install.sh
2.09 KB
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
#!/bin/bash
read -r -p "Deseja fazer o download das dependências? [Y/n] " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
mkdir ~/vlibras-libs
cd ~/vlibras-libs
mkdir aelius
cd aelius
wget 150.165.204.30:8080/translate/linux/aelius-install.tar.gz
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
wget 150.165.204.30:8080/translate/linux/hunpos/x86_64/hunpos-tag
else
wget 150.165.204.30:8080/translate/linux/hunpos/i386/hunpos-tag
fi
read -r -p "Deseja instalar as dependências? [Y/n] " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
echo -e "\n# Extraindo...\n"
tar -xf aelius-install.tar.gz -C .
mkdir bin
mv hunpos-tag bin/
chmod 777 bin/hunpos-tag
echo -e "# Instalando dependências...\n"
sudo apt-get update
sudo apt-get install -y python-dev python-setuptools python-pip python-yaml python-numpy python-matplotlib
sudo pip install nltk nltk_tgrep --upgrade
fi
read -r -p "Deseja limpar os arquivos temporários? [Y/n] " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
rm ~/vlibras-libs/aelius/aelius-install.tar.gz
fi
fi
read -r -p "Deseja criar as variáveis de ambiente? [Y/n] " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
# path to Hunpos Tag
echo -e "\nHUNPOS_TAGGER=\"$HOME/vlibras-libs/aelius/bin/hunpos-tag\"" >> ~/.bashrc
echo -e "export HUNPOS_TAGGER" >> ~/.bashrc
# path to Aelius Data
echo -e "\nAELIUS_DATA=\"$HOME/vlibras-libs/aelius/aelius_data\"" >> ~/.bashrc
echo -e "export AELIUS_DATA" >> ~/.bashrc
# path to NLTK Data
echo -e "\nNLTK_DATA=\"$HOME/vlibras-libs/aelius/nltk_data\"" >> ~/.bashrc
echo -e "export NLTK_DATA" >> ~/.bashrc
# path to Aelius and Translate package (new version)
echo -e "\nPYTHONPATH=\"${PYTHONPATH}:$HOME/vlibras-libs/aelius:$HOME/vlibras-translate/src\"" >> ~/.bashrc
echo -e "export PYTHONPATH\n" >> ~/.bashrc
echo -e "\n## Execute o seguinte comando para concluir:\n\n$ source ~/.bashrc\n"
fi
echo -e "### Instalação finalizada!"