예제 #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
 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
 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)]