def test_spell(self): self.assertEqual(spell(None), [""]) self.assertEqual(spell(""), [""]) result = spell("เน้ร") self.assertIsInstance(result, list) self.assertGreater(len(result), 0) result = spell("เกสมร์") self.assertIsInstance(result, list) self.assertGreater(len(result), 0) result = spell("เน้ร", engine="phunspell") self.assertIsInstance(result, list) self.assertGreater(len(result), 0) result = spell("เกสมร์", engine="phunspell") self.assertIsInstance(result, list) self.assertGreater(len(result), 0) result = spell("เน้ร", engine="symspellpy") self.assertIsInstance(result, list) self.assertGreater(len(result), 0) result = spell("เกสมร์", engine="symspellpy") self.assertIsInstance(result, list) self.assertGreater(len(result), 0) result = spell("เน้ร", engine="tltk") self.assertIsInstance(result, list) self.assertGreater(len(result), 0) result = spell("เดก", engine="tltk") self.assertIsInstance(result, list) self.assertGreater(len(result), 0)
def test_spell(self): self.assertEqual(spell(None), [""]) self.assertEqual(spell(""), [""]) result = spell("เน้ร") self.assertIsInstance(result, list) self.assertGreater(len(result), 0) result = spell("เกสมร์") self.assertIsInstance(result, list) self.assertGreater(len(result), 0)
def test_spell(self): self.assertEqual(spell(None), "") self.assertEqual(spell(""), "") self.assertIsNotNone(spell("เน้ร")) self.assertIsNotNone(spell("เกสมร์")) self.assertEqual(correct(None), "") self.assertEqual(correct(""), "") self.assertIsNotNone(correct("ทดสอง")) checker = NorvigSpellChecker(dict_filter="") self.assertIsNotNone(checker.dictionary()) self.assertGreaterEqual(checker.prob("มี"), 0)
def test_spell(self): self.assertEqual(spell('เน้ร')!=None,True)
# -*- coding: utf-8 -*- from pythainlp.spell import spell a = spell("สี่เหลียม") print(a) # ['สี่เหลี่ยม'] # a = spell("สี่เหลียม", engine="hunspell") # available in some Linux systems
def test_spell(self): self.assertIsNotNone(spell('เน้ร'))