[EN/DE/ES/...] 'Part of Day' rule coerces timespans
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 4.3k
- Forks
- 739
- PR merge metrics
- No merged PRs in 30d
Description
Some time spans are incorrectly interpreted, yielding values that seem caused by a defaulting rule. Parsing is correct, but when building the final Entitys for some reason the time span from and to are incorrect.
All of these report the correct time spans:
vormittags von 3 bis 11 Uhr
vormittags von 4 bis 11 Uhr
...
vormittags von 10 bis 11 Uhr
If the lower bound is 1 or 2 the lower bound is (incorrectly) set to 03:00.
On the other side, if the upper bound is 12 or greater then the time span defaults to 03:00 to 12:00 consistently. I tracked down the issue to the rule time-of-day (latent):
As far as I understand, 'latent' means that there's some ambiguity. For example, the number 7 could mean several things depending on the context.
Lets change this rule and use the check n < 13 like in the EN version:
This will no longer break the lower bound when the upper bound is 12. Nevertheless, the issue remains for the upper bound: values 12 ... as upper bound result in ranges 03:00 to 12:00 consistently. Do these values ring any bell? some kind of defaulting rule?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Duckling/Time/DE/Rules.hs at the time-of-day (latent) rule and compare it with the corresponding rule in Duckling/Time/EN/Rules.hs. Reproduce the German vormittags von 1 bis 11 Uhr and vormittags von 3 bis 12 Uhr cases, then trace entity construction to identify why the bounds become 03:00 or 12:00. Done means the reported lower and upper time bounds are preserved correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- internationalization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100