-
Notifications
You must be signed in to change notification settings - Fork 0
/
quelingua
executable file
·80 lines (55 loc) · 1.69 KB
/
quelingua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
#shopt -s extglob
###################################################################
# Script para facilitar o uso do identificador QueLingua
# - - A variábel QUELINGUA_DIR estabelece o PATH dos programas.
#
# Grupo ProlNat 2010
###################################################################
############################
# Config
############################
QUELINGUA_DIR="./QueLingua"
PROGS=$QUELINGUA_DIR"/scripts"
LEXICONS=$QUELINGUA_DIR"/lexicons"
LEXICONS_VAR=$QUELINGUA_DIR"/lexicons_var"
MORPHO=$QUELINGUA_DIR"/morpho"
############################
# Functions
############################
help()
{
echo "Syntax: cat FILE |./quelingua [OPT]
FILE = path of the input file
OPT = options
Options:
-var = identification of varieties (by default: standard languages)
-help (--h) = help
"
exit
}
# Parámetros obrigatorios
#[ $# -lt 1 ] && help
#FILE=$1
# Parametros optativos
[ "$1" != "" ] && OPT=$1
if [ "$OPT" == "--h" ] || [ "$OPT" == "-help" ] ; then
help
fi
if [ "$OPT" == "-var" ] ; then
###building a temporal lexicon:
for i in $LEXICONS_VAR/* ; do cat $i |awk -v LANG=`basename $i |sed "s/\.lx//"` '{print $0"\t"LANG}' >> __tmp; done
else
###building a temporal lexicon:
for i in $LEXICONS/* ; do cat $i |awk -v LANG=`basename $i |sed "s/\.lx//"` '{print $0"\t"LANG}' >> __tmp; done
fi
###defining morpho files (only suffix):
SUFFIX=$MORPHO"/suffix.txt"
#echo "parametros:: $FILE"
if [ "$FILE" == "" ]; then
$PROGS/tokens.perl | $PROGS/reconhecedorLinguasTodas_morpho.perl __tmp $SUFFIX
fi
if [ "$FILE" != "" ]; then
cat $FILE |$PROGS/tokens.perl | $PROGS/reconhecedorLinguasTodas_morpho.perl __tmp $SUFFIX
fi
rm __tmp