Skip to content

delete SKIP_TOKENS_PARSER setting #728

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

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dateparser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,16 @@ def __init__(self, tokens, settings):

skip_index = []
skip_component = None
skip_tokens = ["t", "year", "hour", "minute"]

for index, token_type_original_index in enumerate(self.filtered_tokens):

if index in skip_index:
continue

token, type, original_index = token_type_original_index

if token in settings.SKIP_TOKENS_PARSER:
if token in skip_tokens:
continue

if self.time is None:
Expand Down
1 change: 0 additions & 1 deletion dateparser_data/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
'PREFER_DATES_FROM': 'current_period',
'PREFER_DAY_OF_MONTH': 'current',
'SKIP_TOKENS': ["t"],
'SKIP_TOKENS_PARSER': ["t", "year", "hour", "minute"],
'TIMEZONE': 'local',
'TO_TIMEZONE': False,
'RETURN_AS_TIMEZONE_AWARE': 'default',
Expand Down