Skip to content

Mistake search_dates for ru language #706

Closed

Description

@0d1nn

Hello everyone!

I have an issue with the following example:

search_dates('через 2 часа', languages = ['ru'])    # через 2 часа = in 2 hours
output:  [('2 часа', datetime.datetime(2020, 6, 11, 8, 58, 34, 823410))]
should be: [('через 2 часа', datetime.datetime(2020, 6, 11, 12, 58, 34, 823410))]

The answer is supposed to be "2 hours from now (later)", but it returns "2 hours before now (earlier)".
The thing is, the sentance is exactly following the structure defined in dateparser/dateparser/data/date_translation_data/ru.py , so I'm confused why the error takes place.
I try to figure out the logic of the parser, and so far I understood that for languages other than english it's supposed to return 2 results: one for translated to english sentance, and the other - for the original sentance. Did I get it correctly?

How can it be fixed?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Status: Bug confirmedType: Bug - Languagesearch_dates

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions