- 
                Notifications
    
You must be signed in to change notification settings  - Fork 484
 
Added support for fortnight and century #987
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
base: master
Are you sure you want to change the base?
Changes from all commits
ddff3eb
              96d2e52
              e826a06
              7185282
              127149b
              2f1f8fc
              7edac70
              9a585be
              ec50655
              5b55b2a
              b461617
              ceae086
              52582cd
              83c593d
              e9ab0d0
              b97612e
              fcab861
              93863fb
              baec3b6
              11c6a5f
              7649958
              472cf9b
              e13c925
              6f7630c
              d89210c
              46dcbc9
              10ce3a4
              a36c48b
              2738b28
              0943ee1
              da174a8
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -51,4 +51,4 @@ docs/_build | |
| .vscode/ | ||
| 
     | 
||
| # Other | ||
| raw_data | ||
| raw_data | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -162,6 +162,12 @@ | |
| ], | ||
| "2 day ago": [ | ||
| "परसों" | ||
| ], | ||
| "1 decade ago": [ | ||
| "पिछला दशक" | ||
| ], | ||
| "in 1 decade": [ | ||
| "अगला दशक" | ||
| ] | ||
| }, | ||
| "relative-type-regex": { | ||
| 
          
            
          
           | 
    @@ -212,6 +218,20 @@ | |
| ], | ||
| "in \\1 year": [ | ||
| "(\\d+) वर्ष में" | ||
| ], | ||
| "in \\1 decade": [ | ||
| "(\\d+) दशक में", | ||
| "(\\d+) दशकों में", | ||
| "(\\d+) दशक मे", | ||
| "(\\d+) दशकों मे", | ||
| 
         
      Comment on lines
    
      +225
     to 
      +226
    
   
  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aren't these same as the first two expressions?  | 
||
| "(\\d+) दशक बाद", | ||
| "(\\d+) दशकों बाद", | ||
| "(\\d+) दशक पश्चात", | ||
| "(\\d+) दशकों पश्चात" | ||
| ], | ||
| "\\1 decade ago": [ | ||
| "(\\d+) दशक पहले", | ||
| "(\\d+) दशकों पहले" | ||
| ] | ||
| }, | ||
| "locale_specific": {}, | ||
| 
        
          
        
         | 
    @@ -235,12 +255,59 @@ | |
| "," | ||
| ], | ||
| "sentence_splitter_group": 3, | ||
| "decade": [ | ||
| "दशक", | ||
| "दशकों" | ||
| ], | ||
| "ago": [ | ||
| "पहले", | ||
| "पूर्व" | ||
| ], | ||
| "in": [ | ||
| "में", | ||
| "बाद" | ||
| "बाद", | ||
| "पश्चात", | ||
| "मे" | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already present as the first item on this list.  | 
||
| ], | ||
| "simplifications": [ | ||
| { | ||
| "एक": "1" | ||
| }, | ||
| { | ||
| "दो": "2" | ||
| }, | ||
| { | ||
| "तीन": "3" | ||
| }, | ||
| { | ||
| "चार": "4" | ||
| }, | ||
| { | ||
| "पांच": "5" | ||
| }, | ||
| { | ||
| "छह": "6" | ||
| }, | ||
| { | ||
| "सात": "7" | ||
| }, | ||
| { | ||
| "आठ": "8" | ||
| }, | ||
| { | ||
| "नौ": "9" | ||
| }, | ||
| { | ||
| "दस": "10" | ||
| }, | ||
| { | ||
| "दश": "10" | ||
| }, | ||
| { | ||
| "ग्यारह": "11" | ||
| }, | ||
| { | ||
| "बारह": "12" | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -12,6 +12,13 @@ september: | |
| decade: | ||
| - decade | ||
| - decades | ||
| century: | ||
| - century | ||
| - centurys | ||
| - centuries | ||
| fortnight: | ||
| - fortnight | ||
| - fortnights | ||
| year: | ||
| - years | ||
| month: | ||
| 
          
            
          
           | 
    @@ -47,12 +54,32 @@ relative-type: | |
| - this decade | ||
| in 1 decade: | ||
| - next decade | ||
| 1 century ago: | ||
| - last century | ||
| - this century | ||
| in 1 century: | ||
| - next century | ||
| 1 fortnight ago: | ||
| - last fortnight | ||
| - this fortnight | ||
| in 1 fortnight: | ||
| - next fortnight | ||
| - coming fortnight | ||
| 
     | 
||
| relative-type-regex: | ||
| in \1 decade: | ||
| - in (\d+) decades? | ||
| \1 decade ago: | ||
| - (\d+) decades? ago | ||
| in \1 century: | ||
| - in (\d+) centurys? | ||
| - in (\d+) centuries? | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can remove the   | 
||
| \1 century ago: | ||
| - (\d+) centurys? ago | ||
| in \1 fortnight: | ||
| - in (\d+) fortnight? | ||
| \1 fortnight ago: | ||
| - (\d+) fortnight? ago | ||
| 
     | 
||
| simplifications: | ||
| - an: '1' | ||
| 
          
            
          
           | 
    ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -10,6 +10,9 @@ november: | |
| - नवम्बर | ||
| december: | ||
| - दिसम्बर | ||
| decade: | ||
| - दशक | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add the plural for this as well, e.g. दशकों There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Thanks For Suggestions I'll be Implementing Them ASAP .... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊.  | 
||
| - दशकों | ||
| 
     | 
||
| year: | ||
| - साल | ||
| 
        
          
        
         | 
    @@ -29,7 +32,44 @@ ago: | |
| in: | ||
| - में | ||
| - बाद | ||
| - पश्चात | ||
| - मे | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is repeated as well.  | 
||
| 
     | 
||
| relative-type: | ||
| 2 day ago: | ||
| - परसों | ||
| 1 decade ago: | ||
| - पिछला दशक | ||
| in 1 decade: | ||
| - अगला दशक | ||
| 
     | 
||
| relative-type-regex: | ||
| in \1 decade: | ||
| - (\d+) दशक में | ||
| - (\d+) दशकों में | ||
| - (\d+) दशक मे | ||
| - (\d+) दशकों मे | ||
| 
         
      Comment on lines
    
      +50
     to 
      +51
    
   
  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Repeated as the above two expressions.  | 
||
| - (\d+) दशक बाद | ||
| - (\d+) दशकों बाद | ||
| - (\d+) दशक पश्चात | ||
| - (\d+) दशकों पश्चात | ||
| 
     | 
||
| \1 decade ago: | ||
| - (\d+) दशक पहले | ||
| - (\d+) दशकों पहले | ||
| 
     | 
||
| 
     | 
||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just a nitpick: there is an extra line here.  | 
||
| simplifications: | ||
| - एक: '1' | ||
| - दो: '2' | ||
| - तीन: '3' | ||
| - चार: '4' | ||
| - पांच: '5' | ||
| - छह: '6' | ||
| - सात: '7' | ||
| - आठ: '8' | ||
| - नौ: '9' | ||
| - दस: '10' | ||
| - दश: '10' | ||
| - ग्यारह: '11' | ||
| - बारह: '12' | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to add a new line here.  | 
||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -57,6 +57,20 @@ def test_relative_past_dates_with_time_as_period(self, date_string, ago, period) | |
| 
     | 
||
| @parameterized.expand([ | ||
| # English dates | ||
| param('1 fortnight', ago={'days': 14}, period='day'), | ||
| param('last fortnight', ago={'days': 14}, period='day'), | ||
| param('14 fortnight', ago={'days': 196}, period='day'), | ||
| param('a fortnight ago', ago={'days': 14}, period='day'), | ||
| param("1 century", ago={'years': 100}, period='year'), | ||
| param("1 century 2 years", ago={'years': 102}, period='year'), | ||
| param("1 century 12 months", ago={'years': 100, 'months': 12}, period='month'), | ||
| param("1 century and 11 months", ago={'years': 100, 'months': 11}, period='month'), | ||
| param("last century", ago={'years': 100}, period='year'), | ||
| param("a century ago", ago={'years': 100}, period='year'), | ||
| param("6 centurys", ago={'years': 600}, period='year'), | ||
| param("10 centuries", ago={'years': 1000}, period='year'), | ||
| param("2 century ago", ago={'years': 200}, period='year'), | ||
| param("two centuries ago", ago={'years': 200}, period='year'), | ||
| param("1 decade", ago={'years': 10}, period='year'), | ||
| param("1 decade 2 years", ago={'years': 12}, period='year'), | ||
| param("1 decade 12 months", ago={'years': 10, 'months': 12}, period='month'), | ||
| 
          
            
          
           | 
    @@ -353,6 +367,8 @@ def test_relative_past_dates_with_time_as_period(self, date_string, ago, period) | |
| param('1 वर्ष, 8 महीने, 2 सप्ताह', ago={'years': 1, 'months': 8, 'weeks': 2}, period='week'), | ||
| param('1 वर्ष 7 महीने', ago={'years': 1, 'months': 7}, period='month'), | ||
| param('आज', ago={'days': 0}, period='day'), | ||
| param('1 दशक', ago={'years': 10}, period='year'), | ||
| param('1 दशक पहले', ago={'years': 10}, period='year'), | ||
| 
         
      Comment on lines
    
      +370
     to 
      +371
    
   
  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added a few suggestions above to improve the Hindi test cases. Please have a look. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe these test cases can be added here as well 
  | 
||
| 
     | 
||
| # af | ||
| param("2 uur gelede", ago={'hours': 2}, period='day'), | ||
| 
          
            
          
           | 
    @@ -576,6 +592,18 @@ def test_relative_past_dates(self, date_string, ago, period): | |
| 
     | 
||
| @parameterized.expand([ | ||
| # English dates | ||
| param('1 fortnight', ago={'days': 14}, period='day'), | ||
| param('last fortnight', ago={'days': 14}, period='day'), | ||
| param('14 fortnight', ago={'days': 196}, period='day'), | ||
| param('a fortnight ago', ago={'days': 14}, period='day'), | ||
| param("1 century", ago={'years': 100}, period='year'), | ||
| param("1 century 2 years", ago={'years': 102}, period='year'), | ||
| param("1 century 12 months", ago={'years': 100, 'months': 12}, period='month'), | ||
| param("1 century and 11 months", ago={'years': 100, 'months': 11}, period='month'), | ||
| param("last century", ago={'years': 100}, period='year'), | ||
| param("a century ago", ago={'years': 100}, period='year'), | ||
| param("6 centurys", ago={'years': 600}, period='year'), | ||
| param("10 centuries", ago={'years': 1000}, period='year'), | ||
| param("1 decade", ago={'years': 10}, period='year'), | ||
| param("1 decade 2 years", ago={'years': 12}, period='year'), | ||
| param("1 decade 12 months", ago={'years': 10, 'months': 12}, period='month'), | ||
| 
          
            
          
           | 
    @@ -841,6 +869,10 @@ def test_relative_past_dates(self, date_string, ago, period): | |
| param('1 वर्ष, 8 महीने, 2 सप्ताह', ago={'years': 1, 'months': 8, 'weeks': 2}, period='week'), | ||
| param('1 वर्ष 7 महीने', ago={'years': 1, 'months': 7}, period='month'), | ||
| param('आज', ago={'days': 0}, period='day'), | ||
| param('1 दशक पहले', ago={'years': 10}, period='year'), | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a few more test cases for the Hindi version here? For e.g. 
 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊.  | 
||
| param('1 दशक पूर्व', ago={'years': 10}, period='year'), | ||
| param('दो दशक पहले', ago={'years': 20}, period='year'), | ||
| param('10 दशकों पहले', ago={'years': 100}, period='year'), | ||
| 
     | 
||
| # af | ||
| param("2 uur gelede", ago={'hours': 2}, period='day'), | ||
| 
          
            
          
           | 
    @@ -1066,6 +1098,18 @@ def test_normalized_relative_dates(self, date_string, ago, period): | |
| 
     | 
||
| @parameterized.expand([ | ||
| # English dates | ||
| param('in a fortnight', in_future={'days': 14}, period='day'), | ||
| param('next fortnight', in_future={'days': 14}, period='day'), | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure, but do we support  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊.  | 
||
| param('coming fortnight', in_future={'days': 14}, period='day'), | ||
| param('in coming fortnight', in_future={'days': 14}, period='day'), | ||
| param('in 1 century 2 months', in_future={'years': 100, 'months': 2}, period='month'), | ||
| param('in 10 century', in_future={'years': 1000}, period='year'), | ||
| 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 3 centuries', in_future={'years': 300}, period='year'), | ||
| param('in 10 centuries', in_future={'years': 1000}, 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'), | ||
| 
          
            
          
           | 
    @@ -1160,6 +1204,11 @@ def test_normalized_relative_dates(self, date_string, ago, period): | |
| param('17 सेकंड बाद', in_future={'seconds': 17}, period='day'), | ||
| param('1 वर्ष, 5 महीने, 1 सप्ताह में', | ||
| in_future={'years': 1, 'months': 5, 'weeks': 1}, period='week'), | ||
| param('1 दशक में', in_future={'years': 10}, period='year'), | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we also add a few more test cases for the Hindi version here? For e.g. 
 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊.  | 
||
| param('पांच दशक बाद', in_future={'years': 50}, period='year'), | ||
| param('दश दशक पश्चात', in_future={'years': 100}, period='year'), | ||
| param('9 दशकों मे', in_future={'years': 90}, period='year'), | ||
| 
     | 
||
| 
     | 
||
| # af | ||
| param("oor 10 jaar", in_future={'years': 10}, period='year'), | ||
| 
          
            
          
           | 
    ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💄 You removed the last empty line 🙂