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

“9月10日到9月25日”第二个时间会识别成明年9月25日 #31

Open
jelly-FF opened this issue Jul 6, 2020 · 2 comments
Open

Comments

@jelly-FF
Copy link

jelly-FF commented Jul 6, 2020

请输入要识别的时间:9月10日到9月25日
当前时间:2020-07-06 17:32:28
{"type": "timespan", "timespan": ["2020-09-10 00:00:00", "2021-09-25 00:00:00"]}

@jelly-FF
Copy link
Author

jelly-FF commented Jul 6, 2020

应该是TimeUnit.py line 996 相等的情况没有写。
我暂时没有想到比较好的解决方案。

@dongrixinyu
Copy link

换一个工具,JioNLP

import jionlp as jio
import time
text = '9月10日到9月25日'
print(jio.parse_time(text, time_base=time.time()))
# {'type': 'time_span', 'definition': 'accurate', 'time': ['2021-09-10 00:00:00', '2021-09-25 23:59:59']}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants