Subversion Repositories navi

Compare Revisions

Ignore whitespace Rev 3 → Rev 12

/webapp/main.py
9,7 → 9,7
 
import os
 
from navi.parsenum import parse
from tsimapiak.parsenum import parse
 
class Index(tornado.web.RequestHandler):
def get(self):
33,12 → 33,22
def get(self):
os.system("/usr/bin/restartnavi")
 
def clear(s):
return s.replace(u"ɛ",u"e").replace(u".",u"").replace(u"ɾ",u"r") \
.replace(u"ɪ",u"ì").replace(u"ˈ",u"").replace(u"'",u"x") \
.replace(u"ŋ",u"ng").replace(u"j",u"y").replace(u"ʔ",u"'") \
.replace(u"æ",u"ä").replace(u"ˌ",u"").replace(u"\t{ts}",u"ts") \
.replace(ur"$\cdot$",u"")
 
class TestDB(tornado.web.RequestHandler):
def get(self):
text = ""
text = u""
db = tornado.database.Connection("127.0.0.1", "navi", user="navi", password="navi")
for thing in db.query("SELECT * FROM test"):
text = "<br />".join((text, str(thing.id) + " - " + thing.asd))
for thing in db.query("""
SELECT *, CHAR_LENGTH(navi) AS NL
FROM `metaWords`
ORDER BY NL DESC"""):
text += unicode(thing.navi) + u" - " + clear(unicode(thing.ipa)) + unicode(thing.navi == clear(thing.ipa)) + u"<br />"
self.write(text)
 
application = tornado.web.Application([
/webapp/templates/base.html
14,7 → 14,7
text-align: center;
font-size: 52px;
}
h1 {
h2 {
text-align: center;
font-size: 24px;
}