Commit d64b2f13 authored by Neeme Kahusk's avatar Neeme Kahusk
Browse files

translation tables

parent 9d0e1fdc
......@@ -29,8 +29,22 @@ TABLE_FILENAMES = {'adj':'fin2pwn-adj.txt','adv':'fin2pwn-adv.txt',
def normalisePOS(i):
"""get POS in whatever form and return on one of
adj, adv, noun, verb
http://wordnet.princeton.edu/wordnet/man/wndb.5WN.html
One character code indicating the synset type:
n NOUN
v VERB
a ADJECTIVE
s ADJECTIVE SATELLITE
r ADVERB
"""
pass
oDict = {'n':'noun','v':'verb',
'a':'adj','s':'adj',
'r':'adv'
}
return oDict[i]
POINTER_SYMBOLS = { # (symbol, pos):
('!','n'):{'gloss':'Antonym','vis':'antonym'},
......@@ -536,14 +550,14 @@ def make_visdic_xml(dataDict,xml,translation=None):
ilrText = '{}-{}-{}'.format(ID_PREFIX,
translate(j['synset_offset'],
tabledict=TR_TABLES,
pos=j['pos']),
pos=normalisePOS(j['pos'])),
j['pos']
)
except ValueError:
ilrText = '%s-%s-%s' % (ID_PREFIX,
translate(j['synset_offset'],
tabledict=TR_TABLES,
pos=j['pos']),
pos=normalisePOS(j['pos'])),
j['pos']
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment