Skip to content

"in three weeks" doesn't work #291

Closed

Description

@sils
In [2]: dateparser.parse('in two weeks')
Out[2]: datetime.datetime(2017, 3, 31, 23, 42, 45, 268823)

In [3]: dateparser.parse('in three weeks')

In [4]: dateparser.parse('in 3 weeks')
Out[4]: datetime.datetime(2017, 4, 7, 23, 42, 53, 854388)

Activity

  1. atultherajput commented on Mar 28, 2017

    @atultherajput
    Contributor

    Yeah, It is not working for more than two days, weeks, months and years . Examples:

    • dateparser.parse('in three weeks')
    • dateparser.parse('in five days')
    • dateparser.parse('in eight months')
    • dateparser.parse('in eleven years')

    But these are working:

    • dateparser.parse('in one weeks')
    • dateparser.parse('in two days')
    • dateparser.parse('in 3 weeks')
    • dateparser.parse('in 5 days')
    • dateparser.parse('in 8 months')
    • dateparser.parse('in 11 years')

    I think it is because of this:- https://github.com/scrapinghub/dateparser/blob/master/data/languagefiles/en.yaml

    `simplifications:

    • day before yesterday: 2 days
    • yesterday: 1 day
    • tomorrow: in 1 day
    • today: 0 days
    • last (week|month|year): 1 \1
    • next (week|month|year): in 1 \1
    • an: 1
    • a: 1
    • one: 1
    • two: 2
    • (\d+)\s*hr(s?): \1 hour\2
    • (\d+)\s*min(s?): \1 minute\2
    • (\d+)\s*sec(s?): \1 second\2
    • (?:12\s+)?noon: '12:00'
    • (?:12\s+)?midnight: '00:00'
    • (\d+)h(\d+)m?: \1:\2
    • less than 1 minute ago: 45 seconds
    • (?<!from\s)now: 0 second

    `

  2. atultherajput commented on Mar 28, 2017

    @atultherajput
    Contributor

    I had submitted a fix for this issue. Now we can parse upto twelve. #299 This is my first commit to this project so kindly review this patch @waqasshabbir

  3. asadurski commented on Mar 28, 2017

    @asadurski
    Member

    Hi! Thanks for bringing that up.
    The issue is related to #46 (and I even have a quite stale branch for that, that I haven't worked on for a while: https://github.com/scrapinghub/dateparser/tree/feature-numerals-to-numbers). It's actually a bit complicated to solve it for more languages than just English. But of course @atultherajput's input is very welcome here for a good start.

  4. atultherajput commented on Mar 28, 2017

    @atultherajput
    Contributor

    Hey @asadurski
    I would like to work on this issue. I think we can use CLDR database for that.

  5. AshwiniPatil5 commented on Jul 17, 2018

    @AshwiniPatil5

    I'm using the pip install to get the dateparser. is this issue fixed in the latest version?

  6. Gallaecio commented on Dec 11, 2019

    @Gallaecio
    Contributor

    Since this specific issue has been fixed, let us keep track of this at #46.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions