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

格式化的时间无法识别 #13

Open
annualLXJ opened this issue Apr 24, 2019 · 3 comments
Open

格式化的时间无法识别 #13

annualLXJ opened this issue Apr 24, 2019 · 3 comments

Comments

@annualLXJ
Copy link

解析前: 2019-04-19
解析后: {"type": "timestamp", "timestamp": "2019-09-04 00:00:00"}
时间不一致

@annualLXJ
Copy link
Author

是年/月/日格式无法识别,若转化为年-月-日格式,则可

@freecui
Copy link

freecui commented Mar 2, 2020

针对中间月份带有0x的形式,如2019-04-19更改TimeUnit.py代码464 rule = u"[0-9]?[0-9]?[0-9]{2}-((10)|(11)|(12)|(0?[1-9]))-((?<!\d))([0-3][0-9]|[1-9])"和474 rule = u"[0-9]?[0-9]?[0-9]{2}/((10)|(11)|(12)|(0?[1-9]))/((?<!\d))([0-3][0-9]|[1-9])"

@dongrixinyu
Copy link

换一个工具,JioNLP

import jionlp as jio
import time
text = '2019-04-19' 或 '2019/04/19'
print(jio.parse_time(text, time_base=time.time()))
# {'type': 'time_point', 'definition': 'accurate', 'time': ['2019-04-19 00:00:00', '2019-04-19 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

3 participants