Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
add tests for count_moras()
  • Loading branch information
tatsumoto-ren committed Jul 24, 2024
1 parent 5c80357 commit 2ae676f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/test_pitch_type.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Copyright: Ajatt-Tools and contributors; https://github.com/Ajatt-Tools
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from japanese.pitch_accents.basic_types import PitchType, pitch_type_from_pitch_num
from japanese.mecab_controller.kana_conv import HIRAGANA, KATAKANA
from japanese.pitch_accents.basic_types import (
PitchType,
count_moras,
pitch_type_from_pitch_num,
)


def test_count_moras() -> None:
assert count_moras("あいうえお") == 5
assert count_moras("カキクケコ") == 5
assert count_moras("にゃ") == 1
assert count_moras("あ") == 1
assert count_moras("ー") == 1
assert count_moras("っ") == 1
assert count_moras("とうきょう") == 4
assert count_moras("きゃきゅきょ") == 3


def test_pitch_type_from_pitch_num() -> None:
Expand Down

0 comments on commit 2ae676f

Please sign in to comment.