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
2de6e7b4
Commit
2de6e7b4
authored
Feb 19, 2015
by
Neeme Kahusk
Browse files
vistnoun lang visdic relations
parent
9e535cf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools/visdic.py
View file @
2de6e7b4
...
...
@@ -62,6 +62,8 @@ POINTER_SYMBOLS = { # (symbol, pos):
'vis'
:
'member_of_topic'
},
(
'-u'
,
'v'
):{
'gloss'
:
'Member of this domain - USAGE'
,
'vis'
:
'member_of_usage'
},
(
'-r'
,
'v'
):{
'gloss'
:
'Member of this domain - REGION'
,
'vis'
:
'member_of_region'
},
# The pointer_symbol s for adjectives are:
...
...
@@ -79,6 +81,9 @@ POINTER_SYMBOLS = { # (symbol, pos):
'vis'
:
'member_of_topic'
},
(
'-u'
,
'a'
):{
'gloss'
:
'Member of this domain - USAGE'
,
'vis'
:
'member_of_usage'
},
(
'-r'
,
'a'
):{
'gloss'
:
'Member of this domain - REGION'
,
'vis'
:
'member_of_region'
},
# The pointer_symbol s for adverbs are:
...
...
@@ -93,16 +98,19 @@ POINTER_SYMBOLS = { # (symbol, pos):
(
'-u'
,
'r'
):{
'gloss'
:
'Member of this domain - USAGE'
,
'vis'
:
'member_of_usage'
},
(
'+'
,
'r'
):{
'gloss'
:
'Derivationally related form'
,
'vis'
:
'derivated_from'
},
# NON-DOCUMENTED
(
'-r'
,
'r'
):{
'gloss'
:
'Member of this domain - REGION'
,
'vis'
:
'member_of_region'
},
}
def
deadj
(
iStr
):
"""Remove part in parentheses (used at adjectives)
"""
if
iStr
.
count
(
'('
):
return
iStr
[
0
:
iStr
.
index
(
'('
)]
elif
iStr
.
count
(
'<'
):
if
iStr
.
count
(
'<'
):
return
iStr
[
0
:
iStr
.
index
(
'<'
)]
elif
iStr
.
count
(
'('
):
return
iStr
[
0
:
iStr
.
index
(
'('
)]
else
:
return
iStr
...
...
tools/vistnoun.sh
View file @
2de6e7b4
#!/bin/bash
# usage: vistnoun.sh <start> <pos>
# usage: vistnoun.sh <start> <pos>
[<lang>]
# ulimit will come from data file
# $1 => start
# $2 => POS
# $3 => lang
i
=
$1
wnpath
=
$HOME
/Wordnet/WordNet-3.0/dict/
# wnpath=$HOME/Wordnet/FinWN/fiwn-2.0/dict
if
[
"
$3
"
==
fin
]
;
then
wnpath
=
$HOME
/Wordnet/FinWN/fiwn-2.0/dict
prefix
=
"fin-20"
else
wnpath
=
$HOME
/Wordnet/WordNet-3.0/dict/
prefix
=
"pwn-30"
fi
ulimit
=
$[
$(
cat
$wnpath
/data.
$2
|egrep
-v
'^ '
|wc
-l
)
-1
]
echo
$ulimit
...
...
@@ -17,6 +24,6 @@ do
then
j
=
$[$ulimit
+1]
fi
echo
$i
$j
python visdic.py
-p
$2
-r
'pwn-30'
-s
$i
-e
$j
python visdic.py
-p
$2
-r
$prefix
-s
$i
-e
$j
i
=
$[$i
+200]
done
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