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] ret_future 与预期不符 #202

Open
beginOfAll opened this issue Apr 16, 2024 · 3 comments
Open

[BUG] ret_future 与预期不符 #202

beginOfAll opened this issue Apr 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@beginOfAll
Copy link

描述(Description)

ret_future(bool): 返回偏向未来的时间,如 周一 可按 下周一 进行解析。
今天 2024-04-16
query='五月十号'
ret_future=true, 期望出的是 2024-05-10, 现状却出 2025-05-10

  1. 版本(Version):
  • python 版本: 3.10.10
  • jionlp 版本: 1.5.9
  1. jionlp的调用代码与输入文本(Code & Text):
import jionlp as jio
# now = '2024-04-16 19:59:39'
res = jio.parse_time('五月十号', time_base=datetime.datetime.now(), ret_future=True)
print(res)
# res = {'type': 'time_point', 'definition': 'accurate', 'time': ['2025-05-10 00:00:00', '2025-05-10 23:59:59']}
# 问题:今年五月十号还没到,为什么直接出了明年五月十号?
# 期望:解析为 2024-05-10
@beginOfAll beginOfAll added the bug Something isn't working label Apr 16, 2024
@dongrixinyu
Copy link
Owner

把参数设 false就可以了

@beginOfAll
Copy link
Author

把参数设 false就可以了

我的需求就是获取未来时间。
如果设置ret_future=False, 其他正常的case将出错。

@beginOfAll
Copy link
Author

把参数设 false就可以了

我的需求就是获取未来时间。 如果设置ret_future=False, 其他正常的case将出错。

我稍后提交一个pr吧

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