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

Parsing Finnish version of "on monday", "in October" #243

Closed
klvbdmh opened this issue Oct 14, 2016 · 1 comment
Closed

Parsing Finnish version of "on monday", "in October" #243

klvbdmh opened this issue Oct 14, 2016 · 1 comment

Comments

@klvbdmh
Copy link

klvbdmh commented Oct 14, 2016

dateparser cannot recognize certain Finnish versions of days and months.

Code that reproduces the issue

In[2]: import dateparser
In[3]: dateparser.parse('tiistaina, 27. lokakuuta 2015')

Expected behavior

The above code should return datetime.datetime(2015, 10, 27, 0, 0)

Observed behavior

The above code returns None.

Notice that dateparser correctly deals with regular forms:

In[4]: dateparser.parse('tiistai, 27. lokakuu 2015')
Out[4]: 
datetime.datetime(2015, 10, 27, 0, 0)

It also deals with similar cases in English:

In[5]: dateparser.parse('on friday')
Out[5]: 
datetime.datetime(2016, 10, 7, 0, 0)
In[6]: dateparser.parse('in October')
Out[6]: 
datetime.datetime(2016, 10, 14, 0, 0)

Notes

More details on this stackoverflow question: http://stackoverflow.com/questions/33375709/python-strptime-finnish
Link to list of time expressions in Finnish: http://people.uta.fi/~km56049/finnish/timexp.html

@vaelma
Copy link
Contributor

vaelma commented Oct 17, 2016

I'm working on a fix, and the latest commit should contain the functionality you need (among other things) in the "fin-datefix" branch: https://github.com/vaelma/dateparser/tree/fin-datefix

If you can, please see if everything is working as you would expect.

I'll do a pull request after I get a confirmation on a certain issue on Gitter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants