Exemple #1
0
def prepareTestDataUni(bigBossData, uniTestData):
  reader = csv.reader(open(bigBossData))
  reader.next()
  sentences = []
  sentence = []
  for line in reader:
    if line[0] == '':
      sentences.append(sentence)
      sentence = []
      continue
    wordTagLang = (line[2], line[3], line[4])
    # print wordTagLang
    sentence.append(wordTagLang)
  if len(sentence) > 0:
    sentences.append(sentence)
  uniSentences = map2Uni.map2UniWithLtag(sentences)
  Writer.writePOSSentencesTSV(uniSentences, uniTestData)
Exemple #2
0
 def dumpOutput(self, outFile):
   Writer.writePOSSentencesTSV(self.outputs, outFile)