Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 4
0
 def parse_line(self, line):
     word, pronunciation, explanation = line.split('|')
     return [Word(word, explanation, pronunciation=pronunciation)]
Ejemplo n.º 5
0
 def parse_line(self, line):
     '''
     Parses single line with word.
     '''
     return [Word.from_slovnik(line)]
Ejemplo n.º 6
0
 def parse_line(self, line):
     '''
     Parses single line with word.
     '''
     return [Word.from_slovnik(line)]