コード例 #1
0
 def parse_line(self, line):
     words, translations, wtype = line.split('\t')
     words = words.split(';')
     translations = translations.split(';')
     for word in words:
         for translation in translations:
             yield Word(word, translation, wtype=wtype)
コード例 #2
0
ファイル: test_word.py プロジェクト: nijel/stardicter
 def do_parse(self, line, expected, translation):
     '''
     Test for word parsing.
     '''
     word = Word.from_slovnik(line)
     self.assertEqual(word.word, expected)
     self.assertEquals(word.translation, translation)
     return word
コード例 #3
0
 def do_parse(self, line, expected, translation):
     '''
     Test for word parsing.
     '''
     word = Word.from_slovnik(line)
     self.assertEqual(word.word, expected)
     self.assertEquals(word.translation, translation)
     return word
コード例 #4
0
ファイル: czech.py プロジェクト: u20024804/stardicter
 def parse_line(self, line):
     word, pronunciation, explanation = line.split('|')
     return [Word(word, explanation, pronunciation=pronunciation)]
コード例 #5
0
ファイル: base.py プロジェクト: nijel/stardicter
 def parse_line(self, line):
     '''
     Parses single line with word.
     '''
     return [Word.from_slovnik(line)]
コード例 #6
0
 def parse_line(self, line):
     '''
     Parses single line with word.
     '''
     return [Word.from_slovnik(line)]