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

Parsing relative dates error with Taiwanese Mandarin #913

Open
kss149 opened this issue Apr 28, 2021 · 0 comments · May be fixed by #917
Open

Parsing relative dates error with Taiwanese Mandarin #913

kss149 opened this issue Apr 28, 2021 · 0 comments · May be fixed by #917
Labels
Type: Bug - Language Subtype of bug, related to language data

Comments

@kss149
Copy link

kss149 commented Apr 28, 2021

I have trouble parsing the following string "2分鐘前". It should translate to "2 minutes ago" in Mandarin (checked with DeepL, GoogleTranslate, etc), but parsing returns None.

>>> dateparser.parse("2分鐘前")
>>> dateparser.parse("2 分鐘前")
datetime.datetime(2021, 4, 28, 20, 45, 19, 266428)

I added a space in between the number and the symbols and it works, but ideally I would like it to work without adding it.
I think it may be because I got it from a Taiwanese version of a website, but I am no expert.

I translated back to Mandarin "2 minutes ago" and got "2分钟前" (notice the symbol in the middle is different), which parses fine with and without a space, but it'd be great if the ?Taiwanese? version will work as well.

>>> dateparser.parse("2分钟前")
datetime.datetime(2021, 4, 28, 20, 45, 32, 129967)
>>> dateparser.parse("2 分钟前")
datetime.datetime(2021, 4, 28, 20, 45, 35, 659334)
@Gallaecio Gallaecio added the Type: Bug - Language Subtype of bug, related to language data label Apr 29, 2021
@noviluni noviluni linked a pull request Apr 29, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug - Language Subtype of bug, related to language data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants