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

AttributeError: unknown attribute: "weeks" #23

Open
CreditTone opened this issue Oct 30, 2019 · 1 comment
Open

AttributeError: unknown attribute: "weeks" #23

CreditTone opened this issue Oct 30, 2019 · 1 comment

Comments

@CreditTone
Copy link

ex.extract_time("下周三")
Traceback (most recent call last):
File "", line 1, in
File "/anaconda3/lib/python3.7/site-packages/cocoNLP/extractor.py", line 240, in extract_time
res = tn.parse(target=tmp_text) # target为待分析语句,timeBase为基准时间默认是当前时间
File "/anaconda3/lib/python3.7/site-packages/cocoNLP/config/basic/time_nlp/TimeNormalizer.py", line 97, in parse
self.timeToken = self.__timeEx()
File "/anaconda3/lib/python3.7/site-packages/cocoNLP/config/basic/time_nlp/TimeNormalizer.py", line 176, in __timeEx
res.append(TimeUnit(temp[i], self, contextTp))
File "/anaconda3/lib/python3.7/site-packages/cocoNLP/config/basic/time_nlp/TimeUnit.py", line 34, in init
self.time_normalization()
File "/anaconda3/lib/python3.7/site-packages/cocoNLP/config/basic/time_nlp/TimeUnit.py", line 53, in time_normalization
self.norm_setCurRelated()
File "/anaconda3/lib/python3.7/site-packages/cocoNLP/config/basic/time_nlp/TimeUnit.py", line 888, in norm_setCurRelated
cur = cur.replace(weeks=1, days=span)
File "/anaconda3/lib/python3.7/site-packages/arrow/arrow.py", line 603, in replace
raise AttributeError('unknown attribute: "{}"'.format(key))
AttributeError: unknown attribute: "weeks"

@Beants
Copy link

Beants commented Dec 16, 2019

相同问题,请问解决了吗

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