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

[EN DateTimeV2] Support for [minutes] past [hour] #3063

Merged
merged 23 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 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
9512381
[EN DateTimeV2] Support [minutes] past [hour]
andrew-gradinari Jan 3, 2023
7375abd
Update DateTimeModel tests
andrew-gradinari Mar 2, 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 @@ -160,7 +160,7 @@ public static class DateTimeDefinitions
public const string LunchRegex = @"\blunchtime\b";
public const string NightRegex = @"\b(mid)?night\b";
public const string CommonDatePrefixRegex = @"^[\.]";
public static readonly string LessThanOneHour = $@"(?<lth>(a\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\s+(minutes?|mins?))|{DeltaMinuteNumRegex}(\s+(minutes?|mins?)))";
public static readonly string LessThanOneHour = $@"(?<lth>(a\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\s+(minutes?|mins?)|(?=\s+past))|{DeltaMinuteNumRegex}(\s+(minutes?|mins?)|(?=\s+past)))";
public static readonly string WrittenTimeRegex = $@"(?<writtentime>{HourNumRegex}\s+{MinuteNumRegex}(\s+(minutes?|mins?))?)";
public static readonly string TimePrefix = $@"(?<prefix>{LessThanOneHour}\s+(past|to))";
public static readonly string TimeSuffix = $@"(?<suffix>{AmRegex}|{PmRegex}|{OclockRegex})";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public class EnglishDateTime {

public static final String CommonDatePrefixRegex = "^[\\.]";

public static final String LessThanOneHour = "(?<lth>(a\\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\\s+(minutes?|mins?))|{DeltaMinuteNumRegex}(\\s+(minutes?|mins?)))"
public static final String LessThanOneHour = "(?<lth>(a\\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\\s+(minutes?|mins?)|(?=\\s+past))|{DeltaMinuteNumRegex}(\\s+(minutes?|mins?)|(?=\\s+past)))"
.replace("{BaseDateTime.DeltaMinuteRegex}", BaseDateTime.DeltaMinuteRegex)
.replace("{DeltaMinuteNumRegex}", DeltaMinuteNumRegex);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export namespace EnglishDateTime {
export const LunchRegex = `\\blunchtime\\b`;
export const NightRegex = `\\b(mid)?night\\b`;
export const CommonDatePrefixRegex = `^[\\.]`;
export const LessThanOneHour = `(?<lth>(a\\s+)?quarter|three quarter(s)?|half( an hour)?|${BaseDateTime.DeltaMinuteRegex}(\\s+(minutes?|mins?))|${DeltaMinuteNumRegex}(\\s+(minutes?|mins?)))`;
export const LessThanOneHour = `(?<lth>(a\\s+)?quarter|three quarter(s)?|half( an hour)?|${BaseDateTime.DeltaMinuteRegex}(\\s+(minutes?|mins?)|(?=\\s+past))|${DeltaMinuteNumRegex}(\\s+(minutes?|mins?)|(?=\\s+past)))`;
export const WrittenTimeRegex = `(?<writtentime>${HourNumRegex}\\s+${MinuteNumRegex}(\\s+(minutes?|mins?))?)`;
export const TimePrefix = `(?<prefix>${LessThanOneHour}\\s+(past|to))`;
export const TimeSuffix = `(?<suffix>${AmRegex}|${PmRegex}|${OclockRegex})`;
Expand Down
2 changes: 1 addition & 1 deletion Patterns/English/English-DateTime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ NightRegex: !simpleRegex
CommonDatePrefixRegex: !simpleRegex
def: ^[\.]
LessThanOneHour: !nestedRegex
def: (?<lth>(a\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\s+(minutes?|mins?))|{DeltaMinuteNumRegex}(\s+(minutes?|mins?)))
def: (?<lth>(a\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\s+(minutes?|mins?)|(?=\s+past))|{DeltaMinuteNumRegex}(\s+(minutes?|mins?)|(?=\s+past)))
references: [ BaseDateTime.DeltaMinuteRegex, DeltaMinuteNumRegex ]
WrittenTimeRegex: !nestedRegex
def: (?<writtentime>{HourNumRegex}\s+{MinuteNumRegex}(\s+(minutes?|mins?))?)
Expand Down
102 changes: 102 additions & 0 deletions Specs/DateTime/English/DateTimeModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -25748,5 +25748,107 @@
}
}
]
},
{
"Input": "I made this purchase at 10 past 9",
"Context": {
"ReferenceDateTime": "2023-03-01T00:00:00"
},
"Results": [
{
"Text": "10 past 9",
"Start": 24,
"End": 32,
"TypeName": "datetimeV2.time",
"Resolution": {
"values": [
{
"timex": "T09:10",
"type": "time",
"value": "09:10:00"
},
{
"timex": "T21:10",
"type": "time",
"value": "21:10:00"
}
]
}
}
]
},
{
"Input": "It's 15 past seven o'clock",
"Context": {
"ReferenceDateTime": "2023-03-01T00:00:00"
},
"Results": [
{
"Text": "15 past seven o'clock",
"Start": 5,
"End": 25,
"TypeName": "datetimeV2.time",
"Resolution": {
"values": [
{
"timex": "T07:15",
"type": "time",
"value": "07:15:00"
},
{
"timex": "T19:15",
"type": "time",
"value": "19:15:00"
}
]
}
}
]
},
{
"Input": "I made this purchase at ten past 9 in the evening",
"Context": {
"ReferenceDateTime": "2023-03-01T00:00:00"
},
"Results": [
{
"Text": "ten past 9 in the evening",
"Start": 24,
"End": 48,
"TypeName": "datetimeV2.time",
"Resolution": {
"values": [
{
"timex": "T21:10",
"type": "time",
"value": "21:10:00"
}
]
}
}
]
},
{
"Input": "It's fifteen past eight in the morning",
"Context": {
"ReferenceDateTime": "2023-03-01T00:00:00"
},
"Results": [
{
"Text": "fifteen past eight in the morning",
"Start": 5,
"End": 37,
"TypeName": "datetimeV2.time",
"Resolution": {
"values": [
{
"timex": "T08:15",
"type": "time",
"value": "08:15:00"
}
]
}
}
]
}
]
44 changes: 44 additions & 0 deletions Specs/DateTime/English/TimeExtractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,50 @@
}
]
},
{
"Input": "I made this purchase at 10 past 9",
"Results": [
{
"Text": "10 past 9",
"Type": "time",
"Start": 24,
"Length": 9
}
]
},
{
"Input": "It's 15 past seven o'clock",
"Results": [
{
"Text": "15 past seven o'clock",
"Type": "time",
"Start": 5,
"Length": 21
}
]
},
{
"Input": "I made this purchase at ten past 9 in the evening",
"Results": [
{
"Text": "ten past 9 in the evening",
"Type": "time",
"Start": 24,
"Length": 25
}
]
},
{
"Input": "It's fifteen past eight in the morning",
"Results": [
{
"Text": "fifteen past eight in the morning",
"Type": "time",
"Start": 5,
"Length": 33
}
]
},
{
"Input": "I'll be back in the afternoon at 7",
"Results": [
Expand Down
80 changes: 80 additions & 0 deletions Specs/DateTime/English/TimeParser.json
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,86 @@
}
]
},
{
"Input": "I made this purchase at 10 past 9",
"Results": [
{
"Text": "10 past 9",
"Type": "time",
"Value": {
"Timex": "T09:10",
"FutureResolution": {
"time": "09:10:00"
},
"PastResolution": {
"time": "09:10:00"
}
},
"Start": 24,
"Length": 9
}
]
},
{
"Input": "It's 15 past seven o'clock",
"Results": [
{
"Text": "15 past seven o'clock",
"Type": "time",
"Value": {
"Timex": "T07:15",
"FutureResolution": {
"time": "07:15:00"
},
"PastResolution": {
"time": "07:15:00"
}
},
"Start": 5,
"Length": 21
}
]
},
{
"Input": "I made this purchase at ten past 9 in the evening",
"Results": [
{
"Text": "ten past 9 in the evening",
"Type": "time",
"Value": {
"Timex": "T21:10",
"FutureResolution": {
"time": "21:10:00"
},
"PastResolution": {
"time": "21:10:00"
}
},
"Start": 24,
"Length": 25
}
]
},
{
"Input": "It's fifteen past eight in the morning",
"Results": [
{
"Text": "fifteen past eight in the morning",
"Type": "time",
"Value": {
"Timex": "T08:15",
"FutureResolution": {
"time": "08:15:00"
},
"PastResolution": {
"time": "08:15:00"
}
},
"Start": 5,
"Length": 33
}
]
},
{
"Input": "I'll be back in the afternoon at 7",
"Results": [
Expand Down