Coder Social home page Coder Social logo

Comments (6)

itdxer avatar itdxer commented on July 27, 2024

I've tried to modify example and when I modify this line (for DATES_PATTERN variable)

(?P<months>{months})

to this

(?P<months>{months})(?P<month_ending>\W|$)

it solves the problem.

In case if this solution is fine - I can make a pull request.

P.S. All tests work fine. Also I can add a few more tests to make sure that this problem will not occur later.

from datefinder.

itdxer avatar itdxer commented on July 27, 2024

There also exists the same issue related to timezones

E           assert 't at 2p.m. m...ndard time on' == 'at 2p.m. moun...ndard time on'
E             - t at 2p.m. mountain standard time on
E             ? --
E             + at 2p.m. mountain standard time on
tests/test_extract_date_strings.py:20: AssertionError

for

['the big fight at 2p.m. mountain standard time on ufc.com', 'at 2p.m. mountain standard time on']

it cuts letter t, because it's one of the choices

from datefinder.

akoumjian avatar akoumjian commented on July 27, 2024

Go ahead and put up a PR. Just want to make sure we aren't removing other valid matches before merging it in. Great work!

from datefinder.

itdxer avatar itdxer commented on July 27, 2024

I've solve issue related to month, but I failed to solve it for extra_tokens.

It still extracts

t at 2p.m. mountain standard time on ufc.com

from

the big fight at 2p.m. mountain standard time on ufc.com

The same trick didn't help for this case.

from datefinder.

mnba avatar mnba commented on July 27, 2024

In fact such ending-guards ( "...\W|$" ) will be needed for DateFinder.REPLACEMENTS strings too, since source replacement can be easily done within words, corrupting them. Doing tokenization would be better approach, though very different one

from datefinder.

akoumjian avatar akoumjian commented on July 27, 2024

This was resolved.

from datefinder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.