Ejemplo n.º 1
0
 def test_compute_suffix(self, word, expected):
     assert expected == KoreanWord(word).suffix
Ejemplo n.º 2
0
 def test_init_incorrect_etymology(self):
     with pytest.raises(ValueError):
         KoreanWord(u'안녕', etymology=u'安寧安寧')
Ejemplo n.º 3
0
 def test_init(self, string, etymology, meaning, compute_etymology):
     KoreanWord(string, etymology, meaning, compute_etymology)
Ejemplo n.º 4
0
 def test_get_words_with_block(self, input_str, exclude, input_str_expected):
     word = KoreanWord(input_str, compute_etymology=True)
     block = word.get_blocks_for_selected_meaning()[0]
     words = DbUtil().get_words_with_block(block, exclude=exclude)
     assert len(words) > 0
     assert input_str_expected == (input_str in [word[0] for word in words])
Ejemplo n.º 5
0
 def test_render_block(self):
     words = [KoreanWord(string=u'남대문', etymology=u'南大門',
                         meaning=u'(건축물) Namdaemun, the (Great) South Gate (of Seoul)')]
     ui.render_block(self.block(), words)
Ejemplo n.º 6
0
 def korean_word():
     return KoreanWord(u'남대문', u'南大門',
                       u'(건축물) Namdaemun, the (Great) South Gate (of Seoul)')