diff --git a/.NET/Microsoft.Recognizers.Text.DataDrivenTests/DateTime/TestDateTime_English.cs b/.NET/Microsoft.Recognizers.Text.DataDrivenTests/DateTime/TestDateTime_English.cs index f40eb647ee..504942bad7 100644 --- a/.NET/Microsoft.Recognizers.Text.DataDrivenTests/DateTime/TestDateTime_English.cs +++ b/.NET/Microsoft.Recognizers.Text.DataDrivenTests/DateTime/TestDateTime_English.cs @@ -257,5 +257,13 @@ public void DateTimeModelExperimentalMode(TestModel testSpec) { TestDateTimeAlt(testSpec); } + + [NetCoreTestDataSource] + [TestMethod] + public void DateTimeModelTasksMode(TestModel testSpec) + { + TestDateTimeAlt(testSpec); + } + } } diff --git a/.NET/Microsoft.Recognizers.Text.DataDrivenTests/TestHelpers.cs b/.NET/Microsoft.Recognizers.Text.DataDrivenTests/TestHelpers.cs index c94a73566f..5d6380c715 100644 --- a/.NET/Microsoft.Recognizers.Text.DataDrivenTests/TestHelpers.cs +++ b/.NET/Microsoft.Recognizers.Text.DataDrivenTests/TestHelpers.cs @@ -53,6 +53,7 @@ public enum Models DateTimeExtendedTypes, DateTimeComplexCalendar, DateTimeExperimentalMode, + DateTimeTasksMode, PhoneNumber, IpAddress, Mention, @@ -121,6 +122,7 @@ public static class TestContextExtensions { Models.DateTimeExtendedTypes, (test, culture) => DateTimeRecognizer.RecognizeDateTime(test.Input, culture, DateTimeOptions.ExtendedTypes, refTime: test.GetReferenceDateTime(), fallbackToDefaultCulture: false) }, { Models.DateTimeComplexCalendar, (test, culture) => DateTimeRecognizer.RecognizeDateTime(test.Input, culture, DateTimeOptions.ExtendedTypes | DateTimeOptions.CalendarMode | DateTimeOptions.EnablePreview, refTime: test.GetReferenceDateTime(), fallbackToDefaultCulture: false) }, { Models.DateTimeExperimentalMode, (test, culture) => DateTimeRecognizer.RecognizeDateTime(test.Input, culture, DateTimeOptions.ExperimentalMode, refTime: test.GetReferenceDateTime(), fallbackToDefaultCulture: false) }, + { Models.DateTimeTasksMode, (test, culture) => DateTimeRecognizer.RecognizeDateTime(test.Input, culture, options: DateTimeOptions.TasksMode, refTime: test.GetReferenceDateTime(), fallbackToDefaultCulture: false) }, { Models.PhoneNumber, (test, culture) => SequenceRecognizer.RecognizePhoneNumber(test.Input, culture, fallbackToDefaultCulture: false) }, { Models.IpAddress, (test, culture) => SequenceRecognizer.RecognizeIpAddress(test.Input, culture, fallbackToDefaultCulture: false) }, { Models.Mention, (test, culture) => SequenceRecognizer.RecognizeMention(test.Input, culture, fallbackToDefaultCulture: false) }, diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Arabic/Extractors/ArabicMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Arabic/Extractors/ArabicMergedExtractorConfiguration.cs index 046d08ed72..0f1c5779af 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Arabic/Extractors/ArabicMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Arabic/Extractors/ArabicMergedExtractorConfiguration.cs @@ -52,6 +52,9 @@ public class ArabicMergedExtractorConfiguration : BaseDateTimeOptionsConfigurati public static readonly Regex FailFastRegex = new Regex(DateTimeDefinitions.FailFastRegex, RegexFlags | RegexOptions.Compiled); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + public static readonly Regex[] TermFilterRegexes = { // one on one @@ -162,6 +165,8 @@ public ArabicMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => UnspecificTimePeriodRegex; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + Regex IMergedExtractorConfiguration.FailFastRegex => FailFastRegex; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/DateTimeOptions.cs b/.NET/Microsoft.Recognizers.Text.DateTime/DateTimeOptions.cs index 19b56a2682..0e068a7628 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/DateTimeOptions.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/DateTimeOptions.cs @@ -38,6 +38,11 @@ public enum DateTimeOptions /// NoProtoCache = 16, + /// + /// TasksMode, specific functionality that changes default behaviour for business reasons. + /// + TasksMode = 1048576, // 2 ^20 + /// /// FailFast, mode that aborts extraction/tagging quickly for non-entity cases. May be removed later. /// diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Dutch/Extractors/DutchMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Dutch/Extractors/DutchMergedExtractorConfiguration.cs index df3c719f42..7094a1e48f 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Dutch/Extractors/DutchMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Dutch/Extractors/DutchMergedExtractorConfiguration.cs @@ -52,6 +52,9 @@ public class DutchMergedExtractorConfiguration : BaseDateTimeOptionsConfiguratio public static readonly Regex PotentialAmbiguousRangeRegex = new Regex(DateTimeDefinitions.PotentialAmbiguousRangeRegex, RegexFlags); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + public static readonly Regex[] TermFilterRegexes = { // one on one @@ -152,6 +155,8 @@ public DutchMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => null; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + public Regex FailFastRegex { get; } = null; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/English/Extractors/EnglishMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/English/Extractors/EnglishMergedExtractorConfiguration.cs index d55211b500..f9b3725c1c 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/English/Extractors/EnglishMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/English/Extractors/EnglishMergedExtractorConfiguration.cs @@ -53,6 +53,10 @@ public class EnglishMergedExtractorConfiguration : BaseDateTimeOptionsConfigurat public static readonly Regex FailFastRegex = new Regex(DateTimeDefinitions.FailFastRegex, RegexFlags | RegexOptions.Compiled); + // Used to skip only year references in a text in TasksMode + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + public static readonly Regex[] TermFilterRegexes = { // one on one @@ -164,6 +168,8 @@ public EnglishMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => UnspecificTimePeriodRegex; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + Regex IMergedExtractorConfiguration.FailFastRegex => FailFastRegex; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Extractors/BaseMergedDateTimeExtractor.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Extractors/BaseMergedDateTimeExtractor.cs index 81d40c14f2..1c366268f9 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Extractors/BaseMergedDateTimeExtractor.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Extractors/BaseMergedDateTimeExtractor.cs @@ -223,6 +223,14 @@ private void AddTo(List dst, List src, string text } } + if ((config.Options & DateTimeOptions.TasksMode) != 0) + { + if (ShouldSkipOnlyYear(result)) + { + continue; + } + } + var isFound = false; var overlapIndexes = new List(); var firstIndex = -1; @@ -270,6 +278,15 @@ private bool ShouldSkipFromToMerge(ExtractResult er) return config.FromToRegex.IsMatch(er.Text); } + /*Under TasksMode: Should not treat a four-digit number as a daterange if the input text does not include a month or year reference. + It should not treat 2005 as a daterange in statements like "Milk 2005." + (The year 2005 should be treated as a number only.) + */ + private bool ShouldSkipOnlyYear(ExtractResult er) + { + return config.YearRegex.Match(er.Text).Value == er.Text; + } + private List FilterUnspecificDatePeriod(List ers) { ers.RemoveAll(o => this.config.UnspecificDatePeriodRegex.IsMatch(o.Text)); diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Extractors/IMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Extractors/IMergedExtractorConfiguration.cs index 459ba64a17..51d25085e4 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Extractors/IMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Extractors/IMergedExtractorConfiguration.cs @@ -67,6 +67,8 @@ public interface IMergedExtractorConfiguration : IDateTimeOptionsConfiguration // Regex to act as umbrella for key terms so that sentences that clearly don't have entities can be rejected quickly Regex FailFastRegex { get; } + Regex YearRegex { get; } + StringMatcher SuperfluousWordMatcher { get; } Dictionary AmbiguityFiltersDict { get; } diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/French/Extractors/FrenchMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/French/Extractors/FrenchMergedExtractorConfiguration.cs index c74bc649ab..e7f3f61577 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/French/Extractors/FrenchMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/French/Extractors/FrenchMergedExtractorConfiguration.cs @@ -57,6 +57,9 @@ public class FrenchMergedExtractorConfiguration : BaseDateTimeOptionsConfigurati public static readonly StringMatcher SuperfluousWordMatcher = new StringMatcher(); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + private const RegexOptions RegexFlags = RegexOptions.Singleline | RegexOptions.ExplicitCapture; public FrenchMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) @@ -141,6 +144,8 @@ public FrenchMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => null; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + public Regex FailFastRegex { get; } = null; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/German/Extractors/GermanMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/German/Extractors/GermanMergedExtractorConfiguration.cs index bac36e832c..1e2f527e42 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/German/Extractors/GermanMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/German/Extractors/GermanMergedExtractorConfiguration.cs @@ -49,6 +49,9 @@ public class GermanMergedExtractorConfiguration : BaseDateTimeOptionsConfigurati public static readonly Regex UnspecificDatePeriodRegex = new Regex(DateTimeDefinitions.UnspecificDatePeriodRegex, RegexFlags); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + public static readonly StringMatcher SuperfluousWordMatcher = new StringMatcher(); public static readonly Regex[] TermFilterRegexes = @@ -142,6 +145,8 @@ public GermanMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => null; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + public Regex FailFastRegex { get; } = null; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Hindi/Extractors/HindiMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Hindi/Extractors/HindiMergedExtractorConfiguration.cs index 5f86449ee1..485ef52087 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Hindi/Extractors/HindiMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Hindi/Extractors/HindiMergedExtractorConfiguration.cs @@ -51,6 +51,9 @@ public class HindiMergedExtractorConfiguration : BaseDateTimeOptionsConfiguratio public static readonly Regex FailFastRegex = new Regex(DateTimeDefinitions.FailFastRegex, RegexFlags | RegexOptions.Compiled); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + public static readonly Regex[] TermFilterRegexes = { // one on one @@ -141,6 +144,8 @@ public HindiMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => null; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + Regex IMergedExtractorConfiguration.FailFastRegex => FailFastRegex; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Italian/Extractors/ItalianMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Italian/Extractors/ItalianMergedExtractorConfiguration.cs index 376a17e790..e53a2241ad 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Italian/Extractors/ItalianMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Italian/Extractors/ItalianMergedExtractorConfiguration.cs @@ -56,6 +56,9 @@ public class ItalianMergedExtractorConfiguration : BaseDateTimeOptionsConfigurat public static readonly StringMatcher SuperfluousWordMatcher = new StringMatcher(); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + private const RegexOptions RegexFlags = RegexOptions.Singleline | RegexOptions.ExplicitCapture; public ItalianMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) @@ -131,6 +134,8 @@ public ItalianMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => null; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + public Regex FailFastRegex { get; } = null; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Microsoft.Recognizers.Text.DateTime.xml b/.NET/Microsoft.Recognizers.Text.DateTime/Microsoft.Recognizers.Text.DateTime.xml index 7ef470bb62..11f4e6ef09 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Microsoft.Recognizers.Text.DateTime.xml +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Microsoft.Recognizers.Text.DateTime.xml @@ -84,6 +84,11 @@ NoProtoCache + + + NoProtoCache + + FailFast, mode that aborts extraction/tagging quickly for non-entity cases. May be removed later. diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Portuguese/Extractors/PortugueseMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Portuguese/Extractors/PortugueseMergedExtractorConfiguration.cs index e363955268..d4b3638fb3 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Portuguese/Extractors/PortugueseMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Portuguese/Extractors/PortugueseMergedExtractorConfiguration.cs @@ -53,6 +53,9 @@ public class PortugueseMergedExtractorConfiguration : BaseDateTimeOptionsConfigu public static readonly StringMatcher SuperfluousWordMatcher = new StringMatcher(); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + public static readonly Regex[] TermFilterRegexes = System.Array.Empty(); private const RegexOptions RegexFlags = RegexOptions.Singleline | RegexOptions.ExplicitCapture; @@ -139,6 +142,8 @@ public PortugueseMergedExtractorConfiguration(IDateTimeOptionsConfiguration conf Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => null; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + public Regex FailFastRegex { get; } = null; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Spanish/Extractors/SpanishMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Spanish/Extractors/SpanishMergedExtractorConfiguration.cs index c705b7925d..7f821a0520 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Spanish/Extractors/SpanishMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Spanish/Extractors/SpanishMergedExtractorConfiguration.cs @@ -51,6 +51,8 @@ public class SpanishMergedExtractorConfiguration : BaseDateTimeOptionsConfigurat public static readonly StringMatcher SuperfluousWordMatcher = new StringMatcher(); + public static readonly Regex YearRegex = new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + private const RegexOptions RegexFlags = RegexOptions.Singleline | RegexOptions.ExplicitCapture; public SpanishMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) @@ -146,6 +148,8 @@ public SpanishMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => null; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + public Regex FailFastRegex { get; } = null; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Swedish/Extractors/SwedishMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Swedish/Extractors/SwedishMergedExtractorConfiguration.cs index 7fe38173b8..d63cd8abed 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Swedish/Extractors/SwedishMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Swedish/Extractors/SwedishMergedExtractorConfiguration.cs @@ -53,6 +53,9 @@ public class SwedishMergedExtractorConfiguration : BaseDateTimeOptionsConfigurat public static readonly Regex FailFastRegex = new Regex(DateTimeDefinitions.FailFastRegex, RegexFlags | RegexOptions.Compiled); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + public static readonly Regex[] TermFilterRegexes = { // one on one @@ -164,6 +167,8 @@ public SwedishMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => UnspecificTimePeriodRegex; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + Regex IMergedExtractorConfiguration.FailFastRegex => FailFastRegex; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Turkish/Extractors/TurkishMergedExtractorConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Turkish/Extractors/TurkishMergedExtractorConfiguration.cs index d211fca018..f96c982a85 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Turkish/Extractors/TurkishMergedExtractorConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Turkish/Extractors/TurkishMergedExtractorConfiguration.cs @@ -51,6 +51,9 @@ public class TurkishMergedExtractorConfiguration : BaseDateTimeOptionsConfigurat public static readonly Regex FailFastRegex = new Regex(DateTimeDefinitions.FailFastRegex, RegexFlags | RegexOptions.Compiled); + public static readonly Regex YearRegex = + new Regex(DateTimeDefinitions.YearRegex, RegexFlags); + public static readonly Regex[] TermFilterRegexes = { // one on one @@ -141,6 +144,8 @@ public TurkishMergedExtractorConfiguration(IDateTimeOptionsConfiguration config) Regex IMergedExtractorConfiguration.UnspecificTimePeriodRegex => null; + Regex IMergedExtractorConfiguration.YearRegex => YearRegex; + Regex IMergedExtractorConfiguration.FailFastRegex => FailFastRegex; IEnumerable IMergedExtractorConfiguration.TermFilterRegexes => TermFilterRegexes; diff --git a/Specs/DateTime/English/DateTimeModel.json b/Specs/DateTime/English/DateTimeModel.json index 1d21a81c61..a18fbee8a4 100644 --- a/Specs/DateTime/English/DateTimeModel.json +++ b/Specs/DateTime/English/DateTimeModel.json @@ -18401,6 +18401,55 @@ } ] }, + { + "Input": "deliver 2000 pieces of toys.", + "Comment": "Default mode produces a false positive for it and it's a case from TasksMode.", + "Context": { + "ReferenceDateTime": "2019-12-15T01:00:00" + }, + "NotSupported": "dotnet, javascript, python, java", + "Results": [] + }, + { + "Input": "Show sales of 2007 and 2009", + "Context": { + "ReferenceDateTime": "2018-06-26T00:00:00" + }, + "Results": [ + { + "Text": "2007", + "Start": 14, + "End": 17, + "TypeName": "datetimeV2.daterange", + "Resolution": { + "values": [ + { + "timex": "2007", + "type": "daterange", + "start": "2007-01-01", + "end": "2008-01-01" + } + ] + } + }, + { + "Text": "2009", + "Start": 23, + "End": 26, + "TypeName": "datetimeV2.daterange", + "Resolution": { + "values": [ + { + "timex": "2009", + "type": "daterange", + "start": "2009-01-01", + "end": "2010-01-01" + } + ] + } + } + ] + }, { "Input": "It will happen 3 days from Tuesday.", "Context": { @@ -21270,7 +21319,7 @@ { "Input": "I want to book a flight for the weekend of halloween", "Context": { - "ReferenceDateTime": "2021-11-09T18:00:00" + "ReferenceDateTime": "2021-11-09T18:00:00" }, "NotSupported": "java, javascript, python", "Results": [ @@ -21301,7 +21350,7 @@ { "Input": "I want to book a flight for halloween weekend 2021", "Context": { - "ReferenceDateTime": "2021-11-09T18:00:00" + "ReferenceDateTime": "2021-11-09T18:00:00" }, "NotSupported": "java, javascript, python", "Results": [ @@ -21326,7 +21375,7 @@ { "Input": "I need to prepare for labor day weekend", "Context": { - "ReferenceDateTime": "2021-11-09T18:00:00" + "ReferenceDateTime": "2021-11-09T18:00:00" }, "NotSupported": "java, javascript, python", "Results": [ @@ -21357,7 +21406,7 @@ { "Input": "I need to prepare for labor day 2021 weekend", "Context": { - "ReferenceDateTime": "2021-11-09T18:00:00" + "ReferenceDateTime": "2021-11-09T18:00:00" }, "NotSupported": "java, javascript, python", "Results": [ @@ -21382,7 +21431,7 @@ { "Input": "We'll take weekend of thanksgiving 2023 off", "Context": { - "ReferenceDateTime": "2021-11-09T18:00:00" + "ReferenceDateTime": "2021-11-09T18:00:00" }, "NotSupported": "java, javascript, python", "Results": [ diff --git a/Specs/DateTime/English/DateTimeModelTasksMode.json b/Specs/DateTime/English/DateTimeModelTasksMode.json new file mode 100644 index 0000000000..6ba1fcee46 --- /dev/null +++ b/Specs/DateTime/English/DateTimeModelTasksMode.json @@ -0,0 +1,92 @@ +[ + { + "Input": "How about year 2016 and greater", + "Comment": "Taskmode will only supress 4 digit number from getting be categorised as year, this eg have year mentioned along with 4 digit number", + "Context": { + "ReferenceDateTime": "2018-08-31T12:00:00" + }, + "NotSupported": "javascript, python, java", + "Results": [ + { + "Text": "year 2016 and greater", + "Start": 10, + "End": 30, + "TypeName": "datetimeV2.daterange", + "Resolution": { + "values": [ + { + "Mod": "since", + "sourceEntity": "datetimerange", + "start": "2016-01-01", + "timex": "2016", + "type": "daterange" + } + ] + } + } + ] + }, + { + "Input": "I'll go back 04th Jan 2019.", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "04th jan 2019", + "Start": 13, + "End": 25, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2019-01-04", + "type": "date", + "value": "2019-01-04" + } + ] + } + } + ] + }, + { + "Input": "Show sales in two thousand and twenty", + "Context": { + "ReferenceDateTime": "2018-06-26T00:00:00" + }, + "NotSupported": "javascript, python, java", + "Results": [] + }, + { + "Input": "The range is from 2015 and 2016", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "NotSupported": "javascript, python, java", + "Results": [] + }, + { + "Input": "deliver 2000 pieces of toys.", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "NotSupported": "javascript, python, java", + "Results": [] + }, + { + "Input": "Show sales of 2007 and 2009", + "Context": { + "ReferenceDateTime": "2018-06-26T00:00:00" + }, + "NotSupported": "javascript, python, java", + "Results": [] + }, + { + "Input": "show me sales before 2010 or after 2018", + "Context": { + "ReferenceDateTime": "2018-05-31T00:00:00" + }, + "NotSupported": "javascript, python, java", + "Results": [] + } +]