diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs index 379d2710f5..d10b0c09e0 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs @@ -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 = $@"^[.]"; diff --git a/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/GermanDateTime.java b/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/GermanDateTime.java index beae66f3eb..d695fb8a75 100644 --- a/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/GermanDateTime.java +++ b/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/GermanDateTime.java @@ -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); diff --git a/Patterns/German/German-DateTime.yaml b/Patterns/German/German-DateTime.yaml index 410ad403fd..88d4e28224 100644 --- a/Patterns/German/German-DateTime.yaml +++ b/Patterns/German/German-DateTime.yaml @@ -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 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/german_date_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/german_date_time.py index 7c6db72999..d7fc777ef6 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/german_date_time.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/german_date_time.py @@ -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'^[.]' diff --git a/Specs/DateTime/German/DateExtractor.json b/Specs/DateTime/German/DateExtractor.json index 3ca097d27a..96303d29bd 100644 --- a/Specs/DateTime/German/DateExtractor.json +++ b/Specs/DateTime/German/DateExtractor.json @@ -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 + } + ] } ] diff --git a/Specs/DateTime/German/DatePeriodExtractor.json b/Specs/DateTime/German/DatePeriodExtractor.json index b229fabe32..d703399275 100644 --- a/Specs/DateTime/German/DatePeriodExtractor.json +++ b/Specs/DateTime/German/DatePeriodExtractor.json @@ -757,7 +757,7 @@ }, { "Input": "Zeigen Sie mir die Aufzeichnungen vom August 99", - "NotSupportedByDesign": "javascript", + "NotSupported": "javascript", "Results": [ { "Text": "August 99", @@ -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 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/DateTime/German/DateTimeModel.json b/Specs/DateTime/German/DateTimeModel.json index 2ecb46680f..7c6b8eca9f 100644 --- a/Specs/DateTime/German/DateTimeModel.json +++ b/Specs/DateTime/German/DateTimeModel.json @@ -286,7 +286,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "vom 12. januar 2016 bis zum 22.01.2016", @@ -3910,7 +3909,7 @@ "Context": { "ReferenceDateTime": "2018-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "so 27.02.2022", @@ -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" + } + ] + } + } + ] } -] \ No newline at end of file +]