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

Detect hours with period/dot as separator #741

Merged
merged 3 commits into from Jul 11, 2020

Conversation

noviluni
Copy link
Collaborator

@noviluni noviluni commented Jul 3, 2020

fixes: #643
fixes: #422

I worked on a solution for this issue and I got this. This is fully working and I added different cases to the tests coming from the issues. However, I think that this part of the code should be heavily refactored, as it's really hard to read, understand, and follow.

Solving this is not as trivial as it seems, because we use dots to separate the tokens, so it's hard to know when it's a valid HH.MM.

@noviluni noviluni added this to the v1.0.0 milestone Jul 3, 2020
@codecov
Copy link

codecov bot commented Jul 7, 2020

Codecov Report

Merging #741 into master will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #741      +/-   ##
==========================================
+ Coverage   95.34%   95.42%   +0.08%     
==========================================
  Files         304      304              
  Lines        2622     2668      +46     
==========================================
+ Hits         2500     2546      +46     
  Misses        122      122              
Impacted Files Coverage Δ
dateparser/parser.py 99.02% <100.00%> (+0.09%) ⬆️
dateparser/conf.py 100.00% <0.00%> (ø)
dateparser/search/__init__.py 100.00% <0.00%> (ø)
dateparser/languages/locale.py 98.65% <0.00%> (ø)
dateparser/utils/__init__.py 97.03% <0.00%> (+0.23%) ⬆️

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 689390e...2f57804. Read the comment docs.

@noviluni noviluni requested a review from Gallaecio July 10, 2020 12:15
Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

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

Well, it works, and it seems as readable as things can get without a big refactoring, so ✔️

@noviluni noviluni merged commit 4f74470 into scrapinghub:master Jul 11, 2020
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

Successfully merging this pull request may close these issues.

time dot as delimiter Doesn't support official Finnish H.MM hour/minute separator
2 participants