Commit 98c8a538012ad6bd9ebc8384ddde66debabc8f34

Authored by Erickson Silva
1 parent 75ecc2bb
Exists in master

Adiciona VLIBRAS e LIBRAS como excessao do plural e adiciona get HOMEDRIVE pra Windows

src/AplicadorRegras.py
... ... @@ -5,6 +5,7 @@
5 5  
6 6 import xml.etree.ElementTree as ET
7 7 from os.path import expanduser
  8 +from os import environ
8 9 import platform
9 10  
10 11 class AplicadorRegras(object):
... ... @@ -14,7 +15,7 @@ class AplicadorRegras(object):
14 15  
15 16 so = platform.system()
16 17 if so == 'Windows':
17   - self.__tree = ET.parse(expanduser("~")+'\vlibras-translate\data\regras.xml')
  18 + self.__tree = ET.parse(environ.get("HOMEDRIVE")+'\vlibras-translate\data\regras.xml')
18 19 else:
19 20 self.__tree = ET.parse(expanduser("~")+'/vlibras-translate/data/regras.xml')
20 21  
... ...
src/Simplificador.py
... ... @@ -36,7 +36,7 @@ class Simplificador(object):
36 36 if self.__dicWords.has_key(t) == False: # verifica se nao eh artigo/preposicao
37 37 wu = str(w).upper() # deixa o token maiusculo
38 38 #if t[:2] == "VB":
39   - if t[-2:] == "-P":
  39 + if t[-2:] == "-P" and wu != "VLIBRAS" and wu != "LIBRAS":
40 40 wu = self.pluralAnalysis(w)
41 41 if t == "VB-P" or t == "VB-D" or t == "VB-R":
42 42 self.__verb = True
... ...
src/WorkCSV.py
... ... @@ -4,6 +4,7 @@
4 4 #Autor: Erickson Silva <erickson.silva@lavid.ufpb.br> <ericksonsilva@live.com>
5 5  
6 6 import csv, platform
  7 +from os import environ
7 8 from os.path import expanduser
8 9  
9 10 class WorkCSV(object):
... ... @@ -13,7 +14,7 @@ class WorkCSV(object):
13 14  
14 15 so = platform.system()
15 16 if so == 'Windows':
16   - self.__path = expanduser("~") + "\vlibras-translate\data\"
  17 + self.__path = environ.get("HOMEDRIVE") + "\vlibras-translate\data\"
17 18 else:
18 19 self.__path = expanduser("~") + "/vlibras-translate/data/"
19 20  
... ...