Commit 7fa9dbbeade9ce040f047db4da1e5a49b36b5812

Authored by Erickson Silva
1 parent 4528585e
Exists in master and in 1 other branch devel

Corrige AplicaSinonimos (tipo de entrada única })

install/linux/aelius_install.sh
... ... @@ -1,57 +0,0 @@
1   -#!/bin/bash
2   -
3   -read -r -p "Deseja fazer o download das dependências? [Y/n] " response
4   - response=${response,,} # tolower
5   - if [[ $response =~ ^(yes|y| ) ]]; then
6   - mkdir ~/vlibras-libs
7   - cd ~/vlibras-libs
8   -
9   - mkdir aelius
10   - cd aelius
11   -
12   - wget 150.165.204.30:8080/translate/linux/aelius-install.tar.gz
13   -
14   - read -r -p "Deseja instalar as dependências? [Y/n] " response
15   - response=${response,,} # tolower
16   - if [[ $response =~ ^(yes|y| ) ]]; then
17   - echo -e "\n# Extraindo...\n"
18   - tar -xf aelius-install.tar.gz -C .
19   -
20   - echo -e "# Instalando dependências...\n"
21   - sudo apt-get install -y python-dev python-setuptools python-yaml python-numpy python-matplotlib
22   - sudo pip install nltk nltk_tgrep
23   -
24   - fi
25   -
26   - read -r -p "Deseja limpar os arquivos temporários? [Y/n] " response
27   - response=${response,,} # tolower
28   - if [[ $response =~ ^(yes|y| ) ]]; then
29   - rm ~/vlibras-libs/aelius/aelius-install.tar.gz
30   - fi
31   -
32   - fi
33   -
34   -
35   -read -r -p "Deseja criar as variáveis de ambiente? [Y/n] " response
36   - response=${response,,} # tolower
37   - if [[ $response =~ ^(yes|y| ) ]]; then
38   - # path to Hunpos Tag
39   - echo -e "\nHUNPOS_TAGGER=\"$HOME/vlibras-libs/aelius/bin/hunpos-tag\"" >> ~/.bashrc
40   - echo -e "export HUNPOS_TAGGER" >> ~/.bashrc
41   -
42   - # path to Aelius Data
43   - echo -e "\nAELIUS_DATA=\"$HOME/vlibras-libs/aelius/aelius_data\"" >> ~/.bashrc
44   - echo -e "export AELIUS_DATA" >> ~/.bashrc
45   -
46   - # path to NLTK Data
47   - echo -e "\nNLTK_DATA=\"$HOME/vlibras-libs/aelius/nltk_data\"" >> ~/.bashrc
48   - echo -e "export NLTK_DATA" >> ~/.bashrc
49   -
50   - # path to Aelius and Translate package (new version)
51   - echo -e "\nPYTHONPATH=\"${PYTHONPATH}:$HOME/vlibras-libs/aelius:$HOME/vlibras-translate/src\"" >> ~/.bashrc
52   - echo -e "export PYTHONPATH\n" >> ~/.bashrc
53   -
54   - echo -e "\n## Execute o seguinte comando para concluir:\n\n$ source ~/.bashrc\n"
55   - fi
56   -
57   -echo -e "### Instalação finalizada!"
58 0 \ No newline at end of file
install/linux/translate_install.sh 0 → 100755
... ... @@ -0,0 +1,57 @@
  1 +#!/bin/bash
  2 +
  3 +read -r -p "Deseja fazer o download das dependências? [Y/n] " response
  4 + response=${response,,} # tolower
  5 + if [[ $response =~ ^(yes|y| ) ]]; then
  6 + mkdir ~/vlibras-libs
  7 + cd ~/vlibras-libs
  8 +
  9 + mkdir aelius
  10 + cd aelius
  11 +
  12 + wget 150.165.204.30:8080/translate/linux/aelius-install.tar.gz
  13 +
  14 + read -r -p "Deseja instalar as dependências? [Y/n] " response
  15 + response=${response,,} # tolower
  16 + if [[ $response =~ ^(yes|y| ) ]]; then
  17 + echo -e "\n# Extraindo...\n"
  18 + tar -xf aelius-install.tar.gz -C .
  19 +
  20 + echo -e "# Instalando dependências...\n"
  21 + sudo apt-get install -y python-dev python-setuptools python-yaml python-numpy python-matplotlib
  22 + sudo pip install nltk nltk_tgrep
  23 +
  24 + fi
  25 +
  26 + read -r -p "Deseja limpar os arquivos temporários? [Y/n] " response
  27 + response=${response,,} # tolower
  28 + if [[ $response =~ ^(yes|y| ) ]]; then
  29 + rm ~/vlibras-libs/aelius/aelius-install.tar.gz
  30 + fi
  31 +
  32 + fi
  33 +
  34 +
  35 +read -r -p "Deseja criar as variáveis de ambiente? [Y/n] " response
  36 + response=${response,,} # tolower
  37 + if [[ $response =~ ^(yes|y| ) ]]; then
  38 + # path to Hunpos Tag
  39 + echo -e "\nHUNPOS_TAGGER=\"$HOME/vlibras-libs/aelius/bin/hunpos-tag\"" >> ~/.bashrc
  40 + echo -e "export HUNPOS_TAGGER" >> ~/.bashrc
  41 +
  42 + # path to Aelius Data
  43 + echo -e "\nAELIUS_DATA=\"$HOME/vlibras-libs/aelius/aelius_data\"" >> ~/.bashrc
  44 + echo -e "export AELIUS_DATA" >> ~/.bashrc
  45 +
  46 + # path to NLTK Data
  47 + echo -e "\nNLTK_DATA=\"$HOME/vlibras-libs/aelius/nltk_data\"" >> ~/.bashrc
  48 + echo -e "export NLTK_DATA" >> ~/.bashrc
  49 +
  50 + # path to Aelius and Translate package (new version)
  51 + echo -e "\nPYTHONPATH=\"${PYTHONPATH}:$HOME/vlibras-libs/aelius:$HOME/vlibras-translate/src\"" >> ~/.bashrc
  52 + echo -e "export PYTHONPATH\n" >> ~/.bashrc
  53 +
  54 + echo -e "\n## Execute o seguinte comando para concluir:\n\n$ source ~/.bashrc\n"
  55 + fi
  56 +
  57 +echo -e "### Instalação finalizada!"
0 58 \ No newline at end of file
... ...
src/new/AplicaSinonimos.py
... ... @@ -19,12 +19,8 @@ class AplicaSinonimos(object):
19 19 self.dicionarios = LerDicionarios()
20 20  
21 21 # Itera sobre os tokens obtendo os sinonimos
22   - def aplicar_sinonimos(self, analise):
23   - lista_anotada = analise
  22 + def aplicar_sinonimos(self, lista_anotada):
24 23 lista_corrigida = []
25   - if type(analise) is not list:
26   - lista_anotada = Tree.leaves(analise)
27   -
28 24 for tupla in lista_anotada:
29 25 sinonimo = self.verificar_sinonimo(tupla[0])
30 26 lista_corrigida.append(sinonimo)
... ...