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
Timo Petmanson
Estnltk
Commits
24c95a66
Commit
24c95a66
authored
Sep 17, 2015
by
Timo P
Browse files
More WHL files
parent
2382bf8d
Changes
4
Hide whitespace changes
Inline
Side-by-side
dist/estnltk-1.3-cp27-none-win32.whl
0 → 100644
View file @
24c95a66
File added
dist/estnltk-1.3-cp27-none-win_amd64.whl
0 → 100644
View file @
24c95a66
File added
dist/estnltk-1.3-cp34-none-win32.whl
View file @
24c95a66
No preview for this file type
estnltk/wordnet/data/scripts/lit_pos_sense_synidx_parser.py
deleted
100644 → 0
View file @
2382bf8d
import
re
import
subprocess
from
sys
import
argv
,
exit
if
len
(
argv
)
<
2
:
print
(
"Usage: python lit-pos-synidx_parser.py wordnet_file"
)
exit
()
OUTPUT
=
"../sense.txt"
synset_idx_regexp
=
re
.
compile
(
"0\s+@(\d+)@\s+WORD_MEANING"
)
pos_regexp
=
re
.
compile
(
"\s+1\s+PART_OF_SPEECH\s+
\"
(.+)
\"
"
)
literal_regexp
=
re
.
compile
(
"\s+2\s+LITERAL\s+
\"
(.+)
\"
"
)
sense_regexp
=
re
.
compile
(
"\s+3\s+SENSE\s+(\d+)"
)
with
open
(
argv
[
1
],
'r'
)
as
fin
,
open
(
OUTPUT
,
'w'
)
as
fout
:
for
line
in
fin
:
result
=
synset_idx_regexp
.
match
(
line
)
if
result
!=
None
:
synset_idx
=
result
.
group
(
1
)
continue
result
=
pos_regexp
.
match
(
line
)
if
result
!=
None
:
pos
=
result
.
group
(
1
)
continue
result
=
literal_regexp
.
match
(
line
)
if
result
!=
None
:
literal
=
result
.
group
(
1
)
continue
result
=
sense_regexp
.
match
(
line
)
if
result
!=
None
:
sense
=
"%02d"
%
int
(
result
.
group
(
1
))
fout
.
write
(
"%s.%s.%s:%s
\n
"
%
(
literal
,
pos
,
sense
,
synset_idx
))
subprocess
.
Popen
([
'sort'
,
'-o'
,
OUTPUT
,
OUTPUT
]).
wait
()
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