예제 #1
0
파일: srsManager.py 프로젝트: Xifax/suzu
 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' '
예제 #2
0
파일: srsManager.py 프로젝트: Xifax/suzu
 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' '
예제 #3
0
파일: srsManager.py 프로젝트: Xifax/suzu
 def getWordPronounciation(self, item):
     try:
         return kata2hira(MecabTool.parseToWordsFull(item)[0]['pronunciation'])
     except:
         return item
예제 #4
0
파일: srsManager.py 프로젝트: Xifax/suzu
 def getWordNonInflectedForm(self, item):
     try:
         return MecabTool.parseToWordsFull(item)[0]['nform']
     except:
         return item
예제 #5
0
파일: srsManager.py 프로젝트: Xifax/suzu
 def getParsedExampleInFull(self):
     return MecabTool.parseToWordsFull(self.currentExample.sentence)
예제 #6
0
파일: srsManager.py 프로젝트: Xifax/suzu
 def getWordFromExample(self):
     words = MecabTool.parseToWordsFull(self.currentExample.sentence)
     answer = self.find(lambda word: self.currentItem.character in word['word'] , words)
     return answer['word']