Exemple #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' '
Exemple #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' '
Exemple #3
0
 def getWordPronounciation(self, item):
     try:
         return kata2hira(MecabTool.parseToWordsFull(item)[0]['pronunciation'])
     except:
         return item
Exemple #4
0
 def getWordNonInflectedForm(self, item):
     try:
         return MecabTool.parseToWordsFull(item)[0]['nform']
     except:
         return item
Exemple #5
0
 def getParsedExampleInFull(self):
     return MecabTool.parseToWordsFull(self.currentExample.sentence)
Exemple #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']