dongrixinyu / JioNLP

中文 NLP 预处理、解析工具包,准确、高效、易用 A Chinese NLP Preprocessing & Parsing Package www.jionlp.com
http://www.jionlp.com/
Apache License 2.0
3.27k stars 399 forks source link

[BUG] ret_future 与预期不符 #202

Open beginOfAll opened 5 months ago

beginOfAll commented 5 months ago

描述(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
  2. 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
dongrixinyu commented 4 months ago

把参数设 false就可以了