Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 漢数字の時刻表現のspanがずれる #67

Closed
reonyanarticle opened this issue Oct 20, 2021 · 2 comments
Closed

[Bug] 漢数字の時刻表現のspanがずれる #67

reonyanarticle opened this issue Oct 20, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@reonyanarticle
Copy link

🐛 Bug

説明

入力した文章から抽出したtimexがもっているspanの長さが想定していた長さとちがう。

現状挙動

text = "平成三十一年に起きた出来事はなんですか?"
timex = TimexParser().parse(text)
print(timex[0].span)
# (0,5)

理想の挙動

text = "平成三十一年に起きた出来事はなんですか?"
timex = TimexParser().parse(text)
print(timex[0].span)
# (0,6)

再現方法やエラー内容

実行環境

  • ja-timexのバージョン : 0.2.0
  • Pythonのバージョン : 3.8.10
  • OSの情報: MacOS Bigsur

追加/補足情報

もしかしてbugではなく、一度漢数字をアラビア数字にしたあと、spanをとっているのでしょうか?そういう仕様なのでしょうか?
もしそうでしたら、変更前の文字列のspan情報が欲しいというfeatureを投げたいです。

@reonyanarticle reonyanarticle added the bug Something isn't working label Oct 20, 2021
@yagays
Copy link
Owner

yagays commented Nov 2, 2021

返信遅れてしまい申し訳ありません。

確かにspanの位置がずれており、漢数字からアラビア数字へ変換する際の文字長の変化に対応できていないことが原因です。こちらは修正対象のバグとして対応します。

@yagays yagays changed the title [Bug] [Bug] 漢数字の時刻表現のspanがずれる Nov 2, 2021
@yagays
Copy link
Owner

yagays commented Jan 29, 2022

@reonyanarticle こちらv0.2.2にて対応しました。

@yagays yagays closed this as completed Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants