Rev 54 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
56 | szabot | 1 | #!/usr/bin/python |
2 | # -*- coding: utf-8 -*- |
||
3 | |||
4 | import re |
||
5 | import dbconnector |
||
6 | |||
7 | infixes0 = ur"(?P<in0>(?:awn|eyk|us|äp)?)" |
||
8 | infixes1 = ur"(?P<in1>(?:ìyev|iyev|ìmìy|arm|asy|ilv|ìmv|imv|ìrm|irv|ìsy|aly|ary|ìly|ìry|ìlm|alm|am|ay|er|ìm|iv|ìy|ol)?)" |
||
9 | infixes2 = ur"(?P<in2>(?:äng|ats|eiy|ei|uy)?)" |
||
10 | #prefixesn = ur"(?P<pre>(?:(?:fì|tsa)?(?:me|pxe|ay|fra)?|(?:fay)?|(?:tsay)?)(?:fne)?(?:tì|sä)?" |
||
11 | |||
12 | def parseword(wordin): |
||
13 | wordfound = [0, u"", u"", u""] |
||
14 | wordre = None |
||
15 | ret = [wordfound, u"", u"", u""] |
||
16 | for word in dbconnector.getnavilist(): |
||
60 | szabot | 17 | wordre = u" ".join(ur"(?:.*?)" + x + ur"(?:.*?)" for x in word[2].split(u" ")).replace(u"<0><1>", infixes0 + infixes1).replace(u"<2>",infixes2) |
56 | szabot | 18 | rem = re.match(wordre,wordin) |
19 | if rem: |
||
20 | wordfound = word |
||
21 | ret = [wordfound, rem.group("in0"), rem.group("in1"), rem.group("in2")] |
||
22 | break |
||
23 | return ret |