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

[DE DateTimeV2] Fix for invalid dates #3094

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
73b8241
[ES Temperature] Support informal degrees and fix issue in ES auto-ge…
tellarin Mar 3, 2022
365d66f
[Python] Enabling SpanishMexican culture in Number/Unit/DateTimveV2 (…
colm-dillon Mar 3, 2022
ff11e07
[Python] Add Portuguese support for DateTimeV2 (#2876)
samhickey25 Mar 3, 2022
3e520e5
[KO Number] Fixed incorrect extraction of number from datetime mentio…
aitelint Mar 11, 2022
f703254
[.NET Timexlib] Fix timex-to-string conversion of English ordinals 11…
shana Mar 12, 2022
45b0c3b
[EN .NET] Workaround for TimexProperty.ToString() to not crash on Dat…
shana Mar 14, 2022
d6e3692
Merge pull request #24 from microsoft/master
Mar 30, 2022
30dbdaf
Merge pull request #29 from microsoft/master
Apr 28, 2022
3a2342a
Merge pull request #33 from microsoft/master
samhickey25 May 11, 2022
cd9ba48
Merge pull request #37 from microsoft/master
kevinwalshgen Jun 9, 2022
22f56fd
NLU-2966: Fix failing tests
kevinwalshgen Jun 10, 2022
c544eff
Revert "NLU-2966: Fix failing tests"
kevinwalshgen Jun 10, 2022
8f92c9a
Merge pull request #42 from microsoft/master
samhickey25 Jul 15, 2022
f14677d
Merge branch 'microsoft:master' into master
samhickey25 Aug 8, 2022
d631cbe
Merge branch 'microsoft:master' into master
rbrennangen Aug 15, 2022
a830707
Merge branch 'microsoft:master' into master
rbrennangen Aug 17, 2022
e378aa3
Merge branch 'microsoft:master' into master
rbrennangen Aug 31, 2022
86f14b8
Merge branch 'microsoft:master' into master
Conor-Keaney Nov 10, 2022
4451a53
Merge pull request #53 from microsoft/master
samhickey25 Dec 19, 2022
bde6680
Merge branch 'microsoft:master' into master
Conor-Keaney Jan 30, 2023
b03280c
Merge branch 'microsoft:master' into master
Conor-Keaney Feb 8, 2023
f11024b
Fix for German invalid dates
andrew-gradinari Apr 13, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static class DateTimeDefinitions
public static readonly string DateExtractor4 = $@"\b({DayRegex}\s*{MonthNumRegex}\s*{DateYearRegex})\b";
public static readonly string DateExtractor5 = $@"\b(({WeekDayRegex})(\s+|\s*,\s*))?({DayRegex}\s*[/\\\-\.]\s*({MonthNumRegex}|{MonthRegex})\s*[/\\\-\.]\s*{DateYearRegex})\b(?!\s*[/\\\-\.]\s*\d+)";
public static readonly string DateExtractor6 = $@"^[.]";
public static readonly string DateExtractor7 = $@"({DayRegex}\s*[\.]\s*{MonthNumRegex}[\.]){BaseDateTime.CheckDecimalRegex}";
public static readonly string DateExtractor7 = $@"\b({DayRegex}\s*[\.]\s*{MonthNumRegex}[\.]){BaseDateTime.CheckDecimalRegex}";
public static readonly string DateExtractor8 = $@"(?<=\b(am)\s+){DayRegex}[/\\\.]{MonthNumRegex}([/\\\.]{DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\b";
public static readonly string DateExtractor9 = $@"\b({DayRegex}\s*/\s*{MonthNumRegex}((\s+|\s*,\s*){DateYearRegex})?){BaseDateTime.CheckDecimalRegex}\b";
public static readonly string DateExtractor10 = $@"^[.]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public class GermanDateTime {
public static final String DateExtractor6 = "^[.]"
.replace("{WeekDayRegex}", WeekDayRegex);

public static final String DateExtractor7 = "({DayRegex}\\s*[\\.]\\s*{MonthNumRegex}[\\.]){BaseDateTime.CheckDecimalRegex}"
public static final String DateExtractor7 = "\\b({DayRegex}\\s*[\\.]\\s*{MonthNumRegex}[\\.]){BaseDateTime.CheckDecimalRegex}"
.replace("{MonthNumRegex}", MonthNumRegex)
.replace("{DayRegex}", DayRegex)
.replace("{BaseDateTime.CheckDecimalRegex}", BaseDateTime.CheckDecimalRegex);
Expand Down
2 changes: 1 addition & 1 deletion Patterns/German/German-DateTime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ DateExtractor6: !nestedRegex
def: ^[.]
references: [ WeekDayRegex ]
DateExtractor7: !nestedRegex
def: ({DayRegex}\s*[\.]\s*{MonthNumRegex}[\.]){BaseDateTime.CheckDecimalRegex}
def: \b({DayRegex}\s*[\.]\s*{MonthNumRegex}[\.]){BaseDateTime.CheckDecimalRegex}
references: [ MonthNumRegex, DayRegex, BaseDateTime.CheckDecimalRegex ]
DateExtractor8: !nestedRegex
def: (?<=\b(am)\s+){DayRegex}[/\\\.]{MonthNumRegex}([/\\\.]{DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class GermanDateTime:
DateExtractor4 = f'\\b({DayRegex}\\s*{MonthNumRegex}\\s*{DateYearRegex})\\b'
DateExtractor5 = f'\\b(({WeekDayRegex})(\\s+|\\s*,\\s*))?({DayRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DateYearRegex})\\b(?!\\s*[/\\\\\\-\\.]\\s*\\d+)'
DateExtractor6 = f'^[.]'
DateExtractor7 = f'({DayRegex}\\s*[\\.]\\s*{MonthNumRegex}[\\.]){BaseDateTime.CheckDecimalRegex}'
DateExtractor7 = f'\\b({DayRegex}\\s*[\\.]\\s*{MonthNumRegex}[\\.]){BaseDateTime.CheckDecimalRegex}'
DateExtractor8 = f'(?<=\\b(am)\\s+){DayRegex}[/\\\\\\.]{MonthNumRegex}([/\\\\\\.]{DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\\b'
DateExtractor9 = f'\\b({DayRegex}\\s*/\\s*{MonthNumRegex}((\\s+|\\s*,\\s*){DateYearRegex})?){BaseDateTime.CheckDecimalRegex}\\b'
DateExtractor10 = f'^[.]'
Expand Down
11 changes: 11 additions & 0 deletions Specs/DateTime/German/DateExtractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,5 +350,16 @@
"Length": 26
}
]
},
{
"Input": "Mein Geburtsdatum ist der 22.04.1990",
"Results": [
{
"Text": "der 22.04.1990",
"Type": "date",
"Start": 22,
"Length": 14
}
]
}
]
16 changes: 14 additions & 2 deletions Specs/DateTime/German/DatePeriodExtractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@
},
{
"Input": "Zeigen Sie mir die Aufzeichnungen vom August 99",
"NotSupportedByDesign": "javascript",
"NotSupported": "javascript",
"Results": [
{
"Text": "August 99",
Expand All @@ -766,5 +766,17 @@
"Length": 9
}
]
},
{
"Input": "Ich komme am 32.04.2023 wieder.",
"NotSupported": "javascript",
"Results": [
{
"Text": "04.2023",
"Type": "daterange",
"Start": 16,
"Length": 7
}
]
}
]
]
52 changes: 49 additions & 3 deletions Specs/DateTime/German/DateTimeModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@
"Context": {
"ReferenceDateTime": "2016-11-07T00:00:00"
},
"NotSupported": "python",
"Results": [
{
"Text": "vom 12. januar 2016 bis zum 22.01.2016",
Expand Down Expand Up @@ -3910,7 +3909,7 @@
"Context": {
"ReferenceDateTime": "2018-11-07T00:00:00"
},
"NotSupported": "java, javascript, python",
"NotSupported": "java, javascript",
"Results": [
{
"Text": "so 27.02.2022",
Expand Down Expand Up @@ -5604,5 +5603,52 @@
}
}
]
},
{
"Input": "Ich komme am 32.04.2023 wieder.",
"Context": {
"ReferenceDateTime": "2016-11-07T00:00:00"
},
"Results": [
{
"Text": "04.2023",
"Start": 16,
"End": 22,
"TypeName": "datetimeV2.daterange",
"Resolution": {
"values": [
{
"timex": "2023-04",
"type": "daterange",
"start": "2023-04-01",
"end": "2023-05-01"
}
]
}
}
]
},
{
"Input": "Mein Geburtsdatum ist der 22.04.1990",
"Context": {
"ReferenceDateTime": "2016-11-07T00:00:00"
},
"Results": [
{
"Text": "der 22.04.1990",
"Start": 22,
"End": 35,
"TypeName": "datetimeV2.date",
"Resolution": {
"values": [
{
"timex": "1990-04-22",
"type": "date",
"value": "1990-04-22"
}
]
}
}
]
}
]
]