Skip to content

Added numbers upto twelve (fix for #291) - #299

Merged
asadurski merged 3 commits into
scrapinghub:masterfrom
atultherajput:added-numbers-upto-twelve
Apr 23, 2019
Merged

asadurski merged 3 commits into
scrapinghub:masterfrom
atultherajput:added-numbers-upto-twelve

Conversation

@atultherajput

Copy link
Copy Markdown
Contributor

I had added numbers upto twelve in languagefiles/en.yaml
This is a fix for #291
Please review this patch @waqasshabbir and @asadurski

@atultherajput

Copy link
Copy Markdown
Contributor Author

Thanks @asadurski but Why this build is failed?

@redapple

Copy link
Copy Markdown
Contributor

Travis is reporting 2 failed tests (see for example the Python 2.7 build):

======================================================================
FAIL: test_relative_past_dates_27_in_eight_months (tests.test_freshness_date_parser.TestFreshnessDateDataParser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/scrapinghub/dateparser/.tox/py27/lib/python2.7/site-packages/nose_parameterized/parameterized.py", line 392, in standalone_func
    return func(*(a + p.args), **p.kwargs)
  File "/home/travis/build/scrapinghub/dateparser/tests/test_freshness_date_parser.py", line 333, in test_relative_past_dates
    self.then_date_obj_is_exactly_this_time_ago(ago)
  File "/home/travis/build/scrapinghub/dateparser/tests/test_freshness_date_parser.py", line 910, in then_date_obj_is_exactly_this_time_ago
    self.assertEqual(self.now - relativedelta(**ago), self.result['date_obj'])
AssertionError: datetime.datetime(2014, 1, 1, 10, 30) != datetime.datetime(2015, 5, 1, 10, 30)
======================================================================
FAIL: test_relative_past_dates_29_in_5_years (tests.test_freshness_date_parser.TestFreshnessDateDataParser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/scrapinghub/dateparser/.tox/py27/lib/python2.7/site-packages/nose_parameterized/parameterized.py", line 392, in standalone_func
    return func(*(a + p.args), **p.kwargs)
  File "/home/travis/build/scrapinghub/dateparser/tests/test_freshness_date_parser.py", line 333, in test_relative_past_dates
    self.then_date_obj_is_exactly_this_time_ago(ago)
  File "/home/travis/build/scrapinghub/dateparser/tests/test_freshness_date_parser.py", line 910, in then_date_obj_is_exactly_this_time_ago
    self.assertEqual(self.now - relativedelta(**ago), self.result['date_obj'])
AssertionError: datetime.datetime(2009, 9, 1, 10, 30) != datetime.datetime(2019, 9, 1, 10, 30)

@codecov-io

codecov-io commented Mar 28, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #299 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #299   +/-   ##
=======================================
  Coverage   94.42%   94.42%           
=======================================
  Files          34       34           
  Lines        2960     2960           
=======================================
  Hits         2795     2795           
  Misses        165      165
Impacted Files Coverage Δ
tests/test_freshness_date_parser.py 99.35% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2726c47...a117aca. Read the comment docs.

@atultherajput

Copy link
Copy Markdown
Contributor Author

Thanks for input @redapple

@waqasshabbir

Copy link
Copy Markdown
Contributor

@atultherajput adding simplifications mapping like that isn't the best solution here. Counting doesn't end at twelve. Can you think of some other generic solution?

@asadurski
asadurski merged commit a117aca into scrapinghub:master Apr 23, 2019
@asadurski

Copy link
Copy Markdown
Member

Since we still don't have any better solution for numerals than simplifications, I believe this is good enough solution in the meantime. I just updated it to fit new data scheme.
Thank you for your contribution, @atultherajput!

@Watchful1 Watchful1 mentioned this pull request Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants