Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

parsing time intervals incorrectly #105

@inferense

Description

@inferense
  • ctparse - Parse natural language time expressions in pytho version: 0.3.0
  • Python version: 3.8
  • Operating System: macOS BigSur

Description

Time intervals where first int is larger than the 2nd int like in "tomorrow 9-5" are parsed always incorrectly. In such case this should result in a resolution of 9am-5pm (as there's no other feasible case for that parse). Instead, this parses the 2nd int as the next day end_time. Assuming this is due to the 24 hour system the parser uses.

r = ctparse("tomorrow 9-5")
r
Out[8]: CTParse(2021-02-23 09:00 (X/X) - 2021-02-24 05:00 (X/X), (114, 128, 136, 128, 'ruleHHMM', 'ruleHHMM', 'ruleTODTOD', 'ruleTomorrow', 'ruleDateInterval'), 4.300637883728172)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions