3 mainClass
="ProcessDics"
4 # Minimum and maximum memory for JVM
7 library
='lib/cross-dics.jar'
8 java_options
="-Xms${defaultMinMem}m -Xmx${defaultMaxMem}m -cp ${library} $mainClass"
9 #java_options="-Xms${defaultMinMem}m -Xmx${defaultMaxMem}m -cp $CLASSPATH $mainClass"
16 crossmodel
="schemas/cross-model-test.xml"
17 if [ $nparams -ge 7 ] && [ $nparams -le 9 ]; then
22 echo "cross model: $crossmodel"
23 java
${java_options} $task -bilAB $3 $4 -bilBC $5 $6 -monA $2 -monC $7 -cross-model $crossmodel $9 2> $task.err
25 echo "Usage: dictools cross <monA> <-r|-n> <bilAB> <-r|-n> <bilBC> <monC> crossmodel"
26 echo "More information in http://xixona.dlsi.ua.es/wiki/index.php/Crossdics";
36 echo "Reading '$3'..."
37 java
${java_options} $task $2 $3 $4 2> format.err
38 echo "Formatted dictonary: $4"
39 echo "Log file in 'format.err'"
41 echo "Usage: dictools format <-mon|-bil> <dic> <out>"
48 function merge-morph
() {
51 echo "Morphological 1: $2"
52 echo "Morphological 2: $3"
53 java
${java_options} $task -monA1 $2 -monA2 $3 -out $4 $5
54 echo "Merged dictionary: $4"
56 echo "Usage: dictools merge-morph <monA1> <monA2> <merged>"
63 function merge-bil
() {
64 if [ $nparams -eq 6 ]; then
65 echo "Bilingual 1: $3"
67 echo "Bilingual 2: $5"
69 java
${java_options} $task -bilAB1 $2 $3 -bilAB2 $4 $5 -out $6
72 echo "Usage: dictools merge-bil <-n|-r> <bilAB1> <-n|-r> <bilAB2> <merged>"
79 function reverse-bil
() {
82 echo "Reading '$2'..."
83 java
${java_options} reverse
$2 $3 2> reverse-bil.err
85 echo "Usage: dictools reverse-bil <dic> <out>"
95 echo "Reading '$4' ($2)"
96 java
${java_options} $task $2 $3 $4 $5
99 echo "Usage: dictools sort <-bil|-mon> <-xinclude|-same-file> <dic.dix> <out.dix>"
106 function process-xincludes
() {
109 java
${java_options} gather
$2 $3
110 echo "Dictionary: $3"
112 echo "Usage: dictools process-xincludes <dic> <out.dix>"
119 function get-bil-omegawiki
() {
122 java
${java_options} $task $2 $3 $4
123 echo "Dictionary: $4"
125 echo "Usage: dictools get-bil-omegawiki <source-lang> <target-lang> <dic-out>"
132 function format-1line
() {
135 java
${java_options} $task $2 $3
136 echo "Dictionary: $3"
138 echo "Usage: dictools format-1line <dic> <dic-out>"
145 function dic-reader
() {
146 if [ $nparams -ge 3 ]
148 java
${java_options} $task $2 $3 $4
150 echo "Usage: dictools dic-reader <action> [-url] <dic>"
151 echo "where <action> can be:"
152 echo " list-paradigms: list of paradigms";
153 echo " list-lemmas: list of lemmas";
154 echo " list-definitions: list of <sdef> elemenst";
155 echo " list-pairs: list of pairs (for bilingual dictionaries";
157 echo "More information: http://xixona.dlsi.ua.es/wiki/index.php/Dictionary_reader";
165 function equiv-paradigms
() {
166 if [ $nparams -ge 2 ]
168 java
${java_options} $task $2 $3
170 echo "Usage: dictools equiv-paradigms <dic> <out>"
178 function show_help
() {
179 echo "Usage: dictools [task] ..."
181 echo " cross: crosses a set of dictionaries"
182 echo " dic-reader: reads elements from a dictionary"
183 echo " equiv-paradigms: finds equivalent paradigms and updates references"
184 echo " format: formats a dictionary"
185 echo " merge-bil: merges two bilingual dictionaries"
186 echo " merge-morph: merges two morphological dictionaries"
187 echo " process-xincludes: processes and expands all xincludes in the dictionary"
188 echo " reverse-bil: reverses a bilingual dictionary"
189 echo " sort: sorts (and groups by category) a dictionary"
191 echo "More info: http://xixona.dlsi.ua.es/wiki/index.php/Crossdics"
199 if [ "$#" == 0 ]; then