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]jionlp.ner.extract_time()解析英文逗号的bug #161

Open
lin-whale opened this issue Aug 28, 2023 · 0 comments
Open

[BUG]jionlp.ner.extract_time()解析英文逗号的bug #161

lin-whale opened this issue Aug 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@lin-whale
Copy link

jionlp.ner.extract_time("每天早上八点,他去上学", time_base=time.time())解析正确
jionlp.ner.extract_time("每天早上八点,他去上学", time_base=time.time())解析错误
[{'time_candidate': '每天早上八点,', 'offset': [0, 7]}]
2023-08-28 12:19:43 ERROR parse_time_period: Traceback (most recent call last):
File "/home/stardust/anaconda3/envs/rasa/lib/python3.10/site-packages/jionlp/gadget/time_parser.py", line 1209, in parse_time_period
first_full_time_handler, second_full_time_handler, _, blur_time = self.parse_time_span_point(
File "/home/stardust/anaconda3/envs/rasa/lib/python3.10/site-packages/jionlp/gadget/time_parser.py", line 1048, in parse_time_span_point
blur_time = self.parse_time_point(
File "/home/stardust/anaconda3/envs/rasa/lib/python3.10/site-packages/jionlp/gadget/time_parser.py", line 1521, in parse_time_point
raise ValueError('## exception string {}.'.format(time_string))
ValueError: ## exception string 早上八点,.

看上去可能是正则表达式没考虑英文逗号?我没找到应该修改的地方,还请指点。

@lin-whale lin-whale added the bug Something isn't working label Aug 28, 2023
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

1 participant