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