43,7 → 43,7 |
.replace(ur"p̚",ur"p ").replace(ur"t̚",ur"t ").replace(ur"'̚",ur"' ") \ |
.replace(u"\\",ur"").replace(ur"(",ur"").replace(ur")",ur"") \ |
.replace(ur"[",ur"").replace(ur"]",ur"").replace(ur" "," ") \ |
.strip() |
.replace(ur"$cdot$",ur"[^ ]").strip() |
s = re.sub(ur" or.*","",s) |
s = re.sub(ur"z(.*)engk(.*)e",ur"z\1enk\2e",s) |
s = re.sub(ur"t(.*)ì(m|n)\ ",ur"t\1ìng ",s) |
52,13 → 52,18 |
class TestDB(tornado.web.RequestHandler): |
def get(self): |
text = u"" |
current = u"" |
db = tornado.database.Connection("127.0.0.1", "navi", user="navi", password="navi") |
for thing in db.query(""" |
SELECT *, CHAR_LENGTH(navi) AS NL |
FROM `metaWords` |
WHERE partOfSpeech IN ('v.', 'vin.', 'vtr,') |
SELECT *, CHAR_LENGTH(navi) AS NL |
FROM `metaWords` |
ORDER BY NL DESC"""): |
text += unicode(thing["navi"]) + u" - " + clear(unicode(thing["ipa"])) + u" - " + unicode(unicode(thing["navi"]) == clear(unicode(thing["ipa"])).replace(ur"$cdot$",ur"")) + u"<br />" |
if thing["partOfSpeech"] in (u"v.", u"vin.", u"vtr."): |
current = clear(unicode(thing["ipa"])) |
else: |
current = unicode(thing["navi"]) |
current = u" ".join([ur"[^ ]*"+x+ur"[^ ]*" for x in current.split(u" ")]) |
text += current + u"<br />" |
self.write(text) |
|
application = tornado.web.Application([ |