-
Notifications
You must be signed in to change notification settings - Fork 0
/
LexiconBuilder
executable file
·63 lines (39 loc) · 1.12 KB
/
LexiconBuilder
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
#!/bin/bash
#shopt -s extglob
###################################################################
# Script para construir um lexicon a partir dum texto
# - - 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"
############################
# Functions
############################
help()
{
echo "Syntax:
./LexiconBuilder <MAX> [FILE]
cat FILE |./LexiconBuilder <MAX>
file=path of the file input
MAX=size of the lexicon
"
exit
}
# Parámetros obrigatorios
[ $# -lt 1 ] && help
MAX=$1
# Parametros optativos
[ "$2" != "" ] && FILE=$2
#echo "parametros:: $FILE"
if [ "$FILE" == "" ]; then
$PROGS/tokens.perl |grep -v "[0-9]" |$PROGS/limpar.x |grep -v "^[A-Z]" |$PROGS/sorting.perl $MAX
fi
if [ "$FILE" != "" ]; then
cat $FILE |$PROGS/tokens.perl |grep -v "[0-9]" |$PROGS/limpar.x |grep -v "^[A-Z]" |$PROGS/sorting.perl $MAX
fi