Commit 9bfc3199299d9dcb703bd8b830a1ff4fd4f2f4a5
1 parent
4881473c
Exists in
master
and in
1 other branch
Remove checagem de SO para carregar paths
Showing
3 changed files
with
1 additions
and
9 deletions
Show diff stats
src/AplicaRegras.py
... | ... | @@ -6,7 +6,6 @@ |
6 | 6 | |
7 | 7 | #LAViD - Laboratório de Aplicações de Vídeo Digital |
8 | 8 | |
9 | -import platform | |
10 | 9 | import re |
11 | 10 | import xml.etree.ElementTree as ET |
12 | 11 | from os.path import expanduser |
... | ... | @@ -42,8 +41,6 @@ class AplicaRegras(object): |
42 | 41 | if "TRANSLATE_DATA" in environ: |
43 | 42 | arq_regras = path.join(environ.get("TRANSLATE_DATA"), "regras.xml") |
44 | 43 | return ET.parse(arq_regras).getroot() |
45 | - elif platform.system() == "Windows": | |
46 | - return ET.parse(environ.get("HOMEDRIVE")+'\\vlibras-libs\\vlibras-translate\\data\\regras.xml').getroot() | |
47 | 44 | return ET.parse(expanduser("~")+'/vlibras-translate/data/regras.xml').getroot() |
48 | 45 | |
49 | 46 | # Aplica regras morfológicas apartir do arquivo regras.xml | ... | ... |
src/LerDicionarios.py
... | ... | @@ -8,7 +8,6 @@ |
8 | 8 | |
9 | 9 | import os |
10 | 10 | import csv |
11 | -import platform | |
12 | 11 | |
13 | 12 | class Singleton(object): |
14 | 13 | ''' Permite a criação de apenas uma instância da classe |
... | ... | @@ -44,8 +43,6 @@ class LerDicionarios(Singleton): |
44 | 43 | ''' |
45 | 44 | if "TRANSLATE_DATA" in os.environ: |
46 | 45 | return os.environ.get("TRANSLATE_DATA") |
47 | - elif platform.system() == 'Windows': | |
48 | - return os.environ.get("HOMEDRIVE") + "\\vlibras-libs\\vlibras-translate\data\\" | |
49 | 46 | return os.path.expanduser("~") + "/vlibras-translate/data" |
50 | 47 | |
51 | 48 | def carregar_dicionarios(self): | ... | ... |
src/alexp.py
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | |
28 | 28 | """Este módulo contém funções que permitem utilizar o Aelius para etiquetar uma sentença, construindo entradas lexicais com base nas etiquetas atribuídas às palavras da sentença. Essas entradas lexicais são integradas em uma gramática CFG dada, que é transformada em um parser, utilizado para gerar uma árvore de estrutura sintagmática da sentença. |
29 | 29 | """ |
30 | -import re,nltk,platform, time, random | |
30 | +import re,nltk, time, random | |
31 | 31 | from os.path import expanduser |
32 | 32 | from os import environ, path |
33 | 33 | from Aelius.Extras import carrega |
... | ... | @@ -100,8 +100,6 @@ def encontraArquivo(): |
100 | 100 | """ |
101 | 101 | if "TRANSLATE_DATA" in environ: |
102 | 102 | return path.join(environ.get("TRANSLATE_DATA"), "cfg.syn.nltk") |
103 | - elif platform.system() == 'Windows': | |
104 | - return environ.get("HOMEDRIVE") + "\\vlibras-libs\\vlibras-translate\data\cfg.syn.nltk" | |
105 | 103 | return expanduser("~") + "/vlibras-translate/data/cfg.syn.nltk" |
106 | 104 | |
107 | 105 | def extraiSintaxe(): | ... | ... |