Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
katsutan committed Jun 29, 2021
1 parent f8cefeb commit 468e0bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/dictionarylib/test_dictionarybuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def setUp(self):
wf.write("東京都,0,0,0,東京都,名詞,固有名詞,地名,一般,*,*,ヒガシキョウト,東京都,*,B,\"東,名詞,普通名詞,一般,*,*,*,ヒガシ/2\",*,1/2,1/2\n")
wf.write("東,-1,-1,0,東,名詞,普通名詞,一般,*,*,*,ヒガシ,ひがし,*,A,*,*,*,*\n")
wf.write("京都,0,0,0,京都,名詞,固有名詞,地名,一般,*,*,キョウト,京都,*,A,*,*,*,*\n")
wf.write("1,-1,-1,0,1,名詞,数詞,*,*,*,*,イチ,1,*,A,*,*,*,*\n")
wf.write("東1,0,0,0,東1,名詞,普通名詞,一般,*,*,*,ヒガシイチ,東1,*,C,\"東,名詞,普通名詞,一般,*,*,*,ヒガシ/1,名詞,数詞,*,*,*,*,イチ\",\"東,名詞,普通名詞,一般,*,*,*,ヒガシ/U3\",*")
self.logger = getLogger()
self.logger.disabled = True

Expand Down Expand Up @@ -218,13 +220,13 @@ def test_build(self):
self.assertEqual('test', header.description)

# grammar
self.assertEqual(2, grammar.get_part_of_speech_size())
self.assertEqual(3, grammar.get_part_of_speech_size())
self.assertEqual(["名詞", "固有名詞", "地名", "一般", "*", "*"], grammar.get_part_of_speech_string(0))
self.assertEqual(["名詞", "普通名詞", "一般", "*", "*", "*"], grammar.get_part_of_speech_string(1))
self.assertEqual(200, grammar.get_connect_cost(0, 0))

# lexicon
self.assertEqual(3, lexicon.size())
self.assertEqual(5, lexicon.size())
self.assertEqual(0, lexicon.get_cost(0))
wi = lexicon.get_word_info(0)
self.assertEqual('東京都', wi.surface)
Expand Down

0 comments on commit 468e0bf

Please sign in to comment.