Subversion Repositories navi

Compare Revisions

Ignore whitespace Rev 122 → Rev 133

/tsimapiak/parsenum.py
12,6 → 12,15
u"pukap",
u"kinä"]
 
numord = [u"kewve",
u"'awve",
u"muve",
u"pxeyve",
u"tsìve",
u"mrrve",
u"puve",
u"kive"]
 
rem = [u"aw",
u"mun",
u"pey",
20,6 → 29,14
u"fu",
u"hin"]
 
remord = [u"awve",
u"muve",
u"peyve",
u"sìve",
u"mrrve",
u"fuve",
u"hive"]
 
base = [u"",
u"me",
u"pxe",
30,12 → 47,12
 
 
numre = \
u"^(a?)(?:(" + "|".join(base) + u")zazam??)?" + \
u"(?:(" + "|".join(base) + u")vozam??)?" + \
u"(?:(" + "|".join(base) + u")zam??)?" + \
u"(?:(" + "|".join(base) + u")vo(?:l(?=a|))?)?" + \
u"((?:" + "|".join(rem) + u")|" + \
u"(?:" + "|".join(num) + u"))?((?:ve)?)(a?)$"
u"^(a?)(?:(?:(" + "|".join(base) + u")zaza(?=m)(?:ve(?=$))?)?" + \
u"(?:(" + "|".join(base) + u")voza(?=m)(?:ve(?=$))?)?" + \
u"(?:(" + "|".join(base) + u")za(?=m)(?:ve(?=$))?)?" + \
u"(?:(" + "|".join(base) + u")(?:vol|vo(?=a|$))(?:ve(?=$))?)?" + \
u"(?:" + "|".join(remord + rem) + u"))|" + \
u"(?:" + "|".join(numord + num) + u")?(a?)$"
numre = re.compile(numre)
 
def parse(numin):
/webapp/static/favicon.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/webapp/static/favicon.ico
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: webapp/templates/parse.html
===================================================================
--- webapp/templates/parse.html (revision 122)
+++ webapp/templates/parse.html (revision 133)
@@ -1,9 +1,9 @@
{% extends "base.html" %}
-{% block title %}Word parser{% end %}
+{% block title %}Sentence parser{% end %}
{% block body %}
-Na'vi word:
+Na'vi sentence:
@@ -36,8 +36,8 @@
{% end %}
{% end %} +

This program uses Eana Eltu for the list of words and infix positions (but nothing else), created by Tuiq and Taronyu. Thanks also go to the rest of the Learn Na'vi community!

-

This program uses Eana Eltu for the list of words and infix positions (but nothing else), created by Tuiq and Taronyu. Thanks also go to the rest of the Learn Na'vi community!

{% end %}
/webapp/templates/base.html
1,6 → 1,7
<html>
<head>
<title>Tsim Apiak - {% block title %}Title{% end %}</title>
<link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico" />
<style type="text/css">
body {
background: #145179;
/webapp/templates/index.html
0,0 → 1,8
{% extends "base.html" %}
 
{% block title %}Home{% end %}
 
{% block body %}
<a href="/number"><b>Number translator</b></a> - this webapp allows you to translate written-out Na'vi numbers into decimal and octal.<br />
<a href="/parse"><b>Parser</b></a> - this webapp can parse Na'vi sentences into the base words, prefixes, infixes and suffixes. It does not currently translate the words, but that will come.
{% end %}
/webapp/main.py
57,6 → 57,10
out = parse.parsesent(word)
self.render("templates/parse.html", last=word, out=out)
 
settings = {
"static_path": os.path.join(os.path.dirname(__file__), "static")
}
 
application = tornado.web.Application([
("/", Index),
("/number", Number),
63,7 → 67,7
("/restart", Restart),
("/testdb", TestDB),
("/parse", Parse)
])
], **settings)
 
if __name__ == "__main__":
http_server = tornado.httpserver.HTTPServer(application)