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
63b88136
Commit
63b88136
authored
Mar 06, 2015
by
Neeme Kahusk
Browse files
translations
parent
d64b2f13
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/visdic.py
View file @
63b88136
...
...
@@ -3,8 +3,9 @@
"""
__author__
=
'Neeme Kahusk <neeme.kahusk@ut.ee>'
__version__
=
'0.9'
__date__
=
'K veebr 18 14:18:29 EET 2015'
__version__
=
'0.10'
__date__
=
'R märts 6 13:04:12 EET 2015'
__maintainer__
=
"Neeme Kahusk"
...
...
@@ -22,6 +23,8 @@ from lxml import etree
from
settings
import
PWN_PATH
from
settings
import
FIN_PATH
# print 'PWN_PATH,PWN_PATH',PWN_PATH
TABLE_FILENAMES
=
{
'adj'
:
'fin2pwn-adj.txt'
,
'adv'
:
'fin2pwn-adv.txt'
,
'noun'
:
'fin2pwn-noun.txt'
,
'verb'
:
'fin2pwn-verb.txt'
}
# TODO: other marks of POS e.g. normalisePOS
...
...
@@ -593,6 +596,9 @@ def oldermain():
"""For python ver. 2.6.6, no argparse but optparse
"""
from
settings
import
PWN_PATH
from
settings
import
FIN_PATH
from
optparse
import
OptionParser
parser
=
OptionParser
()
parser
.
add_option
(
'-s'
,
'--start'
,
dest
=
'start'
,
...
...
@@ -617,16 +623,18 @@ def oldermain():
b
=
WN
()
# print 'PWN_PATH',PWN_PATH
if
options
.
lang
and
options
.
lang
==
'fin'
:
PWN_PATH
=
FIN_PATH
transD
=
None
#
if options.trans:
#
f = open(options.trans, 'r')
#
transD = map(lambda x: x.strip().split(':'),f.readlines())
#
f.close()
#
# print transD
if
options
.
trans
:
f
=
open
(
options
.
trans
,
'r'
)
transD
=
map
(
lambda
x
:
x
.
strip
().
split
(
':'
),
f
.
readlines
())
f
.
close
()
# print transD
oList
=
wnparser
(
PWN_PATH
,
options
.
pos
,
int
(
options
.
start
),
int
(
options
.
end
)
...
...
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