-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a context-free grammar to simplify parsing (#36)
* try lark cfg * fixes #35 * support just a or p for meridiem * basic support for ranges, distribute date, meridiem * distribute meridiem across choices * optional comma * distribute meridiem across time objects too * two more tests * support plaintext times/dates/weekdaysc * support distributing time across multiple dates * distribute across ranges * support (time date) and distribute dates from last or first * hardcoded support for duration in minutes * more todos * added support for past instead of future - fixes #7 * rename to tfh * new config for transformer * infer datetimes to match old behavior * modernize tests * added tests for gh issues (not fixed yet) * support most duration possibilities, fixes #22 * test for case insensitivity, fixes #24 * added support for in/for/ago, fixes #25 * hm how to deal with random text? * fixed dash dates * handle ambiguous day or token with new rule * support for day suffixes * support just day-th * some comments * added lark as dep, move now to config * mention lists too * Update README.md * starting transformer refactor * pass a few tests + add range/list custom objs * more generalized infer * passed all no-inference tests * pass simple date/time tests with inference * pass all datetime inference tests * pass all tests - support range infer * distribute month and time * simpler datetime infer, fixes #8 * only infer if not defined * distribute month across days * passed the other distribute month test too * catch case with two ambiguous tokens * allow comma and or * drop unused files * rename unknown -> ambiguous * finally allow unknown tokens, fixes #26 * oops added fully spelled out weekdays * added more weekdays * added more text * update readme with up-to-date information * annotate type * nits for formatting * nits for formatting, drop old section * Update README.md * 2x faster tests just by reusing grammar ast * version bump + update to include readme * moved grammar to dedicated file * drop unneeded code * nit delete byline * updated pytest, drop travis * fixed coverage settings * move makefile into readme, no need * add a note about recurrence, from a different PR
- Loading branch information
Showing
16 changed files
with
852 additions
and
1,592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[run] | ||
include = */timefhuman/* | ||
include = timefhuman/* | ||
omit = tests/* | ||
|
||
[report] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include README.md | ||
include LICENSE | ||
include timefhuman/grammar.lark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.