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

Enumeinträge für Issue 26 hinzugefügt: #28

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
74 changes: 21 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,27 @@ V 1.0
## Erinnerung für den Parser
- Auf falsche Eingaben überprüfen

## Liste an Events

- ``christmas``

````markdown
+ Year configurable

When: 24.12.YYYY

Alias:
- next christmas
- xmas
- next xmas
````

- ``silvester``

````markdown
+ Year configurable

When: 31.12.YYYY

Alias:
- next silvester
- new years eve
- next new years eve
````

- ``eastern``

````markdown
+ Year configurable

When: <NonFixedDay>.04.YYYY

Alias:
- easter
- next eastern
- next easter
````

- ``nicholas``

````markdown
+ Year configurable

When: 05.12.YYYY

Alias:
- next nicholas
- nicholas day
- next nicholas day
`````
## List of events

- ``christmas (next christmas, xmas, next xmas)``: 24.12.YYYY
- ``silvester (next silvester, new years eve, next new years eve)`` 31.12.YYYY
- ``eastern (next eastern, easter, next easter)``: DD.04.YYYY
- ``nicholas (next nicholas, nicholas day, next nicholas day)``: 05.12.YYYY
- ``halloween (next halloween)``: 31.10.YYYY
- ``valentines (next valentines, valentines day, next valentines day)``: 14.02.YYYY
- ``april fools day (next april fools day, april fool day, next april fool day)``: 01.04.YYYY
- ``saint patrick's day [patrick's/patricks](next saint patrick's day, saint patricks day, next saint patricks day)``: 17.03.YYYY
- ``thanksgiving (next thanksgiving)``: 26.11.YYYY
- ``summer begin (summer, next summer, begin of summer, begin of the summer)``
- ``winter begin (winter, next winter, begin of winter, begin of the winter)``
- ``fall begin [fall/autumn](fall, next fall, begin of fall, begin of the fall)``
- ``spring begin (spring, next spring, begin of spring, begin of the spring)``
- ``summer end (end of summer, end of the summer)``
- ``winter end (end of winter, end of the winter)``
- ``fall end [fall/autumn](end of fall, end of the fall)``
- ``spring end (end of spring, end of the spring)``
- ``aoc begin [aoc/advent of code](aoc, next aoc, begin of aoc, begin of the aoc)``
- ``aoc end [aoc/advent of code](end of aoc, end of the aoc)``

## Ideen für Datenarchitektur vom Parser zum Evaluator

Expand Down
22 changes: 20 additions & 2 deletions datetimeparser/baseclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,26 @@ class Constants:
EASTERN = Constant('eastern', ['next eastern', 'easter', 'next easter'])
NICHOLAS = Constant('nicholas', ['next nicholas', 'nicholas day', 'next nicholas day'])
HALLOWEEN = Constant('halloween', ['next halloween'])

ALL = [CHRISTMAS, SILVESTER, EASTERN, NICHOLAS]
APRIL_FOOLS_DAY = Constant('april fools day', ['next april fools day', 'april fool day', 'next april fool day'])
THANKSGIVING = Constant('thanksgiving', ['next thanksgiving'])
SAINT_PATRICKS_DAY = Constant('saint patrick\'s day', ['next saint patrick\'s day', 'saint patricks day', 'next saint patricks day'])
VALENTINES_DAY = Constant('valentines day', ['next valentines day', 'valentine', 'next valentine'])

SUMMER_BEGIN = Constant('summer begin', ['summer', 'next summer', 'begin of summer', 'begin of the summer'])
WINTER_BEGIN = Constant('winter begin', ['winter', 'next winter', 'begin of winter', 'begin of the winter'])
SPRING_BEGIN = Constant('spring begin', ['spring', 'next spring', 'begin of spring', 'begin of the spring'])
FALL_BEGIN = Constant('fall begin', ['fall', 'begin of fall', 'begin of the fall', 'autumn begin', 'autumn', 'begin of autumn', 'begin of the autumn'])
SUMMER_END = Constant('summer end', ['end of summer', 'end of the summer'])
WINTER_END = Constant('winter end', ['end of winter', 'end of the winter'])
SPRING_END = Constant('spring end', ['end of spring', 'end of the spring'])
FALL_END = Constant('fall end', ['end of fall', 'end of the fall', 'autumn end', 'end of autumn', 'end of the autumn'])

BEGIN_AOC = Constant('aoc begin', ['aoc', 'next aoc', 'begin of aoc', 'begin of the aoc', 'advent of code begin', 'advent of code', 'next advent of code', 'begin of advent of code', 'begin of the advent of code'])
END_AOC = Constant('aoc end', ['end of aoc', 'end of the aoc', 'advent of code end', 'end of advent of code', 'end of the advent of code'])

ALL = [CHRISTMAS, SILVESTER, EASTERN, NICHOLAS, HALLOWEEN, APRIL_FOOLS_DAY, THANKSGIVING, SAINT_PATRICKS_DAY,
SUMMER_BEGIN, WINTER_BEGIN, SPRING_BEGIN, FALL_BEGIN, SUMMER_END, WINTER_END, SPRING_END, FALL_END,
BEGIN_AOC, END_AOC]

class NumberConstants:
# TODO: Add up to 31?
Expand Down
3 changes: 2 additions & 1 deletion tests/general_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
today = datetime.datetime.today()

tests = [
"next 3 years and 2 months"
"next 3 years and 2 months",
"begin of summer"
]

# TODO
Expand Down