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

Added support for fortnight and century #987

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ddff3eb
added support for decade in hindi
Mr-Sunglasses Sep 27, 2021
96d2e52
added support for decade in hindi
Mr-Sunglasses Sep 27, 2021
e826a06
added support for fortnignt and century
Mr-Sunglasses Sep 27, 2021
7185282
Delete pyvenv.cfg
Mr-Sunglasses Sep 27, 2021
127149b
Delete hi.py
Mr-Sunglasses Sep 27, 2021
2f1f8fc
Delete hi.yaml
Mr-Sunglasses Sep 27, 2021
7edac70
fixed accidentally deleted files
Mr-Sunglasses Sep 28, 2021
9a585be
added test for centuries
Mr-Sunglasses Sep 28, 2021
ec50655
added test for centuries
Mr-Sunglasses Sep 28, 2021
5b55b2a
fixed and added centurys support
Mr-Sunglasses Oct 4, 2021
b461617
Delete pyvenv.cfg
Gallaecio Oct 5, 2021
ceae086
fixed all the bugs now its working fine
Mr-Sunglasses Dec 5, 2021
52582cd
fixed all bugs , now this is working fine
Mr-Sunglasses Dec 5, 2021
83c593d
Removed repeated test
Mr-Sunglasses Jun 19, 2022
e9ab0d0
Removed repeated test for last fortnight
Mr-Sunglasses Jun 19, 2022
b97612e
added my env to gitignore
Mr-Sunglasses Jun 19, 2022
fcab861
Added plural for decade in hindi
Mr-Sunglasses Jun 19, 2022
93863fb
Added plural for decade in hindi
Mr-Sunglasses Jun 19, 2022
baec3b6
Merge branch 'scrapinghub:master' into added-suppor-for-for-fortnight
Mr-Sunglasses Jun 19, 2022
11c6a5f
Removed some garbage files
Mr-Sunglasses Jun 19, 2022
7649958
Added support for counting from 1 to 12 in Hindi
Mr-Sunglasses Jun 19, 2022
472cf9b
Added test for 2 centuries ago in hindi
Mr-Sunglasses Jun 19, 2022
e13c925
Add more words for (in) in hindi language
Mr-Sunglasses Jun 19, 2022
6f7630c
Added tests for the in_future in decade in hindi
Mr-Sunglasses Jun 19, 2022
d89210c
Added test for decade in future in hindi
Mr-Sunglasses Jun 20, 2022
46dcbc9
Added test for coming fortnight
Mr-Sunglasses Jun 20, 2022
10ce3a4
Added Support for in coming fortnight
Mr-Sunglasses Jun 20, 2022
a36c48b
Fixed gitignore
Mr-Sunglasses Jun 20, 2022
2738b28
Fixed bug for centuries
Mr-Sunglasses Jun 20, 2022
0943ee1
Added tests for centuries
Mr-Sunglasses Jun 20, 2022
da174a8
Merge branch 'scrapinghub:master' into added-suppor-for-for-fortnight
Mr-Sunglasses Jun 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dateparser/data/date_translation_data/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@
"(\\d+) decades? ago"
],
"in \\1 century": [
"in (\\d+) century?"
"in (\\d+) centurys?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it needs to be something like centur(?:ys?|ies)

Copy link
Contributor Author

@Mr-Sunglasses Mr-Sunglasses Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gallaecio Just tried this , Tests are failing when I used it.

],
"\\1 century ago": [
"(\\d+) century? ago"
"(\\d+) centurys? ago"
],
"in \\1 fortnight": [
"in (\\d+) fortnight?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ relative-type-regex:
\1 decade ago:
- (\d+) decades? ago
in \1 century:
- in (\d+) century?
- in (\d+) centurys?
\1 century ago:
- (\d+) century? ago
- (\d+) centurys? ago
in \1 fortnight:
- in (\d+) fortnight?
\1 fortnight ago:
Expand Down
3 changes: 3 additions & 0 deletions dateparser_scripts/tests/pyvenv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
home = /opt/homebrew/opt/[email protected]/bin
include-system-site-packages = false
version = 3.9.7
1 change: 1 addition & 0 deletions tests/test_freshness_date_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,7 @@ def test_normalized_relative_dates(self, date_string, ago, period):
param('in 1 century 12 years', in_future={'years': 112}, period='year'),
param('next century', in_future={'years': 100}, period='year'),
param('in a century', in_future={'years': 100}, period='year'),
param('in 3 centurys', in_future={'years': 300}, period='year'),
param('in 1 decade 2 months', in_future={'years': 10, 'months': 2}, period='month'),
param('in 100 decades', in_future={'years': 1000}, period='year'),
param('in 1 decade 12 years', in_future={'years': 22}, period='year'),
Expand Down