-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NL DateTimeV2] Dutch datetime support in Python (#3048)
- Loading branch information
1 parent
c48d08a
commit 4071e4e
Showing
50 changed files
with
8,783 additions
and
3,063 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
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 |
---|---|---|
|
@@ -24,3 +24,4 @@ | |
from .chinese import * | ||
from .french import * | ||
from .portuguese import * | ||
from .dutch import * |
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 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
26 changes: 26 additions & 0 deletions
26
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/__init__.py
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,26 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
from .base_configs import * | ||
from .common_configs import * | ||
from .duration_extractor_config import * | ||
from .date_extractor_config import * | ||
from .time_extractor_config import * | ||
from .datetime_extractor_config import * | ||
from .dateperiod_extractor_config import * | ||
from .timeperiod_extractor_config import * | ||
from .datetimeperiod_extractor_config import * | ||
from .set_extractor_config import * | ||
from .holiday_extractor_config import * | ||
from .merged_extractor_config import * | ||
from .duration_parser_config import * | ||
from .date_parser_config import * | ||
from .time_parser_config import * | ||
from .datetime_parser_config import * | ||
from .dateperiod_parser_config import * | ||
from .timeperiod_parser_config import * | ||
from .datetimeperiod_parser_config import * | ||
from .set_parser_config import * | ||
from .holiday_parser_config import * | ||
from .merged_parser_config import * | ||
from .parsers import * |
95 changes: 95 additions & 0 deletions
95
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/base_configs.py
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,95 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
from typing import Pattern | ||
from recognizers_text.utilities import RegExpUtility | ||
from ...resources.dutch_date_time import DutchDateTime | ||
from ..base_date import DateTimeUtilityConfiguration | ||
|
||
|
||
class DutchDateTimeUtilityConfiguration(DateTimeUtilityConfiguration): | ||
@property | ||
def date_unit_regex(self) -> Pattern: | ||
return self._date_unit_regex | ||
|
||
@property | ||
def check_both_before_after(self) -> Pattern: | ||
return self._check_both_before_after | ||
|
||
@property | ||
def range_prefix_regex(self) -> Pattern: | ||
return self._range_prefix_regex | ||
|
||
@property | ||
def ago_regex(self) -> Pattern: | ||
return self._ago_regex | ||
|
||
@property | ||
def later_regex(self) -> Pattern: | ||
return self._later_regex | ||
|
||
@property | ||
def in_connector_regex(self) -> Pattern: | ||
return self._in_connector_regex | ||
|
||
@property | ||
def range_unit_regex(self) -> Pattern: | ||
return self._range_unit_regex | ||
|
||
@property | ||
def am_desc_regex(self) -> Pattern: | ||
return self._am_desc_regex | ||
|
||
@property | ||
def pm_desc__regex(self) -> Pattern: | ||
return self._pm_desc__regex | ||
|
||
@property | ||
def am_pm_desc_regex(self) -> Pattern: | ||
return self._am_pm_desc_regex | ||
|
||
@property | ||
def time_unit_regex(self) -> Pattern: | ||
return self._time_unit_regex | ||
|
||
@property | ||
def within_next_prefix_regex(self) -> Pattern: | ||
return self._within_next_prefix_regex | ||
|
||
@property | ||
def common_date_prefix_regex(self) -> Pattern: | ||
return self._common_date_prefix_regex | ||
|
||
@property | ||
def since_year_suffix_regex(self) -> Pattern: | ||
return self._since_year_suffix_regex | ||
|
||
def __init__(self): | ||
self._later_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.LaterRegex) | ||
self._ago_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.AgoRegex) | ||
self._in_connector_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.InConnectorRegex) | ||
self._range_unit_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.RangeUnitRegex) | ||
self._am_desc_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.AmDescRegex) | ||
self._pm_desc__regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.PmDescRegex) | ||
self._am_pm_desc_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.AmPmDescRegex) | ||
self._time_unit_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.TimeUnitRegex) | ||
self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.WithinNextPrefixRegex) | ||
self._common_date_prefix_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.CommonDatePrefixRegex) | ||
self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter | ||
self._range_prefix_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.RangePrefixRegex | ||
) | ||
self._date_unit_regex = RegExpUtility.get_safe_reg_exp( | ||
DutchDateTime.DateUnitRegex | ||
) | ||
self._since_year_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SinceYearSuffixRegex) |
Oops, something went wrong.