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,7 +6,6 @@ | ||
6 | 6 | ||
7 | #LAViD - Laboratório de Aplicações de Vídeo Digital | 7 | #LAViD - Laboratório de Aplicações de Vídeo Digital |
8 | 8 | ||
9 | -import platform | ||
10 | import re | 9 | import re |
11 | import xml.etree.ElementTree as ET | 10 | import xml.etree.ElementTree as ET |
12 | from os.path import expanduser | 11 | from os.path import expanduser |
@@ -42,8 +41,6 @@ class AplicaRegras(object): | @@ -42,8 +41,6 @@ class AplicaRegras(object): | ||
42 | if "TRANSLATE_DATA" in environ: | 41 | if "TRANSLATE_DATA" in environ: |
43 | arq_regras = path.join(environ.get("TRANSLATE_DATA"), "regras.xml") | 42 | arq_regras = path.join(environ.get("TRANSLATE_DATA"), "regras.xml") |
44 | return ET.parse(arq_regras).getroot() | 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 | return ET.parse(expanduser("~")+'/vlibras-translate/data/regras.xml').getroot() | 44 | return ET.parse(expanduser("~")+'/vlibras-translate/data/regras.xml').getroot() |
48 | 45 | ||
49 | # Aplica regras morfológicas apartir do arquivo regras.xml | 46 | # Aplica regras morfológicas apartir do arquivo regras.xml |
src/LerDicionarios.py
@@ -8,7 +8,6 @@ | @@ -8,7 +8,6 @@ | ||
8 | 8 | ||
9 | import os | 9 | import os |
10 | import csv | 10 | import csv |
11 | -import platform | ||
12 | 11 | ||
13 | class Singleton(object): | 12 | class Singleton(object): |
14 | ''' Permite a criação de apenas uma instância da classe | 13 | ''' Permite a criação de apenas uma instância da classe |
@@ -44,8 +43,6 @@ class LerDicionarios(Singleton): | @@ -44,8 +43,6 @@ class LerDicionarios(Singleton): | ||
44 | ''' | 43 | ''' |
45 | if "TRANSLATE_DATA" in os.environ: | 44 | if "TRANSLATE_DATA" in os.environ: |
46 | return os.environ.get("TRANSLATE_DATA") | 45 | return os.environ.get("TRANSLATE_DATA") |
47 | - elif platform.system() == 'Windows': | ||
48 | - return os.environ.get("HOMEDRIVE") + "\\vlibras-libs\\vlibras-translate\data\\" | ||
49 | return os.path.expanduser("~") + "/vlibras-translate/data" | 46 | return os.path.expanduser("~") + "/vlibras-translate/data" |
50 | 47 | ||
51 | def carregar_dicionarios(self): | 48 | def carregar_dicionarios(self): |
src/alexp.py
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | 27 | ||
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. | 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 | from os.path import expanduser | 31 | from os.path import expanduser |
32 | from os import environ, path | 32 | from os import environ, path |
33 | from Aelius.Extras import carrega | 33 | from Aelius.Extras import carrega |
@@ -100,8 +100,6 @@ def encontraArquivo(): | @@ -100,8 +100,6 @@ def encontraArquivo(): | ||
100 | """ | 100 | """ |
101 | if "TRANSLATE_DATA" in environ: | 101 | if "TRANSLATE_DATA" in environ: |
102 | return path.join(environ.get("TRANSLATE_DATA"), "cfg.syn.nltk") | 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 | return expanduser("~") + "/vlibras-translate/data/cfg.syn.nltk" | 103 | return expanduser("~") + "/vlibras-translate/data/cfg.syn.nltk" |
106 | 104 | ||
107 | def extraiSintaxe(): | 105 | def extraiSintaxe(): |