Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neeme Kahusk
Lightewn
Commits
d64b2f13
Commit
d64b2f13
authored
Mar 06, 2015
by
Neeme Kahusk
Browse files
translation tables
parent
9d0e1fdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/visdic.py
View file @
d64b2f13
...
...
@@ -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'
]
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment