Exemplo n.º 1
0
 def getCorrectAnswer(self):
     words = MecabTool.parseToWordsFull(self.currentExample.sentence)
     answer = self.find(lambda word: self.currentItem.character in word['word'] , words)
     try:
         return kata2hira(answer['pronunciation'])
     except Exception:
         return u' '
Exemplo n.º 2
0
 def getWordPronunciationFromExample(self, item):
     words = MecabTool.parseToWordsFull(self.currentExample.sentence)
     answer = self.find(lambda word: item in word['word'] , words)
     try:
         return kata2hira(answer['pronunciation'])
     except Exception:
         return u' '
Exemplo n.º 3
0
 def getWordPronounciation(self, item):
     try:
         return kata2hira(MecabTool.parseToWordsFull(item)[0]['pronunciation'])
     except:
         return item
Exemplo n.º 4
0
 def getWordNonInflectedForm(self, item):
     try:
         return MecabTool.parseToWordsFull(item)[0]['nform']
     except:
         return item
Exemplo n.º 5
0
 def getParsedExampleInFull(self):
     return MecabTool.parseToWordsFull(self.currentExample.sentence)
Exemplo n.º 6
0
 def getWordFromExample(self):
     words = MecabTool.parseToWordsFull(self.currentExample.sentence)
     answer = self.find(lambda word: self.currentItem.character in word['word'] , words)
     return answer['word']