Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Add more endmarks incl. \uFF1F (#146)
Browse files Browse the repository at this point in the history
* Add more endmarks incl. \uFF1F

Fix #145

Signed-off-by: Hiroshi Miura <[email protected]>

* PEP8/Black

Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Jul 10, 2021
1 parent d67bd5b commit 921f159
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pykakasi/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Ch:
zenkaku_number_nine = 0xFF1A
zenkaku_A = 0xFF21
zenkaku_a = 0xFF41
endmark = ")]!,.,\u3001\u3002"
endmark = ")]!,.,\u3001\u3002\uff1f\uff10\uff1e\uff1c"
long_symbols = "\u30FC\u2015\u2212\uFF70" # "ー ― − ー "
# _UNCHECKED_LONG_SYMBOLS: str = "\u002D\u2010\u2011\u2013\u2014" # "- ‐ ‑ – —"

Expand Down
16 changes: 16 additions & 0 deletions tests/test_pykakasi_structured.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,22 @@ def test_kakasi_unidic_noun(case, expected):
assert result[0]["hira"] == expected


def test_issue_145():
case = "見えますか?"
expected = {
"orig": "ますか?",
"hira": "ますか?",
"kana": "マスカ?",
"hepburn": "masuka?",
"kunrei": "masuka?",
"passport": "masuka?",
}
kakasi = pykakasi.Kakasi()
result = kakasi.convert(case)
assert result[1]["orig"] == expected["orig"]
assert result[1]["hira"] == expected["hira"]


@pytest.mark.parametrize(
"case, expected",
[
Expand Down

0 comments on commit 921f159

Please sign in to comment.