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

过去的时间段和未来的时间段不分 #15

Open
liuhuanyong opened this issue May 3, 2019 · 1 comment
Open

过去的时间段和未来的时间段不分 #15

liuhuanyong opened this issue May 3, 2019 · 1 comment

Comments

@liuhuanyong
Copy link

输入:未来一周
(['未来1周'], '{"timedelta": {"second": 0, "minute": 0, "hour": 0, "day": 7, "year": 0, "month": 0}, "type": "timedelta"}')
输入:
过去一周:
(['过去1周'], '{"timedelta": {"minute": 0, "hour": 0, "day": 7, "month": 0, "year": 0, "second": 0}, "type": "timedelta"}')
在对这种时间的处理上还是需要进行优化的啊

@dongrixinyu
Copy link

严格来说,未来一周不属于 timedelta,而是 time_Span
换一个工具,JioNLP会持续支持

import jionlp as jio
import time
text = '晚上8点到9点'
print(jio.parse_time(text, time_base=time.time()))
# {'type': 'time_span', 'definition': 'accurate', 'time': ['2021-07-26 20:00:00', '2021-07-26 21: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