Ejemplo n.º 1
0
 def prepararArquivo(self, arquivo):
     if (self.comQuebraLinha):
         stringArquivo = Util.lerArquivo(arquivo)
     else: 
         # Se (comQuebraLinha = False), le o arquivo sem considerar as quebras de linha (LF, CR)
         stringArquivo = Util.lerArquivoSemQuebraLinha(arquivo)
     
     # Se (comComentariosELiterais = False), retira os comentarios e literais da string
     if not (self.comComentariosELiterais):
         stringArquivo = self.removerComentarios(stringArquivo)
         stringArquivo = self.removerLiterais(stringArquivo)
         #print stringArquivo
     
     # Separa o arquivo em n-grams
     nGrams = self.separarEmNGrams(stringArquivo)
     return nGrams
Ejemplo n.º 2
0
 def recuperarNGrams(self, arquivoNGrams):
     return Util.lerArquivo(arquivoNGrams)