Esempio n. 1
0
 def handleGeneration(generated):
     if generated is None:
         self.send_error(408, explanation='Request timed out')
     else:
         generated = removeLast(toGenerate, generated)
         self.sendResponse([(generation, lexicalUnits[index]) for (index, generation) in enumerate(generated.split('[SEP]'))])
Esempio n. 2
0
 def handleAnalysis(analysis):
     if analysis is None:
         self.send_error(408, explanation='Request timed out')
     else:
         lexicalUnits = removeLast(toAnalyze, re.findall(r'\^([^\$]*)\$([^\^]*)', analysis))
         self.sendResponse([(lexicalUnit[0], lexicalUnit[0].split('/')[0] + lexicalUnit[1]) for lexicalUnit in lexicalUnits])