Commit a7e823d49f42d83783be9e45b233687f2d2026a0
1 parent
3befb7a3
Exists in
master
and in
1 other branch
Corrige path do arquivo de regras e adiciona script de instalação para linux
Showing
2 changed files
with
50 additions
and
2 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +#Instalador do Tradutor Aelius | |
| 4 | + | |
| 5 | +mkdir ~/vlibras-libs | |
| 6 | +cd ~/vlibras-libs | |
| 7 | + | |
| 8 | +mkdir aelius | |
| 9 | +cd aelius | |
| 10 | + | |
| 11 | +wget 150.165.204.30:8080/translate/linux/aelius-install.tar.gz | |
| 12 | + | |
| 13 | +echo -e "\n# Extraindo...\n" | |
| 14 | +tar -xf aelius-install.tar.gz -C . | |
| 15 | + | |
| 16 | +echo -e "# Instalando dependências...\n" | |
| 17 | +sudo apt-get install -y python-dev python-setuptools python-yaml python-numpy python-matplotlib | |
| 18 | + | |
| 19 | +cd nltk-3.0.0/ | |
| 20 | + | |
| 21 | +sudo python setup.py install | |
| 22 | + | |
| 23 | +echo -e "\n# Finalizando...\n" | |
| 24 | + | |
| 25 | +# path to Aelius Data | |
| 26 | +echo -e "\nAELIUS_DATA=\"$HOME/vlibras-libs/aelius/aelius_data\"" >> ~/.bashrc | |
| 27 | +echo -e "export AELIUS_DATA" >> ~/.bashrc | |
| 28 | + | |
| 29 | +# path to NLTK Data | |
| 30 | +echo -e "\nNLTK_DATA=\"$HOME/vlibras-libs/aelius/nltk_data\"" >> ~/.bashrc | |
| 31 | +echo -e "export NLTK_DATA" >> ~/.bashrc | |
| 32 | + | |
| 33 | +# path to Aelius and Translate package (new version) | |
| 34 | +echo -e "\nPYTHONPATH=\"${PYTHONPATH}:$HOME/vlibras-libs/aelius:$HOME/vlibras-translate/src\"" >> ~/.bashrc | |
| 35 | +echo -e "export PYTHONPATH\n" >> ~/.bashrc | |
| 36 | + | |
| 37 | +cd .. | |
| 38 | + | |
| 39 | +sudo mv usr-local-bin.tar.gz /usr/local/bin/ | |
| 40 | + | |
| 41 | +cd /usr/local/bin/ | |
| 42 | + | |
| 43 | +sudo tar -xf usr-local-bin.tar.gz | |
| 44 | +sudo rm usr-local-bin.tar.gz | |
| 45 | + | |
| 46 | +rm ~/vlibras-libs/aelius/aelius-install.tar.gz | |
| 47 | + | |
| 48 | +echo -e "### Instalação finalizada! \n## Execute o seguinte comando para concluir:\n\n$ source ~/.bashrc\n" | ... | ... |
src/AplicadorRegras.py
| ... | ... | @@ -4,13 +4,13 @@ |
| 4 | 4 | #Autor: Erickson Silva <erickson.silva@lavid.ufpb.br> <ericksonsilva@live.com> |
| 5 | 5 | |
| 6 | 6 | import xml.etree.ElementTree as ET |
| 7 | -import os | |
| 7 | +from os.path import expanduser | |
| 8 | 8 | |
| 9 | 9 | class AplicadorRegras(object): |
| 10 | 10 | |
| 11 | 11 | # inicializacao das variaves |
| 12 | 12 | def __init__(self): |
| 13 | - self.__tree = ET.parse('vlibras_user/vlibras-core/data/regras.xml') | |
| 13 | + self.__tree = ET.parse(expanduser("~")+'/vlibras-translate/data/regras.xml') | |
| 14 | 14 | self.__root = self.__tree.getroot() |
| 15 | 15 | self.__tAux = [] |
| 16 | 16 | self.__dAux = {} | ... | ... |