diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/Arabic/NumbersDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/Arabic/NumbersDefinitions.cs index 292db1a45b..82bb6bf080 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/Arabic/NumbersDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/Arabic/NumbersDefinitions.cs @@ -105,9 +105,9 @@ public static class NumbersDefinitions public static readonly string TwoNumberRangeRegex3 = $@"({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})\s*(،)?\s*((أ|ا)?و|لكن|,)\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})"; public static readonly string TwoNumberRangeRegex4 = $@"((من\s)(?({NumberSplitMark}(?!\bمن\b).)+)\s*{TillRegex}\s*(ال\s+)?(?({NumberSplitMark}.)+))|((من\s)?(?({NumberSplitMark}(?!\bمن\b).)+)\s*{TillRegex}\s*(ال\s+)?(?({NumberSplitMark}.)+))"; public const string AmbiguousFractionConnectorsRegex = @"(\bمن|بين|من|بين\b)"; - public const char DecimalSeparatorChar = ','; + public const char DecimalSeparatorChar = '.'; public const string FractionMarkerToken = @"أكثر"; - public const char NonDecimalSeparatorChar = '،'; + public const char NonDecimalSeparatorChar = ','; public const string HalfADozenText = @"ستة"; public const string WordSeparatorToken = @"و"; public static readonly string[] WrittenDecimalSeparatorTexts = { @"نقطة | فاصلة" }; diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/Dutch/DateTimeDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/Dutch/DateTimeDefinitions.cs index 3ad4640399..c318247701 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/Dutch/DateTimeDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/Dutch/DateTimeDefinitions.cs @@ -89,7 +89,7 @@ public static class DateTimeDefinitions public static readonly string MonthFrontSimpleCasesRegex = $@"\b({RangePrefixRegex}\s+)?(({MonthSuffixRegex}\s+((van)\s+)?({DayRegex})|({DayRegex})\s+((van)\s+)?{MonthSuffixRegex})\s*{TillRegex}\s*({DayRegex})|(op\s+)?({DayRegex})\s*{TillRegex}\s*({DayRegex})\s+{MonthSuffixRegex})((\s+|\s*,\s*){YearRegex})?\b"; public static readonly string MonthFrontBetweenRegex = $@"\b{MonthSuffixRegex}\s+(tussen\s+)({DayRegex})\s*{RangeConnectorRegex}\s*({DayRegex})((\s+|\s*,\s*){YearRegex})?\b"; public static readonly string BetweenRegex = $@"\b(tussen\s+)({DayRegex})\s*{RangeConnectorRegex}\s*({DayRegex})\s+{MonthSuffixRegex}((\s+|\s*,\s*){YearRegex})?\b"; - public static readonly string RelativeYearRegex = $@"({YearRegex}|(?volgende?|komende?|aanstaande?|aankomende?|huidige?|vorige?|afgelopen|dit)\s+jaar)"; + public static readonly string RelativeYearRegex = $@"({YearRegex}|{TwoDigitYearRegex}|(?volgende?|komende?|aanstaande?|aankomende?|huidige?|vorige?|afgelopen|dit)\s+jaar)"; public static readonly string MonthWithYear = $@"\b(({WrittenMonthRegex}(\.)?(\s*)[/\\\-\.,]?(\s+(van|over|in))?(\s*){RelativeYearRegex})|({RelativeYearRegex}(\s*),?(\s*){WrittenMonthRegex}))\b"; public static readonly string OneWordPeriodRegex = $@"\b((((de\s+)?maand\s+(van\s+)?)?({StrictRelativeRegex}\s+)?(?januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december|jan\.?|feb\.?|mar\.?|mrt\.?|apr\.?|jun\.?|jul\.?|aug\.?|sep\.?|sept\.?|oct\.?|okt\.?|nov\.?|dec\.?))|(maand|jaar)\s+tot(\s+op)?\s+heden|(({RelativeRegex}\s+)(mijn\s+)?(weekend|(?werkweek)|week|maand|jaar(?!\s+hoger dan))|({RelativeRegex}\s+)?(mijn\s+)(weekend|(?werkweek)|week|maand|jaar))(?!((\s+van)?\s+\d+|\s+tot(\s+op)?\s+heden|nu))(\s+{AfterNextSuffixRegex})?)\b"; public static readonly string MonthNumWithYear = $@"\b(({BaseDateTime.FourDigitYearRegex}(\s*)[/\-\.](\s*){MonthNumRegex})|({MonthNumRegex}(\s*)[/\-](\s*){BaseDateTime.FourDigitYearRegex}))\b"; diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/English/DateTimeDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/English/DateTimeDefinitions.cs index 0888b5e53b..13385574b4 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/English/DateTimeDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/English/DateTimeDefinitions.cs @@ -87,7 +87,7 @@ public static class DateTimeDefinitions public static readonly string MonthFrontSimpleCasesRegex = $@"\b({RangePrefixRegex}\s+)?{MonthSuffixRegex}\s+((from)\s+)?({DayRegex}|{WrittenOrdinalDayRegex})\s*{TillRegex}\s*({DayRegex}|{WrittenOrdinalDayRegex})((\s+|\s*,\s*){YearRegex})?\b"; public static readonly string MonthFrontBetweenRegex = $@"\b{MonthSuffixRegex}\s+(between\s+)({DayRegex}|{WrittenOrdinalDayRegex})\s*{RangeConnectorRegex}\s*({DayRegex}|{WrittenOrdinalDayRegex})((\s+|\s*,\s*){YearRegex})?\b"; public static readonly string BetweenRegex = $@"\b(between\s+)({DayRegex}|{WrittenOrdinalDayRegex})\s*{RangeConnectorRegex}\s*({DayRegex}|{WrittenOrdinalDayRegex})\s+{MonthSuffixRegex}((\s+|\s*,\s*){YearRegex})?\b"; - public static readonly string MonthWithYear = $@"\b((({WrittenMonthRegex}[\.]?|((the\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|sixth|6th|seventh|7th|eighth|8th|ninth|9th|tenth|10th|eleventh|11th|twelfth|12th|last)\s+month(?=\s+(of|in))))((\s*)[/\\\-\.,]?(\s+(of|in))?(\s*)({YearRegex}|(?following|next|last|this)\s+year)|\s+(of|in)\s+{TwoDigitYearRegex}))|(({YearRegex}|(?following|next|last|this)\s+year)(\s*),?(\s*){WrittenMonthRegex}))\b"; + public static readonly string MonthWithYear = $@"\b((({WrittenMonthRegex}[\.]?|((the\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|sixth|6th|seventh|7th|eighth|8th|ninth|9th|tenth|10th|eleventh|11th|twelfth|12th|last)\s+month(?=\s+(of|in))))((\s*)[/\\\-\.,]?(\s+(of|in))?(\s*)({YearRegex}|{TwoDigitYearRegex}|(?following|next|last|this)\s+year)|\s+(of|in)\s+{TwoDigitYearRegex}))|(({YearRegex}|(?following|next|last|this)\s+year)(\s*),?(\s*){WrittenMonthRegex}))\b"; public const string SpecialYearPrefixes = @"(calendar|(?fiscal|school))"; public static readonly string OneWordPeriodRegex = $@"\b((((the\s+)?month of\s+)?({StrictRelativeRegex}\s+)?{MonthRegex})|(month|year) to date|(?((un)?till?|to)\s+date)|({RelativeRegex}\s+)?(my\s+)?((?working\s+week|workweek)|week(end)?|month|fortnight|(({SpecialYearPrefixes}\s+)?year))(?!((\s+of)?\s+\d+(?!({BaseDateTime.BaseAmDescRegex}|{BaseDateTime.BasePmDescRegex}))|\s+to\s+date))(\s+{AfterNextSuffixRegex})?)\b"; public static readonly string MonthNumWithYear = $@"\b(({BaseDateTime.FourDigitYearRegex}(\s*)[/\-\.](\s*){MonthNumRegex})|({MonthNumRegex}(\s*)[/\-](\s*){BaseDateTime.FourDigitYearRegex}))\b"; @@ -139,8 +139,8 @@ public static class DateTimeDefinitions public static readonly string DateExtractor4 = $@"\b{MonthNumRegex}\s*[/\\\-]\s*{DayRegex}[\.]?\s*[/\\\-]\s*{DateYearRegex}"; public static readonly string DateExtractor5 = $@"\b({DayPrefix}(\s*,)?\s+)?{DayRegex}\s*[/\\\-\.]\s*({MonthNumRegex}|{MonthRegex})\s*[/\\\-\.]\s*{DateYearRegex}(?!\s*[/\\\-\.]\s*\d+)"; public static readonly string DateExtractor6 = $@"(?<={DatePreposition}\s+)({StrictRelativeRegex}\s+)?({DayPrefix}\s+)?{MonthNumRegex}[\-\.]{DayRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\b"; - public static readonly string DateExtractor7L = $@"\b({DayPrefix}(\s*,)?\s+)?{MonthNumRegex}\s*/\s*{DayRegex}{DateExtractorYearTermRegex}(?![%])\b"; - public static readonly string DateExtractor7S = $@"\b({DayPrefix}(\s*,)?\s+)?{MonthNumRegex}\s*/\s*{DayRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\b"; + public static readonly string DateExtractor7L = $@"\b({DayPrefix}(\s*,)?\s+)?(the\s+)?{MonthNumRegex}\s*/\s*{DayRegex}{DateExtractorYearTermRegex}(?![%])\b"; + public static readonly string DateExtractor7S = $@"\b({DayPrefix}(\s*,)?\s+)?(the\s+)?{MonthNumRegex}\s*/\s*{DayRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\b"; public static readonly string DateExtractor8 = $@"(?<={DatePreposition}\s+)({StrictRelativeRegex}\s+)?({DayPrefix}\s+)?{DayRegex}[\\\-]{MonthNumRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\b"; public static readonly string DateExtractor9L = $@"\b({DayPrefix}(\s*,)?\s+)?{DayRegex}\s*/\s*{MonthNumRegex}{DateExtractorYearTermRegex}(?![%])\b"; public static readonly string DateExtractor9S = $@"\b({DayPrefix}(\s*,)?\s+)?{DayRegex}\s*/\s*{MonthNumRegex}{BaseDateTime.CheckDecimalRegex}(?![%])\b"; @@ -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 = $@"(?(a\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\s+(minutes?|mins?))|{DeltaMinuteNumRegex}(\s+(minutes?|mins?)))"; + public static readonly string LessThanOneHour = $@"(?(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 = $@"(?{HourNumRegex}\s+{MinuteNumRegex}(\s+(minutes?|mins?))?)"; public static readonly string TimePrefix = $@"(?{LessThanOneHour}\s+(past|to))"; public static readonly string TimeSuffix = $@"(?{AmRegex}|{PmRegex}|{OclockRegex})"; @@ -924,4 +924,4 @@ public static class DateTimeDefinitions public const string QuarterTypeRegex = @"(quarter(s|ly)?)$"; public const string YearTypeRegex = @"((years?|annual)(ly)?)$"; } -} \ No newline at end of file +} diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs index b9ba8e743c..84a952d576 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs @@ -65,7 +65,7 @@ public static class DateTimeDefinitions public static readonly string MonthFrontSimpleCasesRegex = $@"((vom|zwischen)\s*)?{MonthSuffixRegex}\s*((vom|zwischen)\s*)?({DayRegex})\s*{TillRegex}\s*({DayRegex})((\s+|\s*,\s*){YearRegex})?"; public static readonly string MonthFrontBetweenRegex = $@"({MonthSuffixRegex}\s+(zwischen\s+)({DayRegex})\s*{RangeConnectorRegex}\s*({DayRegex})((\s+|\s*,\s*){YearRegex})?)"; public static readonly string BetweenRegex = $@"((zwischen\s+)({DayRegex})(\s+{MonthSuffixRegex})?\s*{RangeConnectorRegex}\s*({DayRegex})(\s+{MonthSuffixRegex})((\s+|\s*,\s*){YearRegex})?|(zwischen\s+)({DayRegex})(\s+{MonthSuffixRegex})?\s*{RangeConnectorRegex}\s*({DayRegex})(\s+{MonthSuffixRegex})?((\s+|\s*,\s*){YearRegex})?)"; - public static readonly string MonthWithYear = $@"\b((?apr(il|\.)|aug(ust|\.)|dez(ember|\.)|feb(ruar|ber|\.)|januar|j[äa]n(ner|\.)|jul(e?i|l\.)|jun([io]|\.)|märz|mai|nov(ember|\.)|okt(ober|\.)|sept?(ember|\.))(\s*),?(\s+des)?(\s*)({YearRegex}|(?nächste[mn]|letzte[mn]|diese(s|n))\s+jahres))"; + public static readonly string MonthWithYear = $@"\b((?apr(il|\.)|aug(ust|\.)|dez(ember|\.)|feb(ruar|ber|\.)|januar|j[äa]n(ner|\.)|jul(e?i|l\.)|jun([io]|\.)|märz|mai|nov(ember|\.)|okt(ober|\.)|sept?(ember|\.))(\s*),?(\s+des)?(\s*)({YearRegex}|{TwoDigitYearRegex}|(?nächste[mn]|letzte[mn]|diese(s|n))\s+jahres))"; public static readonly string OneWordPeriodRegex = $@"\b((((im\s+)?monat\s+)?({RelativeRegex}\s*(jahr\s*(im\s*)?)?)?(?apr(il|\.)|aug(ust|\.)|dez(ember|\.)|feb(ruar|ber|\.)|j[äa]n(uar|ner|\.)|jul(e?i|l\.)|jun([io]|\.)|märz|mai|nov(ember|\.)|okt(ober|\.)|sept?(ember|\.)))|(?unter\s+der\s+woche)|({RelativeRegex}\s+)?((?werktags|arbeitswoche)|woche(nende)?|monat(s)?|jahr|jahres)(?!(\s+\d+(?!({BaseDateTime.BaseAmDescRegex}|{BaseDateTime.BasePmDescRegex}))|\s+bis\s+heute)))\b"; public static readonly string MonthNumWithYear = $@"({YearRegex}(\s*)[/\-\.](\s*){MonthNumRegex})|({MonthNumRegex}(\s*)[/\-\.](\s*){YearRegex})"; public static readonly string WeekOfMonthRegex = $@"(?((die|der)\s+)(?erste[rns]?|1\.|zweite[rns]?|2\.|dritte[rns]?|3\.|vierte[rns]?|4\.|fünfte[rns]?|5\.|letzte[rmns]?)\s+woche\s+(des|diese(s|n)|im)\s+({MonthSuffixRegex}|monat(s)?))"; @@ -98,13 +98,13 @@ public static class DateTimeDefinitions public static readonly string WeekDayOfMonthRegex = $@"\b(?((an( dem)?|de[rs]|am)\s+)?(?erste[rns]?|1\.|zweite[rns]?|2\.|dritte[rns]?|3\.|vierte[rns]?|4\.|fünfte[rns]?|5\.|letzte[rmns]?)\s+{WeekDayRegex}\s+{MonthSuffixRegex})\b"; public static readonly string RelativeWeekDayRegex = $@"\b({WrittenNumRegex}\s+{WeekDayRegex}e\s+(von\s+jetzt|später))\b"; public static readonly string SpecialDate = $@"(?=\b(an( dem)?|am)\s+){DayRegex}\b"; - public static readonly string DateExtractor1 = $@"\b(({WeekDayRegex})(\s+|\s*,\s*))?({DayRegex}\s*[/\\.,\- ]\s*{MonthRegex}(\s*[/\\.,\- ]\s*{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\s*[/\\.,\- ]\s*{DayRegex}\s*[/\\.,\- ]\s*{MonthRegex})\b"; + public static readonly string DateExtractor1 = $@"\b(({WeekDayRegex})(\s+|\s*,\s*))?({DayRegex}\s*[/\\.,\- ]\s*({MonthNumRegex}|{MonthRegex})(\s*[/\\.,\- ]\s*{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\s*[/\\.,\- ]\s*{DayRegex}\s*[/\\.,\- ]\s*{MonthRegex})\b"; public static readonly string DateExtractor2 = $@"\b({MonthRegex}\s*[/\\.,\- ]\s*{DayRegex}(?!\s*\-\s*\d{{2}}\b)(\s*[/\\.,\- ]\s*{DateYearRegex})?)\b"; public static readonly string DateExtractor3 = $@"\b({DayRegex}{MonthRegex})"; 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 = $@"^[.]"; @@ -125,7 +125,7 @@ public static class DateTimeDefinitions public const string NightRegex = @"\b(mitternacht|(nachts?|primetime|abends?))\b"; public const string AmPmPrefixRegex = @"\b((((um|gegen)\s*)?(?(((?am morgen)|((früh|spät)\s*)?morgens|früh|(vor|nach)mittags?)|(?((früh|spät)\s*)?(nachmittags?|abends?)|mitternachts?))|(in der\s*)?(?nachts?)))\s*(um|gegen|von)\s*)"; public const string CommonDatePrefixRegex = @"^[\.]"; - public static readonly string LessThanOneHour = $@"\b(?(ein(er?)?\s+)?((drei)?viertel|halb(en?)?)(\s*stunden?)?)|{BaseDateTime.DeltaMinuteRegex}(\s+(min(uten?)?))|{DeltaMinuteNumRegex}(\s+(min(uten?)?))"; + public static readonly string LessThanOneHour = $@"\b(?(ein(er?)?\s+)?((drei)?viertel|halb(en?)?)(\s*stunden?)?)|{BaseDateTime.DeltaMinuteRegex}(\s+(min(uten?)?)|(?=\s+(nach|vor)))|{DeltaMinuteNumRegex}(\s+(min(uten?)?)|(?=\s+(nach|vor)))"; public static readonly string WrittenTimeRegex = $@"(um\s*)?(?{HourNumRegex}(\s*{OclockRegex}\s*)({MinuteNumRegex}|{MinuteNumRegex}und(?zwanzig|dreißig|vierzig|fünfzig)))"; public static readonly string TimePrefix = $@"(?({LessThanOneHour})(\s*(vor(\W)?|nach(\W)?))?)"; public static readonly string TimeSuffix = $@"(?{AmRegex}|{PmRegex}|{OclockRegex})"; @@ -936,4 +936,4 @@ public static class DateTimeDefinitions @"year to date" }; } -} \ No newline at end of file +} diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/Italian/DateTimeDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/Italian/DateTimeDefinitions.cs index 0cbbea1377..10965ad176 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/Italian/DateTimeDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/Italian/DateTimeDefinitions.cs @@ -74,7 +74,7 @@ public static class DateTimeDefinitions public static readonly string MonthFrontBetweenRegex = $@"\b{MonthSuffixRegex}\s+([tf]ra\s+)({DayRegex})\s*{RangeConnectorRegex}\s*({DayRegex})((\s+|\s*,\s*){YearRegex})?\b"; public static readonly string BetweenRegex = $@"\b([tf]ra\s+)({DayRegex})\s*{RangeConnectorRegex}\s*({DayRegex})\s+{MonthSuffixRegex}((\s+|\s*,\s*){YearRegex})?\b"; public const string YearWordRegex = @"\b(?l'anno)\b"; - public static readonly string MonthWithYear = $@"\b({MonthRegex}(\.)?(\s*)[/\\\-\.,]?(((\s+del)?\s+{YearRegex})|((\s+(del|di|il))?\s+(?prossim['o]|passato|quest['o])\s*anno)|((\s+(del)?l')anno\s+(?prossimo|passato))))"; + public static readonly string MonthWithYear = $@"\b({MonthRegex}(\.)?(\s*)[/\\\-\.,]?(((\s+del)?\s+{YearRegex}|{TwoDigitYearRegex})|((\s+(del|di|il))?\s+(?prossim['o]|passato|quest['o])\s*anno)|((\s+(del)?l')anno\s+(?prossimo|passato))))"; public const string SpecialYearPrefixes = @"(?fiscale|scolastico)"; public static readonly string OneWordPeriodRegex = $@"\b((((il|l[o'])\s*)?((mese di\s+)|({RelativeRegex}\s*))?{MonthRegex}(\s+{RelativeRegex})?)|dall'inizio\s+del(l')\s*(mese|anno)|({RelativeRegex}\s*)?(mi[ao]\s+)?(weekend|finesettimana|settimana|mese|anno)(\s+{RelativeRegex})?(?!((\s+di|del)?\s+\d+))(\s+{AfterNextSuffixRegex})?)\b"; public static readonly string MonthNumWithYear = $@"({YearRegex}[/\-\.]{MonthNumRegex})|({MonthNumRegex}[/\-]{YearRegex})"; @@ -139,9 +139,9 @@ public static class DateTimeDefinitions public const string AmRegex = @"\b(?((((la|alla|verso|per|della|di|in)\s+(la\s+)?)?(mattinata|mattina))|(((il|al|verso|per|del|di)\s+(il\s+)?)?(mattino))))\b"; public const string LunchRegex = @"\b(ora di pranzo)\b"; public const string NightRegex = @"\b(mezzanotte|notte)\b"; - public static readonly string LessThanOneHour = $@"(?(un\s+quarto|tre quarti?|mezz[oa]|mezz'ora|{BaseDateTime.DeltaMinuteRegex}(\s+(minut[oi]|min))?|{DeltaMinuteNumRegex}(\s+(minut[oi]|min))|(?<=(e|meno)\s+){DeltaMinuteNumRegex}))"; + public static readonly string LessThanOneHour = $@"(?(un\s+quarto|tre quarti?|mezz[oa]|mezz'ora|{BaseDateTime.DeltaMinuteRegex}|{DeltaMinuteNumRegex}))"; public static readonly string EngTimeRegex = $@"(?{HourNumRegex}\s+e\s+({MinuteNumRegex}|(?venti?|trenta?|quaranta?|cinquanta?){MinuteNumRegex}))"; - public static readonly string TimePrefix = $@"(?(e\s+{LessThanOneHour}|{LessThanOneHour}\s+(minut[oi]|min)\s+all[e']|meno {LessThanOneHour}))"; + public static readonly string TimePrefix = $@"(?((e|meno)\s+{LessThanOneHour}(\s+(minut[oi]|min))?|{LessThanOneHour}\s+(minut[oi]|min)\s+all[e']))"; public static readonly string TimeSuffix = $@"(?{AmRegex}|{PmRegex}|{OclockRegex})"; public static readonly string BasicTime = $@"\b(?{EngTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}:{BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|{BaseDateTime.HourRegex})"; public const string MidnightRegex = @"(?mezzanotte|mezza notte)"; diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/Italian/NumbersWithUnitDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/Italian/NumbersWithUnitDefinitions.cs index 0180f11a4b..97a1c75e26 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/Italian/NumbersWithUnitDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/Italian/NumbersWithUnitDefinitions.cs @@ -565,7 +565,7 @@ public static class NumbersWithUnitDefinitions public const string CompoundUnitConnectorRegex = @"(?e)"; public static readonly Dictionary CurrencyPrefixList = new Dictionary { - { @"Dollar", @"$" }, + { @"Dollar", @"$|dollari" }, { @"United States dollar", @"$ stati uniti|us$|us $|u.s. $|u.s $" }, { @"East Caribbean dollar", @"east caribbean $" }, { @"Australian dollar", @"$ australiano|$ australia" }, diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/German/Parsers/GermanTimeParserConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/German/Parsers/GermanTimeParserConfiguration.cs index 548ef108ae..737300552c 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/German/Parsers/GermanTimeParserConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/German/Parsers/GermanTimeParserConfiguration.cs @@ -105,13 +105,13 @@ public void AdjustByPrefix(string prefix, ref int hour, ref int min, ref bool ha minStr = match.Groups["deltaminnum"].Value; deltaMin = Numbers[minStr]; } - } - // @TODO move hardcoded values to resources file + // @TODO move hardcoded values to resources file - if (trimmedPrefix.EndsWith("zum", StringComparison.Ordinal)) - { - deltaMin = -deltaMin; + if (trimmedPrefix.EndsWith("vor", StringComparison.Ordinal)) + { + deltaMin = -deltaMin; + } } min += deltaMin; diff --git a/.NET/Microsoft.Recognizers.Text.DateTime/Italian/Parsers/ItalianTimeParserConfiguration.cs b/.NET/Microsoft.Recognizers.Text.DateTime/Italian/Parsers/ItalianTimeParserConfiguration.cs index 07558ac58f..2cef97b99a 100644 --- a/.NET/Microsoft.Recognizers.Text.DateTime/Italian/Parsers/ItalianTimeParserConfiguration.cs +++ b/.NET/Microsoft.Recognizers.Text.DateTime/Italian/Parsers/ItalianTimeParserConfiguration.cs @@ -81,7 +81,8 @@ public void AdjustByPrefix(string prefix, ref int hour, ref int min, ref bool ha } // 'to' i.e 'one to five' - if (trimmedPrefix.StartsWith("meno", StringComparison.Ordinal)) + if (trimmedPrefix.StartsWith("meno", StringComparison.Ordinal) || + trimmedPrefix.EndsWith("alle", StringComparison.Ordinal)) { deltaMin = -deltaMin; } diff --git a/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/german/parsers/GermanTimeParserConfiguration.java b/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/german/parsers/GermanTimeParserConfiguration.java index 1479a0d811..715b03e0ff 100644 --- a/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/german/parsers/GermanTimeParserConfiguration.java +++ b/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/german/parsers/GermanTimeParserConfiguration.java @@ -109,10 +109,9 @@ public PrefixAdjustResult adjustByPrefix(String prefix, int hour, int min, boole minStr = match.get().getGroup("deltaminnum").value; deltaMin = numbers.getOrDefault(minStr, 0); } - } - - if (trimmedPrefix.endsWith("zum")) { - deltaMin = -deltaMin; + if (trimmedPrefix.endsWith("vor")) { + deltaMin = -deltaMin; + } } min += deltaMin; diff --git a/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/EnglishDateTime.java b/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/EnglishDateTime.java index 73e6caebbf..efb52516bb 100644 --- a/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/EnglishDateTime.java +++ b/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/EnglishDateTime.java @@ -412,13 +412,13 @@ public class EnglishDateTime { .replace("{StrictRelativeRegex}", StrictRelativeRegex) .replace("{BaseDateTime.CheckDecimalRegex}", BaseDateTime.CheckDecimalRegex); - public static final String DateExtractor7L = "\\b({DayPrefix}(\\s*,)?\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}{DateExtractorYearTermRegex}(?![%])\\b" + public static final String DateExtractor7L = "\\b({DayPrefix}(\\s*,)?\\s+)?(the\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}{DateExtractorYearTermRegex}(?![%])\\b" .replace("{MonthNumRegex}", MonthNumRegex) .replace("{DayRegex}", DayRegex) .replace("{DayPrefix}", DayPrefix) .replace("{DateExtractorYearTermRegex}", DateExtractorYearTermRegex); - public static final String DateExtractor7S = "\\b({DayPrefix}(\\s*,)?\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\\b" + public static final String DateExtractor7S = "\\b({DayPrefix}(\\s*,)?\\s+)?(the\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\\b" .replace("{MonthNumRegex}", MonthNumRegex) .replace("{DayRegex}", DayRegex) .replace("{DayPrefix}", DayPrefix) @@ -486,7 +486,7 @@ public class EnglishDateTime { public static final String CommonDatePrefixRegex = "^[\\.]"; - public static final String LessThanOneHour = "(?(a\\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\\s+(minutes?|mins?))|{DeltaMinuteNumRegex}(\\s+(minutes?|mins?)))" + public static final String LessThanOneHour = "(?(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); 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..580ed8fafa 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 @@ -244,7 +244,7 @@ public class GermanDateTime { public static final String SpecialDate = "(?=\\b(an( dem)?|am)\\s+){DayRegex}\\b" .replace("{DayRegex}", DayRegex); - public static final String DateExtractor1 = "\\b(({WeekDayRegex})(\\s+|\\s*,\\s*))?({DayRegex}\\s*[/\\\\.,\\- ]\\s*{MonthRegex}(\\s*[/\\\\.,\\- ]\\s*{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\.,\\- ]\\s*{DayRegex}\\s*[/\\\\.,\\- ]\\s*{MonthRegex})\\b" + public static final String DateExtractor1 = "\\b(({WeekDayRegex})(\\s+|\\s*,\\s*))?({DayRegex}\\s*[/\\\\.,\\- ]\\s*({MonthNumRegex}|{MonthRegex})(\\s*[/\\\\.,\\- ]\\s*{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\.,\\- ]\\s*{DayRegex}\\s*[/\\\\.,\\- ]\\s*{MonthRegex})\\b" .replace("{WeekDayRegex}", WeekDayRegex) .replace("{MonthRegex}", MonthRegex) .replace("{DayRegex}", DayRegex) @@ -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); @@ -348,7 +348,7 @@ public class GermanDateTime { public static final String CommonDatePrefixRegex = "^[\\.]"; - public static final String LessThanOneHour = "\\b(?(ein(er?)?\\s+)?((drei)?viertel|halb(en?)?)(\\s*stunden?)?)|{BaseDateTime.DeltaMinuteRegex}(\\s+(min(uten?)?))|{DeltaMinuteNumRegex}(\\s+(min(uten?)?))" + public static final String LessThanOneHour = "\\b(?(ein(er?)?\\s+)?((drei)?viertel|halb(en?)?)(\\s*stunden?)?)|{BaseDateTime.DeltaMinuteRegex}(\\s+(min(uten?)?)|(?=\\s+(nach|vor)))|{DeltaMinuteNumRegex}(\\s+(min(uten?)?)|(?=\\s+(nach|vor)))" .replace("{BaseDateTime.DeltaMinuteRegex}", BaseDateTime.DeltaMinuteRegex) .replace("{DeltaMinuteNumRegex}", DeltaMinuteNumRegex); diff --git a/JavaScript/packages/recognizers-date-time/src/resources/englishDateTime.ts b/JavaScript/packages/recognizers-date-time/src/resources/englishDateTime.ts index d9d34ee07e..116f4ee322 100644 --- a/JavaScript/packages/recognizers-date-time/src/resources/englishDateTime.ts +++ b/JavaScript/packages/recognizers-date-time/src/resources/englishDateTime.ts @@ -129,8 +129,8 @@ export namespace EnglishDateTime { export const DateExtractor4 = `\\b${MonthNumRegex}\\s*[/\\\\\\-]\\s*${DayRegex}[\\.]?\\s*[/\\\\\\-]\\s*${DateYearRegex}`; export const DateExtractor5 = `\\b(${DayPrefix}(\\s*,)?\\s+)?${DayRegex}\\s*[/\\\\\\-\\.]\\s*(${MonthNumRegex}|${MonthRegex})\\s*[/\\\\\\-\\.]\\s*${DateYearRegex}(?!\\s*[/\\\\\\-\\.]\\s*\\d+)`; export const DateExtractor6 = `(?<=${DatePreposition}\\s+)(${StrictRelativeRegex}\\s+)?(${DayPrefix}\\s+)?${MonthNumRegex}[\\-\\.]${DayRegex}(?![%])${BaseDateTime.CheckDecimalRegex}\\b`; - export const DateExtractor7L = `\\b(${DayPrefix}(\\s*,)?\\s+)?${MonthNumRegex}\\s*/\\s*${DayRegex}${DateExtractorYearTermRegex}(?![%])\\b`; - export const DateExtractor7S = `\\b(${DayPrefix}(\\s*,)?\\s+)?${MonthNumRegex}\\s*/\\s*${DayRegex}(?![%])${BaseDateTime.CheckDecimalRegex}\\b`; + export const DateExtractor7L = `\\b(${DayPrefix}(\\s*,)?\\s+)?(the\\s+)?${MonthNumRegex}\\s*/\\s*${DayRegex}${DateExtractorYearTermRegex}(?![%])\\b`; + export const DateExtractor7S = `\\b(${DayPrefix}(\\s*,)?\\s+)?(the\\s+)?${MonthNumRegex}\\s*/\\s*${DayRegex}(?![%])${BaseDateTime.CheckDecimalRegex}\\b`; export const DateExtractor8 = `(?<=${DatePreposition}\\s+)(${StrictRelativeRegex}\\s+)?(${DayPrefix}\\s+)?${DayRegex}[\\\\\\-]${MonthNumRegex}(?![%])${BaseDateTime.CheckDecimalRegex}\\b`; export const DateExtractor9L = `\\b(${DayPrefix}(\\s*,)?\\s+)?${DayRegex}\\s*/\\s*${MonthNumRegex}${DateExtractorYearTermRegex}(?![%])\\b`; export const DateExtractor9S = `\\b(${DayPrefix}(\\s*,)?\\s+)?${DayRegex}\\s*/\\s*${MonthNumRegex}${BaseDateTime.CheckDecimalRegex}(?![%])\\b`; @@ -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 = `(?(a\\s+)?quarter|three quarter(s)?|half( an hour)?|${BaseDateTime.DeltaMinuteRegex}(\\s+(minutes?|mins?))|${DeltaMinuteNumRegex}(\\s+(minutes?|mins?)))`; + export const LessThanOneHour = `(?(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 = `(?${HourNumRegex}\\s+${MinuteNumRegex}(\\s+(minutes?|mins?))?)`; export const TimePrefix = `(?${LessThanOneHour}\\s+(past|to))`; export const TimeSuffix = `(?${AmRegex}|${PmRegex}|${OclockRegex})`; diff --git a/JavaScript/packages/recognizers-number-with-unit/package-lock.json b/JavaScript/packages/recognizers-number-with-unit/package-lock.json index 53404db853..db6c21ea99 100644 --- a/JavaScript/packages/recognizers-number-with-unit/package-lock.json +++ b/JavaScript/packages/recognizers-number-with-unit/package-lock.json @@ -1,22 +1,128 @@ { - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "lodash.escaperegexp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=" - }, - "lodash.last": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash.last/-/lodash.last-3.0.0.tgz", - "integrity": "sha1-JC9mMRLdTG5jcoxgo8kJ0b2tvUw=" - }, - "lodash.max": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.max/-/lodash.max-4.0.1.tgz", - "integrity": "sha1-hzVWbGGLNan3YFILSHrnllivE2o=" - } - }, - "version": "1.3.0" -} \ No newline at end of file + "name": "@microsoft/recognizers-text-number-with-unit", + "version": "1.3.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@microsoft/recognizers-text-number-with-unit", + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "@microsoft/recognizers-text": "~1.3.0", + "@microsoft/recognizers-text-number": "~1.3.0", + "lodash.escaperegexp": "^4.1.2", + "lodash.last": "^3.0.0", + "lodash.max": "^4.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@microsoft/recognizers-text": { + "version": "1.3.0", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/@microsoft/recognizers-text/-/recognizers-text-1.3.0.tgz", + "integrity": "sha512-0gUhtS/0qSF6veB3Olu55IuJ0Skwg4u1IbJX9KFj1QeK8z6cw69/p637IPD2NgXLlXCy2HEqLvUW/mgbDp3rWg==", + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@microsoft/recognizers-text-number": { + "version": "1.3.0", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/@microsoft/recognizers-text-number/-/recognizers-text-number-1.3.0.tgz", + "integrity": "sha512-KVFxvaXW9E7UkuF0EYCghvCn0u+N5L7bBXeP4IKB6fXkQd6GAZ9zNA2Acdm9lJzCRxcsBYFbRLcRMrPHwAa32w==", + "dependencies": { + "@microsoft/recognizers-text": "~1.3.0", + "bignumber.js": "^7.2.1", + "lodash.escaperegexp": "^4.1.2", + "lodash.sortby": "^4.7.0", + "lodash.trimend": "^4.5.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/bignumber.js": { + "version": "7.2.1", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/bignumber.js/-/bignumber.js-7.2.1.tgz", + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==", + "engines": { + "node": "*" + } + }, + "node_modules/lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=" + }, + "node_modules/lodash.last": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash.last/-/lodash.last-3.0.0.tgz", + "integrity": "sha1-JC9mMRLdTG5jcoxgo8kJ0b2tvUw=" + }, + "node_modules/lodash.max": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.max/-/lodash.max-4.0.1.tgz", + "integrity": "sha1-hzVWbGGLNan3YFILSHrnllivE2o=" + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" + }, + "node_modules/lodash.trimend": { + "version": "4.5.1", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/lodash.trimend/-/lodash.trimend-4.5.1.tgz", + "integrity": "sha512-lsD+k73XztDsMBKPKvzHXRKFNMohTjoTKIIo4ADLn5dA65LZ1BqlAvSXhR2rPEC3BgAUQnzMnorqDtqn2z4IHA==" + } + }, + "dependencies": { + "@microsoft/recognizers-text": { + "version": "1.3.0", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/@microsoft/recognizers-text/-/recognizers-text-1.3.0.tgz", + "integrity": "sha512-0gUhtS/0qSF6veB3Olu55IuJ0Skwg4u1IbJX9KFj1QeK8z6cw69/p637IPD2NgXLlXCy2HEqLvUW/mgbDp3rWg==" + }, + "@microsoft/recognizers-text-number": { + "version": "1.3.0", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/@microsoft/recognizers-text-number/-/recognizers-text-number-1.3.0.tgz", + "integrity": "sha512-KVFxvaXW9E7UkuF0EYCghvCn0u+N5L7bBXeP4IKB6fXkQd6GAZ9zNA2Acdm9lJzCRxcsBYFbRLcRMrPHwAa32w==", + "requires": { + "@microsoft/recognizers-text": "~1.3.0", + "bignumber.js": "^7.2.1", + "lodash.escaperegexp": "^4.1.2", + "lodash.sortby": "^4.7.0", + "lodash.trimend": "^4.5.1" + } + }, + "bignumber.js": { + "version": "7.2.1", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/bignumber.js/-/bignumber.js-7.2.1.tgz", + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + }, + "lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=" + }, + "lodash.last": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash.last/-/lodash.last-3.0.0.tgz", + "integrity": "sha1-JC9mMRLdTG5jcoxgo8kJ0b2tvUw=" + }, + "lodash.max": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.max/-/lodash.max-4.0.1.tgz", + "integrity": "sha1-hzVWbGGLNan3YFILSHrnllivE2o=" + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" + }, + "lodash.trimend": { + "version": "4.5.1", + "resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/lodash.trimend/-/lodash.trimend-4.5.1.tgz", + "integrity": "sha512-lsD+k73XztDsMBKPKvzHXRKFNMohTjoTKIIo4ADLn5dA65LZ1BqlAvSXhR2rPEC3BgAUQnzMnorqDtqn2z4IHA==" + } + } +} diff --git a/Patterns/Arabic/Arabic-DateTime.yaml b/Patterns/Arabic/Arabic-DateTime.yaml index cdadf97ccc..a72b71f33f 100644 --- a/Patterns/Arabic/Arabic-DateTime.yaml +++ b/Patterns/Arabic/Arabic-DateTime.yaml @@ -81,7 +81,7 @@ OclockRegex: !simpleRegex SpecialDescRegex: !simpleRegex def: ((?)p\b) AmDescRegex: !nestedRegex - def: (في\s)?(صباح(ا)?|صباحًا|الصباح|{BaseDateTime.BaseAmDescRegex}) + def: (في\s)?(صباح(ا)?|صباحًا|ص|الصباح|{BaseDateTime.BaseAmDescRegex}) references: [BaseDateTime.BaseAmDescRegex] PmDescRegex: !nestedRegex def: (في\s)?((ال)?مساء|مساءً|ليلًا|ليلا|(ال)?ليل(ة)?|بعد الظهر|الظهر|ظهرا|{BaseDateTime.BasePmDescRegex}) @@ -90,7 +90,7 @@ AmPmDescRegex: !nestedRegex def: (في\s)?(صباح(ا)?|صباحًا|الصباح|(ال)?مساء|مساءً|{BaseDateTime.BaseAmPmDescRegex}) references: [BaseDateTime.BaseAmPmDescRegex] DescRegex: !nestedRegex - def: (:?(:?({OclockRegex}\s+)?(?({AmPmDescRegex}|{AmDescRegex}|{PmDescRegex}|{SpecialDescRegex})))|{OclockRegex}) + def: (?:(?:({OclockRegex}\s+)?(?({AmPmDescRegex}|{AmDescRegex}|{PmDescRegex}|{SpecialDescRegex})))|{OclockRegex}) references: [ OclockRegex, AmDescRegex, PmDescRegex, AmPmDescRegex, SpecialDescRegex ] OfPrepositionRegex: !simpleRegex def: (\bof\b) @@ -139,6 +139,12 @@ BetweenTokenRegex: !simpleRegex def: \b(between(\s+the)?)$ OrdinalNumberRegex: !simpleRegex def: ((ال)?حادي عشر|ل(ال)?ثاني عشر|(ال)?ثالث عشر|(ال)?رابع عشر|(ال)?خامس عشر|(ال)?خمسة عشر|(ال)?سادس عشر|(ال)?سابع عشر|(ال)?ثامن عشر|(ال)?تاسع عشر|(ال)?عشرون|(ال)?عشرين|(ال)?حادي والعشرون|(ال)?حادية والعشرين|(ال)?حادي والعشرين|(ال)?ثاني والعشرون|(ال)?ثانية والعشرين|(ال)?ثالث والعشرون|(ال)?رابع والعشرون|(ال)?خامس والعشرون|(ال)?سادس والعشرون|(ال)?تاسع والعشرون|(ال)?سابع والعشرون|(ال)?رابع والعشرون|الثامن|الأول|الثالث|الرابع|الخامس|السادس|الثاني|العاشر|السابع) +SolarMonthRegex: !simpleRegex + def: (?يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر) +LunarMonthRegex: !simpleRegex + def: (?محرم|صفر|ربيع الأول|ربيع الثاني|جمادى الأول|جمادى الثاني|رجب|شعبان|رمضان|شوال|ذو القعدة|ذو الحجة) +ArabicMonthRegex: !simpleRegex + def: (?كانون الثاني|شباط|آذار|نيسان|حزيران|تموز|آب|أيلول|تشرين الأول|تشرين الثاني|كانون الأول|أيار) SimpleCasePreMonthRegex: !nestedRegex def: ((بين|من)\s+)(({DayRegex}-{DayRegex})\s+)((من|في)\s+)?((الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})\s+)({RelativeRegex})?({YearRegex})? references: [ DayRegex, SolarMonthRegex, LunarMonthRegex, ArabicMonthRegex, RelativeRegex, YearRegex ] @@ -159,6 +165,8 @@ MonthWithYear: !nestedRegex references: [ SolarMonthRegex, LunarMonthRegex, ArabicMonthRegex, YearRegex, RelativeRegex ] SpecialYearPrefixes: !simpleRegex def: (التقويمي(ة)?|(?المالي(ة)?|الدراسي(ة)?)) +ArabicWeekRegex: !simpleRegex + def: (?الأسبوعين|الاسبوعين|أسابيع|الاسبوع|الأسبوع|الإسبوع|أسبوعين|أسبوعي|اسبوعين|اسبوعي|أسبوع|الاسابيع|الأسابيع) OneWordPeriodRegex: !nestedRegex def: ((بعد|في|آخر)\s+(\d+\s+)?((ال)?سنوات|(ال)?أعوام|(ال)?سنين|(ال)?أسابيع|(ال)?أشهر|(ال)?أيام))(\s+\d+)?(\s+{FutureSuffixRegex})?|((هذا\s+)?(شهر\s+)?(الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})(\s+{RelativeRegex})?)|((هذا\s+)?((عطلة|خلال)\s+)?((نهاية\s+)?({ArabicWeekRegex}|العام)\s*)((بعد\s+)?{RelativeRegex})?) references: [ FutureSuffixRegex, SolarMonthRegex, LunarMonthRegex, ArabicMonthRegex, RelativeRegex, ArabicWeekRegex] @@ -231,12 +239,6 @@ WeekOfRegex: !simpleRegex def: (the\s+)?((week)(\s+(of|(commencing|starting|beginning)(\s+on)?))|w/c)(\s+the)? MonthOfRegex: !simpleRegex def: (من)(\s*)(شهر) -SolarMonthRegex: !simpleRegex - def: (?يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر) -LunarMonthRegex: !simpleRegex - def: (?محرم|صفر|ربيع الأول|ربيع الثاني|جمادى الأول|جمادى الثاني|رجب|شعبان|رمضان|شوال|ذو القعدة|ذو الحجة) -ArabicMonthRegex: !simpleRegex - def: (?كانون الثاني|شباط|آذار|نيسان|حزيران|تموز|آب|أيلول|تشرين الأول|تشرين الثاني|كانون الأول|أيار) MonthRegex: !nestedRegex def: (?{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex}) references: [ SolarMonthRegex, LunarMonthRegex, ArabicMonthRegex ] @@ -260,8 +262,6 @@ RelaxedOnRegex: !nestedRegex references: [ OrdinalDayOfMonthRegex, WeekDayofMonthRegex ] PrefixWeekDayRegex: !simpleRegex def: (\s*((,?\s*on)|[-—–])) -ArabicWeekRegex: !simpleRegex - def: (?الأسبوعين|الاسبوعين|أسابيع|الاسبوع|الأسبوع|الإسبوع|أسبوعين|أسبوعي|اسبوعين|اسبوعي|أسبوع|الاسابيع|الأسابيع) ThisRegex: !nestedRegex def: (?=يوم\s+)?({WeekDayRegex})(\s+)?(من|هذا|)(\s+)?(هذا)?(\s+)({ArabicWeekRegex})((\s+)({RelativeRegex}))? references: [ WeekDayRegex, ArabicWeekRegex, RelativeRegex ] @@ -274,13 +274,11 @@ LastWeekDateRegex: !nestedRegex LastMonthYearDateRegex: !simpleRegex def: (قبل\s+)(\d+ )?((بضعة|بضع|عدة)\s+)?(سنتين|شهرين|الشهور|أشهر|اشهر|شهر|الشهر|أيام|عامين|عام|أعوام|سنة|سنين|سنوات) SpecificDayRegex: !nestedRegex - def: ((قبل|بعد)\s+)?((اليوم|يوم)\s+)?(((?<=ب)الأمس|أمس|الأمس|البارحة)|(آخر يوم|الماضي|السابق|الأخير|يومين)|({DayRegex}\s+{MonthRegex})) + def: ((قبل|بعد)\s+)?((اليوم|يوم)\s+)?(((?<=ب)الأمس|أمس|الأمس|البارحة)|(أول أمس|آخر يوم|الماضي|السابق|الأخير|يومين)|({DayRegex}\s+{MonthRegex})) references: [ DayRegex, MonthRegex ] LastDateRegex: !nestedRegex def: ({LastDayDateRegex}|{LastWeekDateRegex}) references: [ LastDayDateRegex, LastWeekDateRegex, ] -NextRegex: !simpleRegex - def: (\s+)?(الآتي|الأخير|التالي|القادم|من الآن|الحالي|المقبل|الحاضر) NextDayRegex: !nestedRegex def: (هذا يوم\s+|بعد\s+)?(?=(ال)?يوم\s+)?({WeekDayRegex})((\s+)({NextRegex}))? references: [ WeekDayRegex, NextRegex ] @@ -455,7 +453,7 @@ TimeRegex3: !nestedRegex def: (\b{TimePrefix}\s+)?{BaseDateTime.HourRegex}\.{BaseDateTime.MinuteRegex}(\s*{DescRegex}) references: [ TimePrefix, BaseDateTime.HourRegex, BaseDateTime.MinuteRegex, DescRegex ] TimeRegex4: !nestedRegex - def: \b({TimePrefix}\s+)?{BasicTime}(\s*{DescRegex})?\s+{TimeSuffix}(\s*{DescRegex})?\b + def: \b({TimePrefix}\s+)?{BasicTime}(\s*{DescRegex})?(\s+{TimeSuffix})?(\s*{DescRegex})?\b references: [ TimePrefix, BasicTime, DescRegex, TimeSuffix ] TimeRegex5: !nestedRegex def: \b({DescRegex}\s)?{BasicTime}((\s*{DescRegex})((\s+{TimePrefix})?)|(\s+{TimePrefix}(\s+{TimePrefix})?))(\s{DescRegex})? @@ -1338,28 +1336,30 @@ NightTermList: !list SameDayTerms: !list types: [ string ] entries: - - today - - otd + - اليوم + - اليوم الحاضر + - اليوم العصر PlusOneDayTerms: !list types: [ string ] - entries: - - tomorrow - - tmr - - day after + entries: + - غدا + - الغد + - غد + - غدا MinusOneDayTerms: !list types: [ string ] - entries: - - yesterday - - day before + entries: + - أمس + - البارحة + - الأمس PlusTwoDayTerms: !list types: [ string ] - entries: - - day after tomorrow - - day after tmr + entries: + - بعد الغد MinusTwoDayTerms: !list types: [ string ] - entries: - - day before yesterday + entries: + - أول أمس # For DatePeriodParserConfiguration FutureTerms: !list types: [ string ] diff --git a/Patterns/Arabic/Arabic-Numbers.yaml b/Patterns/Arabic/Arabic-Numbers.yaml index db643beb00..5ae11c9d99 100644 --- a/Patterns/Arabic/Arabic-Numbers.yaml +++ b/Patterns/Arabic/Arabic-Numbers.yaml @@ -270,9 +270,9 @@ AmbiguousFractionConnectorsRegex: !simpleRegex def: (\bمن|بين|من|بين\b) # "in" is ambiguous for cases like "more than 30000 in 2009", other connector "out of", "over" is not ambiguous in English #Parser -DecimalSeparatorChar: !char "," +DecimalSeparatorChar: !char "." FractionMarkerToken: أكثر -NonDecimalSeparatorChar: !char "،" +NonDecimalSeparatorChar: !char "," HalfADozenText: ستة WordSeparatorToken: و WrittenDecimalSeparatorTexts: [نقطة | فاصلة] diff --git a/Patterns/Dutch/Dutch-DateTime.yaml b/Patterns/Dutch/Dutch-DateTime.yaml index d23f0f4407..e98ac75b31 100644 --- a/Patterns/Dutch/Dutch-DateTime.yaml +++ b/Patterns/Dutch/Dutch-DateTime.yaml @@ -4,7 +4,7 @@ LangMarker: Dut # Note: CheckBothBeforeAfter is set to true in DutchSetExtractorConfiguration CheckBothBeforeAfter: !bool false TillRegex: !nestedRegex - def: (?\b(tot(dat|\s+en\s+met)?|gedurende|tijdens|ten tijde van)\b|{BaseDateTime.RangeConnectorSymbolRegex}) + def: (?\b(tot(dat|\s+en\s+met)?|en|gedurende|tijdens|ten tijde van)\b|{BaseDateTime.RangeConnectorSymbolRegex}) references: [ BaseDateTime.RangeConnectorSymbolRegex ] RangeConnectorRegex: !nestedRegex def: (?\b(en|t/m|tot(\s+(aan|en\s+met))?)\b|{BaseDateTime.RangeConnectorSymbolRegex}) @@ -47,6 +47,10 @@ PastSuffixRegex: !simpleRegex DayRegex: !simpleRegex def: (de\s*)?(?(?:3[0-1]|[1-2]\d|0?[1-9]))(?:\s*(ste|de|e))?(?=\b|t) # 1-31 written +WrittenOneToNineRegex: !simpleRegex + def: (één|een|twee|drie|vier|vijf|zes|zeven|acht|negen) +WrittenElevenToNineteenRegex: !simpleRegex + def: (elf|elven|twaalf|dertien|veertien|vijftien|zestien|zeventien|achttien|negentien) WrittenDayRegex: !nestedRegex def: (?({WrittenOneToNineRegex})|({WrittenElevenToNineteenRegex})|(({WrittenOneToNineRegex}(en|ën))?twintig)|(((één|een)(en|ën))?dertig)) references: [ WrittenOneToNineRegex, WrittenElevenToNineteenRegex ] @@ -57,10 +61,6 @@ ImplicitDayRegex: !simpleRegex def: (de\s*)?(?(3[0-1]|[0-2]?\d)(\s*(ste|de|e)))\b MonthNumRegex: !simpleRegex def: \b(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\b -WrittenOneToNineRegex: !simpleRegex - def: (één|een|twee|drie|vier|vijf|zes|zeven|acht|negen) -WrittenElevenToNineteenRegex: !simpleRegex - def: (elf|elven|twaalf|dertien|veertien|vijftien|zestien|zeventien|achttien|negentien) WrittenTensRegex: !simpleRegex def: (tien|twintig|dertig|veertig|vijftig|zestig|zeventig|tachtig|negentig) WrittenNumRegex: !nestedRegex @@ -97,7 +97,7 @@ DescRegex: !nestedRegex def: (:?(:?({OclockRegex}\s+)?(?({AmPmDescRegex}|{AmDescRegex}|{PmDescRegex}|{SpecialDescRegex}))\.?)|{OclockRegex}) references: [ OclockRegex, AmDescRegex, PmDescRegex, AmPmDescRegex, SpecialDescRegex ] PmRegex: !nestedRegex - def: (?({ApostrofsRegex}|des)\s+(\bmiddags|avonds|nachts)|((in|tegen|op|om|met)\s+(de\s+)?)(((na)?middag|avond|(midder)?nacht|lunchtijd))|dag) + def: (?({ApostrofsRegex}|des)\s+(\bmiddags|avonds|nachts)|((in|tegen|op|om|met)\s+(de\s+)?)(((na)?middag|avond|(midder)?nacht|lunchtijd))|\s+dag) references: [ ApostrofsRegex ] PmRegexFull: !nestedRegex def: (?(({ApostrofsRegex}|des)\s+(\bmiddags|avonds|nachts)|((in|tegen|op|om|met)\s+(de\s+)?)?(((na)?middag|(?volgende?|komende?|aanstaande?|aankomende?|huidige?|vorige?|afgelopen|dit)\s+jaar) - references: [ YearRegex ] + def: ({YearRegex}|\'?{TwoDigitYearRegex}|(?volgende?|komende?|aanstaande?|aankomende?|huidige?|vorige?|afgelopen|dit)\s+jaar) + references: [ YearRegex, TwoDigitYearRegex ] MonthWithYear: !nestedRegex def: \b(({WrittenMonthRegex}(\.)?(\s*)[/\\\-\.,]?(\s+(van|over|in))?(\s*){RelativeYearRegex})|({RelativeYearRegex}(\s*),?(\s*){WrittenMonthRegex}))\b references: [ WrittenMonthRegex, RelativeYearRegex ] @@ -427,6 +427,8 @@ PeriodHourNumRegex: !simpleRegex ConnectNumRegex: !nestedRegex def: '\b{BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59)\s*{DescRegex}' references: [ BaseDateTime.HourRegex, DescRegex ] +AroundRegex: !simpleRegex + def: (\b(rond(om)?|ongeveer(\s+om)?)\s*\b) TimeRegexWithDotConnector: !nestedRegex def: ({BaseDateTime.HourRegex}(\s*\.\s*){BaseDateTime.MinuteRegex}(\s*:\s*{BaseDateTime.SecondRegex})?(\s*u\s*)?) references: [ BaseDateTime.HourRegex, BaseDateTime.MinuteRegex, BaseDateTime.SecondRegex ] @@ -501,6 +503,8 @@ SpecificTimeBetweenAnd: !nestedRegex references: [ TimeRegex2, RangeConnectorRegex, HourDTRegEx, PeriodHourNumRegex, DescRegex, PmRegexFull, AmRegex, TimeSuffix ] PrepositionRegex: !simpleRegex def: (?^(om|rond|tegen|op|van|deze)(\s+de)?$) +MealTimeRegex: !simpleRegex + def: \b((((tijdens\s+)?de|het)\s+)?(?ontbijt|lunch|avondeten)|((om|tegen|tijdens)\s+)?(?lunchtijd))\b EarlyLateRegex: !simpleRegex def: \b(((?vroege?|(in\s+het\s+)?(begin))|(?laat|later|late|aan\s+het\s+einde?))((\s+|-)(in\s+de|op\s+de|van\s+de|deze|in|op|van|de))?) TimeOfDayRegex: !nestedRegex @@ -546,6 +550,8 @@ UnspecificEndOfRegex: !simpleRegex def: \b(((om|rond|tegen|op)\s+)?het\s+)?(einde?\s+van\s+(de\s+)?dag)\b UnspecificEndOfRangeRegex: !simpleRegex def: \b(evj)\b +MiddlePauseRegex: !simpleRegex + def: \s*(,)\s* PeriodTimeOfDayRegex: !nestedRegex def: ((in\s+(de)?\s+)?({EarlyLateRegex}(\s+|-))?(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag|(eer)?gisteren|morgen)?(?ochtend|(na)?middag|avond|nacht))\b references: [ EarlyLateRegex ] @@ -566,7 +572,7 @@ DurationUnitRegex: !nestedRegex def: (?{DateUnitRegex}|(min\.|sec\.)|((?halfuur)|(?kwartier\s+uur)|(?kwartier)|uur|uren|u|minuten|minuut|m(ins?)?|seconde[ns]?|s(ecs?)?|nacht(en)?)\b)(\s+lang\b)? references: [ DateUnitRegex ] SuffixAndRegex: !simpleRegex - def: (?\s*(en|ën)(\s*een)?\s*(?hal(f|ve)|kwart|kwartier)|(?(een\s+)?kwartier)) + def: (?\s+(en|ën)(\s*een)?\s*(?hal(f|ve)|kwart|kwartier)|(?(een\s+)?kwartier)) PeriodicRegex: !simpleRegex def: \b(?dagelijkse?|(drie)?maandelijkse?|wekelijkse?|twee-?wekelijkse?|(half)?jaarlijkse?|kwartaal)\b EachUnitRegex: !nestedRegex @@ -641,8 +647,6 @@ BeforeRegex: !nestedRegex references: [ InclusiveModPrepositions ] SinceRegex: !simpleRegex def: (\b(sinds|na\s+of\s+gelijk\s+aan|(startend|beginnend)\s+(vanaf|op|met)|(al\s+)?zo\s+vroeg\s+als|(elk|ieder)\s+moment\s+vanaf|een\s+tijdstip\s+vanaf)\b\s*)|(?=) -AroundRegex: !simpleRegex - def: (\b(rond(om)?|ongeveer(\s+om)?)\s*\b) AgoRegex: !simpleRegex def: \b(geleden|(voor|eerder\s+dan)\s+(?gisteren|vandaag))\b LaterRegex: !simpleRegex @@ -720,8 +724,6 @@ RestOfDateRegex: !simpleRegex def: \brest\s+(van\s+)?((de|het|mijn|dit|deze|(de\s+)?huidige)\s+)?(?week|maand|jaar|decennium)\b RestOfDateTimeRegex: !simpleRegex def: \brest\s+(van\s+)?((de|het|mijn|dit|deze|(de\s+)?huidige)\s+)?(?vandaag|dag)\b -MealTimeRegex: !simpleRegex - def: \b((((tijdens\s+)?de|het)\s+)?(?ontbijt|lunch|avondeten)|((om|tegen|tijdens)\s+)?(?lunchtijd))\b AmbiguousRangeModifierPrefix: !simpleRegex def: (voor) PotentialAmbiguousRangeRegex: !nestedRegex @@ -740,8 +742,6 @@ WeekWithWeekDayRangeRegex: !nestedRegex references: [NextPrefixRegex, PreviousPrefixRegex, WeekDayRegex] GeneralEndingRegex: !simpleRegex def: ^\s*((\.,)|\.|,|!|\?)?\s*$ -MiddlePauseRegex: !simpleRegex - def: \s*(,)\s* DurationConnectorRegex: !simpleRegex def: ^\s*(?\s+|en|,)\s*$ PrefixArticleRegex: !simpleRegex diff --git a/Patterns/English/English-DateTime.yaml b/Patterns/English/English-DateTime.yaml index 9d28552127..ab7c711962 100644 --- a/Patterns/English/English-DateTime.yaml +++ b/Patterns/English/English-DateTime.yaml @@ -162,7 +162,7 @@ BetweenRegex: !nestedRegex def: \b(between\s+)({DayRegex}|{WrittenOrdinalDayRegex})\s*{RangeConnectorRegex}\s*({DayRegex}|{WrittenOrdinalDayRegex})\s+{MonthSuffixRegex}((\s+|\s*,\s*){YearRegex})?\b references: [ DayRegex, RangeConnectorRegex , MonthSuffixRegex, YearRegex, WrittenOrdinalDayRegex ] MonthWithYear: !nestedRegex - def: \b((({WrittenMonthRegex}[\.]?|((the\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|sixth|6th|seventh|7th|eighth|8th|ninth|9th|tenth|10th|eleventh|11th|twelfth|12th|last)\s+month(?=\s+(of|in))))((\s*)[/\\\-\.,]?(\s+(of|in))?(\s*)({YearRegex}|(?following|next|last|this)\s+year)|\s+(of|in)\s+{TwoDigitYearRegex}))|(({YearRegex}|(?following|next|last|this)\s+year)(\s*),?(\s*){WrittenMonthRegex}))\b + def: \b((({WrittenMonthRegex}[\.]?|((the\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|sixth|6th|seventh|7th|eighth|8th|ninth|9th|tenth|10th|eleventh|11th|twelfth|12th|last)\s+month(?=\s+(of|in))))((\s*)[/\\\-\.,]?(\s+(of|in))?(\s*)({YearRegex}|\'?{TwoDigitYearRegex}|(?following|next|last|this)\s+year)|\s+(of|in)\s+{TwoDigitYearRegex}))|(({YearRegex}|(?following|next|last|this)\s+year)(\s*),?(\s*){WrittenMonthRegex}))\b references: [ WrittenMonthRegex, YearRegex, TwoDigitYearRegex ] SpecialYearPrefixes: !simpleRegex def: (calendar|(?fiscal|school)) @@ -240,7 +240,7 @@ MonthOfRegex: !simpleRegex # This is a look-behind assertion. Some cases should extract two digits as year like 11/25/16, where 16 means 2016. # The assertion determines if not connected with am/pm or hour separator (:), which should be a time. DateYearRegex: !nestedRegex - def: (?{BaseDateTime.FourDigitYearRegex}|(?{BaseDateTime.FourDigitYearRegex}|(?(a\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\s+(minutes?|mins?))|{DeltaMinuteNumRegex}(\s+(minutes?|mins?))) + def: (?(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: (?{HourNumRegex}\s+{MinuteNumRegex}(\s+(minutes?|mins?))?) diff --git a/Patterns/French/French-DateTime.yaml b/Patterns/French/French-DateTime.yaml index b42c12c865..0fc3cc2a0e 100644 --- a/Patterns/French/French-DateTime.yaml +++ b/Patterns/French/French-DateTime.yaml @@ -92,7 +92,7 @@ BetweenRegex: !nestedRegex YearWordRegex: !simpleRegex def: \b(?l'ann[ée]e)\b MonthWithYear: !nestedRegex - def: \b({WrittenMonthRegex}(\s*),?(\s+de)?(\s*)({YearRegex}|{TwoDigitYearRegex}|(?cette)\s*{YearWordRegex})|{YearWordRegex}\s*({PastSuffixRegex}|{NextSuffixRegex})) + def: \b({WrittenMonthRegex}(\s*),?(\s+de)?(\s*)({YearRegex}|\'?{TwoDigitYearRegex}|(?cette)\s*{YearWordRegex})|{YearWordRegex}\s*({PastSuffixRegex}|{NextSuffixRegex})) references: [ WrittenMonthRegex, YearRegex, TwoDigitYearRegex, YearWordRegex, PastSuffixRegex, NextSuffixRegex ] OneWordPeriodRegex: !nestedRegex def: \b(({RelativeRegex}\s+)?{WrittenMonthRegex}|(la\s+)?(weekend|(fin de )?semaine|week-end|mois|ans?|l'année)\s+{StrictRelativeRegex}|{RelativeRegex}\s+(weekend|(fin de )?semaine|week-end|mois|ans?|l'année)|weekend|week-end|mois|l'année|an)\b @@ -183,7 +183,7 @@ SpecialDate: !nestedRegex def: (?<=\b(au|le)\s+){DayRegex}(?!:)\b references: [ DayRegex ] DateYearRegex: !nestedRegex - def: (?{YearRegex}|{TwoDigitYearRegex}) + def: (?{YearRegex}|\'?{TwoDigitYearRegex}) references: [ YearRegex, TwoDigitYearRegex ] DateExtractor1: !nestedRegex def: \b({WeekDayRegex}(\s+|\s*,\s*))?{MonthRegex}\s*[/\\\.\-]?\s*{DayRegex}(\s*([/\\\.\-]|\bde\b)?\s*{BaseDateTime.FourDigitYearRegex})?\b @@ -268,7 +268,7 @@ MidmorningRegex: !nestedRegex def: (?milieu\s*d[ue]\s*{MorningRegex}) references: [ MorningRegex ] MiddayRegex: !simpleRegex - def: (?milieu(\s*|-)d[eu]\s*(jour|midi)|apr[eè]s(-|\s*)midi|(?<=\bà\s+)midi) + def: (?milieu(\s*|-)d[eu]\s*(jour|midi)|apr[eè]s(-|\s*)midi|(?<=à\s+)midi) MidafternoonRegex: !nestedRegex def: (?milieu\s*d'+{AfternoonRegex}) references: [ AfternoonRegex ] diff --git a/Patterns/German/German-DateTime.yaml b/Patterns/German/German-DateTime.yaml index 4da821cf0a..48c415b9f1 100644 --- a/Patterns/German/German-DateTime.yaml +++ b/Patterns/German/German-DateTime.yaml @@ -106,8 +106,8 @@ BetweenRegex: !nestedRegex def: ((zwischen\s+)({DayRegex})(\s+{MonthSuffixRegex})?\s*{RangeConnectorRegex}\s*({DayRegex})(\s+{MonthSuffixRegex})((\s+|\s*,\s*){YearRegex})?|(zwischen\s+)({DayRegex})(\s+{MonthSuffixRegex})?\s*{RangeConnectorRegex}\s*({DayRegex})(\s+{MonthSuffixRegex})?((\s+|\s*,\s*){YearRegex})?) references: [ DayRegex, RangeConnectorRegex , MonthSuffixRegex, YearRegex ] MonthWithYear: !nestedRegex - def: \b((?apr(il|\.)|aug(ust|\.)|dez(ember|\.)|feb(ruar|ber|\.)|januar|j[äa]n(ner|\.)|jul(e?i|l\.)|jun([io]|\.)|märz|mai|nov(ember|\.)|okt(ober|\.)|sept?(ember|\.))(\s*),?(\s+des)?(\s*)({YearRegex}|(?nächste[mn]|letzte[mn]|diese(s|n))\s+jahres)) - references: [ YearRegex ] + def: \b((?apr(il|\.)|aug(ust|\.)|dez(ember|\.)|feb(ruar|ber|\.)|januar|j[äa]n(ner|\.)|jul(e?i|l\.)|jun([io]|\.)|märz|mai|nov(ember|\.)|okt(ober|\.)|sept?(ember|\.))(\s*),?(\s+des)?(\s*)({YearRegex}|\'?{TwoDigitYearRegex}|(?nächste[mn]|letzte[mn]|diese(s|n))\s+jahres)) + references: [ YearRegex , TwoDigitYearRegex ] OneWordPeriodRegex: !nestedRegex def: \b((((im\s+)?monat\s+)?({RelativeRegex}\s*(jahr\s*(im\s*)?)?)?(?apr(il|\.)|aug(ust|\.)|dez(ember|\.)|feb(ruar|ber|\.)|j[äa]n(uar|ner|\.)|jul(e?i|l\.)|jun([io]|\.)|märz|mai|nov(ember|\.)|okt(ober|\.)|sept?(ember|\.)))|(?unter\s+der\s+woche)|({RelativeRegex}\s+)?((?werktags|arbeitswoche)|woche(nende)?|monat(s)?|jahr|jahres)(?!(\s+\d+(?!({BaseDateTime.BaseAmDescRegex}|{BaseDateTime.BasePmDescRegex}))|\s+bis\s+heute)))\b references: [ RelativeRegex, BaseDateTime.BaseAmDescRegex, BaseDateTime.BasePmDescRegex ] @@ -162,7 +162,7 @@ MonthRegex: !simpleRegex #This is a look-behind assertion. Some cases should extract two digits as year like 11/25/16, where 16 means 2016. #The assertion determines if not connected with am/pm or hour separator (:), which should be a time. DateYearRegex: !nestedRegex - def: (?{BaseDateTime.FourDigitYearRegex}|{TwoDigitYearRegex}) + def: (?{BaseDateTime.FourDigitYearRegex}|\'?{TwoDigitYearRegex}) references: [ BaseDateTime.FourDigitYearRegex, TwoDigitYearRegex ] OnRegex: !nestedRegex def: (?<=\bam\s+)({DayRegex}s?)\b @@ -199,8 +199,8 @@ SpecialDate: !nestedRegex def: (?=\b(an( dem)?|am)\s+){DayRegex}\b references: [ DayRegex ] DateExtractor1: !nestedRegex - def: \b(({WeekDayRegex})(\s+|\s*,\s*))?({DayRegex}\s*[/\\.,\- ]\s*{MonthRegex}(\s*[/\\.,\- ]\s*{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\s*[/\\.,\- ]\s*{DayRegex}\s*[/\\.,\- ]\s*{MonthRegex})\b - references: [ WeekDayRegex, MonthRegex, DayRegex, DateYearRegex, BaseDateTime.FourDigitYearRegex ] + def: \b(({WeekDayRegex})(\s+|\s*,\s*))?({DayRegex}\s*[/\\.,\- ]\s*({MonthNumRegex}|{MonthRegex})(\s*[/\\.,\- ]\s*{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\s*[/\\.,\- ]\s*{DayRegex}\s*[/\\.,\- ]\s*{MonthRegex})\b + references: [ WeekDayRegex, MonthRegex, MonthNumRegex, DayRegex, DateYearRegex, BaseDateTime.FourDigitYearRegex ] DateExtractor2: !nestedRegex def: \b({MonthRegex}\s*[/\\.,\- ]\s*{DayRegex}(?!\s*\-\s*\d{2}\b)(\s*[/\\.,\- ]\s*{DateYearRegex})?)\b references: [ WeekDayRegex, MonthRegex, DayRegex, DateYearRegex ] @@ -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 @@ -271,7 +271,7 @@ AmPmPrefixRegex: !simpleRegex CommonDatePrefixRegex: !simpleRegex def: ^[\.] LessThanOneHour: !nestedRegex - def: \b(?(ein(er?)?\s+)?((drei)?viertel|halb(en?)?)(\s*stunden?)?)|{BaseDateTime.DeltaMinuteRegex}(\s+(min(uten?)?))|{DeltaMinuteNumRegex}(\s+(min(uten?)?)) + def: \b(?(ein(er?)?\s+)?((drei)?viertel|halb(en?)?)(\s*stunden?)?)|{BaseDateTime.DeltaMinuteRegex}(\s+(min(uten?)?)|(?=\s+(nach|vor)))|{DeltaMinuteNumRegex}(\s+(min(uten?)?)|(?=\s+(nach|vor))) references: [ BaseDateTime.DeltaMinuteRegex, DeltaMinuteNumRegex ] WrittenTimeRegex: !nestedRegex def: (um\s*)?(?{HourNumRegex}(\s*{OclockRegex}\s*)({MinuteNumRegex}|{MinuteNumRegex}und(?zwanzig|dreißig|vierzig|fünfzig))) diff --git a/Patterns/Italian/Italian-DateTime.yaml b/Patterns/Italian/Italian-DateTime.yaml index 9085adec71..f059ae64cc 100644 --- a/Patterns/Italian/Italian-DateTime.yaml +++ b/Patterns/Italian/Italian-DateTime.yaml @@ -108,7 +108,7 @@ TwoDigitYearRegex: !nestedRegex #This is a look-behind assertion. Some cases should extract two digits as year like 11/25/16, where 16 means 2016. #The assertion determines if not connected with am/pm or hour separator (:), which should be a time. DateYearRegex: !nestedRegex - def: (?{BaseDateTime.FourDigitYearRegex}|{TwoDigitYearRegex}) + def: (?{BaseDateTime.FourDigitYearRegex}|\'?{TwoDigitYearRegex}) references: [ BaseDateTime.FourDigitYearRegex, TwoDigitYearRegex ] YearSuffix: !nestedRegex def: (,?\s*({DateYearRegex}|{FullTextYearRegex})) @@ -133,8 +133,8 @@ BetweenRegex: !nestedRegex YearWordRegex: !simpleRegex def: \b(?l'anno)\b MonthWithYear: !nestedRegex - def: \b({MonthRegex}(\.)?(\s*)[/\\\-\.,]?(((\s+del)?\s+{YearRegex})|((\s+(del|di|il))?\s+(?prossim['o]|passato|quest['o])\s*anno)|((\s+(del)?l')anno\s+(?prossimo|passato)))) - references: [ YearRegex, MonthRegex ] + def: \b({MonthRegex}(\.)?(\s*)[/\\\-\.,]?(((\s+del)?\s+{YearRegex}|\'?{TwoDigitYearRegex})|((\s+(del|di|il))?\s+(?prossim['o]|passato|quest['o])\s*anno)|((\s+(del)?l')anno\s+(?prossimo|passato)))) + references: [ YearRegex, MonthRegex, TwoDigitYearRegex ] SpecialYearPrefixes: !simpleRegex def: (?fiscale|scolastico) OneWordPeriodRegex: !nestedRegex @@ -303,13 +303,13 @@ LunchRegex: !simpleRegex NightRegex: !simpleRegex def: \b(mezzanotte|notte)\b LessThanOneHour: !nestedRegex - def: (?(un\s+quarto|tre quarti?|mezz[oa]|mezz'ora|{BaseDateTime.DeltaMinuteRegex}(\s+(minut[oi]|min))?|{DeltaMinuteNumRegex}(\s+(minut[oi]|min))|(?<=(e|meno)\s+){DeltaMinuteNumRegex})) + def: (?(un\s+quarto|tre quarti?|mezz[oa]|mezz'ora|{BaseDateTime.DeltaMinuteRegex}|{DeltaMinuteNumRegex})) references: [ BaseDateTime.DeltaMinuteRegex, DeltaMinuteNumRegex ] EngTimeRegex: !nestedRegex def: (?{HourNumRegex}\s+e\s+({MinuteNumRegex}|(?venti?|trenta?|quaranta?|cinquanta?){MinuteNumRegex})) references: [ HourNumRegex, MinuteNumRegex ] TimePrefix: !nestedRegex - def: (?(e\s+{LessThanOneHour}|{LessThanOneHour}\s+(minut[oi]|min)\s+all[e']|meno {LessThanOneHour})) + def: (?((e|meno)\s+{LessThanOneHour}(\s+(minut[oi]|min))?|{LessThanOneHour}\s+(minut[oi]|min)\s+all[e'])) references: [ LessThanOneHour ] TimeSuffix: !nestedRegex def: (?{AmRegex}|{PmRegex}|{OclockRegex}) diff --git a/Patterns/Italian/Italian-NumbersWithUnit.yaml b/Patterns/Italian/Italian-NumbersWithUnit.yaml index d3b08e36b5..15d7721019 100644 --- a/Patterns/Italian/Italian-NumbersWithUnit.yaml +++ b/Patterns/Italian/Italian-NumbersWithUnit.yaml @@ -643,7 +643,7 @@ CurrencyPrefixList: !dictionary types: [ string, string ] entries: #Dollar Prefix - Dollar: $ + Dollar: $|dollari United States dollar: $ stati uniti|us$|us $|u.s. $|u.s $ East Caribbean dollar: east caribbean $ Australian dollar: $ australiano|$ australia diff --git a/Patterns/Japanese/Japanese-DateTime.yaml b/Patterns/Japanese/Japanese-DateTime.yaml index 2f1ab566b1..67580a4f8b 100644 --- a/Patterns/Japanese/Japanese-DateTime.yaml +++ b/Patterns/Japanese/Japanese-DateTime.yaml @@ -281,6 +281,28 @@ DecadeRegexInCJK: !simpleRegex DecadeRegex: !nestedRegex def: ({DateRangePrepositions})(?({CenturyRegex}|{CenturyRegexInCJK}|{RelativeCenturyRegex}))?の?(?(?\d{2}(?=\d)))?(?((\d{1}0)|{DecadeRegexInCJK}))年代(のごろ)? references: [DateRangePrepositions, CenturyRegex, CenturyRegexInCJK, RelativeCenturyRegex, DecadeRegexInCJK] +#TimeExtractorCJK +TimeHourNumRegex: !simpleRegex + def: (?^(,?(夜の|的|の(?朝|夜|午後|晩)?|t),?|在)$) @@ -459,28 +481,6 @@ SetEachDayRegex: !simpleRegex def: (毎|各|毎一)(天|日)\s*$ SetEachDateUnitRegex: !simpleRegex def: (毎)(年|月|週)\s*$ -#TimeExtractorCJK -TimeHourNumRegex: !simpleRegex - def: (?{TimeHourCJKRegex}|{TimeHourNumRegex}){TimeClockDescRegex} @@ -685,6 +685,10 @@ YearToDateTerms: !list types: [ string ] entries: - 年初来 +MonthToDateTerms: !list + types: [ string ] + entries: + - 月に入ってから LastYearTerms: !list types: [ string ] entries: @@ -1249,7 +1253,6 @@ DynastyYearMap: !dictionary 明治43: 1910 明治44: 1911 明治45: 1912 - 大正元: 1912 大正2: 1913 大正3: 1914 大正4: 1915 diff --git a/Patterns/Japanese/Japanese-NumbersWithUnit.yaml b/Patterns/Japanese/Japanese-NumbersWithUnit.yaml index 855b945a28..76cac45b91 100644 --- a/Patterns/Japanese/Japanese-NumbersWithUnit.yaml +++ b/Patterns/Japanese/Japanese-NumbersWithUnit.yaml @@ -46,14 +46,14 @@ CurrencySuffixList: !dictionary Chetrum: チェルタム #Bolivian boliviano Bolivian boliviano: ボリビアーノ -#Bosnia and Herzegovina convertible mark +#Bosnia and Herzegovina convertible mark Bosnia and Herzegovina convertible mark: 兌換マルク #Botswana pula Botswana pula: ボツワナ・プラ|ボツワナプラ|プラ Thebe: テベ #Brazilian real Brazilian real: ブラジル・レアル|ブラジルレアル|レアル -#Bulgarian lev +#Bulgarian lev Bulgarian lev: ブルガリア・レフ|ブルガリアレフ|レフ Stotinka: ストティンカ #Cambodian riel @@ -190,7 +190,7 @@ CurrencySuffixList: !dictionary Manat: マナト #Shilling Somali shilling: ソマリア・シリング - Somaliland shilling: ソマリランド・シリング + Somaliland shilling: ソマリランド・シリング Tanzanian shilling: タンザニア・シリング Ugandan shilling: ウガンダ・シリング #Leu @@ -499,10 +499,10 @@ CurrencyNameToIsoCodeMap: !dictionary Kiribati dollar: _KID Guernsey pound: _GGP Faroese króna: _FOK - Cook Islands dollar: _CKD - British Virgin Islands dollar: _BD - Ascension pound: _AP - Alderney pound: _ALP + Cook Islands dollar: _CKD + British Virgin Islands dollar: _BD + Ascension pound: _AP + Alderney pound: _ALP Abkhazian apsar: _AA FractionalUnitNameToCodeMap: !dictionary types: [ string, string ] @@ -781,4 +781,4 @@ TemperatureAmbiguousValues: !list - 度 - k HalfUnitRegex: !simpleRegex - def: 半 \ No newline at end of file + def: 半 diff --git a/Patterns/Portuguese/Portuguese-DateTime.yaml b/Patterns/Portuguese/Portuguese-DateTime.yaml index 41b91b9a6b..fd06bff6ff 100644 --- a/Patterns/Portuguese/Portuguese-DateTime.yaml +++ b/Patterns/Portuguese/Portuguese-DateTime.yaml @@ -85,7 +85,7 @@ OneWordPeriodRegex: !nestedRegex def: \b(((pr[oó]xim[oa]?|[nd]?es[st]e|aquel[ea]|[uú]ltim[oa]?|em)\s+)?(?abr(il)?|ago(sto)?|dez(embro)?|fev(ereiro)?|jan(eiro)?|ju[ln](ho)?|mar([çc]o)?|maio?|nov(embro)?|out(ubro)?|sep?t(embro)?)|({RelativeRegex}\s+)?(ano\s+{SpecialYearPrefixes}|{SpecialYearPrefixes}\s+ano)|(?<=\b(de|do|da|o|a)\s+)?(pr[oó]xim[oa](s)?|[uú]ltim[oa]s?|est(e|a))\s+(fim de semana|fins de semana|semana|m[êe]s|ano)|fim de semana|fins de semana|(m[êe]s|anos)? [àa] data)\b references: [RelativeRegex, SpecialYearPrefixes] MonthWithYearRegex: !nestedRegex - def: \b((((pr[oó]xim[oa](s)?|[nd]?es[st]e|aquele|[uú]ltim[oa]?|em)\s+)?{MonthRegex}|((n?o\s+)?(?primeiro|1o|segundo|2o|terceiro|3o|[cq]uarto|4o|quinto|5o|sexto|6o|s[eé]timo|7o|oitavo|8o|nono|9o|d[eé]cimo(\s+(primeiro|segundo))?|10o|11o|12o|[uú]ltimo)\s+m[eê]s(?=\s+(d[aeo]|[ao]))))\s+((d[aeo]|[ao])\s+)?({YearRegex}|{TwoDigitYearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|[nd]?es[st]e)\s+ano))\b + def: \b((((pr[oó]xim[oa](s)?|[nd]?es[st]e|aquele|[uú]ltim[oa]?|em)\s+)?{MonthRegex}|((n?o\s+)?(?primeiro|1o|segundo|2o|terceiro|3o|[cq]uarto|4o|quinto|5o|sexto|6o|s[eé]timo|7o|oitavo|8o|nono|9o|d[eé]cimo(\s+(primeiro|segundo))?|10o|11o|12o|[uú]ltimo)\s+m[eê]s(?=\s+(d[aeo]|[ao]))))\s+((d[aeo]|[ao])\s+)?({YearRegex}|\'?{TwoDigitYearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|[nd]?es[st]e)\s+ano))\b references: [ MonthRegex, YearRegex, TwoDigitYearRegex ] MonthNumWithYearRegex: !nestedRegex def: ({YearRegex}(\s*?)[/\-\.](\s*?){MonthNumRegex})|({MonthNumRegex}(\s*?)[/\-](\s*?){YearRegex}) @@ -217,7 +217,7 @@ WeekDayEnd: !nestedRegex WeekDayStart: !simpleRegex def: ^\b$ DateYearRegex: !nestedRegex - def: (?{YearRegex}|{TwoDigitYearRegex}) + def: (?{YearRegex}|\'?{TwoDigitYearRegex}) references: [ YearRegex, TwoDigitYearRegex ] DateExtractor1: !nestedRegex # (domingo,)? 5 de Abril diff --git a/Patterns/Spanish/Spanish-DateTime.yaml b/Patterns/Spanish/Spanish-DateTime.yaml index 5d790e2f21..dfeefc0641 100644 --- a/Patterns/Spanish/Spanish-DateTime.yaml +++ b/Patterns/Spanish/Spanish-DateTime.yaml @@ -96,7 +96,7 @@ OneWordPeriodRegex: !nestedRegex def: \b(((((la|el)\s+)?mes\s+(({OfPrepositionRegex})\s+)?)|((pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?)\s+))?({MonthRegex})|((el\s+)?{RelativeRegex}\s+)?(({SpecialYearPrefixes}\s+)año|año\s+{SpecialYearPrefixes})|(((la|el)\s+)?((({RelativeRegex}\s+)({DateUnitRegex}|(fin\s+de\s+)?semana|finde)(\s+{RelativeSuffixRegex})?)|{DateUnitRegex}(\s+{RelativeSuffixRegex}))|va\s+de\s+{DateUnitRegex}|((año|mes)(\s+(a|hasta)\s+la\s+fecha)?|((el\s+)?fin\s+de\s+)?semana|(el\s+)?finde))\b) references: [MonthRegex, RelativeRegex, OfPrepositionRegex, RelativeSuffixRegex, DateUnitRegex, SpecialYearPrefixes] MonthWithYearRegex: !nestedRegex - def: \b((((pr[oó]xim[oa](s)?|est?[ae]|[uú]ltim[oa]?)\s+)?{MonthRegex}|((el\s+)?(?primero?|1(er|ro)|segundo|2do|tercero?|3(er|ro)|uarto|4to|quinto|5to|sexto|6to|s[eé]ptimo|7mo|octavo|8vo|noveno|9no|d[eé]cimo|10mo|und[eé]cimo|11mo|duod[eé]cimo|12mo|[uú]ltimo)\s+mes(?=\s+(del?|en))))((\s+|(\s*[,-]\s*))((de(l|\s+la)?|en)\s+)?({YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\s+año)|\s+(del?|en)\s+{TwoDigitYearRegex}))\b + def: \b((((pr[oó]xim[oa](s)?|est?[ae]|[uú]ltim[oa]?)\s+)?{MonthRegex}|((el\s+)?(?primero?|1(er|ro)|segundo|2do|tercero?|3(er|ro)|uarto|4to|quinto|5to|sexto|6to|s[eé]ptimo|7mo|octavo|8vo|noveno|9no|d[eé]cimo|10mo|und[eé]cimo|11mo|duod[eé]cimo|12mo|[uú]ltimo)\s+mes(?=\s+(del?|en))))((\s+|(\s*[,-]\s*))((de(l|\s+la)?|en)\s+)?({YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\s+año)|\s+(del?|en)\s+\'?{TwoDigitYearRegex}))\b references: [ MonthRegex, YearRegex, TwoDigitYearRegex ] MonthNumWithYearRegex: !nestedRegex def: \b(({YearRegex}(\s*?)[/\-\.~](\s*?){MonthNumRegex})|({MonthNumRegex}(\s*?)[/\-\.~](\s*?){YearRegex}))\b @@ -237,7 +237,7 @@ WeekDayEnd: !nestedRegex WeekDayStart: !simpleRegex def: ^\b$ DateYearRegex: !nestedRegex - def: (?{YearRegex}|(?{YearRegex}|(? /dev/null || git show-ref --tags -d | grep ^${COMMIT_ID} | sed -e 's,.* refs/tags/,,' -e 's/\\^{}//' | xargs || echo ''").trim() + if(BRANCH.equals("master")) { + NICKNAME = 'main' + } else { + NICKNAME = 'PR' + } + sh "echo ${NICKNAME}" + sh """ + rm -rf allure-results + mkdir allure-results + """ + withCredentials([usernamePassword(credentialsId: params.CREDENTIALSID, usernameVariable: 'username', passwordVariable: 'password')]) { + sh """ + rm -rf pip.conf + echo '[global]' >> pip.conf + echo 'extra-index-url = https://$username:$password@nexus.use1.infra-pure.cloud/repository/inin-pypi/simple' >> pip.conf + """ + } + + } + } + + stage("Test install package and run tests") { + dir('Python') { + sh """ + virtualenv -p python3.8 --clear venv + . venv/bin/activate + sh build.sh venv + """ + } + } + + stage("Publish Build Artifacts") { + dir(LIBRARY_FOLDER){ + try { + sh """ + virtualenv -p python3.8 --clear venv + . venv/bin/activate + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + dir(LIBRARY_FOLDER + "/recognizers-text"){ + + try { + sh """ + . ../venv/bin/activate + python setup.py sdist upload -r inin-pypi + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + dir(LIBRARY_FOLDER + "/recognizers-number"){ + + try { + sh """ + . ../venv/bin/activate + python setup.py sdist upload -r inin-pypi + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + dir(LIBRARY_FOLDER + "/recognizers-number-with-unit"){ + + try { + sh """ + . ../venv/bin/activate + python setup.py sdist upload -r inin-pypi + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + dir(LIBRARY_FOLDER + "/datatypes-timex-expression"){ + + try { + sh """ + . ../venv/bin/activate + python setup.py sdist upload -r inin-pypi + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + dir(LIBRARY_FOLDER + "/recognizers-date-time"){ + + try { + sh """ + . ../venv/bin/activate + python setup.py sdist upload -r inin-pypi + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + dir(LIBRARY_FOLDER + "/recognizers-sequence"){ + + try { + sh """ + . ../venv/bin/activate + python setup.py sdist upload -r inin-pypi + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + dir(LIBRARY_FOLDER + "/recognizers-choice"){ + + try { + sh """ + . ../venv/bin/activate + python setup.py sdist upload -r inin-pypi + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + dir(LIBRARY_FOLDER + "/recognizers-suite"){ + + try { + sh """ + . ../venv/bin/activate + python setup.py sdist upload -r inin-pypi + """ + } catch(Exception e) { + echo "Skipping publish of artifact version ${ARTIFACT_VERSION}. Exception is ${e}" + } + } + + } + + } +} diff --git a/Python/README.md b/Python/README.md index a48cfdbd28..61bf241800 100644 --- a/Python/README.md +++ b/Python/README.md @@ -9,6 +9,12 @@ Recognizer's are organized into groups and designed to be used in C#, Node.js, P git clone https://github.com/Microsoft/Recognizers-Text.git cd Recognizers-Text +## Setting Up the Development Environment + + cd Python + pip install -r requirements.txt + pre-commit install + ### Manual Build Open a terminal and run the following commands: @@ -26,9 +32,17 @@ You can then install each of the local packages: pip install -e .\libraries\recognizers-number-with-unit\ pip install -e .\libraries\recognizers-date-time\ -To run tests: +To run all tests: + + pytest --tb=line -n auto + +To run a specific test suite, use one of the following commands: - pytest --tb=line + pytest -n auto tests/test_runner_choice.py + pytest -n auto tests/test_runner_datetime.py + pytest -n auto tests/test_runner_number.py + pytest -n auto tests/test_runner_number_with_unit.py + pytest -n auto tests/test_runner_sequence.py ### Automatized Build @@ -58,9 +72,9 @@ Once the proper package is installed, you'll need to reference the package: ````Python from recognizers_text import Culture, ModelResult from recognizers_number import NumberRecognizer -from recognizers_number_with_unit import NumberWithUnitRecognizer -from recognizers_date_time import DateTimeRecognizer -from recognizers_sequence import SequenceRecognizer +from recognizers_number_with_unit import NumberWithUnitRecognizer +from recognizers_date_time import DateTimeRecognizer +from recognizers_sequence import SequenceRecognizer ```` Or, using the suite package: @@ -111,27 +125,7 @@ Internally, both methods will cache the instance models to avoid extra costs. `NumberRecognizer(Culture.English).get_ordinal_model()` -* **Percentages** - - This recognizer will find any number presented as percentage. E.g. _"one hundred percents"_ will return _"100%"_. - - `recognize_percentage('one hundred percents', Culture.English))` - - Or you can obtain a model instance using: - - `NumberRecognizer(Culture.English).get_percentage_model()` - ### Microsoft.Recognizers.Text.NumberWithUnit -* **Ages** - - This recognizer will find any age number presented. E.g. _"After ninety five years of age, perspectives change"_ will return _"95 Year"_. - - `recognize_age('After ninety five years of age, perspectives change', Culture.English)` - - Or you can obtain a model instance using: - - `NumberWithUnitRecognizer(Culture.English).get_age_model()` - * **Currencies** This recognizer will find any currency presented. E.g. _"Interest expense in the 1988 third quarter was $ 75.3 million"_ will return _"75300000 Dollar"_. @@ -142,26 +136,6 @@ Internally, both methods will cache the instance models to avoid extra costs. `NumberWithUnitRecognizer(Culture.English).get_currency_model()` -* **Dimensions** - - This recognizer will find any dimension presented. E.g. _"The six-mile trip to my airport hotel that had taken 20 minutes earlier in the day took more than three hours."_ will return _"6 Mile"_. - - `recognize_dimension('The six-mile trip to my airport hotel that had taken 20 minutes earlier in the day took more than three hours.', Culture.English)` - - Or you can obtain a model instance using: - - `NumberWithUnitRecognizer(Culture.English).get_dimension_model()` - -* **Temperatures** - - This recognizer will find any temperature presented. E.g. _"Set the temperature to 30 degrees celsius"_ will return _"30 C"_. - - `recognize_temperature('Set the temperature to 30 degrees celsius', Culture.English)` - - Or you can obtain a model instance using: - - `NumberWithUnitRecognizer(Culture.English).get_temperature_model()` - ### Microsoft.Recognizers.Text.DateTime * **DateTime** @@ -182,7 +156,7 @@ Internally, both methods will cache the instance models to avoid extra costs. The Recognizers aim to bridge people's spoken language and machine's programming languages. As such, Recognizers were designed to facilitate growing the number of supported _cultures_ (i.e. spoken languages) and _platforms_ (i.e. programming languages.) - + With this goal in mind, they are designed to disjoint the specific culture's logic from the recognizer's core implementation. A shared set of tools are available at the heart of a *cross-culture & cross-platform* approach that will help with extending the number and range of the recognizers. diff --git a/Python/build.sh b/Python/build.sh index 040b798eb4..5022eaeb2f 100644 --- a/Python/build.sh +++ b/Python/build.sh @@ -1,16 +1,3 @@ -cd libraries/resource-generator - -echo // Installing Resource Generator Dependencies -pip install -r ./requirements.txt - -echo // Building Resources -python index.py ../recognizers-choice/resource-definitions.json -python index.py ../recognizers-number/resource-definitions.json -python index.py ../recognizers-number-with-unit/resource-definitions.json -python index.py ../recognizers-date-time/resource-definitions.json -python index.py ../recognizers-sequence/resource-definitions.json - -cd ../.. echo // Installing recognizers-text pip install -e ./libraries/recognizers-text/ @@ -39,4 +26,4 @@ echo // Installing Test Dependencies pip install -r ./tests/requirements.txt echo // Running tests -pytest --tb=line +pytest --tb=line -n auto diff --git a/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/english/english_timex_relative_convert.py b/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/english/english_timex_relative_convert.py index 620ecc069f..0e575b9a5f 100644 --- a/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/english/english_timex_relative_convert.py +++ b/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/english/english_timex_relative_convert.py @@ -94,7 +94,7 @@ def convert_date_time_range(timex: Timex, date: datetime): def english_convert_timex_to_string_relative(timex: Timex, date: datetime): - types = timex.types if len(timex.types) is not 0 else TimexInference.infer(timex) + types = timex.types if len(timex.types) != 0 else TimexInference.infer(timex) if Constants.TIMEX_TYPES_PRESENT in types: return 'now' diff --git a/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/timex_constants.py b/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/timex_constants.py index d09182befd..941d210225 100644 --- a/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/timex_constants.py +++ b/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/timex_constants.py @@ -20,3 +20,5 @@ class Constants: 'SATURDAY': 5, 'SUNDAY': 6 } + GENERAL_PERIOD_PREFIX: str = "P" + TIME_TIMEX_PREFIX: str = "T" diff --git a/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/timex_helpers.py b/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/timex_helpers.py index 07fbf5a3ef..ae3c73bff9 100644 --- a/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/timex_helpers.py +++ b/Python/libraries/datatypes-timex-expression/datatypes_timex_expression/timex_helpers.py @@ -2,6 +2,7 @@ # Licensed under the MIT License. from datetime import date, timedelta, datetime +from typing import List from math import floor @@ -164,9 +165,9 @@ def timex_datetime_add(start, duration): @staticmethod def date_from_timex(timex): return date( - timex.year if timex.year is not None else 2001, - timex.month if timex.month is not None else 1, - timex.day_of_month if timex.day_of_month is not None else 1 + int(timex.year) if timex.year is not None else 2001, + int(timex.month) if timex.month is not None else 1, + int(timex.day_of_month) if timex.day_of_month is not None else 1 ) @staticmethod @@ -227,3 +228,31 @@ def clone_duration(timex): result.weekend = None result.part_of_day = None return result + + @staticmethod + def is_time_duration_timex(timex: str) -> bool: + return timex.startswith(f"{Constants.GENERAL_PERIOD_PREFIX}{Constants.TIME_TIMEX_PREFIX}") + + @staticmethod + def get_duration_timex_without_prefix(timex: str) -> str: + # Remove "PT" prefix for TimeDuration, Remove "P" prefix for DateDuration + if TimexHelpers.is_time_duration_timex(timex): + return timex[2:] + else: + return timex[1:] + + @staticmethod + def generate_compound_duration_timex(timex_list: List[str]) -> str: + is_time_duration_already_exist = False + timex_builder = Constants.GENERAL_PERIOD_PREFIX + + # The Time Duration component occurs first time + for timex_component in timex_list: + if not is_time_duration_already_exist and TimexHelpers.is_time_duration_timex(timex_component): + timex_builder += f"{Constants.TIME_TIMEX_PREFIX}" \ + f"{TimexHelpers.get_duration_timex_without_prefix(timex_component)}" + is_time_duration_already_exist = True + else: + timex_builder += f"{TimexHelpers.get_duration_timex_without_prefix(timex_component)}" + + return timex_builder diff --git a/Python/libraries/datatypes-timex-expression/setup.py b/Python/libraries/datatypes-timex-expression/setup.py index 6596291226..7b91948241 100644 --- a/Python/libraries/datatypes-timex-expression/setup.py +++ b/Python/libraries/datatypes-timex-expression/setup.py @@ -3,15 +3,15 @@ import os -from setuptools import setup, find_packages +from setuptools import find_packages, setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -NAME = 'datatypes_timex_expression' -VERSION = '1.0.0.a0' +NAME = 'datatypes_timex_expression_genesys' +VERSION = '1.1.43' REQUIRES = [] setup( @@ -32,5 +32,5 @@ def read(fname): 'Operating System :: OS Independent', 'Development Status :: 3 - Alpha', 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] + ], ) diff --git a/Python/libraries/recognizers-choice/recognizers_choice/choice/constants.py b/Python/libraries/recognizers-choice/recognizers_choice/choice/constants.py index 9710c05eff..638302f659 100644 --- a/Python/libraries/recognizers-choice/recognizers_choice/choice/constants.py +++ b/Python/libraries/recognizers-choice/recognizers_choice/choice/constants.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class Constants: SYS_BOOLEAN: str = "boolean" SYS_BOOLEAN_TRUE: str = "boolean-true" diff --git a/Python/libraries/recognizers-choice/recognizers_choice/choice/english/boolean.py b/Python/libraries/recognizers-choice/recognizers_choice/choice/english/boolean.py index 5ea6e4225c..37862052da 100644 --- a/Python/libraries/recognizers-choice/recognizers_choice/choice/english/boolean.py +++ b/Python/libraries/recognizers-choice/recognizers_choice/choice/english/boolean.py @@ -15,10 +15,7 @@ class EnglishBooleanExtractorConfiguration(BooleanExtractorConfiguration): only_top_match: bool def __init__(self, only_top_match: bool = True): - self.regex_true = RegExpUtility.get_safe_reg_exp( - EnglishChoice.TrueRegex) - self.regex_false = RegExpUtility.get_safe_reg_exp( - EnglishChoice.FalseRegex) - self.token_regex = RegExpUtility.get_safe_reg_exp( - EnglishChoice.TokenizerRegex, regex.S) + self.regex_true = RegExpUtility.get_safe_reg_exp(EnglishChoice.TrueRegex) + self.regex_false = RegExpUtility.get_safe_reg_exp(EnglishChoice.FalseRegex) + self.token_regex = RegExpUtility.get_safe_reg_exp(EnglishChoice.TokenizerRegex, regex.S) self.only_top_match = only_top_match diff --git a/Python/libraries/recognizers-choice/recognizers_choice/choice/extractors.py b/Python/libraries/recognizers-choice/recognizers_choice/choice/extractors.py index 837900f086..04541fd06b 100644 --- a/Python/libraries/recognizers-choice/recognizers_choice/choice/extractors.py +++ b/Python/libraries/recognizers-choice/recognizers_choice/choice/extractors.py @@ -46,7 +46,7 @@ def extract(self, source: str): return results source_tokens = self.__tokenize(trimmed_source) - for (regexp, type_extracted) in self.config.regexes_map.items(): + for regexp, type_extracted in self.config.regexes_map.items(): for match in RegExpUtility.get_matches(regexp, trimmed_source): match_tokens = self.__tokenize(match) top_score = 0.0 @@ -59,7 +59,7 @@ def extract(self, source: str): value = ExtractResult() start = trimmed_source.index(match) length = len(match) - text = source[start: start + length].strip() + text = source[start : start + length].strip() value.start = start value.length = length value.text = text @@ -77,14 +77,14 @@ def extract(self, source: str): top_score = 0.0 top_result_index = 0 for i in range(len(partial_results)): - data = ChoiceExtractDataResult( - source, partial_results[i].data.score) + data = ChoiceExtractDataResult(source, partial_results[i].data.score) if data.score > top_score: top_score = data.score top_result_index = i - top_result = ChoiceExtractDataResult(partial_results[top_result_index].data.source, - partial_results[top_result_index].data.score) + top_result = ChoiceExtractDataResult( + partial_results[top_result_index].data.source, partial_results[top_result_index].data.score + ) top_result.other_matches = partial_results results.append(partial_results[top_result_index]) else: @@ -159,10 +159,7 @@ class BooleanExtractor(ChoiceExtractor): def __init__(self, config: BooleanExtractorConfiguration): regexes_map = {} - update_values = { - config.regex_true: Constants.SYS_BOOLEAN_TRUE, - config.regex_false: Constants.SYS_BOOLEAN_FALSE - } + update_values = {config.regex_true: Constants.SYS_BOOLEAN_TRUE, config.regex_false: Constants.SYS_BOOLEAN_FALSE} regexes_map.update(update_values) options_config = ChoiceExtractorConfiguration() options_config.regexes_map = regexes_map diff --git a/Python/libraries/recognizers-choice/recognizers_choice/choice/models.py b/Python/libraries/recognizers-choice/recognizers_choice/choice/models.py index 6664ab2b20..37c53c378c 100644 --- a/Python/libraries/recognizers-choice/recognizers_choice/choice/models.py +++ b/Python/libraries/recognizers-choice/recognizers_choice/choice/models.py @@ -50,14 +50,10 @@ def model_type_name(self) -> str: return 'boolean' def get_resolution(self, sources: ParseResult): - results = { - 'value': sources.value, - 'score': sources.data.score - } + results = {'value': sources.value, 'score': sources.data.score} if sources.data.other_matches: - results.other_results = [{'text': o.text, - 'value': o.value, - 'score': o.data.score} - for o in sources.data.other_matches] + results.other_results = [ + {'text': o.text, 'value': o.value, 'score': o.data.score} for o in sources.data.other_matches + ] return results diff --git a/Python/libraries/recognizers-choice/recognizers_choice/choice/parsers.py b/Python/libraries/recognizers-choice/recognizers_choice/choice/parsers.py index 7c07e81705..3649730b44 100644 --- a/Python/libraries/recognizers-choice/recognizers_choice/choice/parsers.py +++ b/Python/libraries/recognizers-choice/recognizers_choice/choice/parsers.py @@ -43,17 +43,16 @@ def parse(self, ext_result): result = ParseResult(ext_result) data = ChoiceExtractDataResult(ext_result.data) result.value = self.config.resolutions.get(result.type) - result.data = ChoiceParseDataResult( - data.score, [self.__to_other_match_result(m) for m in data.other_matches]) + result.data = ChoiceParseDataResult(data.score, [self.__to_other_match_result(m) for m in data.other_matches]) return result def __to_other_match_result(self, ext_result): parse_result = ParseResult(ext_result) ext_data = ChoiceExtractDataResult(ext_result.Data) - result = OtherMatchParseResult(ext_data.score, - parse_result.text, - self.config.resolutions.get(parse_result.type)) + result = OtherMatchParseResult( + ext_data.score, parse_result.text, self.config.resolutions.get(parse_result.type) + ) return result diff --git a/Python/libraries/recognizers-choice/recognizers_choice/choice/recognizers_choice.py b/Python/libraries/recognizers-choice/recognizers_choice/choice/recognizers_choice.py index c875dcd436..f7ae2b3224 100644 --- a/Python/libraries/recognizers-choice/recognizers_choice/choice/recognizers_choice.py +++ b/Python/libraries/recognizers-choice/recognizers_choice/choice/recognizers_choice.py @@ -15,25 +15,29 @@ class ChoiceOptions(IntFlag): NONE = 0 -def recognize_boolean(query: str, - culture: str, - options: ChoiceOptions = ChoiceOptions.NONE, - fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_boolean( + query: str, culture: str, options: ChoiceOptions = ChoiceOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = ChoiceRecognizer(culture, options) model = recognizer.get_boolean_model(culture, fallback_to_default_culture) return model.parse(query) -class ChoiceRecognizer (Recognizer[ChoiceOptions]): +class ChoiceRecognizer(Recognizer[ChoiceOptions]): - def __init__(self, target_culture: str = None, options: ChoiceOptions = ChoiceOptions.NONE, lazy_initialization: bool = False): + def __init__( + self, target_culture: str = None, options: ChoiceOptions = ChoiceOptions.NONE, lazy_initialization: bool = False + ): if options < ChoiceOptions.NONE or options > ChoiceOptions.NONE: raise ValueError() super().__init__(target_culture, options, lazy_initialization) def initialize_configuration(self): - self.register_model('BooleanModel', Culture.English, lambda options: BooleanModel( - BooleanParser(), BooleanExtractor(EnglishBooleanExtractorConfiguration()))) + self.register_model( + 'BooleanModel', + Culture.English, + lambda options: BooleanModel(BooleanParser(), BooleanExtractor(EnglishBooleanExtractorConfiguration())), + ) @staticmethod def is_valid_option(options: int) -> bool: diff --git a/Python/libraries/recognizers-choice/recognizers_choice/resources/english_choice.py b/Python/libraries/recognizers-choice/recognizers_choice/resources/english_choice.py index 72f8e10bed..7084c622c7 100644 --- a/Python/libraries/recognizers-choice/recognizers_choice/resources/english_choice.py +++ b/Python/libraries/recognizers-choice/recognizers_choice/resources/english_choice.py @@ -16,6 +16,10 @@ class EnglishChoice: LangMarker = 'Eng' TokenizerRegex = f'[^\\w\\d]' SkinToneRegex = f'(\\uD83C\\uDFFB|\\uD83C\\uDFFC|\\uD83C\\uDFFD|\\uD83C\\uDFFE|\\uD83C\\uDFFF)' - TrueRegex = f'\\b(true|yes|yep|yup|yeah|y|sure|ok|agree)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C|\\u0001f44c){SkinToneRegex}?' + TrueRegex = ( + f'\\b(true|yes|yep|yup|yeah|y|sure|ok|agree)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C|\\u0001f44c){SkinToneRegex}?' + ) FalseRegex = f'\\b(false|nope|nop|no|not\\s+ok|disagree)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90|\\u0001F44E|\\u0001F590){SkinToneRegex}?' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-choice/setup.py b/Python/libraries/recognizers-choice/setup.py index c71d1c00f4..ab700b7bb5 100644 --- a/Python/libraries/recognizers-choice/setup.py +++ b/Python/libraries/recognizers-choice/setup.py @@ -3,16 +3,16 @@ import os -from setuptools import setup, find_packages +from setuptools import find_packages, setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -NAME = 'recognizers-text-choice' -VERSION = '1.0.0.a0' -REQUIRES = ['recognizers-text', 'regex', 'grapheme'] +NAME = 'recognizers-text-choice-genesys' +VERSION = '1.1.43' +REQUIRES = ['recognizers-text-genesys', 'regex', 'grapheme'] setup( name=NAME, @@ -20,8 +20,7 @@ def read(fname): url='https://github.com/Microsoft/Recognizers-Text', author='Microsoft', description='recognizers-text-choice README', - keywords=['nlp', 'nlp-entity-extraction', - 'entity-extraction', 'parser-library'], + keywords=['nlp', 'nlp-entity-extraction', 'entity-extraction', 'parser-library'], long_description=read('README.rst'), license='MIT', packages=find_packages(), @@ -33,5 +32,5 @@ def read(fname): 'Operating System :: OS Independent', 'Development Status :: 3 - Alpha', 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] + ], ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/__init__.py new file mode 100644 index 0000000000..95dfb5625d --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/__init__.py @@ -0,0 +1,10 @@ +from .base_configs import * +from .base_date import * +from .base_dateperiod import * +from .base_datetime import * +from .base_datetimeperiod import * +from .base_duration import * +from .base_holiday import * +from .base_merged import * +from .base_time import * +from .base_timeperiod import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_configs.py new file mode 100644 index 0000000000..c740627a8c --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_configs.py @@ -0,0 +1,179 @@ +from abc import abstractmethod +from typing import Dict + +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities import DateTimeOptionsConfiguration, DateTimeUtilityConfiguration +from recognizers_number import BaseNumberExtractor, BaseNumberParser + + +class CJKCommonDateTimeParserConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def cardinal_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def integer_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def ordinal_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def number_parser(self) -> BaseNumberParser: + raise NotImplementedError + + @property + @abstractmethod + def date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def holiday_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def duration_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_period_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def time_period_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_period_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def holiday_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_alt_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def month_of_year(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def numbers(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def unit_value_map(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def season_map(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def special_year_prefixes_map(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def unit_map(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def cardinal_map(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def day_of_month(self) -> Dict[str, int]: + return NotImplementedError + + @property + @abstractmethod + def day_of_week(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def double_numbers(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def written_decades(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def special_decade_cases(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def utility_configuration(self) -> DateTimeUtilityConfiguration: + raise NotImplementedError diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_date.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_date.py new file mode 100644 index 0000000000..148524cdd7 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_date.py @@ -0,0 +1,1227 @@ +import calendar +from abc import ABC, abstractmethod +from datetime import datetime, timedelta +from typing import Dict, List, Match, Pattern + +from datedelta import datedelta +from dateutil.relativedelta import relativedelta + +from recognizers_date_time.date_time import Constants as Date_Constants +from recognizers_date_time.date_time.abstract_year_extractor import AbstractYearExtractor +from recognizers_date_time.date_time.base_date import BaseDateParser +from recognizers_date_time.date_time.CJK import CJKCommonDateTimeParserConfiguration +from recognizers_date_time.date_time.utilities import ( + DateTimeExtractor, + DateTimeFormatUtil, + DateTimeParser, + DateTimeParseResult, + DateTimeResolutionResult, + DateTimeUtilityConfiguration, + DateUtils, + DayOfWeek, + DurationParsingUtil, + ExtractResultExtension, + TimeTypeConstants, + TimexUtil, + Token, + merge_all_tokens, +) +from recognizers_number.number import CJKNumberParser +from recognizers_number.number import Constants as Num_Constants +from recognizers_text import ExtractResult, MetaData, RegExpUtility + + +class CJKDateExtractorConfiguration(ABC): + + @property + @abstractmethod + def date_regex_list(self) -> List[Pattern]: + raise NotImplementedError + + @property + @abstractmethod + def implicit_date_list(self) -> List[Pattern]: + raise NotImplementedError + + @property + @abstractmethod + def datetime_period_unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def before_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def after_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def week_day_start_end(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def range_connector_symbol_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def ambiguity_date_filters_dict(self) -> Dict[Pattern, Pattern]: + raise NotImplementedError + + @property + @abstractmethod + def number_parser(self) -> CJKNumberParser: + raise NotImplementedError + + @property + @abstractmethod + def time_clock_desc_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def time_minutes_desc_regex(self) -> Pattern: + raise NotImplementedError + + +class BaseCJKDateExtractor(DateTimeExtractor, AbstractYearExtractor): + @property + def extractor_type_name(self) -> str: + return Date_Constants.SYS_DATETIME_DATE + + def __init__(self, config: CJKDateExtractorConfiguration): + super().__init__(config) + self.config = config + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + if reference is None: + reference = datetime.now() + + tokens: List[Token] = list() + tokens.extend(self.basic_regex_match(source)) + tokens.extend(self.implicit_date(source)) + tokens.extend(self.duration_with_ago_and_later(source, reference)) + result = merge_all_tokens(tokens, source, self.extractor_type_name) + + result = ExtractResultExtension.filter_ambiguity(result, source, self.config.ambiguity_date_filters_dict) + + return result + + # Match basic patterns in DateRegexList + def basic_regex_match(self, source: str) -> List[Token]: + ret: List[Token] = list() + + for regexp in self.config.date_regex_list: + + matches = list(regexp.finditer(source)) + if matches: + for match in matches: + ret.append(Token(match.start(), source.index(match.group()) + match.end() - match.start())) + + return ret + + # Match several other implicit cases + def implicit_date(self, source: str) -> List[Token]: + ret: List[Token] = list() + + for regexp in self.config.implicit_date_list: + + for match in regexp.finditer(source): + ret.append(Token(match.start(), source.index(match.group()) + match.end() - match.start())) + + return ret + + # process case like "三天前" "两个月前" + def duration_with_ago_and_later(self, source: str, reference: datetime) -> List[Token]: + ret: List[Token] = list() + duration_extracted_results = self.config.duration_extractor.extract(source, reference) + + for extracted_result in duration_extracted_results: + + # Only handles date durations here + # Cases with dateTime durations will be handled in DateTime Extractor + if self.config.datetime_period_unit_regex.match(extracted_result.text): + continue + if self.config.time_clock_desc_regex.search( + extracted_result.text + ) or self.config.time_minutes_desc_regex.search(extracted_result.text): + continue + + pos = extracted_result.start + extracted_result.length + + if pos < len(source): + suffix = source[pos:] + match = RegExpUtility.get_matches(self.config.before_regex, suffix) + + if not match: + match = RegExpUtility.get_matches(self.config.after_regex, suffix) + + if match and suffix.startswith(match[0]): + meta_data = MetaData() + meta_data.is_duration_date_with_weekday = True + # "Extend extraction with weekdays like in "Friday two weeks from now", "in 3 weeks on Monday"" + ret.append(Token(extracted_result.start, pos + len(match[0]), meta_data)) + + ret.extend(self.extend_with_week_day(ret, source)) + + return ret + + def extend_with_week_day(self, ret: List[Token], source: str): + new_ret: List[Token] = list() + + for er in ret: + before_str = source[0 : er.start] + after_str = source[er.end :] + + before_match = self.config.week_day_start_end.match(before_str) + after_match = self.config.week_day_start_end.match(after_str) + + if before_match or after_match: + start = before_match.start() if before_match else er.start + end = er.end if before_match else er.end + after_match.start() + len(after_match.group()) + + meta_data = MetaData() + meta_data.is_duration_date_with_weekday = True + ret.append(Token(start, end, meta_data)) + + return new_ret + + +class CJKDateParserConfiguration(CJKCommonDateTimeParserConfiguration): + + @property + @abstractmethod + def cardinal_extractor(self): + raise NotImplementedError + + @property + @abstractmethod + def integer_extractor(self): + raise NotImplementedError + + @property + @abstractmethod + def ordinal_extractor(self): + raise NotImplementedError + + @property + @abstractmethod + def number_parser(self): + raise NotImplementedError + + @property + @abstractmethod + def date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def holiday_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_parser(self) -> BaseDateParser: + raise NotImplementedError + + @property + @abstractmethod + def time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def duration_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_period_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def time_period_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_period_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def holiday_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_alt_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def month_of_year(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def numbers(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def double_numbers(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def unit_value_map(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def season_map(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def special_year_prefixes_map(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def unit_map(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def cardinal_map(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def day_of_month(self) -> Dict[str, int]: + return NotImplementedError + + @property + @abstractmethod + def day_of_week(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def written_decades(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def special_decade_cases(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def special_date(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def utility_configuration(self) -> DateTimeUtilityConfiguration: + raise NotImplementedError + + @property + @abstractmethod + def date_regex_list(self): + raise NotImplementedError + + @property + @abstractmethod + def next_re(self): + raise NotImplementedError + + @property + @abstractmethod + def last_re(self): + raise NotImplementedError + + @property + @abstractmethod + def special_day_regex(self): + raise NotImplementedError + + @abstractmethod + def get_swift_day(self, day_str: str): + raise NotImplementedError + + @property + @abstractmethod + def duration_relative_duration_unit_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def special_day_with_num_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def week_day_and_day_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def next_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def this_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def last_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def week_day_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def strict_week_day_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def week_day_of_month_regex(self): + raise NotImplementedError + + @abstractmethod + def is_cardinal_last(self, source: str) -> bool: + raise NotImplementedError + + @property + @abstractmethod + def next_month_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def last_month_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def lunar_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def last_week_day_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def unit_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def before_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def after_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def dynasty_year_regex(self): + raise NotImplementedError + + @property + @abstractmethod + def dynasty_start_year(self): + raise NotImplementedError + + @property + @abstractmethod + def dynasty_year_map(self): + raise NotImplementedError + + +class BaseCJKDateParser(DateTimeParser): + + def __init__(self, config: CJKDateParserConfiguration): + self.config = config + self.month_max_days: List[int] = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] + + @property + def no_date(self): + return DateUtils.safe_create_from_value(DateUtils.min_value, 0, 0, 0) + + @property + def parser_type_name(self) -> str: + return Date_Constants.SYS_DATETIME_DATE + + def parse(self, source: ExtractResult, reference: datetime = None) -> DateTimeParseResult: + if reference is None: + reference = datetime.now() + + if source.type is self.parser_type_name: + value = self.inner_parser(source.text, reference) + + result = DateTimeParseResult() + result.text = source.text + result.start = source.start + result.length = source.length + result.type = source.type + result.data = source.data + result.value = value + result.timex_str = '' if not value else value.timex + result.resolution_str = '' + + return result + + def filter_results(self, query: str, candidate_results: List[DateTimeParseResult]): + return candidate_results + + def inner_parser(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + inner_result = self.parse_basic_regex_match(source_text, reference) + + if not inner_result.success: + inner_result = self.parse_weekday_of_month(source_text, reference) + + if not inner_result.success: + inner_result = self.parse_implicit_date(source_text, reference) + + if not inner_result.success: + inner_result = self.parser_duration_with_ago_and_later(source_text, reference) + + if inner_result.success: + inner_result.future_resolution: Dict[str, str] = dict() + inner_result.future_resolution[TimeTypeConstants.DATE] = DateTimeFormatUtil.format_date( + inner_result.future_value + ) + inner_result.past_resolution: Dict[str, str] = dict() + inner_result.past_resolution[TimeTypeConstants.DATE] = DateTimeFormatUtil.format_date( + inner_result.past_value + ) + inner_result.is_lunar = self.is_lunar_calendar(source_text) + + result_value = inner_result + + return result_value + + return None + + # parse basic patterns in DateRegexList + def parse_basic_regex_match(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + + for regexp in self.config.date_regex_list: + match = RegExpUtility.exact_match(regexp, source_text, trim=True) + + if match and match.success: + # Value string will be set in Match2Date method + ret = self.match_to_date(match, reference) + return ret + + return ret + + # match several other cases + # including '今天', '后天', '十三日' + def parse_implicit_date(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + + # handle "十二日" "明年这个月三日" "本月十一日" + match = RegExpUtility.exact_match(self.config.special_date, source_text, trim=True) + + if match and match.success: + year_str = match.get_group(Date_Constants.THIS_YEAR_GROUP_NAME) + month_str = match.get_group(Date_Constants.THIS_MONTH_GROUP_NAME) + day_str = match.get_group(Date_Constants.DAY_GROUP_NAME) + + month = reference.month + year = reference.year + day = self.config.day_of_month[day_str] + + has_year = False + has_month = False + + if month_str: + has_month = True + has_year = True + + if self.config.next_re.match(month_str): + month += 1 + if month == (Date_Constants.MAX_MONTH + 1): + month = Date_Constants.MIN_MONTH + year += 1 + elif self.config.last_re.match(month_str): + month -= 1 + if month == (Date_Constants.MIN_MONTH + 1): + month = Date_Constants.MAX_MONTH + year -= 1 + + if year_str: + has_year = True + if self.config.next_re.match(year_str): + year += 1 + elif self.config.last_re.match(year_str): + year -= 1 + + ret.timex = DateTimeFormatUtil.luis_date(year if has_year else -1, month if has_month else -1, day) + + future_date: datetime + past_date: datetime + + if day > self.get_month_max_day(year, month): + future_month = month + 1 + past_month = month - 1 + future_year = year + past_year = year + + if future_month == (Date_Constants.MAX_MONTH + 1): + future_month = Date_Constants.MIN_MONTH + future_year = year + 1 + + if past_month == (Date_Constants.MIN_MONTH - 1): + past_month = Date_Constants.MAX_MONTH + past_year = year - 1 + + is_future_valid = DateUtils.is_valid_date(future_year, future_month, day) + is_past_valid = DateUtils.is_valid_date(past_year, past_month, day) + + if is_future_valid and is_past_valid: + future_date = DateUtils.safe_create_from_value(DateUtils.min_value, future_year, future_month, day) + past_date = DateUtils.safe_create_from_value(DateUtils.min_value, past_year, past_month, day) + elif is_future_valid and not is_past_valid: + future_date = past_date = DateUtils.safe_create_from_value( + DateUtils.min_value, future_year, future_month, day + ) + elif not is_future_valid and not is_past_valid: + future_date = past_date = DateUtils.safe_create_from_value( + DateUtils.min_value, past_year, past_month, day + ) + else: + # Fall back to normal cases, might lead to resolution failure + future_date = past_date = DateUtils.safe_create_from_value(DateUtils.min_value, year, month, day) + else: + future_date = past_date = DateUtils.safe_create_from_value(DateUtils.min_value, year, month, day) + + if not has_month: + if future_date < reference: + if DateUtils.is_valid_date(year, month + 1, day): + future_date += datedelta(months=1) + if past_date >= reference: + if DateUtils.is_valid_date(year, month - 1, day): + past_date -= datedelta(months=1) + elif DateUtils.is_Feb_29th(year, month, day): + past_date -= datedelta(months=2) + elif not has_year: + if future_date < reference: + if DateUtils.is_valid_date(year + 1, month, day): + future_date += datedelta(years=1) + if past_date >= reference: + if DateUtils.is_valid_date(year - 1, month, day): + past_date -= datedelta(years=1) + + ret.future_value = future_date + ret.past_value = past_date + ret.success = True + + return ret + + # handle cases like "昨日", "明日", "大后天" + match = RegExpUtility.exact_match(self.config.special_day_regex, source_text, trim=True) + + if match and match.success: + value = reference + datedelta(days=self.config.get_swift_day(match.value)) + ret.timex = DateTimeFormatUtil.luis_date_from_datetime(value) + ret.future_value = ret.past_value = DateUtils.safe_create_from_value( + DateUtils.min_value, value.year, value.month, value.day + ) + ret.success = True + + return ret + + # Handle "今から2日曜日" (2 Sundays from now) + exact_match = RegExpUtility.exact_match(self.config.special_day_with_num_regex, source_text, trim=True) + + if exact_match and exact_match.success: + num_ers = self.config.integer_extractor.extract(source_text) + weekday_str = exact_match.get_group(Date_Constants.WEEKDAY_GROUP_NAME) + + if weekday_str and len(num_ers) > 0: + num = int(self.config.number_parser.parse(num_ers[0]).value) + value = reference + + # Check whether the determined day of this week has passed. + if value.isoweekday() > DayOfWeek(self.config.day_of_week[weekday_str]): + num -= 1 + + while num > 0: + value = DateUtils.next(value, self.get_day_of_week(weekday_str)) + num -= 1 + + ret.timex = DateTimeFormatUtil.luis_date_from_datetime(value) + ret.future_value = DateUtils.safe_create_from_min_value(value.year, value.month, value.day) + ret.past_value = ret.future_value + ret.success = True + + return ret + + # handle "明日から3週間" (3 weeks from tomorrow) + duration_extracted_results = self.config.duration_extractor.extract(source_text, reference) + unit_match = self.config.duration_relative_duration_unit_regex.match(source_text) + is_within = False + within_regex = RegExpUtility.match_end( + self.config.duration_relative_duration_unit_regex, source_text, trim=True + ) + if within_regex: + is_within = True if within_regex.get_group(Date_Constants.WITHIN_GROUP_NAME) else False + + if ( + (exact_match or is_within) + and unit_match + and len(duration_extracted_results) > 0 + and not unit_match.get_group(Date_Constants.FEW_GROUP_NAME) + ): + pr = self.config.duration_parser.parse(duration_extracted_results[0], reference) + day_str = unit_match.get_group(Date_Constants.LATER_GROUP_NAME) + future = True + swift = 0 + + if pr: + if day_str: + swift = self.config.get_swift_day(day_str) + + result_date_time = DurationParsingUtil.shift_date_time( + pr.timex_str, (reference + datedelta(days=swift)), future + ) + ret.timex = f'{DateTimeFormatUtil.luis_date_from_datetime(result_date_time)}' + ret.future_value = past_value = result_date_time + ret.success = True + return ret + + if not ret.success: + ret = self.match_weekday_and_day(source_text, reference) + + if not ret.success: + ret = self.match_this_weekday(source_text, reference) + + if not ret.success: + ret = self.match_next_weekday(source_text, reference) + + if not ret.success: + ret = self.match_last_weekday(source_text, reference) + + if not ret.success: + ret = self.match_weekday_alone(source_text, reference) + + return ret + + def match_weekday_and_day(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + result_value = DateTimeResolutionResult() + + # Handling cases like 'Monday 21', which both 'Monday' and '21' refer to the same date. + # The year of expected date can be different to the year of referenceDate. + match = self.config.week_day_and_day_regex.match(source_text) + + if match: + month = reference.month + year = reference.year + + # Create a extract result which content ordinal string of text + er = ExtractResult() + er.text = match.get_group(Date_Constants.DAY_GROUP_NAME).text + er.start = match.get_group(Date_Constants.DAY_GROUP_NAME).start + er.length = match.get_group(Date_Constants.DAY_GROUP_NAME).length + + # "Parse the day in text into number" + day = self.convert_cjk_to_num(er.text) + + # Firstly, find a latest date with the "day" as pivotDate. Secondly, if the pivotDate equals the + # referenced date, in other word, the day of the referenced date is exactly the "day". In this way, + # check if the pivotDate is the weekday. If so, then the futureDate and the previousDate are the same + # date (referenced date). Otherwise, increase the pivotDate month by month to find the latest futureDate + # and decrease the pivotDate month by month to the latest previousDate. Notice: if the "day" is larger + # than 28, some months should be ignored in the increase or decrease procedure. + + days_in_month = calendar.monthrange(year, month)[1] + if days_in_month >= day: + pivot_date = DateUtils.safe_create_from_min_value(year, month, day) + else: + # Add 1 month is enough, since 1, 3, 5, 7, 8, 10, 12 months has 31 days + pivot_date = DateUtils.safe_create_from_min_value(year, month + 1, day) + + num_week_day_int = pivot_date.isoweekday() % 7 + extracted_week_day_str = match.get_group(Date_Constants.WEEKDAY_GROUP_NAME) + week_day = self.config.day_of_week[extracted_week_day_str] + + if pivot_date != DateUtils.min_value: + + if num_week_day_int == week_day: + # The referenceDate is the weekday and with the "day". + result_value.future_value = datetime(year, month, day) + result_value.past_value = datetime(year, month, day) + result_value.timex = DateTimeFormatUtil.luis_date(year, month, day) + else: + future_date = pivot_date + past_date = pivot_date + + while future_date.isoweekday() % 7 != week_day or future_date.day != day or future_date < reference: + # Increase the futureDate month by month to find the expected date (the "day" is the weekday) + # and make sure the futureDate not less than the referenceDate. + future_date += relativedelta(months=1) + tmp_days_in_month = calendar.monthrange(future_date.year, future_date.month)[1] + if tmp_days_in_month >= day: + # For months like January 31, after add 1 month, February 31 won't be returned, + # so the day should be revised ASAP. + future_date = DateUtils.safe_create_from_value( + future_date, future_date.year, future_date.month, day + ) + + result_value.future_value = future_date + + while past_date.isoweekday() % 7 != week_day or past_date.day != day or past_date > reference: + # Decrease the pastDate month by month to find the expected date (the "day" is the weekday) and + # make sure the pastDate not larger than the referenceDate. + past_date -= relativedelta(months=1) + tmp_days_in_month = calendar.monthrange(past_date.year, past_date.month)[1] + if tmp_days_in_month >= day: + # For months like March 31, after minus 1 month, February 31 + # won't be returned, so the day should be revised ASAP. + past_date = DateUtils.safe_create_from_value( + DateUtils.min_value, past_date.year, past_date.month, day + ) + + result_value.past_value = past_date + + if week_day == 0: + week_day = 7 + + result_value.timex = TimexUtil.generate_weekday_timex(week_day) + + result_value.success = True + return result_value + + return result_value + + def match_next_weekday(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + + match = RegExpUtility.exact_match(self.config.next_regex, source_text, trim=True) + + if match and match.success: + weekday_key = match.get_group(Date_Constants.WEEKDAY_GROUP_NAME) + value = DateUtils.next(reference, self.get_day_of_week(weekday_key)) + + result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) + result.future_value = result.past_value = DateUtils.safe_create_from_min_value( + value.year, value.month, value.day + ) + result.success = True + return result + + def match_this_weekday(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + + match = RegExpUtility.exact_match(self.config.this_regex, source_text, trim=True) + + if match and match.success: + weekday_key = match.get_group(Date_Constants.WEEKDAY_GROUP_NAME) + value = DateUtils.this(reference, self.get_day_of_week(weekday_key)) + + result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) + result.future_value = result.past_value = DateUtils.safe_create_from_min_value( + value.year, value.month, value.day + ) + result.success = True + + return result + + def match_last_weekday(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + + match = RegExpUtility.exact_match(self.config.last_regex, source_text, trim=True) + + if match and match.success: + weekday_key = match.get_group(Date_Constants.WEEKDAY_GROUP_NAME) + value = DateUtils.last(reference, self.get_day_of_week(weekday_key)) + + result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) + result.future_value = result.past_value = DateUtils.safe_create_from_min_value( + value.year, value.month, value.day + ) + result.success = True + + return result + + def match_weekday_alone(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + + match = RegExpUtility.exact_match(self.config.strict_week_day_regex, source_text, trim=True) + + if match and match.success: + weekday_str = match.get_group(Date_Constants.WEEKDAY_GROUP_NAME) + weekday = self.get_day_of_week(weekday_str) + value = DateUtils.this(reference, weekday) + + if weekday < int(DayOfWeek.MONDAY): + weekday = int(DayOfWeek.SUNDAY) + + if weekday < reference.isoweekday(): + value = DateUtils.next(reference, weekday) + + result.timex = TimexUtil.generate_weekday_timex(weekday) + future_date = past_date = value + + if future_date < reference: + future_date += timedelta(weeks=1) + + if past_date >= reference: + past_date -= timedelta(weeks=1) + + result.future_value = future_date + result.past_value = past_date + result.success = True + + return result + + def parse_weekday_of_month(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + trimmed_source = source_text.strip() + + match = self.config.week_day_of_month_regex.match(trimmed_source) + + if not match: + return ret + + cardinal_str = match.group(Date_Constants.CARDINAL) + weekday_str = match.group(Date_Constants.WEEKDAY_GROUP_NAME) + month_str = match.group(Date_Constants.MONTH_GROUP_NAME) + no_year = False + + if RegExpUtility.exact_match(self.config.last_week_day_regex, cardinal_str, trim=True).success: + cardinal = 5 + else: + cardinal = self.config.cardinal_map.get(cardinal_str) + + weekday = self.config.day_of_week[weekday_str] + + if not month_str: + swift = 0 + + next_month_match = RegExpUtility.match_begin(self.config.next_month_regex, trimmed_source, trim=True) + last_month_match = RegExpUtility.match_begin(self.config.last_month_regex, trimmed_source, trim=True) + + if next_month_match and next_month_match.success: + swift = 1 + elif last_month_match and last_month_match.success: + swift = -1 + + temp = reference + datedelta(months=swift) + month = temp.month + year = temp.year + else: + month = self.config.month_of_year[month_str] + year = reference.year + no_year = True + + value = self.compute_date(cardinal, weekday, month, year) + + if value.month != month: + cardinal -= 1 + value = value - datedelta(days=7) + + future_date = value + past_date = value + + if no_year and future_date < reference: + future_date = self.compute_date(cardinal, weekday, month, year + 1) + + if future_date.month != month: + future_date = future_date - datedelta(days=7) + + if no_year and past_date >= reference: + past_date = self.compute_date(cardinal, weekday, month, year - 1) + + if past_date.month != month: + past_date = past_date - datedelta(days=7) + + # here is a very special case, timeX follows future date + ret.timex = f'XXXX-{month:02d}-WXX-{weekday}-#{cardinal}' + ret.future_value = future_date + ret.past_value = past_date + ret.success = True + + return ret + + # parse a regex match which includes 'day', 'month' and 'year' (optional) group + def match_to_date(self, match: Match, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + + month_str = RegExpUtility.get_group(match, Date_Constants.MONTH_GROUP_NAME) + day_str = RegExpUtility.get_group(match, Date_Constants.DAY_GROUP_NAME) + year_str = RegExpUtility.get_group(match, Date_Constants.YEAR_GROUP_NAME) + year_cjk_str = RegExpUtility.get_group(match, Date_Constants.YEAR_CJK_GROUP_NAME) + + month = day = 0 + + tmp = self.convert_cjk_year_to_integer(year_cjk_str) + + year = 0 if tmp == -1 else tmp + + if month_str in self.config.month_of_year and day_str in self.config.day_of_month: + month = ( + self.config.month_of_year[month_str] % 12 + if self.config.month_of_year[month_str] > 12 + else self.config.month_of_year[month_str] + ) + day = ( + self.config.day_of_month[day_str] % 31 + if self.config.day_of_month[day_str] > 31 + else self.config.day_of_month[day_str] + ) + + if year_str: + year = int(year_str) + + if 100 > year >= Date_Constants.MIN_TWO_DIGIT_YEAR_PAST_NUM: + year += Date_Constants.BASE_YEAR_PAST_CENTURY + elif 0 <= year < Date_Constants.MAX_TWO_DIGIT_YEAR_FUTURE_NUM: + year += Date_Constants.BASE_YEAR_CURRENT_CENTURY + + no_year = False + + if year == 0: + year = reference.year + ret.timex = DateTimeFormatUtil.luis_date(-1, month, day) + no_year = True + else: + ret.timex = DateTimeFormatUtil.luis_date(year, month, day) + + future_date, past_date = DateUtils.generate_dates(no_year, reference, year, month, day) + + ret.future_value = future_date + ret.past_value = past_date + ret.success = True + return ret + + def compute_date(self, cardinal: int, weekday: int, month: int, year: int) -> datetime: + first_day = DateUtils.safe_create_from_value(DateUtils.min_value, year, month, 1) + first_weekday = DateUtils.this(first_day, self.get_day_of_week(weekday)) + day_of_week_of_first_day = first_day.isoweekday() + + if weekday == 0: + weekday = int(DayOfWeek.SUNDAY) + + if day_of_week_of_first_day == 0: + day_of_week_of_first_day = 7 + + if weekday < day_of_week_of_first_day: + first_weekday = DateUtils.next(first_day, DayOfWeek(weekday)) + + first_weekday = first_weekday + datedelta(days=7 * (cardinal - 1)) + + return first_weekday + + # parse if lunar contains + def is_lunar_calendar(self, text: str) -> bool: + trimmed_source = text.strip() + is_lunar_match = self.config.lunar_regex.match(trimmed_source) + return is_lunar_match + + # Judge if a date is valid + @staticmethod + def is_valid_date(year: int, month: int, day: int) -> bool: + + if month < Date_Constants.MIN_MONTH: + year -= 1 + month = Date_Constants.MAX_MONTH + + if month > Date_Constants.MAX_MONTH: + year += 1 + month = Date_Constants.MIN_MONTH + + return DateUtils.is_valid_date(year, month, day) + + # Handle cases like "三天前" "Three days ago" + def parser_duration_with_ago_and_later(self, source_text: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + num_str = '' + unit_str = '' + + duration_extracted_results = self.config.duration_extractor.extract(source_text, reference) + + if duration_extracted_results: + match = self.config.unit_regex.match(source_text) + + if match: + suffix = source_text[ + duration_extracted_results[0].start + duration_extracted_results[0].length : + ].strip() + src_unit = match.get_group(Date_Constants.UNIT) + + number_str = source_text[ + duration_extracted_results[0].start : match.lastindex - duration_extracted_results.start + 1 + ] + unit_match = self.config.duration_relative_duration_unit_regex.match(source_text) + + few_in_unit_match = unit_match.get_group(Date_Constants.FEW_GROUP_NAME) + + # set the inexact number "数" (few) to 3 for now + number = 3 if number_str == few_in_unit_match else self.convert_cjk_to_num(num_str) + + if not number_str == few_in_unit_match: + if suffix == unit_match.value: + pr = self.config.duration_parser.parse(duration_extracted_results[0], reference) + is_future = suffix == unit_match.get_group(Date_Constants.LATER_GROUP_NAME) + swift = 0 + + if pr: + result_date_time = DurationParsingUtil.shift_date_time( + pr.timex_str, (reference + datedelta(days=swift)), is_future + ) + ret.timex = DateTimeFormatUtil.luis_date_from_datetime(result_date_time) + ret.future_value = past_value = result_date_time + ret.success = True + return ret + + if src_unit in self.config.unit_map: + unit_str = self.config.unit_map[src_unit] + unit_type = 'T' if self.config.duration_parser.is_less_than_day(unit_str) else '' + ret.timex = f'P{unit_type}{number_str}{unit_str[0]}' + + date = Date_Constants.INVALID_DATE_STRING + + before_match = self.config.before_regex.match(suffix) + + if before_match and suffix.startswith(before_match): + date = DurationParsingUtil.shift_date_time(ret.timex, reference, False) + + after_match = self.config.after_regex.match(suffix) + if after_match and suffix.startswith(after_match[0]): + date = DurationParsingUtil.shift_date_time(ret.timex, reference, True) + + if date != Date_Constants.INVALID_DATE_STRING: + ret.timex = DateTimeFormatUtil.luis_date_from_datetime(date) + ret.future_value = ret.past_value = date + ret.success = True + return ret + + return ret + + # Convert CJK Number to Integer + def convert_cjk_to_num(self, num_string: str) -> int: + num = -1 + er = self.config.integer_extractor.extract(num_string) + + if er: + if er[0].type == Num_Constants.SYS_NUM_INTEGER: + num = int(self.config.number_parser.parse(er[0]).value) + + return num + + # convert CJK Year to Integer + def convert_cjk_year_to_integer(self, year_cjk_string: str) -> int: + year = num = 0 + + dynasty_year = DateTimeFormatUtil.parse_dynasty_year( + year_cjk_string, + self.config.dynasty_year_regex, + self.config.dynasty_start_year, + self.config.dynasty_year_map, + self.config.integer_extractor, + self.config.number_parser, + ) + if dynasty_year and dynasty_year > 0: + return dynasty_year + + er = self.config.integer_extractor.extract(year_cjk_string) + + if er: + if er[0].type == Num_Constants.SYS_NUM_INTEGER: + num = self.config.number_parser.parse(er[0]).value + + if num < 10: + num = 0 + for year in year_cjk_string: + num *= 10 + + er = self.config.integer_extractor.extract(str(year)) + + if er: + if er[0].type == Num_Constants.SYS_NUM_INTEGER: + num += self.config.number_parser.parse(er[0]) + + year = -1 if num < 10 else num + + return year + + def get_month_max_day(self, year, month) -> int: + max_day = self.month_max_days[month - 1] + + if not DateUtils.is_leap_year(year) and month == 2: + max_day -= 1 + return max_day + + def get_day_of_week(self, weekday_key: any) -> DayOfWeek: + if type(weekday_key) == str: + return ( + DayOfWeek.SUNDAY + if self.config.day_of_week[weekday_key] == 0 + else DayOfWeek(self.config.day_of_week[weekday_key]) + ) + elif type(weekday_key) == int: + return DayOfWeek.SUNDAY if weekday_key == 0 else DayOfWeek(weekday_key) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_dateperiod.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_dateperiod.py new file mode 100644 index 0000000000..3b857e1f30 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_dateperiod.py @@ -0,0 +1,3157 @@ +from abc import abstractmethod +from datetime import datetime, timedelta +from re import Pattern +from typing import Dict, List, Match + +from datedelta import datedelta +from regex import regex + +from recognizers_date_time.date_time import Constants +from recognizers_date_time.date_time.base_date import BaseDateParser +from recognizers_date_time.date_time.base_dateperiod import BaseDatePeriodParser +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateContext, + DateTimeExtractor, + DateTimeFormatUtil, + DateTimeOptions, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DateUtils, + DayOfWeek, + DurationParsingUtil, + ExtractResultExtension, + TimeTypeConstants, + TimexUtil, + Token, + merge_all_tokens, +) +from recognizers_date_time.date_time.utilities.mod_and_date_result import ModAndDateResult +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_number import Constants as Num_Constants +from recognizers_text import ConditionalMatch, Extractor, ExtractResult, Metadata, RegExpUtility + + +class CJKDatePeriodExtractorConfiguration(DateTimeOptionsConfiguration): + + @property + @abstractmethod + def simple_cases_regexes(self) -> List[Pattern]: + raise NotImplementedError + + @property + @abstractmethod + def till_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def date_unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def range_prefix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def range_suffix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def future_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def past_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def first_last_of_year_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def number_combined_with_unit(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def followed_unit(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def date_point_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def integer_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: + raise NotImplementedError + + +class BaseCJKDatePeriodExtractor(DateTimeExtractor): + + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_DATEPERIOD + + def __init__(self, config: CJKDatePeriodExtractorConfiguration): + self.config = config + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + if not reference: + reference = datetime.now() + tokens = [] + + tokens += self.match_simple_cases(source) + simple_cases_results = merge_all_tokens(tokens, source, self.extractor_type_name) + tokens += self.match_complex_cases(source, simple_cases_results, reference) + tokens += self.merge_two_time_points(source, reference) + tokens += self.match_number_with_unit(source) + tokens += self.match_duration(source, reference) + + rets = merge_all_tokens(tokens, source, self.extractor_type_name) + + # Remove common ambiguous cases + rets = ExtractResultExtension.filter_ambiguity(rets, source, self.config.ambiguity_filters_dict) + + return rets + + def match_simple_cases(self, source: str) -> List[Token]: + ret = [] + + for regexp in self.config.simple_cases_regexes: + matches = list(regex.finditer(regexp, source)) + for match in matches: + ret.append(Token(match.start(), match.end())) + + return ret + + def match_duration(self, source: str, reference: datetime) -> List[Token]: + ret: List[Token] = list() + durations = [] + duration_extractions = self.config.duration_extractor.extract(source, reference) + + for duration_extraction in duration_extractions: + date_unit_match = self.config.date_unit_regex.match(duration_extraction.text) + + if not date_unit_match: + continue + + durations.append(Token(duration_extraction.start, duration_extraction.start + duration_extraction.length)) + + for duration in durations: + before_str = source[0 : duration.start].lower() + after_str = source[duration.start : duration.start + duration.length] + + if not before_str and not after_str: + continue + + # handle cases with 'within' and 'next' + match_within = RegExpUtility.match_begin(self.config.future_regex, after_str, trim=True) + match_next = RegExpUtility.match_end(self.config.future_regex, after_str, trim=True) + + if match_within and match_next and not match_next.group() == Constants.WITHIN_GROUP_NAME: + if match_next.value == match_within.value: + ret.append(Token(duration.start - match_next.length, duration.end)) + else: + ret.append(Token(duration.start - match_next.length, duration.end + match_within.length)) + elif match_within: + ret.append(Token(duration.start, duration.end + match_within.length)) + elif match_next: + ret.append(Token(duration.start - match_next.length, duration.end)) + + return ret + + # merge two time points + def merge_two_time_points(self, source: str, reference: datetime) -> List[Token]: + ret: List[Token] = list() + er = self.config.date_point_extractor.extract(source, reference) + + if not er: + return ret + + # merge '{TimePoint} 到 {TimePoint}' + idx = 0 + + while idx < len(er) - 1: + middle_begin = er[idx].start + er[idx].length + middle_end = er[idx + 1].start + + if middle_begin >= middle_end: + idx += 1 + continue + + middle_str = source[middle_begin : middle_end - middle_begin].strip() + + if RegExpUtility.exact_match(self.config.till_regex, middle_str, trim=True).success: + period_begin = er[idx].start + period_end = er[idx + 1].start + er[idx].length + + # handle suffix + after_str = source[period_end:] + match = RegExpUtility.match_begin(self.config.range_suffix_regex, after_str, trim=True) + + if match and match.success: + period_end = period_end + match.index + match.length + + # handle prefix + before_str = source[:period_begin] + match = RegExpUtility.match_end(self.config.range_prefix_regex, before_str, trim=True) + + if match and match.success: + period_begin = match.index + + ret.append(Token(period_begin, period_end)) + idx += 2 + continue + idx += 1 + + return ret + + # extract case like "前两年" "前三个月" + def match_number_with_unit(self, source: str) -> List[Token]: + ret: List[Token] = list() + durations: List[Token] = list() + + ers = self.config.integer_extractor.extract(source) + + for er in ers: + after_str = source[er.start + er.length :] + match = RegExpUtility.match_begin(self.config.followed_unit, after_str, trim=True) + + if match and match.success: + durations.append(Token(er.start, er.start + er.length + match.length)) + + if self.config.number_combined_with_unit.match(source): + + for match in self.config.number_combined_with_unit.finditer(source): + durations.append(Token(match.start(), match.end())) + + for duration in durations: + before_str = source[: duration.start] + + if not before_str: + continue + + # Cases like 'first 2 weeks of 2018' (2021年的前2周) + match = RegExpUtility.match_end(self.config.first_last_of_year_regex, before_str, trim=True) + + if match and match.success: + # Check if the unit is compatible (day, week, month) + duration_str = source[duration.start : duration.length] + unit_match = self.config.unit_regex.match(duration_str) + + if unit_match.group(Constants.UNIT_OF_YEAR_GROUP_NAME): + ret.append(Token(match.start, duration.end)) + continue + + match = RegExpUtility.match_end(self.config.past_regex, before_str, trim=True) + + if match and match.success: + ret.append(Token(match.index, duration.end)) + continue + + match = RegExpUtility.match_end(self.config.future_regex, before_str, trim=True) + + if match and match.success: + ret.append(Token(match.index, duration.end)) + + return ret + + # Complex cases refer to the combination of daterange and datepoint + # For Example: from|between {DateRange|DatePoint} to|till|and {DateRange|DatePoint} + def match_complex_cases( + self, source: str, simple_cases_results: List[ExtractResult], reference: datetime + ) -> List[Token]: + er = self.config.date_point_extractor.extract(source, reference) + + # Filter out DateRange results that are part of DatePoint results + # For example, "Feb 1st 2018" => "Feb" and "2018" should be filtered out here + + er.extend( + list( + filter( + lambda simple_date_range: not any( + list( + filter( + lambda date_point: date_point.start <= simple_date_range.start + and date_point.start + date_point.length + >= simple_date_range.start + simple_date_range.length, + er, + ) + ) + ), + simple_cases_results, + ) + ) + ) + + er = list(sorted(er, key=lambda x: x.start)) + + return self.merge_multiple_extractions(source, er) + + def merge_multiple_extractions(self, source: str, extraction_results: List[ExtractResult]) -> List[Token]: + ret: List[Token] = list() + + metadata = Metadata() + metadata.possibly_included_period_end = True + + if len(extraction_results) <= 1: + return ret + + idx = 0 + + while idx < len(extraction_results) - 1: + middle_begin = extraction_results[idx].start + extraction_results[idx].length + middle_end = extraction_results[idx + 1].start + + if middle_begin >= middle_end: + idx += 1 + continue + + middle_str = source[middle_begin : middle_end - middle_begin].strip().lower() + end_point_str = extraction_results[idx + 1].text + start_point_str = extraction_results[idx].text + + if RegExpUtility.exact_match(self.config.till_regex, middle_str, trim=True) or ( + not middle_str + and ( + RegExpUtility.match_begin(self.config.till_regex, end_point_str, trim=True) + or RegExpUtility.match_end(self.config.till_regex, start_point_str, trim=True) + ) + ): + + period_begin = extraction_results[idx].start + period_end = extraction_results[idx + 1].start + extraction_results[idx + 1].length + + # handle "from/between" together with till words (till/until/through...) + before_str = source[:period_begin] + + before_match = RegExpUtility.match_end(self.config.range_prefix_regex, before_str, trim=True) + + if before_match: + period_begin = before_match.index + else: + after_str = source[period_end:] + + after_match = RegExpUtility.match_begin(self.config.range_suffix_regex, after_str, trim=True) + + if after_match: + period_end += after_match.index + after_match.length + + ret.append(Token(period_begin, period_begin, metadata)) + + idx += 2 + continue + idx += 1 + + return ret + + +class CJKDatePeriodParserConfiguration(DateTimeOptionsConfiguration): + + @property + @abstractmethod + def integer_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def number_parser(self) -> BaseNumberParser: + raise NotImplementedError + + @property + @abstractmethod + def date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def cardinal_extractor(self) -> Extractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_parser(self) -> BaseDateParser: + raise NotImplementedError + + @property + @abstractmethod + def dynasty_year_map(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def unit_map(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def cardinal_map(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def day_of_month(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def month_of_year(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def season_map(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def dynasty_start_year(self) -> str: + raise NotImplementedError + + @property + @abstractmethod + def token_before_date(self) -> str: + raise NotImplementedError + + @property + @abstractmethod + def two_num_year(self) -> int: + raise NotImplementedError + + @property + @abstractmethod + def simple_cases_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def dynasty_year_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def year_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def relative_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def relative_month_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def duration_relative_duration_unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def this_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def last_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def next_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def year_to_year(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def year_to_year_suffix_required(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def year_in_cjk_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def month_to_month(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def month_to_month_suffix_required(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def month_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def year_and_month(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def pure_num_year_and_month(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def one_word_period_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def number_combined_with_unit(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def past_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def future_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def week_with_week_day_range_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def duration_unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def week_of_month_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def week_of_year_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def week_of_date_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def month_of_date_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def which_week_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def first_last_of_year_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def season_with_year(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def quarter_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def decade_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def century_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def day_to_day(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def month_day_range(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def day_regex_for_period(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def simple_year_and_month(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def special_month_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def special_year_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def later_early_period_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def date_point_with_ago_and_later(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def reference_date_period_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def wom_last_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def wom_previous_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def wom_next_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def complex_date_period_regex(self) -> Pattern: + raise NotImplementedError + + @abstractmethod + def to_month_number(self, month_str: str) -> int: + raise NotImplementedError + + @abstractmethod + def is_month_only(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_weekend(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_week_only(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_year_only(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_this_year(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_year_to_date(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_last_year(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_next_year(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_year_after_next(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def is_year_before_last(self, source: str) -> bool: + raise NotImplementedError + + @abstractmethod + def get_swift_month(self, source: str): + raise NotImplementedError + + @abstractmethod + def get_swift_year(self, source: str): + raise NotImplementedError + + +class BaseCJKDatePeriodParser(DateTimeParser): + + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_DATEPERIOD + + def __init__(self, config: CJKDatePeriodParserConfiguration, inclusive_end_period: bool = False): + self.config = config + self._inclusive_end_period = inclusive_end_period + + def get_year_context(self, start_date_str: str, end_date_str: str, source: str) -> DateContext: + is_end_date_pure_year = False + context_year = Constants.INVALID_YEAR + + year_match_for_end_date = self.config.year_regex.match(end_date_str) + + if year_match_for_end_date and (year_match_for_end_date.end() - year_match_for_end_date.start()) == len( + end_date_str + ): + is_end_date_pure_year = True + + relative_match_for_start_date = self.config.relative_regex.match(start_date_str) + relative_match_for_end_date = self.config.relative_regex.match(end_date_str) + is_date_relative = relative_match_for_start_date or relative_match_for_end_date + + if not is_end_date_pure_year and not is_date_relative: + + for match in self.config.year_regex.finditer(source): + year = self.get_year_from_text(match) + if year != Constants.INVALID_YEAR: + context_year = year + else: + # this indicates that the text has two different year value, no common context year + if context_year != year: + context_year = Constants.INVALID_YEAR + break + + result: DateContext = DateContext() + result.year = context_year + + return result + + def parse(self, er: ExtractResult, reference: datetime) -> DateTimeParseResult: + if not reference: + reference = datetime.now() + result_value = None + + if er.type == self.parser_type_name: + source_text = er.text.strip().lower() + inner_result = self.parse_base_date_period(source_text, reference) + + if not inner_result.success: + inner_result = self.parse_complex_date_period(source_text, reference) + + if inner_result.success: + + if inner_result.mod == Constants.BEFORE_MOD: + inner_result.future_resolution = { + TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date(inner_result.future_value[0]) + } + inner_result.past_resolution = { + TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date(inner_result.past_value[0]) + } + + elif inner_result.mod == Constants.AFTER_MOD: + inner_result.future_resolution = { + TimeTypeConstants.START_DATE: DateTimeFormatUtil.format_date(inner_result.future_value[0]) + } + inner_result.past_resolution = { + TimeTypeConstants.START_DATE: DateTimeFormatUtil.format_date(inner_result.past_value[0]) + } + + elif inner_result.future_value and inner_result.past_value: + inner_result.future_resolution = { + TimeTypeConstants.START_DATE: DateTimeFormatUtil.format_date(inner_result.future_value[0]), + TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date(inner_result.future_value[1]), + } + inner_result.past_resolution = { + TimeTypeConstants.START_DATE: DateTimeFormatUtil.format_date(inner_result.past_value[0]), + TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date(inner_result.past_value[1]), + } + + else: + inner_result.future_resolution = inner_result.past_resolution = {} + + result_value = inner_result + + ret = DateTimeParseResult(er) + ret.text = er.text + ret.start = er.start + ret.length = er.length + ret.type = er.type + ret.meta_data = er.meta_data + ret.value = result_value + ret.timex_str = result_value.timex if result_value else '' + ret.resolution_str = '' + + return ret + + def parse_base_date_period( + self, source: str, reference: datetime, date_context: DateContext = None + ) -> DateTimeResolutionResult: + + inner_result = self.parse_simple_cases(source, reference) + + if not inner_result.success: + inner_result = self.parse_duration(source, reference) + if not inner_result.success: + inner_result = self.parse_one_word_period(source, reference) + if not inner_result.success: + inner_result = self.parse_number_with_unit(source, reference) + if not inner_result.success: + inner_result = self.parse_day_to_day(source, reference) + if not inner_result.success: + inner_result = self.merge_two_time_points(source, reference) + if not inner_result.success: + inner_result = self.parse_year_and_month(source, reference) + if not inner_result.success: + inner_result = self.parse_year_to_year(source, reference) + if not inner_result.success: + inner_result = self.parse_month_to_month(source, reference) + if not inner_result.success: + inner_result = self.parse_year(source, reference) + if not inner_result.success: + inner_result = self.parse_week_of_month(source, reference) + if not inner_result.success: + inner_result = self.parse_week_of_year(source, reference) + if not inner_result.success: + inner_result = self.parse_week_of_date(source, reference) + if not inner_result.success: + inner_result = self.parse_month_of_date(source, reference) + if not inner_result.success: + inner_result = self.parse_which_week(source, reference) + if not inner_result.success: + inner_result = self.parse_season(source, reference) + if not inner_result.success: + inner_result = self.parse_quarter(source, reference) + if not inner_result.success: + inner_result = self.parse_decade(source, reference) + if not inner_result.success: + inner_result = self.parse_century(source, reference) + # if not inner_result.success: + # inner_result = self.parse_date_point_with_ago_and_later(source, reference) + if not inner_result.success and date_context: + inner_result = date_context.process_date_period_entity_resolution(inner_result) + + return inner_result + + def get_year_from_text(self, match: Match) -> int: + year = Constants.INVALID_YEAR + + year_str = match.group(Constants.YEAR_GROUP_NAME) + written_year_str = match.groupdict().get(Constants.FULL_YEAR_GROUP_NAME) + + if year_str and year_str != written_year_str: + year = self.convert_cjk_to_integer(year_str) + + if 100 > year >= Constants.MIN_TWO_DIGIT_YEAR_PAST_NUM: + year += Constants.BASE_YEAR_PAST_CENTURY + elif 0 <= year < Constants.MAX_TWO_DIGIT_YEAR_FUTURE_NUM: + year += Constants.BASE_YEAR_CURRENT_CENTURY + else: + first_two_year_num_str = match.group(Constants.FIRST_TWO_YEAR_NUM) + + if first_two_year_num_str: + er = ExtractResult() + er.text = first_two_year_num_str + er.start = match.get_group(Constants.FIRST_TWO_YEAR_NUM).start + er.length = match.get_group(Constants.FIRST_TWO_YEAR_NUM).length + + first_two_year_num = int(self.config.number_parser.parse(er).value) + + last_two_year_num = 0 + last_two_year_num_str = match.get_group(Constants.LAST_TWO_YEAR_NUM) + + if last_two_year_num_str: + er.text = last_two_year_num_str + er.start = match.group(Constants.LAST_TWO_YEAR_NUM).start + er.length = match.group(Constants.LAST_TWO_YEAR_NUM).length + + last_two_year_num = self.config.number_parser.parse(er) + + # Exclude pure number like "nineteen", "twenty four" + if (first_two_year_num < 100 and last_two_year_num == 0) or ( + first_two_year_num < 100 + and first_two_year_num % 10 == 0 + and len(last_two_year_num_str.strip().split(' ')) == 1 + ): + year = Constants.INVALID_YEAR + return year + if first_two_year_num >= 100: + year = first_two_year_num + last_two_year_num + else: + year = (first_two_year_num * 100) + last_two_year_num + else: + if written_year_str: + er = ExtractResult + er.text = written_year_str + er.start = match.group(Constants.FULL_YEAR_GROUP_NAME).start + er.length = match.group(Constants.FULL_YEAR_GROUP_NAME).length + + year = int(self.config.number_parser.parse(er).value) + + if 100 > year >= Constants.MIN_TWO_DIGIT_YEAR_PAST_NUM: + year += Constants.BASE_YEAR_PAST_CENTURY + elif 0 <= year < Constants.MAX_TWO_DIGIT_YEAR_FUTURE_NUM: + year += Constants.BASE_YEAR_CURRENT_CENTURY + + return year + + def shift_resolution(self, date: [datetime, datetime], match: Match, start: bool) -> datetime: + result = date[0] + return result + + def convert_cjk_to_num(self, num_str: str) -> int: + num = -1 + er = self.config.integer_extractor.extract(num_str) + + if er and er[0].type == Num_Constants.SYS_NUM_INTEGER: + num = int(self.config.number_parser.parse(er[0]).value) + + return num + + # Convert CJK Year to Integer + def convert_cjk_to_integer(self, year_cjk_str: str) -> int: + num = 0 + + dynasty_year = DateTimeFormatUtil.parse_dynasty_year( + year_cjk_str, + self.config.dynasty_year_regex, + self.config.dynasty_start_year, + self.config.dynasty_year_map, + self.config.integer_extractor, + self.config.number_parser, + ) + + if dynasty_year and dynasty_year > 0: + return dynasty_year + + er = self.config.integer_extractor.extract(year_cjk_str) + + if er and er[0].type == Num_Constants.SYS_NUM_INTEGER: + num = int(self.config.number_parser.parse(er[0]).value) + + if num < 10: + num = 0 + + for ch in year_cjk_str: + + num *= 10 + er = next(iter(self.config.integer_extractor.extract(ch)), None) + if er and er.type == Num_Constants.SYS_NUM_INTEGER: + num += int(self.config.number_parser.parse(er).value) + year = num + else: + year = num + + return -1 if year == 0 else year + + def parse_single_time_point( + self, source: str, reference: datetime, date_context: DateContext = None + ) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + er = self.config.date_extractor.extract(source, reference)[0] + + if er: + pr = self.config.date_parser.parse(er, reference) + + if pr: + ret.timex = f'({pr.timex_str})' + ret.future_value = pr.value.future_value + ret.past_value = pr.value.past_value + ret.success = True + + return ret + + def parse_simple_cases(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + year = reference.year + month = reference.month + + no_year = False + input_year = False + + match = self.config.simple_cases_regex.search(source) + + if not match: + match = self.config.month_day_range.search(source) + + if match: + days = match.captures(Constants.DAY_GROUP_NAME) + begin_day = self.config.day_of_month[days[0]] + end_day = self.config.day_of_month[days[1]] + + month_str = match.group(Constants.MONTH_GROUP_NAME) + year_str = match.group(Constants.YEAR_GROUP_NAME) + + if year_str: + year = self.parse_num_year(year_str) + + input_year = True + else: + no_year = True + + if month_str: + month = self.config.to_month_number(month_str) + else: + month_str = match.group(Constants.REL_MONTH) + this_match = self.config.this_regex.match(month_str) + next_match = self.config.next_regex.match(month_str) + + if this_match: + pass + elif next_match: + if month != 12: + month += 1 + else: + month = 1 + year += 1 + else: + if month != 1: + month -= 1 + else: + month = 12 + year -= 1 + + begin_luis_str = DateTimeFormatUtil.luis_date( + ( + year + if input_year or self.config.this_regex.match(month_str) or self.config.next_regex.match(month_str) + else -1 + ), + month, + begin_day, + ) + end_luis_str = DateTimeFormatUtil.luis_date( + ( + year + if input_year or self.config.this_regex.match(month_str) or self.config.next_regex.match(month_str) + else -1 + ), + month, + end_day, + ) + + else: + match = RegExpUtility.exact_match(self.config.special_year_regex, source, trim=True) + + if match and match.success: + value = reference + datedelta(years=self.config.get_swift_year(match)) + ret.timex = DateTimeFormatUtil.luis_date_from_datetime(value) + ret.future_value = ret.past_value = value + ret.success = True + + return ret + + return ret + + future_begin_dates, past_begin_dates = DateUtils.generate_dates(no_year, reference, year, month, begin_day) + future_end_dates, past_end_dates = DateUtils.generate_dates(no_year, reference, year, month, end_day) + + ret.timex = f'({begin_luis_str},{end_luis_str},P{end_day - begin_day}D)' + ret.future_value = [future_begin_dates, future_end_dates] + ret.past_value = [past_begin_dates, past_end_dates] + ret.success = True + + return ret + + def parse_year_to_year(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = self.config.year_to_year.match(source) + + if not match: + match = self.config.year_to_year_suffix_required.match(source) + + if match: + year_match = list(self.config.year_regex.finditer(source)) + year_in_cjk_match = list(self.config.year_in_cjk_regex.finditer(source)) + + begin_year = 0 + end_year = 0 + + if len(year_match) == 2: + begin_year = self.convert_cjk_to_integer(year_match[0].group(Constants.YEAR_GROUP_NAME)) + end_year = self.convert_cjk_to_integer(year_match[1].group(Constants.YEAR_GROUP_NAME)) + + elif len(year_in_cjk_match) == 2: + begin_year = self.convert_cjk_to_integer(year_in_cjk_match[0].group(Constants.YEAR_CJK_GROUP_NAME)) + end_year = self.convert_cjk_to_integer(year_in_cjk_match[1].group(Constants.YEAR_CJK_GROUP_NAME)) + + elif len(year_in_cjk_match) == 1 and len(year_match) == 1: + + if year_match[0].start < year_in_cjk_match[0].start: + begin_year = int(year_match[0].get_group(Constants.YEAR_GROUP_NAME)) + end_year = self.convert_cjk_to_integer( + year_in_cjk_match[0].get_group(Constants.YEAR_CJK_GROUP_NAME) + ) + + else: + begin_year = self.convert_cjk_to_integer( + year_in_cjk_match[0].get_group(Constants.YEAR_CJK_GROUP_NAME) + ) + end_year = int(year_match[0].get_group(Constants.YEAR_GROUP_NAME)) + + if 100 > begin_year >= self.config.two_num_year: + begin_year += Constants.BASE_YEAR_PAST_CENTURY + elif begin_year < 100 and begin_year < self.config.two_num_year: + begin_year += Constants.BASE_YEAR_CURRENT_CENTURY + + if 100 > end_year >= self.config.two_num_year: + end_year += Constants.BASE_YEAR_PAST_CENTURY + elif end_year < 100 and end_year < self.config.two_num_year: + end_year += Constants.BASE_YEAR_CURRENT_CENTURY + + begin_day = DateUtils.safe_create_from_min_value(begin_year, 1, 1) + end_day = DateUtils.safe_create_from_min_value(end_year, 1, 1) + ret.timex = TimexUtil.generate_date_period_timex(begin_day, end_day, timex_type=3) + ret.future_value = ret.past_value = [begin_day, end_day] + ret.success = True + + return ret + + return ret + + # handle like "3月到5月", "3月和5月之间" + def parse_month_to_month(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = self.config.month_to_month.match(source) + + if not match: + match = self.config.month_to_month_suffix_required.match(source) + + if match: + month_match = RegExpUtility.get_matches(self.config.month_regex, source) + + begin_month = 0 + end_month = 0 + + if len(month_match) == 2: + begin_month = self.config.to_month_number(month_match[0].get_group(Constants.MONTH_GROUP_NAME)) + end_month = self.config.to_month_number(month_match[1].get_group(Constants.MONTH_GROUP_NAME)) + + elif match.group(Constants.MONTH_FROM_GROUP_NAME) and match.group(Constants.MONTH_TO_GROUP_NAME): + begin_month = self.config.to_month_number(match.group(Constants.MONTH_FROM_GROUP_NAME)) + end_month = self.config.to_month_number(match.group(Constants.MONTH_TO_GROUP_NAME)) + + year_match = RegExpUtility.get_matches(self.config.year_regex, source) + has_year = False + + if len(year_match) > 0 and match.get_group(Constants.YEAR_GROUP_NAME): + has_year = True + + if len(year_match) == 2: + begin_year = self.parse_num_year(year_match[0].get_group(Constants.YEAR_GROUP_NAME)) + end_year = self.parse_num_year(year_match[1].get_group(Constants.YEAR_GROUP_NAME)) + + else: + begin_year = end_year = self.parse_num_year(year_match[0].get_group(Constants.YEAR_GROUP_NAME)) + + else: + begin_year = end_year = reference.year + + curr_year = reference.year + curr_month = reference.month + begin_year_for_past_resolution = begin_year + end_year_for_past_resolution = end_year + begin_year_for_future_resolution = begin_year + end_year_for_future_resolution = end_year + duration_months = 0 + + if has_year: + diff_months = end_month - begin_month + diff_year = end_year - begin_year + + duration_months = (diff_year * 12) + diff_months + + else: + if begin_month < end_month: + + # For this case, FutureValue and PastValue share the same resolution + if begin_month < curr_month <= end_month: + # Keep the beginYear and endYear equal to currentYear + pass + + elif begin_month >= curr_month: + begin_year_for_past_resolution = end_year_for_past_resolution = curr_year - 1 + + elif end_month < curr_month: + begin_year_for_future_resolution = end_year_for_future_resolution = curr_year + 1 + + duration_months = end_month - begin_month + + elif begin_month > end_month: + + # For this case, FutureValue and PastValue share the same resolution + if begin_month < curr_month: + end_year_for_past_resolution = end_year_for_future_resolution = curr_year + 1 + else: + begin_year_for_past_resolution = curr_year - 1 + end_year_for_future_resolution = curr_year + 1 + + duration_months = begin_month - end_month + + if duration_months != 0: + begin_date_for_past_resolution = DateUtils.safe_create_from_min_value( + begin_year_for_past_resolution, begin_month, 1 + ) + end_date_for_past_resolution = DateUtils.safe_create_from_min_value( + end_year_for_past_resolution, end_month, 1 + ) + begin_date_for_future_resolution = DateUtils.safe_create_from_min_value( + begin_year_for_future_resolution, begin_month, 1 + ) + end_date_for_future_resolution = DateUtils.safe_create_from_min_value( + end_year_for_future_resolution, end_month, 1 + ) + + day_match = RegExpUtility.get_matches(self.config.day_regex_for_period, source) + + # handle cases like 2019年2月1日から3月まで + if day_match and match.get_group(Constants.DAY_GROUP_NAME): + ret.timex = TimexUtil.generate_date_period_timex( + begin_date_for_future_resolution, + end_date_for_future_resolution, + 0, + begin_date_for_past_resolution, + end_date_for_past_resolution, + has_year, + ) + + # If the year is not specified, the combined range timex will use fuzzy years. + else: + ret.timex = TimexUtil.generate_date_period_timex( + begin_date_for_future_resolution, + end_date_for_future_resolution, + 2, + begin_date_for_past_resolution, + end_date_for_past_resolution, + has_year, + ) + + ret.past_value = [begin_date_for_past_resolution, end_date_for_past_resolution] + ret.future_value = [begin_date_for_future_resolution, end_date_for_future_resolution] + ret.success = True + + return ret + + def parse_num_year(self, year_num: str) -> int: + year = self.convert_cjk_to_integer(year_num) + + if 100 > year >= self.config.two_num_year: + year += Constants.BASE_YEAR_PAST_CENTURY + elif year < 100 and year < self.config.two_num_year: + year += Constants.BASE_YEAR_CURRENT_CENTURY + + return year + + def parse_day_to_day(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = self.config.day_to_day.match(source) + + if match: + day_match_match = list(regex.finditer(self.config.day_regex_for_period, source)) + + begin_day = end_day = 0 + + if len(day_match_match) == 2: + day_from = RegExpUtility.get_group(day_match_match[0], Constants.DAY_GROUP_NAME) + day_to = RegExpUtility.get_group(day_match_match[1], Constants.DAY_GROUP_NAME) + + begin_day = self.config.day_of_month[day_from] + end_day = self.config.day_of_month[day_to] + + elif match.group(Constants.HALF_GROUP_NAME): + er = self.config.duration_extractor.extract(match.group(Constants.HALF_GROUP_NAME), reference) + pr = self.config.duration_parser.parse(er[0], reference) + + num = TimexUtil.parse_number_from_duration_timex(pr.timex_str) + + begin_day_2 = reference + end_day_2 = reference + datedelta(days=num) + + ret.timex = TimexUtil.generate_date_period_timex(begin_day_2, end_day_2, timex_type=0) + ret.past_value = ret.future_value = [begin_day_2, end_day_2] + ret.success = True + return ret + + begin_year_for_past_resolution = reference.year + end_year_for_past_resolution = reference.year + begin_year_for_future_resolution = reference.year + end_year_for_future_resolution = reference.year + + curr_day = reference.day + duration_months = duration_days = 0 + + relative_month = self.config.relative_month_regex.match(source) + curr_month = ( + reference + datedelta(months=self.config.get_swift_month(relative_month.value)) + if relative_month + else reference.month + ) + + begin_month_for_past_resolution = curr_month + end_month_for_past_resolution = curr_month + begin_month_for_future_resolution = curr_month + end_month_for_future_resolution = curr_month + + if begin_day < end_day: + + # For this case, FutureValue and PastValue share the same resolution + if begin_day < curr_day <= end_day: + # Keep the beginMonth and endMonth equal to currentMonth + pass + + elif begin_day >= curr_day: + if curr_month == 1: + begin_month_for_past_resolution = end_month_for_past_resolution = Constants.MAX_MONTH + begin_year_for_past_resolution -= 1 + end_year_for_past_resolution -= 1 + else: + begin_month_for_past_resolution = end_month_for_past_resolution = curr_month - 1 + + elif end_day < curr_day: + if curr_month == Constants.MAX_MONTH: + begin_month_for_future_resolution = end_month_for_future_resolution = 1 + begin_year_for_future_resolution += 1 + end_year_for_future_resolution += 1 + else: + begin_month_for_future_resolution = end_month_for_future_resolution = curr_month + 1 + + duration_days = end_day - begin_day + + elif begin_day > end_day: + + # For this case, FutureValue and PastValue share the same resolution + if begin_day < curr_day: + if curr_month == Constants.MAX_MONTH: + end_month_for_past_resolution = end_month_for_future_resolution = 1 + end_year_for_past_resolution += 1 + end_year_for_future_resolution += 1 + else: + end_month_for_past_resolution = end_month_for_future_resolution = curr_month + 1 + else: + if curr_month == Constants.MAX_MONTH: + begin_month_for_past_resolution = curr_month - 1 + end_month_for_future_resolution = 1 + end_year_for_future_resolution += 1 + elif curr_month == 1: + begin_month_for_past_resolution = 12 + begin_year_for_past_resolution -= 1 + end_month_for_future_resolution = curr_month + 1 + else: + begin_month_for_past_resolution = curr_month - 1 + end_month_for_future_resolution = curr_month + 1 + duration_days = begin_day - end_day + + if duration_days != 0: + begin_date_for_past_resolution = DateUtils.safe_create_from_min_value( + begin_year_for_past_resolution, begin_month_for_past_resolution, begin_day + ) + end_date_for_past_resolution = DateUtils.safe_create_from_min_value( + end_year_for_past_resolution, end_month_for_past_resolution, end_day + ) + begin_date_for_future_resolution = DateUtils.safe_create_from_min_value( + begin_year_for_future_resolution, begin_month_for_future_resolution, begin_day + ) + end_date_for_future_resolution = DateUtils.safe_create_from_min_value( + end_year_for_future_resolution, end_month_for_future_resolution, end_day + ) + + if relative_month: + ret.timex = TimexUtil.generate_date_period_timex( + begin_date_for_future_resolution, end_date_for_future_resolution, 0 + ) + else: + ret.timex = TimexUtil.generate_date_period_timex( + begin_date_for_future_resolution, + end_date_for_future_resolution, + 0, + has_year=False, + has_month=False, + ) + + ret.past_value = [begin_date_for_past_resolution, end_date_for_past_resolution] + ret.future_value = [begin_date_for_future_resolution, end_date_for_future_resolution] + ret.success = True + + return ret + + # for case "2016年5月" + def parse_year_and_month(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = RegExpUtility.exact_match(self.config.year_and_month, source, trim=True) + + if not match or not match.success: + match = RegExpUtility.exact_match(self.config.pure_num_year_and_month, source, trim=True) + + if not match or not match.success: + return ret + + year = reference.year + year_num = match.get_group(Constants.YEAR_GROUP_NAME) + year_cjk = match.get_group(Constants.YEAR_CJK_GROUP_NAME) + year_rel = match.get_group(Constants.YEAR_RELATIVE) + cardinal_str = match.get_group(Constants.CARDINAL) + + if year_num: + if self.config.is_year_only(year_num): + year_num = year_num[: len(year_num) - 1] + + year = self.convert_cjk_to_integer(year_num) + + elif year_cjk: + if self.config.is_year_only(year_cjk): + year_cjk = year_cjk[: len(year_num) - 1] + + year = self.convert_cjk_to_integer(year_cjk) + + elif year_rel: + if self.config.is_last_year(year_rel): + year -= 1 + elif self.config.is_next_year(year_rel): + year += 1 + + if 100 > year >= self.config.two_num_year: + year += int(Constants.BASE_YEAR_PAST_CENTURY) + elif year < self.config.two_num_year: + year += int(Constants.BASE_YEAR_CURRENT_CENTURY) + + month_str = match.get_group(Constants.MONTH_GROUP_NAME) + + if month_str: + month = self.config.to_month_number(month_str) + elif RegExpUtility.exact_match(self.config.wom_last_regex, cardinal_str, trim=True).success: + month = 12 + else: + month = self.config.cardinal_map[cardinal_str] + + begin_day = DateUtils.safe_create_from_min_value(year, month, 1) + + if month == 12: + end_day = DateUtils.safe_create_from_min_value(year + 1, 1, 1) + else: + end_day = DateUtils.safe_create_from_min_value(year, month + 1, 1) + + ret.timex = DateTimeFormatUtil.luis_date(year, month, 1) + ret.future_value = ret.past_value = [begin_day, end_day] + ret.success = True + return ret + + # case like "今年三月" "这个周末" "五月" + def parse_one_word_period(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + year = reference.year + month = reference.month + future_year = past_year = year + + is_reference_date_period = False + + trimmed_source = source.lower() + match = RegExpUtility.exact_match(self.config.one_word_period_regex, trimmed_source, trim=True) + + # For cases "that week|month|year" + if not match: + match = RegExpUtility.exact_match(self.config.reference_date_period_regex, trimmed_source, trim=True) + + if match and match.success: + is_reference_date_period = True + ret.mod = TimeTypeConstants.REF_UNDEF_MOD + + if not match: + match = RegExpUtility.exact_match(self.config.later_early_period_regex, trimmed_source, trim=True) + + if match and match.success: + self.parse_later_early_period(source, reference) + + if match and match.success: + month_str = match.get_group(Constants.MONTH_GROUP_NAME) + + if self.config.is_this_year(trimmed_source): + ret.timex = TimexUtil.generate_year_timex(reference) + ret.future_value = ret.past_value = [DateUtils.safe_create_from_min_value(year, 1, 1), reference] + ret.success = True + return ret + + if self.config.is_year_to_date(trimmed_source): + ret.timex = TimexUtil.generate_year_timex(reference.year) + ret.future_value = ret.past_value = [DateUtils.safe_create_from_min_value(year, 1, 1), reference] + ret.success = True + return ret + + next_match = self.config.next_regex.match(trimmed_source) + last_match = self.config.last_regex.match(trimmed_source) + + if month_str: + + swift = -10 + year_rel = match.get_group(Constants.YEAR_RELATIVE) + + if year_rel: + if self.config.is_next_year(year_rel): + swift = 1 + elif self.config.is_last_year(year_rel): + swift = -1 + elif self.config.is_this_year(year_rel): + swift = 0 + + month = self.config.to_month_number(month_str) + + if swift >= -1: + year += swift + ret.timex = DateTimeFormatUtil.luis_date(year, month, 1) + future_year = past_year = year + else: + ret.timex = DateTimeFormatUtil.luis_date(Constants.INVALID_YEAR, month, 1) + + if month < reference.month: + future_year += 1 + + if month >= reference.month: + past_year -= 1 + else: + swift = 0 + if next_match: + if next_match.group(Constants.AFTER_MOD): + swift = 2 + else: + swift = 1 + elif last_match: + swift = -1 + + # Handle cases with "(上|下)半" like "上半月"、 "下半年" + if match.get_group(Constants.HALF_TAG_GROUP_NAME): + return self.handle_with_half_tag(source, reference, ret, swift) + + if self.config.is_week_only(trimmed_source): + monday = DateUtils.this(reference, DayOfWeek.MONDAY) + datedelta(days=7 * swift) + ret.timex = ( + TimexUtil.generate_week_timex() + if is_reference_date_period + else TimexUtil.generate_week_timex(monday) + ) + ret.future_value = ret.past_value = [ + monday, + DateUtils.this(reference, DayOfWeek.SUNDAY) + datedelta(days=7 * swift) + datedelta(days=1), + ] + ret.success = True + + return ret + elif match.get_group(Constants.REST_OF_GROUP_NAME): + duration_str = match.get_group(Constants.SYS_DATETIME_DURATION) + duration_unit = self.config.unit_map[duration_str] + begin_date = end_date = reference + + ret.timex = TimexUtil.generate_date_period_timex_with_diff(begin_date, end_date, duration_unit) + ret.future_value = ret.past_value = [begin_date, end_date] + ret.success = True + return ret + + if self.config.is_weekend(trimmed_source): + begin_date = DateUtils.this(reference, DayOfWeek.SATURDAY) + datedelta(days=7 * swift) + end_date = DateUtils.this(reference, DayOfWeek.SUNDAY) + datedelta(days=7 * swift) + + match = RegExpUtility.exact_match( + self.config.reference_date_period_regex, trimmed_source, trim=True + ) + + if match and match.success: + is_reference_date_period = True + ret.mod = TimeTypeConstants.REF_UNDEF_MOD + + ret.timex = ( + TimexUtil.generate_weekend_timex() + if is_reference_date_period + else TimexUtil.generate_weekend_timex(begin_date) + ) + ret.future_value = ret.past_value = [begin_date, end_date + datedelta(days=1)] + ret.success = True + return ret + + if self.config.is_month_only(trimmed_source): + month = int(reference.month + swift) + year = int(reference.year + swift) + ret.timex = DateTimeFormatUtil.luis_date(year, month, reference.day) + ret.timex = ( + TimexUtil.generate_month_timex() + if is_reference_date_period + else DateTimeFormatUtil.luis_date(year, month, 1) + ) + future_year = past_year = year + + elif self.config.is_year_only(trimmed_source): + + # Handle like "今年上半年","明年下半年" + swift = 0 + trimmed_source, has_half, is_first_half = self.handle_with_half_year(match, trimmed_source) + swift = 0 if has_half else swift + + year = int(reference.year) + swift + + if self.config.is_last_year(trimmed_source): + year -= 1 + elif self.config.is_next_year(trimmed_source): + year += 1 + elif self.config.is_year_before_last(trimmed_source): + year -= 2 + elif self.config.is_year_after_next(trimmed_source): + year += 2 + + return self.handle_year_result(ret, year, is_reference_date_period, has_half, is_first_half) + + else: + return ret + + # only "month" will come to here + + ret.future_value = [ + DateUtils.safe_create_from_min_value(future_year, month, 1), + DateUtils.safe_create_from_min_value(future_year, month, 1) + datedelta(months=1), + ] + ret.past_value = [ + DateUtils.safe_create_from_min_value(past_year, month, 1), + DateUtils.safe_create_from_min_value(past_year, month, 1) + datedelta(months=1), + ] + + ret.success = True + + return ret + + def parse_later_early_period(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + year = reference.year + month = reference.month + + future_year = past_year = year + + early_prefix = False + late_prefix = False + mid_prefix = False + earlier_prefix = False + later_prefix = False + is_reference_date_period = False + + trimmed_source = source.lower() + + match = RegExpUtility.exact_match(self.config.later_early_period_regex, trimmed_source, trim=True) + + if match and match.success: + if match.get_group(Constants.EARLY_PREFIX): + early_prefix = True + trimmed_source = str(match.get_group(Constants.SUFFIX_GROUP_NAME)) + ret.mod = TimeTypeConstants.EARLY_MOD + + elif match.get_group(Constants.LATE_PREFIX): + late_prefix = True + trimmed_source = str(match.get_group(Constants.SUFFIX_GROUP_NAME)) + ret.mod = TimeTypeConstants.LATE_MOD + + elif match.get_group(Constants.MID_PREFIX): + mid_prefix = True + trimmed_source = str(match.get_group(Constants.SUFFIX_GROUP_NAME)) + ret.mod = TimeTypeConstants.MID_MOD + + swift = 0 + if match.get_group(Constants.MONTH_GROUP_NAME): + swift = self.config.get_swift_year(trimmed_source) + else: + if match.get_group(Constants.NEXT_GROUP_NAME): + swift = 1 + elif match.get_group(Constants.LAST_GROUP_NAME): + swift = -1 + + if match.get_group(Constants.REL_EARLY): + earlier_prefix = True + if BaseDatePeriodParser.is_present(swift): + ret.mod = None + elif match.get_group(Constants.REL_LATE): + later_prefix = True + if BaseDatePeriodParser.is_present(swift): + ret.mod = None + + month_str = match.get_group(Constants.MONTH_GROUP_NAME) + + # Parse expressions "till date", "to date" + if match.get_group(Constants.TO_DATE_GROUP_NAME): + ret.timex = "PRESENT_REF" + ret.future_value = ret.past_value = reference + ret.mod = TimeTypeConstants.BEFORE_MOD + ret.success = True + return ret + + if month_str: + + swift = self.config.get_swift_year(trimmed_source) + month = self.config.month_of_year[month_str] + + if swift >= 1: + ret.timex = f'{reference + datedelta(years=swift):04d}-{month:02d}' + + year = year + swift + future_year = past_year = year + else: + ret.timex = f'XXXX-{month:02d}' + + if month < reference.month: + future_year += 1 + if month >= reference.month: + past_year -= 1 + + else: + if match.get_group(Constants.NEXT_GROUP_NAME): + swift = 1 + elif match.get_group(Constants.LAST_GROUP_NAME): + swift = -1 + + is_working_week = match.get_group(Constants.BUSINESS_DAY_GROUP_NAME).success + + is_week_only = self.config.is_week_only(trimmed_source) + + if is_working_week or is_week_only: + delta = Constants.WEEK_DAY_COUNT * swift + end_delta = delta + + monday = DateUtils.this(reference, DayOfWeek.MONDAY) + datedelta(days=delta) + end_day = DayOfWeek.FRIDAY if is_working_week else DayOfWeek.SUNDAY + + begin_date = monday + end_date = ( + DateUtils.this(reference, end_day) + datedelta(days=end_delta) + if self._inclusive_end_period + else DateUtils.this(reference, end_day) + datedelta(days=end_delta + 1) + ) + + if early_prefix: + end_date = ( + DateUtils.this(reference, DayOfWeek.WEDNESDAY) + datedelta(days=end_delta) + if self._inclusive_end_period + else DateUtils.this(reference, DayOfWeek.WEDNESDAY) + datedelta(days=end_delta + 1) + ) + + elif mid_prefix: + begin_date = DateUtils.this(reference, DayOfWeek.TUESDAY) + datedelta(days=delta) + end_date = ( + DateUtils.this(reference, DayOfWeek.FRIDAY) + datedelta(days=end_delta) + if self._inclusive_end_period + else DateUtils.this(reference, DayOfWeek.FRIDAY) + datedelta(days=end_delta + 1) + ) + + elif late_prefix: + begin_date = DateUtils.this(reference, DayOfWeek.THURSDAY) + datedelta(days=delta) + + if earlier_prefix and swift == 0: + if end_date > reference: + end_date = reference + elif later_prefix and swift == 0: + if begin_date < reference: + begin_date = reference + + ret.timex = ( + TimexUtil.generate_week_timex() + if is_reference_date_period + else TimexUtil.generate_week_timex(monday) + ) + + if late_prefix and swift != 0: + ret.mod = TimeTypeConstants.LATE_MOD + + ret.future_value = ret.past_value = [begin_date, end_date] + ret.success = True + return ret + + if self.config.is_weekend(trimmed_source): + begin_date = DateUtils.this(reference, DayOfWeek.SATURDAY) + datedelta( + days=Constants.WEEK_DAY_COUNT * swift + ) + end_date = DateUtils.this(reference, DayOfWeek.SUNDAY) + datedelta( + days=Constants.WEEK_DAY_COUNT * swift + ) + ret.timex = ( + TimexUtil.generate_weekend_timex() + if is_reference_date_period + else TimexUtil.generate_weekend_timex(begin_date) + ) + end_date = end_date if self._inclusive_end_period else end_date + datedelta(days=1) + ret.future_value = ret.past_value = [begin_date, end_date] + ret.success = True + return ret + + if self.config.is_month_only(trimmed_source): + date = reference + datedelta(months=swift) + month = date.month + year = date.year + ret.timex = ( + TimexUtil.generate_month_timex() + if is_reference_date_period + else TimexUtil.generate_month_timex(date) + ) + future_year = past_year = year + + elif self.config.is_year_only(trimmed_source): + date = reference + datedelta(years=swift) + year = date.year + + if match.get_group(Constants.SPECIAL_GROUP_NAME): + swift = self.config.get_swift_year(trimmed_source) + date = Constants.INVALID_YEAR if swift < -1 else date + ret.timex = TimexUtil.generate_year_timex(date, None) + ret.success = True + return ret + + begin_date = DateUtils.safe_create_from_min_value(year, 1, 1) + end_date = ( + DateUtils.safe_create_from_min_value(year, 12, 31) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(year, 12, 31) + datedelta(days=1) + ) + + if early_prefix: + end_date = ( + DateUtils.safe_create_from_min_value(year, 6, 30) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(year, 6, 30) + datedelta(days=1) + ) + + elif mid_prefix: + begin_date = DateUtils.safe_create_from_min_value(year, 4, 1) + end_date = ( + DateUtils.safe_create_from_min_value(year, 9, 30) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(year, 9, 30) + datedelta(days=1) + ) + + elif late_prefix: + begin_date = DateUtils.safe_create_from_min_value(year, Constants.WEEK_DAY_COUNT, 1) + + if earlier_prefix and swift == 0: + if end_date > reference: + end_date = reference + + elif later_prefix and swift == 0: + if begin_date < reference: + begin_date = reference + + ret.timex = ( + TimexUtil.generate_year_timex() + if is_reference_date_period + else TimexUtil.generate_year_timex(date) + ) + ret.future_value = ret.past_value = [begin_date, end_date] + ret.success = True + + return ret + + # Early/mid/late are resolved in this policy to 4 month ranges at the start/middle/end of the year. + elif match.get_group(Constants.FOUR_DIGIT_YEAR_GROUP_NAME): + date = reference + datedelta(years=swift) + year = int(match.get_group(Constants.FOUR_DIGIT_YEAR_GROUP_NAME)) + + begin_date = DateUtils.safe_create_from_min_value(year, 1, 1) + end_date = ( + DateUtils.safe_create_from_min_value(year, 12, 31) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(year, 12, 31) + datedelta(days=1) + ) + + if early_prefix: + end_date = ( + DateUtils.safe_create_from_min_value(year, 4, 30) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(year, 4, 30) + datedelta(days=1) + ) + elif mid_prefix: + begin_date = DateUtils.safe_create_from_min_value(year, 5, 1) + end_date = ( + DateUtils.safe_create_from_min_value(year, 8, 31) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(year, 8, 31) + datedelta(days=1) + ) + + elif late_prefix: + begin_date = DateUtils.safe_create_from_min_value(year, 9, 1) + + ret.timex = ( + TimexUtil.generate_year_timex() + if is_reference_date_period + else TimexUtil.generate_year_timex(begin_date) + ) + ret.future_value = ret.past_value = [begin_date, end_date] + ret.success = True + + return ret + + else: + return ret + + # only "month" will come to here + future_start = DateUtils.safe_create_from_min_value(future_year, month, 1) + future_end = ( + DateUtils.safe_create_from_min_value(future_year, month, 1) + datedelta(months=1) - datedelta(days=1) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(future_year, month, 1) + datedelta(months=1) + ) + + past_start = DateUtils.safe_create_from_min_value(past_year, month, 1) + past_end = ( + DateUtils.safe_create_from_min_value(past_year, month, 1) + datedelta(months=1) - datedelta(days=1) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(past_year, month, 1) + datedelta(months=1) + ) + + if early_prefix: + future_end = ( + DateUtils.safe_create_from_min_value(future_year, month, 15) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(future_year, month, 15) + datedelta(days=1) + ) + + past_end = ( + DateUtils.safe_create_from_min_value(past_year, month, 15) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(past_year, month, 15) + datedelta(days=1) + ) + + elif mid_prefix: + future_start = DateUtils.safe_create_from_min_value(future_year, month, 10) + past_start = DateUtils.safe_create_from_min_value(past_year, month, 10) + + future_end = ( + DateUtils.safe_create_from_min_value(future_year, month, 20) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(future_year, month, 20) + datedelta(days=1) + ) + + past_end = ( + DateUtils.safe_create_from_min_value(past_year, month, 20) + if self._inclusive_end_period + else DateUtils.safe_create_from_min_value(past_year, month, 20) + datedelta(days=1) + ) + + elif late_prefix: + future_start = DateUtils.safe_create_from_min_value(future_year, month, 16) + past_start = DateUtils.safe_create_from_min_value(past_year, month, 16) + + if earlier_prefix and future_end == past_end: + if future_end > reference: + future_end = past_end = reference + + elif later_prefix and future_start == past_start: + if future_start < reference: + future_start = past_start = reference + + ret.future_value = [future_start, future_end] + ret.past_value = [past_start, past_end] + ret.success = True + + return ret + + def handle_with_half_tag( + self, source: str, reference: datetime, ret: DateTimeResolutionResult, swift: int + ) -> DateTimeResolutionResult: + year = reference.year + month = reference.month + + if self.config.is_week_only(source): + + # Handle like "上半周","下半周" + begin_day = ( + DateUtils.this(reference, DayOfWeek.MONDAY) + if swift == -1 + else DateUtils.this(reference, DayOfWeek.THURSDAY) + ) + end_day = ( + DateUtils.this(reference, DayOfWeek.THURSDAY) + if swift == -1 + else DateUtils.this(reference, DayOfWeek.SUNDAY) + datedelta(days=1) + ) + ret.timex = TimexUtil.generate_date_period_timex(begin_day, end_day, timex_type=0) + + elif self.config.is_month_only(source): + + # Handle like "上半月","下半月" + month_start_day = DateUtils.safe_create_from_min_value(year, month, 1) + month_end_day = DateUtils.safe_create_from_min_value(year, month + 1, 1) + half_month_day = int((month_end_day.day - month_start_day.day) / 2) + + begin_day = month_start_day if swift == -1 else month_start_day + datedelta(days=half_month_day) + end_day = month_start_day + datedelta(days=half_month_day) if swift == -1 else month_end_day + ret.timex = TimexUtil.generate_date_period_timex(begin_day, end_day, timex_type=0) + + else: + # Handle like "上(个)半年","下(个)半年" + begin_day = ( + DateUtils.safe_create_from_min_value(year, 1, 1) + if swift == -1 + else DateUtils.safe_create_from_min_value(year, 7, 1) + ) + end_day = ( + DateUtils.safe_create_from_min_value(year, 7, 1) + if swift == -1 + else DateUtils.safe_create_from_min_value(year + 1, 1, 1) + ) + ret.timex = TimexUtil.generate_date_period_timex(begin_day, end_day, timex_type=2) + + ret.future_value = ret.past_value = [begin_day, end_day] + ret.success = True + return ret + + # only contains year like "2016年" or "2016年上半年" + def parse_year(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = RegExpUtility.exact_match(self.config.year_regex, source, trim=True) + + if match and match.success: + year_str = match.value + + # Handle like "2016年上半年","2017年下半年" + year_str = self.handle_with_half_year(match, year_str)[0] + + # Trim() to handle extra whitespaces like '07 年' + if self.config.is_year_only(year_str): + year_str = year_str[: len(year_str) - 1] + + year = self.convert_cjk_to_integer(year_str) + + return self.handle_year_result(ret, year, False) + + match = RegExpUtility.exact_match(self.config.year_in_cjk_regex, source, trim=True) + + if match and match.success: + year_str = match.value + + # Handle like "二零一七年上半年","二零一七年下半年" + year_str = self.handle_with_half_year(match, year_str)[0] + + if self.config.is_year_only(year_str): + year_str = year_str[: len(year_str) - 1] + + if len(year_str) == 1: + return ret + + year = self.convert_cjk_to_integer(year_str) + + return self.handle_year_result(ret, year, False) + + return ret + + def handle_with_half_year(self, match: ConditionalMatch, source: str) -> [str, bool, bool]: + first_half = match.get_group(Constants.FIRST_HALF_GROUP_NAME) + second_half = match.get_group(Constants.SECOND_HALF_GROUP_NAME) + + has_half = False + is_first_half = True if first_half else False + + if is_first_half or second_half: + half_text = first_half if is_first_half else second_half + source = source[: len(source) - len(half_text)] + has_half = True + + return source.lower(), has_half, is_first_half + + def handle_year_result( + self, + ret: DateTimeResolutionResult, + year: int, + is_reference_date_period: bool, + has_half: bool = False, + is_first_half: bool = False, + ) -> DateTimeResolutionResult: + if 100 > year >= self.config.two_num_year: + year += Constants.BASE_YEAR_PAST_CENTURY + elif year < 100 and year < self.config.two_num_year: + year += Constants.BASE_YEAR_CURRENT_CENTURY + + begin_day = DateUtils.safe_create_from_min_value(year, 1, 1) + end_day = DateUtils.safe_create_from_min_value(year + 1, 1, 1) + + ret.timex = ( + TimexUtil.generate_year_timex() if is_reference_date_period else DateTimeFormatUtil.luis_date(year, 1, 1) + ) + + if has_half: + if is_first_half: + end_day = DateUtils.safe_create_from_min_value(year, 7, 1) + else: + begin_day = DateUtils.safe_create_from_min_value(year, 7, 1) + + ret.timex = TimexUtil.generate_date_period_timex(begin_day, end_day, timex_type=2) + + ret.future_value = ret.past_value = [begin_day, end_day] + ret.success = True + + return ret + + # parse entities that made up by two time points + def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + er = self.config.date_extractor.extract(source, reference) + + if len(er) < 2: + er = self.config.date_extractor.extract(self.config.token_before_date + source, reference) + + if len(er) < 2: + return ret + + er[0].start -= len(self.config.token_before_date) + er[1].start -= len(self.config.token_before_date) + + pr1 = self.config.date_parser.parse(er[0], reference) + pr2 = self.config.date_parser.parse(er[1], reference) + + if len(er) >= 2: + + match = self.config.week_with_week_day_range_regex.match(source) + + if match: + week_prefix = str(match.group(Constants.WEEK_GROUP_NAME).value) + + # Check if weekPrefix is already included in the extractions otherwise include it + if week_prefix: + + if week_prefix not in er[0].text: + er[0].text = week_prefix + er[0].text + + if week_prefix not in er[1].text: + er[1].text = week_prefix + er[1].text + + pr1 = self.config.date_parser.parse(er[0], reference) + pr2 = self.config.date_parser.parse(er[1], reference) + + else: + date_context = self.get_year_context(er[0].text, er[1].text, source) + + if pr1.value is None or pr2.value is None: + return ret + + pr1 = date_context.process_date_entity_parsing_result(pr1) + pr2 = date_context.process_date_entity_parsing_result(pr2) + + if date_context.is_empty() and ( + DateUtils.is_Feb_29th_datetime(pr1.value.future_value) + or DateUtils.is_Feb_29th_datetime(pr2.value.future_value) + ): + [pr1, pr2] = date_context.sync_year(pr1, pr2) + + future_begin = pr1.value.future_value + future_end = pr2.value.future_value + past_begin = pr1.value.past_value + past_end = pr2.value.past_value + + if future_begin > future_end: + future_begin = past_begin + + if past_end < past_begin: + past_end = future_end + + ret.timex = TimexUtil.generate_date_period_timex_str(future_begin, future_end, 0, pr1.timex_str, pr2.timex_str) + + if ( + pr1.timex_str.startswith(Constants.TIMEX_FUZZY_YEAR) + and future_begin <= DateUtils.safe_create_from_value(DateUtils.min_value, future_begin.year, 2, 28) + and future_end >= DateUtils.safe_create_from_value(DateUtils.min_value, future_begin.year, 3, 1) + ): + # Handle cases like "2月28日到3月1日". + # There may be different timexes for FutureValue and PastValue due to the different validity of Feb 29th. + + ret.comment = Constants.COMMENT_DOUBLETIMEX + past_timex = TimexUtil.generate_date_period_timex_str(past_begin, past_end, 0, pr1.timex_str, pr2.timex_str) + ret.timex = TimexUtil.merge_timex_alternatives(ret.timex, past_timex) + + ret.future_value = [future_begin, future_end] + ret.past_value = [past_begin, past_end] + ret.success = True + + return ret + + # handle like "前两年" "前三个月" + def parse_number_with_unit(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + + # if there are NO spaces between number and unit + match = self.config.number_combined_with_unit.match(source) + + if match: + src_unit = match.group(Constants.UNIT_GROUP_NAME) + + before_str = source[: match.start()] + + if src_unit in self.config.unit_map: + unit_str = self.config.unit_map[src_unit] + num_str = match.group(Constants.NUM) + num_int = int(num_str) + + if RegExpUtility.exact_match(self.config.past_regex, before_str, trim=True).success: + if unit_str == Constants.TIMEX_DAY: + begin_date = reference - datedelta(days=num_int) + end_date = reference + elif unit_str == Constants.TIMEX_WEEK: + begin_date = reference - datedelta(days=7 * num_int) + end_date = reference + elif unit_str == Constants.TIMEX_MONTH_FULL: + begin_date = reference - datedelta(months=num_int) + end_date = reference + elif unit_str == Constants.TIMEX_YEAR: + begin_date = reference - datedelta(years=num_int) + end_date = reference + else: + return ret + + ret.timex = ( + f'({DateTimeFormatUtil.luis_date(begin_date.year, begin_date.month, begin_date.day)},' + f'{DateTimeFormatUtil.luis_date(end_date.year, end_date.month, end_date.day)},' + f'P{num_str}{unit_str[0]})' + ) + ret.future_value = ret.past_value = [begin_date, end_date] + ret.success = True + return ret + + if RegExpUtility.exact_match(self.config.future_regex, before_str, trim=True).success: + if unit_str == Constants.TIMEX_DAY: + begin_date = reference + end_date = reference + datedelta(days=num_int) + elif unit_str == Constants.TIMEX_WEEK: + begin_date = reference + end_date = reference + datedelta(days=7 * num_int) + elif unit_str == Constants.TIMEX_MONTH_FULL: + begin_date = reference + end_date = reference + datedelta(months=num_int) + elif unit_str == Constants.TIMEX_YEAR: + begin_date = reference + end_date = reference + datedelta(years=num_int) + else: + return ret + + ret.timex = ( + f'({DateTimeFormatUtil.luis_date(begin_date.year, begin_date.month, begin_date.day) + datedelta(days=1)},' + f'{DateTimeFormatUtil.luis_date(end_date.year, end_date.month, end_date.day) + datedelta(days=1)},' + f'P{num_str}{unit_str[0]})' + ) + ret.future_value = ret.past_value = [begin_date + datedelta(days=1), end_date + datedelta(days=1)] + ret.success = True + return ret + return ret + + # Analogous to the same method in BaseDatePeriodParser, it deals with date periods that involve durations + # e.g. "past 2 years", "within 2 days", "first 2 weeks of 2018". + def parse_duration(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + + # For cases like 'first 2 weeks of 2021' (2021年的前2周), 'past 2 years' (前两年), 'next 3 years' (后三年) + duration_res = self.config.duration_extractor.extract(source, reference) + + match_half = RegExpUtility.exact_match(self.config.one_word_period_regex, source, trim=True) + + # halfTag cases are processed in ParseOneWordPeriod + if match_half.success and match_half.get_group(Constants.HALF_TAG_GROUP_NAME): + ret.success = False + return ret + + if len(duration_res) > 0: + before_str = source[: duration_res[0].start] + after_str = source[duration_res[0].start :] + + matches = list(regex.finditer(self.config.unit_regex, duration_res[0].text)) + # matches = RegExpUtility.get_matches(self.config.unit_regex, duration_res[0].text) + match_business_days = RegExpUtility.exact_match(self.config.duration_unit_regex, source, trim=True) + + # handle duration cases like "5 years 1 month 21 days" and "multiple business days" + if (1 < len(matches) <= 3) or ( + matches and match_business_days.get_group(Constants.BUSINESS_DAY_GROUP_NAME) + ): + ret = self.parse_multiple_dates_duration(source, reference) + return ret + + elif len(matches) == 1: + src_unit = RegExpUtility.get_group(matches[0], Constants.UNIT_GROUP_NAME) + src_unit_index = duration_res[0].text.index(src_unit) + + number_str = duration_res[0].text[:src_unit_index] + match_few = self.config.duration_relative_duration_unit_regex.match(source) + + if match_few and number_str == match_few.get_group(Constants.FEW_GROUP_NAME).Value: + number = 3 + else: + number = self.convert_cjk_to_num(number_str) + + if src_unit in self.config.unit_map: + begin_date = reference + end_date = reference + + unit_str = self.config.unit_map[src_unit] + + # Get prefix + prefix_match = None + + if self.config.unit_regex.match(src_unit).groups(Constants.UNIT_OF_YEAR_GROUP_NAME): + # Patterns like 'first 2 weeks of 2018' are considered only if the unit is compatible + prefix_match = RegExpUtility.exact_match( + self.config.first_last_of_year_regex, before_str, trim=True + ) + + if prefix_match.success: + is_of_year_match = prefix_match.success + is_past_match = prefix_match.groups(Constants.LAST_GROUP_NAME) + else: + is_of_year_match = False + is_past_match = None + + is_future = False + + if not prefix_match: + prefix_match = self.config.past_regex.match_exact(before_str) + is_past_match = prefix_match.success + + if not prefix_match: + prefix_match = RegExpUtility.exact_match(self.config.future_regex, before_str, trim=True) + is_future = prefix_match.success + + if not prefix_match: + prefix_match = RegExpUtility.exact_match(self.config.future_regex, after_str, trim=True) + is_future = prefix_match.success + + if is_future and not RegExpUtility.exact_match( + self.config.future_regex, after_str, trim=True + ).get_groups(Constants.WITHIN_GROUP_NAME): + # for the "within" case it should start from the current day + begin_date = begin_date + datedelta(days=1) + end_date = end_date + datedelta(days=1) + + # Shift by year (if present) + if is_of_year_match: + + # Get Year + year = self.get_year_from_text(prefix_match) + + if year == Constants.INVALID_YEAR: + swift = 0 + year_rel = prefix_match.get_group(Constants.YEAR_RELATIVE) + if self.config.is_last_year(year_rel): + swift = -1 + elif self.config.is_next_year(year_rel): + swift = 1 + year = reference.year + datedelta(years=swift) + + # Get begin/end dates for year + if unit_str == Constants.TIMEX_WEEK: + # First/last week of the year is calculated according to ISO definition + begin_date = DateUtils.this(DateUtils.get_first_thursday(year), DayOfWeek.MONDAY) + end_date = DateUtils.this(DateUtils.get_last_thursday(year), DayOfWeek.MONDAY) + datedelta( + days=7 + ) + else: + begin_date = DateUtils.safe_create_from_min_value(year, 1, 1) + end_date = DateUtils.safe_create_from_min_value(year, 12, 31) + datedelta(days=1) + + # Shift begin/end dates by duration span + if prefix_match: + if is_past_match: + begin_date = end_date + + if unit_str == Constants.TIMEX_DAY: + begin_date = begin_date - datedelta(days=number) + pass + elif unit_str == Constants.TIMEX_WEEK: + begin_date = begin_date - datedelta(days=7 * number) + pass + elif unit_str == Constants.TIMEX_MONTH_FULL: + begin_date = begin_date - datedelta(months=number) + pass + elif unit_str == Constants.TIMEX_YEAR: + begin_date = begin_date - datedelta(years=number) + pass + else: + return ret + else: + end_date = begin_date + + if unit_str == Constants.TIMEX_DAY: + end_date = end_date + datedelta(days=number) + pass + elif unit_str == Constants.TIMEX_WEEK: + end_date = end_date + datedelta(days=7 * number) + pass + elif unit_str == Constants.TIMEX_MONTH_FULL: + end_date = end_date + datedelta(months=number) + pass + elif unit_str == Constants.TIMEX_YEAR: + end_date = end_date + datedelta(years=number) + pass + else: + return ret + + ret.timex = ( + f'({DateTimeFormatUtil.luis_date(begin_date.year, begin_date.month, begin_date.day)},\ + {DateTimeFormatUtil.luis_date(end_date.year, end_date.month, end_date.day)},' + f'P{number}{unit_str[0]})' + ) + ret.future_value = ret.past_value = [begin_date, end_date] + ret.success = True + return ret + + return ret + + def parse_multiple_dates_duration(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + begin_date = end_date = reference + duration_timex = '' + rest_now_sunday = False + + duration_ers = self.config.duration_extractor.extract(source, reference) + + if len(duration_ers) > 0: + duration_pr = self.config.duration_parser.parse(duration_ers[0]) + before_str = source[: duration_pr.start] + after_str = source[duration_pr.start + duration_pr.length] + + mod_and_date = ModAndDateResult() + mod_and_date_result = mod_and_date.mod_and_date_result(begin_date, end_date) + + if duration_pr.value: + duration_result = duration_pr.value + + if not duration_result.timex: + return ret + + if self.config.past_regex.match(before_str) or self.config.past_regex.match(after_str): + mod_and_date_result = ModAndDateResult.get_mod_and_date( + begin_date, end_date, reference, duration_result.timex, False + ) + + if ( + RegExpUtility.exact_match(self.config.future_regex, before_str, trim=True) + or RegExpUtility.exact_match(self.config.future_regex, after_str, trim=True) + ) and DurationParsingUtil.is_date_duration(duration_result.timex): + + mod_and_date_result = ModAndDateResult.get_mod_and_date( + begin_date, end_date, reference, duration_result.timex, True + ) + begin_date = mod_and_date_result.begin_date + end_date = mod_and_date_result.end_date + + # In GetModAndDate, this "future" resolution will add one day to beginDate/endDate, + # but for the "within" case it should start from the current day. + + if RegExpUtility.exact_match(self.config.future_regex, after_str, trim=True).get_group( + Constants.WITHIN_GROUP_NAME + ): + begin_date = begin_date - datedelta(days=1) + end_date = end_date - datedelta(days=1) + + if mod_and_date_result.mod: + duration_pr.value.mod = mod_and_date_result.mod + + duration_timex = duration_result.timex + ret.sub_date_time_entities = [duration_pr] + + if mod_and_date_result.date_list is not None: + ret.list = mod_and_date_result.date_list + + if (begin_date != end_date) or rest_now_sunday: + end_date = end_date - datedelta(days=1) if self._inclusive_end_period else end_date + + ret.timex = ( + f'({DateTimeFormatUtil.luis_date(begin_date.year, begin_date.month, begin_date.day)},' + f'{DateTimeFormatUtil.luis_date(end_date.year, end_date.month, end_date.day)},' + f'{duration_timex})' + ) + ret.future_value = ret.past_value = [begin_date, end_date] + ret.success = True + return ret + + ret.success = False + return ret + + # case like "三月的第一周" + def parse_week_of_month(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + trimmed_source = source.lower() + + match = self.config.week_of_month_regex.match(source) + + if not match: + return ret + + cardinal_str = match.get_group(Constants.CARDINAL) + month_str = match.get_group(Constants.MONTH_GROUP_NAME) + no_year = False + + if month_str is None: + swift = 0 + if RegExpUtility.match_begin(self.config.wom_next_regex, trimmed_source, trim=True): + swift = 1 + elif RegExpUtility.match_begin(self.config.wom_previous_regex, trimmed_source, trim=True): + swift = -1 + + month = reference + datedelta(months=swift) + year = reference + datedelta(years=swift) + ret.timex = DateTimeFormatUtil.luis_date(reference.year, month, 1) + else: + month = self.config.to_month_number(month_str) + year = self.get_year_from_text(match) + + if year == Constants.INVALID_YEAR: + year = reference.year + no_year = True + + ret = self.get_week_of_month(cardinal_str, month, year, reference, no_year) + + return ret + + def parse_week_of_date(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = self.config.week_of_date_regex.match(source) + date_ers = self.config.date_extractor.extract(source, reference) + + # Cases like 'week of september 16th' (9月16日の週) + + if match and len(date_ers) == 1: + pr = self.config.date_parser.parse(date_ers[0], reference).value + + if (self.config.options and DateTimeOptions.CALENDAR) != 0: + monday = DateUtils.this(pr.future_value, DayOfWeek.MONDAY) + ret.timex = DateTimeFormatUtil.to_iso_week_timex(monday) + else: + ret.timex = pr.timex + + ret.comment = Constants.COMMENT_WEEK_OF + ret.future_value = BaseDatePeriodParser.get_week_range_from_date(pr.future_value) + ret.past_value = BaseDatePeriodParser.get_week_range_from_date(pr.past_value) + ret.success = True + + return ret + + def parse_month_of_date(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = self.config.month_of_date_regex.match(source) + ex = self.config.date_extractor.extract(source, reference) + + # Cases like 'month of september 16th' (9月16日の月) + + if match and len(ex) == 1: + pr = self.config.date_parser.parse(ex[0], reference).value + ret.timex = pr.timex + ret.comment = Constants.COMMENT_MONTH_OF + ret.future_value = BaseDatePeriodParser.get_month_range_from_date(pr.future_value) + ret.past_value = BaseDatePeriodParser.get_month_range_from_date(pr.past_value) + ret.success = True + + return ret + + def parse_which_week(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = RegExpUtility.exact_match(self.config.which_week_regex, source, trim=True) + + if match and match.success: + num = int(match.get_group(Constants.NUMBER)) + if num == 0: + return ret + + year = reference.year + ret.timex = f'{year:04d}-W{num:02d}' + + first_day = DateUtils.safe_create_from_value(DateUtils.min_value, year, 1, 1) + first_thursday = DateUtils.this(first_day, DayOfWeek.THURSDAY) + first_week = DateUtils.week_of_year(first_thursday) + + if first_week == 1: + num -= 1 + + value = first_thursday + datedelta(days=(7 * num) - 3) + + ret.future_value = [value, value + datedelta(days=7)] + ret.past_value = [value, value + datedelta(days=7)] + ret.success = True + + return ret + + def get_week_of_month( + self, cardinal_str: str, month: int, year: int, reference: datetime, no_year: bool + ) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + target_monday = self.get_monday_of_target_week(cardinal_str, month, year) + + future_date = past_date = target_monday + + if no_year and future_date < reference: + future_date = self.get_monday_of_target_week(cardinal_str, month, year + 1) + + if no_year and past_date >= reference: + past_date = self.get_monday_of_target_week(cardinal_str, month, year - 1) + + if no_year: + year = Constants.INVALID_YEAR + + # Note that if the cardinalStr equals to "last", the weekNumber would be fixed at "5" + # This may lead to some inconsistency between Timex and Resolution + # the StartDate and EndDate of the resolution would always be correct (following ISO week definition) + # But week number for "last week" might be inconsistent with the resolution as we only have one Timex, + # but we may have past and future resolutions which may have different week numbers + + week_num = self.get_week_number_for_month(cardinal_str) + ret.timex = TimexUtil.generate_week_of_month_timex(year, month, week_num) + + ret.future_value = ( + [future_date, future_date + datedelta(days=Constants.WEEK_DAY_COUNT - 1)] + if self._inclusive_end_period + else [future_date, future_date + datedelta(days=Constants.WEEK_DAY_COUNT)] + ) + ret.past_value = ( + [past_date, past_date + datedelta(days=Constants.WEEK_DAY_COUNT - 1)] + if self._inclusive_end_period + else [past_date, past_date + datedelta(days=Constants.WEEK_DAY_COUNT)] + ) + ret.success = True + + return ret + + def get_monday_of_target_week(self, cardinal_str: str, month: int, year: int) -> datetime: + + if RegExpUtility.exact_match(self.config.wom_last_regex, cardinal_str, trim=True).success: + last_thursday = DateUtils.get_last_thursday(year, month) + result = DateUtils.this(last_thursday, DayOfWeek.MONDAY) + else: + cardinal = self.get_week_number_for_month(cardinal_str) + first_thursday = DateUtils.get_first_thursday(year, month) + + result = DateUtils.this(first_thursday, DayOfWeek.MONDAY) + datedelta( + days=Constants.WEEK_DAY_COUNT * (cardinal - 1) + ) + + return result + + def get_week_number_for_month(self, cardinal_str: str) -> int: + + # "last week of month" might not be "5th week of month" + # Sometimes it can also be "4th week of month" depends on specific year and month + # But as we only have one Timex, we use "5" to indicate it's the "last week" + + if RegExpUtility.exact_match(self.config.wom_last_regex, cardinal_str, trim=True).success: + cardinal = 5 + else: + cardinal = self.config.cardinal_map[cardinal_str] + + return cardinal + + # Cases like 'second week of 2021' (2021年的第二周) + def parse_week_of_year(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + + match = self.config.week_of_year_regex.match(source) + + if not match: + return ret + + cardinal_str = match.get_group(Constants.CARDINAL) + order_str = match.get_group(Constants.ORDER) + + year = self.get_year_from_text(match) + + if year == Constants.INVALID_YEAR: + swift = self.config.get_swift_year(order_str) + + if swift < -1: + return ret + + year = reference.year + datedelta(years=swift) + + if RegExpUtility.exact_match(self.config.wom_last_regex, cardinal_str, trim=True).success: + target_week_monday = DateUtils.this(DateUtils.get_last_thursday(year), DayOfWeek.MONDAY) + ret.timex = TimexUtil.generate_week_timex(target_week_monday) + else: + week_num = self.config.cardinal_map[cardinal_str] + target_week_monday = DateUtils.this(DateUtils.get_last_thursday(year), DayOfWeek.MONDAY) + datedelta( + days=Constants.WEEK_DAY_COUNT * (week_num - 1) + ) + ret.timex = TimexUtil.generate_week_of_year_timex(year, week_num) + + ret.future_value = ( + [target_week_monday, target_week_monday + datedelta(days=Constants.WEEK_DAY_COUNT - 1)] + if self._inclusive_end_period + else [target_week_monday, target_week_monday + datedelta(days=Constants.WEEK_DAY_COUNT)] + ) + + ret.past_value = ( + [target_week_monday, target_week_monday + datedelta(days=Constants.WEEK_DAY_COUNT - 1)] + if self._inclusive_end_period + else [target_week_monday, target_week_monday + datedelta(days=Constants.WEEK_DAY_COUNT)] + ) + + ret.success = True + + return ret + + # parse "今年夏天" + def parse_season(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = RegExpUtility.exact_match(self.config.season_with_year, source, trim=True) + + if match and match.success: + + # parse year + year = reference.year + has_year = False + year_num = match.get_group(Constants.YEAR_GROUP_NAME) + year_cjk = match.get_group(Constants.YEAR_CJK_GROUP_NAME) + year_rel = match.get_group(Constants.YEAR_RELATIVE) + + if year_num: + has_year = True + + if self.config.is_year_only(year_num): + year_num = year_num[: len(year_num) - 1] + year = int(year_num) + + elif year_cjk: + has_year = True + + if self.config.is_year_only(year_cjk): + year_cjk = year_cjk[: len(year_cjk) - 1] + year = self.convert_cjk_to_integer(year_cjk) + + elif year_rel: + has_year = True + + if self.config.is_last_year(year_rel): + year -= 1 + elif self.config.is_next_year(year_rel): + year += 1 + + RegExpUtility.match_begin(self.config.this_regex, source, trim=True) + + # handle cases like "this summer" 今夏 + if not has_year and RegExpUtility.match_begin(self.config.this_regex, source, trim=True): + has_year = True + year = reference.year + elif not has_year and RegExpUtility.match_begin(self.config.next_regex, source, trim=True): + has_year = True + year = reference.year + datedelta(years=1) + elif not has_year and RegExpUtility.match_begin(self.config.last_regex, source, trim=True): + has_year = True + year = reference.year - datedelta(years=1) + + if 100 > year >= self.config.two_num_year: + year += Constants.BASE_YEAR_PAST_CENTURY + elif year < 100 and year < self.config.two_num_year: + year += Constants.BASE_YEAR_CURRENT_CENTURY + + # parse season + season_str = match.get_group(Constants.SEASON) + + if match.get_group(Constants.EARLY_PREFIX): + ret.mod = TimeTypeConstants.EARLY_MOD + if match.get_group(Constants.MID_PREFIX): + ret.mod = TimeTypeConstants.MID_MOD + if match.get_group(Constants.LATE_PREFIX): + ret.mod = TimeTypeConstants.LATE_MOD + + ret.timex = self.config.season_map[season_str] + + if has_year: + ret.timex = f'{year:04d}-{ret.timex}' + + ret.success = True + return ret + + return ret + + def parse_quarter(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = RegExpUtility.exact_match(self.config.quarter_regex, source, trim=True) + + if not match or not match.success: + return ret + + # parse year + year = reference.year + year_num = match.get_group(Constants.YEAR_GROUP_NAME) + year_cjk = match.get_group(Constants.YEAR_CJK_GROUP_NAME) + year_rel = match.get_group(Constants.YEAR_RELATIVE) + + if year_num: + if self.config.is_year_only(year_num): + year_num = year_num[: len(year_num) - 1] + + year = int(year_num) + + elif year_cjk: + if self.config.is_year_only(year_cjk): + year_cjk = year_cjk[: len(year_cjk) - 1] + + year = self.convert_cjk_to_integer(year_cjk) + + elif year_rel: + if self.config.is_last_year(year_rel): + year -= 1 + elif self.config.is_next_year(year_rel): + year += 1 + + if 100 > year >= self.config.two_num_year: + year += Constants.BASE_YEAR_PAST_CENTURY + elif year < 100 and year < self.config.two_num_year: + year += Constants.BASE_YEAR_CURRENT_CENTURY + + # parse quarter_num + cardinal_str = match.get_group(Constants.CARDINAL) + quarter_num = self.config.cardinal_map[cardinal_str] + + if year_num or year_rel: + begin_date = DateUtils.safe_create_from_value( + DateUtils.min_value, year, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) + end_date = DateUtils.safe_create_from_value( + DateUtils.min_value, year, quarter_num * Constants.TRIMESTER_MONTH_COUNT, 1 + ) + datedelta(months=1) + ret.future_value = ret.past_value = [begin_date, end_date] + ret.timex = TimexUtil.generate_date_period_timex(begin_date, end_date, 2) + ret.success = True + else: + begin_date = DateUtils.safe_create_from_value( + DateUtils.min_value, year, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) + end_date = DateUtils.safe_create_from_value( + DateUtils.min_value, year, quarter_num * Constants.TRIMESTER_MONTH_COUNT, 1 + ) + datedelta(months=1) + ret.past_value = [begin_date, end_date] + ret.timex = TimexUtil.generate_date_period_timex(begin_date, end_date, 2) + begin_date = DateUtils.safe_create_from_value( + DateUtils.min_value, year + 1, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) + end_date = DateUtils.safe_create_from_value( + DateUtils.min_value, year + 1, quarter_num * Constants.TRIMESTER_MONTH_COUNT, 1 + ) + datedelta(months=1) + ret.future_value = [begin_date, end_date] + + ret.success = True + return ret + + def parse_decade(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + + century = int((reference.year / 100) + 1) + decade_last_year = 10 + input_century = False + + match = RegExpUtility.exact_match(self.config.decade_regex, source, trim=True) + + if match and match.success: + decade_str = match.get_group(Constants.DECADE) + decade = int(decade_str) + + if not DateUtils.int_try_parse(decade_str)[1]: + decade = self.convert_cjk_to_num(decade_str) + + century_str = match.get_group(Constants.CENTURY) + + if century_str: + century = int(century_str) + + if not DateUtils.int_try_parse(century_str)[1]: + century = self.convert_cjk_to_num(century_str) + + else: + century_str = match.get_group(Constants.REL_CENTURY) + + if century_str: + + century_str = century_str.lower() + this_match = self.config.this_regex.match(century_str) + next_match = self.config.next_regex.match(century_str) + + if this_match: + pass + elif next_match: + century += 1 + else: + century -= 1 + + input_century = True + else: + return ret + + begin_year = ((century - 1) * 100) + decade + first_two_num_of_year = match.get_group(Constants.FIRST_TWO_YEAR_NUM) + + # handle cases like "2000年代" + if first_two_num_of_year: + begin_year = (self.convert_cjk_to_integer(first_two_num_of_year) * 100) + decade + + ret.timex = TimexUtil.generate_decade_timex(begin_year, decade_last_year, decade, input_century) + + future_year = past_year = begin_year + + start_date = DateUtils.safe_create_from_value(DateUtils.min_value, begin_year, 1, 1) + + if not input_century and start_date < reference and not first_two_num_of_year: + future_year += 100 + + if not input_century and start_date >= reference and not first_two_num_of_year: + past_year -= 100 + + ret.future_value = [ + DateUtils.safe_create_from_value(DateUtils.min_value, future_year, 1, 1), + DateUtils.safe_create_from_value(DateUtils.min_value, future_year + decade_last_year, 1, 1), + ] + ret.past_value = [ + DateUtils.safe_create_from_value(DateUtils.min_value, past_year, 1, 1), + DateUtils.safe_create_from_value(DateUtils.min_value, past_year + decade_last_year, 1, 1), + ] + ret.success = True + + return ret + + def parse_century(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + century = (reference.year / 100) + 1 + + match = RegExpUtility.exact_match(self.config.century_regex, source, trim=True) + + if match and match.success: + century_str = match.get_group(Constants.CENTURY) + + if century_str: + century = int(century_str) + + if not DateUtils.int_try_parse(century_str)[1]: + century = self.convert_cjk_to_num(century_str) + + begin_year = (century - 1) * Constants.CENTURY_YEARS_COUNT + end_year = begin_year + Constants.CENTURY_YEARS_COUNT + + start_date = DateUtils.safe_create_from_value(begin_year, 1, 1, 1) + end_date = DateUtils.safe_create_from_value(end_year, 1, 1, 1) + + ret.timex = TimexUtil.generate_date_period_timex(start_date, end_date, 3) + ret.future_value = ret.past_value = [start_date, end_date] + ret.success = True + + return ret + + # Only handle cases like "within/less than/more than x weeks from/before/after today" + def parse_date_point_with_ago_and_later(self, source: str, reference: datetime) -> DateTimeResolutionResult: + + ret = DateTimeResolutionResult() + er = self.config.date_extractor.extract(source, reference)[0] + trimmed_source = source.lower() + match = RegExpUtility.exact_match(self.config.date_point_with_ago_and_later, trimmed_source, trim=True) + + if er and match: + is_ago = match.get_group(Constants.AGO_LABEL).success + is_within = match.get_group(Constants.WITHIN_GROUP_NAME).success + is_more_than = match.get_group(Constants.MORE_GROUP_NAME).success + + if match.get_group(Constants.YESTERDAY_GROUP_NAME): + reference = reference - datedelta(days=1) + + er.text = source + pr = self.config.date_parser.parse(er, reference) + duration_extraction_result = self.config.duration_extractor.extract(er.text, reference)[0] + + if duration_extraction_result: + + duration = self.config.duration_parser.parse(duration_extraction_result, reference) + duration_in_seconds = duration.value.past_value + + if is_within: + + if is_ago: + start_date = pr.value.past_value + end_date = start_date + timedelta(seconds=duration_in_seconds) + else: + end_date = pr.value.future_value + start_date = end_date - timedelta(seconds=duration_in_seconds) + + if start_date != DateUtils.min_value(): + duration_timex = duration.value.timex + + ret.timex = TimexUtil.generate_date_period_timex_with_duration( + start_date, end_date, duration_timex + ) + ret.future_value = ret.past_value = [start_date, end_date] + ret.success = True + + return ret + + elif is_more_than: + ret.mod = Constants.BEFORE_MOD if is_ago else Constants.AFTER_MOD + ret.timex = pr.timex_str + ret.future_value = pr.value.future_value + ret.past_value = pr.value.past_value + ret.success = True + + return ret + + ret.success = False + return ret + + def parse_complex_date_period(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = self.config.complex_date_period_regex.match(source) + + if match and match.success: + future_begin = DateUtils.min_value() + future_end = DateUtils.min_value() + past_begin = DateUtils.min_value() + past_end = DateUtils.min_value() + + is_specific_date = False + is_start_by_week = False + is_end_by_week = False + is_ambiguous_start = False + is_ambiguous_end = False + + ambiguous_res = DateTimeResolutionResult() + date_context = self.get_year_context( + match.get_group(TimeTypeConstants.START).value, match.get_group(TimeTypeConstants.END).value, source + ) + + start_resolution = self.parse_single_time_point( + match.get_group(TimeTypeConstants.START).value, reference, date_context + ) + + if start_resolution.success: + future_begin = start_resolution.future_value + past_begin = start_resolution.past_value + is_specific_date = True + + if not start_resolution.success: + start_resolution = self.parse_base_date_period( + match.get_group(TimeTypeConstants.START).value, reference, date_context + ) + + if start_resolution.success: + future_begin = self.shift_resolution(start_resolution.future_value, match, start=True) + past_begin = self.shift_resolution(start_resolution.past_value, match, start=True) + + if "-W" in start_resolution.timex: + is_start_by_week = True + + if start_resolution.success: + end_resolution = self.parse_single_time_point( + match.get_group(TimeTypeConstants.END).value, reference, date_context + ) + + if end_resolution.success: + future_end = end_resolution.future_value + past_end = end_resolution.past_value + is_specific_date = True + + if not end_resolution.success or is_ambiguous_end: + end_resolution = self.parse_base_date_period( + match.get_group(TimeTypeConstants.END).value, reference, date_context + ) + + if end_resolution.success: + # When the end group contains modifiers such as 'end of', 'middle of', the end resolution + # must be updated accordingly. + + future_end = self.shift_resolution(end_resolution.future_value, match, start=False) + past_end = self.shift_resolution(end_resolution.past_value, match, start=False) + + if "-W" in end_resolution.timex: + is_end_by_week = True + + if end_resolution.success: + # When start or end is ambiguous it is better to resolve it to the type of the unambiguous + # extraction. In Spanish, for example, 'de lunes a mar' (from Monday to Tuesday) or + # 'de enero a mar' (from January to March). In the first case 'mar' is resolved as Date (weekday), + # in the second case it is resolved as DatePeriod (month). if (isAmbiguousStart && isSpecificDate) + + if is_ambiguous_start and is_specific_date: + start_resolution = ambiguous_res + future_begin = start_resolution.future_value + past_begin = start_resolution.past_value + + elif is_ambiguous_end and is_specific_date: + end_resolution = ambiguous_res + future_end = end_resolution.future_value + past_end = end_resolution.past_value + + if future_begin > future_end: + if not date_context: + future_begin = past_begin + else: + future_begin = DateContext.swift_date_object(future_begin, future_end) + + if past_end < past_begin: + if not date_context: + past_end = future_end + else: + past_begin = DateContext.swift_date_object(past_begin, past_end) + + # If both begin/end are date ranges in "Month", the Timex should be ByMonth + # The year period case should already be handled in Basic Cases + date_period_timex_type = 2 + + if is_specific_date: + # If at least one of the begin/end is specific date, the Timex should be ByDay + date_period_timex_type = 0 + + elif is_start_by_week and is_end_by_week: + # If both begin/end are date ranges in "Week", the Timex should be ByWeek + date_period_timex_type = 1 + + has_year = not start_resolution.timex.startswith( + Constants.TIMEX_FUZZY_YEAR + ) or not end_resolution.timex.startswith(Constants.TIMEX_FUZZY_YEAR) + + # If the year is not specified, the combined range timex will use fuzzy years. + ret.timex = TimexUtil.generate_date_period_timex( + future_begin, future_end, date_period_timex_type, past_begin, past_end, has_year + ) + ret.future_value = [future_begin, future_end] + ret.past_value = [past_begin, past_end] + ret.success = True + + return ret diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_datetime.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_datetime.py new file mode 100644 index 0000000000..9b62c1581a --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_datetime.py @@ -0,0 +1,645 @@ +from abc import abstractmethod +from collections import namedtuple +from datetime import datetime, timedelta +from typing import Dict, List, Match, Optional, Pattern + +import regex + +from recognizers_date_time.date_time.constants import Constants, TimeTypeConstants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeFormatUtil, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DurationParsingUtil, + ExtractResultExtension, + RegExpUtility, + TimexUtil, + Token, + merge_all_tokens, +) +from recognizers_number.number.constants import Constants as NumConstants +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text import MetaData +from recognizers_text.extractor import Extractor, ExtractResult + + +class CJKDateTimeExtractorConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def now_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def preposition_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def night_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def time_of_special_day_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def time_of_day_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def before_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def after_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def connector_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_point_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_point_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def ambiguity_date_time_filters(self) -> Dict[Pattern, Pattern]: + raise NotImplementedError + + +class BaseCJKDateTimeExtractor(Extractor): + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_DATETIME + + def __init__(self, config: CJKDateTimeExtractorConfiguration): + self.config = config + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + + if reference is None: + reference = datetime.now() + + tokens: List[Token] = list() + + tokens.extend(self.merge_date_and_time(source, reference)) + tokens.extend(self.basic_regex_match(source)) + tokens.extend(self.time_of_today(source, reference)) + # tokens.extend(self.duration_with_ago_and_later(source, reference)) + + result = merge_all_tokens(tokens, source, self.extractor_type_name) + + result = ExtractResultExtension.filter_ambiguity(result, source, self.config.ambiguity_date_time_filters) + + return result + + # match "now" + def basic_regex_match(self, source: str) -> List[Token]: + tokens: List[Token] = list() + # handle "now" + matches: List[Match] = list(regex.finditer(self.config.now_regex, source)) + tokens.extend(map(lambda x: Token(x.start(), x.end()), matches)) + return tokens + + # Merge a Date entity and a Time entity, like "明天早上七点" + def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: + tokens: List[Token] = list() + ers: List[ExtractResult] = self.config.date_point_extractor.extract(source, reference) + + if len(ers) < 1: + return tokens + + ers.extend(self.config.time_point_extractor.extract(source, reference)) + + if len(ers) < 2: + return tokens + + ers = sorted(ers, key=lambda x: x.start) + i = 0 + + while i < len(ers) - 1: + j = i + 1 + + while j < len(ers) and ers[i].overlap(ers[j]): + j += 1 + + if j >= len(ers): + break + + if ers[i].type is Constants.SYS_DATETIME_DATE and ers[j].type is Constants.SYS_DATETIME_TIME: + middle_begin = ers[i].start + ers[i].length + middle_end = ers[j].start + + if middle_begin > middle_end: + break + + middle = source[middle_begin:middle_end].strip().lower() + + if ( + not middle + or RegExpUtility.get_matches(self.config.connector_regex, middle) + or RegExpUtility.get_matches(self.config.preposition_regex, middle) + ): + begin = ers[i].start + end = ers[j].start + ers[j].length + tokens.append(Token(begin, end)) + i = j + 1 + continue + i = j + return tokens + + # Parse a specific time of today, tonight, this afternoon, "今天下午七点" + def time_of_today(self, source: str, reference: datetime) -> List[Token]: + tokens: List[Token] = list() + ers = self.config.time_point_extractor.extract(source, reference) + + for er in ers: + before = source[: er.start] + inner_match = regex.search(self.config.night_regex, er.text) + + if inner_match is not None and inner_match.start() == 0: + before = source[: er.start + len(inner_match.group())] + if not before: + continue + + match = regex.search(self.config.time_of_special_day_regex, before) + if match is not None and not before[match.end() :].strip(): + begin = match.start() + end = er.start + er.length + tokens.append(Token(begin, end)) + + # TimePeriodExtractor cases using TimeOfDayRegex are not processed here + match_time_of_today = regex.search(self.config.time_of_special_day_regex, source) + match_time_of_day = regex.search(self.config.time_of_day_regex, source) + + if match_time_of_today and not match_time_of_day: + tokens.append(Token(match_time_of_today.start(), (match_time_of_today.end()))) + + return tokens + + # Process case like "5分钟前" "二小时后" + def duration_with_ago_and_later(self, source: str, reference: datetime) -> List[Token]: + ret: List[Token] = list() + duration_er = self.config.duration_extractor.extract(source, reference) + + for er in duration_er: + pos = er.start + er.length + if pos < len(source): + suffix = source[pos] + before_match = RegExpUtility.get_matches(self.config.before_regex, suffix) + after_match = RegExpUtility.get_matches(self.config.after_regex, suffix) + + if (before_match and suffix.startswith(before_match[0])) or ( + after_match and suffix.startswith(after_match[0]) + ): + meta_data = MetaData() + meta_data.is_duration_with_ago_and_later = True + ret.append(Token(er.start, pos + 1, meta_data)) + return ret + + +MatchedTimex = namedtuple('MatchedTimex', ['matched', 'timex']) + + +class CJKDateTimeParserConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def duration_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def integer_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def number_parser(self) -> BaseNumberParser: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def now_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def lunar_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def lunar_holiday_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def simple_pm_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def simple_am_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def time_of_special_day_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def datetime_period_unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def duration_relative_duration_unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def ago_later_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def before_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def after_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def unit_map(self) -> Dict[str, str]: + raise NotImplementedError + + @abstractmethod + def get_matched_now_timex(self, source: str) -> MatchedTimex: + raise NotImplementedError + + @abstractmethod + def get_swift_day(self, source: str) -> int: + raise NotImplementedError + + @abstractmethod + def adjust_by_time_of_day(self, source: str, hour: int, swift: int) -> None: + raise NotImplementedError + + +class BaseCJKDateTimeParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_DATETIME + + def __init__(self, config: CJKDateTimeParserConfiguration): + self.config = config + + def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: + if reference is None: + reference = datetime.now() + + result = DateTimeParseResult(source) + + if source.type is self.parser_type_name: + source_text = source.text.lower() + inner_result = self.merge_date_and_time(source_text, reference) + + if not inner_result.success: + inner_result = self.parse_basic_regex(source_text, reference) + + if not inner_result.success: + inner_result = self.parse_time_of_special_day_regex(source_text, reference) + + # if not inner_result.success: + # inner_result = self.parser_duration_with_ago_and_later(source_text, reference) + + if inner_result.success: + inner_result.future_resolution[TimeTypeConstants.DATETIME] = DateTimeFormatUtil.format_date_time( + inner_result.future_value + ) + inner_result.past_resolution[TimeTypeConstants.DATETIME] = DateTimeFormatUtil.format_date_time( + inner_result.past_value + ) + + inner_result.is_lunar = self.is_lunar_calendar(source_text) + + result.value = inner_result + result.timex_str = inner_result.timex if inner_result else '' + result.resolution_str = '' + + return result + + def filter_results(self, query: str, candidate_results: List[DateTimeParseResult]): + return candidate_results + + def parse_basic_regex(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + source = source.strip().lower() + + # handle "现在" + match = regex.search(self.config.now_regex, source) + if match and match.start() == 0 and match.group() == source: + matched_now_timex = self.config.get_matched_now_timex(source) + result.timex = matched_now_timex.timex + result.future_value = reference + result.past_value = reference + result.success = matched_now_timex.matched + return result + + # parse if lunar contains + def is_lunar_calendar(self, source: str): + source = source.strip().lower() + match = regex.match(self.config.lunar_regex, source) + if match: + return True + match = regex.match(self.config.lunar_holiday_regex, source) + if match: + return True + return False + + # merge a Date entity and a Time entity + def merge_date_and_time(self, source: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match_ago_later = regex.search(self.config.ago_later_regex, source) + if match_ago_later: + return ret + + er1 = self.config.date_extractor.extract(source, reference) + if not er1: + return ret + + er2 = self.config.time_extractor.extract(source, reference) + if not er2: + return ret + + pr1 = self.config.date_parser.parse(er1[0], reference) + pr2 = self.config.time_parser.parse(er2[0], reference) + if pr1.value is None or pr2.value is None: + return ret + + future_date = pr1.value.future_value + past_date = pr1.value.past_value + time = pr2.value.future_value + + # handle cases with time like 25時 which resolve to the next day + timex_hour = TimexUtil.parse_hour_from_time_timex(pr2.timex_str) + if timex_hour > Constants.DAY_HOUR_COUNT: + future_date.day += timedelta(days=1) + past_date.day += timedelta(days=1) + + hour = time.hour + minute = time.minute + second = time.second + + # handle morning, afternoon + if self.config.simple_pm_regex.search(source) and hour < Constants.HALF_DAY_HOUR_COUNT: + hour += Constants.HALF_DAY_HOUR_COUNT + elif self.config.simple_am_regex.search(source) and hour >= Constants.HALF_DAY_HOUR_COUNT: + hour -= Constants.HALF_DAY_HOUR_COUNT + + time_str = pr2.timex_str + if time_str.endswith(Constants.COMMENT_AMPM): + time_str = time_str[0 : len(time_str) - 4] + + ret.timex = pr1.timex_str + time_str + + val = pr2.value + if ( + hour <= Constants.HALF_DAY_HOUR_COUNT + and not self.config.simple_pm_regex.search(source) + and not self.config.simple_am_regex.search(source) + and val.comment + ): + ret.comment = Constants.COMMENT_AMPM + + ret.future_value = datetime(future_date.year, future_date.month, future_date.day, hour, minute, second) + ret.past_value = datetime(past_date.year, past_date.month, past_date.day, hour, minute, second) + ret.success = True + + return ret + + def parse_time_of_special_day_regex(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + ers = self.config.time_extractor.extract(source, reference) + + # Handle 'eod', 'end of day' + eod = regex.search(self.config.time_of_special_day_regex, source) + match_ago_and_later = regex.search(self.config.ago_later_regex, source) + if match_ago_and_later: + duration_res = self.config.duration_extractor.extract(source, reference) + if duration_res: + pr1 = self.config.duration_parser.parse(duration_res[0], reference) + is_future = False + if RegExpUtility.get_group(match_ago_and_later, Constants.LATER_GROUP_NAME): + is_future = True + timex = pr1.timex_str + + # handle less and more mode + if RegExpUtility.get_group(eod, Constants.LESS_GROUP_NAME): + result.mod = Constants.LESS_THAN_MOD + elif RegExpUtility.get_group(eod, Constants.MORE_GROUP_NAME): + result.mod = Constants.MORE_THAN_MOD + + result_datetime = DurationParsingUtil.shift_date_time(timex, reference, future=is_future) + result.timex = TimexUtil.generate_date_time_timex(result_datetime) + result.future_value = result.past_value = result_datetime + result.sub_date_time_entities = [pr1] + + result.success = True + return result + + if RegExpUtility.get_group(eod, Constants.SPECIFIC_END_OF_GROUP_NAME) and len(ers) == 0: + result = self.parse_special_time_of_date(source, reference) + return result + + if eod and len(ers) != 1: + if RegExpUtility.get_group(eod, Constants.TOMORROW_GROUP_NAME): + tomorrow_date = reference + timedelta(days=1) + result = DateTimeFormatUtil.resolve_end_of_day( + DateTimeFormatUtil.format_date(tomorrow_date), tomorrow_date, tomorrow_date + ) + else: + result = DateTimeFormatUtil.resolve_end_of_day( + DateTimeFormatUtil.format_date(reference), reference, reference + ) + return result + + if len(ers) != 1: + return result + + pr = self.config.time_parser.parse(ers[0], reference) + if not pr.value: + return result + + time = pr.value.future_value + + hour = time.hour + min = time.minute + sec = time.second + + match = regex.search(self.config.time_of_special_day_regex, source) + if match: + swift = 0 + self.config.adjust_by_time_of_day(match.group(0), hour, swift) + date = reference + timedelta(days=swift) + + # in this situation, luisStr cannot end up with "ampm", because we always have a "morning" or "night" + time_str = pr.timex_str + if time_str.endswith(Constants.COMMENT_AMPM): + time_str = time_str[0:-4] + + # handle less and more mode + if RegExpUtility.get_group(match, Constants.LESS_GROUP_NAME): + result.mod = Constants.LESS_THAN_MOD + elif RegExpUtility.get_group(match, Constants.MORE_GROUP_NAME): + result.mod = Constants.MORE_THAN_MOD + + time_str = Constants.TIME_TIMEX_PREFIX + DateTimeFormatUtil.to_str(hour, 2) + time_str[3:] + result.timex = DateTimeFormatUtil.format_date(date) + time_str + result.future_value = datetime(date.year, date.month, date.day, hour, min, sec) + result.past_value = result.future_value + result.success = True + return result + return result + + def parse_special_time_of_date(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + ers = self.config.date_extractor.extract(source, reference) + + if len(ers) != 1: + return result + + parse_result = self.config.date_parser.parse(ers[0], reference) + future_date = parse_result.value.future_value + past_date = parse_result.value.past_value + + result = DateTimeFormatUtil.resolve_end_of_day(parse_result.timex_str, future_date, past_date) + return result + + # handle cases like "5分钟前", "1小时以后" + def parser_duration_with_ago_and_later(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + duration_result = self.config.duration_extractor.extract(source, reference) + + if len(duration_result) > 0: + match_ago_later = regex.search(self.config.ago_later_regex, source) + + if match_ago_later: + parse_result = self.config.duration_parser.parse(duration_result[0], reference) + is_future = False + if RegExpUtility.get_group(match_ago_later, Constants.LATER_GROUP_NAME): + is_future = True + timex = parse_result.timex_str + + result_date_time = DurationParsingUtil.shift_date_time(timex, reference, future=is_future) + result.timex = TimexUtil.generate_date_time_timex(result_date_time) + result.future_value = result_date_time + result.past_value = result_date_time + result.sub_date_time_entities = [parse_result] + + result.success = True + + return result + + match = regex.match(self.config.datetime_period_unit_regex, source) + if match: + suffix = source[duration_result[0].start : match.start() + duration_result[0].length].strip() + src_unit = RegExpUtility.get_group(match, Constants.UNIT_GROUP_NAME) + + number_str = source[duration_result[0].start : match.start() - duration_result[0].start].strip() + number = self.convert_CJK_to_num(number_str) + + if src_unit in self.config.unit_map: + unit_str = self.config.unit_map[src_unit] + before_match = regex.search(self.config.before_regex, suffix) + if before_match and suffix.startswith(before_match.group()): + if unit_str == Constants.TIMEX_HOUR: + date = reference + timedelta(hours=-number) + elif unit_str == Constants.TIMEX_MINUTE: + date = reference + timedelta(minutes=-number) + elif unit_str == Constants.TIMEX_SECOND: + date = reference + timedelta(seconds=-number) + else: + return result + + result.timex = DateTimeFormatUtil.luis_date_from_datetime(date) + result.future_value = result.past_value = date + result.success = True + return result + + after_match = regex.search(self.config.after_regex, source) + if after_match and suffix.startswith(after_match.group()): + if unit_str == Constants.TIMEX_HOUR: + date = reference + timedelta(hours=number) + elif unit_str == Constants.TIMEX_MINUTE: + date = reference + timedelta(minutes=number) + elif unit_str == Constants.TIMEX_SECOND: + date = reference + timedelta(seconds=number) + else: + return result + + result.timex = DateTimeFormatUtil.luis_date_from_datetime(date) + result.future_value = result.past_value = date + result.success = True + return result + return result + + def convert_CJK_to_num(self, num_str: str) -> int: + num = -1 + er: ExtractResult = next(iter(self.config.integer_extractor.extract(num_str)), None) + if er and er.type == NumConstants.SYS_NUM_INTEGER: + try: + num = int(self.config.number_parser.parse(er).value) + except ValueError: + num = 0 + return num diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_datetimeperiod.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_datetimeperiod.py new file mode 100644 index 0000000000..f22e4329a6 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_datetimeperiod.py @@ -0,0 +1,1286 @@ +from abc import abstractmethod +from collections import namedtuple +from datetime import datetime, timedelta +from typing import Dict, List, Match, Pattern + +import regex + +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities import ( + DateTimeFormatUtil, + DateTimeOptionsConfiguration, + DateTimeParseResult, + DateTimeResolutionResult, + DateUtils, + ExtractResultExtension, + RegExpUtility, + TimeTypeConstants, + TimexUtil, + Token, + merge_all_tokens, +) +from recognizers_text.extractor import Extractor, ExtractResult +from recognizers_text.parser import Parser + + +MatchedIndex = namedtuple('MatchedIndex', ['matched', 'index']) +MatchedTimeRegex = namedtuple('MatchedTimeRegex', ['matched', 'timex', 'begin_hour', 'end_hour', 'end_min']) +MatchedTimeRegexAndSwift = namedtuple( + 'MatchedTimeRegex', ['matched', 'timex', 'begin_hour', 'end_hour', 'end_min', 'swift'] +) +BeginEnd = namedtuple('BeginEnd', ['begin', 'end']) + + +class CJKDateTimePeriodExtractorConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def preposition_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def till_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def specific_time_of_day_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def time_of_day_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def followed_unit(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def past_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def future_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def time_period_left_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def relative_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def rest_of_date_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def am_pm_desc_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def this_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def before_after_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def cardinal_extractor(self) -> Extractor: + raise NotImplementedError + + @property + @abstractmethod + def single_date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def single_time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def single_date_time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @abstractmethod + def get_from_token_index(self, text: str) -> MatchedIndex: + raise NotImplementedError + + @abstractmethod + def has_connector_token(self, text: str) -> bool: + raise NotImplementedError + + @abstractmethod + def get_between_token_index(self, text: str) -> MatchedIndex: + raise NotImplementedError + + +class BaseCJKDateTimePeriodExtractor(DateTimeExtractor): + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_DATETIME + + def __init__(self, config: CJKDateTimePeriodExtractorConfiguration): + self.config = config + + def extract(self, text: str, reference_time: datetime = None) -> List[ExtractResult]: + if reference_time is None: + reference_time = datetime.now() + # Date and time Extractions should be extracted from the text only once, + # and shared in the methods below, passed by value + + date_ers = self.config.single_date_extractor.extract(text, reference_time) + time_ers = self.config.single_time_extractor.extract(text, reference_time) + time_range_ers = self.config.time_period_extractor.extract(text, reference_time) + date_time_ers = self.config.single_date_time_extractor.extract(text, reference_time) + + tokens: List[Token] = list() + + tokens.extend(self.merge_date_and_time_period(text, date_ers, time_range_ers)) + tokens.extend(self.merge_two_time_points(text, date_time_ers, time_ers)) + tokens.extend(self.match_duration(text, reference_time)) + tokens.extend(self.match_relative_unit(text)) + tokens.extend(self.match_date_with_period_suffix(text, date_ers)) + tokens.extend(self.match_number_with_unit(text)) + tokens.extend(self.match_night(text, reference_time)) + tokens.extend(self.merge_date_with_time_period_suffix(text, date_ers, time_ers)) + + return merge_all_tokens(tokens, text, self.extractor_type_name) + + # merge Date and Time period + def merge_date_and_time_period( + self, text: str, data_ers: List[ExtractResult], time_range_ers: List[ExtractResult] + ) -> List[Token]: + ret: List[Token] = list() + time_points: List[ExtractResult] = list() + + # handle the overlap problem + j = 0 + for data_er in data_ers: + time_points.append(data_er) + while j < len(time_range_ers) and time_range_ers[j].start + time_range_ers[j].length <= data_er.start: + time_points.append(time_range_ers[j]) + j += 1 + + while j < len(time_range_ers) and ExtractResultExtension.is_overlap(time_range_ers[j], data_er): + j += 1 + + while j < len(time_range_ers): + time_points.append(time_range_ers[j]) + j += 1 + + time_points = list(sorted(time_points, key=lambda x: x.start)) + + # merge {Date} {TimePeriod} + idx = 0 + while idx < len(time_points) - 1: + if ( + time_points[idx].type == Constants.SYS_DATETIME_DATE + and time_points[idx + 1].type == Constants.SYS_DATETIME_TIMEPERIOD + ): + middle_begin = time_points[idx].start + time_points[idx].length + middle_end = time_points[idx + 1].start + + middle_str = text[middle_begin : middle_end - middle_begin].strip() + preposition_regex_match = regex.match(self.config.preposition_regex, middle_str) + if middle_str or preposition_regex_match: + period_begin = time_points[idx].start + period_end = time_points[idx + 1].start + time_points[idx + 1].length + ret.append(Token(period_begin, period_end)) + idx += 2 + continue + idx += 1 + idx += 1 + return ret + + def merge_two_time_points( + self, text: str, date_time_ers: List[ExtractResult], time_ers: List[ExtractResult] + ) -> List[Token]: + + ret: List[Token] = list() + time_points: List[ExtractResult] = list() + + # handle the overlap problem + j = 0 + for date_time_er in date_time_ers: + time_points.append(date_time_er) + while j < len(time_ers) and time_ers[j].start + time_ers[j].length <= date_time_er.start: + time_points.append(time_ers[j]) + j += 1 + while j < len(time_ers) and ExtractResultExtension.is_overlap(time_ers[j], date_time_er): + j += 1 + + while j < len(time_ers): + time_points.append(time_ers[j]) + j += 1 + + time_points = list(sorted(time_points, key=lambda x: x.start)) + + # merge "{TimePoint} to {TimePoint}", "between {TimePoint} and {TimePoint}" + idx = 0 + while idx < len(time_points) - 1: + # if both ends are Time. then this is a TimePeriod, not a DateTimePeriod + if ( + time_points[idx].type == Constants.SYS_DATETIME_TIME + and time_points[idx + 1].type == Constants.SYS_DATETIME_TIME + ): + idx += 1 + continue + + middle_begin = time_points[idx].start + time_points[idx].length + middle_end = time_points[idx + 1].start + + middle_str = text[middle_begin : middle_end - middle_begin].strip() + + # handle "{TimePoint} to {TimePoint}" + if RegExpUtility.is_exact_match(self.config.till_regex, middle_str, True): + period_begin = time_points[idx].start + period_end = time_points[idx + 1].start + time_points[idx + 1].length + + # handle "from" + before_str = time_points[0:period_begin] + match_from = self.config.get_from_token_index(before_str) + from_token_index = match_from if match_from.matched else self.config.get_between_token_index(before_str) + + if from_token_index.matched: + period_begin = from_token_index.index + else: + after_str = text[period_end:] + after_token_index = self.config.get_from_token_index(after_str) + if after_token_index.matched: + period_end += after_token_index.index + + ret.append(Token(period_begin, period_end)) + idx += 2 + continue + + # handle "between {TimePoint} and {TimePoint}" + if self.config.has_connector_token(middle_str): + period_begin = time_points[idx].start + period_end = time_points[idx + 1].start + time_points[idx + 1].length + + # handle "between" + after_str = text[period_end:] + after_token_between_index = self.config.get_between_token_index(after_str) + if after_token_between_index.matched: + ret.append(Token(period_begin, period_end + after_token_between_index.index)) + idx += 2 + continue + + idx += 1 + + return ret + + def match_night(self, text: str, reference_time: datetime) -> List[Token]: + ret: List[Token] = list() + + matches = regex.finditer(self.config.specific_time_of_day_regex, text) + ret.extend(map(lambda x: Token(x.start(), x.end()), matches)) + + # Date followed by morning, afternoon + ers = self.config.single_date_extractor.extract(text, reference_time) + if len(ers) == 0: + return ret + + for er in ers: + if er.start + er.length > len(text): + after_str = text[er.start + er.length] + else: + after_str = text[0] + match = regex.match(self.config.time_of_day_regex, after_str) + if match: + middle_str = after_str[0 : match.start()] + if not middle_str.strip() or regex.search(self.config.preposition_regex, middle_str): + ret.append(Token(er.start, er.start + er.length + match.start() + match.end())) + return ret + + # Cases like "2015年1月1日の2時以降", "On January 1, 2015 after 2:00" + def merge_date_with_time_period_suffix( + self, text: str, date_ers: List[ExtractResult], time_ers: List[ExtractResult] + ) -> List[Token]: + ret: List[Token] = list() + + if not any(date_ers): + return ret + if not any(time_ers): + return ret + + ers: [Match] = date_ers + ers.extend(time_ers) + + ers = sorted(ers, key=lambda x: x.start) + + i = 0 + while i < len(ers) - 1: + j = i + 1 + while j < len(ers) and ExtractResultExtension.is_overlap(ers[i], ers[j]): + j += 1 + if j >= len(ers): + break + + if ers[i].type == Constants.SYS_DATETIME_DATE and ers[j].type == Constants.SYS_DATETIME_TIME: + middle_begin = ers[i].start + (ers[i].length or 0) + middle_end = ers[j].start or 0 + + if middle_begin > middle_end: + i = j + 1 + continue + + middle_str = text[middle_begin : middle_end - middle_begin].strip() + + match = regex.match(self.config.before_after_regex, middle_str) + if match: + begin = ers[i].start or 0 + end = (ers[j].start or 0) + (ers[j].length or 0) + ret.append(Token(begin, end)) + + i = j + 1 + continue + i = j + return ret + + # Extract patterns that involve durations e.g. "Within 5 hours from now" + def match_duration(self, text: str, reference: datetime) -> List[Token]: + ret: List[Token] = list() + duration_extractions: List[ExtractResult] = self.config.duration_extractor.extract(text, reference) + + for duration_extraction in duration_extractions: + if not regex.search(self.config.unit_regex, duration_extraction.text): + continue + duration = Token( + duration_extraction.start or 0, (duration_extraction.start + duration_extraction.length or 0) + ) + before_str = text[0 : duration.start] + after_str = text[duration.start + duration.length :].strip() + + if not before_str and not after_str: + continue + + start_out = -1 + end_out = -1 + match = regex.match(self.config.future_regex, after_str) + + in_prefix_match = regex.match(self.config.this_regex, before_str) + in_prefix = True if in_prefix_match else False + + if RegExpUtility.get_group(match, Constants.WITHIN_GROUP_NAME): + start_token = in_prefix_match.start() if in_prefix else duration.start + within_length = len(RegExpUtility.get_group(match, Constants.WITHIN_GROUP_NAME)) + end_token = duration.end + (0 if in_prefix else match.start() + match.end()) + + match = regex.match(self.config.unit_regex, text[duration.start : duration.length]) + + if match: + start_out = start_token + end_out = end_token + within_length if in_prefix else end_token + + ret.append(Token(start_out, end_out)) + + return ret + + def match_relative_unit(self, text: str) -> List[Token]: + ret: List[Token] = list() + matches = list(regex.finditer(self.config.rest_of_date_regex, text)) + ret.extend(map(lambda x: Token(x.start(), x.start() + x.end()), matches)) + return ret + + # For cases like "Early in the day Wednesday" + def match_date_with_period_suffix(self, text: str, date_ers: List[ExtractResult]) -> List[Token]: + ret: List[Token] = list() + + for date_er in date_ers: + date_str_end = int(date_er.start + date_er.length) + after_str = text[date_str_end : len(text) - date_str_end] + match_after = RegExpUtility.match_begin(self.config.time_period_left_regex, after_str, True) + if match_after: + ret.append(Token(int(date_er.start), date_str_end + match_after.index + match_after.length)) + + return ret + + def match_number_with_unit(self, text: str) -> List[Token]: + ret: List[Token] = list() + durations: List[Token] = list() + + ers = self.config.cardinal_extractor.extract(text) + + for er in ers: + after_str = text[(er.start + er.length) or 0 :] + followed_unit_match = RegExpUtility.match_begin(self.config.followed_unit, after_str, True) + + if followed_unit_match: + durations.append(Token(er.start or 0, (er.start + er.length) or 0 + len(followed_unit_match.group()))) + + past_regex_match = RegExpUtility.match_begin(self.config.past_regex, after_str, True) + if past_regex_match: + durations.append(Token(er.start or 0, (er.start + er.length) or 0 + len(past_regex_match.group()))) + + for match in RegExpUtility.get_matches(self.config.unit_regex, text): + durations.append(Token(text.index(match), len(match))) + + for duration in durations: + before_str = text[0 : duration.start] + if not before_str.strip(): + continue + + past_regex_match = RegExpUtility.match_end(self.config.past_regex, before_str, True) + if past_regex_match: + ret.append(Token(past_regex_match.index, duration.end)) + continue + + future_regex_match = RegExpUtility.match_end(self.config.future_regex, before_str, True) + if future_regex_match: + ret.append(Token(future_regex_match.index, duration.end)) + + time_period_left_regex_match = RegExpUtility.match_end(self.config.time_period_left_regex, before_str, True) + if time_period_left_regex_match: + ret.append(Token(time_period_left_regex_match.index, duration.end)) + + return ret + + +class CJKDateTimePeriodParserConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def cardinal_extractor(self) -> Extractor: + raise NotImplementedError + + @property + @abstractmethod + def cardinal_parser(self) -> Parser: + raise NotImplementedError + + @property + @abstractmethod + def date_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def time_period_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def specific_time_of_day_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def time_of_day_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def next_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def last_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def past_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def future_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def weekday_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def time_period_left_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def unit_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def rest_of_date_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def am_pm_desc_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def unit_map(self) -> Dict[str, str]: + raise NotImplementedError + + @abstractmethod + def get_matched_time_range(self, text: str) -> MatchedTimeRegex: + raise NotImplementedError + + @abstractmethod + def get_matched_time_range_and_swift(self, text: str) -> MatchedTimeRegexAndSwift: + raise NotImplementedError + + +class BaseCJKDateTimePeriodParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_DATETIME + + def __init__(self, config: CJKDateTimePeriodParserConfiguration): + self.config = config + + def parse(self, source: ExtractResult, reference: datetime = None) -> DateTimeParseResult: + reference_time = reference if reference is not None else datetime.now() + value = None + + if source.type == self.parser_type_name: + inner_result = self.merge_date_and_time_period(source.text, reference_time) + + if not inner_result.success: + inner_result = self.merge_two_time_points(source.text, reference_time) + + if not inner_result.success: + inner_result = self.parse_duration(source.text, reference_time) + + if not inner_result.success: + inner_result = self.parse_specific_night(source.text, reference_time) + + if not inner_result.success: + inner_result = self.parse_number_with_unit(source.text, reference_time) + + if not inner_result.success: + inner_result = self.parse_relative_unit(source.text, reference_time) + + if not inner_result.success: + inner_result = self.parse_date_with_period_suffix(source.text, reference_time) + + if not inner_result.success: + inner_result = self.parse_date_with_time_period_suffix(source.text, reference_time) + + if inner_result.success: + if inner_result.mod == Constants.BEFORE_MOD: + # Cases like "last tuesday by 2:00 pm" there is no StartTime + inner_result.future_resolution = { + TimeTypeConstants.END_DATETIME: DateTimeFormatUtil.format_date_time( + datetime(inner_result.future_value) + ) + } + inner_result.past_resolution = { + TimeTypeConstants.END_DATETIME: DateTimeFormatUtil.format_date_time( + datetime(inner_result.past_value) + ) + } + else: + inner_result.future_resolution = { + TimeTypeConstants.START_DATETIME: DateTimeFormatUtil.format_date_time( + inner_result.future_value[0] + ), + TimeTypeConstants.END_DATETIME: DateTimeFormatUtil.format_date_time( + inner_result.future_value[1] + ), + } + + inner_result.past_resolution = { + TimeTypeConstants.START_DATETIME: DateTimeFormatUtil.format_date_time( + inner_result.past_value[0] + ), + TimeTypeConstants.END_DATETIME: DateTimeFormatUtil.format_date_time(inner_result.past_value[1]), + } + + value = inner_result + + ret = DateTimeParseResult() + ret.text = source.text + ret.start = source.start + ret.length = source.length + ret.type = source.type + ret.date = source.data + ret.value = value + ret.timex_str = '' if not value else value.timex + ret.resolution_str = '' + return ret + + def filter_result(self, query: str, candidare_results: List[DateTimeParseResult]) -> List[DateTimeParseResult]: + return candidare_results + + def merge_date_and_time_period(self, text: str, reference_time: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + + er1 = self.config.date_extractor.extract(text, reference_time) + er2 = self.config.time_period_extractor.extract(text, reference_time) + + if len(er1) != 1 or len(er2) != 1: + return ret + + pr1 = self.config.date_parser.parse(er1[0], reference_time) + pr2 = self.config.time_period_parser.parse(er2[0], reference_time) + time_range = tuple(pr2.value.future_value) + begin_time = time_range[0] + end_time = time_range[1] + future_date = pr1.value.future_value + past_date = pr1.value.past_value + + # handle cases with time like 25時 which resolve to the next day + swift_day = 0 + timex_hours = TimexUtil.parse_hours_from_time_period_timex(pr2.timex_str) + ampm_desc_regex_match = regex.match(self.config.am_pm_desc_regex, text) + + if ( + ampm_desc_regex_match + and timex_hours[0] < Constants.HALF_DAY_HOUR_COUNT + and timex_hours[1] < Constants.HALF_DAY_HOUR_COUNT + ): + ret.comment = Constants.COMMENT_AMPM + + if timex_hours[0] > Constants.DAY_HOUR_COUNT: + past_date = past_date + timedelta(days=1) + future_date = future_date + timedelta(days=1) + elif timex_hours[1] > Constants.DAY_HOUR_COUNT: + swift_day += 1 + + past_date_alt = past_date + timedelta(days=swift_day) + future_date_alt = future_date + timedelta(days=swift_day) + + ret.future_value = ( + DateUtils.safe_create_from_min_value( + future_date.year, + future_date.month, + future_date.day, + begin_time.hour, + begin_time.minute, + begin_time.second, + ), + DateUtils.safe_create_from_min_value( + future_date_alt.year, + future_date_alt.month, + future_date_alt.day, + end_time.hour, + end_time.minute, + end_time.second, + ), + ) + + ret.past_value = ( + DateUtils.safe_create_from_min_value( + past_date.year, past_date.month, past_date.day, begin_time.hour, begin_time.minute, begin_time.second + ), + DateUtils.safe_create_from_min_value( + past_date_alt.year, + past_date_alt.month, + past_date_alt.day, + end_time.hour, + end_time.minute, + end_time.second, + ), + ) + + ret.timex = TimexUtil.generate_split_date_time_period_timex(pr1.timex_str, pr2.timex_str) + ret.success = True if ret.timex else False + + return ret + + # Cases like "last tuesday by 2:00pm" + def parse_date_with_time_period_suffix(self, text: str, reference_time: datetime): + ret = DateTimeResolutionResult() + + date_er = self.config.date_extractor.extract(text, reference_time) + time_er = self.config.time_extractor.extract(text, reference_time) + + if len(date_er) > 0 and len(time_er) > 0: + match = RegExpUtility.match_end(self.config.past_regex, text, True) + + if RegExpUtility.get_group(match, Constants.BEFORE_MOD): + ret.mod = Constants.BEFORE_MOD + + date_pr = self.config.date_parser.parse(date_er[0], reference_time) + time_pr = self.config.time_parser.parse(time_er[0], reference_time) + + if date_pr and time_pr: + time_resolution_result = time_pr.value + date_resolution_result = date_pr.value + future_date_value = date_resolution_result.future_value + past_date_value = date_resolution_result.past_value + future_time_value = time_resolution_result.future_value + past_time_value: datetime = time_resolution_result.past_value + + ret.comment = time_resolution_result.comment + ret.timex = TimexUtil.combine_date_and_time_timex(date_pr.timex_str, time_pr.timex_str) + + ret.future_value = DateUtils.safe_create_from_value( + future_date_value.year, + future_date_value.month, + future_date_value.day, + future_date_value.hour, + future_date_value.minute, + future_date_value.second, + ) + ret.past_value = DateUtils.safe_create_from_value( + past_date_value.year, + past_date_value.month, + past_date_value.day, + past_date_value.hour, + past_date_value.minute, + past_date_value.second, + ) + + ret.sub_date_time_entities = [date_pr, time_pr] + ret.success = True + + return ret + + def merge_two_time_points(self, text: str, reference_time: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + pr1: DateTimeParseResult = None + pr2: DateTimeParseResult = None + + both_have_dates: bool = False + begin_has_date: bool = False + end_has_date: bool = False + + er1 = self.config.time_extractor.extract(text, reference_time) + er2 = self.config.date_time_extractor.extract(text, reference_time) + + right_time = DateUtils.safe_create_from_value( + DateUtils.min_value, reference_time.year, reference_time.month, reference_time.day + ) + left_time = DateUtils.safe_create_from_value( + DateUtils.min_value, reference_time.year, reference_time.month, reference_time.day + ) + + match = regex.match(self.config.future_regex, text) + + # cases including 'within' are processed in ParseDuration + if RegExpUtility.get_group(match, Constants.WITHIN_GROUP_NAME): + return self.parse_duration(text, reference_time) + + match_weekday = regex.match(self.config.weekday_regex, text) + + if match_weekday: + return ret + + if len(er2) == 2: + pr1 = self.config.date_time_parser.parse(er2[0], reference_time) + pr2 = self.config.date_time_parser.parse(er2[1], reference_time) + both_have_dates = True + + elif len(er2) == 1 and len(er1) == 2: + if not ExtractResultExtension.is_overlap(er2[0], er1[1]): + pr1 = self.config.time_parser.parse(er1[0], reference_time) + pr2 = self.config.date_time_parser.parse(er2[0], reference_time) + end_has_date = True + else: + pr1 = self.config.date_time_parser.parse(er2[0], reference_time) + pr2 = self.config.time_parser.parse(er1[0], reference_time) + begin_has_date = True + + elif len(er2) == 1 and len(er1) == 1: + if er1[0].start < er2[0].start: + pr1 = self.config.time_parser.parse(er1[0], reference_time) + pr2 = self.config.date_time_parser.parse(er2[0], reference_time) + end_has_date = True + else: + pr1 = self.config.date_time_parser.parse(er2[0], reference_time) + pr2 = self.config.time_parser.parse(er1[0], reference_time) + begin_has_date = True + + elif len(er1) == 2: + # if both ends are Time. then this is a TimePeriod, not a DateTimePeriod + return ret + + else: + return ret + + if not pr1.value or not pr2.value: + return ret + + future_begin: datetime = pr1.value.future_value + future_end: datetime = pr2.value.future_value + + past_begin = pr1.value.past_value + + if future_begin > future_end: + future_begin = past_begin + + if both_have_dates: + right_time = DateUtils.safe_create_from_value( + DateUtils.min_value, future_end.year, future_end.month, future_end.day + ) + left_time = DateUtils.safe_create_from_value( + DateUtils.min_value, future_begin.year, future_begin.month, future_begin.day + ) + elif begin_has_date: + left_time = DateUtils.safe_create_from_value( + DateUtils.min_value, future_begin.year, future_begin.month, future_begin.day + ) + elif end_has_date: + right_time = DateUtils.safe_create_from_value( + DateUtils.min_value, future_end.year, future_end.month, future_end.day + ) + left_result: DateTimeResolutionResult = pr1.value + right_result: DateTimeResolutionResult = pr2.value + left_result_time: datetime = left_result.future_value + right_result_time: datetime = right_result.future_value + + # check if the right time is smaller than the left time, if yes, add one day + hour = left_result_time.hour if left_result_time.hour > 0 else 0 + minute = left_result_time.minute if left_result_time.minute > 0 else 0 + second = left_result_time.second if left_result_time.second > 0 else 0 + + left_time = left_time + timedelta(hours=hour, minutes=minute, seconds=second) + + hour = right_result_time.hour if right_result_time.hour > 0 else 0 + minute = right_result_time.minute if right_result_time.minute > 0 else 0 + second = right_result_time.second if right_result_time.second > 0 else 0 + + right_time = right_time + timedelta(hours=hour, minutes=minute, seconds=second) + + # the right side time contains "ampm", while the left side doesn't + if right_result.comment == Constants.COMMENT_AMPM and not left_result.comment and right_time < left_time: + right_time = right_time + timedelta(days=Constants.HALF_DAY_HOUR_COUNT) + + if right_time < left_time: + right_time = right_time + timedelta(days=1) + + ret.future_value = ret.past_value = (left_time, right_time) + + left_timex = pr1.timex_str + right_timex = pr2.timex_str + + if begin_has_date: + right_timex = DateTimeFormatUtil.luis_date_short_time(right_time, pr2.timex_str) + elif end_has_date: + left_timex = DateTimeFormatUtil.luis_date_short_time(left_time, pr1.timex_str) + + ret.timex = TimexUtil.generate_date_time_period_timex(left_timex, right_timex, right_time - left_time) + ret.success = True + return ret + + def parse_duration(self, text: str, reference_time: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + ers = self.config.duration_extractor.extract(text, reference_time) + + if len(ers) == 1: + pr = self.config.duration_parser.parse(ers[0]) + after_str = text[pr.start + pr.legth :].strip() + + if pr.value: + swift_seconds = 0 + mod = '' + duration_result: DateTimeResolutionResult = pr.value + + if type(duration_result.past_value) == float and type(duration_result.future_value) == float: + swift_seconds += int(duration_result.future_value) + + begin_time: datetime = None + end_time = begin_time = reference_time + match = regex.match(self.config.future_regex, after_str) + + if RegExpUtility.get_group(match, Constants.WITHIN_GROUP_NAME): + end_time = begin_time + timedelta(seconds=swift_seconds) + ret.timex = TimexUtil.generate_date_time_period_timex(begin_time, end_time, duration_result.timex) + + ret.future_value = ret.past_value = (begin_time, end_time) + ret.success = True + + if mod: + pr.value.Mod = mod + + ret.sub_date_time_entities = [pr] + return ret + + return ret + + # Parse cases like "this night" + def parse_specific_night(self, text: str, reference_time: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + trimmed_text = text.strip() + begin_hour = end_hour = end_min = 0 + time_str: str = "" + + # Handle 昨晚 (last night),今晨 (this morning) + if RegExpUtility.is_exact_match(self.config.specific_time_of_day_regex, trimmed_text, True): + # handle the ambiguous case "ぎりぎり" [the latest possible time] + latest = regex.match(self.config.specific_time_of_day_regex, text) + + if RegExpUtility.get_group(latest, Constants.LATER_GROUP_NAME): + begin_date: datetime = reference_time + timedelta(minutes=-1) + end_date: datetime = reference_time + + diff = end_date - begin_date + + ret.timex = TimexUtil.generate_date_time_period_timex(begin_date, end_date) + ret.future_value = ret.past_value = (begin_date, end_date) + ret.success = True + return ret + + if not self.config.get_matched_time_range_and_swift(trimmed_text): + return ret + + night_regex_match = regex.match(self.config.next_regex, trimmed_text) + last_regex_match = regex.match(self.config.last_regex, trimmed_text) + swift = 0 + if night_regex_match: + swift = 1 + elif last_regex_match: + swift = -1 + + date = datetime.date(reference_time + timedelta(days=swift)) + day = date.day + month = date.month + year = date.year + + ret.timex = DateTimeFormatUtil.format_date(date) + time_str + ret.future_value = ret.past_value = ( + DateUtils.safe_create_from_value(year, month, day, begin_hour, 0, 0), + DateUtils.safe_create_from_value(year, month, day, end_hour, end_min, end_min), + ) + ret.success = True + return ret + + # Handle cases like morning, afternoon + if not self.config.get_matched_time_range(trimmed_text): + return ret + + if RegExpUtility.is_exact_match(self.config.specific_time_of_day_regex, trimmed_text, True): + swift = 0 + night_regex_match = regex.match(self.config.next_regex, trimmed_text) + last_regex_match = regex.match(self.config.next_regex, trimmed_text) + if night_regex_match: + swift = 1 + elif last_regex_match: + swift = -1 + date = datetime.date(reference_time + timedelta(days=swift)) + day = date.day + month = date.month + year = date.year + + ret.timex = DateTimeFormatUtil.format_date(date) + time_str + ret.future_value = ret.past_value = ( + DateUtils.safe_create_from_value(year, month, day, begin_hour, 0, 0), + DateUtils.safe_create_from_value(year, month, day, end_hour, end_min, end_min), + ) + ret.success = True + return ret + + # handle Date followed by morning, afternoon + match = regex.match(self.config.time_of_day_regex, trimmed_text) + + if match: + before_str = trimmed_text[0 : match.start()].strip() + ers = self.config.date_extractor.extract(before_str, reference_time) + + if len(ers) == 0 or ers[0].length != len(before_str): + return ret + + pr = self.config.date_parser.parse(ers[0], reference_time) + future_date = pr.value.future_value + past_date = pr.value.past_value + + ret.timex = pr.timex_str + time_str + + ret.future_value = ( + DateUtils.safe_create_from_value( + future_date.year, future_date.month, future_date.day, begin_hour, 0, 0 + ), + DateUtils.safe_create_from_value( + future_date.year, future_date.month, future_date.day, end_hour, end_min, end_min + ), + ) + ret.past_value = ( + DateUtils.safe_create_from_value(past_date.year, past_date.month, past_date.day, past_date, 0, 0), + DateUtils.safe_create_from_value( + past_date.year, past_date.month, past_date.day, end_hour, end_min, end_min + ), + ) + ret.success = True + return ret + + return ret + + # parse "in 20 minutes" + def parse_number_with_unit(self, text: str, reference_time: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + unit_str: str = None + + # if there are spaces between number and unit + ers = self.config.cardinal_extractor.extract(text) + if len(ers) == 1: + pr = self.config.cardinal_parser.parse(ers[0]) + src_unit = text[ers[0].start + ers[0].length].strip() + + if src_unit.startswith("个"): + src_unit = src_unit[1:] + + before_str = text[0 : ers[0].start] + if src_unit in self.config.unit_map: + num_str = pr.resolution_str + unit_str = self.config.unit_map[src_unit] + prefix_match = RegExpUtility.exact_match(self.config.past_regex, before_str, True) + if prefix_match.success: + begin_date: datetime = None + end_date: datetime = None + + if unit_str == "H": + begin_date = reference_time + timedelta(hours=-float(pr.value)) + end_date = reference_time + elif unit_str == "M": + begin_date = reference_time + timedelta(minutes=-float(pr.value)) + end_date = reference_time + elif unit_str == "S": + begin_date = reference_time + timedelta(seconds=-float(pr.value)) + end_date = reference_time + else: + return ret + + ret.timex = ( + f"{DateTimeFormatUtil.luis_date(begin_date)}T" + f"{DateTimeFormatUtil.luis_time(begin_date)}," + f"{DateTimeFormatUtil.luis_date(end_date)}T" + f"{DateTimeFormatUtil.luis_time(end_date)},PT" + f"{num_str}{unit_str[0]}" + ) + ret.future_value = ret.past_value = (begin_date, end_date) + ret.success = True + return ret + + if not prefix_match.success: + prefix_match = RegExpUtility.match_end(self.config.time_period_left_regex, before_str, True) + + if prefix_match.success: + begin_date: datetime = None + end_date: datetime = None + + if unit_str == "H": + begin_date = reference_time + end_date = reference_time + timedelta(days=float(pr.value)) + elif unit_str == "M": + begin_date = reference_time + end_date = reference_time + timedelta(minutes=float(pr.value)) + elif unit_str == "S": + begin_date = reference_time + end_date = reference_time + timedelta(seconds=float(pr.value)) + else: + return ret + + ret.timex = ( + f"{DateTimeFormatUtil.luis_date(begin_date)}T" + f"{DateTimeFormatUtil.luis_time(begin_date)}," + f"{DateTimeFormatUtil.luis_date(end_date)}T" + f"{DateTimeFormatUtil.luis_time(end_date)},PT" + f"{num_str}{unit_str[0]}" + ) + ret.future_value = ret.past_value = (begin_date, end_date) + ret.success = True + return ret + + # handle "last hour" + match = regex.match(self.config.unit_regex, text) + if match: + src_unit = RegExpUtility.get_group(match, Constants.UNIT_GROUP_NAME) + before_str = text[0 : match.start()].strip() + + if src_unit in self.config.unit_map: + unit_str = self.config.unit_regex[src_unit] + + if RegExpUtility.is_exact_match(self.config.past_regex, before_str, True): + begin_date: datetime = None + end_date: datetime = None + + if unit_str == "H": + begin_date = reference_time + timedelta(days=-1) + end_date = reference_time + elif unit_str == "M": + begin_date = reference_time + timedelta(minutes=-1) + end_date = reference_time + elif unit_str == "S": + begin_date = reference_time + timedelta(seconds=-1) + end_date = reference_time + else: + return ret + + ret.timex = ( + f"{DateTimeFormatUtil.luis_date(begin_date)}T" + f"{DateTimeFormatUtil.luis_time(begin_date)}," + f"{DateTimeFormatUtil.luis_date(end_date)}T" + f"{DateTimeFormatUtil.luis_time(end_date)},PT" + f"{unit_str[0]}" + ) + ret.future_value = ret.past_value = (begin_date, end_date) + ret.success = True + return ret + + if RegExpUtility.is_exact_match(self.config.future_regex, before_str, True): + begin_date: datetime = None + end_date: datetime = None + + if unit_str == "H": + beginDate = reference_time + endDate = reference_time + timedelta(hours=1) + elif unit_str == "M": + beginDate = reference_time + endDate = reference_time + timedelta(minutes=1) + elif unit_str == "S": + beginDate = reference_time + endDate = reference_time + timedelta(seconds=1) + else: + return ret + + ret.timex = ( + f"{DateTimeFormatUtil.luis_date(begin_date)}T" + f"{DateTimeFormatUtil.luis_time(begin_date)}," + f"{DateTimeFormatUtil.luis_date(end_date)}T" + f"{DateTimeFormatUtil.luis_time(end_date)},PT" + f"{unit_str[0]}" + ) + ret.future_value = ret.past_value = (begin_date, end_date) + ret.success = True + return ret + + return ret + + def parse_relative_unit(self, text: str, reference_time: datetime): + ret = DateTimeResolutionResult() + + match = regex.match(self.config.rest_of_date_regex, text) + + if match: + src_unit = RegExpUtility.get_group(match, Constants.UNIT_GROUP_NAME) + unit_str = self.config.unit_map[src_unit] + swift_value = 1 + begin_time: datetime = reference_time + end_time: datetime = reference_time + + if src_unit in self.config.unit_map: + ret.timex = TimexUtil.generate_relative_unit_date_time_period_timex( + begin_time, end_time, reference_time, unit_str, swift_value + ) + ret.future_value = ret.past_value = (begin_time, end_time) + ret.success = True if ret.timex else False + return ret + + return ret + + # cases like "Early in the day Wednesday" + def parse_date_with_period_suffix(self, text: str, reference_time: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + date_result = self.config.date_extractor.extract(text, reference_time) + + if len(date_result) > 0: + pr = DateTimeParseResult() + after_str = text[ + date_result[0].start + date_result[0].length : len(text) - date_result[0].start + date_result[0].length + ].lstrip() + match = regex.match(self.config.time_period_left_regex, after_str) + if match: + pr = self.config.date_parser.parse(date_result[0], reference_time) + + if match: + if pr.value: + start_time: datetime = pr.value.future_value + start_time = datetime(start_time.year, start_time.month, start_time.day) + end_time: datetime = start_time + + if RegExpUtility.get_group(match, Constants.EARLY_PREFIX_GROUP_NAME): + end_time = end_time + timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) + ret.mod = Constants.EARLY_MOD + + elif RegExpUtility.get_group(match, Constants.MID_PREFIX_GROUP_NAME): + start_time = start_time + timedelta( + hours=Constants.HALF_DAY_HOUR_COUNT - Constants.HALF_MID_DAY_DURATION_HOUR_COUNT + ) + end_time = end_time + timedelta( + hours=Constants.HALF_DAY_HOUR_COUNT + Constants.HALF_MID_DAY_DURATION_HOUR_COUNT + ) + ret.mod = Constants.MID_MOD + + elif RegExpUtility.get_group(match, Constants.LATE_PREFIX_GROUP_NAME): + start_time = start_time + timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) + end_time = start_time + timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) + ret.mod = Constants.LATE_MOD + + else: + return ret + + ret.timex = pr.timex_str + ret.past_value = ret.future_value = (start_time, end_time) + ret.success = True + return ret diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_duration.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_duration.py new file mode 100644 index 0000000000..b7172f49df --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_duration.py @@ -0,0 +1,435 @@ +from abc import abstractmethod +from datetime import datetime +from typing import Dict, List, Optional, Pattern + +from regex import regex + +from recognizers_date_time.date_time import Constants, TimeTypeConstants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DurationParsingUtil, + ExtractResultExtension, + Metadata, + RegExpUtility, + TimexUtil, + Token, + get_tokens_from_regex, +) +from recognizers_text.extractor import Extractor, ExtractResult +from recognizers_text.parser import Parser + + +class CJKDurationExtractorConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def duration_unit_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def duration_connector_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def year_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def all_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def half_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def relative_duration_unit_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def during_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def some_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def more_or_less_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def internal_extractor(self) -> Extractor: + return NotImplementedError + + @property + @abstractmethod + def unit_map(self) -> Dict[str, str]: + return NotImplementedError + + @property + @abstractmethod + def unit_value_map(self) -> Dict[str, float]: + return NotImplementedError + + @property + @abstractmethod + def ambiguity_duration_filters_dict(self) -> Dict[Pattern, Pattern]: + return NotImplementedError + + +class BaseCJKDurationExtractor(DateTimeExtractor): + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_DURATION + + def __init__(self, config: CJKDurationExtractorConfiguration, merge: bool = True): + self.config = config + self.merge = merge + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + # Use unit to extract + ret_list = self.config.internal_extractor.extract(source) + result: List[ExtractResult] = list() + + for er_result in ret_list: + # filter + if regex.search(self.config.year_regex, er_result.text): + continue + + result.append(er_result) + + # handle "all day", "more days", "few days" + result.extend(self.implicit_duration(source)) + result = ExtractResultExtension.merge_all_tokens(result) + + if self.merge: + result = self.merge_multiple_duration(source, result) + result = ExtractResultExtension.filter_ambiguity( + result, source, self.config.ambiguity_duration_filters_dict + ) + + return result + + def merge_multiple_duration(self, text: str, er: List[ExtractResult]) -> List[ExtractResult]: + if len(er) <= 1: + return er + + unit_map = self.config.unit_map + unit_value_map = self.config.unit_value_map + unit_regex = self.config.duration_unit_regex + result: List[ExtractResult] = list() + + first_extraction_index = 0 + time_unit = 0 + total_unit = 0 + + while first_extraction_index < len(er): + cur_unit = None + unit_match = regex.match(unit_regex, er[first_extraction_index].text) + + if unit_match and RegExpUtility.get_group(unit_match, Constants.UNIT_GROUP_NAME) in unit_map: + cur_unit = RegExpUtility.get_group(unit_match, Constants.UNIT_GROUP_NAME) + total_unit += 1 + if DurationParsingUtil.is_time_duration_unit(unit_map[cur_unit]): + time_unit += 1 + + if not cur_unit: + first_extraction_index += 1 + continue + + second_extraction_index = first_extraction_index + 1 + while second_extraction_index < len(er): + valid = False + mid_str_begin = er[second_extraction_index - 1].start + er[second_extraction_index - 1].length + mid_str_end = er[second_extraction_index].start + if mid_str_begin > mid_str_end: + return er + + mid_str = text[mid_str_begin : mid_str_end - mid_str_begin] + match = regex.match(self.config.duration_connector_regex, mid_str) + if match: + # If the second element of a group is a modifier, it should not be merged with subsequent elements. + # For example "4 days or more and 1 week or less" should return 2 separate extractions. + if ( + second_extraction_index > 1 + and er[second_extraction_index - 1].meta_data + and er[second_extraction_index - 1].meta_data.has_mod + ): + break + + unit_match = regex.match(unit_regex, er[second_extraction_index].text) + if unit_match and RegExpUtility.get_group(unit_match, Constants.UNIT_GROUP_NAME) in unit_map: + next_unit_str = RegExpUtility.get_group(unit_match, Constants.UNIT_GROUP_NAME) + if unit_value_map[unit_map[next_unit_str]] != unit_value_map[unit_map[cur_unit]]: + valid = True + if unit_value_map[unit_map[next_unit_str]] < unit_value_map[unit_map[cur_unit]]: + cur_unit = next_unit_str + + total_unit += 1 + if DurationParsingUtil.is_time_duration_unit(unit_map[next_unit_str]): + time_unit += 1 + + if not valid: + break + + second_extraction_index += 1 + + if second_extraction_index - 1 > first_extraction_index: + node = ExtractResult() + node.start = er[first_extraction_index].start + node.length = ( + er[second_extraction_index - 1].start + er[second_extraction_index - 1].length - node.start + ) + node.text = text[node.start : node.length] + node.type = er[first_extraction_index].type + + # Add multiple duration type to extract result + type = Constants.MULTIPLE_DURATION_TIME # Default type + if time_unit == total_unit: + type = Constants.MULTIPLE_DURATION_TIME + elif time_unit == 0: + type = Constants.MULTIPLE_DURATION_DATE + node.data = type + + result.append(node) + time_unit = 0 + total_unit = 0 + else: + result.append(er[first_extraction_index]) + + first_extraction_index = second_extraction_index + + return result + + def implicit_duration(self, text: str) -> List[ExtractResult]: + ret: List[Token] = list() + # handle "all day", "all year" + ret.extend(get_tokens_from_regex(self.config.all_regex, text)) + # handle "half day", "half year" + ret.extend(get_tokens_from_regex(self.config.half_regex, text)) + # handle "next day", "last year" + ret.extend(get_tokens_from_regex(self.config.relative_duration_unit_regex, text)) + # handle "more day", "more year" + ret.extend(get_tokens_from_regex(self.config.more_or_less_regex, text)) + # handle "few days", "few months" + ret.extend(get_tokens_from_regex(self.config.some_regex, text)) + # handle "during/for the day/week/month/year" + # if (self.config.options and DateTimeOptions.CALENDAR) != 0: + # ret.extend(get_tokens_from_regex(self.config.during_regex, text)) + + result: List[ExtractResult] = list() + for e in ret: + node = ExtractResult() + node.start = e.start + node.length = e.length + node.text = text[node.start : node.length] + node.type = self.extractor_type_name + node.meta_data = Metadata() + node.meta_data.has_mod = True + result.append(node) + + return result + + +class CJKDurationParserConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + return NotImplementedError + + @property + @abstractmethod + def internal_parser(self) -> Parser: + return NotImplementedError + + @property + @abstractmethod + def year_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def some_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def more_or_less_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def duration_unit_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def an_unit_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def duration_connector_regex(self) -> Pattern: + return NotImplementedError + + @property + @abstractmethod + def unit_map(self) -> Dict[str, str]: + return NotImplementedError + + @property + @abstractmethod + def unit_value_map(self) -> Dict[str, float]: + return NotImplementedError + + +class BaseCJKDurationParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_DURATION + + def __init__(self, config: CJKDurationParserConfiguration): + self.config = config + + def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: + datetime_parse_result = self.parse_merged_duration(source.text, reference) + + if not datetime_parse_result.success: + datetime_parse_result = DurationParsingUtil.parse_inexact_number_with_unit( + source.text, self.config.some_regex, self.config.unit_map, self.config.unit_value_map, is_cjk=True + ) + + if not datetime_parse_result.success: + datetime_parse_result = self.parse_an_unit(source.text) + + if not datetime_parse_result.success: + parse_result = self.config.internal_parser.parse(source) + unit_result = parse_result.value + if not unit_result: + return DateTimeParseResult() + + unit_str = unit_result.unit + if unit_result.number: + num = float(unit_result.number.__str__()) + else: + num = 1 + + datetime_parse_result.timex = TimexUtil.generate_duration_timex( + num, unit_str, DurationParsingUtil.is_less_than_day(unit_str) + ) + datetime_parse_result.future_value = datetime_parse_result.past_value = ( + num * self.config.unit_value_map[unit_str] + ) + datetime_parse_result.success = True + + if datetime_parse_result.success: + datetime_parse_result.future_resolution = { + TimeTypeConstants.DURATION: datetime_parse_result.future_value + } + datetime_parse_result.past_resolution = {TimeTypeConstants.DURATION: datetime_parse_result.past_value} + + more_or_less_match = regex.match(self.config.more_or_less_regex, source.text) + if more_or_less_match: + if RegExpUtility.get_group(more_or_less_match, Constants.LESS_GROUP_NAME): + datetime_parse_result.mod = Constants.LESS_THAN_MOD + elif RegExpUtility.get_group(more_or_less_match, Constants.MORE_GROUP_NAME): + datetime_parse_result.mod = Constants.MORE_THAN_MOD + + ret = DateTimeParseResult() + ret.text = source.text + ret.start = source.start + ret.type = source.type + ret.data = source.type + ret.value = datetime_parse_result + ret.timex_str = datetime_parse_result.timex + ret.resolution_str = None + + return ret + + def filter_results(self, query: str, candidate_results: List[DateTimeParseResult]) -> List[DateTimeParseResult]: + return candidate_results + + def parse_an_unit(self, text: str) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = regex.match(self.config.an_unit_regex, text) + if RegExpUtility.get_group(match, Constants.ANOTHER_GROUP_NAME): + if RegExpUtility.get_group(match, Constants.HALF_GROUP_NAME): + num_val = 0.5 + elif RegExpUtility.get_group(match, Constants.QUARTER_GROUP_NAME): + num_val = 0.25 + elif RegExpUtility.get_group(match, Constants.THREE_QUARTER_GROUP_NAME): + num_val = 0.75 + else: + num_val = 1 + + src_unit = RegExpUtility.get_group(match, Constants.UNIT_GROUP_NAME) + if src_unit in self.config.unit_map: + unit_str = self.config.unit_map[src_unit] + ret.timex = TimexUtil.generate_duration_timex( + num_val, unit_str, DurationParsingUtil.is_less_than_day(unit_str) + ) + ret.future_value = ret.past_value = num_val * self.config.unit_value_map[unit_str] + ret.success = True + return ret + + def parse_merged_duration(self, text: str, reference: datetime) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + duration_extractor = self.config.duration_extractor + + # DurationExtractor without parameter will not extract merged duration + ers = duration_extractor.extract(text, reference) + + # only handle merged duration cases like "1 month 21 days" + if len(ers) <= 1: + ret.success = False + return ret + + start = ers[0].start + if start != 0: + before_str = text[0 : start - 1] + if before_str: + return ret + + end = ers[-1].start + ers[-1].length + if end != len(text): + after_str = text[end:] + if after_str: + return ret + + prs: List[DateTimeParseResult] = list() + timex_dict: Dict[str, str] = dict() + + # insert timex into a dictionary + for er in ers: + unit_regex = self.config.duration_unit_regex + unit_match = regex.match(unit_regex, text) + if unit_match: + pr = self.parse(er) + if pr and pr.value: + timex_dict[self.config.unit_map[RegExpUtility.get_group(unit_match, Constants.UNIT_GROUP_NAME)]] = ( + pr.timex_str + ) + prs.append(pr) + # sort the timex using the granularity of the duration, "P1M23D" for "1 month 23 days" and "23 days 1 month" + if len(prs) > 0: + ret.timex = TimexUtil.generate_compound_duration_timex(timex_dict, self.config.unit_value_map) + + value = 0 + for pr in prs: + value += float(pr.value.future_value.__str__()) + ret.future_value = ret.past_value = value + + ret.success = True + return ret diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_holiday.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_holiday.py new file mode 100644 index 0000000000..9deb380161 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_holiday.py @@ -0,0 +1,415 @@ +from abc import abstractmethod +from calendar import Calendar +from datetime import datetime +from typing import Callable, Dict, List, Match, Optional, Pattern + +import regex +from datedelta import datedelta + +from recognizers_date_time.date_time.constants import Constants, TimeTypeConstants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeFormatUtil, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DateUtils, + DayOfWeek, + HolidayFunctions, + Token, + merge_all_tokens, +) +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_number import Constants as NumberConstants +from recognizers_text import Metadata +from recognizers_text.extractor import ExtractResult +from recognizers_text.utilities import RegExpUtility + + +class CJKHolidayExtractorConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def holiday_regexes(self) -> List[Pattern]: + raise NotImplementedError + + +class BaseCJKHolidayExtractor(DateTimeExtractor): + + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_DATE # "Date" + + def __init__(self, config: CJKHolidayExtractorConfiguration): + self.config = config + + def extract(self, text: str) -> List[ExtractResult]: + return self.extract(text, datetime.now()) + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + tokens: List[Token] = list() + tokens.extend(self.holiday_match(source)) + ers: List[ExtractResult] = merge_all_tokens(tokens, source, self.extractor_type_name) + + for er in ers: + er.metadata = Metadata() + er.metadata.is_holiday = True + + return ers + + def holiday_match(self, text: str) -> List[Token]: + ret: List[Token] = list() + for pattern in self.config.holiday_regexes: + matches = list(regex.finditer(pattern, text)) + ret.extend(map(lambda x: Token(x.start(), x.end()), matches)) + return ret + + +class CJKHolidayParserConfiguration(DateTimeOptionsConfiguration): + + @property + @abstractmethod + def integer_extractor(self) -> BaseNumberExtractor: + return NotImplementedError + + @property + @abstractmethod + def number_parser(self) -> BaseNumberParser: + raise NotImplementedError + + @property + @abstractmethod + def fixed_holidays_dict(self) -> Dict[str, Callable[[int], datetime]]: + raise NotImplementedError + + @property + @abstractmethod + def holiday_func_dict(self) -> Dict[str, Callable[[int], datetime]]: + raise NotImplementedError + + @property + @abstractmethod + def no_fixed_timex(self) -> Dict[str, str]: + raise NotImplementedError + + @property + @abstractmethod + def holiday_regex_list(self) -> List[Pattern]: + raise NotImplementedError + + @property + @abstractmethod + def lunar_holiday_regex(self) -> Pattern: + raise NotImplementedError + + @abstractmethod + def get_swift_year(self, source: str) -> str: + raise NotImplementedError + + @abstractmethod + def sanitize_year_token(self, source: str) -> str: + raise NotImplementedError + + @staticmethod + def new_year(year: int) -> datetime: + return datetime(year, 1, 1) + + @staticmethod + def usa_independence_day(year: int) -> datetime: + return datetime(year, 7, 4) + + @staticmethod + def teacher_day(year: int) -> datetime: + return datetime(year, 9, 10) + + @staticmethod + def mao_birthday(year: int) -> datetime: + return datetime(year, 12, 26) + + @staticmethod + def youth_day(year: int) -> datetime: + return datetime(year, 5, 4) + + @staticmethod + def children_day(year: int) -> datetime: + return datetime(year, 6, 1) + + @staticmethod + def female_day(year: int) -> datetime: + return datetime(year, 3, 8) + + @staticmethod + def tree_plant_day(year: int) -> datetime: + return datetime(year, 3, 12) + + @staticmethod + def lover_day(year: int) -> datetime: + return datetime(year, 2, 14) + + @staticmethod + def christmas_day(year: int) -> datetime: + return datetime(year, 12, 25) + + @staticmethod + def christmas_eve(year: int) -> datetime: + return datetime(year, 12, 24) + + @staticmethod + def easter_day(year: int) -> datetime: + return HolidayFunctions.calculate_holiday_by_easter(year) + + @staticmethod + def fool_day(year: int) -> datetime: + return datetime(year, 4, 1) + + @staticmethod + def labor_day(year: int) -> datetime: + return datetime(year, 5, 1) + + @staticmethod + def halloween_day(year: int) -> datetime: + return datetime(year, 10, 31) + + @staticmethod + def mid_autumn_day(year: int) -> datetime: + return datetime(year, 8, 15) + + @staticmethod + def spring_day(year: int) -> datetime: + return datetime(year, 1, 1) + + @staticmethod + def new_year_eve(year: int) -> datetime: + return datetime(year, 12, 31) + + @staticmethod + def lantern_day(year: int) -> datetime: + return datetime(year, 1, 15) + + @staticmethod + def qing_ming_day(year: int) -> datetime: + return datetime(year, 4, 4) + + @staticmethod + def dragon_boat_day(year: int) -> datetime: + return datetime(year, 5, 5) + + @staticmethod + def boys_festival(year: int) -> datetime: + return datetime(year, 5, 5) + + @staticmethod + def jap_national_day(year: int) -> datetime: + return datetime(year, 10, 1) + + @staticmethod + def jap_mil_build_day(year: int) -> datetime: + return datetime(year, 8, 1) + + @staticmethod + def girls_day(year: int) -> datetime: + return datetime(year, 3, 7) + + @staticmethod + def singles_day(year: int) -> datetime: + return datetime(year, 11, 11) + + @staticmethod + def chong_yang_day(year: int) -> datetime: + return datetime(year, 9, 9) + + @staticmethod + def get_day(year: int, month: int, week: int, day_of_week: DayOfWeek) -> int: + calendar = Calendar() + return [d for d in calendar.itermonthdays2(year, month) if d[0] and d[1] == day_of_week - 1][week][0] + + @staticmethod + def get_last_day(year: int, month: int, day_of_week: DayOfWeek) -> int: + return CJKHolidayParserConfiguration.get_day(year, month, -1, day_of_week) + + @staticmethod + def mothers_day(year: int) -> datetime: + return datetime(year, 5, CJKHolidayParserConfiguration.get_day(year, 5, 1, DayOfWeek.SUNDAY)) + + @staticmethod + def fathers_day(year: int) -> datetime: + return datetime(year, 6, CJKHolidayParserConfiguration.get_day(year, 6, 2, DayOfWeek.SUNDAY)) + + @staticmethod + def martin_luther_king_day(year: int) -> datetime: + return datetime(year, 1, CJKHolidayParserConfiguration.get_day(year, 1, 2, DayOfWeek.MONDAY)) + + @staticmethod + def washingtons_birthday(year: int) -> datetime: + return datetime(year, 2, CJKHolidayParserConfiguration.get_day(year, 2, 2, DayOfWeek.MONDAY)) + + @staticmethod + def canberra_day(year: int) -> datetime: + return datetime(year, 3, CJKHolidayParserConfiguration.get_day(year, 3, 0, DayOfWeek.MONDAY)) + + @staticmethod + def memorial_day(year: int) -> datetime: + return datetime(year, 5, CJKHolidayParserConfiguration.get_last_day(year, 5, DayOfWeek.MONDAY)) + + @staticmethod + def labour_day(year: int) -> datetime: + return datetime(year, 9, CJKHolidayParserConfiguration.get_day(year, 9, 0, DayOfWeek.MONDAY)) + + @staticmethod + def international_workers_day(year: int) -> datetime: + return datetime(year, 5, 1) + + @staticmethod + def columbus_day(year: int) -> datetime: + return datetime(year, 10, CJKHolidayParserConfiguration.get_day(year, 10, 1, DayOfWeek.MONDAY)) + + @staticmethod + def thanksgiving_day(year: int) -> datetime: + return datetime(year, 11, CJKHolidayParserConfiguration.get_day(year, 11, 3, DayOfWeek.THURSDAY)) + + +class BaseCJKHolidayParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_DATE + + def __init__(self, config: CJKHolidayParserConfiguration): + self.config = config + + def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: + reference_date = reference if reference is not None else datetime.now() + value = None + + if source.type == self.parser_type_name: + inner_result = self.parse_holiday_regex_match(source.text, reference_date) + + if inner_result.success: + inner_result.future_resolution = { + TimeTypeConstants.DATE: DateTimeFormatUtil.format_date(inner_result.future_value) + } + inner_result.past_resolution = { + TimeTypeConstants.DATE: DateTimeFormatUtil.format_date(inner_result.past_value) + } + inner_result.is_lunar = self.is_lunar_calendar(source.text) + value = inner_result + + result = DateTimeParseResult(source) + result.value = value + result.timex_str = value.timex if value else '' + result.resolution_str = '' + + return result + + def filter_result(self, query: str, candidate_results: List[DateTimeParseResult]): + return candidate_results + + def get_future_value(self, value: datetime, reference_date: datetime, holiday: str) -> datetime: + if value < reference_date: + if holiday in self.config.fixed_holidays_dict: + return value + datedelta(years=1) + if holiday in self.config.holiday_func_dict: + value = self.config.holiday_func_dict[holiday](reference_date.year + 1) + return value + + def get_past_value(self, value: datetime, reference_date: datetime, holiday: str) -> datetime: + if value >= reference_date: + if holiday in self.config.fixed_holidays_dict: + return value + datedelta(years=-1) + if holiday in self.config.holiday_func_dict: + value = self.config.holiday_func_dict[holiday](reference_date.year - 1) + return value + + def parse_holiday_regex_match(self, text: str, reference_date: datetime) -> DateTimeResolutionResult: + for pattern in self.config.holiday_regex_list: + match = pattern.match(text) + if match and match.pos == 0 and match.endpos == len(text): + # Value string will be set in Match2Date method + result = self.match_to_date(match, reference_date) + return result + return DateTimeResolutionResult() + + def match_to_date(self, match: Match, reference_date: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + holiday_str = match.group('holiday') + + year = reference_date.year + has_year = False + year_num = match.group('year') + year_cjk = match.group(Constants.YEAR_CJK_GROUP_NAME) + year_relative = match.group('yearrel') + + if year_num: + has_year = True + year_num = self.config.sanitize_year_token(year_num) + year = int(year_num) + + elif year_cjk: + has_year = True + year_cjk = self.config.sanitize_year_token(year_cjk) + year = self.convert_to_integer(year_cjk) + + elif year_relative: + has_year = True + swift = self.config.get_swift_year(year_relative) + if swift >= -1: + year += swift + + if 100 > year >= 90: + year += Constants.BASE_YEAR_PAST_CENTURY + elif year < 20: + year += Constants.BASE_YEAR_CURRENT_CENTURY + + if holiday_str: + value: datetime = None + timex = '' + if holiday_str in self.config.fixed_holidays_dict: + value = self.config.fixed_holidays_dict[holiday_str](year) + timex = f'-{DateTimeFormatUtil.to_str(value.month, 2)}-{DateTimeFormatUtil.to_str(value.day, 2)}' + else: + if holiday_str in self.config.holiday_func_dict: + value = self.config.holiday_func_dict[holiday_str](year) + timex = self.config.no_fixed_timex[holiday_str] + else: + return result + + if has_year: + result.timex = DateTimeFormatUtil.to_str(year, 4) + timex + result.future_value = DateUtils.safe_create_from_min_value(year, value.month, value.day) + result.past_value = result.future_value + result.success = True + return result + + result.timex = 'XXXX' + timex + result.future_value = self.get_future_value(value, reference_date, holiday_str) + result.past_value = self.get_past_value(value, reference_date, holiday_str) + result.success = True + return result + + return result + + def convert_to_integer(self, year_cjk: str): + year = 0 + num = 0 + + er = self.config.integer_extractor.extract(year_cjk) + if er and er[0].type == NumberConstants.SYS_NUM_INTEGER: + num = self.config.number_parser.parse(er[0]).value + + if num < 10: + num = 0 + for ch in year_cjk: + num *= 10 + er = self.config.integer_extractor.extract(ch) + if er and er[0].type == NumberConstants.SYS_NUM_INTEGER: + num += self.config.number_parser.parse(er[0]).value + + year = num + else: + year = num + return -1 if year == 0 else year + + def is_lunar_calendar(self, text: str): + source = text.strip().lower() + match = RegExpUtility.get_matches(self.config.lunar_holiday_regex, source) + if match: + return True + return False diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_merged.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_merged.py new file mode 100644 index 0000000000..6bd2109d57 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_merged.py @@ -0,0 +1,533 @@ +from abc import abstractmethod +from collections import namedtuple +from datetime import datetime +from typing import Dict, List, Optional, Pattern + +from recognizers_date_time.date_time.CJK.base_configs import CJKCommonDateTimeParserConfiguration +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeOptions, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + ExtractResultExtension, + MergedParserUtil, + RegExpUtility, +) +from recognizers_text.extractor import ExtractResult +from recognizers_text.meta_data import MetaData + + +MatchedIndex = namedtuple('MatchedIndex', ['matched', 'index']) + + +class CJKMergedExtractorConfiguration(DateTimeOptionsConfiguration): + + @property + @abstractmethod + def date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_period_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def duration_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def holiday_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def after_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def before_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def unspecified_date_period_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def since_suffix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def since_prefix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def around_suffix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def around_prefix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def until_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def equal_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def potential_ambiguous_range_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def ambiguous_range_modifier_prefix(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: + raise NotImplementedError + + +class BaseCJKMergedExtractor(DateTimeExtractor): + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_MERGED + + def __init__(self, config: CJKMergedExtractorConfiguration, options: DateTimeOptions): + self.config = config + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + if reference is None: + reference = datetime.now() + + result = self.config.date_extractor.extract(source, reference) + + # The order is important, since there can be conflicts in merging + result = self.add_to(result, self.config.time_extractor.extract(source, reference)) + result = self.add_to(result, self.config.duration_extractor.extract(source, reference)) + result = self.add_to(result, self.config.date_period_extractor.extract(source, reference)) + result = self.add_to(result, self.config.date_time_extractor.extract(source, reference)) + result = self.add_to(result, self.config.time_period_extractor.extract(source, reference)) + result = self.add_to(result, self.config.date_time_period_extractor.extract(source, reference)) + result = self.add_to(result, self.config.holiday_extractor.extract(source, reference)) + + result = self.filter_unspecific_date_period(result) + + result = ExtractResultExtension.filter_ambiguity(result, source, self.config.ambiguity_filters_dict) + + result = self.add_mod(result, source) + + result = sorted(result, key=lambda x: x.start) + + return result + + def filter_unspecific_date_period(self, extract_results: List[ExtractResult]) -> List[ExtractResult]: + for extract_result in extract_results: + if self.config.unspecified_date_period_regex.search(extract_result.text) is not None: + extract_results.remove(extract_result) + + return extract_results + + def add_mod(self, extract_results: List[ExtractResult], source: str) -> List[ExtractResult]: + last_end = 0 + for extract_result in extract_results: + before_str = source[last_end : extract_result.start].strip() + after_str = source[extract_result.start + extract_result.length :].strip() + + match = RegExpUtility.match_begin(self.config.before_regex, after_str, True) + if match: + mod_len = match.index + match.length + extract_result.length += mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + match = RegExpUtility.match_begin(self.config.after_regex, after_str, True) + if match: + mod_len = match.index + match.length + extract_result.length += mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + match = RegExpUtility.match_begin(self.config.until_regex, before_str, True) + if match: + mod_len = len(before_str) - match.index + extract_result.length += mod_len + extract_result.start -= mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + match = RegExpUtility.match_begin(self.config.until_regex, after_str, True) + if match: + mod_len = len(after_str) - match.index + extract_result.length += mod_len + extract_result.start -= mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + match = RegExpUtility.match_begin(self.config.since_prefix_regex, before_str, True) + if match and self.ambiguous_range_checker(before_str, source, extract_result): + mod_len = len(before_str) + match.index + extract_result.length += mod_len + extract_result.start -= mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + match = RegExpUtility.match_begin(self.config.since_prefix_regex, after_str, True) + if match and self.ambiguous_range_checker(after_str, source, extract_result): + mod_len = len(after_str) + match.index + extract_result.length += mod_len + extract_result.start -= mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + match = RegExpUtility.match_begin(self.config.around_suffix_regex, before_str, True) + if match: + mod_len = len(before_str) + match.index + extract_result.length += mod_len + extract_result.start -= mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + match = RegExpUtility.match_begin(self.config.around_suffix_regex, after_str, True) + if match: + mod_len = len(after_str) + match.index + extract_result.length += mod_len + extract_result.start -= mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + match = RegExpUtility.match_begin(self.config.equal_regex, before_str, True) + if match: + mod_len = len(before_str) + match.index + extract_result.length += mod_len + extract_result.start -= mod_len + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] + + extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) + + return extract_results + + def add_to(self, destinations: List[ExtractResult], source: List[ExtractResult]) -> List[ExtractResult]: + for value in source: + is_found = False + overlap_indexes: List[int] = list() + first_index = -1 + + for index, destination in enumerate(destinations): + if destination.overlap(value): + is_found = True + if destination.cover(value): + if first_index == -1: + first_index = index + overlap_indexes.append(index) + else: + continue + + if not is_found: + destinations.append(value) + elif overlap_indexes: + temp_dst: List[ExtractResult] = list() + + for index, destination in enumerate(destinations): + if index not in overlap_indexes: + temp_dst.append(destination) + + # insert at the first overlap occurence to keep the order + temp_dst.insert(first_index, value) + destinations = temp_dst + return destinations + + # Avoid adding mod for ambiguity cases, such as "从" in "从 ... 到 ..." should not add mod + # TODO: Revise PotentialAmbiguousRangeRegex to support cases like "从2015年起,哪所大学需要的分数在80到90之间" + def ambiguous_range_checker(self, before_str: str, text: str, er: ExtractResult) -> bool: + if RegExpUtility.match_end(self.config.ambiguous_range_modifier_prefix, text, True): + matches = RegExpUtility.get_matches(self.config.potential_ambiguous_range_regex, text) + if any(m.index < er.start + er.length and m.index + m.length > er.start for m in matches): + return False + return True + + def assign_mod_metadata(self, metadata: MetaData) -> MetaData: + if not metadata: + metadata = MetaData() + metadata.has_mod = True + return metadata + + +class CJKMergedParserConfiguration(CJKCommonDateTimeParserConfiguration): + @property + @abstractmethod + def before_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def after_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def since_prefix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def since_suffix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def until_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def equal_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def around_prefix_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def around_suffix_regex(self) -> Pattern: + raise NotImplementedError + + +class BaseCJKMergedParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_MERGED + + def __init__(self, config: CJKMergedParserConfiguration, options): + self.config = config + self.options = options + + def parse(self, er: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: + if not reference: + reference = datetime.now() + + # push, save the MOD string + has_inclusive_modifier = False + has_before = False + has_after = False + has_until = False + has_since = False + has_equal = False + has_around = False + mod_str = "" + mod_str_prefix = "" + mod_str_suffix = "" + + if er.meta_data: + if er.meta_data.has_mod: + before_match = RegExpUtility.match_end(self.config.before_regex, er.text, True) + after_match = RegExpUtility.match_end(self.config.after_regex, er.text, True) + until_match = RegExpUtility.match_begin(self.config.until_regex, er.text, True) + since_match_prefix = RegExpUtility.match_begin(self.config.since_prefix_regex, er.text, True) + since_match_suffix = RegExpUtility.match_end(self.config.since_suffix_regex, er.text, True) + equal_match = RegExpUtility.match_begin(self.config.equal_regex, er.text, True) + around_match_prefix = RegExpUtility.match_begin(self.config.around_prefix_regex, er.text, True) + around_match_suffix = RegExpUtility.match_end(self.config.around_suffix_regex, er.text, True) + + if before_match and not MergedParserUtil.is_duration_with_ago_and_later(er): + has_before = True + er.length -= before_match.length + if er.length > len(er.text): + er.text = er.text[0 : er.length] + mod_str = before_match.value if before_match.value != er.text else '' + if before_match.get_group(Constants.INCLUDE_GROUP_NAME): + has_inclusive_modifier = True + + elif after_match and not since_match_suffix and not MergedParserUtil.is_duration_with_ago_and_later(er): + has_after = True + er.length -= after_match.length + if er.length > len(er.text): + er.text = er.text[0 : er.length] + mod_str = after_match.value + if after_match.get_group(Constants.INCLUDE_GROUP_NAME): + has_inclusive_modifier = True + + elif until_match: + has_until = True + er.start += until_match.length + er.length -= until_match.length + er.text = er.text[until_match.length] + mod_str = until_match.group() + + elif equal_match: + has_equal = True + er.start += equal_match.length + er.length -= equal_match.length + er.text = er.text[equal_match.length] + mod_str = equal_match.group() + + else: + if since_match_prefix: + has_since = True + er.start += since_match_prefix.length + er.length -= since_match_prefix.length + er.text = er.text[since_match_prefix.length] + mod_str = since_match_prefix.group() + + if since_match_suffix: + has_since = True + er.length -= since_match_suffix.length + er.text = er.text[since_match_suffix.start :] + mod_str = since_match_suffix.group() + + if around_match_prefix: + has_around = True + er.start += around_match_prefix.length + er.length -= around_match_prefix.length + er.text = er.text[around_match_prefix.length] + mod_str = around_match_prefix.group() + + if around_match_suffix: + has_around = True + er.length -= around_match_suffix.length + er.text = er.text[around_match_suffix.start :] + mod_str = around_match_suffix.group() + + # Parse extracted datetime mention + pr = self.parse_result(er, reference) + if not pr: + return None + + # pop, restore the MOD string + if has_before: + pr.length += len(mod_str) + pr.text = pr.text + mod_str + val: DateTimeResolutionResult = pr.value + + if has_inclusive_modifier: + val.mod = MergedParserUtil.combined_mod(val.mod, Constants.BEFORE_MOD) + else: + val.mod = MergedParserUtil.combined_mod(val.mod, Constants.UNTIL_MOD) + pr.value = val + + if has_after: + pr.length += len(mod_str) + pr.text = pr.text + mod_str + val: DateTimeResolutionResult = pr.value + + if has_inclusive_modifier: + val.mod = MergedParserUtil.combined_mod(val.mod, Constants.AFTER_MOD) + else: + val.mod = MergedParserUtil.combined_mod(val.mod, Constants.SINCE_MOD) + pr.value = val + + if has_until: + pr.length += len(mod_str) + pr.start -= len(mod_str) + pr.text = mod_str + pr.text + val: DateTimeResolutionResult = pr.value + val.mod = Constants.BEFORE_MOD + pr.value = val + has_before = True + + if has_since: + pr.length += len(mod_str_prefix) + len(mod_str_suffix) + pr.start -= len(mod_str_prefix) + pr.text = mod_str_prefix + pr.text + mod_str_suffix + val: DateTimeResolutionResult = pr.value + val.mod = Constants.SINCE_MOD + pr.value = val + + if has_equal: + pr.length += len(mod_str) + pr.start -= len(mod_str) + pr.text = mod_str + pr.text + + if has_around: + pr.length += len(mod_str_prefix) + len(mod_str_suffix) + pr.start -= len(mod_str_prefix) + pr.text = mod_str_prefix + pr.text + mod_str_suffix + val: DateTimeResolutionResult = pr.value + val.mod = Constants.APPROX_MOD + pr.value = val + + has_range_changing_mod = False + if has_before or has_after or has_since: + has_range_changing_mod = True + + if not pr.value: + pr.value = DateTimeResolutionResult + pr.value.has_range_changing_mod = has_range_changing_mod + + pr = MergedParserUtil.set_parse_result(pr, has_range_changing_mod, self.config) + + return pr + + def parse_result(self, source: ExtractResult, reference: datetime) -> DateTimeParseResult: + result = None + + if source.type == Constants.SYS_DATETIME_DATE: + if source.meta_data and source.meta_data.is_holiday: + result = self.config.holiday_parser.parse(source, reference) + else: + result = self.config.date_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_TIME: + result = self.config.time_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_DATETIME: + result = self.config.date_time_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_DATEPERIOD: + result = self.config.date_period_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_TIMEPERIOD: + result = self.config.time_period_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_DATETIMEPERIOD: + result = self.config.date_time_period_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_DURATION: + result = self.config.duration_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_DATETIMEALT: + result = self.config.date_time_alt_parser.parse(source, reference) + else: + return None + + return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_time.py new file mode 100644 index 0000000000..437456d9cf --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_time.py @@ -0,0 +1,174 @@ +from abc import abstractmethod +from datetime import datetime +from typing import Dict, List, Match, Optional, Pattern + +import regex + +from recognizers_date_time.date_time.constants import Constants, TimeTypeConstants +from recognizers_date_time.date_time.data_structures import TimeType +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeExtra, + DateTimeFormatUtil, + DateTimeOptionsConfiguration, + ExtractResultExtension, + RegExpUtility, + TimeFunctions, +) +from recognizers_date_time.resources import BaseDateTime +from recognizers_text.extractor import ExtractResult + + +class CJKTimeExtractorConfiguration(DateTimeOptionsConfiguration): + + @property + @abstractmethod + def regexes(self) -> Dict[Pattern, TimeType]: + raise NotImplementedError + + @property + @abstractmethod + def ambiguity_time_filters_dict(self) -> Dict[Pattern, Pattern]: + raise NotImplementedError + + +class BaseCJKTimeExtractor(DateTimeExtractor): + @property + def hour_regex(self) -> Pattern: + return self._hour_regex + + @property + def minute_regex(self) -> Pattern: + return self._minute_regex + + @property + def second_regex(self) -> Pattern: + return self._second_regex + + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_TIME + + def __init__(self, config: CJKTimeExtractorConfiguration): + self.config = config + self._hour_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.HourRegex) + self._minute_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.MinuteRegex) + self._second_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.SecondRegex) + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + + result: List[ExtractResult] = list() + if not source: + return result + + match_source: Dict[Match, any] = dict() + matched: List[bool] = [False] * len(source) + + collections = list(map(lambda x: (list(regex.finditer(x[0], source)), x[1]), self.config.regexes.items())) + collections = list(filter(lambda x: len(x[0]) > 0, collections)) + + for collection in collections: + for match in collection[0]: + for j in range(len(match.group())): + matched[match.start() + j] = True + match_source[match] = collection[1] + + last = -1 + for i in range(len(source)): + if matched[i]: + if i + 1 == len(source) or not matched[i + 1]: + start = last + 1 + length = i - last + text = source[start : start + length].strip() + src_match = next( + (x for x in iter(match_source) if (x.start() == start and (x.end() - x.start()) == length)), + None, + ) + if src_match: + value = ExtractResult() + value.start = start + value.length = length + value.text = text + value.type = self.extractor_type_name + value.data = self.__get_data(match_source, src_match) + result.append(value) + else: + last = i + + result = ExtractResultExtension.filter_ambiguity(result, source, self.config.ambiguity_time_filters_dict) + + return result + + @staticmethod + def __get_data(source: Dict[Match, any], key: Match) -> any: + if key not in source: + return None + + result = DateTimeExtra() + result.data_type = source[key] + result.named_entity = key.capturesdict() + result.match = key + return result + + +class CJKTimeParserConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_func(self) -> TimeFunctions: + raise NotImplementedError + + @property + @abstractmethod + def function_map(self): + raise NotImplementedError + + +class BaseCJKTimeParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_TIME + + def __init__(self, config: CJKTimeParserConfiguration): + self.config = config + + def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: + if reference is None: + reference = datetime.now() + + extra: DateTimeExtra = source.data + + if not extra: + result = self.config.time_extractor.extract(source.text, reference) + if result: + extra = result[0].data + + if extra: + time_result = self.config.function_map[extra.data_type](extra) + parse_result = self.config.time_func.pack_time_result(extra, time_result, reference) + + if parse_result.success: + parse_result.future_resolution[TimeTypeConstants.TIME] = DateTimeFormatUtil.format_time( + parse_result.future_value + ) + parse_result.past_resolution[TimeTypeConstants.TIME] = DateTimeFormatUtil.format_time( + parse_result.past_value + ) + + result = DateTimeParseResult(source) + result.value = parse_result + result.data = time_result + result.timex_str = parse_result.timex if parse_result is not None else '' + result.resolution_str = '' + + return result + + return None + + def filter_results(self, query: str, candidate_results: List[DateTimeParseResult]): + return candidate_results diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_timeperiod.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_timeperiod.py new file mode 100644 index 0000000000..8a0e785229 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/CJK/base_timeperiod.py @@ -0,0 +1,212 @@ +from abc import abstractmethod +from collections import namedtuple +from datetime import datetime +from typing import Dict, List, Match, Optional, Pattern + +import regex + +from recognizers_date_time.date_time.constants import Constants, TimeTypeConstants +from recognizers_date_time.date_time.data_structures import PeriodType +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeExtra, + DateTimeFormatUtil, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DateUtils, + ExtractResultExtension, + TimeFunctions, + TimePeriodFunctions, +) +from recognizers_text.extractor import ExtractResult + + +class CJKTimePeriodExtractorConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def regexes(self) -> Dict[Pattern, PeriodType]: + raise NotImplementedError + + @property + @abstractmethod + def ambiguity_time_period_filters_dict(self) -> Dict[Pattern, Pattern]: + raise NotImplementedError + + +class BaseCJKTimePeriodExtractor(DateTimeExtractor): + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_TIMEPERIOD + + def __init__(self, config: CJKTimePeriodExtractorConfiguration): + self.config = config + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + result: List[ExtractResult] = list() + if not source: + return result + + match_source: Dict[Match, any] = dict() + matched: List[bool] = [False] * len(source) + + collections = list(map(lambda x: (list(regex.finditer(x[0], source)), x[1]), self.config.regexes.items())) + collections = list(filter(lambda x: len(x[0]) > 0, collections)) + + for collection in collections: + for match in collection[0]: + for j in range(len(match.group())): + matched[match.start() + j] = True + match_source[match] = collection[1] + + last = -1 + for i in range(len(source)): + if matched[i]: + if i + 1 == len(source) or not matched[i + 1]: + start = last + 1 + length = i - last + text = source[start : start + length].strip() + src_match = next( + (x for x in iter(match_source) if (x.start() == start and (x.end() - x.start()) == length)), + None, + ) + if src_match: + value = ExtractResult() + value.start = start + value.length = length + value.text = text + value.type = self.extractor_type_name + value.data = self.__get_data(match_source, src_match) + result.append(value) + else: + last = i + + result = ExtractResultExtension.filter_ambiguity(result, source, self.config.ambiguity_time_period_filters_dict) + + return result + + @staticmethod + def __get_data(source: Dict[Match, any], key: Match) -> any: + if key not in source: + return None + + result = DateTimeExtra() + result.data_type = source[key] + result.named_entity = key.capturesdict() + result.match = key + return result + + +MatchedTimeRegex = namedtuple('MatchedTimeRegex', ['matched', 'timex', 'begin_hour', 'end_hour', 'end_min']) + + +class CJKTimePeriodParserConfiguration(DateTimeOptionsConfiguration): + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def time_func(self) -> TimeFunctions: + raise NotImplementedError + + @abstractmethod + def get_matched_timex_range(self, text: str) -> dict: + raise NotImplementedError + + +class BaseCJKTimePeriodParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_TIMEPERIOD + + def __init__(self, config: CJKTimePeriodParserConfiguration): + self.config = config + + def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: + if reference is None: + reference = datetime.now() + + result = DateTimeParseResult(source) + extra: DateTimeExtra = source.data + + if not extra: + result = self.config.time_extractor.extract(source.text, reference) + extra = result.data + + if extra: + parse_result = self.parse_time_of_day(source.text, reference) + + if not parse_result.success: + parse_result = TimePeriodFunctions.handle( + self.config.time_parser, extra, reference, self.config.time_func + ) + + if parse_result.success: + parse_result.future_resolution[TimeTypeConstants.START_TIME] = DateTimeFormatUtil.format_time( + parse_result.future_value[0] + ) + parse_result.future_resolution[TimeTypeConstants.END_TIME] = DateTimeFormatUtil.format_time( + parse_result.future_value[1] + ) + parse_result.past_resolution[TimeTypeConstants.START_TIME] = DateTimeFormatUtil.format_time( + parse_result.past_value[0] + ) + parse_result.past_resolution[TimeTypeConstants.END_TIME] = DateTimeFormatUtil.format_time( + parse_result.past_value[1] + ) + + result.value = parse_result + result.timex_str = parse_result.timex if parse_result is not None else '' + result.resolution_str = '' + + return result + + return None + + def filter_results(self, query: str, candidate_results: List[DateTimeParseResult]): + return candidate_results + + def parse_time_of_day(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + + day = reference.day + month = reference.month + year = reference.year + + parameters = self.config.get_matched_timex_range(source) + if parameters['matched'] is False: + return DateTimeResolutionResult() + + end_hour = parameters['end_hour'] + begin_hour = parameters['begin_hour'] + + # Add "early"/"late" Mod + if (end_hour == begin_hour + Constants.HALF_MID_DAY_DURATION_HOUR_COUNT) and ( + begin_hour == Constants.MORNING_BEGIN_HOUR or begin_hour == Constants.AFTERNOON_BEGIN_HOUR + ): + result.comment = Constants.COMMENT_EARLY + result.mod = TimeTypeConstants.EARLY_MOD + + if (begin_hour == end_hour - Constants.HALF_MID_DAY_DURATION_HOUR_COUNT) and ( + end_hour == Constants.MORNING_END_HOUR or end_hour == Constants.AFTERNOON_END_HOUR + ): + result.comment = Constants.COMMENT_LATE + result.mod = TimeTypeConstants.LATE_MOD + + result.timex = parameters['timex'] + result.future_value = result.past_value = [ + DateUtils.safe_create_from_min_value(year, month, day, parameters['begin_hour'], 0, 0), + DateUtils.safe_create_from_min_value( + year, month, day, parameters['end_hour'], parameters['end_min'], parameters['end_min'] + ), + ] + + result.success = True + return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/__init__.py index cf208f8751..49a3e30004 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/__init__.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/__init__.py @@ -1,9 +1,10 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from .date_time_recognizer import * from .constants import * +from .date_time_recognizer import * from .models import * +from .data_structures import * from .extractors import * from .parsers import * from .utilities import * @@ -15,12 +16,17 @@ from .base_timeperiod import * from .base_datetime import * from .base_datetimeperiod import * -from .base_set import * from .base_holiday import * from .base_merged import * -from .base_timezone import * +from .base_minimal_merged import * +from .base_minimal_configs import * +from .CJK import * from .english import * from .spanish import * from .chinese import * from .french import * from .portuguese import * +from .dutch import * +from .japanese import * +from .arabic import * +from .catalan import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/abstract_year_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/abstract_year_extractor.py index 002e7fca7c..7f1c84b7d9 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/abstract_year_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/abstract_year_extractor.py @@ -1,13 +1,13 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +import datetime from abc import abstractmethod from typing import List, Match -import datetime -from recognizers_text.extractor import ExtractResult -from recognizers_date_time.date_time.date_extractor import DateExtractor from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.date_extractor import DateExtractor +from recognizers_text.extractor import ExtractResult from recognizers_text.utilities import RegExpUtility @@ -43,30 +43,35 @@ def get_year_from_text(self, match: Match) -> int: er = ExtractResult() er.text = first_two_year_num_str er.start = match.string.index(RegExpUtility.get_group(match, Constants.FIRST_TWO_YEAR_NUM)) - er.length = len(RegExpUtility.get_group( - match, Constants.FIRST_TWO_YEAR_NUM)) + er.length = len(RegExpUtility.get_group(match, Constants.FIRST_TWO_YEAR_NUM)) - first_two_year_num = self.config.number_parser.parse(er).value if \ - self.config.number_parser.parse(er).value else 0 + first_two_year_num = ( + self.config.number_parser.parse(er).value if self.config.number_parser.parse(er).value else 0 + ) last_two_year_num = 0 - last_two_year_num_str = RegExpUtility.get_group( - match, Constants.LAST_TWO_YEAR_NUM) + last_two_year_num_str = RegExpUtility.get_group(match, Constants.LAST_TWO_YEAR_NUM) if not (str.isspace(last_two_year_num_str) or last_two_year_num_str is None): er = ExtractResult() er.text = last_two_year_num_str er.start = match.string.index(RegExpUtility.get_group(match, Constants.LAST_TWO_YEAR_NUM)) - er.length = len(RegExpUtility.get_group( - match, Constants.LAST_TWO_YEAR_NUM)) + er.length = len(RegExpUtility.get_group(match, Constants.LAST_TWO_YEAR_NUM)) - last_two_year_num = self.config.number_parser.parse(er).value if \ - self.config.number_parser.parse(er).value else 0 + last_two_year_num = ( + self.config.number_parser.parse(er).value if self.config.number_parser.parse(er).value else 0 + ) # Exclude pure number like "nineteen", "twenty four" - if (first_two_year_num < 100 and last_two_year_num == 0)\ - or (first_two_year_num < 100 and first_two_year_num % 10 == 0 - and len(last_two_year_num_str.strip().split(' ')) == 1): + if (first_two_year_num < 100 and last_two_year_num == 0) or ( + first_two_year_num < 100 + and first_two_year_num % 10 == 0 + and ( + len(last_two_year_num_str.strip().split(' ')) == 1 + and len(last_two_year_num_str.strip().split('-')) == 1 + and last_two_year_num < 10 + ) + ): year = Constants.INVALID_YEAR return year @@ -84,12 +89,11 @@ def get_year_from_text(self, match: Match) -> int: er.start = match.string.index(RegExpUtility.get_group(match, Constants.FULL_YEAR_GROUP_NAME)) er.length = len(RegExpUtility.get_group(match, Constants.FULL_YEAR_GROUP_NAME)) - year = self.config.number_parser.parse(er).value if \ - self.config.number_parser.parse(er).value else 0 + year = self.config.number_parser.parse(er).value if self.config.number_parser.parse(er).value else 0 if 100 > year >= Constants.MIN_TWO_DIGIT_YEAR_PAST_NUM: year += 1900 elif 0 <= year < Constants.MAX_TWO_DIGIT_YEAR_FUTURE_NUM: year += 2000 - return year + return int(year) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/base_configs.py new file mode 100644 index 0000000000..0b1040e0e3 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/base_configs.py @@ -0,0 +1,8 @@ +from recognizers_date_time.date_time.utilities import DateTimeUtilityConfiguration +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime + + +class ArabicDateTimeUtilityConfiguration(DateTimeUtilityConfiguration): + + def __init__(self): + super().__init__(ArabicDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/common_configs.py new file mode 100644 index 0000000000..2c86d830f8 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/common_configs.py @@ -0,0 +1,209 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.arabic.base_configs import ArabicDateTimeUtilityConfiguration +from recognizers_date_time.date_time.arabic.date_extractor_config import ArabicDateExtractorConfiguration +from recognizers_date_time.date_time.arabic.date_parser_config import ArabicDateParserConfiguration +from recognizers_date_time.date_time.arabic.dateperiod_extractor_config import ArabicDatePeriodExtractorConfiguration +from recognizers_date_time.date_time.arabic.dateperiod_parser_config import ArabicDatePeriodParserConfiguration +from recognizers_date_time.date_time.arabic.datetime_extractor_config import ArabicDateTimeExtractorConfiguration +from recognizers_date_time.date_time.arabic.datetime_parser_config import ArabicDateTimeParserConfiguration +from recognizers_date_time.date_time.arabic.datetimeperiod_extractor_config import ( + ArabicDateTimePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.arabic.datetimeperiod_parser_config import ArabicDateTimePeriodParserConfiguration +from recognizers_date_time.date_time.arabic.duration_extractor_config import ArabicDurationExtractorConfiguration +from recognizers_date_time.date_time.arabic.duration_parser_config import ArabicDurationParserConfiguration +from recognizers_date_time.date_time.arabic.parsers import ArabicTimeParser +from recognizers_date_time.date_time.arabic.time_extractor_config import ArabicTimeExtractorConfiguration +from recognizers_date_time.date_time.arabic.time_parser_config import ArabicTimeParserConfiguration +from recognizers_date_time.date_time.arabic.timeperiod_extractor_config import ArabicTimePeriodExtractorConfiguration +from recognizers_date_time.date_time.arabic.timeperiod_parser_config import ArabicTimePeriodParserConfiguration +from recognizers_date_time.date_time.base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from recognizers_date_time.date_time.base_date import BaseDateExtractor, BaseDateParser +from recognizers_date_time.date_time.base_dateperiod import BaseDatePeriodExtractor, BaseDatePeriodParser +from recognizers_date_time.date_time.base_datetime import BaseDateTimeExtractor, BaseDateTimeParser +from recognizers_date_time.date_time.base_datetimeperiod import BaseDateTimePeriodExtractor, BaseDateTimePeriodParser +from recognizers_date_time.date_time.base_duration import BaseDurationExtractor, BaseDurationParser +from recognizers_date_time.date_time.base_time import BaseTimeExtractor +from recognizers_date_time.date_time.base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.resources import ArabicDateTime +from recognizers_number import ( + ArabicCardinalExtractor, + ArabicIntegerExtractor, + ArabicNumberParserConfiguration, + ArabicOrdinalExtractor, + BaseNumberExtractor, + BaseNumberParser, +) + + +class ArabicCommonDateTimeParserConfiguration(BaseDateParserConfiguration): + + @property + def check_both_before_after(self) -> Pattern: + return self._check_both_before_after + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def ordinal_extractor(self) -> BaseNumberExtractor: + return self._ordinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def date_period_extractor(self) -> DateTimeExtractor: + return self._date_period_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def date_time_period_extractor(self) -> DateTimeExtractor: + return self._date_time_period_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> DateTimeParser: + return self._date_time_parser + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def date_period_parser(self) -> DateTimeParser: + return self._date_period_parser + + @property + def time_period_parser(self) -> DateTimeParser: + return self._time_period_parser + + @property + def date_time_period_parser(self) -> DateTimeParser: + return self._date_time_period_parser + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def unit_value_map(self) -> Dict[str, int]: + return self._unit_value_map + + @property + def season_map(self) -> Dict[str, str]: + return self._season_map + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def day_of_week(self) -> Dict[str, int]: + return self._day_of_week + + @property + def double_numbers(self) -> Dict[str, int]: + return self._double_numbers + + @property + def special_year_prefixes(self) -> Dict[str, str]: + return self._special_year_prefixes_map + + @property + def written_decades(self) -> Dict[str, int]: + return self._written_decades + + @property + def special_decade_cases(self) -> Dict[str, int]: + return self._special_decade_cases + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self): + super().__init__() + self._utility_configuration = ArabicDateTimeUtilityConfiguration() + + self._unit_value_map = ArabicDateTime.UnitValueMap + self._season_map = ArabicDateTime.SeasonMap + self._special_year_prefixes_map = ArabicDateTime.SpecialYearPrefixesMap + self._cardinal_map = ArabicDateTime.CardinalMap + self._day_of_week = ArabicDateTime.DayOfWeek + self._month_of_year = ArabicDateTime.MonthOfYear + self._numbers = ArabicDateTime.Numbers + self._double_numbers = ArabicDateTime.DoubleNumbers + self._written_decades = ArabicDateTime.WrittenDecades + self._special_decade_cases = ArabicDateTime.SpecialDecadeCases + + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + + self._unit_map = ArabicDateTime.UnitMap + self._utility_configuration = ArabicDateTimeUtilityConfiguration() + + self._cardinal_extractor = ArabicCardinalExtractor() + self._integer_extractor = ArabicIntegerExtractor() + self._ordinal_extractor = ArabicOrdinalExtractor() + + self._number_parser = BaseNumberParser(ArabicNumberParserConfiguration()) + + # Do not change order. The order of initialization can lead to side-effects + self._date_extractor = BaseDateExtractor(ArabicDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(ArabicTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(ArabicDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(ArabicDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(ArabicTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(ArabicDateTimeExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(ArabicDateTimePeriodExtractorConfiguration()) + + self._duration_parser = BaseDurationParser(ArabicDurationParserConfiguration(self)) + self._date_parser = BaseDateParser(ArabicDateParserConfiguration(self)) + self._time_parser = ArabicTimeParser(ArabicTimeParserConfiguration(self)) + self._date_period_parser = BaseDatePeriodParser(ArabicDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(ArabicTimePeriodParserConfiguration(self)) + self._date_time_parser = BaseDateTimeParser(ArabicDateTimeParserConfiguration(self)) + self._date_time_period_parser = BaseDateTimePeriodParser(ArabicDateTimePeriodParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/date_extractor_config.py new file mode 100644 index 0000000000..29385bcf2c --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/date_extractor_config.py @@ -0,0 +1,78 @@ +from typing import List, Pattern + +from recognizers_date_time.date_time.arabic.base_configs import ArabicDateTimeUtilityConfiguration +from recognizers_date_time.date_time.arabic.duration_extractor_config import ArabicDurationExtractorConfiguration +from recognizers_date_time.date_time.base_date import DateExtractorConfiguration +from recognizers_date_time.date_time.base_duration import BaseDurationExtractor +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.utilities import DateTimeUtilityConfiguration +from recognizers_date_time.resources import ArabicDateTime +from recognizers_number import ( + ArabicIntegerExtractor, + ArabicNumberParserConfiguration, + ArabicOrdinalExtractor, + BaseNumberExtractor, + BaseNumberParser, +) +from recognizers_text.utilities import RegExpUtility + + +class ArabicDateExtractorConfiguration(DateExtractorConfiguration): + + def __init__(self): + super().__init__(ArabicDateTime()) + self.ordinal_extractor: BaseNumberExtractor = ArabicOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = ArabicIntegerExtractor() + self.number_parser: BaseNumberParser = BaseNumberParser(ArabicNumberParserConfiguration()) + self.duration_extractor: DateTimeExtractor = BaseDurationExtractor(ArabicDurationExtractorConfiguration()) + self.utility_configuration: DateTimeUtilityConfiguration = ArabicDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(ArabicDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.ThisRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.LastDateRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.SingleWeekDayRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecialDate), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecialDayWithNumRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeWeekDayRegex), + ] + + @property + def date_regex_list(self) -> List[Pattern]: + if ArabicDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: + date_extractor_4 = ArabicDateTime.DateExtractor5 + date_extractor_5 = ArabicDateTime.DateExtractor8 + date_extractor_6 = ArabicDateTime.DateExtractor7L + date_extractor_7 = ArabicDateTime.DateExtractor9S + date_extractor_8 = ArabicDateTime.DateExtractor4 + date_extractor_9 = ArabicDateTime.DateExtractor6 + date_extractor_10 = ArabicDateTime.DateExtractor9L + date_extractor_11 = ArabicDateTime.DateExtractor7S + else: + date_extractor_4 = ArabicDateTime.DateExtractor4 + date_extractor_5 = ArabicDateTime.DateExtractor6 + date_extractor_6 = ArabicDateTime.DateExtractor7L + date_extractor_7 = ArabicDateTime.DateExtractor7S + date_extractor_8 = ArabicDateTime.DateExtractor5 + date_extractor_9 = ArabicDateTime.DateExtractor8 + date_extractor_10 = ArabicDateTime.DateExtractor9L + date_extractor_11 = ArabicDateTime.DateExtractor9S + + return [ + RegExpUtility.get_safe_reg_exp(ArabicDateTime.DateExtractor1), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.DateExtractor3), + RegExpUtility.get_safe_reg_exp(date_extractor_4), + RegExpUtility.get_safe_reg_exp(date_extractor_5), + RegExpUtility.get_safe_reg_exp(date_extractor_6), + RegExpUtility.get_safe_reg_exp(date_extractor_7), + RegExpUtility.get_safe_reg_exp(date_extractor_8), + RegExpUtility.get_safe_reg_exp(date_extractor_9), + RegExpUtility.get_safe_reg_exp(date_extractor_10), + RegExpUtility.get_safe_reg_exp(date_extractor_11), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.DateExtractorA), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.DateExtractorB), + ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/date_parser_config.py new file mode 100644 index 0000000000..cf42b88fb9 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/date_parser_config.py @@ -0,0 +1,339 @@ +from typing import Dict, List, Pattern + +import regex + +from recognizers_date_time.date_time.arabic.date_extractor_config import ArabicDateExtractorConfiguration +from recognizers_date_time.date_time.base_configs import BaseDateParserConfiguration +from recognizers_date_time.date_time.base_date import DateParserConfiguration +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities import DateTimeUtilityConfiguration +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + +from ..extractors import DateTimeExtractor + + +class ArabicDateParserConfiguration(DateParserConfiguration): + @property + def date_token_prefix(self) -> str: + return self._date_token_prefix + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def ordinal_extractor(self) -> BaseNumberExtractor: + return self._ordinal_extractor + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def date_regex(self) -> List[Pattern]: + return self._date_regex + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def on_regex(self) -> Pattern: + return self._on_regex + + @property + def special_day_regex(self) -> Pattern: + return self._special_day_regex + + @property + def special_day_with_num_regex(self) -> Pattern: + return self._special_day_with_num_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def this_regex(self) -> Pattern: + return self._this_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def week_day_regex(self) -> Pattern: + return self._week_day_regex + + @property + def month_regex(self) -> Pattern: + return self._month_regex + + @property + def week_day_of_month_regex(self) -> Pattern: + return self._week_day_of_month_regex + + @property + def for_the_regex(self) -> Pattern: + return self._for_the_regex + + @property + def week_day_and_day_of_month_regex(self) -> Pattern: + return self._week_day_and_day_of_month_regex + + @property + def week_day_and_day_regex(self) -> Pattern: + return self._week_day_and_day_regex + + @property + def relative_month_regex(self) -> Pattern: + return self._relative_month_regex + + @property + def strict_relative_regex(self) -> Pattern: + return self._strict_relative_regex + + @property + def year_suffix(self) -> Pattern: + return self._year_suffix + + @property + def relative_week_day_regex(self) -> Pattern: + return self._relative_week_day_regex + + @property + def relative_day_regex(self) -> Pattern: + return self._relative_day_regex + + @property + def next_prefix_regex(self) -> Pattern: + return self._next_prefix_regex + + @property + def previous_prefix_regex(self) -> Pattern: + return self._previous_prefix_regex + + @property + def upcoming_prefix_regex(self) -> Pattern: + return self._upcoming_prefix_regex + + @property + def past_prefix_regex(self) -> Pattern: + return self._past_prefix_regex + + @property + def before_after_regex(self) -> Pattern: + return self._before_after_regex + + @property + def tasks_mode_duration_to_date_patterns(self) -> Pattern: + return self._tasks_mode_duration_to_date_patterns + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def day_of_week(self) -> Dict[str, int]: + return self._day_of_week + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def same_day_terms(self) -> List[str]: + return self._same_day_terms + + @property + def plus_one_day_terms(self) -> List[str]: + return self._plus_one_day_terms + + @property + def minus_one_day_terms(self) -> List[str]: + return self._minus_one_day_terms + + @property + def plus_two_day_terms(self) -> List[str]: + return self._plus_two_day_terms + + @property + def minus_two_day_terms(self) -> List[str]: + return self._minus_two_day_terms + + @property + def plus_one_week_terms(self) -> List[str]: + return self._plus_one_week_terms + + @property + def plus_three_day_terms(self) -> List[str]: + return self._plus_three_day_terms + + @property + def plus_four_day_terms(self) -> List[str]: + return self._plus_four_day_terms + + @property + def plus_five_day_terms(self) -> List[str]: + return self._plus_five_day_terms + + @property + def plus_six_day_terms(self) -> List[str]: + return self._plus_six_day_terms + + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self, config: BaseDateParserConfiguration): + self._date_token_prefix = ArabicDateTime.DateTokenPrefix + + self._integer_extractor = config.integer_extractor + self._ordinal_extractor = config.ordinal_extractor + self._cardinal_extractor = config.cardinal_extractor + self._number_parser = config.number_parser + self._date_extractor = config.date_extractor + self._duration_extractor = config.duration_extractor + self._duration_parser = config.duration_parser + + self._date_regex = ArabicDateExtractorConfiguration().date_regex_list + + self._month_of_year = config.month_of_year + self._day_of_month = config.day_of_month + self._day_of_week = config.day_of_week + self._unit_map = config.unit_map + self._cardinal_map = config.cardinal_map + + self._on_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.OnRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextDateRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.LastDateRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ThisRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DateUnitRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekDayRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekDayOfMonthRegex) + self._for_the_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ForTheRegex) + self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekDayAndDayOfMonthRegex) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeMonthRegex) + self._strict_relative_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.StrictRelativeRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearSuffix) + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeWeekDayRegex) + self._before_after_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.BeforeAfterRegex) + + self._utility_configuration = config.utility_configuration + self._date_token_prefix = ArabicDateTime.DateTokenPrefix + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + + self._tasks_mode_duration_to_date_patterns = None + + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PastPrefixRegex) + self._upcoming_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.UpcomingPrefixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PreviousPrefixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextPrefixRegex) + self._relative_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeDayRegex) + + self._plus_one_week_terms = ArabicDateTime.PlusOneWeekTerms + self._minus_two_day_terms = ArabicDateTime.MinusTwoDayTerms + self._plus_two_day_terms = ArabicDateTime.PlusTwoDayTerms + self._minus_one_day_terms = ArabicDateTime.MinusOneDayTerms + self._plus_one_day_terms = ArabicDateTime.PlusOneDayTerms + self._same_day_terms = ArabicDateTime.SameDayTerms + self._plus_three_day_terms = ArabicDateTime.PlusThreeDayTerms + self._plus_four_day_terms = ArabicDateTime.PlusFourDayTerms + self._plus_five_day_terms = ArabicDateTime.PlusFiveDayTerms + self._plus_six_day_terms = ArabicDateTime.PlusSixDayTerms + + def get_swift_month_or_year(self, source: str) -> int: + trimmed_text = source.strip().lower() + swift = 0 + + if regex.search(self._next_prefix_regex, trimmed_text): + swift = 1 + elif regex.search(self._previous_prefix_regex, trimmed_text): + swift = -1 + + return swift + + def is_cardinal_last(self, source: str) -> bool: + trimmed_text = source.strip().lower() + return trimmed_text == "last" + + def normalise(self, text: str) -> str: + return text + + def get_swift_day(self, source: str) -> int: + trimmed_text = source.strip().lower() + swift = 0 + matches = regex.search(self.relative_day_regex, source) + if trimmed_text in self.same_day_terms: + swift = 0 + elif trimmed_text in self.plus_one_day_terms: + swift = 1 + elif trimmed_text in self.minus_one_day_terms: + swift = -1 + elif trimmed_text in self.plus_two_day_terms: + swift = 2 + elif trimmed_text in self.minus_two_day_terms: + swift = -2 + elif trimmed_text in self.plus_three_day_terms: + swift = 3 + elif trimmed_text in self.plus_four_day_terms: + swift = 4 + elif trimmed_text in self.plus_five_day_terms: + swift = 5 + elif trimmed_text in self.plus_six_day_terms: + swift = 6 + elif trimmed_text in self.plus_one_week_terms: + swift = 7 + elif matches: + swift = self.get_swift(source) + + return swift + + def get_swift_month(self, source: str) -> int: + return self.get_swift(source) + + def get_swift(self, source: str) -> int: + trimmed_text = source.strip().lower() + swift = 0 + next_prefix_matches = regex.search(self.next_prefix_regex, trimmed_text) + past_prefix_matches = regex.search(self.past_prefix_regex, trimmed_text) + if next_prefix_matches: + swift = 1 + elif past_prefix_matches: + swift = -1 + + return swift \ No newline at end of file diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/dateperiod_extractor_config.py new file mode 100644 index 0000000000..76e98150ef --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/dateperiod_extractor_config.py @@ -0,0 +1,66 @@ +from recognizers_date_time.date_time.arabic.date_extractor_config import ArabicDateExtractorConfiguration +from recognizers_date_time.date_time.arabic.duration_extractor_config import ArabicDurationExtractorConfiguration +from recognizers_date_time.date_time.base_date import BaseDateExtractor +from recognizers_date_time.date_time.base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex +from recognizers_date_time.date_time.base_duration import BaseDurationExtractor +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_number import ArabicCardinalExtractor, ArabicOrdinalExtractor +from recognizers_number.number import BaseNumberParser +from recognizers_number.number.arabic.extractors import ArabicIntegerExtractor +from recognizers_number.number.arabic.parsers import ArabicNumberParserConfiguration +from recognizers_text.utilities import RegExpUtility + + +class ArabicDatePeriodExtractorConfiguration(DatePeriodExtractorConfiguration): + + def __init__(self): + super().__init__(ArabicDateTime()) + self.ordinal_extractor = ArabicOrdinalExtractor() + self.cardinal_extractor = ArabicCardinalExtractor() + self.cardinal_extractor = ArabicCardinalExtractor() + self.date_point_extractor = BaseDateExtractor(ArabicDateExtractorConfiguration()) + self.number_parser = BaseNumberParser(ArabicNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(ArabicDurationExtractorConfiguration()) + self.integer_extractor = ArabicIntegerExtractor() + self.from_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.FromRegex) + self.simple_cases_regexes = [ + RegExpUtility.get_safe_reg_exp(ArabicDateTime.SimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.BetweenRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.OneWordPeriodRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthWithYear), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthNumWithYear), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekOfMonthRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekOfYearRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthFrontBetweenRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthFrontSimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.QuarterRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.QuarterRegexYearFront), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.AllHalfYearRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.SeasonRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.WhichWeekRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.RestOfDateRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.LaterEarlyPeriodRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekWithWeekDayRangeRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearPlusNumberRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.DecadeWithCenturyRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeDecadeRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.ReferenceDatePeriodRegex), + ] + + def get_from_token_index(self, source: str) -> MatchedIndex: + match = self.from_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def get_between_token_index(self, source: str) -> MatchedIndex: + match = self.between_token_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def has_connector_token(self, source: str) -> bool: + return RegExpUtility.is_exact_match(self.range_connector_regex, source, True) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/dateperiod_parser_config.py new file mode 100644 index 0000000000..e2884c4f03 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/dateperiod_parser_config.py @@ -0,0 +1,385 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.base_configs import BaseDateParserConfiguration +from recognizers_date_time.date_time.base_dateperiod import DatePeriodParserConfiguration +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicDatePeriodParserConfiguration(DatePeriodParserConfiguration): + + @property + def less_than_regex(self) -> Pattern: + return self._less_than_regex + + @property + def more_than_regex(self) -> Pattern: + return self._more_than_regex + + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def reference_date_period_regex(self) -> Pattern: + return self._reference_date_period_regex + + @property + def decade_with_century_regex(self) -> Pattern: + return self._decade_with_century_regex + + @property + def relative_regex(self) -> Pattern: + return self._relative_regex + + @property + def ago_regex(self) -> Pattern: + return self._ago_regex + + @property + def later_regex(self) -> Pattern: + return self._later_regex + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def month_front_between_regex(self) -> Pattern: + return self._month_front_between_regex + + @property + def between_regex(self) -> Pattern: + return self._between_regex + + @property + def month_front_simple_cases_regex(self) -> Pattern: + return self._month_front_simple_cases_regex + + @property + def simple_cases_regex(self) -> Pattern: + return self._simple_cases_regex + + @property + def one_word_period_regex(self) -> Pattern: + return self._one_word_period_regex + + @property + def month_with_year(self) -> Pattern: + return self._month_with_year + + @property + def month_num_with_year(self) -> Pattern: + return self._month_num_with_year + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def past_regex(self) -> Pattern: + return self._past_regex + + @property + def future_regex(self) -> Pattern: + return self._future_regex + + @property + def in_connector_regex(self) -> Pattern: + return self._in_connector_regex + + @property + def week_of_month_regex(self) -> Pattern: + return self._week_of_month_regex + + @property + def week_of_year_regex(self) -> Pattern: + return self._week_of_year_regex + + @property + def quarter_regex(self) -> Pattern: + return self._quarter_regex + + @property + def quarter_regex_year_front(self) -> Pattern: + return self._quarter_regex_year_front + + @property + def all_half_year_regex(self) -> Pattern: + return self._all_half_year_regex + + @property + def season_regex(self) -> Pattern: + return self._season_regex + + @property + def week_of_regex(self) -> Pattern: + return self._week_of_regex + + @property + def month_of_regex(self) -> Pattern: + return self._month_of_regex + + @property + def which_week_regex(self) -> Pattern: + return self._which_week_regex + + @property + def next_prefix_regex(self) -> Pattern: + return self._next_prefix_regex + + @property + def previous_prefix_regex(self) -> Pattern: + return self._past_prefix_regex + + @property + def this_prefix_regex(self) -> Pattern: + return self._this_prefix_regex + + @property + def rest_of_date_regex(self) -> Pattern: + return self._rest_of_date_regex + + @property + def later_early_period_regex(self) -> Pattern: + return self._later_early_period_regex + + @property + def week_with_week_day_range_regex(self) -> Pattern: + return self._week_with_week_day_range_regex + + @property + def unspecific_end_of_range_regex(self) -> Pattern: + return self._unspecific_end_of_range_regex + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def season_map(self) -> Dict[str, str]: + return self._season_map + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def now_regex(self) -> Pattern: + return self._now_regex + + @property + def complex_dateperiod_regex(self) -> Pattern: + return self._complex_dateperiod_regex + + @property + def relative_decade_regex(self) -> Pattern: + return self._relative_decade_regex + + @property + def dynasty_year_regex(self) -> Pattern: + return None + + @property + def dynasty_year_map(self) -> Dict[str, int]: + return None + + @property + def year_plus_number_regex(self) -> Pattern: + return self._year_plus_number_regex + + @property + def year_period_regex(self) -> Pattern: + return self._year_period_regex + + @property + def within_next_prefix_regex(self) -> Pattern: + return self._within_next_prefix_regex + + @property + def century_suffix_regex(self) -> Pattern: + return self._century_suffix_regex + + @property + def first_last_regex(self) -> Pattern: + return self._first_last_regex + + @property + def special_day_regex(self) -> Pattern: + return self._special_day_regex + + @property + def after_next_suffix_regex(self) -> Pattern: + return self._after_next_suffix_regex + + def __init__(self, config: BaseDateParserConfiguration): + self._relative_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeRegex) + self._later_regex = ArabicDateTime.LaterRegex + self._ago_regex = ArabicDateTime.AgoRegex + self._token_before_date = ArabicDateTime.TokenBeforeDate + self.cardinal_extractor = config.cardinal_extractor + self.number_parser = config.number_parser + self._duration_extractor = config.duration_extractor + self._date_extractor = config.date_extractor + self._duration_parser = config.duration_parser + self._date_parser = config.date_parser + + self._after_next_suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AfterNextSuffixRegex) + self._year_plus_number_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearPlusNumberRegex) + self._year_period_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearPeriodRegex) + self._month_front_between_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthFrontBetweenRegex) + self._between_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.BetweenRegex) + self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthFrontSimpleCasesRegex) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.OneWordPeriodRegex) + self._month_with_year = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthWithYear) + self._month_num_with_year = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthNumWithYear) + self._year_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextPrefixRegex) + self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NumberCombinedWithDurationUnit) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekOfYearRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.QuarterRegex) + self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp(ArabicDateTime.QuarterRegexYearFront) + self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AllHalfYearRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SeasonRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WhichWeekRegex) + self._week_of_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekOfRegex) + self._month_of_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MonthOfRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RestOfDateRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.LaterEarlyPeriodRegex) + self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekWithWeekDayRangeRegex) + self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.UnspecificEndOfRangeRegex) + + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextPrefixRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PreviousPrefixRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ThisPrefixRegex) + self._next_suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.FutureSuffixRegex) + self._past_suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PastSuffixRegex) + + self._in_connector_regex = config.utility_configuration.in_connector_regex + self._unit_map = config.unit_map + self._cardinal_map = config.cardinal_map + self._day_of_month = config.day_of_month + self._month_of_year = config.month_of_year + self._season_map = config.season_map + self._now_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NowRegex) + self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DecadeWithCenturyRegex) + self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ComplexDatePeriodRegex) + self._relative_decade_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeDecadeRegex) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ReferenceDatePeriodRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.LessThanRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MoreThanRegex) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WithinNextPrefixRegex) + self._century_suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.CenturySuffixRegex) + self._first_last_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.FirstLastRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecialDayRegex) + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + + def get_swift_day_or_month(self, source: str) -> int: + trimmed_source = source.strip().lower() + swift = 0 + if self.after_next_suffix_regex.search(trimmed_source): + swift = 2 + elif self.next_prefix_regex.search(trimmed_source): + swift = 1 + elif self.previous_prefix_regex.search(trimmed_source): + swift = -1 + + return swift + + def get_swift_year(self, source: str) -> int: + trimmed_source = source.strip().lower() + swift = -10 + + if self.after_next_suffix_regex.search(trimmed_source): + swift = 2 + elif self.next_prefix_regex.search(trimmed_source): + swift = 1 + elif self.previous_prefix_regex.search(trimmed_source): + swift = -1 + elif self.this_prefix_regex.search(trimmed_source): + swift = 0 + + return swift + + def is_future(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.startswith(o) for o in ArabicDateTime.FutureTerms) + + def is_last_cardinal(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in ArabicDateTime.LastCardinalTerms) + + def is_month_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in ArabicDateTime.MonthTerms) or ( + trimmed_source in ArabicDateTime.MonthTerms + and RegExpUtility.get_matches(self.after_next_suffix_regex, trimmed_source) + ) + + def is_month_to_date(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in ArabicDateTime.MonthToDateTerms) + + def is_weekend(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in ArabicDateTime.WeekendTerms) or ( + trimmed_source in ArabicDateTime.WeekendTerms + and RegExpUtility.get_matches(self.after_next_suffix_regex, trimmed_source) + ) + + def is_week_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in ArabicDateTime.WeekTerms) or ( + trimmed_source in ArabicDateTime.WeekTerms + and RegExpUtility.get_matches(self.after_next_suffix_regex, trimmed_source) + ) + + def is_fortnight(self, source: str) -> bool: + return False + + def is_year_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return ( + any(trimmed_source.endswith(o) for o in ArabicDateTime.YearTerms) + or ( + trimmed_source in ArabicDateTime.YearTerms + and RegExpUtility.get_matches(self.after_next_suffix_regex, trimmed_source) + ) + or ( + any(trimmed_source.endswith(o) for o in ArabicDateTime.GenericYearTerms) + and trimmed_source in ArabicDateTime.GenericYearTerms + ) + ) + + def is_year_to_date(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in ArabicDateTime.YearToDateTerms) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetime_extractor_config.py new file mode 100644 index 0000000000..3591aca7d5 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetime_extractor_config.py @@ -0,0 +1,142 @@ +from typing import Pattern + +import regex + +from recognizers_date_time.date_time.arabic.base_configs import ArabicDateTimeUtilityConfiguration +from recognizers_date_time.date_time.arabic.date_extractor_config import ArabicDateExtractorConfiguration +from recognizers_date_time.date_time.arabic.duration_extractor_config import ArabicDurationExtractorConfiguration +from recognizers_date_time.date_time.arabic.time_extractor_config import ArabicTimeExtractorConfiguration +from recognizers_date_time.date_time.base_date import BaseDateExtractor +from recognizers_date_time.date_time.base_datetime import DateTimeExtractorConfiguration +from recognizers_date_time.date_time.base_duration import BaseDurationExtractor +from recognizers_date_time.date_time.base_time import BaseTimeExtractor +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicDateTimeExtractorConfiguration(DateTimeExtractorConfiguration): + @property + def date_point_extractor(self) -> DateTimeExtractor: + return self._date_point_extractor + + @property + def time_point_extractor(self) -> DateTimeExtractor: + return self._time_point_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def suffix_regex(self) -> Pattern: + return self._suffix_regex + + @property + def now_regex(self) -> Pattern: + return self._now_regex + + @property + def time_of_today_after_regex(self) -> Pattern: + return self._time_of_today_after_regex + + @property + def simple_time_of_today_after_regex(self) -> Pattern: + return self._simple_time_of_today_after_regex + + @property + def night_regex(self) -> Pattern: + return self._night_regex + + @property + def time_of_today_before_regex(self) -> Pattern: + return self._time_of_today_before_regex + + @property + def simple_time_of_today_before_regex(self) -> Pattern: + return self._simple_time_of_today_before_regex + + @property + def specific_end_of_regex(self) -> Pattern: + return self._specific_end_of_regex + + @property + def unspecific_end_of_regex(self) -> Pattern: + return self._unspecific_end_of_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def utility_configuration(self) -> ArabicDateTimeUtilityConfiguration: + return self._utility_configuration + + @property + def number_as_time_regex(self) -> Pattern: + return self._number_as_time_regex + + @property + def date_number_connector_regex(self) -> Pattern: + return self._date_number_connector_regex + + @property + def suffix_after_regex(self) -> Pattern: + return self._suffix_after_regex + + @property + def year_suffix(self) -> Pattern: + return self._year_suffix + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def dmy_date_format(self) -> bool: + return self._dmy_date_format + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def prefix_day_regex(self) -> Pattern: + return self._prefix_day_regex + + def __init__(self, dmyDateFormat=True): + super().__init__() + self._date_point_extractor = BaseDateExtractor(ArabicDateExtractorConfiguration()) + self._time_point_extractor = BaseTimeExtractor(ArabicTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(ArabicDurationExtractorConfiguration()) + self._utility_configuration = ArabicDateTimeUtilityConfiguration() + self.preposition_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NowRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SuffixRegex) + self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeOfTodayAfterRegex) + self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.SimpleTimeOfTodayAfterRegex + ) + self._night_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeOfDayRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeOfTodayBeforeRegex) + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeUnitRegex) + self.connector_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ConnectorRegex) + self._number_as_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NumberAsTimeRegex) + self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DateNumberConnectorRegex) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SuffixAfterRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearSuffix) + self._year_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecificTimeOfDayRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PrefixDayRegex) + + def is_connector_token(self, source: str) -> bool: + return ( + source.strip() == '' + or regex.search(self.connector_regex, source) is not None + or regex.search(self.preposition_regex, source) is not None + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetime_parser_config.py new file mode 100644 index 0000000000..a08d3afde9 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetime_parser_config.py @@ -0,0 +1,199 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.base_configs import BaseDateParserConfiguration +from recognizers_date_time.date_time.base_datetime import DateTimeParserConfiguration, MatchedTimex +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities import DateTimeUtilityConfiguration +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + + +class ArabicDateTimeParserConfiguration(DateTimeParserConfiguration): + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def token_before_time(self) -> str: + return self._token_before_time + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def now_regex(self) -> Pattern: + return self._now_regex + + @property + def am_time_regex(self) -> Pattern: + return self._am_time_regex + + @property + def pm_time_regex(self) -> Pattern: + return self._pm_time_regex + + @property + def simple_time_of_today_after_regex(self) -> Pattern: + return self._simple_time_of_today_after_regex + + @property + def simple_time_of_today_before_regex(self) -> Pattern: + return self._simple_time_of_today_before_regex + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def specific_end_of_regex(self) -> Pattern: + return self._specific_end_of_regex + + @property + def unspecific_end_of_regex(self) -> Pattern: + return self._unspecific_end_of_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def night_time_regex(self) -> Pattern: + return self._night_time_regex + + @property + def now_time_regex(self) -> Pattern: + return self._now_time_regex + + @property + def recently_time_regex(self) -> Pattern: + return self._recently_time_regex + + @property + def asap_time_regex(self) -> Pattern: + return self._asap_time_regex + + @property + def next_prefix_regex(self) -> Pattern: + return self._next_prefix_regex + + @property + def previous_prefix_regex(self) -> Pattern: + return self._previous_prefix_regex + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self, config: BaseDateParserConfiguration): + self._token_before_date = ArabicDateTime.TokenBeforeDate + self._token_before_time = ArabicDateTime.TokenBeforeTime + self._date_extractor = config.date_extractor + self._time_extractor = config.time_extractor + self._date_parser = config.date_parser + self._time_parser = config.time_parser + self._now_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NowRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AMTimeRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PMTimeRegex) + self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.SimpleTimeOfTodayAfterRegex + ) + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecificTimeOfDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeUnitRegex) + self._numbers = config.numbers + self._cardinal_extractor = config.cardinal_extractor + self._number_parser = config.number_parser + self._duration_extractor = config.duration_extractor + self._duration_parser = config.duration_parser + self._unit_map = config.unit_map + self._utility_configuration = config.utility_configuration + self._night_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NightTimeRegex) + self._now_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NowTimeRegex) + self._recently_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RecentlyTimeRegex) + self._asap_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AsapTimeRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextPrefixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PreviousPrefixRegex) + + def get_hour(self, source: str, hour: int) -> int: + source = source.strip().lower() + + if RegExpUtility.match_end(self.am_time_regex, source, False) and hour >= Constants.HALF_DAY_HOUR_COUNT: + return hour - 12 + elif ( + not RegExpUtility.match_end(self.am_time_regex, source, False) + and hour < Constants.HALF_DAY_HOUR_COUNT + and not ( + RegExpUtility.match_end(self.pm_time_regex, source, False) and hour < Constants.QUARTER_DAY_HOUR_COUNT + ) + ): + return hour + 12 + + return hour + + def get_matched_now_timex(self, source: str) -> MatchedTimex: + + if RegExpUtility.match_end(self.now_time_regex, source, True): + return MatchedTimex(True, 'PRESENT_REF') + elif RegExpUtility.match_end(self.recently_time_regex, source, True): + return MatchedTimex(True, 'PAST_REF') + elif RegExpUtility.match_end(self.asap_time_regex, source, True): + return MatchedTimex(True, 'FUTURE_REF') + + return MatchedTimex(False, None) + + def get_swift_day(self, source: str) -> int: + + if RegExpUtility.match_begin(self.next_prefix_regex, source, True): + return 1 + elif RegExpUtility.match_begin(self.previous_prefix_regex, source, True): + return -1 + + return 0 + + def have_ambiguous_token(self, source: str, matched_text: str) -> bool: + return False diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetimeperiod_extractor_config.py new file mode 100644 index 0000000000..85e856d391 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetimeperiod_extractor_config.py @@ -0,0 +1,212 @@ +from typing import List, Pattern + +from recognizers_date_time.date_time.arabic.date_extractor_config import ArabicDateExtractorConfiguration +from recognizers_date_time.date_time.arabic.datetime_extractor_config import ArabicDateTimeExtractorConfiguration +from recognizers_date_time.date_time.arabic.duration_extractor_config import ArabicDurationExtractorConfiguration +from recognizers_date_time.date_time.arabic.time_extractor_config import ArabicTimeExtractorConfiguration +from recognizers_date_time.date_time.arabic.timeperiod_extractor_config import ArabicTimePeriodExtractorConfiguration +from recognizers_date_time.date_time.base_date import BaseDateExtractor +from recognizers_date_time.date_time.base_datetime import BaseDateTimeExtractor +from recognizers_date_time.date_time.base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex +from recognizers_date_time.date_time.base_duration import BaseDurationExtractor +from recognizers_date_time.date_time.base_time import BaseTimeExtractor +from recognizers_date_time.date_time.base_timeperiod import BaseTimePeriodExtractor +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.utilities import DateTimeOptions +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_number import ArabicCardinalExtractor, BaseNumberExtractor +from recognizers_text.utilities import RegExpUtility + + +class ArabicDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): + + @property + def check_both_before_after(self) -> Pattern: + return self._check_both_before_after + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def single_date_extractor(self) -> DateTimeExtractor: + return self._single_date_extractor + + @property + def single_time_extractor(self) -> DateTimeExtractor: + return self._single_time_extractor + + @property + def single_date_time_extractor(self) -> DateTimeExtractor: + return self._single_date_time_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def simple_cases_regexes(self) -> List[Pattern]: + return self._simple_cases_regexes + + @property + def preposition_regex(self) -> Pattern: + return self._preposition_regex + + @property + def till_regex(self) -> Pattern: + return self._till_regex + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def period_time_of_day_with_date_regex(self) -> Pattern: + return self._period_time_of_day_with_date_regex + + @property + def followed_unit(self) -> Pattern: + return self._followed_unit + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def time_unit_regex(self) -> Pattern: + return self._time_unit_regex + + @property + def previous_prefix_regex(self) -> Pattern: + return self._past_prefix_regex + + @property + def next_prefix_regex(self) -> Pattern: + return self._next_prefix_regex + + @property + def relative_time_unit_regex(self) -> Pattern: + return self._relative_time_unit_regex + + @property + def rest_of_date_time_regex(self) -> Pattern: + return self._rest_of_date_time_regex + + @property + def general_ending_regex(self) -> Pattern: + return self._general_ending_regex + + @property + def middle_pause_regex(self) -> Pattern: + return self._middle_pause_regex + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def within_next_prefix_regex(self) -> Pattern: + return self._within_next_prefix_regex + + @property + def future_suffix_regex(self) -> Pattern: + return self._future_suffix_regex + + @property + def date_unit_regex(self) -> Pattern: + return self._date_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 prefix_day_regex(self) -> Pattern: + return self._prefix_day_regex + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def suffix_regex(self) -> Pattern: + return self._suffix_regex + + @property + def week_day_regex(self) -> Pattern: + return self._week_day_regex + + def __init__(self, dmyDateFormat=True): + super().__init__() + self._week_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WeekDayRegex) + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + self._cardinal_extractor = ArabicCardinalExtractor() + self._single_date_extractor = BaseDateExtractor(ArabicDateExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(ArabicTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseDateTimeExtractor(ArabicDateTimeExtractorConfiguration(dmyDateFormat)) + self._duration_extractor = BaseDurationExtractor(ArabicDurationExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(ArabicTimePeriodExtractorConfiguration()) + self._simple_cases_regexes = [ + RegExpUtility.get_safe_reg_exp(ArabicDateTime.PureNumFromTo), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.PureNumBetweenAnd), + ] + self._preposition_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PeriodSpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PeriodTimeOfDayRegex) + self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.PeriodTimeOfDayWithDateRegex + ) + self._followed_unit = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeFollowedUnit) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeNumberCombinedWithUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeUnitRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PreviousPrefixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextPrefixRegex) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RestOfDateTimeRegex) + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.GeneralEndingRegex) + self._middle_pause_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MiddlePauseRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RangeConnectorRegex) + self._token_before_date = ArabicDateTime.TokenBeforeDate + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WithinNextPrefixRegex) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.FutureSuffixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DateUnitRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PmDescRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AfterRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SuffixRegex) + self._options = DateTimeOptions.NONE + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + + def get_from_token_index(self, source: str) -> MatchedIndex: + if source.endswith('from'): + return MatchedIndex(matched=True, index=source.rfind('from')) + + return MatchedIndex(matched=False, index=-1) + + def get_between_token_index(self, source: str) -> MatchedIndex: + if source.endswith('between'): + return MatchedIndex(matched=True, index=source.rfind('between')) + + return MatchedIndex(matched=False, index=-1) + + def has_connector_token(self, source: str) -> bool: + return RegExpUtility.is_exact_match(self.range_connector_regex, source, True) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetimeperiod_parser_config.py new file mode 100644 index 0000000000..cccdfc8c13 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/datetimeperiod_parser_config.py @@ -0,0 +1,223 @@ +from typing import Dict, Pattern + +import regex + +from recognizers_date_time.date_time.base_configs import BaseDateParserConfiguration +from recognizers_date_time.date_time.base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def future_suffix_regex(self): + return self._future_suffix_regex + + @property + def within_next_prefix_regex(self): + return self._within_next_prefix_regex + + def __init__(self, config: BaseDateParserConfiguration): + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeOfDayRegex) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.FutureSuffixRegex) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WithinNextPrefixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PreviousPrefixRegex) + self._cardinal_extractor = config.cardinal_extractor + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PmDescRegex) + self._token_before_date = ArabicDateTime.TokenBeforeDate + self._token_before_time = ArabicDateTime.TokenBeforeTime + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PureNumBetweenAnd) + self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.PeriodTimeOfDayWithDateRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PeriodSpecificTimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PreviousPrefixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextPrefixRegex) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RestOfDateTimeRegex) + self._numbers = config.numbers + self._unit_map = config.unit_map + self._date_extractor = config.date_extractor + self._time_extractor = config.time_extractor + self._date_time_extractor = config.date_time_extractor + self._time_period_extractor = config.time_period_extractor + self._duration_extractor = config.duration_extractor + self._date_parser = config.date_parser + self._time_parser = config.time_parser + self._date_time_parser = config.date_time_parser + self._time_period_parser = config.time_period_parser + self._duration_parser = config.duration_parser + self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MorningStartEndRegex) + self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AfternoonStartEndRegex) + self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.EveningStartEndRegex) + self.night_start_end_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NightStartEndRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PrefixDayRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AfterRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.BeforeRegex) + + @property + def previous_prefix_regex(self): + return self._previous_prefix_regex + + @property + def cardinal_extractor(self): + return self._cardinal_extractor + + @property + def am_desc_regex(self): + return self._am_desc_regex + + @property + def pm_desc_regex(self): + return self._pm_desc_regex + + @property + def before_regex(self): + return self._before_regex + + @property + def after_regex(self): + return self._after_regex + + @property + def prefix_day_regex(self): + return self._prefix_day_regex + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def token_before_time(self): + return self._token_before_time + + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def pure_number_from_to_regex(self) -> Pattern: + return self._pure_number_from_to_regex + + @property + def pure_number_between_and_regex(self) -> Pattern: + return self._pure_number_between_and_regex + + @property + def period_time_of_day_with_date_regex(self) -> Pattern: + return self._period_time_of_day_with_date_regex + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def past_regex(self) -> Pattern: + return self._past_regex + + @property + def future_regex(self) -> Pattern: + return self._future_regex + + @property + def relative_time_unit_regex(self) -> Pattern: + return self._relative_time_unit_regex + + @property + def rest_of_date_time_regex(self) -> Pattern: + return self._rest_of_date_time_regex + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> DateTimeParser: + return self._date_time_parser + + @property + def time_period_parser(self) -> DateTimeParser: + return self._time_period_parser + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + def get_matched_time_range(self, source: str): + begin_hour = 0 + end_hour = 0 + end_min = 0 + if regex.search(self.morning_start_end_regex, source): + time_str = 'TMO' + begin_hour = 8 + end_hour = Constants.HALF_DAY_HOUR_COUNT + elif regex.search(self.afternoon_start_end_regex, source): + time_str = 'TAF' + begin_hour = Constants.HALF_DAY_HOUR_COUNT + end_hour = 16 + elif regex.search(self.evening_start_end_regex, source): + time_str = 'TEV' + begin_hour = 16 + end_hour = 20 + elif regex.search(self.night_start_end_regex, source): + time_str = 'TNI' + begin_hour = 20 + end_hour = 23 + end_min = 59 + else: + time_str = '' + return MatchedTimeRange(time_str, begin_hour, end_hour, end_min, False) + + return MatchedTimeRange(time_str, begin_hour, end_hour, end_min, True) + + def get_swift_prefix(self, source: str) -> int: + if source.startswith('next'): + return 1 + + if source.startswith('last'): + return -1 + + return 0 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/duration_extractor_config.py new file mode 100644 index 0000000000..5350b69103 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/duration_extractor_config.py @@ -0,0 +1,120 @@ +from typing import Pattern + +from recognizers_date_time.date_time.base_duration import DurationExtractorConfiguration +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_number.number.arabic.extractors import ArabicCardinalExtractor +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_text.utilities import RegExpUtility + + +class ArabicDurationExtractorConfiguration(DurationExtractorConfiguration): + + @property + def special_number_unit_regex(self): + return self._special_number_unit_regex + + @property + def check_both_before_after(self): + return self._check_both_before_after + + @property + def all_regex(self) -> Pattern: + return self._all_regex + + @property + def half_regex(self) -> Pattern: + return self._half_regex + + @property + def followed_unit(self) -> Pattern: + return self._followed_unit + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def an_unit_regex(self) -> Pattern: + return self._an_unit_regex + + @property + def inexact_number_unit_regex(self) -> Pattern: + return self._inexact_number_unit_regex + + @property + def suffix_and_regex(self) -> Pattern: + return self._suffix_and_regex + + @property + def relative_duration_unit_regex(self) -> Pattern: + return self._relative_duration_unit_regex + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def during_regex(self) -> Pattern: + return self._during_regex + + @property + def unit_map(self) -> Pattern: + return self._unit_map + + @property + def unit_value_map(self) -> {}: + return self._unit_value_map + + @property + def duration_unit_regex(self) -> {}: + return self._duration_unit_regex + + @property + def duration_connector_regex(self) -> Pattern: + return self._duration_connector_regex + + @property + def more_than_regex(self) -> Pattern: + return self._more_than_regex + + @property + def less_than_regex(self) -> Pattern: + return self._less_than_regex + + @property + def conjunction_regex(self) -> Pattern: + return self._conjunction_regex + + @property + def inexact_number_regex(self) -> Pattern: + return self._inexact_number_regex + + def __init__(self): + super().__init__() + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AllRegex) + self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.HalfRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DurationFollowedUnit) + self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.NumberCombinedWithDurationUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AnUnitRegex) + self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.InexactNumberUnitRegex) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SuffixAndRegex) + self._relative_duration_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.RelativeDurationUnitRegex + ) + self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DuringRegex) + self._cardinal_extractor: BaseNumberExtractor = ArabicCardinalExtractor() + self._unit_map = ArabicDateTime.UnitMap + self._unit_value_map = ArabicDateTime.UnitValueMap + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DurationUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DurationConnectorRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MoreThanRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.LessThanRegex) + self._conjunction_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ConjunctionRegex) + self._inexact_number_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.InexactNumberRegex) + self._special_number_with_unit_regex = None + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + + self._special_number_unit_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/duration_parser_config.py new file mode 100644 index 0000000000..e1bd85cde8 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/duration_parser_config.py @@ -0,0 +1,86 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.arabic.duration_extractor_config import ArabicDurationExtractorConfiguration +from recognizers_date_time.date_time.base_duration import BaseDurationExtractor, DurationParserConfiguration +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_number.number.arabic.extractors import ArabicCardinalExtractor +from recognizers_number.number.arabic.parsers import ArabicNumberParserConfiguration +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + + +class ArabicDurationParserConfiguration(DurationParserConfiguration): + @property + def options(self): + return self._cardinal_extractor + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def followed_unit(self) -> Pattern: + return self._followed_unit + + @property + def suffix_and_regex(self) -> Pattern: + return self._suffix_and_regex + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def an_unit_regex(self) -> Pattern: + return self._an_unit_regex + + @property + def all_date_unit_regex(self) -> Pattern: + return self._all_date_unit_regex + + @property + def half_date_unit_regex(self) -> Pattern: + return self._half_date_unit_regex + + @property + def inexact_number_unit_regex(self) -> Pattern: + return self._inexact_number_unit_regex + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def unit_value_map(self) -> Dict[str, int]: + return self._unit_value_map + + @property + def double_numbers(self) -> Dict[str, float]: + return self._double_numbers + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + def __init__(self, config): + self._duration_extractor = BaseDurationExtractor(ArabicDurationExtractorConfiguration(), False) + self._cardinal_extractor: BaseNumberExtractor = ArabicCardinalExtractor() + self._number_parser: BaseNumberParser = BaseNumberParser(ArabicNumberParserConfiguration()) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DurationFollowedUnit) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SuffixAndRegex) + self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.NumberCombinedWithDurationUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AnUnitRegex) + self._all_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AllRegex) + self._half_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.HalfRegex) + self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.InexactNumberUnitRegex) + self._unit_map: Dict[str, str] = ArabicDateTime.UnitMap + self._unit_value_map: Dict[str, int] = ArabicDateTime.UnitValueMap + self._double_numbers: Dict[str, float] = ArabicDateTime.DoubleNumbers diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/holiday_extractor_config.py new file mode 100644 index 0000000000..2945f6dacf --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/holiday_extractor_config.py @@ -0,0 +1,20 @@ +from typing import List, Pattern + +from recognizers_date_time.date_time.base_holiday import HolidayExtractorConfiguration +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicHolidayExtractorConfiguration(HolidayExtractorConfiguration): + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def holiday_regexes(self) -> List[Pattern]: + return self._holiday_regexes + + def __init__(self): + self._year_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearRegex) + self._holiday_regexes = [RegExpUtility.get_safe_reg_exp(ArabicDateTime.HolidayRegex)] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/holiday_parser_config.py new file mode 100644 index 0000000000..c0a01e4420 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/holiday_parser_config.py @@ -0,0 +1,219 @@ +from datetime import datetime +from typing import Callable, Dict, List + +from recognizers_date_time.date_time.base_holiday import BaseHolidayParserConfiguration +from recognizers_date_time.date_time.utilities import DateUtils +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicHolidayParserConfiguration(BaseHolidayParserConfiguration): + @property + def holiday_names(self) -> Dict[str, List[str]]: + return self._holiday_names + + @property + def holiday_regex_list(self) -> List[str]: + return self._holiday_regexes + + @property + def holiday_func_dictionary(self) -> Dict[str, Callable[[int], datetime]]: + return self._holiday_func_dictionary + + def get_swift_year(self, text: str) -> int: + trimmed_text = text.strip().lower() + swift = -10 + + if self.next_prefix_regex.search(trimmed_text): + swift = 1 + + if self.previous_prefix_regex.search(trimmed_text): + swift = -1 + + if self.this_prefix_regex.search(trimmed_text): + swift = 0 + + return swift + + def sanitize_holiday_token(self, holiday: str) -> str: + return holiday.replace(' ', '').replace('\'', '') + + def __init__(self, config): + super().__init__() + self._holiday_regexes = [RegExpUtility.get_safe_reg_exp(ArabicDateTime.HolidayRegex)] + self._holiday_names = ArabicDateTime.HolidayNames + + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PreviousPrefixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ThisPrefixRegex) + + def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: + local = dict( + [ + ('maosbirthday', ArabicHolidayParserConfiguration.mao_birthday), + ('yuandan', ArabicHolidayParserConfiguration.new_year), + ('teachersday', ArabicHolidayParserConfiguration.teacher_day), + ('singleday', ArabicHolidayParserConfiguration.singles_day), + ('allsaintsday', ArabicHolidayParserConfiguration.halloween_day), + ('youthday', ArabicHolidayParserConfiguration.youth_day), + ('childrenday', ArabicHolidayParserConfiguration.children_day), + ('femaleday', ArabicHolidayParserConfiguration.female_day), + ('treeplantingday', ArabicHolidayParserConfiguration.tree_plant_day), + ('arborday', ArabicHolidayParserConfiguration.tree_plant_day), + ('girlsday', ArabicHolidayParserConfiguration.girls_day), + ('whiteloverday', ArabicHolidayParserConfiguration.white_lover_day), + ('loverday', ArabicHolidayParserConfiguration.valentines_day), + ('christmas', ArabicHolidayParserConfiguration.christmas_day), + ('xmas', ArabicHolidayParserConfiguration.christmas_day), + ('newyear', ArabicHolidayParserConfiguration.new_year), + ('newyearday', ArabicHolidayParserConfiguration.new_year), + ('newyearsday', ArabicHolidayParserConfiguration.new_year), + ('inaugurationday', ArabicHolidayParserConfiguration.inauguration_day), + ('groundhougday', ArabicHolidayParserConfiguration.groundhog_day), + ('valentinesday', ArabicHolidayParserConfiguration.valentines_day), + ('stpatrickday', ArabicHolidayParserConfiguration.st_patrick_day), + ('aprilfools', ArabicHolidayParserConfiguration.fool_day), + ('stgeorgeday', ArabicHolidayParserConfiguration.st_george_day), + ('mayday', ArabicHolidayParserConfiguration.may_day), + ('cincodemayoday', ArabicHolidayParserConfiguration.cinco_de_mayo_day), + ('baptisteday', ArabicHolidayParserConfiguration.baptiste_day), + ('usindependenceday', ArabicHolidayParserConfiguration.usa_independence_day), + ('independenceday', ArabicHolidayParserConfiguration.usa_independence_day), + ('bastilleday', ArabicHolidayParserConfiguration.bastille_day), + ('halloweenday', ArabicHolidayParserConfiguration.halloween_day), + ('allhallowday', ArabicHolidayParserConfiguration.all_hallow_day), + ('allsoulsday', ArabicHolidayParserConfiguration.all_souls_day), + ('guyfawkesday', ArabicHolidayParserConfiguration.guy_fawkes_day), + ('veteransday', ArabicHolidayParserConfiguration.veterans_day), + ('christmaseve', ArabicHolidayParserConfiguration.christmas_eve), + ('newyeareve', ArabicHolidayParserConfiguration.new_year_eve), + ('easterday', ArabicHolidayParserConfiguration.easter_day), + ('juneteenth', ArabicHolidayParserConfiguration.juneteenth), + ] + ) + + return {**super()._init_holiday_funcs(), **local} + + @staticmethod + def mao_birthday(year: int) -> datetime: + return datetime(year, 12, 26) + + @staticmethod + def new_year(year: int) -> datetime: + return datetime(year, 1, 1) + + @staticmethod + def teacher_day(year: int) -> datetime: + return datetime(year, 9, 10) + + @staticmethod + def singles_day(year: int) -> datetime: + return datetime(year, 11, 11) + + @staticmethod + def halloween_day(year: int) -> datetime: + return datetime(year, 10, 31) + + @staticmethod + def youth_day(year: int) -> datetime: + return datetime(year, 5, 4) + + @staticmethod + def children_day(year: int) -> datetime: + return datetime(year, 6, 1) + + @staticmethod + def female_day(year: int) -> datetime: + return datetime(year, 3, 8) + + @staticmethod + def tree_plant_day(year: int) -> datetime: + return datetime(year, 3, 12) + + @staticmethod + def girls_day(year: int) -> datetime: + return datetime(year, 3, 7) + + @staticmethod + def white_lover_day(year: int) -> datetime: + return datetime(year, 3, 14) + + @staticmethod + def valentines_day(year: int) -> datetime: + return datetime(year, 2, 14) + + @staticmethod + def christmas_day(year: int) -> datetime: + return datetime(year, 12, 25) + + @staticmethod + def inauguration_day(year: int) -> datetime: + return datetime(year, 1, 20) + + @staticmethod + def groundhog_day(year: int) -> datetime: + return datetime(year, 2, 2) + + @staticmethod + def st_patrick_day(year: int) -> datetime: + return datetime(year, 3, 17) + + @staticmethod + def fool_day(year: int) -> datetime: + return datetime(year, 4, 1) + + @staticmethod + def st_george_day(year: int) -> datetime: + return datetime(year, 4, 23) + + @staticmethod + def may_day(year: int) -> datetime: + return datetime(year, 5, 1) + + @staticmethod + def cinco_de_mayo_day(year: int) -> datetime: + return datetime(year, 5, 5) + + @staticmethod + def baptiste_day(year: int) -> datetime: + return datetime(year, 6, 24) + + @staticmethod + def usa_independence_day(year: int) -> datetime: + return datetime(year, 7, 4) + + @staticmethod + def bastille_day(year: int) -> datetime: + return datetime(year, 7, 14) + + @staticmethod + def all_hallow_day(year: int) -> datetime: + return datetime(year, 11, 1) + + @staticmethod + def all_souls_day(year: int) -> datetime: + return datetime(year, 11, 2) + + @staticmethod + def guy_fawkes_day(year: int) -> datetime: + return datetime(year, 11, 5) + + @staticmethod + def veterans_day(year: int) -> datetime: + return datetime(year, 11, 11) + + @staticmethod + def christmas_eve(year: int) -> datetime: + return datetime(year, 12, 24) + + @staticmethod + def new_year_eve(year: int) -> datetime: + return datetime(year, 12, 31) + + @staticmethod + def easter_day(year: int) -> datetime: + return DateUtils.min_value + + @staticmethod + def juneteenth(year: int) -> datetime: + return datetime(year, 6, 19) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/merged_extractor_config.py new file mode 100644 index 0000000000..e244dbbef6 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/merged_extractor_config.py @@ -0,0 +1,188 @@ +from typing import List, Pattern + +from recognizers_date_time.date_time.arabic.date_extractor_config import ArabicDateExtractorConfiguration +from recognizers_date_time.date_time.arabic.dateperiod_extractor_config import ArabicDatePeriodExtractorConfiguration +from recognizers_date_time.date_time.arabic.datetime_extractor_config import ArabicDateTimeExtractorConfiguration +from recognizers_date_time.date_time.arabic.datetimeperiod_extractor_config import ( + ArabicDateTimePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.arabic.duration_extractor_config import ArabicDurationExtractorConfiguration +from recognizers_date_time.date_time.arabic.holiday_extractor_config import ArabicHolidayExtractorConfiguration +from recognizers_date_time.date_time.arabic.time_extractor_config import ArabicTimeExtractorConfiguration +from recognizers_date_time.date_time.arabic.timeperiod_extractor_config import ArabicTimePeriodExtractorConfiguration +from recognizers_date_time.date_time.base_date import BaseDateExtractor +from recognizers_date_time.date_time.base_dateperiod import BaseDatePeriodExtractor +from recognizers_date_time.date_time.base_datetime import BaseDateTimeExtractor +from recognizers_date_time.date_time.base_datetimeperiod import BaseDateTimePeriodExtractor +from recognizers_date_time.date_time.base_duration import BaseDurationExtractor +from recognizers_date_time.date_time.base_holiday import BaseHolidayExtractor +from recognizers_date_time.date_time.base_merged import MergedExtractorConfiguration +from recognizers_date_time.date_time.base_time import BaseTimeExtractor +from recognizers_date_time.date_time.base_timeperiod import BaseTimePeriodExtractor +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_date_time.resources.base_date_time import BaseDateTime +from recognizers_number import ArabicIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class ArabicMergedExtractorConfiguration(MergedExtractorConfiguration): + @property + def check_both_before_after(self): + return self._check_both_before_after + + @property + def datetime_alt_extractor(self): + return self._datetime_alt_extractor + + @property + def term_filter_regexes(self) -> List[Pattern]: + return self._term_filter_regexes + + @property + def fail_fast_regex(self) -> Pattern: + return self._fail_fast_regex + + @property + def superfluous_word_matcher(self) -> Pattern: + return self._superfluous_word_matcher + + @property + def unspecified_date_period_regex(self) -> Pattern: + return self._unspecified_date_period_regex + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def date_period_extractor(self) -> DateTimeExtractor: + return self._date_period_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def date_time_period_extractor(self) -> DateTimeExtractor: + return self._date_time_period_extractor + + @property + def holiday_extractor(self) -> DateTimeExtractor: + return self._holiday_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def integer_extractor(self) -> Extractor: + return self._integer_extractor + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def since_regex(self) -> Pattern: + return self._since_regex + + @property + def around_regex(self) -> Pattern: + return self._around_regex + + @property + def equal_regex(self) -> Pattern: + return self._equal_regex + + @property + def suffix_after_regex(self) -> Pattern: + return self._suffix_after_regex + + @property + def from_to_regex(self) -> Pattern: + return self._from_to_regex + + @property + def single_ambiguous_month_regex(self) -> Pattern: + return self._single_ambiguous_month_regex + + @property + def preposition_suffix_regex(self) -> Pattern: + return self._preposition_suffix_regex + + @property + def number_ending_pattern(self) -> Pattern: + return self._number_ending_pattern + + @property + def filter_word_regex_list(self) -> List[Pattern]: + return self._filter_word_regex_list + + @property + def ambiguous_range_modifier_prefix(self) -> Pattern: + return None + + @property + def ambiguity_filters_dict(self) -> Pattern: + return self._ambiguity_filters_dict + + @property + def potential_ambiguous_range_regex(self) -> Pattern: + return self._potential_ambiguous_range_regex + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + def __init__(self): + self._before_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SinceRegex) + self._from_to_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.FromToRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearRegex) + self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SingleAmbiguousMonthRegex) + self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PrepositionSuffixRegex) + self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NumberEndingPattern) + + self._date_extractor = BaseDateExtractor(ArabicDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(ArabicTimeExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(ArabicDateTimeExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(ArabicDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(ArabicTimePeriodExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(ArabicDateTimePeriodExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(ArabicDurationExtractorConfiguration()) + self._holiday_extractor = BaseHolidayExtractor(ArabicHolidayExtractorConfiguration()) + self._integer_extractor = ArabicIntegerExtractor() + self._filter_word_regex_list = [] + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.UnspecificDatePeriodRegex) + self._around_regex = ArabicDateTime.AroundRegex + self._equal_regex = BaseDateTime.EqualRegex + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SuffixAfterRegex) + self._potential_ambiguous_range_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.FromToRegex) + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + self._term_filter_regexes = [ + RegExpUtility.get_safe_reg_exp(ArabicDateTime.OneOnOneRegex), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.SingleAmbiguousTermsRegex), + ] + # TODO When the implementation for these properties is added, change the None values to their respective Regexps + self._superfluous_word_matcher = None + self._fail_fast_regex = None + self._datetime_alt_extractor = None + self._ambiguity_filters_dict = DefinitionLoader.load_ambiguity_filters(ArabicDateTime.AmbiguityFiltersDict) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/merged_parser_config.py new file mode 100644 index 0000000000..635ed70c3f --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/merged_parser_config.py @@ -0,0 +1,93 @@ +from typing import Pattern + +from recognizers_date_time.date_time.arabic.common_configs import ArabicCommonDateTimeParserConfiguration +from recognizers_date_time.date_time.arabic.dateperiod_parser_config import ArabicDatePeriodParserConfiguration +from recognizers_date_time.date_time.arabic.holiday_parser_config import ArabicHolidayParserConfiguration +from recognizers_date_time.date_time.arabic.timeperiod_parser_config import ArabicTimePeriodParserConfiguration +from recognizers_date_time.date_time.base_date import BaseDateParser +from recognizers_date_time.date_time.base_dateperiod import BaseDatePeriodParser +from recognizers_date_time.date_time.base_datetime import BaseDateTimeParser +from recognizers_date_time.date_time.base_datetimeperiod import BaseDateTimePeriodParser +from recognizers_date_time.date_time.base_duration import BaseDurationParser +from recognizers_date_time.date_time.base_holiday import BaseHolidayParser +from recognizers_date_time.date_time.base_merged import MergedParserConfiguration +from recognizers_date_time.date_time.base_time import BaseTimeParser +from recognizers_date_time.date_time.base_timeperiod import BaseTimePeriodParser +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime, BaseDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicMergedParserConfiguration(ArabicCommonDateTimeParserConfiguration, MergedParserConfiguration): + @property + def around_regex(self) -> Pattern: + return self._around_regex + + @property + def equal_regex(self) -> Pattern: + return self._equal_regex + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def suffix_after(self) -> Pattern: + return self._suffix_after + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def since_regex(self) -> Pattern: + return self._since_regex + + @property + def date_parser(self) -> BaseDateParser: + return self._date_parser + + @property + def holiday_parser(self) -> BaseHolidayParser: + return self._holiday_parser + + @property + def time_parser(self) -> BaseTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> BaseDateTimeParser: + return self._date_time_parser + + @property + def date_period_parser(self) -> BaseDatePeriodParser: + return self._date_period_parser + + @property + def time_period_parser(self) -> BaseTimePeriodParser: + return self._time_period_parser + + @property + def date_time_period_parser(self) -> BaseDateTimePeriodParser: + return self._date_time_period_parser + + @property + def duration_parser(self) -> BaseDurationParser: + return self._duration_parser + + def __init__(self, config): + ArabicCommonDateTimeParserConfiguration.__init__(self) + self._suffix_after = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SuffixAfterRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.YearRegex) + self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) + self._around_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AroundRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SinceRegex) + + self._date_period_parser = BaseDatePeriodParser(ArabicDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(ArabicTimePeriodParserConfiguration(self)) + self._holiday_parser = BaseHolidayParser(ArabicHolidayParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/parsers.py new file mode 100644 index 0000000000..a776202b98 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/parsers.py @@ -0,0 +1,34 @@ +from datetime import datetime + +from recognizers_date_time.date_time.base_time import BaseTimeParser +from recognizers_date_time.date_time.utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicTimeParser(BaseTimeParser): + def internal_parser(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = super().internal_parser(source, reference) + if not result.success: + result = self.parse_ish(source, reference) + + return result + + def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + trimmed_source = source.strip().lower() + + match = RegExpUtility.get_safe_reg_exp(ArabicDateTime.IshRegex).match(source) + if match and match.end() == len(trimmed_source): + hour_str = RegExpUtility.get_group(match, 'hour') + hour = 12 + if hour_str: + hour = int(hour_str) + + result.timex = 'T' + DateTimeFormatUtil.to_str(hour, 2) + result.future_value = result.past_value = DateUtils.safe_create_from_min_value( + reference.year, reference.month, reference.day, hour, 0, 0 + ) + result.success = True + + return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/time_extractor_config.py new file mode 100644 index 0000000000..a811e62e70 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/time_extractor_config.py @@ -0,0 +1,150 @@ +from typing import List, Pattern + +from recognizers_date_time.date_time.arabic.duration_extractor_config import ArabicDurationExtractorConfiguration +from recognizers_date_time.date_time.base_duration import BaseDurationExtractor +from recognizers_date_time.date_time.base_time import TimeExtractorConfiguration +from recognizers_date_time.date_time.utilities import DateTimeOptions +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicTimeExtractorConfiguration(TimeExtractorConfiguration): + + @property + def desc_regex(self) -> Pattern: + return self._desc_regex + + @property + def hour_num_regex(self) -> Pattern: + return self._hour_num_regex + + @property + def minute_num_regex(self) -> Pattern: + return self._minute_num_regex + + @property + def oclock_regex(self) -> Pattern: + return self._oclock_regex + + @property + def pm_regex(self) -> Pattern: + return self._pm_regex + + @property + def am_regex(self) -> Pattern: + return self._am_regex + + @property + def less_than_one_hour_regex(self) -> Pattern: + return self._less_than_one_hour + + @property + def written_time_regex(self) -> Pattern: + return self._written_time_regex + + @property + def time_prefix_regex(self) -> Pattern: + return self._time_prefix_regex + + @property + def time_suffix_regex(self) -> Pattern: + return self._time_suffix_regex + + @property + def basic_time_regex(self) -> Pattern: + return self._basic_time_regex + + @property + def midnight_regex(self) -> Pattern: + return self._midnight_regex + + @property + def midmorning_regex(self) -> Pattern: + return self._midmorning_regex + + @property + def midafternoon_regex(self) -> Pattern: + return self._midafternoon_regex + + @property + def midday_regex(self) -> Pattern: + return self._midday_regex + + @property + def midtime_regex(self) -> Pattern: + return self._midtime_regex + + @property + def at_regex(self) -> Pattern: + return self._at_regex + + @property + def ish_regex(self) -> Pattern: + return self._ish_regex + + @property + def time_unit_regex(self) -> Pattern: + return self._time_unit_regex + + @property + def connect_num_regex(self): + return self._connect_num_regex + + @property + def time_before_after_regex(self) -> Pattern: + return self._time_before_after_regex + + @property + def time_regex_list(self) -> List[Pattern]: + return self._time_regex_list + + @property + def duration_extractor(self): + return self._duration_extractor + + def __init__(self): + super().__init__() + + self._time_regex_list: List[Pattern] = ArabicTimeExtractorConfiguration.get_time_regex_list() + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AtRegex) + self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.IshRegex) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeBeforeAfterRegex) + + self._options = DateTimeOptions.NONE + self._duration_extractor = BaseDurationExtractor(ArabicDurationExtractorConfiguration()) + + self._desc_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DescRegex) + self._hour_num_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.HourNumRegex) + self._minute_num_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MinuteNumRegex) + self._oclock_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.OclockRegex) + self._pm_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PmRegex) + self._am_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AmRegex) + self._less_than_one_hour = RegExpUtility.get_safe_reg_exp(ArabicDateTime.LessThanOneHour) + self._written_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.WrittenTimeRegex) + self._time_prefix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimePrefix) + self._time_suffix_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeSuffix) + self._basic_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.BasicTime) + + self._midnight_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MidnightRegex) + self._midmorning_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MidmorningRegex) + self._midafternoon_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MidafternoonRegex) + self._midday_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MiddayRegex) + self._midtime_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MidTimeRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeUnitRegex) + self._connect_num_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ConnectNumRegex) + + @staticmethod + def get_time_regex_list() -> List[Pattern]: + return [ + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex1), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex2), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex3), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex4), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex5), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex6), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex7), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex9), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex10), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeRegex11), + RegExpUtility.get_safe_reg_exp(ArabicDateTime.ConnectNumRegex), + ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/time_parser_config.py new file mode 100644 index 0000000000..2d11cf87b6 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/time_parser_config.py @@ -0,0 +1,173 @@ +from typing import Dict, List, Pattern + +import regex + +from recognizers_date_time.date_time.arabic.time_extractor_config import ArabicTimeExtractorConfiguration +from recognizers_date_time.date_time.base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from recognizers_date_time.date_time.base_time import AdjustParams, TimeParserConfiguration +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.utilities import RegExpUtility + + +class ArabicTimeParserConfiguration(TimeParserConfiguration): + + @property + def time_suffix_full(self) -> Pattern: + return self._time_suffix_full + + @property + def lunch_regex(self) -> Pattern: + return self._lunch_regex + + @property + def night_regex(self) -> Pattern: + return self._night_regex + + @property + def half_token_regex(self) -> Pattern: + return self._half_token_regex + + @property + def quarter_token_regex(self) -> Pattern: + return self._quarter_token_regex + + @property + def three_quarter_token_regex(self) -> Pattern: + return self._three_quarter_token_regex + + @property + def to_token_regex(self) -> Pattern: + return self._to_token_regex + + @property + def to_half_token_regex(self) -> Pattern: + return self._to_half_token_regex + + @property + def for_half_token_regex(self) -> Pattern: + return self._for_half_token_regex + + @property + def time_token_prefix(self) -> str: + return self._time_token_prefix + + @property + def at_regex(self) -> Pattern: + return self._at_regex + + @property + def meal_time_regex(self) -> Pattern: + return self._meal_time_regex + + @property + def time_regexes(self) -> List[Pattern]: + return self._time_regexes + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self, config: BaseDateParserConfiguration): + + self._time_token_prefix = ArabicDateTime.TimeTokenPrefix + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AtRegex) + self._time_regexes = ArabicTimeExtractorConfiguration.get_time_regex_list() + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(ArabicDateTime.LessThanOneHour) + self.time_suffix = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeSuffix) + self.time_suffix_full_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeSuffixFull) + + self._half_token_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.HalfTokenRegex) + self._quarter_token_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.QuarterTokenRegex) + self._three_quarter_token_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ThreeQuarterTokenRegex) + + self._night_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.NightRegex) + self._lunch_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.LunchRegex) + self._to_token_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ToTokenRegex) + self._to_half_token_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ToHalfTokenRegex) + self._for_half_token_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.ForHalfTokenRegex) + self._meal_time_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.MealTimeRegex) + self._time_suffix_full = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeSuffixFull) + + self._utility_configuration = config.utility_configuration + self._numbers: Dict[str, int] = config.numbers + + def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): + delta_min = 0 + trimmed_prefix = prefix.strip().lower() + + if regex.search(self.half_token_regex, trimmed_prefix): + delta_min = 30 + elif regex.search(self.quarter_token_regex, trimmed_prefix): + delta_min = 15 + elif regex.search(self.three_quarter_token_regex, trimmed_prefix): + delta_min = 45 + else: + match = regex.search(self.less_than_one_hour, trimmed_prefix) + if match: + min_str = RegExpUtility.get_group(match, 'deltamin') + if min_str: + delta_min = int(min_str) + else: + min_str = RegExpUtility.get_group(match, 'deltaminnum').lower() + delta_min = self.numbers.get(min_str) + + if regex.search(self.to_half_token_regex, trimmed_prefix): + delta_min = delta_min - 30 + elif regex.search(self.for_half_token_regex, trimmed_prefix): + delta_min = -delta_min - 30 + elif regex.search(self.to_token_regex, trimmed_prefix): + delta_min = delta_min * -1 + + adjust.minute += delta_min + + if adjust.minute < 0: + adjust.minute += 60 + adjust.hour -= 1 + + adjust.has_minute = True + + def adjust_by_suffix(self, suffix: str, adjust: AdjustParams): + suffix = suffix.strip().lower() + delta_hour = 0 + match = regex.search(self.time_suffix_full_regex, suffix) + if match is not None and match.start() == 0 and match.group() == suffix: + oclock_str = RegExpUtility.get_group(match, 'oclock') + if not oclock_str: + am_str = RegExpUtility.get_group(match, Constants.AM_GROUP_NAME) + if am_str: + if adjust.hour >= Constants.HALF_DAY_HOUR_COUNT: + delta_hour -= Constants.HALF_DAY_HOUR_COUNT + else: + adjust.has_am = True + pm_str = RegExpUtility.get_group(match, Constants.PM_GROUP_NAME) + + if pm_str: + if adjust.hour < Constants.HALF_DAY_HOUR_COUNT: + delta_hour = Constants.HALF_DAY_HOUR_COUNT + if regex.search(self.lunch_regex, pm_str): + if adjust.hour >= 10 and adjust.hour <= Constants.HALF_DAY_HOUR_COUNT: + delta_hour = 0 + if adjust.hour == Constants.HALF_DAY_HOUR_COUNT: + adjust.has_pm = True + else: + adjust.has_am = True + else: + adjust.has_pm = True + + elif regex.search(self.night_regex, pm_str): + if adjust.hour <= 3 or adjust.hour == Constants.HALF_DAY_HOUR_COUNT: + if adjust.hour == Constants.HALF_DAY_HOUR_COUNT: + adjust.hour = 0 + delta_hour = 0 + adjust.has_am = True + else: + adjust.has_pm = True + else: + adjust.has_pm = True + + adjust.hour = (adjust.hour + delta_hour) % 24 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/timeperiod_extractor_config.py new file mode 100644 index 0000000000..1acc701d2d --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/timeperiod_extractor_config.py @@ -0,0 +1,184 @@ +from typing import List, Pattern + +from recognizers_date_time.date_time.arabic.base_configs import ArabicDateTimeUtilityConfiguration +from recognizers_date_time.date_time.arabic.time_extractor_config import ArabicTimeExtractorConfiguration +from recognizers_date_time.date_time.base_time import BaseTimeExtractor +from recognizers_date_time.date_time.base_timeperiod import MatchedIndex, TimePeriodExtractorConfiguration +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_number.number.arabic.extractors import ArabicIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + + +class ArabicTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): + @property + def till_regex(self) -> Pattern: + return self._till_regex + + @property + def hour_regex(self) -> Pattern: + return self._hour_regex + + @property + def period_hour_num_regex(self) -> Pattern: + return self._period_hour_num_regex + + @property + def period_desc_regex(self) -> Pattern: + return self._period_desc_regex + + @property + def pm_regex(self) -> Pattern: + return self._pm_regex + + @property + def am_regex(self) -> Pattern: + return self._am_regex + + @property + def pure_num_from_to(self) -> Pattern: + return self._pure_num_from_to + + @property + def pure_num_between_and(self): + return self._pure_num_between_and + + @property + def specific_time_from_to(self): + return self._specific_time_from_to_regex + + @property + def specific_time_between_and(self): + return self._specific_time_between_and_regex + + @property + def preposition_regex(self): + return self._preposition_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def specific_time_of_day_regex(self): + return self._specific_time_of_day_regex + + @property + def time_unit_regex(self): + return self._time_unit_regex + + @property + def time_follow_unit(self) -> Pattern: + return self._time_followed_unit + + @property + def time_number_combined_with_unit(self) -> Pattern: + return self._time_number_combined_with_unit + + @property + def general_ending_regex(self) -> Pattern: + return self._general_ending_regex + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def utility_configuration(self): + return self._utility_configuration + + @property + def single_time_extractor(self) -> DateTimeExtractor: + return self._single_time_extractor + + @property + def integer_extractor(self) -> Extractor: + return self._integer_extractor + + @property + def simple_cases_regex(self) -> List[Pattern]: + return self._simple_cases_regex + + @property + def pure_number_regex(self) -> List[Pattern]: + return self._pure_number_regex + + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def from_regex(self) -> Pattern: + return self._from_regex + + @property + def between_token_regex(self) -> Pattern: + return self._between_token_regex + + @property + def range_connector_regex(self) -> Pattern: + return self._range_connector_regex + + def __init__(self): + super().__init__() + + self._token_before_date = ArabicDateTime.TokenBeforeDate + self._single_time_extractor = BaseTimeExtractor(ArabicTimeExtractorConfiguration()) + self._utility_configuration = ArabicDateTimeUtilityConfiguration() + + self._integer_extractor = ArabicIntegerExtractor() + self._check_both_before_after = ArabicDateTime.CheckBothBeforeAfter + + self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TillRegex) + self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeOfDayRegex) + self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.GeneralEndingRegex) + self._hour_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.HourRegex) + self._period_desc_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.DescRegex) + self._period_hour_num_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PeriodHourNumRegex) + self._specific_time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.SpecificTimeOfDayRegex + ) + self._time_followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeFollowedUnit) + self._time_number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( + ArabicDateTime.TimeNumberCombinedWithUnit + ) + + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeUnitRegex) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecificTimeBetweenAnd) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PrepositionRegex) + + self._pure_num_between_and = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PureNumBetweenAnd) + self._pure_num_from_to = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PureNumFromTo) + self._am_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.AmRegex) + self._pm_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PmRegex) + + self._simple_cases_regex: List[Pattern] = [ + self.pure_num_from_to, + self.pure_num_between_and, + self.specific_time_from_to, + self.specific_time_between_and, + ] + self._pure_number_regex = [self.pure_num_from_to, self.pure_num_between_and] + + self._from_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.FromRegex) + self._between_token_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.BetweenTokenRegex) + self._range_connector_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.RangeConnectorRegex) + + def get_from_token_index(self, source: str) -> MatchedIndex: + match = self.from_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def get_between_token_index(self, source: str) -> MatchedIndex: + match = self.between_token_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def is_connector_token(self, source: str): + return self.range_connector_regex.match(source) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/timeperiod_parser_config.py new file mode 100644 index 0000000000..86c2c51384 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/arabic/timeperiod_parser_config.py @@ -0,0 +1,111 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from recognizers_date_time.date_time.base_timeperiod import MatchedTimeRegex, TimePeriodParserConfiguration +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities import TimexUtil +from recognizers_date_time.resources.arabic_date_time import ArabicDateTime +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + + +class ArabicTimePeriodParserConfiguration(TimePeriodParserConfiguration): + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def integer_extractor(self) -> Extractor: + return self._integer_extractor + + @property + def specific_time_from_to_regex(self) -> Pattern: + return self._specific_time_from_to_regex + + @property + def specific_time_between_and_regex(self) -> Pattern: + return self._specific_time_between_and_regex + + @property + def pure_number_from_to_regex(self) -> Pattern: + return self._pure_number_from_to_regex + + @property + def pure_number_between_and_regex(self) -> Pattern: + return self._pure_number_between_and_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def general_ending_regex(self): + return self._general_ending_regex + + @property + def till_regex(self) -> Pattern: + return self._till_regex + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self, config: BaseDateParserConfiguration): + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.GeneralEndingRegex) + self._time_extractor = config.time_extractor + self._time_parser = config.time_parser + self._integer_extractor = config.integer_extractor + self._numbers = config.numbers + self._utility_configuration = config.utility_configuration + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.PureNumBetweenAnd) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.SpecificTimeBetweenAnd) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TimeOfDayRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(ArabicDateTime.TillRegex) + + def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: + trimmed_text = source.strip().lower() + if trimmed_text.endswith('s'): + trimmed_text = trimmed_text[:-1] + + if any(trimmed_text.endswith(o) for o in ArabicDateTime.MorningTermList): + time_of_day = Constants.MORNING + elif any(trimmed_text.endswith(o) for o in ArabicDateTime.AfternoonTermList): + time_of_day = Constants.AFTERNOON + elif any(trimmed_text.endswith(o) for o in ArabicDateTime.EveningTermList): + time_of_day = Constants.EVENING + elif any(trimmed_text.endswith(o) for o in ArabicDateTime.DaytimeTermList): + time_of_day = Constants.DAYTIME + elif any(trimmed_text.endswith(o) for o in ArabicDateTime.NightTermList): + time_of_day = Constants.NIGHT + elif all(trimmed_text.endswith(o) for o in ArabicDateTime.BusinessHourSplitStrings): + time_of_day = Constants.BUSINESS_HOUR + elif any(trimmed_text.endswith(o) for o in ArabicDateTime.MealtimeBreakfastTermList): + time_of_day = Constants.MEALTIME_BREAKFAST + elif any(trimmed_text.endswith(o) for o in ArabicDateTime.MealtimeBrunchTermList): + time_of_day = Constants.MEALTIME_BRUNCH + elif any(trimmed_text.endswith(o) for o in ArabicDateTime.MealtimeLunchTermList): + time_of_day = Constants.MEALTIME_LUNCH + elif any(trimmed_text.endswith(o) for o in ArabicDateTime.MealtimeDinnerTermList): + time_of_day = Constants.MEALTIME_DINNER + else: + return MatchedTimeRegex(matched=False, timex='', begin_hour=0, end_hour=0, end_min=0) + + parse_result = TimexUtil.parse_time_of_day(time_of_day) + timex = parse_result.timex + begin_hour = parse_result.begin_hour + end_hour = parse_result.end_hour + end_min = parse_result.end_min + + return MatchedTimeRegex(matched=True, timex=timex, begin_hour=begin_hour, end_hour=end_hour, end_min=end_min) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_configs.py index 97a2fb363b..8d719dedb5 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_configs.py @@ -1,10 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +from abc import ABC, abstractmethod from typing import Dict, Pattern -from abc import abstractmethod, ABC from recognizers_number import BaseNumberExtractor, BaseNumberParser + from ..resources.base_date_time import BaseDateTime from .extractors import DateTimeExtractor from .parsers import DateTimeParser @@ -82,11 +83,6 @@ def time_parser(self) -> DateTimeParser: def date_time_parser(self) -> DateTimeParser: raise NotImplementedError - @property - @abstractmethod - def time_zone_parser(self) -> DateTimeParser: - raise NotImplementedError - @property @abstractmethod def duration_parser(self) -> DateTimeParser: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_date.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_date.py index 443854c2d1..c8c7ee1e21 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_date.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_date.py @@ -1,220 +1,66 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +import calendar from abc import ABC, abstractmethod -from typing import List, Optional, Pattern, Dict, Match from datetime import datetime, timedelta +from typing import Dict, List, Match, Optional, Pattern -from recognizers_date_time.date_time.abstract_year_extractor import AbstractYearExtractor +import regex from datedelta import datedelta +from dateutil.relativedelta import relativedelta + +from recognizers_date_time.date_time.abstract_year_extractor import AbstractYearExtractor +from recognizers_date_time.resources import BaseDateTime, BaseDateTimeResource +from recognizers_number.number import Constants as NumberConstants from recognizers_text.extractor import ExtractResult from recognizers_text.utilities import RegExpUtility, flatten -from recognizers_number.number import Constants as NumberConstants + from .constants import Constants, TimeTypeConstants from .extractors import DateTimeExtractor from .parsers import DateTimeParser, DateTimeParseResult -from .utilities import Token, MatchingUtil -import regex -import calendar - - -class DateTimeUtilityConfiguration(ABC): - @property - @abstractmethod - def date_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def ago_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def later_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def in_connector_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def range_unit_regex(self) -> Pattern: - raise NotImplementedError +from .utilities import MatchingUtil, Token - @property - @abstractmethod - def am_desc_regex(self) -> Pattern: - raise NotImplementedError - @property - @abstractmethod - def pm_desc__regex(self) -> Pattern: - raise NotImplementedError +class DateExtractorConfiguration: @property - @abstractmethod - def am_pm_desc_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def check_both_before_after(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def range_prefix_regex(self) -> Pattern: - raise NotImplementedError - - -class DateExtractorConfiguration(ABC): - @property - @abstractmethod def date_regex_list(self) -> List[Pattern]: - raise NotImplementedError - - @property - @abstractmethod - def implicit_date_list(self) -> List[Pattern]: - raise NotImplementedError - - @property - @abstractmethod - def month_end(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def week_day_end(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def week_day_start(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def of_month(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def date_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def for_the_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def week_day_and_day_of_month_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def week_day_and_day_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def relative_month_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def week_day_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def prefix_article_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def day_of_week(self) -> Dict[str, int]: - raise NotImplementedError - - @property - @abstractmethod - def month_of_year(self) -> Dict[str, int]: - raise NotImplementedError - - @property - @abstractmethod - def ordinal_extractor(self): - raise NotImplementedError - - @property - @abstractmethod - def integer_extractor(self): - raise NotImplementedError - - @property - @abstractmethod - def number_parser(self): - raise NotImplementedError - - @property - @abstractmethod - def duration_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def utility_configuration(self): - raise NotImplementedError - - @property - @abstractmethod - def strict_relative_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def range_connector_symbol_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def year_suffix(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def more_than_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def less_than_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def in_connector_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def range_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def since_year_suffix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def check_both_before_after(self) -> Pattern: - raise NotImplementedError + return [] + + def __init__(self, resource: BaseDateTimeResource): + self.day_of_week: Dict[str, int] = resource.DayOfWeek + self.month_of_year: Dict[str, int] = resource.MonthOfYear + self.check_both_before_after: bool = resource.CheckBothBeforeAfter + + self.year_suffix: Pattern = RegExpUtility.get_safe_reg_exp(resource.YearSuffix) + self.since_year_suffix_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.SinceYearSuffixRegex) + self.month_end: Pattern = RegExpUtility.get_safe_reg_exp(resource.MonthEnd) + self.of_month: Pattern = RegExpUtility.get_safe_reg_exp(resource.OfMonth) + self.relative_month_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.RelativeMonthRegex) + self.week_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.WeekDayRegex) + self.week_day_end: Pattern = RegExpUtility.get_safe_reg_exp(resource.WeekDayEnd) + self.week_day_start: Pattern = RegExpUtility.get_safe_reg_exp(resource.WeekDayStart) + self.week_day_and_day_of_month_regex: Pattern = RegExpUtility.get_safe_reg_exp( + resource.WeekDayAndDayOfMonthRegex + ) + self.week_day_and_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.WeekDayAndDayRegex) + self.date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.DateUnitRegex) + self.for_the_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.ForTheRegex) + self.prefix_article_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.PrefixArticleRegex) + self.strict_relative_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.StrictRelativeRegex) + self.range_connector_symbol_regex: Pattern = RegExpUtility.get_safe_reg_exp( + BaseDateTime.RangeConnectorSymbolRegex + ) + self.more_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.MoreThanRegex) + self.less_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.LessThanRegex) + self.in_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.InConnectorRegex) + self.range_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.RangeUnitRegex) + + self.year_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.YearRegex) + self.before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.BeforeAfterRegex) + self.month_num_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.MonthNumRegex) + self.month_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.MonthRegex) class BaseDateExtractor(DateTimeExtractor, AbstractYearExtractor): @@ -227,6 +73,7 @@ def __init__(self, config: DateExtractorConfiguration): def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: from .utilities import merge_all_tokens + if reference is None: reference = datetime.now() @@ -240,8 +87,8 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult return result def basic_regex_match(self, source: str) -> []: - from .utilities import Token - from .utilities import RegExpUtility + from .utilities import RegExpUtility, Token + ret: List[Token] = list() for regexp in self.config.date_regex_list: @@ -255,19 +102,30 @@ def basic_regex_match(self, source: str) -> []: # Cases that the relative term is before # the detected date entity, like "this 5/12", "next friday 5/12" - pre_text = source[0:source.index(match.group())] + pre_text = source[0 : source.index(match.group())] relative_regex = RegExpUtility.match_end(self.config.strict_relative_regex, pre_text, True) if relative_regex: if relative_regex.success: - ret.append(Token(relative_regex.index, source.index(match.group()) - + match.end() - match.start())) + ret.append( + Token( + relative_regex.index, source.index(match.group()) + match.end() - match.start() + ) + ) else: - ret.append(Token(source.index(match.group()), - source.index(match.group()) + match.end() - match.start())) + ret.append( + Token( + source.index(match.group()), + source.index(match.group()) + match.end() - match.start(), + ) + ) else: - ret.append(Token(source.index(match.group()), - source.index(match.group()) + match.end() - match.start())) + ret.append( + Token( + source.index(match.group()), + source.index(match.group()) + match.end() - match.start(), + ) + ) return ret @@ -277,18 +135,17 @@ def basic_regex_match(self, source: str) -> []: def validate_match(self, match: Match, text: str): # If the match doesn't contains "year" part, it will not be ambiguous and it's a valid match - is_valid_match = not RegExpUtility.get_group( - match, Constants.YEAR_GROUP_NAME) + is_valid_match = not RegExpUtility.get_group(match, Constants.YEAR_GROUP_NAME) if not is_valid_match: - year_group = RegExpUtility.get_group( - match, Constants.YEAR_GROUP_NAME) + year_group = RegExpUtility.get_group(match, Constants.YEAR_GROUP_NAME) # If the "year" part is not at the end of the match, it's a valid match - if not text.index(year_group) + len(year_group) == text.index(match.group())\ - + (match.end() - match.start()): + if not text.index(year_group) + len(year_group) == text.index(match.group()) + ( + match.end() - match.start() + ): is_valid_match = True else: - sub_text = text[text.index(year_group):] + sub_text = text[text.index(year_group) :] # If the following text (include the "year" part) doesn't start with a Date entity, it's a valid match if not self.starts_with_basic_date(sub_text): @@ -302,7 +159,7 @@ def validate_match(self, match: Match, text: str): # though "2018-10-2" a valid match (indicates the first year "2018" might # belongs to the second Date entity), but "10-2-2018" is also - sub_text = text[text.index(year_group) + len(year_group):].strip() + sub_text = text[text.index(year_group) + len(year_group) :].strip() sub_text = self.trim_start_range_connector_symbols(sub_text) is_valid_match = self.starts_with_basic_date(sub_text) @@ -330,8 +187,11 @@ def trim_start_range_connector_symbols(self, text: str): for symbol_match in range_connector_symbol_matches: start_symbol_length = -1 - if symbol_match and text.index(symbol_match.group()) == 0 and len(symbol_match.group()) >\ - start_symbol_length: + if ( + symbol_match + and text.index(symbol_match.group()) == 0 + and len(symbol_match.group()) > start_symbol_length + ): start_symbol_length = len(symbol_match.group()) if start_symbol_length > 0: @@ -342,6 +202,7 @@ def trim_start_range_connector_symbols(self, text: str): # TODO: Simplify this method to improve the performance def starts_with_basic_date(self, text: str): from .utilities import RegExpUtility + for regexp in self.config.date_regex_list: match = RegExpUtility.match_begin(regexp, text, True) @@ -352,6 +213,7 @@ def starts_with_basic_date(self, text: str): def implicit_date(self, source: str) -> []: from .utilities import get_tokens_from_regex + ret: List[Token] = list() for regexp in self.config.implicit_date_list: @@ -361,6 +223,7 @@ def implicit_date(self, source: str) -> []: def number_with_month(self, source: str, reference: datetime) -> []: from .utilities import DateUtils + ret: List[Token] = list() extract_results = self.config.ordinal_extractor.extract(source) extract_results.extend(self.config.integer_extractor.extract(source)) @@ -372,7 +235,7 @@ def number_with_month(self, source: str, reference: datetime) -> []: continue if result.start >= 0: - front_string = source[0:result.start or 0] + front_string = source[0 : result.start or 0] # Check that the extracted number is not part of a decimal number, time expression or currency # (e.g. '123.24', '12:24', '$12') @@ -387,11 +250,17 @@ def number_with_month(self, source: str, reference: datetime) -> []: end_index = match.start() + len(match.group()) + result_length start_index, end_index = self.extend_with_week_day_and_year( - start_index, end_index, self.config.month_of_year[str(RegExpUtility.get_group( - match, Constants.MONTH_GROUP_NAME)).lower()], num, source, reference) - - ret.append( - Token(match.start(), end_index)) + start_index, + end_index, + self.config.month_of_year[ + str(RegExpUtility.get_group(match, Constants.MONTH_GROUP_NAME)).lower() + ], + num, + source, + reference, + ) + + ret.append(Token(match.start(), end_index)) continue # handling cases like 'for the 25th' @@ -400,47 +269,38 @@ def number_with_month(self, source: str, reference: datetime) -> []: for match_case in matches: if match_case is not None: - ordinal_num = RegExpUtility.get_group( - match_case, Constants.DAY_OF_MONTH) + ordinal_num = RegExpUtility.get_group(match_case, Constants.DAY_OF_MONTH) if ordinal_num == result.text: - length = len( - RegExpUtility.get_group(match_case, TimeTypeConstants.END)) - ret.append(Token(match_case.start(), - match_case.end() - length)) + length = len(RegExpUtility.get_group(match_case, TimeTypeConstants.END)) + ret.append(Token(match_case.start(), match_case.end() - length)) is_found = True if is_found: continue # handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date - matches = regex.finditer( - self.config.week_day_and_day_of_month_regex, source) + matches = regex.finditer(self.config.week_day_and_day_of_month_regex, source) for match_case in matches: if match_case is not None: - ordinal_num = RegExpUtility.get_group( - match_case, Constants.DAY_OF_MONTH) + ordinal_num = RegExpUtility.get_group(match_case, Constants.DAY_OF_MONTH) if ordinal_num == result.text: month = reference.month year = reference.year # get week of day for the ordinal number which is regarded as a date of reference month - date = DateUtils.safe_create_from_min_value( - year, month, num) - num_week_day_str: str = calendar.day_name[date.weekday()].lower( - ) + date = DateUtils.safe_create_from_min_value(year, month, num) + num_week_day_str: str = calendar.day_name[date.weekday()].lower() # get week day from text directly, compare it with the weekday generated above # to see whether they refer to a same week day - extracted_week_day_str = RegExpUtility.get_group( - match_case, 'weekday').lower() - if (date != DateUtils.min_value and - DateUtils.day_of_week(num_week_day_str) == - self.config.day_of_week.get(extracted_week_day_str)): - ret.append( - Token(match_case.start(), match_case.end())) + extracted_week_day_str = RegExpUtility.get_group(match_case, 'weekday').lower() + if date != DateUtils.min_value and DateUtils.day_of_week( + num_week_day_str + ) == self.config.day_of_week.get(extracted_week_day_str): + ret.append(Token(match_case.start(), match_case.end())) is_found = True if is_found: @@ -463,9 +323,8 @@ def number_with_month(self, source: str, reference: datetime) -> []: continue # handling cases like '20th of next month' - suffix_str: str = source[result.start + result.length:].lower() - match = regex.match( - self.config.relative_month_regex, suffix_str.strip()) + suffix_str: str = source[result.start + result.length :].lower() + match = regex.match(self.config.relative_month_regex, suffix_str.strip()) space_len = len(suffix_str) - len(suffix_str.strip()) if match is not None and match.start() == 0: @@ -480,24 +339,25 @@ def number_with_month(self, source: str, reference: datetime) -> []: if prefix_match: res_start = prefix_match.start() - ret.append( - Token(res_start, res_end)) + ret.append(Token(res_start, res_end)) # handling cases like 'second Sunday' - suffix_str = source[result.start + result.length:] - match = regex.match( - self.config.week_day_regex, suffix_str.strip()) - if (match is not None and match.start() == 0 and 1 <= num <= 5 and - result.type == NumberConstants.SYS_NUM_ORDINAL): + suffix_str = source[result.start + result.length :] + match = regex.match(self.config.week_day_regex, suffix_str.strip()) + if ( + match is not None + and match.start() == 0 + and 1 <= num <= 5 + and result.type == NumberConstants.SYS_NUM_ORDINAL + ): week_day_str = RegExpUtility.get_group(match, Constants.WEEKDAY_GROUP_NAME).lower() if week_day_str in self.config.day_of_week: - ret.append( - Token(result.start, result.start + result.length + space_len + len(match.group()))) + ret.append(Token(result.start, result.start + result.length + space_len + len(match.group()))) # For cases like "I'll go back twenty second of June" if result.start + result.length < len(source): - after_string = source[result.start + result.length:] + after_string = source[result.start + result.length :] match = regex.match(self.config.of_month, after_string) if match is not None: @@ -505,10 +365,16 @@ def number_with_month(self, source: str, reference: datetime) -> []: result_length = result.length if result.length else 0 end_index = (start_index + result_length) + len(match.group()) - start_index, end_index = self.extend_with_week_day_and_year(start_index, end_index, - self.config.month_of_year[RegExpUtility.get_group( - match, Constants.MONTH_GROUP_NAME).lower() or str( - reference.month)], num, source, reference) + start_index, end_index = self.extend_with_week_day_and_year( + start_index, + end_index, + self.config.month_of_year[ + RegExpUtility.get_group(match, Constants.MONTH_GROUP_NAME).lower() or str(reference.month) + ], + num, + source, + reference, + ) ret.append(Token(start_index, end_index)) return ret @@ -517,27 +383,34 @@ def get_year_index(self, affix, year, in_prefix): index = 0 match_year = self.config.year_suffix.match(affix) - success = not (match_year and match_year.start()) if not in_prefix else match_year and match_year.start() \ - + match_year.end() == len(affix.strip()) + success = ( + not (match_year and match_year.start()) + if not in_prefix + else match_year and match_year.start() + match_year.end() == len(affix.strip()) + ) if success: year = self.get_year_from_text(match_year) if Constants.MIN_YEAR_NUM <= year <= Constants.MAX_YEAR_NUM: - index = len(match_year.group(0)) if not in_prefix else match_year.end() + (len(affix) - len(affix.strip())) + index = ( + len(match_year.group(0)) if not in_prefix else match_year.end() + (len(affix) - len(affix.strip())) + ) return index, success - def extend_with_week_day_and_year(self, start_index: int, end_index: int, month: int, - day: int, text: str, reference: datetime): - from .utilities import DateUtils + def extend_with_week_day_and_year( + self, start_index: int, end_index: int, month: int, day: int, text: str, reference: datetime + ): import calendar + from .utilities import DateUtils + year = reference.year # Check whether there's a year suffix = text[end_index:] - prefix = text[0: start_index] + prefix = text[0:start_index] year_index, success = self.get_year_index(suffix, year, False) end_index += year_index @@ -558,14 +431,14 @@ def extend_with_week_day_and_year(self, start_index: int, end_index: int, month: if match_week_day: # Get weekday from context directly, compare it with the weekday extraction above # to see whether they reference the same weekday - extracted_week_day_str = RegExpUtility.get_group( - match_week_day, Constants.WEEKDAY_GROUP_NAME) + extracted_week_day_str = RegExpUtility.get_group(match_week_day, Constants.WEEKDAY_GROUP_NAME) num_week_day_str = calendar.day_name[date.weekday()].lower() week_day_1 = self.config.day_of_week.get(num_week_day_str) week_day_2 = self.config.day_of_week.get(extracted_week_day_str) - if self.config.day_of_week.get(num_week_day_str, week_day_1) and \ - self.config.day_of_week.get(extracted_week_day_str, week_day_2): + if self.config.day_of_week.get(num_week_day_str, week_day_1) and self.config.day_of_week.get( + extracted_week_day_str, week_day_2 + ): if not date == DateUtils.min_value and week_day_1 == week_day_2: if not is_match_in_suffix: @@ -576,9 +449,11 @@ def extend_with_week_day_and_year(self, start_index: int, end_index: int, month: return start_index, end_index # "In 3 days/weeks/months/years" = "3 days/weeks/months/years from now" - def extract_relative_duration_date_with_in_prefix(self, source: str, duration_er: [ExtractResult], - reference: datetime): + def extract_relative_duration_date_with_in_prefix( + self, source: str, duration_er: [ExtractResult], reference: datetime + ): from .utilities import Token + result: [Token] = [] durations: [Token] = [] @@ -587,12 +462,16 @@ def extract_relative_duration_date_with_in_prefix(self, source: str, duration_er match = self.config.date_unit_regex.search(duration_extraction.text) if match: - durations.append(Token(duration_extraction.start or 0, (duration_extraction.start or 0) - + duration_extraction.length or 0)) + durations.append( + Token( + duration_extraction.start or 0, + (duration_extraction.start or 0) + duration_extraction.length or 0, + ) + ) for duration in durations: - before_str = source[0:duration.start] - after_str = source[duration.start + duration.length:] + before_str = source[0 : duration.start] + after_str = source[duration.start + duration.length :] if (str.isspace(before_str) or before_str is None) and (str.isspace(after_str) or after_str is None): continue @@ -607,8 +486,11 @@ def extract_relative_duration_date_with_in_prefix(self, source: str, duration_er def relative_duration_date(self, source: str, reference: datetime) -> []: from .utilities import AgoLaterUtil + tokens = [] - duration_extracted_results = self.config.duration_extractor.extract(source, reference) + duration_extracted_results = [] + if self.config.duration_extractor: + duration_extracted_results = self.config.duration_extractor.extract(source, reference) for extracted_result in duration_extracted_results: @@ -633,12 +515,15 @@ def relative_duration_date(self, source: str, reference: datetime) -> []: if match: tokens.extend( - AgoLaterUtil.extractor_duration_with_before_and_after(source, extracted_result, tokens, - self.config.utility_configuration)) + AgoLaterUtil.extractor_duration_with_before_and_after( + source, extracted_result, tokens, self.config.utility_configuration + ) + ) # Extract cases like "in 3 weeks", which equals to "3 weeks from today" - relative_duration_date_with_in_prefix =\ - self.extract_relative_duration_date_with_in_prefix(source, duration_extracted_results, reference) + relative_duration_date_with_in_prefix = self.extract_relative_duration_date_with_in_prefix( + source, duration_extracted_results, reference + ) for extract_result_with_in_prefix in relative_duration_date_with_in_prefix: if not self.is_overlap_with_exist_extractions(extract_result_with_in_prefix, tokens): @@ -685,19 +570,28 @@ def is_multiple_duration(er: ExtractResult): # Cases like "more than 3 days", "less than 4 weeks" @staticmethod def is_inequality_duration(er: ExtractResult): - return er.data is not None and er.data == TimeTypeConstants.MORE_THAN_MOD \ + return ( + er.data is not None + and er.data == TimeTypeConstants.MORE_THAN_MOD or er.data == TimeTypeConstants.LESS_THAN_MOD + ) def extract_in_connector(self, text, first_str, second_str, duration, in_prefix): from recognizers_date_time import Token + result = [] - match = RegExpUtility.match_end(self.config.in_connector_regex, first_str, True) if in_prefix else RegExpUtility.match_begin(self.config.in_connector_regex, first_str, True) + match = ( + RegExpUtility.match_end(self.config.in_connector_regex, first_str, True) + if in_prefix + else RegExpUtility.match_begin(self.config.in_connector_regex, first_str, True) + ) success = False if not match else match.success if match and match.success: start_token = match.index - range_unit_math = self.config.range_unit_regex.match(text[duration.start: duration.start - + duration.length]) + range_unit_math = self.config.range_unit_regex.match( + text[duration.start : duration.start + duration.length] + ) if range_unit_math: since_year_match = self.config.since_year_suffix_regex.match(second_str) @@ -891,6 +785,7 @@ def __init__(self, config: DateParserConfiguration): def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: from .utilities import DateTimeFormatUtil + if reference is None: reference = datetime.now() @@ -904,16 +799,13 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self.parse_implicit_date(source_text, reference) if not inner_result.success: - inner_result = self.parse_weekday_of_month( - source_text, reference) + inner_result = self.parse_weekday_of_month(source_text, reference) if not inner_result.success: - inner_result = self.parser_duration_with_ago_and_later( - source_text, reference) + inner_result = self.parser_duration_with_ago_and_later(source_text, reference) if not inner_result.success: - inner_result = self.parse_number_with_month( - source_text, reference) + inner_result = self.parse_number_with_month(source_text, reference) if not inner_result.success: inner_result = self.parse_single_number(source_text, reference) @@ -921,10 +813,12 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if inner_result.success: inner_result.future_resolution: Dict[str, str] = dict() inner_result.future_resolution[TimeTypeConstants.DATE] = DateTimeFormatUtil.format_date( - inner_result.future_value) + inner_result.future_value + ) inner_result.past_resolution: Dict[str, str] = dict() inner_result.past_resolution[TimeTypeConstants.DATE] = DateTimeFormatUtil.format_date( - inner_result.past_value) + inner_result.past_value + ) result_value = inner_result result = DateTimeParseResult(source) @@ -936,6 +830,7 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D def parse_basic_regex_match(self, source: str, reference: datetime) -> DateTimeParseResult: from .utilities import DateTimeResolutionResult + trimmed_source = source.strip() result = DateTimeResolutionResult() @@ -944,8 +839,7 @@ def parse_basic_regex_match(self, source: str, reference: datetime) -> DateTimeP match = regex.search(regexp, trimmed_source) if match is None: - match = regex.search( - regexp, self.config.date_token_prefix + trimmed_source) + match = regex.search(regexp, self.config.date_token_prefix + trimmed_source) offset = len(self.config.date_token_prefix) if match and match.start() == offset and len(match.group()) == len(trimmed_source): @@ -955,9 +849,7 @@ def parse_basic_regex_match(self, source: str, reference: datetime) -> DateTimeP return result def match_to_date(self, match, reference: datetime): - from .utilities import DateTimeResolutionResult - from .utilities import DateUtils - from .utilities import DateTimeFormatUtil + from .utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils result = DateTimeResolutionResult() month = 0 @@ -994,25 +886,23 @@ def match_to_date(self, match, reference: datetime): result.timex = DateTimeFormatUtil.luis_date(year, month, day) future_date, past_date = DateUtils.generate_dates(no_year, reference, year, month, day) - #future_date = DateUtils.safe_create_from_min_value(no_year, reference, year, month, day) - #past_date = DateUtils.safe_create_from_min_value(no_year, reference, year, month, day) result.future_value = future_date result.past_value = past_date - result.success = True + + if "00" not in result.timex.split("-"): + result.success = True + return result def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParseResult: - from .utilities import DateUtils - from .utilities import DateTimeFormatUtil - from .utilities import DateTimeResolutionResult - from .utilities import DayOfWeek + from .utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils, DayOfWeek + trimmed_source = source.strip() result = DateTimeResolutionResult() # handle "on 12" - match = regex.search(self.config.on_regex, - self.config.date_token_prefix + trimmed_source) + match = regex.search(self.config.on_regex, self.config.date_token_prefix + trimmed_source) if match and match.start() == len(self.config.date_token_prefix) and len(match.group()) == len(trimmed_source): day = 0 month = reference.month @@ -1028,10 +918,8 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse past_date: datetime if try_date: - future_date = DateUtils.safe_create_from_min_value( - year, month, day) - past_date = DateUtils.safe_create_from_min_value( - year, month, day) + future_date = DateUtils.safe_create_from_min_value(year, month, day) + past_date = DateUtils.safe_create_from_min_value(year, month, day) if future_date < reference: future_date += datedelta(months=1) @@ -1039,10 +927,8 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse if past_date >= reference: past_date += datedelta(months=-1) else: - future_date = DateUtils.safe_create_from_min_value( - year, month + 1, day) - past_date = DateUtils.safe_create_from_min_value( - year, month - 1, day) + future_date = DateUtils.safe_create_from_min_value(year, month + 1, day) + past_date = DateUtils.safe_create_from_min_value(year, month - 1, day) result.future_value = future_date result.past_value = past_date @@ -1053,8 +939,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse match = regex.match(self.config.special_day_regex, trimmed_source) if match and match.start() == 0 and len(match.group()) == len(trimmed_source): swift = self.config.get_swift_day(match.group()) - today = DateUtils.safe_create_from_min_value( - reference.year, reference.month, reference.day) + today = DateUtils.safe_create_from_min_value(reference.year, reference.month, reference.day) value = today + timedelta(days=swift) result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) result.future_value = value @@ -1113,8 +998,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse match = regex.match(self.config.next_regex, trimmed_source) if match and match.start() == 0 and len(match.group()) == len(trimmed_source): weekday_str = match.group(Constants.WEEKDAY_GROUP_NAME) - value = DateUtils.next( - reference, self.config.day_of_week.get(weekday_str)) + value = DateUtils.next(reference, self.config.day_of_week.get(weekday_str)) result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) result.future_value = value @@ -1126,8 +1010,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse match = regex.match(self.config.this_regex, trimmed_source) if match and match.start() == 0 and len(match.group()) == len(trimmed_source): weekday_str = match.group(Constants.WEEKDAY_GROUP_NAME) - value = DateUtils.this( - reference, self.config.day_of_week.get(weekday_str)) + value = DateUtils.this(reference, self.config.day_of_week.get(weekday_str)) result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) result.future_value = value @@ -1139,8 +1022,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse match = regex.match(self.config.last_regex, trimmed_source) if match and match.start() == 0 and len(match.group()) == len(trimmed_source): weekday_str = match.group(Constants.WEEKDAY_GROUP_NAME) - value = DateUtils.last( - reference, self.config.day_of_week.get(weekday_str)) + value = DateUtils.last(reference, self.config.day_of_week.get(weekday_str)) result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) result.future_value = value @@ -1171,7 +1053,9 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse if past_date >= reference: past_date -= timedelta(weeks=1) - result.future_value = DateUtils.safe_create_from_min_value(future_date.year, future_date.month, future_date.day) + result.future_value = DateUtils.safe_create_from_min_value( + future_date.year, future_date.month, future_date.day + ) result.past_value = DateUtils.safe_create_from_min_value(past_date.year, past_date.month, past_date.day) result.success = True return result @@ -1195,8 +1079,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse return result # handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date - match = regex.match( - self.config.week_day_and_day_of_month_regex, trimmed_source) + match = regex.match(self.config.week_day_and_day_of_month_regex, trimmed_source) if match: day_str = match.group(Constants.DAY_OF_MONTH) er = ExtractResult.get_from_text(day_str) @@ -1215,11 +1098,10 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse # Handling cases like 'Monday 21', which both 'Monday' and '21' refer to the same date. # The year of expected date can be different to the year of referenceDate. - match = regex.match( - self.config.week_day_and_day_regex, trimmed_source) + match = regex.match(self.config.week_day_and_day_regex, trimmed_source) if match: # avoid parsing "Monday 3" from "Monday 3 weeks from now" - after_str = trimmed_source[match.end():] + after_str = trimmed_source[match.end() :] if self.config.unit_regex.search(after_str.strip()): return result @@ -1243,10 +1125,9 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse pivot_date = DateUtils.safe_create_from_min_value(year, month, day) else: # Add 1 month is enough, since 1, 3, 5, 7, 8, 10, 12 months has 31 days - pivot_date = datetime(year, month, day) + datedelta(months=1) - pivot_date = DateUtils.safe_create_from_min_value(pivot_date.year, pivot_date.month, pivot_date.day) + pivot_date = DateUtils.safe_create_from_min_value(year, month + 1, day) - num_week_day_int = pivot_date.isoweekday() + num_week_day_int = pivot_date.isoweekday() % 7 extracted_week_day_str = match.group(Constants.WEEKDAY_GROUP_NAME) week_day = self.config.day_of_week.get(extracted_week_day_str) @@ -1260,25 +1141,29 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse future_date = pivot_date past_date = pivot_date - while future_date.isoweekday() != week_day or future_date.day != day or future_date < reference: + while future_date.isoweekday() % 7 != week_day or future_date.day != day or future_date < reference: # Increase the futureDate month by month to find the expected date (the "day" is the weekday) and # make sure the futureDate not less than the referenceDate. - future_date += datedelta(months=1) + future_date += relativedelta(months=1) tmp_days_in_month = calendar.monthrange(future_date.year, future_date.month)[1] if tmp_days_in_month >= day: # For months like January 31, after add 1 month, February 31 won't be returned, so the day should be revised ASAP. - future_date = DateUtils.safe_create_from_value(DateUtils.min_value, future_date.year, future_date.month, day) + future_date = DateUtils.safe_create_from_value( + DateUtils.min_value, future_date.year, future_date.month, day + ) result.future_value = future_date - while past_date.isoweekday() != week_day or past_date.day != day or past_date > reference: + while past_date.isoweekday() % 7 != week_day or past_date.day != day or past_date > reference: # Decrease the pastDate month by month to find the expected date (the "day" is the weekday) and # make sure the pastDate not larger than the referenceDate. - past_date += datedelta(months=-1) - tmp_days_in_month = calendar.monthrange(past_date.year, future_date.month)[1] + past_date -= relativedelta(months=1) + tmp_days_in_month = calendar.monthrange(past_date.year, past_date.month)[1] if tmp_days_in_month >= day: # For months like March 31, after minus 1 month, February 31 won't be returned, so the day should be revised ASAP. - past_date = DateUtils.safe_create_from_value(DateUtils.min_value, past_date.year, past_date.month, day) + past_date = DateUtils.safe_create_from_value( + DateUtils.min_value, past_date.year, past_date.month, day + ) result.past_value = past_date @@ -1294,12 +1179,11 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeParse return result def parse_weekday_of_month(self, source: str, reference: datetime) -> DateTimeParseResult: - from .utilities import DateTimeFormatUtil - from .utilities import DateTimeResolutionResult + from .utilities import DateTimeFormatUtil, DateTimeResolutionResult + trimmed_source = source.strip() result = DateTimeResolutionResult() - match = regex.match( - self.config.week_day_of_month_regex, trimmed_source) + match = regex.match(self.config.week_day_of_month_regex, trimmed_source) if not match: return result @@ -1308,8 +1192,7 @@ def parse_weekday_of_month(self, source: str, reference: datetime) -> DateTimePa weekday_str = RegExpUtility.get_group(match, Constants.WEEKDAY_GROUP_NAME) month_str = RegExpUtility.get_group(match, Constants.MONTH_GROUP_NAME) no_year = False - cardinal = 5 if self.config.is_cardinal_last( - cardinal_str) else self.config.cardinal_map.get(cardinal_str) + cardinal = 5 if self.config.is_cardinal_last(cardinal_str) else self.config.cardinal_map.get(cardinal_str) weekday = self.config.day_of_week.get(weekday_str) month = reference.month year = reference.year @@ -1333,8 +1216,7 @@ def parse_weekday_of_month(self, source: str, reference: datetime) -> DateTimePa past_date = value if no_year and future_date < reference: - future_date = self._compute_date( - cardinal, weekday, month, year + 1) + future_date = self._compute_date(cardinal, weekday, month, year + 1) if future_date.month != month: future_date = future_date.replace(day=future_date.day - 7) @@ -1343,16 +1225,15 @@ def parse_weekday_of_month(self, source: str, reference: datetime) -> DateTimePa if past_date.month != month: past_date = past_date.replace(day=past_date.date - 7) - result.timex = '-'.join(['XXXX', DateTimeFormatUtil.to_str(month, 2), - 'WXX', str(weekday), '#' + str(cardinal)]) + result.timex = '-'.join(['XXXX', DateTimeFormatUtil.to_str(month, 2), 'WXX', str(weekday), '#' + str(cardinal)]) result.future_value = future_date result.past_value = past_date result.success = True return result def _compute_date(self, cardinal: int, weekday, month: int, year: int): - from .utilities import DateUtils - from .utilities import DayOfWeek + from .utilities import DateUtils, DayOfWeek + first_day = datetime(year, month, 1) first_weekday = DateUtils.this(first_day, weekday) @@ -1362,13 +1243,12 @@ def _compute_date(self, cardinal: int, weekday, month: int, year: int): if weekday < first_day.isoweekday(): first_weekday = DateUtils.next(first_day, weekday) - first_weekday = first_weekday.replace( - day=first_weekday.day + (7 * (cardinal - 1))) + first_weekday = first_weekday.replace(day=first_weekday.day + (7 * (cardinal - 1))) return first_weekday def parser_duration_with_ago_and_later(self, source: str, reference: datetime) -> DateTimeParseResult: from .utilities import AgoLaterUtil - from .utilities import AgoLaterMode + return AgoLaterUtil.parse_duration_with_ago_and_later( source, reference, @@ -1376,13 +1256,17 @@ def parser_duration_with_ago_and_later(self, source: str, reference: datetime) - self.config.duration_parser, self.config.unit_map, self.config.unit_regex, - self.config.utility_configuration) + self.config.utility_configuration, + ) def _get_year_in_affix(self, affix, in_prefix): match_year = self.config.date_extractor.config.year_suffix.match(affix) - success = not (match_year and match_year.start()) if not in_prefix else match_year and match_year.start() \ - + match_year.end() == len(affix.strip()) + success = ( + not (match_year and match_year.start()) + if not in_prefix + else match_year and match_year.start() + match_year.end() == len(affix.strip()) + ) if success: year = self.config.date_extractor.get_year_from_text(match_year) @@ -1392,9 +1276,8 @@ def _get_year_in_affix(self, affix, in_prefix): return Constants.INVALID_YEAR def parse_number_with_month(self, source: str, reference: datetime) -> DateTimeParseResult: - from .utilities import DateUtils - from .utilities import DateTimeFormatUtil - from .utilities import DateTimeResolutionResult + from .utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils + trimmed_source = source.strip() ambiguous = True result = DateTimeResolutionResult() @@ -1417,8 +1300,13 @@ def parse_number_with_month(self, source: str, reference: datetime) -> DateTimeP if match: month = self.config.month_of_year.get(match.group()) day = num - suffix = trimmed_source[match.end():] - prefix = trimmed_source[0: match.start()] + + prefix_end = min(ers[0].start, match.start()) + prefix = trimmed_source[0:prefix_end] + + suffix_start = max(ers[0].start + ers[0].length, match.end()) + suffix = trimmed_source[suffix_start:] + year = self._get_year_in_affix(suffix, False) if year == Constants.INVALID_YEAR and self.config.check_both_before_after: @@ -1430,12 +1318,14 @@ def parse_number_with_month(self, source: str, reference: datetime) -> DateTimeP year = reference.year else: # handling relative month - match = regex.search( - self.config.relative_month_regex, trimmed_source) + match = regex.search(self.config.relative_month_regex, trimmed_source) if match: - month_str = match.group(Constants.ORDER) + if match.group(Constants.ORDER): + month_str = match.group(Constants.ORDER) + else: + month_str = match swift = self.config.get_swift_month(month_str) - date = reference.replace(month=reference.month+swift) + date = reference.replace(month=reference.month + swift) month = date.month day = num ambiguous = False @@ -1446,13 +1336,14 @@ def parse_number_with_month(self, source: str, reference: datetime) -> DateTimeP if match: month = reference.month # resolve the date of wanted week day - wanted_week_day = self.config.day_of_week.get( - match.group(Constants.WEEKDAY_GROUP_NAME)) - first_date = DateUtils.safe_create_from_min_value( - reference.year, reference.month, 1) + wanted_week_day = self.config.day_of_week.get(match.group(Constants.WEEKDAY_GROUP_NAME)) + first_date = DateUtils.safe_create_from_min_value(reference.year, reference.month, 1) first_weekday = first_date.isoweekday() - delta_days = wanted_week_day - \ - first_weekday if wanted_week_day > first_weekday else wanted_week_day - first_weekday + 7 + delta_days = ( + wanted_week_day - first_weekday + if wanted_week_day > first_weekday + else wanted_week_day - first_weekday + 7 + ) first_wanted_week_day = first_date + timedelta(days=delta_days) day = first_wanted_week_day.day + ((num - 1) * 7) ambiguous = False @@ -1469,10 +1360,10 @@ def parse_number_with_month(self, source: str, reference: datetime) -> DateTimeP result.timex = DateTimeFormatUtil.luis_date(-1, month, day) if future_date < reference: - future_date = future_date.replace(year=future_date.year+1) + future_date = future_date.replace(year=future_date.year + 1) if past_date >= reference: - past_date = past_date.replace(year=past_date.year+1) + past_date = past_date.replace(year=past_date.year - 1) else: result.timex = DateTimeFormatUtil.luis_date(year, month, day) @@ -1482,9 +1373,8 @@ def parse_number_with_month(self, source: str, reference: datetime) -> DateTimeP return result def parse_single_number(self, source: str, reference: datetime) -> DateTimeParseResult: - from .utilities import DateUtils - from .utilities import DateTimeFormatUtil - from .utilities import DateTimeResolutionResult + from .utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils + trimmed_source = source.strip() result = DateTimeResolutionResult() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_dateperiod.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_dateperiod.py index d28abb4f25..b1ef2743a8 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_dateperiod.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_dateperiod.py @@ -3,215 +3,103 @@ import math from abc import ABC, abstractmethod -from typing import List, Optional, Pattern, Match, Dict -from datetime import datetime, timedelta from collections import namedtuple +from datetime import datetime, timedelta +from typing import Dict, List, Match, Optional, Pattern import regex from datedelta import datedelta -from recognizers_text.extractor import ExtractResult, Extractor, Metadata -from recognizers_date_time.date_time.date_extractor import DateExtractor -from recognizers_number.number import BaseNumberParser, BaseNumberExtractor +from recognizers_date_time.resources.base_date_time import BaseDateTime, BaseDateTimeResource +from recognizers_text.extractor import ExtractResult, Metadata + +from .base_date import BaseDateParser +from .base_duration import BaseDurationParser from .constants import Constants, TimeTypeConstants from .extractors import DateTimeExtractor from .parsers import DateTimeParser, DateTimeParseResult -from .base_date import BaseDateParser -from .base_duration import BaseDurationParser -from .utilities import Token, merge_all_tokens, DateTimeFormatUtil, DateTimeResolutionResult, DateUtils, DayOfWeek, \ - RegExpUtility, DateContext, TimexUtil - -MatchedIndex = namedtuple('MatchedIndex', ['matched', 'index']) - - -class DatePeriodExtractorConfiguration(ABC): - - @property - @abstractmethod - def previous_prefix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def simple_cases_regexes(self) -> List[Pattern]: - raise NotImplementedError - - @property - @abstractmethod - def check_both_before_after(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def illegal_year_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def year_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def till_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def followed_unit(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def number_combined_with_unit(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def past_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def future_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def week_of_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def month_of_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def date_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def time_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def in_connector_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def range_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def now_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def date_point_extractor(self) -> DateExtractor: - raise NotImplementedError - - @property - @abstractmethod - def integer_extractor(self) -> BaseNumberExtractor: - raise NotImplementedError +from .utilities import ( + DateContext, + DateTimeFormatUtil, + DateTimeResolutionResult, + DateUtils, + DayOfWeek, + RegExpUtility, + TimexUtil, + Token, + merge_all_tokens, +) - @property - @abstractmethod - def ordinal_extractor(self) -> Extractor: - raise NotImplementedError - @property - @abstractmethod - def cardinal_extractor(self) -> Extractor: - raise NotImplementedError +MatchedIndex = namedtuple('MatchedIndex', ['matched', 'index']) - @property - @abstractmethod - def number_parser(self) -> BaseNumberParser: - raise NotImplementedError - @property - @abstractmethod - def duration_extractor(self) -> DateTimeExtractor: - raise NotImplementedError +class DatePeriodExtractorConfiguration: - @abstractmethod def get_from_token_index(self, source: str) -> MatchedIndex: raise NotImplementedError - @abstractmethod def get_between_token_index(self, source: str) -> MatchedIndex: raise NotImplementedError - @abstractmethod def has_connector_token(self, source: str) -> bool: raise NotImplementedError - @property - @abstractmethod - def within_next_prefix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def future_suffix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def ago_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def later_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def less_than_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def more_than_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def duration_date_restrictions(self) -> [str]: - raise NotImplementedError - - @property - @abstractmethod - def year_period_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def century_suffix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def month_num_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def check_both_before_after(self) -> bool: - raise NotImplementedError - - @property - @abstractmethod - def previous_prefix_regex(self) -> Pattern: - raise NotImplementedError + def __init__(self, resource: BaseDateTimeResource): + self.of_year_regex = RegExpUtility.get_safe_reg_exp(resource.OfYearRegex) + self.week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(resource.WeekWithWeekDayRangeRegex) + self.later_early_year_regex = RegExpUtility.get_safe_reg_exp(resource.LaterEarlyPeriodRegex) + self.all_half_year_regex = RegExpUtility.get_safe_reg_exp(resource.AllHalfYearRegex) + self.complex_date_period_regex = RegExpUtility.get_safe_reg_exp(resource.ComplexDatePeriodRegex) + self.rest_of_date_regex = RegExpUtility.get_safe_reg_exp(resource.RestOfDateRegex) + self.which_week_regex = RegExpUtility.get_safe_reg_exp(resource.WhichWeekRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(resource.NextPrefixRegex) + self.month_suffix_regex = RegExpUtility.get_safe_reg_exp(resource.MonthSuffixRegex) + self.relative_month_regex = RegExpUtility.get_safe_reg_exp(resource.RelativeMonthRegex) + self.week_day_regex = RegExpUtility.get_safe_reg_exp(resource.WeekDayRegex) + self.day_regex = RegExpUtility.get_safe_reg_exp(resource.DayRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(resource.RangeConnectorRegex) + self.time_unit_regex = RegExpUtility.get_safe_reg_exp(resource.TimeUnitRegex) + self.first_last_regex = RegExpUtility.get_safe_reg_exp(resource.FirstLastRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(resource.PastSuffixRegex) + self.past_prefix_regex = RegExpUtility.get_safe_reg_exp(resource.PastSuffixRegex) + self.check_both_before_after = resource.CheckBothBeforeAfter + self.week_of_month_regex = resource.WeekOfMonthRegex + self.check_both_before_after = resource.CheckBothBeforeAfter + self.illegal_year_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.IllegalYearRegex) + self.year_regex = RegExpUtility.get_safe_reg_exp(resource.YearRegex) + self.till_regex = RegExpUtility.get_safe_reg_exp(resource.TillRegex) + self.followed_unit = RegExpUtility.get_safe_reg_exp(resource.FollowedDateUnit) + self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp(resource.NumberCombinedWithDateUnit) + self.past_regex = RegExpUtility.get_safe_reg_exp(resource.PreviousPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(resource.PreviousPrefixRegex) + self.future_regex = RegExpUtility.get_safe_reg_exp(resource.NextPrefixRegex) + self.week_of_regex = RegExpUtility.get_safe_reg_exp(resource.WeekOfRegex) + self.month_of_regex = RegExpUtility.get_safe_reg_exp(resource.MonthOfRegex) + self.date_unit_regex = RegExpUtility.get_safe_reg_exp(resource.DateUnitRegex) + self.within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(resource.WithinNextPrefixRegex) + self.in_connector_regex = RegExpUtility.get_safe_reg_exp(resource.InConnectorRegex) + self.range_unit_regex = RegExpUtility.get_safe_reg_exp(resource.RangeUnitRegex) + self.from_regex = RegExpUtility.get_safe_reg_exp(resource.FromRegex) + self.before_regex = RegExpUtility.get_safe_reg_exp(resource.BeforeRegex) + self.now_regex = RegExpUtility.get_safe_reg_exp(resource.NowRegex) + self.future_suffix_regex = RegExpUtility.get_safe_reg_exp(resource.FutureSuffixRegex) + self.ago_regex = RegExpUtility.get_safe_reg_exp(resource.AgoRegex) + self.later_regex = RegExpUtility.get_safe_reg_exp(resource.LaterRegex) + self.less_than_regex = RegExpUtility.get_safe_reg_exp(resource.LessThanRegex) + self.more_than_regex = RegExpUtility.get_safe_reg_exp(resource.MoreThanRegex) + self.duration_date_restrictions = resource.DurationDateRestrictions + self.year_period_regex = RegExpUtility.get_safe_reg_exp(resource.YearPeriodRegex) + self.month_num_regex = RegExpUtility.get_safe_reg_exp(resource.MonthNumRegex) + self.century_suffix_regex = RegExpUtility.get_safe_reg_exp(resource.CenturySuffixRegex) + self.decade_with_century_regex = RegExpUtility.get_safe_reg_exp(resource.DecadeWithCenturyRegex) + self.time_unit_regex = RegExpUtility.get_safe_reg_exp(resource.TimeUnitRegex) + if hasattr(resource, 'WrittenMonthRegex'): + self.written_month_regex = RegExpUtility.get_safe_reg_exp(resource.WrittenMonthRegex) + if hasattr(resource, 'BetweenTokenRegex'): + self.between_token_regex = RegExpUtility.get_safe_reg_exp(resource.BetweenTokenRegex) + if hasattr(resource, 'ThisPrefixRegex'): + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(resource.ThisPrefixRegex) class BaseDatePeriodExtractor(DateTimeExtractor): @@ -250,7 +138,7 @@ def match_ordinal_number_with_century_suffix(self, text: str, ordinal_extraction if er.start + er.length >= len(text): continue - after_string = text[er.start + er.length:] + after_string = text[er.start + er.length :] trimmed_after_string = after_string.rstrip() white_spaces_count = len(after_string) - len(trimmed_after_string) after_string_offset = (er.start + er.length) + white_spaces_count @@ -258,8 +146,9 @@ def match_ordinal_number_with_century_suffix(self, text: str, ordinal_extraction match = regex.match(self.config.century_suffix_regex, trimmed_after_string) if match: - result.append(Token(er.start, after_string_offset + text.index(match.group()) + - (match.end() - match.start()))) + result.append( + Token(er.start, after_string_offset + text.index(match.group()) + (match.end() - match.start())) + ) return result @@ -322,12 +211,14 @@ def has_invalid_dash_context(self, match: Match, text: str): # Filter out cases like "82-2100" where "2100" should not be extracted as a DateRange # Filter out cases like "82-2010-2015" where "2010-2015" should not be extracted as a DateRange if has_dash_prefix: - has_digit_number_before_dash, number_start_index = self.has_digit_number_before_dash(text, - dash_prefix_index) + has_digit_number_before_dash, number_start_index = self.has_digit_number_before_dash( + text, dash_prefix_index + ) if has_digit_number_before_dash: - digit_number_str = text[number_start_index: number_start_index + (text.index(match.group()) - - 1 - number_start_index)] + digit_number_str = text[ + number_start_index : number_start_index + (text.index(match.group()) - 1 - number_start_index) + ] if RegExpUtility.is_exact_match(self.config.month_num_regex, digit_number_str, True): has_invalid_dash_context = True @@ -341,7 +232,7 @@ def has_invalid_dash_context(self, match: Match, text: str): has_digit_number_after_dash, number_end_index = self.has_digit_number_after_dash(text, dash_suffix_index) number_start_index = text.index(match.group()) + (match.end() - match.start()) + 1 - digit_number_str = text[number_start_index: number_start_index + (number_end_index - number_start_index)] + digit_number_str = text[number_start_index : number_start_index + (number_end_index - number_start_index)] if RegExpUtility.is_exact_match(self.config.month_num_regex, digit_number_str, True): has_invalid_dash_context = True @@ -443,14 +334,22 @@ def match_complex_cases(self, text: str, simple_date_range_results: [ExtractResu # Filter out DateRange results that are part of DatePoint results # For example, "Feb 1st 2018" => "Feb" and "2018" should be filtered out here - er.extend(list( - filter( - lambda simple_date_range: not any( - list( - filter( - lambda date_point: date_point.start <= simple_date_range.start and date_point.start + - date_point.length >= simple_date_range.start + simple_date_range.length, er))), - simple_date_range_results)) + er.extend( + list( + filter( + lambda simple_date_range: not any( + list( + filter( + lambda date_point: date_point.start <= simple_date_range.start + and date_point.start + date_point.length + >= simple_date_range.start + simple_date_range.length, + er, + ) + ) + ), + simple_date_range_results, + ) + ) ) er = list(sorted(er, key=lambda x: x.start)) @@ -473,8 +372,9 @@ def match_simple_cases(self, source: str) -> List[ExtractResult]: continue if (match.end() - match.start() == Constants.FOUR_DIGITS_YEAR_LENGTH) and self.__infix_boundary_check( - match, source): - sub_str = source[match.start() - 1: match.end() + 1] + match, source + ): + sub_str = source[match.start() - 1 : match.end() + 1] # Handle single year which is surrounded by '-' at both sides, e.g., a single year falls in a GUID if self.config.illegal_year_regex.match(sub_str): @@ -503,9 +403,13 @@ def __get_year_from_text(self, match) -> int: er.length = match.end(Constants.LAST_TWO_YEAR_NUM) - er.start last_two_year_num = self.config.number_parser.parse(er).value - if first_two_year_num < 100 and last_two_year_num == 0 or first_two_year_num < 100 and\ - first_two_year_num % 10 == 0 and len( - last_two_year_num_str.strip().split(' ')) == 1: + if ( + first_two_year_num < 100 + and last_two_year_num == 0 + or first_two_year_num < 100 + and first_two_year_num % 10 == 0 + and len(last_two_year_num_str.strip().split(' ')) == 1 + ): return -1 if first_two_year_num >= 100: @@ -554,14 +458,12 @@ def merge_multiple_extractions(self, source: str, extract_result: [ExtractResult if RegExpUtility.is_exact_match(self.config.till_regex, middle_str, True): period_begin = extract_result[idx].start - period_end = (extract_result[idx + 1].start or 0) + \ - (extract_result[idx + 1].length or 0) + period_end = (extract_result[idx + 1].start or 0) + (extract_result[idx + 1].length or 0) # Handle "from/between" together with till words (till/until/through...) before_str = source[0:period_begin].strip().lower() from_token_index = self.config.get_from_token_index(before_str) - between_token_index = self.config.get_between_token_index( - before_str) + between_token_index = self.config.get_between_token_index(before_str) if from_token_index.matched or between_token_index.matched: period_begin = from_token_index.index if from_token_index.matched else between_token_index.index @@ -573,13 +475,11 @@ def merge_multiple_extractions(self, source: str, extract_result: [ExtractResult if self.config.has_connector_token(middle_str): period_begin = extract_result[idx].start or 0 - period_end = (extract_result[idx + 1].start or 0) + \ - (extract_result[idx + 1].length or 0) + period_end = (extract_result[idx + 1].start or 0) + (extract_result[idx + 1].length or 0) # handle "between...and..." case before_str = source[0:period_begin].strip().lower() - between_token_index = self.config.get_between_token_index( - before_str) + between_token_index = self.config.get_between_token_index(before_str) if between_token_index.matched: period_begin = between_token_index.index @@ -590,7 +490,7 @@ def merge_multiple_extractions(self, source: str, extract_result: [ExtractResult continue if self.config.check_both_before_after: - after_str = source[period_end: len(source) - period_end] + after_str = source[period_end : len(source) - period_end] between_token_index = self.config.get_between_token_index(after_str) if between_token_index.matched: period_end += after_str @@ -609,15 +509,16 @@ def match_duration(self, source: str, reference: datetime) -> List[Token]: durations = [] duration_extractions = self.config.duration_extractor.extract(source, reference) - for duration_extraction in self.config.duration_extractor.extract(source, reference): + for duration_extraction in duration_extractions: match = self.config.date_unit_regex.search(duration_extraction.text) if match: durations.append( - Token(duration_extraction.start, duration_extraction.start + duration_extraction.length)) + Token(duration_extraction.start, duration_extraction.start + duration_extraction.length) + ) for duration in durations: - before_str = source[0:duration.start].lower() - after_str = source[duration.start:duration.start + duration.length] + before_str = source[0 : duration.start].lower() + after_str = source[duration.start : duration.start + duration.length] if not before_str or not after_str: continue @@ -649,8 +550,8 @@ def match_duration(self, source: str, reference: datetime) -> List[Token]: index = match.index if index >= 0: - prefix = before_str[0: index].strip() - duration_text = source[duration.start: duration.length] + prefix = before_str[0:index].strip() + duration_text = source[duration.start : duration.length] numbers_in_prefix = self.config.cardinal_extractor.extract(prefix) numbers_in_duration = self.config.cardinal_extractor.extract(duration_text) @@ -682,15 +583,18 @@ def match_duration(self, source: str, reference: datetime) -> List[Token]: return tokens def _match_within_next_affix_regex(self, source, duration, in_prefix): - before_str = source[0: duration.start] - after_str = source[duration.start: duration.start + duration.length] + before_str = source[0 : duration.start] + after_str = source[duration.start : duration.start + duration.length] end_token = start_token = -1 - match = RegExpUtility.match_end(self.config.within_next_prefix_regex, before_str, True) if in_prefix else \ - RegExpUtility.match_begin(self.config.within_next_prefix_regex, after_str, True) + match = ( + RegExpUtility.match_end(self.config.within_next_prefix_regex, before_str, True) + if in_prefix + else RegExpUtility.match_begin(self.config.within_next_prefix_regex, after_str, True) + ) if match and match.success: - duration_str = source[duration.start: duration.length] + duration_str = source[duration.start : duration.length] match_date = self.config.date_unit_regex.match(duration_str) match_time = self.config.time_unit_regex.match(duration_str) @@ -714,23 +618,26 @@ def __extract_within_next_prefix(self, substr, extract_result, in_prefix): # For "within" case # Cases like "within the next 5 days before today" is not acceptable if not (is_next and self.is_ago_relative_duration_date(extract_result)): - result.extend(self.__get_token_for_regex_matching( - substr, - self.config.within_next_prefix_regex, - extract_result, in_prefix) + result.extend( + self.__get_token_for_regex_matching( + substr, self.config.within_next_prefix_regex, extract_result, in_prefix + ) ) return result + # 1. Extract the month of date, week of date to a date range # 2. Extract cases like within two weeks from/before today/tomorrow/yesterday - def single_time_point_with_patterns(self, source: str, ordinal_extractions: - [ExtractResult], reference: datetime) -> List[Token]: + def single_time_point_with_patterns( + self, source: str, ordinal_extractions: [ExtractResult], reference: datetime + ) -> List[Token]: result = [] date_points = self.config.date_point_extractor.extract(source, reference) # For cases like "week of the 18th" - date_points.extend(list(filter(lambda o: not any(list(filter(lambda x: x.overlap(o), date_points))), - ordinal_extractions))) + date_points.extend( + list(filter(lambda o: not any(list(filter(lambda x: x.overlap(o), date_points))), ordinal_extractions)) + ) if len(date_points) < 1: return result @@ -738,39 +645,59 @@ def single_time_point_with_patterns(self, source: str, ordinal_extractions: for extraction_result in date_points: if extraction_result.start is not None and extraction_result.length is not None: - before_string = source[0: extraction_result.start] - after_string = source[extraction_result.start + extraction_result.length: len(source) - - extraction_result.start - extraction_result.length] - result.extend(self.__get_token_for_regex_matching(before_string, - self.config.week_of_regex, extraction_result, True)) - result.extend(self.__get_token_for_regex_matching(before_string, - self.config.month_of_regex, extraction_result, True)) + before_string = source[0 : extraction_result.start] + after_string = source[ + extraction_result.start + + extraction_result.length : len(source) + - extraction_result.start + - extraction_result.length + ] + result.extend( + self.__get_token_for_regex_matching( + before_string, self.config.week_of_regex, extraction_result, True + ) + ) + result.extend( + self.__get_token_for_regex_matching( + before_string, self.config.month_of_regex, extraction_result, True + ) + ) # check also after_string if self.config.check_both_before_after: - result.extend(self.__get_token_for_regex_matching(after_string, - self.config.week_of_regex, extraction_result, - True)) - result.extend(self.__get_token_for_regex_matching(after_string, - self.config.month_of_regex, extraction_result, - True)) + result.extend( + self.__get_token_for_regex_matching( + after_string, self.config.week_of_regex, extraction_result, True + ) + ) + result.extend( + self.__get_token_for_regex_matching( + after_string, self.config.month_of_regex, extraction_result, True + ) + ) # Cases like "3 days from today", "2 weeks before yesterday", "3 months after tomorrow" if self.is_relative_duration_date(extraction_result): - result.extend(self.__get_token_for_regex_matching(before_string, - self.config.less_than_regex, extraction_result, - False)) - result.extend(self.__get_token_for_regex_matching(before_string, - self.config.more_than_regex, extraction_result, - False)) + result.extend( + self.__get_token_for_regex_matching( + before_string, self.config.less_than_regex, extraction_result, False + ) + ) + result.extend( + self.__get_token_for_regex_matching( + before_string, self.config.more_than_regex, extraction_result, False + ) + ) if self.config.check_both_before_after: - result.extend(self.__get_token_for_regex_matching(after_string, - self.config.less_than_regex, - extraction_result, - False)) - result.extend(self.__get_token_for_regex_matching(after_string, - self.config.more_than_regex, - extraction_result, - False)) + result.extend( + self.__get_token_for_regex_matching( + after_string, self.config.less_than_regex, extraction_result, False + ) + ) + result.extend( + self.__get_token_for_regex_matching( + after_string, self.config.more_than_regex, extraction_result, False + ) + ) # For "within" case, only duration with relative to "today" or "now" makes sense # Cases like "within 3 days from yesterday/tomorrow" does not make any sense if self.is_date_relative_to_now_or_today(extraction_result): @@ -801,14 +728,21 @@ def is_date_relative_to_now_or_today(self, er: ExtractResult): @staticmethod def __match_regex_in_prefix(source: str, match: Match) -> bool: - return match and not source[match.end():].strip() + return match and not source[match.end() :].strip() @staticmethod def __get_token_for_regex_matching(source: str, regexp: Pattern, er: ExtractResult, in_prefix: bool) -> List[Token]: tokens = [] match = regex.search(regexp, source) - is_match_at_edge = False if not match else source.strip().endswith(match.group().strip()) if in_prefix else\ - source.strip().startswith(match.group().strip()) + is_match_at_edge = ( + False + if not match + else ( + source.strip().endswith(match.group().strip()) + if in_prefix + else source.strip().startswith(match.group().strip()) + ) + ) if match and is_match_at_edge: start_index = source.rfind(match.group()) @@ -823,7 +757,7 @@ def __get_token_for_regex_matching(source: str, regexp: Pattern, er: ExtractResu def __infix_boundary_check(match: Match, source: str) -> bool: is_match_infix_of_source = False if match.start() > 0 and match.end() < len(source): - if source[match.start():match.end()] == match.group(): + if source[match.start() : match.end()] == match.group(): is_match_infix_of_source = True return is_match_infix_of_source @@ -1110,25 +1044,27 @@ def __init__(self, config: DatePeriodParserConfiguration, inclusive_end_period: self.config = config self._inclusive_end_period = inclusive_end_period - def get_year_context(self, config: DatePeriodParserConfiguration, start_date_str: str, end_date_str: str, - text: str) -> DateContext: + def get_year_context( + self, config: DatePeriodParserConfiguration, start_date_str: str, end_date_str: str, text: str + ) -> DateContext: is_end_date_pure_year = False is_date_relative = False context_year = Constants.INVALID_YEAR year_match_for_end_date = self.config.year_regex.match(end_date_str) - if year_match_for_end_date and hasattr(year_match_for_end_date, 'success') and \ - year_match_for_end_date.success and \ - len(year_match_for_end_date) == len(end_date_str): + if ( + year_match_for_end_date + and hasattr(year_match_for_end_date, 'success') + and year_match_for_end_date.success + and len(year_match_for_end_date) == len(end_date_str) + ): is_end_date_pure_year = True else: is_end_date_pure_year = False relative_match_for_start_date = config.relative_regex.search(start_date_str) relative_match_for_end_date = config.relative_regex.search(end_date_str) if relative_match_for_start_date and relative_match_for_end_date: - if hasattr(relative_match_for_start_date, 'success') and \ - hasattr(relative_match_for_end_date, 'success'): - is_date_relative = relative_match_for_start_date.success or \ - relative_match_for_end_date.success + if hasattr(relative_match_for_start_date, 'success') and hasattr(relative_match_for_end_date, 'success'): + is_date_relative = relative_match_for_start_date.success or relative_match_for_end_date.success else: is_date_relative = None if not is_end_date_pure_year and not is_date_relative: @@ -1164,13 +1100,11 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if inner_result.future_value and inner_result.past_value: inner_result.future_resolution = { TimeTypeConstants.START_DATE: DateTimeFormatUtil.format_date(inner_result.future_value[0]), - TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date( - inner_result.future_value[1]) + TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date(inner_result.future_value[1]), } inner_result.past_resolution = { TimeTypeConstants.START_DATE: DateTimeFormatUtil.format_date(inner_result.past_value[0]), - TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date( - inner_result.past_value[1]) + TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date(inner_result.past_value[1]), } else: @@ -1191,8 +1125,9 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D return result - def _parse_base_date_period(self, text: str, reference_date: datetime, date_context: DateContext = None) \ - -> DateTimeResolutionResult: + def _parse_base_date_period( + self, text: str, reference_date: datetime, date_context: DateContext = None + ) -> DateTimeResolutionResult: inner_result = self.__parse_month_with_year(text, reference_date) if not inner_result.success: inner_result = self._parse_simple_case(text, reference_date) @@ -1252,8 +1187,9 @@ def _parse_complex_date_period(self, source, reference): if match: future_begin = future_end = past_begin = past_end = datetime.min is_specific_date = is_start_by_week = is_end_by_week = False - date_context = self.get_year_context(self.config, match.group('start').strip(), match.group('end').strip(), - source) + date_context = self.get_year_context( + self.config, match.group('start').strip(), match.group('end').strip(), source + ) start_resolution = self.__parse_single_time_point(match.group('start').strip(), reference, date_context) if start_resolution and start_resolution.success: @@ -1289,8 +1225,11 @@ def _parse_complex_date_period(self, source, reference): if end_resolution: if future_begin > future_end: - future_begin = past_begin if not date_context or date_context.is_empty() else \ - DateContext.swift_date_object(future_begin, future_end) + future_begin = ( + past_begin + if not date_context or date_context.is_empty() + else DateContext.swift_date_object(future_begin, future_end) + ) if past_end < past_begin: if not date_context: @@ -1301,7 +1240,8 @@ def _parse_complex_date_period(self, source, reference): date_period_timex_type = 0 if is_specific_date else 1 if is_start_by_week or is_end_by_week else 2 result.timex = TimexUtil.generate_date_period_timex( - future_begin, future_end, date_period_timex_type, past_begin, past_end) + future_begin, future_end, date_period_timex_type, past_begin, past_end + ) result.future_value = [future_begin, future_end] result.past_value = [past_begin, past_end] result.success = True @@ -1432,16 +1372,12 @@ def _parse_simple_case(self, source: str, reference: datetime) -> DateTimeResolu result.timex = f'({begin_date_luis},{end_date_luis},P{end_day - begin_day}D)' result.future_value = [ - DateUtils.safe_create_from_value( - DateUtils.min_value, future_year, month, begin_day), - DateUtils.safe_create_from_value( - DateUtils.min_value, future_year, month, end_day) + DateUtils.safe_create_from_value(DateUtils.min_value, future_year, month, begin_day), + DateUtils.safe_create_from_value(DateUtils.min_value, future_year, month, end_day), ] result.past_value = [ - DateUtils.safe_create_from_value( - DateUtils.min_value, past_year, month, begin_day), - DateUtils.safe_create_from_value( - DateUtils.min_value, past_year, month, end_day) + DateUtils.safe_create_from_value(DateUtils.min_value, past_year, month, begin_day), + DateUtils.safe_create_from_value(DateUtils.min_value, past_year, month, end_day), ] result.success = True @@ -1457,20 +1393,19 @@ def _parse_one_word_period(self, source: str, reference: datetime) -> DateTimeRe if self.config.is_year_to_date(source): result.timex = f'{year:04d}' - result.future_value = [DateUtils.safe_create_from_value( - DateUtils.min_value, year, 1, 1), reference] - result.past_value = [DateUtils.safe_create_from_value( - DateUtils.min_value, year, 1, 1), reference] + result.future_value = [DateUtils.safe_create_from_value(DateUtils.min_value, year, 1, 1), reference] + result.past_value = [DateUtils.safe_create_from_value(DateUtils.min_value, year, 1, 1), reference] result.success = True return result if self.config.is_month_to_date(source): result.timex = f'{year:04d}-{month:02d}' - result.future_value = [DateUtils.safe_create_from_value( - DateUtils.min_value, year, month, 1), reference] - result.past_value = [DateUtils.safe_create_from_value( - DateUtils.min_value, year, month, month, 1), reference] + result.future_value = [DateUtils.safe_create_from_value(DateUtils.min_value, year, month, 1), reference] + result.past_value = [ + DateUtils.safe_create_from_value(DateUtils.min_value, year, month, month, 1), + reference, + ] result.success = True return result @@ -1514,8 +1449,10 @@ def _parse_one_word_period(self, source: str, reference: datetime) -> DateTimeRe else: swift = self.config.get_swift_day_or_month(trimmed_source) - if self.config.unspecific_end_of_range_regex is not None and self.config.unspecific_end_of_range_regex.match( - match.value): + if ( + self.config.unspecific_end_of_range_regex is not None + and self.config.unspecific_end_of_range_regex.match(match.value) + ): late_prefix = True trimmed_source = match.value result.mod = TimeTypeConstants.LATE_MOD @@ -1560,8 +1497,7 @@ def _parse_one_word_period(self, source: str, reference: datetime) -> DateTimeRe end_date = DateUtils.this(reference, DayOfWeek.SUNDAY) + datedelta(days=7 * swift) if early_prefix: - end_date = DateUtils.this( - reference, DayOfWeek.WEDNESDAY) + datedelta(days=7 * swift) + end_date = DateUtils.this(reference, DayOfWeek.WEDNESDAY) + datedelta(days=7 * swift) elif mid_prefix: begin_date = DateUtils.this(reference, DayOfWeek.TUESDAY) + datedelta(days=7 * swift) @@ -1667,7 +1603,8 @@ def _merge_two_times_points(self, source: str, reference: datetime) -> DateTimeR if not extract_results or len(extract_results) < 2: extract_results = self.config.date_extractor.extract( - self.config.token_before_date + trimmed_source, reference) + self.config.token_before_date + trimmed_source, reference + ) if len(extract_results) >= 2: for extract_result in extract_results: @@ -1692,7 +1629,11 @@ def _merge_two_times_points(self, source: str, reference: datetime) -> DateTimeR future_match_for_start_date = self.config.future_regex.match(extract_results[0].text) future_match_for_end_date = self.config.future_regex.match(extract_results[1].text) - if future_match_for_start_date and future_match_for_start_date.success and not future_match_for_end_date.success: + if ( + future_match_for_start_date + and future_match_for_start_date.success + and not future_match_for_end_date.success + ): extract_results[1].text = future_match_for_start_date.value + ' ' + extract_results[1].text match = self.config.week_with_week_day_range_regex.search(source) @@ -1718,7 +1659,10 @@ def _merge_two_times_points(self, source: str, reference: datetime) -> DateTimeR parse_result2 = date_context.process_date_entity_parsing_result(parse_result2) # When the case has no specified year, we should sync the future/past year due to invalid date Feb 29th. - if date_context.is_empty() and (DateUtils.is_Feb_29th_datetime(parse_result1.value.future_value) or DateUtils.is_Feb_29th_datetime(parse_result2.value.future_value)): + if date_context.is_empty() and ( + DateUtils.is_Feb_29th_datetime(parse_result1.value.future_value) + or DateUtils.is_Feb_29th_datetime(parse_result2.value.future_value) + ): parse_result1, parse_result2 = date_context.sync_year(parse_result1, parse_result2) result.sub_date_time_entities = [parse_result1, parse_result2] @@ -1734,13 +1678,21 @@ def _merge_two_times_points(self, source: str, reference: datetime) -> DateTimeR if past_end < past_begin: past_end = future_end - result.timex = TimexUtil.generate_date_period_timex_str(future_begin, future_end, 0, parse_result1.timex_str, parse_result2.timex_str) + result.timex = TimexUtil.generate_date_period_timex_str( + future_begin, future_end, 0, parse_result1.timex_str, parse_result2.timex_str + ) - if parse_result1.timex_str.startswith(Constants.TIMEX_FUZZY_YEAR) and future_begin <= DateUtils.safe_create_from_value(DateUtils.min_value, future_begin.year, 2, 28) and future_end >= DateUtils.safe_create_from_value(DateUtils.min_value, future_begin.year, 3, 1): + if ( + parse_result1.timex_str.startswith(Constants.TIMEX_FUZZY_YEAR) + and future_begin <= DateUtils.safe_create_from_value(DateUtils.min_value, future_begin.year, 2, 28) + and future_end >= DateUtils.safe_create_from_value(DateUtils.min_value, future_begin.year, 3, 1) + ): # Handle cases like "2/28 - 3/1". # There may be different timexes for FutureValue and PastValue due to the different validity of Feb 29th. result.comment = Constants.COMMENT_DOUBLETIMEX - past_timex = TimexUtil.generate_date_period_timex_str(past_begin, past_end, 0, parse_result1.timex_str, parse_result2.timex_str) + past_timex = TimexUtil.generate_date_period_timex_str( + past_begin, past_end, 0, parse_result1.timex_str, parse_result2.timex_str + ) result.timex = TimexUtil.merge_timex_alternatives(result.timex, past_timex) result.future_value = [future_begin, future_end] result.past_value = [past_begin, past_end] @@ -1753,11 +1705,9 @@ def _parse_now_as_date(self, source: str, reference: datetime) -> DateTimeParseR parse_result = DateTimeParseResult() match = self.config.now_regex.search(source) if match is not None: - value = DateUtils.safe_create_from_min_value( - reference.year, reference.month, reference.day) + value = DateUtils.safe_create_from_min_value(reference.year, reference.month, reference.day) ret_now = DateTimeResolutionResult() - ret_now.timex = DateTimeFormatUtil.luis_date_from_datetime( - reference) + ret_now.timex = DateTimeFormatUtil.luis_date_from_datetime(reference) ret_now.future_value = value ret_now.past_value = value parse_result.text = match.string @@ -1777,10 +1727,8 @@ def _parse_year(self, source: str, reference: datetime) -> DateTimeResolutionRes return result year = int(self.config.date_extractor.get_year_from_text(match)) - begin_date = DateUtils.safe_create_from_value( - DateUtils.min_value, year, 1, 1) - end_date = DateUtils.safe_create_from_value( - DateUtils.min_value, year + 1, 1, 1) + begin_date = DateUtils.safe_create_from_value(DateUtils.min_value, year, 1, 1) + end_date = DateUtils.safe_create_from_value(DateUtils.min_value, year + 1, 1, 1) if self._inclusive_end_period: end_date = end_date + datedelta(days=-1) @@ -1895,8 +1843,7 @@ def _parse_week_of_year(self, source: str, reference: datetime) -> DateTimeResol week_num = DateUtils.week_of_year(last_day) if week_num == 1: - last_day_week_monday = DateUtils.this( - last_day + datedelta(days=-7), DayOfWeek.MONDAY) + last_day_week_monday = DateUtils.this(last_day + datedelta(days=-7), DayOfWeek.MONDAY) target_week_monday = last_day_week_monday week_num = DateUtils.week_of_year(target_week_monday) @@ -1945,13 +1892,17 @@ def _parse_half_year(self, source: str, reference: datetime) -> DateTimeResoluti quarter_num = self.config.cardinal_map[cardinal_str] if not number_str else int(number_str) begin_date = DateUtils.safe_create_date_resolve_overflow( - year, ((quarter_num - 1) * Constants.SEMESTER_MONTH_COUNT) + 1, 1) + year, ((quarter_num - 1) * Constants.SEMESTER_MONTH_COUNT) + 1, 1 + ) end_date = DateUtils.safe_create_date_resolve_overflow( - year, (quarter_num * Constants.SEMESTER_MONTH_COUNT) + 1, 1) + year, (quarter_num * Constants.SEMESTER_MONTH_COUNT) + 1, 1 + ) result.future_value = result.past_value = [begin_date, end_date] - result.timex = f'({DateTimeFormatUtil.luis_date_from_datetime(begin_date)},' \ + result.timex = ( + f'({DateTimeFormatUtil.luis_date_from_datetime(begin_date)},' f'{DateTimeFormatUtil.luis_date_from_datetime(end_date)},P6M)' + ) result.success = True return result @@ -1985,7 +1936,7 @@ def _parse_duration(self, source: str, reference: datetime) -> DateTimeResolutio if parse_result is None: return result - before_str = source[0:parse_result.start].strip() + before_str = source[0 : parse_result.start].strip() duration_result = parse_result.value if not duration_result.timex: @@ -2036,7 +1987,8 @@ def _parse_duration(self, source: str, reference: datetime) -> DateTimeResolutio elif duration_unit == Constants.UNIT_MON: end_date = DateUtils.safe_create_from_min_value( - begin_date.year, begin_date.month, DateUtils.last_day_of_month(begin_date.year, begin_date.month)) + begin_date.year, begin_date.month, DateUtils.last_day_of_month(begin_date.year, begin_date.month) + ) diff_days = end_date.day - begin_date.day + 1 elif duration_unit == Constants.UNIT_Y: @@ -2049,8 +2001,10 @@ def _parse_duration(self, source: str, reference: datetime) -> DateTimeResolutio if self._inclusive_end_period: end_date = end_date + timedelta(days=-1) - result.timex = f'({DateTimeFormatUtil.luis_date_from_datetime(begin_date)},' \ + result.timex = ( + f'({DateTimeFormatUtil.luis_date_from_datetime(begin_date)},' f'{DateTimeFormatUtil.luis_date_from_datetime(end_date)},{duration_timex})' + ) result.future_value = [begin_date, end_date] result.past_value = [begin_date, end_date] result.success = True @@ -2063,8 +2017,8 @@ def __parse_date_point_with_ago_and_later(self, source: str, reference: datetime extract_result = next(iter(self.config.date_extractor.extract(source, reference)), None) if extract_result: - before_str = source[0:extract_result.start].strip() - after_str = source[extract_result.start + extract_result.length:] + before_str = source[0 : extract_result.start].strip() + after_str = source[extract_result.start + extract_result.length :] is_ago = self.config.ago_regex.match(extract_result.text) is_later = self.config.later_regex.match(extract_result.text) @@ -2077,7 +2031,9 @@ def __parse_date_point_with_ago_and_later(self, source: str, reference: datetime if "today" in extract_result or "now" in extract_result: match_with_next_prefix(before_str, is_ago, is_less_than_or_with_in, is_more_than) else: - is_less_than_or_with_in = is_less_than_or_with_in or self.config.less_than_regex.match(before_str).success + is_less_than_or_with_in = ( + is_less_than_or_with_in or self.config.less_than_regex.match(before_str).success + ) is_more_than = self.config.less_than_regex.match(before_str).success # Check also after_str @@ -2216,12 +2172,16 @@ def __parse_decade(self, source: str, reference_date: datetime) -> DateTimeResol past_year -= 100 result.future_value = Dict[datetime, datetime] - result.future_value = [DateUtils.safe_create_from_value(future_year, 1, 1, 1), - DateUtils.safe_create_from_value(future_year + total_last_year, 1, 1, 1)] + result.future_value = [ + DateUtils.safe_create_from_value(future_year, 1, 1, 1), + DateUtils.safe_create_from_value(future_year + total_last_year, 1, 1, 1), + ] result.past_value = Dict[datetime, datetime] - result.past_value = [DateUtils.safe_create_from_value(past_year, 1, 1, 1), - DateUtils.safe_create_from_value(past_year + total_last_year, 1, 1, 1)] + result.past_value = [ + DateUtils.safe_create_from_value(past_year, 1, 1, 1), + DateUtils.safe_create_from_value(past_year + total_last_year, 1, 1, 1), + ] result.success = True @@ -2269,38 +2229,48 @@ def __parse_quarter(self, source: str, reference: datetime) -> DateTimeResolutio quarter_num = self.config.cardinal_map[cardinal_str] begin_date = DateUtils.safe_create_date_resolve_overflow( - year, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1) + year, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) end_date = DateUtils.safe_create_date_resolve_overflow( - year, (quarter_num * Constants.TRIMESTER_MONTH_COUNT) + 1, 1) + year, (quarter_num * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) if no_specific_value: if end_date < reference: result.past_value = [begin_date, end_date] future_begin_date = DateUtils.safe_create_date_resolve_overflow( - year + 1, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1) + year + 1, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) future_end_date = DateUtils.safe_create_date_resolve_overflow( - year + 1, (quarter_num * Constants.TRIMESTER_MONTH_COUNT) + 1, 1) + year + 1, (quarter_num * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) result.future_value = [future_begin_date, future_end_date] elif end_date > reference: result.future_value = [begin_date, end_date] past_begin_date = DateUtils.safe_create_date_resolve_overflow( - year - 1, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1) + year - 1, ((quarter_num - 1) * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) past_end_date = DateUtils.safe_create_date_resolve_overflow( - year - 1, (quarter_num * Constants.TRIMESTER_MONTH_COUNT) + 1, 1) + year - 1, (quarter_num * Constants.TRIMESTER_MONTH_COUNT) + 1, 1 + ) result.past_value = [past_begin_date, past_end_date] else: result.future_value = [begin_date, end_date] result.past_value = [begin_date, end_date] - result.timex = f'({DateTimeFormatUtil.luis_date(-1, begin_date.month, 1)},' \ + result.timex = ( + f'({DateTimeFormatUtil.luis_date(-1, begin_date.month, 1)},' f'{DateTimeFormatUtil.luis_date(-1, end_date.month, 1)},P3M)' + ) else: result.future_value = [begin_date, end_date] result.past_value = [begin_date, end_date] - result.timex = f'({DateTimeFormatUtil.luis_date_from_datetime(begin_date)},' \ + result.timex = ( + f'({DateTimeFormatUtil.luis_date_from_datetime(begin_date)},' f'{DateTimeFormatUtil.luis_date_from_datetime(end_date)},P3M)' + ) result.success = True return result @@ -2361,8 +2331,8 @@ def __parse_week_of_date(self, source: str, reference: datetime) -> DateTimeReso date_resolution = self.config.date_parser.parse(ers[0], reference).value result.timex = date_resolution.timex result.comment = BaseDatePeriodParser.week_of_comment - result.future_value = self.__get_week_range_from_date(date_resolution.future_value) - result.past_value = self.__get_week_range_from_date(date_resolution.past_value) + result.future_value = self.get_week_range_from_date(date_resolution.future_value) + result.past_value = self.get_week_range_from_date(date_resolution.past_value) result.success = True return result @@ -2377,18 +2347,18 @@ def __parse_month_of_date(self, source: str, reference: datetime) -> DateTimeRes date_resolution = self.config.date_parser.parse(ers[0], reference).value result.timex = date_resolution.timex result.comment = BaseDatePeriodParser.week_of_comment - result.future_value = self.__get_month_range_from_date(date_resolution.future_value) - result.past_value = self.__get_month_range_from_date(date_resolution.past_value) + result.future_value = self.get_month_range_from_date(date_resolution.future_value) + result.past_value = self.get_month_range_from_date(date_resolution.past_value) result.success = True return result - def __get_week_range_from_date(self, seed_date: datetime) -> List[datetime]: + def get_week_range_from_date(self, seed_date: datetime) -> List[datetime]: begin_date = DateUtils.this(seed_date, DayOfWeek.MONDAY) end_date = begin_date + timedelta(days=6 if self._inclusive_end_period else 7) return [begin_date, end_date] @staticmethod - def __get_month_range_from_date(seed_date: datetime) -> List[datetime]: + def get_month_range_from_date(seed_date: datetime) -> List[datetime]: begin_date = DateUtils.safe_create_from_value(DateUtils.min_value, seed_date.year, seed_date.month, 1) end_date = DateUtils.safe_create_from_value(DateUtils.min_value, seed_date.year, seed_date.month + 1, 1) return [begin_date, end_date] @@ -2396,7 +2366,7 @@ def __get_month_range_from_date(seed_date: datetime) -> List[datetime]: @staticmethod def __get_swift_date(date: datetime, timex: str, is_positive_swift: bool) -> datetime: result = date - num_str = timex.replace('P', '')[0:len(timex) - 2] + num_str = timex.replace('P', '')[0 : len(timex) - 2] unit_str = timex[len(timex) - 1] swift = int(num_str) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_datetime.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_datetime.py index 126c30fbb0..6674945e21 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_datetime.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_datetime.py @@ -2,21 +2,32 @@ # Licensed under the MIT License. from abc import abstractmethod -from typing import List, Optional, Pattern, Dict, Match -from datetime import datetime, timedelta from collections import namedtuple +from datetime import datetime, timedelta +from typing import Dict, List, Match, Optional, Pattern + import regex from recognizers_date_time.date_time.date_extractor import DateExtractor -from recognizers_text.extractor import ExtractResult +from recognizers_number.number.constants import Constants as NumConstants from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.extractor import ExtractResult + from .constants import Constants, TimeTypeConstants -from recognizers_number.number.constants import Constants as NumConstants from .extractors import DateTimeExtractor from .parsers import DateTimeParser, DateTimeParseResult -from .utilities import Token, merge_all_tokens, DateTimeResolutionResult, DateTimeUtilityConfiguration, AgoLaterUtil,\ - DateTimeFormatUtil, RegExpUtility, AgoLaterMode, DateTimeOptionsConfiguration, DateTimeOptions +from .utilities import ( + AgoLaterUtil, + DateTimeFormatUtil, + DateTimeOptions, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DateTimeUtilityConfiguration, + RegExpUtility, + Token, + merge_all_tokens, +) class DateTimeExtractorConfiguration(DateTimeOptionsConfiguration): @@ -147,8 +158,7 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult # merge a Date entity and a Time entity, like "at 7 tomorrow" def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: tokens: List[Token] = list() - date_ers: List[ExtractResult] = self.config.date_point_extractor.extract( - source, reference) + date_ers: List[ExtractResult] = self.config.date_point_extractor.extract(source, reference) if not date_ers: return tokens @@ -194,12 +204,20 @@ def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: if j >= len(extract_results): break - if ((extract_results[i].type is Constants.SYS_DATETIME_DATE and extract_results[j].type is - Constants.SYS_DATETIME_TIME) or - (extract_results[i].type is Constants.SYS_DATETIME_TIME and extract_results[j].type is - Constants.SYS_DATETIME_DATE) or - (extract_results[i].type is Constants.SYS_DATETIME_DATE and extract_results[j] is - NumConstants.SYS_NUM_INTEGER)): + if ( + ( + extract_results[i].type is Constants.SYS_DATETIME_DATE + and extract_results[j].type is Constants.SYS_DATETIME_TIME + ) + or ( + extract_results[i].type is Constants.SYS_DATETIME_TIME + and extract_results[j].type is Constants.SYS_DATETIME_DATE + ) + or ( + extract_results[i].type is Constants.SYS_DATETIME_DATE + and extract_results[j] is NumConstants.SYS_NUM_INTEGER + ) + ): middle_begin = extract_results[i].start + (extract_results[i].length or 0) middle_end = extract_results[j].start or 0 @@ -207,7 +225,7 @@ def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: i = j + 1 continue - middle_str = source[middle_begin: middle_end].strip() + middle_str = source[middle_begin:middle_end].strip() valid = False # for cases like "tomorrow 3", "tomorrow at 3" @@ -220,7 +238,8 @@ def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: match = self.config.suffix_after_regex.search(middle_str) if match: middle_str = middle_str[ - middle_str.index(match.group()) + len(match.group()): len(middle_end)].strip() + middle_str.index(match.group()) + len(match.group()) : len(middle_end) + ].strip() if not (match and len(middle_str) == 0): if self.config.is_connector_token(middle_str): @@ -240,7 +259,7 @@ def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: # handle "in the afternoon" at the end of entity idx = 0 for idx in range(idx, len(tokens), 1): - after_str = source[tokens[idx].end:] + after_str = source[tokens[idx].end :] match = self.config.suffix_regex.search(after_str) if match: tokens[idx] = Token(tokens[idx].start, tokens[idx].end + len(match.group())) @@ -248,7 +267,7 @@ def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: # handle "day" prefixes idx = 0 for idx in range(idx, len(tokens), 1): - before_str = source[0: tokens[idx].start] + before_str = source[0 : tokens[idx].start] match = self.config.utility_configuration.common_date_prefix_regex.search(before_str) if match: tokens[idx] = Token(tokens[idx].start - len(match.group()), tokens[idx].end) @@ -264,12 +283,12 @@ def extend_with_date_time_and_year(self, start_index: int, end_index: int, text: check_year = self.config.date_point_extractor.get_year_from_text(self.config.year_regex.search(text)) year = self.config.date_point_extractor.get_year_from_text(match_year) if Constants.MIN_YEAR_NUM <= year <= Constants.MAX_YEAR_NUM and check_year == year: - end_index += (match_year.end() - match_year.start()) + end_index += match_year.end() - match_year.start() return end_index, start_index def verify_end_token(self, source: str, token: Token) -> Token: - after_str = source[token.end:] + after_str = source[token.end :] match = regex.search(self.config.suffix_regex, after_str) if match: @@ -281,8 +300,7 @@ def verify_end_token(self, source: str, token: Token) -> Token: def basic_regex_match(self, source: str) -> List[Token]: tokens: List[Token] = list() # handle "now" - matches: List[Match] = list( - regex.finditer(self.config.now_regex, source)) + matches: List[Match] = list(regex.finditer(self.config.now_regex, source)) tokens.extend(map(lambda x: Token(x.start(), x.end()), matches)) return tokens @@ -292,25 +310,23 @@ def time_of_today_before(self, source: str, reference: datetime) -> List[Token]: extract_results = self.config.time_point_extractor.extract(source, reference) for extract_result in extract_results: - before = source[:extract_result.start] + before = source[: extract_result.start] # handle "this morning at 7am" inner_match = regex.search(self.config.night_regex, extract_result.text) if inner_match and inner_match.start() == 0: - before = source[:extract_result.start + len(inner_match.group())] + before = source[: extract_result.start + len(inner_match.group())] if not before: continue - match = regex.search( - self.config.time_of_today_before_regex, before) + match = regex.search(self.config.time_of_today_before_regex, before) if match: begin = match.start() end = extract_result.start + extract_result.length tokens.append(Token(begin, end)) - matches: List[Match] = list(regex.finditer( - self.config.simple_time_of_today_before_regex, source)) + matches: List[Match] = list(regex.finditer(self.config.simple_time_of_today_before_regex, source)) tokens.extend(map(lambda x: Token(x.start(), x.end()), matches)) return tokens @@ -320,7 +336,7 @@ def time_of_today_after(self, source: str, reference: datetime) -> List[Token]: extract_results = self.config.time_point_extractor.extract(source, reference) for extract_result in extract_results: - after = source[extract_result.start + extract_result.length:] + after = source[extract_result.start + extract_result.length :] if not after: continue @@ -330,8 +346,7 @@ def time_of_today_after(self, source: str, reference: datetime) -> List[Token]: end = extract_result.start + extract_result.length + len(match.group()) tokens.append(Token(begin, end)) - matches: List[Match] = list(regex.finditer( - self.config.simple_time_of_today_after_regex, source)) + matches: List[Match] = list(regex.finditer(self.config.simple_time_of_today_after_regex, source)) tokens.extend(map(lambda x: Token(x.start(), x.end()), matches)) return tokens @@ -341,20 +356,21 @@ def special_time_of_date(self, source: str, reference: datetime) -> List[Token]: # handle "the end of the day" for extract_result in extract_results: - before = source[:extract_result.start].strip() - before_match = RegExpUtility.match_end( - self.config.specific_end_of_regex, before, True) + before = source[: extract_result.start].strip() + before_match = RegExpUtility.match_end(self.config.specific_end_of_regex, before, True) if before_match and before_match.success: - tokens.append( - Token(before_match.index, extract_result.start + extract_result.length)) + tokens.append(Token(before_match.index, extract_result.start + extract_result.length)) else: - after = source[extract_result.start + extract_result.length:] - after_match = RegExpUtility.match_begin( - self.config.specific_end_of_regex, after, True) + after = source[extract_result.start + extract_result.length :] + after_match = RegExpUtility.match_begin(self.config.specific_end_of_regex, after, True) if after_match and after_match.success: - tokens.append(Token(extract_result.start, extract_result.start + - extract_result.length + after_match.index + after_match.length)) + tokens.append( + Token( + extract_result.start, + extract_result.start + extract_result.length + after_match.index + after_match.length, + ) + ) # handle "eod, end of day" eod = regex.finditer(self.config.unspecific_end_of_regex, source) @@ -372,7 +388,8 @@ def duration_with_before_and_after(self, source: str, reference: datetime) -> Li match = regex.search(self.config.unit_regex, extract_result.text) if match: tokens = AgoLaterUtil.extractor_duration_with_before_and_after( - source, extract_result, tokens, self.config.utility_configuration) + source, extract_result, tokens, self.config.utility_configuration + ) return tokens @@ -533,18 +550,18 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self.parse_time_of_today(source_text, reference) if not inner_result.success: - inner_result = self.parse_special_time_of_date( - source_text, reference) + inner_result = self.parse_special_time_of_date(source_text, reference) if not inner_result.success: - inner_result = self.parser_duration_with_ago_and_later( - source_text, reference) + inner_result = self.parser_duration_with_ago_and_later(source_text, reference) if inner_result.success: inner_result.future_resolution[TimeTypeConstants.DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.future_value) + inner_result.future_value + ) inner_result.past_resolution[TimeTypeConstants.DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.past_value) + inner_result.past_value + ) result.value = inner_result result.timex_str = inner_result.timex if inner_result else '' result.resolution_str = '' @@ -554,12 +571,10 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D # merge a Date entity and a Time entity def merge_date_and_time(self, source: str, reference: datetime) -> DateTimeResolutionResult: result = DateTimeResolutionResult() - extract_result1: ExtractResult = next( - iter(self.config.date_extractor.extract(source, reference)), None) + extract_result1: ExtractResult = next(iter(self.config.date_extractor.extract(source, reference)), None) if extract_result1 is None: - extract_results = self.config.date_extractor.extract( - self.config.token_before_date + source, reference) + extract_results = self.config.date_extractor.extract(self.config.token_before_date + source, reference) if len(extract_results) == 1: extract_result1: ExtractResult = next(iter(extract_results), None) @@ -572,14 +587,12 @@ def merge_date_and_time(self, source: str, reference: datetime) -> DateTimeResol if self.config.have_ambiguous_token(source, extract_result1.text): return result - extract_result2_list: List[ExtractResult] = self.config.time_extractor.extract( - source, reference) + extract_result2_list: List[ExtractResult] = self.config.time_extractor.extract(source, reference) extract_result2: ExtractResult = next(iter(extract_result2_list), None) if extract_result2 is None: # here we filter out "morning, afternoon, night..." time entities - extract_result2_list = self.config.time_extractor.extract( - self.config.token_before_time + source, reference) + extract_result2_list = self.config.time_extractor.extract(self.config.token_before_time + source, reference) if len(extract_result2_list) == 1: extract_result2: ExtractResult = next(iter(extract_result2_list), None) @@ -591,8 +604,9 @@ def merge_date_and_time(self, source: str, reference: datetime) -> DateTimeResol # in this case "5 in the afternoon" will be extract as a Time entity correct_time_idx = 0 - while correct_time_idx < len(extract_result2_list) and\ - extract_result2_list[correct_time_idx].overlap(extract_result1): + while correct_time_idx < len(extract_result2_list) and extract_result2_list[correct_time_idx].overlap( + extract_result1 + ): correct_time_idx += 1 if correct_time_idx >= len(extract_result2_list): @@ -629,21 +643,20 @@ def merge_date_and_time(self, source: str, reference: datetime) -> DateTimeResol val = parse_result2.value - has_am_pm = regex.search(self.config.pm_time_regex, source) and regex.search( - self.config.am_time_regex, source) + has_am_pm = regex.search(self.config.pm_time_regex, source) and regex.search(self.config.am_time_regex, source) if hour <= 12 and not has_am_pm and val.comment: result.comment = Constants.AM_PM_GROUP_NAME - result.future_value = datetime( - future_date.year, future_date.month, future_date.day, hour, minute, second) - result.past_value = datetime( - past_date.year, past_date.month, past_date.day, hour, minute, second) + result.future_value = datetime(future_date.year, future_date.month, future_date.day, hour, minute, second) + result.past_value = datetime(past_date.year, past_date.month, past_date.day, hour, minute, second) result.success = True # change the value of time object parse_result2.timex_str = time_str if result.comment: - parse_result2.value.comment = Constants.AM_PM_GROUP_NAME if result.comment == Constants.AM_PM_GROUP_NAME else '' + parse_result2.value.comment = ( + Constants.AM_PM_GROUP_NAME if result.comment == Constants.AM_PM_GROUP_NAME else '' + ) # add the date and time object in case we want to split them result.sub_date_time_entities = [parse_result1, parse_result2] @@ -671,17 +684,14 @@ def parse_time_of_today(self, source: str, reference: datetime) -> DateTimeResol minute = 0 second = 0 - whole_match = next(regex.finditer( - self.config.simple_time_of_today_after_regex, source), None) + whole_match = next(regex.finditer(self.config.simple_time_of_today_after_regex, source), None) if whole_match is None or whole_match.group() != source: - whole_match = next(regex.finditer( - self.config.simple_time_of_today_before_regex, source), None) + whole_match = next(regex.finditer(self.config.simple_time_of_today_before_regex, source), None) if whole_match and whole_match.group() == source: hour_str = RegExpUtility.get_group(whole_match, Constants.HOUR_GROUP_NAME, None) if not hour_str: - hour_str = RegExpUtility.get_group( - whole_match, Constants.HOUR_NUM_GROUP_NAME).lower() + hour_str = RegExpUtility.get_group(whole_match, Constants.HOUR_NUM_GROUP_NAME).lower() hour = self.config.numbers.get(hour_str) else: hour = int(hour_str) @@ -691,8 +701,9 @@ def parse_time_of_today(self, source: str, reference: datetime) -> DateTimeResol if len(ers) == 1: er = next(iter(ers), None) else: - er = next(iter(self.config.time_extractor.extract( - self.config.token_before_time + source, reference)), None) + er = next( + iter(self.config.time_extractor.extract(self.config.token_before_time + source, reference)), None + ) if er is None: return result er.start -= len(self.config.token_before_time) @@ -708,8 +719,7 @@ def parse_time_of_today(self, source: str, reference: datetime) -> DateTimeResol second = time.second time_str = pr.timex_str - match = next(regex.finditer( - self.config.specific_time_of_day_regex, source), None) + match = next(regex.finditer(self.config.specific_time_of_day_regex, source), None) if match is None: return result @@ -730,10 +740,8 @@ def parse_time_of_today(self, source: str, reference: datetime) -> DateTimeResol time_str = f'T{hour:02d}{time_str[3:]}' result.timex = DateTimeFormatUtil.format_date(date) + time_str - result.future_value = datetime( - date.year, date.month, date.day, hour, minute, second) - result.past_value = datetime( - date.year, date.month, date.day, hour, minute, second) + result.future_value = datetime(date.year, date.month, date.day, hour, minute, second) + result.past_value = datetime(date.year, date.month, date.day, hour, minute, second) result.success = True return result @@ -749,10 +757,11 @@ def parse_special_time_of_date(self, source: str, reference: datetime) -> DateTi return result extract_result = next(iter(extract_results), None) - before_str = source[0:extract_result.start] - after_str = source[:extract_result.start + extract_result.end] + before_str = source[0 : extract_result.start] + after_str = source[: extract_result.start + extract_result.end] if regex.search(self.config.specific_end_of_regex, before_str) or regex.search( - self.config.specific_end_of_regex, after_str): + self.config.specific_end_of_regex, after_str + ): parse_result = self.config.date_parser.parse(extract_result, reference) result.timex = parse_result.timex_str + 'T23:59:59' future_date = parse_result.value.future_value @@ -766,8 +775,7 @@ def parse_unspecific_time_of_date(self, source: str, reference: datetime) -> Dat result = DateTimeResolutionResult() eod = regex.search(self.config.unspecific_end_of_regex, source) if eod: - result = self.resolve_end_of_day( - DateTimeFormatUtil.format_date(reference), reference, reference) + result = self.resolve_end_of_day(DateTimeFormatUtil.format_date(reference), reference, reference) return result @@ -776,10 +784,8 @@ def resolve_end_of_day(timex_prefix: str, future_date: datetime, past_date: date result = DateTimeResolutionResult() result.timex = timex_prefix + 'T23:59:59' - result.future_value = datetime( - future_date.year, future_date.month, future_date.day, 23, 59, 59, 0) - result.past_value = datetime( - past_date.year, past_date.month, past_date.day, 23, 59, 59, 0) + result.future_value = datetime(future_date.year, future_date.month, future_date.day, 23, 59, 59, 0) + result.past_value = datetime(past_date.year, past_date.month, past_date.day, 23, 59, 59, 0) result.success = True return result @@ -792,5 +798,5 @@ def parser_duration_with_ago_and_later(self, source: str, reference: datetime) - self.config.duration_parser, self.config.unit_map, self.config.unit_regex, - self.config.utility_configuration + self.config.utility_configuration, ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_datetimeperiod.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_datetimeperiod.py index e708f55377..a9ce4d0196 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_datetimeperiod.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_datetimeperiod.py @@ -2,28 +2,46 @@ # Licensed under the MIT License. from abc import abstractmethod -from typing import List, Optional, Pattern, Dict, Match -from datetime import datetime, timedelta from collections import namedtuple +from datetime import datetime, timedelta +from typing import Dict, List, Match, Optional, Pattern + import regex -from recognizers_text.extractor import ExtractResult from recognizers_number import BaseNumberExtractor +from recognizers_text.extractor import ExtractResult + from .base_date import BaseDateExtractor -from .base_time import BaseTimeExtractor from .base_datetime import BaseDateTimeExtractor from .base_duration import BaseDurationExtractor +from .base_time import BaseTimeExtractor from .base_timeperiod import BaseTimePeriodExtractor from .constants import Constants, TimeTypeConstants from .extractors import DateTimeExtractor from .parsers import DateTimeParser, DateTimeParseResult -from .utilities import Token, merge_all_tokens, RegExpUtility, DateTimeFormatUtil, DateTimeResolutionResult, \ - DateUtils, RegExpUtility, DateTimeOptionsConfiguration, DateTimeOptions, TimexUtil +from .utilities import ( + DateTimeFormatUtil, + DateTimeOptions, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DateUtils, + RegExpUtility, + TimexUtil, + Token, + merge_all_tokens, +) class MatchedTimeRange: - def __init__(self, time_str: str = '', begin_hour: int = 0, end_hour: int = 0, end_min: int = 0, - success: bool = False, swift: int = 0): + def __init__( + self, + time_str: str = '', + begin_hour: int = 0, + end_hour: int = 0, + end_min: int = 0, + success: bool = False, + swift: int = 0, + ): self.time_str = time_str self.begin_hour = begin_hour self.end_hour = end_hour @@ -209,11 +227,6 @@ def suffix_regex(self) -> Pattern: def check_both_before_after(self) -> Pattern: raise NotImplementedError - @property - @abstractmethod - def time_zone_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - class BaseDateTimePeriodExtractor(DateTimeExtractor): @property @@ -255,13 +268,13 @@ def match_date_with_period_prefix(self, source, reference, date_ers): for date_er in date_ers: date_str_end = date_er.start + date_er.length - before_str = source[0:date_er.start].strip() + before_str = source[0 : date_er.start].strip() match = regex.search(self.config.prefix_day_regex, before_str) if match: result.append(Token(match.start(), date_str_end)) elif self.config.check_both_before_after: # check also after_str - after_str = source[date_str_end: len(source) - date_str_end] + after_str = source[date_str_end : len(source) - date_str_end] match_after = RegExpUtility.match_begin(self.config.prefix_day_regex, after_str, True) if match_after and match_after.success: result.append(Token(date_er.start, date_str_end + match_after.index + match_after.length)) @@ -293,15 +306,17 @@ def merge_date_with_time_period_suffix(self, text: str, date_ers: [ExtractResult if j >= len(extracted_results): break - if extracted_results[i].type == Constants.SYS_DATETIME_DATE and\ - extracted_results[j].type == Constants.SYS_DATETIME_TIME: + if ( + extracted_results[i].type == Constants.SYS_DATETIME_DATE + and extracted_results[j].type == Constants.SYS_DATETIME_TIME + ): middle_begin = extracted_results[i].start + (extracted_results[i].length or 0) middle_end = extracted_results[j].start or 0 if middle_begin > middle_end: i = j + 1 continue - middle_str = text[middle_begin: middle_end].strip() + middle_str = text[middle_begin:middle_end].strip() if self.is_valid_connector_for_date_and_time_period(middle_str): begin = ers[i].start or 0 @@ -322,7 +337,7 @@ def merge_date_with_time_period_suffix(self, text: str, date_ers: [ExtractResult i = j idx = 0 - for idx in range(idx, len(result)-1, 1): + for idx in range(idx, len(result) - 1, 1): after_str = text[result[idx].end] match = self.config.suffix_regex.search(after_str) if match: @@ -352,7 +367,7 @@ def match_time_of_day(self, source: str, reference: datetime, date_extract_resul return tokens for extracted_result in date_extract_results: - after_str = source[extracted_result.start + extracted_result.length:] + after_str = source[extracted_result.start + extracted_result.length :] match = regex.search(self.config.period_time_of_day_with_date_regex, after_str) @@ -360,51 +375,57 @@ def match_time_of_day(self, source: str, reference: datetime, date_extract_resul # For cases like "Friday afternoon between 1PM and 4PM" which "Friday afternoon" need to be # extracted first match_start = match.start() - if not after_str[0:match.start()] or after_str[0:match.start()].isspace(): + if not after_str[0 : match.start()] or after_str[0 : match.start()].isspace(): start = extracted_result.start - end = extracted_result.start + extracted_result.length + len( - RegExpUtility.get_group(match, Constants.TIME_OF_DAY_GROUP_NAME)) + \ - match.start(Constants.TIME_OF_DAY_GROUP_NAME) + end = ( + extracted_result.start + + extracted_result.length + + len(RegExpUtility.get_group(match, Constants.TIME_OF_DAY_GROUP_NAME)) + + match.start(Constants.TIME_OF_DAY_GROUP_NAME) + ) tokens.append(Token(start, end)) break - connector_str = after_str[0:match.start()] + connector_str = after_str[0 : match.start()] # Trim here is set to false as the Regex might catch white spaces before or after the text if RegExpUtility.is_exact_match(self.config.middle_pause_regex, connector_str, False): - suffix = after_str[match.end():].strip() + suffix = after_str[match.end() :].strip() ending_match = regex.search(self.config.general_ending_regex, suffix) if ending_match: - tokens.append(Token(extracted_result.start, extracted_result.start + - extracted_result.length + match.end())) + tokens.append( + Token( + extracted_result.start, extracted_result.start + extracted_result.length + match.end() + ) + ) if not match: match = regex.search(self.config.am_desc_regex, after_str) - if not match or after_str[0:match.start()]: + if not match or after_str[0 : match.start()]: match = regex.search(self.config.pm_desc_regex, after_str) if match: - if not after_str[0:match.start()]: + if not after_str[0 : match.start()]: tokens.append(Token(extracted_result.start, extracted_result.end + match.end())) - prefix_str = source[0: extracted_result.start] + prefix_str = source[0 : extracted_result.start] match = regex.search(self.config.period_time_of_day_with_date_regex, prefix_str) if match: - if not prefix_str[match.end():] or prefix_str[match.end():].isspace(): - mid_str = source[match.end(): extracted_result.start] + if not prefix_str[match.end() :] or prefix_str[match.end() :].isspace(): + mid_str = source[match.end() : extracted_result.start] if mid_str and mid_str.isspace(): tokens.append(Token(match.start(), extracted_result.start + extracted_result.length)) m_start = match.start() else: - connector_str = prefix_str[match.end():] + connector_str = prefix_str[match.end() :] # Trim here is set to false as the Regex might catch white spaces before or after the text if RegExpUtility.is_exact_match(self.config.middle_pause_regex, connector_str, False): - suffix = source[extracted_result.start + extracted_result.length:].strip(' ') + suffix = source[extracted_result.start + extracted_result.length :].strip(' ') ending_match = self.config.general_ending_regex.match(suffix) if ending_match: tokens.append(Token(match.start(), extracted_result.start + extracted_result.length)) @@ -415,24 +436,28 @@ def match_time_of_day(self, source: str, reference: datetime, date_extract_resul for token in result: # Try to extract a time period in before-string if token.start > 0: - before_str = source[0:token.start] + before_str = source[0 : token.start] if before_str: time_extract_results = self.config.time_period_extractor.extract(before_str) if len(time_extract_results) > 0: for time_period in time_extract_results: - mid_str = before_str[time_period.start + time_period.length:] + mid_str = before_str[time_period.start + time_period.length :] if (not mid_str or mid_str.isspace()) and not time_period.meta_data: - tokens.append(Token(time_period.start, time_period.start + time_period.length + - len(mid_str) + token.length)) + tokens.append( + Token( + time_period.start, + time_period.start + time_period.length + len(mid_str) + token.length, + ) + ) # Try to extract a time period in after-string if token.end <= len(source): - after_str = source[token.start + token.length:] + after_str = source[token.start + token.length :] if after_str: time_extract_results = self.config.time_period_extractor.extract(after_str) if len(time_extract_results) > 0: for time_period in time_extract_results: - mid_str = after_str[0:time_period.start] + mid_str = after_str[0 : time_period.start] if (not mid_str or mid_str.isspace()) and not time_period.meta_data: tokens.append(Token(token.start, token.end + len(mid_str) + time_period.length)) @@ -441,41 +466,44 @@ def match_time_of_day(self, source: str, reference: datetime, date_extract_resul def match_simple_cases(self, source: str, reference: datetime) -> List[Token]: tokens: List[Token] = list() source = source.strip().lower() - simple_cases_matches = list(filter(lambda t: t != [], map(lambda x: list( - regex.finditer(x, source)), self.config.simple_cases_regexes))) + simple_cases_matches = list( + filter(lambda t: t != [], map(lambda x: list(regex.finditer(x, source)), self.config.simple_cases_regexes)) + ) for matches in simple_cases_matches: for match in matches: # has a date before? has_before_date = False - before_str = source[0:match.start()].strip() + before_str = source[0 : match.start()].strip() if before_str: - er = next(reversed(self.config.single_date_extractor.extract( - before_str, reference)), None) + er = next(reversed(self.config.single_date_extractor.extract(before_str, reference)), None) if er: begin = er.start end = er.start + er.length middle_str = before_str[end:].strip() - if not middle_str or RegExpUtility.is_exact_match(self.config.preposition_regex, middle_str, True): + if not middle_str or RegExpUtility.is_exact_match( + self.config.preposition_regex, middle_str, True + ): tokens.append(Token(begin, match.end())) has_before_date = True - followed_str = source[match.end():] + followed_str = source[match.end() :] if followed_str and not has_before_date: - extracted_result = next(iter(self.config.single_date_extractor.extract( - followed_str, reference)), None) + extracted_result = next( + iter(self.config.single_date_extractor.extract(followed_str, reference)), None + ) if extracted_result: begin = extracted_result.start end = extracted_result.start + extracted_result.length middle_str = followed_str[0:begin].strip() if middle_str == '' or regex.search(self.config.preposition_regex, middle_str): - tokens.append( - Token(match.start(), match.end() + end)) + tokens.append(Token(match.start(), match.end() + end)) return tokens - def merge_two_time_points(self, source: str, reference: datetime, date_ers: [ExtractResult], - time_ers: [ExtractResult]) -> List[Token]: + def merge_two_time_points( + self, source: str, reference: datetime, date_ers: [ExtractResult], time_ers: [ExtractResult] + ) -> List[Token]: tokens = [] ers_datetime = self.config.single_date_time_extractor.extract(source, reference) time_points = [] @@ -500,8 +528,10 @@ def merge_two_time_points(self, source: str, reference: datetime, date_ers: [Ext # Merge "{TimePoint} to {TimePoint}", "between {TimePoint} and {TimePoint}" index = 0 while index < len(time_points) - 1: - if time_points[index].type == Constants.SYS_DATETIME_TIME and time_points[index + 1].type == \ - Constants.SYS_DATETIME_TIME: + if ( + time_points[index].type == Constants.SYS_DATETIME_TIME + and time_points[index + 1].type == Constants.SYS_DATETIME_TIME + ): index += 1 break @@ -519,12 +549,11 @@ def merge_two_time_points(self, source: str, reference: datetime, date_ers: [Ext before_str = source[0:period_begin].strip() match_from = self.config.get_from_token_index(before_str) - from_token_index = match_from if match_from.matched else self.config.get_between_token_index( - before_str) + from_token_index = match_from if match_from.matched else self.config.get_between_token_index(before_str) if from_token_index.matched: period_begin = from_token_index.index elif self.config.check_both_before_after: - after_str = source[period_end:len(source) - period_end] + after_str = source[period_end : len(source) - period_end] after_token_index = self.config.get_between_token_index(after_str) if after_token_index.matched: # Handle "between" in after_str @@ -572,14 +601,17 @@ def merge_two_time_points(self, source: str, reference: datetime, date_ers: [Ext mid_str = source[mid_begin:mid_end] if not mid_str.strip() or mid_str.strip().startswith(self.config.token_before_date): # Extend date extraction for cases like "Monday evening next week" - extended_str = points[index].text + source[int(points[index + 1].start + points[index + 1].length):] + extended_str = ( + points[index].text + source[int(points[index + 1].start + points[index + 1].length) :] + ) extended_date_str = self.config.single_date_extractor.extract(extended_str) offset = 0 if extended_date_str is not None and extended_date_str.index == 0: offset = int(len(extended_date_str) - points[index].length) - tokens.append(Token(points[index].start, - offset + points[index + 1].start + points[index + 1].length)) + tokens.append( + Token(points[index].start, offset + points[index + 1].start + points[index + 1].length) + ) index += 2 index += 1 @@ -590,8 +622,7 @@ def match_duration(self, source: str, reference: datetime) -> List[Token]: tokens: List[Token] = list() source = source.strip().lower() - ers_duration: List[ExtractResult] = self.config.duration_extractor.extract( - source, reference) + ers_duration: List[ExtractResult] = self.config.duration_extractor.extract(source, reference) durations: List[Token] = list() for extracted_result in ers_duration: @@ -599,8 +630,8 @@ def match_duration(self, source: str, reference: datetime) -> List[Token]: durations.append(Token(extracted_result.start, extracted_result.start + extracted_result.length)) for duration in durations: - before_str = source[0:duration.start].strip() - after_str = source[duration.start + duration.length:].strip() + before_str = source[0 : duration.start].strip() + after_str = source[duration.start + duration.length :].strip() if not before_str and not after_str: break @@ -629,8 +660,8 @@ def match_duration(self, source: str, reference: datetime) -> List[Token]: if match and match.success: index = match.index if index >= 0: - prefix = before_str[0: index].strip() - duration_text = source[duration.start: duration.length] + prefix = before_str[0:index].strip() + duration_text = source[duration.start : duration.length] numbers_in_prefix = self.config.cardinal_extractor.extract(prefix) numbers_in_duration = self.config.cardinal_extractor.extract(duration_text) @@ -680,12 +711,12 @@ def match_within_next_prefix(self, sub_str: str, source: str, duration: Token, i else: start_token = duration.start end_token = duration.end + (source.index(match.group()) + duration.length) - match = self.config.time_unit_regex.match(source[duration.start: duration.length]) + match = self.config.time_unit_regex.match(source[duration.start : duration.length]) success = match if not in_prefix: # Match prefix for "next" - before_str = source[0:duration.start] + before_str = source[0 : duration.start] match_next = self.config.next_prefix_regex.match(before_str) success = match or match_next if self.match_prefix_regex_in_segment(before_str, match_next, True): @@ -700,83 +731,76 @@ def match_night(self, source: str, reference: datetime) -> List[Token]: tokens: List[Token] = list() source = source.strip().lower() - matches = regex.finditer( - self.config.specific_time_of_day_regex, source) + matches = regex.finditer(self.config.specific_time_of_day_regex, source) tokens.extend(map(lambda x: Token(x.start(), x.end()), matches)) - ers_date: List[ExtractResult] = self.config.single_date_extractor.extract( - source, reference) + ers_date: List[ExtractResult] = self.config.single_date_extractor.extract(source, reference) for extracted_result in ers_date: - after_str = source[extracted_result.start + extracted_result.length:] - match = regex.search( - self.config.period_time_of_day_with_date_regex, after_str) + after_str = source[extracted_result.start + extracted_result.length :] + match = regex.search(self.config.period_time_of_day_with_date_regex, after_str) if match: - if not after_str[0:match.start()].strip(): + if not after_str[0 : match.start()].strip(): tokens.append( - Token(extracted_result.start, extracted_result.start + extracted_result.length + match.end())) + Token(extracted_result.start, extracted_result.start + extracted_result.length + match.end()) + ) else: - pause_match = regex.search( - self.config.middle_pause_regex, after_str[0:match.start()].strip()) + pause_match = regex.search(self.config.middle_pause_regex, after_str[0 : match.start()].strip()) if pause_match: - suffix = after_str[match.end():].strip() + suffix = after_str[match.end() :].strip() - ending_match = regex.search( - self.config.general_ending_regex, suffix) + ending_match = regex.search(self.config.general_ending_regex, suffix) if ending_match: tokens.append( - Token(extracted_result.start, extracted_result.start + - extracted_result.length + match.end())) + Token( + extracted_result.start, + extracted_result.start + extracted_result.length + match.end(), + ) + ) - before_str = source[0:extracted_result.start] - match = regex.search( - self.config.period_time_of_day_with_date_regex, before_str) + before_str = source[0 : extracted_result.start] + match = regex.search(self.config.period_time_of_day_with_date_regex, before_str) if match: - if not before_str[match.end():].strip(): - middle_str = source[match.end():extracted_result.start] + if not before_str[match.end() :].strip(): + middle_str = source[match.end() : extracted_result.start] if middle_str == ' ': - tokens.append( - Token(match.start(), extracted_result.start + extracted_result.length)) + tokens.append(Token(match.start(), extracted_result.start + extracted_result.length)) else: - pause_match = regex.search( - self.config.middle_pause_regex, before_str[match.end():]) + pause_match = regex.search(self.config.middle_pause_regex, before_str[match.end() :]) if pause_match: - suffix = source[extracted_result.start + extracted_result.length:].strip() + suffix = source[extracted_result.start + extracted_result.length :].strip() - ending_match = regex.search( - self.config.general_ending_regex, suffix) + ending_match = regex.search(self.config.general_ending_regex, suffix) if ending_match: - tokens.append( - Token(match.start(), extracted_result.start + extracted_result.length)) + tokens.append(Token(match.start(), extracted_result.start + extracted_result.length)) # check whether there are adjacent time period strings, before or after for token in tokens: # try to extract a time period in before-string if token.start > 0: - before_str = source[0:token.start].strip() + before_str = source[0 : token.start].strip() if before_str: - ers_time = self.config.time_period_extractor.extract( - before_str, reference) + ers_time = self.config.time_period_extractor.extract(before_str, reference) for er_time in ers_time: - middle_str = before_str[er_time.start + - er_time.length:].strip() + middle_str = before_str[er_time.start + er_time.length :].strip() if not middle_str: - tokens.append(Token(er_time.start, - er_time.start + er_time.length + len(middle_str) + token.length)) + tokens.append( + Token( + er_time.start, er_time.start + er_time.length + len(middle_str) + token.length + ) + ) if token.start + token.length <= len(source): - after_str = source[token.start + token.length:] + after_str = source[token.start + token.length :] if after_str: - ers_time = self.config.time_period_extractor.extract( - after_str, reference) + ers_time = self.config.time_period_extractor.extract(after_str, reference) for er_time in ers_time: - middle_str = after_str[0:er_time.start] + middle_str = after_str[0 : er_time.start] if not middle_str: - token_end = token.start + token.length + \ - len(middle_str) + er_time.length + token_end = token.start + token.length + len(middle_str) + er_time.length tokens.append(Token(token.start, token_end)) return tokens @@ -785,17 +809,15 @@ def match_night(self, source: str, reference: datetime) -> List[Token]: def match_prefix_regex_in_segment(string: str, match: Match, in_prefix: bool): substring = '' if match: - substring = string[match.start(): match.end()] if in_prefix else string[0: match.start()] - return match and substring.strip() is not '' + substring = string[match.start() : match.end()] if in_prefix else string[0 : match.start()] + return match and substring.strip() != '' def match_relative_unit(self, source: str) -> List[Token]: tokens: List[Token] = list() - matches = list(regex.finditer( - self.config.relative_time_unit_regex, source)) + matches = list(regex.finditer(self.config.relative_time_unit_regex, source)) if not matches: - matches = list(regex.finditer( - self.config.rest_of_date_time_regex, source)) + matches = list(regex.finditer(self.config.rest_of_date_time_regex, source)) tokens.extend(map(lambda x: Token(x.start(), x.end()), matches)) return tokens @@ -942,11 +964,6 @@ def time_period_extractor(self) -> DateTimeExtractor: def duration_extractor(self) -> DateTimeExtractor: raise NotImplementedError - @property - @abstractmethod - def time_zone_parser(self) -> DateTimeParser: - raise NotImplementedError - @property @abstractmethod def date_parser(self) -> DateTimeParser: @@ -998,16 +1015,13 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if source.type is self.parser_type_name: source_text = source.text.lower() - inner_result = self.merge_date_and_time_periods( - source_text, reference) + inner_result = self.merge_date_and_time_periods(source_text, reference) if not inner_result.success: - inner_result = self.merge_two_time_points( - source_text, reference) + inner_result = self.merge_two_time_points(source_text, reference) if not inner_result.success: - inner_result = self.parse_specific_time_of_day( - source_text, reference) + inner_result = self.parse_specific_time_of_day(source_text, reference) if not inner_result.success: inner_result = self.parse_duration(source_text, reference) @@ -1023,13 +1037,17 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if inner_result.success: inner_result.future_resolution[TimeTypeConstants.START_DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.future_value[0]) + inner_result.future_value[0] + ) inner_result.future_resolution[TimeTypeConstants.END_DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.future_value[1]) + inner_result.future_value[1] + ) inner_result.past_resolution[TimeTypeConstants.START_DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.past_value[0]) + inner_result.past_value[0] + ) inner_result.past_resolution[TimeTypeConstants.END_DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.past_value[1]) + inner_result.past_value[1] + ) result.value = inner_result result.timex_str = inner_result.timex if inner_result is not None else '' result.resolution_str = '' @@ -1041,8 +1059,12 @@ def is_before_or_after_mod(self, mod: str) -> bool: return mod and (mod == TimeTypeConstants.BEFORE_MOD or mod == TimeTypeConstants.AFTER_MOD) else: # matches with inclusive_mod_prepositions are also parsed here - return mod and (mod == TimeTypeConstants.BEFORE_MOD or mod == TimeTypeConstants.AFTER_MOD or - mod == TimeTypeConstants.UNTIL_MOD or mod == TimeTypeConstants.SINCE_MOD) + return mod and ( + mod == TimeTypeConstants.BEFORE_MOD + or mod == TimeTypeConstants.AFTER_MOD + or mod == TimeTypeConstants.UNTIL_MOD + or mod == TimeTypeConstants.SINCE_MOD + ) def merge_date_and_time_periods(self, source: str, reference: datetime) -> DateTimeResolutionResult: result = DateTimeResolutionResult() @@ -1062,7 +1084,9 @@ def merge_date_and_time_periods(self, source: str, reference: datetime) -> DateT # if it is a range type timex if TimexUtil.is_range_timex(time_period_timex): - date_result = self.config.date_extractor.extract(trimmed_source.replace(extracted_results[0].text, ''), reference) + date_result = self.config.date_extractor.extract( + trimmed_source.replace(extracted_results[0].text, ''), reference + ) # Check if token_before_date and token_before_time are null date_text = trimmed_source.replace(extracted_results[0].text, '').strip() @@ -1090,39 +1114,72 @@ def merge_date_and_time_periods(self, source: str, reference: datetime) -> DateT range_timex_components = TimexUtil.get_range_timex_components(time_period_timex) if range_timex_components.is_valid: - begin_timex = TimexUtil.combine_date_and_time_timex(date_timex, range_timex_components.begin_timex) + begin_timex = TimexUtil.combine_date_and_time_timex( + date_timex, range_timex_components.begin_timex + ) end_timex = TimexUtil.combine_date_and_time_timex(date_timex, range_timex_components.end_timex) - result.timex = TimexUtil.generate_date_time_period_timex(begin_timex, end_timex, range_timex_components.duration_timex) - - time_period_future_value = (time_period_resolution_result.future_value.start, time_period_resolution_result.future_value.end) + result.timex = TimexUtil.generate_date_time_period_timex( + begin_timex, end_timex, range_timex_components.duration_timex + ) + + time_period_future_value = ( + time_period_resolution_result.future_value.start, + time_period_resolution_result.future_value.end, + ) begin_time = time_period_future_value[0] end_time = time_period_future_value[1] result.future_value = [ - DateUtils.safe_create_from_min_value(future_time.year, future_time.month, future_time.day, - begin_time.hour, begin_time.minute, - begin_time.second), - DateUtils.safe_create_from_min_value(future_time.year, future_time.month, future_time.day, - end_time.hour, end_time.minute, - end_time.second) + DateUtils.safe_create_from_min_value( + future_time.year, + future_time.month, + future_time.day, + begin_time.hour, + begin_time.minute, + begin_time.second, + ), + DateUtils.safe_create_from_min_value( + future_time.year, + future_time.month, + future_time.day, + end_time.hour, + end_time.minute, + end_time.second, + ), ] result.past_value = [ - DateUtils.safe_create_from_min_value(past_time.year, past_time.month, past_time.day, - begin_time.hour, begin_time.minute, - begin_time.second), - DateUtils.safe_create_from_min_value(past_time.year, past_time.month, past_time.day, - end_time.hour, end_time.minute, - end_time.second) + DateUtils.safe_create_from_min_value( + past_time.year, + past_time.month, + past_time.day, + begin_time.hour, + begin_time.minute, + begin_time.second, + ), + DateUtils.safe_create_from_min_value( + past_time.year, + past_time.month, + past_time.day, + end_time.hour, + end_time.minute, + end_time.second, + ), ] - if time_period_resolution_result.comment and time_period_resolution_result.comment == Constants.COMMENT_AMPM: + if ( + time_period_resolution_result.comment + and time_period_resolution_result.comment == Constants.COMMENT_AMPM + ): # ampm comment is used for later set_parser_result to judge whether this parse result should # have two parsing results. # Cases like "from 10:30 to 11 on 1/1/2015" should have ampm comment, as it can be parsed # to "10:30am to 11am" and also be parsed to "10:30pm to 11pm". # Cases like "from 10:30 to 3 on 1/1/2015" should not have ampm comment. - if begin_time.hour < Constants.HALF_DAY_HOUR_COUNT and end_time.hour < Constants.HALF_DAY_HOUR_COUNT: + if ( + begin_time.hour < Constants.HALF_DAY_HOUR_COUNT + and end_time.hour < Constants.HALF_DAY_HOUR_COUNT + ): result.comment = Constants.COMMENT_AMPM result.success = True @@ -1139,8 +1196,7 @@ def parse_simple_cases(self, source: str, reference: datetime) -> DateTimeResolu match = regex.search(self.config.pure_number_from_to_regex, source) if not match: - match = regex.search( - self.config.pure_number_between_and_regex, source) + match = regex.search(self.config.pure_number_between_and_regex, source) if not match or match.start() != 0: return result @@ -1155,8 +1211,9 @@ def parse_simple_cases(self, source: str, reference: datetime) -> DateTimeResolu if not end_hour: end_hour = int(hour_group[1]) - extracted_result = next(iter(self.config.date_extractor.extract( - source.replace(match.group(), ''), reference)), None) + extracted_result = next( + iter(self.config.date_extractor.extract(source.replace(match.group(), ''), reference)), None + ) if not extracted_result: return result @@ -1199,24 +1256,27 @@ def parse_simple_cases(self, source: str, reference: datetime) -> DateTimeResolu result.timex = f'({begin_str},{end_str},PT{end_hour - begin_hour}H)' result.future_value = [ - DateUtils.safe_create_from_min_value(future_date.year, future_date.month, future_date.day, begin_hour, 0, - 0), DateUtils.safe_create_from_min_value( - future_date.year, future_date.month, future_date.day, end_hour, 0, 0) + future_date.year, future_date.month, future_date.day, begin_hour, 0, 0 + ), + DateUtils.safe_create_from_min_value(future_date.year, future_date.month, future_date.day, end_hour, 0, 0), ] result.past_value = [ - DateUtils.safe_create_from_min_value( - past_date.year, past_date.month, past_date.day, begin_hour, 0, 0), - DateUtils.safe_create_from_min_value( - past_date.year, past_date.month, past_date.day, end_hour, 0, 0) + DateUtils.safe_create_from_min_value(past_date.year, past_date.month, past_date.day, begin_hour, 0, 0), + DateUtils.safe_create_from_min_value(past_date.year, past_date.month, past_date.day, end_hour, 0, 0), ] result.success = True return result @staticmethod - def get_two_points(begin_er: ExtractResult, end_er: ExtractResult, begin_parser: DateTimeParser, - end_parser: DateTimeParser, reference: datetime) -> BeginEnd: + def get_two_points( + begin_er: ExtractResult, + end_er: ExtractResult, + begin_parser: DateTimeParser, + end_parser: DateTimeParser, + reference: datetime, + ) -> BeginEnd: return BeginEnd(begin=begin_parser.parse(begin_er, reference), end=end_parser.parse(end_er, reference)) def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeResolutionResult: @@ -1282,19 +1342,33 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes # Do nothing elif begin_has_date: - future_end = DateUtils.safe_create_from_min_value(future_begin.year, future_begin.month, future_begin.day, - future_end.hour, future_end.minute, future_end.second) - past_end = DateUtils.safe_create_from_min_value(past_begin.year, past_begin.month, past_begin.day, - past_end.hour, past_end.minute, past_end.second) + future_end = DateUtils.safe_create_from_min_value( + future_begin.year, + future_begin.month, + future_begin.day, + future_end.hour, + future_end.minute, + future_end.second, + ) + past_end = DateUtils.safe_create_from_min_value( + past_begin.year, past_begin.month, past_begin.day, past_end.hour, past_end.minute, past_end.second + ) date_str = parse_result1.timex_str.split('T')[0] duration_str = DateTimeFormatUtil.luis_time_span(future_begin, future_end) result.timex = f'({parse_result1.timex_str},{date_str + parse_result2.timex_str},{duration_str})' elif end_has_date: - future_begin = DateUtils.safe_create_from_min_value(future_end.year, future_end.month, future_end.day, - future_begin.hour, future_begin.minute, future_begin.second) - past_begin = DateUtils.safe_create_from_min_value(past_end.year, past_end.month, past_end.day, - past_begin.hour, past_begin.minute, past_begin.second) + future_begin = DateUtils.safe_create_from_min_value( + future_end.year, + future_end.month, + future_end.day, + future_begin.hour, + future_begin.minute, + future_begin.second, + ) + past_begin = DateUtils.safe_create_from_min_value( + past_end.year, past_end.month, past_end.day, past_begin.hour, past_begin.minute, past_begin.second + ) date_str = parse_result2.timex_str.split('T')[0] duration_str = DateTimeFormatUtil.luis_time_span(past_begin, past_end) @@ -1302,8 +1376,12 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes am_pm_str_1 = parse_result1.value.comment am_pm_str_2 = parse_result2.value.comment - if am_pm_str_1 and am_pm_str_1.endswith(Constants.COMMENT_AMPM) and \ - am_pm_str_2 and am_pm_str_2.endswith(Constants.COMMENT_AMPM): + if ( + am_pm_str_1 + and am_pm_str_1.endswith(Constants.COMMENT_AMPM) + and am_pm_str_2 + and am_pm_str_2.endswith(Constants.COMMENT_AMPM) + ): result.comment = Constants.COMMENT_AMPM result.future_value = (future_begin, future_end) @@ -1315,8 +1393,9 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes @staticmethod def get_datetime(date: datetime, time: datetime) -> datetime: - return DateUtils.safe_create_from_min_value(date.year, date.month, date.day, time.hour, time.minute, - time.second) + return DateUtils.safe_create_from_min_value( + date.year, date.month, date.day, time.hour, time.minute, time.second + ) # Parse specific time of day like 'this nigth', 'early morning', 'last evening' def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTimeResolutionResult: @@ -1372,10 +1451,10 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.timex = DateTimeFormatUtil.format_date(date) + values.time_str - result.future_value = result.past_value = (DateUtils.safe_create_from_min_value(year, month, day, - values.begin_hour, 0, 0), - DateUtils.safe_create_from_min_value(year, month, day, - values.end_hour, values.end_min, values.end_min)) + result.future_value = result.past_value = ( + DateUtils.safe_create_from_min_value(year, month, day, values.begin_hour, 0, 0), + DateUtils.safe_create_from_min_value(year, month, day, values.end_hour, values.end_min, values.end_min), + ) result.success = True return result @@ -1384,15 +1463,15 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi match = self.config.period_time_of_day_with_date_regex.search(trimmed_source) if not match: - match = self.config.am_desc_regex.sarch(trimmed_source) + match = self.config.am_desc_regex.search(trimmed_source) if not match: match = self.config.pm_desc_regex.search(trimmed_source) else: - before_str = trimmed_source[0:match.start()].strip() + before_str = trimmed_source[0 : match.start()].strip() _before_str = before_str trimmed_before_str = '' - after_str = trimmed_source[match.end():].strip() + after_str = trimmed_source[match.end() :].strip() _after_str = after_str trimmed_after_str = '' @@ -1415,20 +1494,26 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi _before_str = trimmed_after_str trimmed_after_str = trimmed_after_str.strip() - extracted_results = self.config.date_extractor.extract((trimmed_before_str if trimmed_before_str is not '' else before_str) + ' ' + (trimmed_after_str if trimmed_after_str is not '' else after_str), reference) + extracted_results = self.config.date_extractor.extract( + (trimmed_before_str if trimmed_before_str != '' else before_str) + + ' ' + + (trimmed_after_str if trimmed_after_str != '' else after_str), + reference, + ) if len(extracted_results) == 0 or extracted_results[0].length < len(trimmed_before_str): valid = False if len(extracted_results) > 0 and extracted_results[0].start == 0: - mid_str = before_str[extracted_results[0].start + extracted_results[0].length:] + mid_str = before_str[extracted_results[0].start + extracted_results[0].length :] if mid_str.replace(',', ' '): valid = True if not valid: extracted_results = self.config.date_extractor.extract(after_str, reference) if len(extracted_results) == 0 or extracted_results[0].length != len(after_str): - if len(extracted_results) > 0 and extracted_results[0].start + extracted_results[0].length ==\ - len(after_str): - mid_str = after_str[0:extracted_results[0].start] + if len(extracted_results) > 0 and extracted_results[0].start + extracted_results[ + 0 + ].length == len(after_str): + mid_str = after_str[0 : extracted_results[0].start] if not mid_str.replace(',', ' '): valid = True else: @@ -1440,7 +1525,10 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi if len(time_period_extract_results) > 0: time_parse_result = self.config.time_period_parser.parse(time_period_extract_results[0], reference) if time_parse_result: - period_future = (time_parse_result.value.future_value.start, time_parse_result.value.future_value.end) + period_future = ( + time_parse_result.value.future_value.start, + time_parse_result.value.future_value.end, + ) period_past = (time_parse_result.value.past_value.start, time_parse_result.value.past_value.end) if period_future == period_past: @@ -1464,17 +1552,35 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.timex = parse_result.timex_str + values.time_str else: format_str = '({}T{},{}T{},PT{}H)' - result.timex = format_str.format(parse_result.timex_str, values.begin_hour, parse_result.timex_str, values.end_hour, - values.end_hour - values.begin_hour) - - result.future_value = (DateUtils.safe_create_from_min_value(future_date.year, future_date.month, - future_date.day, values.begin_hour, 0, 0), - DateUtils.safe_create_from_min_value(future_date.year, future_date.month, - future_date.day, values.end_hour, values.end_min, values.end_min)) - result.past_value = (DateUtils.safe_create_from_min_value(past_date.year, past_date.month, - past_date.day, values.begin_hour, 0, 0), - DateUtils.safe_create_from_min_value(past_date.year, past_date.month, - past_date.day, values.end_hour, values.end_min, values.end_min)) + result.timex = format_str.format( + parse_result.timex_str, + values.begin_hour, + parse_result.timex_str, + values.end_hour, + values.end_hour - values.begin_hour, + ) + + result.future_value = ( + DateUtils.safe_create_from_min_value( + future_date.year, future_date.month, future_date.day, values.begin_hour, 0, 0 + ), + DateUtils.safe_create_from_min_value( + future_date.year, + future_date.month, + future_date.day, + values.end_hour, + values.end_min, + values.end_min, + ), + ) + result.past_value = ( + DateUtils.safe_create_from_min_value( + past_date.year, past_date.month, past_date.day, values.begin_hour, 0, 0 + ), + DateUtils.safe_create_from_min_value( + past_date.year, past_date.month, past_date.day, values.end_hour, values.end_min, values.end_min + ), + ) result.success = True return result @@ -1492,8 +1598,8 @@ def parse_duration(self, source: str, reference: datetime) -> DateTimeResolution if len(extracted_result) == 1: parse_result = self.config.duration_parser.parse(extracted_result[0]) - before_str = source[0:parse_result.start].strip() - after_str = source[parse_result.start + parse_result.length:].strip() + before_str = source[0 : parse_result.start].strip() + after_str = source[parse_result.start + parse_result.length :].strip() numbers_in_suffix = self.config.cardinal_extractor.extract(before_str) numbers_in_duration = self.config.cardinal_extractor.extract(extracted_result[0].text) @@ -1530,7 +1636,9 @@ def parse_duration(self, source: str, reference: datetime) -> DateTimeResolution # Set the begin_time equal to reference time for now if RegExpUtility.is_exact_match(self.config.within_next_prefix_regex, before_str, True): end_time = begin_time + timedelta(seconds=swift_seconds) - if self.config.check_both_before_after and RegExpUtility.is_exact_match(self.config.within_next_prefix_regex, after_str, True): + if self.config.check_both_before_after and RegExpUtility.is_exact_match( + self.config.within_next_prefix_regex, after_str, True + ): end_time = begin_time + timedelta(seconds=swift_seconds) if RegExpUtility.is_exact_match(self.config.future_regex, before_str, True): mod = TimeTypeConstants.AFTER_MOD @@ -1545,11 +1653,12 @@ def parse_duration(self, source: str, reference: datetime) -> DateTimeResolution mod = TimeTypeConstants.AFTER_MOD end_time = begin_time + timedelta(seconds=swift_seconds) - result.timex = f'({DateTimeFormatUtil.luis_date_from_datetime(begin_time)}T' \ - f'{DateTimeFormatUtil.luis_time_from_datetime(begin_time)},' + \ - f'{DateTimeFormatUtil.luis_date_from_datetime(end_time)}T' \ - f'{DateTimeFormatUtil.luis_time_from_datetime(end_time)},' + \ - f'{duration_result.timex})' + result.timex = ( + f'({DateTimeFormatUtil.luis_date_from_datetime(begin_time)}T' + f'{DateTimeFormatUtil.luis_time_from_datetime(begin_time)},' + + f'{DateTimeFormatUtil.luis_date_from_datetime(end_time)}T' + f'{DateTimeFormatUtil.luis_time_from_datetime(end_time)},' + f'{duration_result.timex})' + ) result.future_value = result.past_value = (begin_time, end_time) result.success = True @@ -1570,16 +1679,17 @@ def get_valid_connector_mod_for_date_and_time_period(self, source: str, in_prefi # Item2 is the mod corresponding to an inclusive match (i.e. containing an inclusive_mod_prepositions, # e.g. "at or before3") # Item3 is the mod corresponding to a non-inclusive match (e.g "before 3") - before_after_regex_tuple = [(self.config.before_regex, TimeTypeConstants.UNTIL_MOD, - TimeTypeConstants.BEFORE_MOD), - (self.config.after_regex, TimeTypeConstants.SINCE_MOD, - TimeTypeConstants.AFTER_MOD)] + before_after_regex_tuple = [ + (self.config.before_regex, TimeTypeConstants.UNTIL_MOD, TimeTypeConstants.BEFORE_MOD), + (self.config.after_regex, TimeTypeConstants.SINCE_MOD, TimeTypeConstants.AFTER_MOD), + ] for regexp in before_after_regex_tuple: match = regexp[0].match(source) if in_prefix else RegExpUtility.match_begin(regexp[0], source, True) if match and match.success: - mod = regexp[2] if in_prefix else (regexp[1] if RegExpUtility.get_group(match, 'include') else - regexp[2]) + mod = ( + regexp[2] if in_prefix else (regexp[1] if RegExpUtility.get_group(match, 'include') else regexp[2]) + ) return mod return mod @@ -1609,32 +1719,28 @@ def parse_relative_unit(self, source: str, reference: datetime) -> DateTimeResol end_time: datetime = reference if unit_str == 'D': - end_time = DateUtils.safe_create_from_min_value(begin_time.year, begin_time.month, - begin_time.day) + timedelta(days=1, seconds=-1) + end_time = DateUtils.safe_create_from_min_value( + begin_time.year, begin_time.month, begin_time.day + ) + timedelta(days=1, seconds=-1) difference = int((end_time - begin_time).total_seconds()) pt_timex = f'PT{difference}S' elif unit_str == 'H': - begin_time = begin_time + \ - timedelta(hours=0 if swift > 0 else swift) + begin_time = begin_time + timedelta(hours=0 if swift > 0 else swift) end_time = end_time + timedelta(hours=swift if swift > 0 else 0) pt_timex = 'PT1H' elif unit_str == 'M': - begin_time = begin_time + \ - timedelta(minutes=0 if swift > 0 else swift) + begin_time = begin_time + timedelta(minutes=0 if swift > 0 else swift) end_time = end_time + timedelta(minutes=swift if swift > 0 else 0) pt_timex = 'PT1M' elif unit_str == 'S': - begin_time = begin_time + \ - timedelta(seconds=0 if swift > 0 else swift) + begin_time = begin_time + timedelta(seconds=0 if swift > 0 else swift) end_time = end_time + timedelta(seconds=swift if swift > 0 else 0) pt_timex = 'PT1S' else: return result - luis_date_begin = DateTimeFormatUtil.luis_date_from_datetime( - begin_time) - luis_time_begin = DateTimeFormatUtil.luis_time_from_datetime( - begin_time) + luis_date_begin = DateTimeFormatUtil.luis_date_from_datetime(begin_time) + luis_time_begin = DateTimeFormatUtil.luis_time_from_datetime(begin_time) luis_date_end = DateTimeFormatUtil.luis_date_from_datetime(end_time) luis_time_end = DateTimeFormatUtil.luis_time_from_datetime(end_time) @@ -1650,12 +1756,17 @@ def parse_date_with_period_prefix(self, source: str, reference: datetime) -> Dat date_result = self.config.date_extractor.extract(source) if len(date_result) > 0: - before_str = source[0: date_result[-1].start] + before_str = source[0 : date_result[-1].start] match = self.config.prefix_day_regex.match(before_str) # Check also after_str if not match and self.config.check_both_before_after: - after_str = source[date_result[-1].start + date_result[-1].length: len(source) - date_result[-1].start + date_result[-1].length] + after_str = source[ + date_result[-1].start + + date_result[-1].length : len(source) + - date_result[-1].start + + date_result[-1].length + ] match = self.config.prefix_day_regex.match(after_str) if match: @@ -1669,8 +1780,12 @@ def parse_date_with_period_prefix(self, source: str, reference: datetime) -> Dat end_time = start_time + timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) result.mod = TimeTypeConstants.EARLY_MOD elif RegExpUtility.get_group(match, Constants.MID_PREFIX): - start_time = start_time + timedelta(hours=Constants.HALF_DAY_HOUR_COUNT - Constants.HALF_MID_DAY_DURATION_HOUR_COUNT) - end_time = end_time + timedelta(hours=Constants.HALF_DAY_HOUR_COUNT + Constants.HALF_MID_DAY_DURATION_HOUR_COUNT) + start_time = start_time + timedelta( + hours=Constants.HALF_DAY_HOUR_COUNT - Constants.HALF_MID_DAY_DURATION_HOUR_COUNT + ) + end_time = end_time + timedelta( + hours=Constants.HALF_DAY_HOUR_COUNT + Constants.HALF_MID_DAY_DURATION_HOUR_COUNT + ) result.mod = TimeTypeConstants.MID_MOD elif RegExpUtility.get_group(match, Constants.LATE_PREFIX): start_time = start_time + timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) @@ -1696,15 +1811,18 @@ def parse_date_with_time_period_suffix(self, source: str, reference: datetime) - time_str_end = int(time_extract_result.start + time_extract_result.length) if date_str_end < time_extract_result.start: - mid_str = source[date_str_end:time_extract_result.start - date_str_end].strip() + mid_str = source[date_str_end : time_extract_result.start - date_str_end].strip() after_str = source[time_str_end:] mod_str = self.get_valid_connector_mod_for_date_and_time_period(mid_str, True) # Check also after_str if mod_str and self.config.check_both_before_after: - mod_str = self.get_valid_connector_mod_for_date_and_time_period(after_str, False) if\ - len(mid_str) <= 4 else None + mod_str = ( + self.get_valid_connector_mod_for_date_and_time_period(after_str, False) + if len(mid_str) <= 4 + else None + ) if mod_str: date_parse_result = self.config.date_parser.parse(date_extract_result, reference) @@ -1721,18 +1839,22 @@ def parse_date_with_time_period_suffix(self, source: str, reference: datetime) - result.comment = time_resolution_result.comment result.timex = f'{date_parse_result.timex_str}{time_parse_result.timex_str}' - result.future_value = DateUtils.safe_create_from_min_value(future_date_value.year, - future_date_value.month, - future_date_value.day, - future_time_value.hour, - future_time_value.minute, - future_time_value.second) - result.past_value = DateUtils.safe_create_from_min_value(past_date_value.year, - past_date_value.month, - past_date_value.day, - past_time_value.hour, - past_time_value.minute, - past_time_value.second) + result.future_value = DateUtils.safe_create_from_min_value( + future_date_value.year, + future_date_value.month, + future_date_value.day, + future_time_value.hour, + future_time_value.minute, + future_time_value.second, + ) + result.past_value = DateUtils.safe_create_from_min_value( + past_date_value.year, + past_date_value.month, + past_date_value.day, + past_time_value.hour, + past_time_value.minute, + past_time_value.second, + ) result.mod = mod_str result.sub_date_time_entities = [date_parse_result, time_parse_result] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_duration.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_duration.py index 90563c9541..467d880c85 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_duration.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_duration.py @@ -2,19 +2,28 @@ # Licensed under the MIT License. from abc import ABC, abstractmethod -from typing import List, Optional, Pattern, Dict, Match from datetime import datetime +from typing import Dict, List, Match, Optional, Pattern + import regex -from recognizers_text.utilities import QueryProcessor -from recognizers_text.extractor import ExtractResult from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.extractor import ExtractResult +from recognizers_text.utilities import QueryProcessor + from .constants import Constants, TimeTypeConstants from .extractors import DateTimeExtractor from .parsers import DateTimeParser, DateTimeParseResult -from .utilities import Token, merge_all_tokens, DateTimeResolutionResult, RegExpUtility,\ - DateTimeOptionsConfiguration, DateTimeOptions, DurationParsingUtil, RegExpUtility +from .utilities import ( + DateTimeOptions, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DurationParsingUtil, + RegExpUtility, + Token, + merge_all_tokens, +) class DurationExtractorConfiguration(DateTimeOptionsConfiguration): @@ -135,8 +144,8 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult # Handle cases look like: {more than | less than} {duration}? def tag_inequality_prefix(self, text: str, extract_results: [ExtractResult]): for extract_result in extract_results: - before_string = text[0: extract_result.start] - after_string = text[extract_result.start: extract_result.length] + before_string = text[0 : extract_result.start] + after_string = text[extract_result.start : extract_result.length] is_inequality_prefix_matched = False is_match_after = False @@ -160,10 +169,10 @@ def tag_inequality_prefix(self, text: str, extract_results: [ExtractResult]): if not is_match_after: extract_result.length += extract_result.start - text.index(match.group()) extract_result.start = text.index(match.group()) - extract_result.text = text[extract_result.start: extract_result.start + extract_result.length] + extract_result.text = text[extract_result.start : extract_result.start + extract_result.length] else: extract_result.length += match.index + match.length - extract_result.text = text[extract_result.start: extract_result.length] + extract_result.text = text[extract_result.start : extract_result.length] return extract_results def merge_multiple_duration(self, text: str, extractor_results: [ExtractResult]): @@ -199,13 +208,19 @@ def merge_multiple_duration(self, text: str, extractor_results: [ExtractResult]) while second_extraction_index < len(extractor_results): valid = False - mid_str_begin = extractor_results[second_extraction_index - 1].start +\ - extractor_results[second_extraction_index - 1].length if \ - extractor_results[second_extraction_index - 1].length else 0 - - mid_str_end = extractor_results[second_extraction_index].start \ - if extractor_results[second_extraction_index].start else 0 - mid_str = text[mid_str_begin: mid_str_end] + mid_str_begin = ( + extractor_results[second_extraction_index - 1].start + + extractor_results[second_extraction_index - 1].length + if extractor_results[second_extraction_index - 1].length + else 0 + ) + + mid_str_end = ( + extractor_results[second_extraction_index].start + if extractor_results[second_extraction_index].start + else 0 + ) + mid_str = text[mid_str_begin:mid_str_end] match = self.config.duration_connector_regex.search(mid_str) if match: @@ -231,10 +246,12 @@ def merge_multiple_duration(self, text: str, extractor_results: [ExtractResult]) node: ExtractResult = ExtractResult() node.start = extractor_results[first_extraction_index].start - node.length = extractor_results[second_extraction_index - 1].start +\ - extractor_results[second_extraction_index - 1].length -\ - node.start - node.text = text[node.start or 0: node.length + node.start or 0] + node.length = ( + extractor_results[second_extraction_index - 1].start + + extractor_results[second_extraction_index - 1].length + - node.start + ) + node.text = text[node.start or 0 : node.length + node.start or 0] node.type = extractor_results[first_extraction_index].type if time_unit == total_unit: @@ -259,56 +276,45 @@ def merge_multiple_duration(self, text: str, extractor_results: [ExtractResult]) # simple cases of a number followed by unit def number_with_unit(self, source: str) -> List[Token]: - extract_results: List[ExtractResult] = self.config.cardinal_extractor.extract( - source) - result: List[Token] = list( - filter(None, map(lambda x: self.__cardinal_to_token(x, source), extract_results))) + extract_results: List[ExtractResult] = self.config.cardinal_extractor.extract(source) + result: List[Token] = list(filter(None, map(lambda x: self.__cardinal_to_token(x, source), extract_results))) # handle "3hrs" - result.extend(self.get_tokens_from_regex( - self.config.number_combined_with_unit, source)) + result.extend(self.get_tokens_from_regex(self.config.number_combined_with_unit, source)) # handle "an hour" - result.extend(self.get_tokens_from_regex( - self.config.an_unit_regex, source)) + result.extend(self.get_tokens_from_regex(self.config.an_unit_regex, source)) # handle "few" related cases - result.extend(self.get_tokens_from_regex( - self.config.inexact_number_unit_regex, source)) + result.extend(self.get_tokens_from_regex(self.config.inexact_number_unit_regex, source)) return result # handle cases look like: {number} {unit}? and {an|a} {half|quarter} {unit}? # define the part "and {an|a} {half|quarter}" as Suffix def number_with_unit_and_suffix(self, source: str, tokens: List[Token]) -> List[Token]: - result: List[Token] = list( - filter(None, map(lambda x: self.__base_to_token(x, source), tokens))) + result: List[Token] = list(filter(None, map(lambda x: self.__base_to_token(x, source), tokens))) return result # handle cases that don't contain number def implicit_duration(self, source: str) -> List[Token]: # handle "all day", "all year" - result: List[Token] = self.get_tokens_from_regex( - self.config.all_regex, source) + result: List[Token] = self.get_tokens_from_regex(self.config.all_regex, source) # handle "half day", "half year" - result.extend(self.get_tokens_from_regex( - self.config.half_regex, source)) + result.extend(self.get_tokens_from_regex(self.config.half_regex, source)) # handle "next day", "last year" - result.extend(self.get_tokens_from_regex( - self.config.relative_duration_unit_regex, source)) + result.extend(self.get_tokens_from_regex(self.config.relative_duration_unit_regex, source)) # handle "during/for the day/week/month/year" if (self.config.options & DateTimeOptions.CALENDAR) != 0: - result.extend(self.get_tokens_from_regex( - self.config.during_regex, source) - ) + result.extend(self.get_tokens_from_regex(self.config.during_regex, source)) return result def __cardinal_to_token(self, cardinal: ExtractResult, source: str) -> Optional[Token]: - after = source[cardinal.start + cardinal.length:] + after = source[cardinal.start + cardinal.length :] match = regex.match(self.config.followed_unit, after) if match is not None: @@ -317,7 +323,7 @@ def __cardinal_to_token(self, cardinal: ExtractResult, source: str) -> Optional[ return None def __base_to_token(self, token: Token, source: str) -> Optional[Token]: - after = source[token.start + token.length:] + after = source[token.start + token.length :] match = regex.match(self.config.suffix_and_regex, after) if match is not None: @@ -411,14 +417,11 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self.parse_number_with_unit(source_text, reference) if not inner_result.success: - inner_result = self.parse_implicit_duration( - source_text, reference) + inner_result = self.parse_implicit_duration(source_text, reference) if inner_result.success: - inner_result.future_resolution[TimeTypeConstants.DURATION] = str( - inner_result.future_value) - inner_result.past_resolution[TimeTypeConstants.DURATION] = str( - inner_result.past_value) + inner_result.future_resolution[TimeTypeConstants.DURATION] = str(inner_result.future_value) + inner_result.past_resolution[TimeTypeConstants.DURATION] = str(inner_result.past_value) value = inner_result @@ -462,16 +465,13 @@ def parse_number_with_unit(self, source: str, reference: datetime) -> DateTimeRe def parse_implicit_duration(self, source: str, reference: datetime) -> DateTimeResolutionResult: source = source.strip() - result = self.get_result_from_regex( - self.config.all_date_unit_regex, source, 1) + result = self.get_result_from_regex(self.config.all_date_unit_regex, source, 1) if not result.success: - result = self.get_result_from_regex( - self.config.half_date_unit_regex, source, 0.5) + result = self.get_result_from_regex(self.config.half_date_unit_regex, source, 0.5) if not result.success: - result = self.get_result_from_regex( - self.config.followed_unit, source, 1) + result = self.get_result_from_regex(self.config.followed_unit, source, 1) return result @@ -490,8 +490,7 @@ def get_result_from_regex(self, pattern: Pattern, source: str, num: float) -> Da unit = self.config.unit_map[source_unit] is_time = Constants.UNIT_T if self.is_less_than_day(unit) else '' result.timex = f'P{is_time}{num}{unit[0]}' - result.future_value = QueryProcessor.float_or_int( - num * self.config.unit_value_map[source_unit]) + result.future_value = QueryProcessor.float_or_int(num * self.config.unit_value_map[source_unit]) result.past_value = result.future_value result.success = True return result @@ -508,7 +507,7 @@ def parse_number_space_unit(self, source: str) -> DateTimeResolutionResult: source_unit = '' er = ers[0] pr = self.config.number_parser.parse(er) - no_num = source[pr.start + pr.length:].strip().lower() + no_num = source[pr.start + pr.length :].strip().lower() match = regex.search(self.config.followed_unit, no_num) if match is not None: @@ -524,8 +523,7 @@ def parse_number_space_unit(self, source: str) -> DateTimeResolutionResult: num = QueryProcessor.float_or_int(num) is_time = 'T' if self.is_less_than_day(unit) else '' result.timex = f'P{is_time}{num}{unit[0]}' - result.future_value = QueryProcessor.float_or_int( - num * self.config.unit_value_map[source_unit]) + result.future_value = QueryProcessor.float_or_int(num * self.config.unit_value_map[source_unit]) result.past_value = result.future_value result.success = True return result @@ -560,8 +558,7 @@ def parse_number_combined_unit(self, source: str) -> DateTimeResolutionResult: num = QueryProcessor.float_or_int(num) is_time = Constants.UNIT_T if self.is_less_than_day(unit) else '' result.timex = f'P{is_time}{num}{unit[0]}' - result.future_value = QueryProcessor.float_or_int( - num * self.config.unit_value_map[source_unit]) + result.future_value = QueryProcessor.float_or_int(num * self.config.unit_value_map[source_unit]) result.past_value = result.future_value result.success = True return result @@ -586,8 +583,7 @@ def parse_an_unit(self, source: str) -> DateTimeResolutionResult: unit = self.config.unit_map[source_unit] is_time = Constants.UNIT_T if self.is_less_than_day(unit) else '' result.timex = f'P{is_time}{num}{unit[0]}' - result.future_value = QueryProcessor.float_or_int( - num * self.config.unit_value_map[source_unit]) + result.future_value = QueryProcessor.float_or_int(num * self.config.unit_value_map[source_unit]) result.past_value = result.future_value result.success = True return result @@ -612,8 +608,7 @@ def parse_in_exact_number_unit(self, source: str) -> DateTimeResolutionResult: num = QueryProcessor.float_or_int(num) is_time = Constants.UNIT_T if self.is_less_than_day(unit) else '' result.timex = f'P{is_time}{num}{unit[0]}' - result.future_value = QueryProcessor.float_or_int( - num * self.config.unit_value_map[source_unit]) + result.future_value = QueryProcessor.float_or_int(num * self.config.unit_value_map[source_unit]) result.past_value = result.future_value result.success = True return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_holiday.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_holiday.py index 9381fa709b..97bd806023 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_holiday.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_holiday.py @@ -2,16 +2,17 @@ # Licensed under the MIT License. from abc import ABC, abstractmethod -from typing import List, Optional, Pattern, Callable, Dict, Match -from datetime import datetime from calendar import Calendar +from datetime import datetime +from typing import Callable, Dict, List, Match, Optional, Pattern from recognizers_text.extractor import ExtractResult, Metadata + from ..resources.base_date_time import BaseDateTime from .constants import Constants, TimeTypeConstants from .extractors import DateTimeExtractor from .parsers import DateTimeParser, DateTimeParseResult -from .utilities import Token, merge_all_tokens, DateTimeFormatUtil, DayOfWeek, DateTimeResolutionResult, DateUtils +from .utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils, DayOfWeek, Token, merge_all_tokens class HolidayExtractorConfiguration(ABC): @@ -103,12 +104,10 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self._parse_holiday_regex_match(source.text, reference) if inner_result.success: inner_result.future_resolution = { - TimeTypeConstants.DATE: DateTimeFormatUtil.format_date( - inner_result.future_value) + TimeTypeConstants.DATE: DateTimeFormatUtil.format_date(inner_result.future_value) } inner_result.past_resolution = { - TimeTypeConstants.DATE: DateTimeFormatUtil.format_date( - inner_result.past_value) + TimeTypeConstants.DATE: DateTimeFormatUtil.format_date(inner_result.past_value) } value = inner_result @@ -134,8 +133,7 @@ def _parse_holiday_regex_match(self, text: str, reference: datetime) -> DateTime def _match2date(self, match: Match, reference: datetime) -> DateTimeResolutionResult: result = DateTimeResolutionResult() - holiday_str = self.config.sanitize_holiday_token( - match.group(Constants.HOLIDAY_GROUP_NAME).lower()) + holiday_str = self.config.sanitize_holiday_token(match.group(Constants.HOLIDAY_GROUP_NAME).lower()) # get year (if exist) year_str = match.group(Constants.YEAR_GROUP_NAME) @@ -154,19 +152,20 @@ def _match2date(self, match: Match, reference: datetime) -> DateTimeResolutionRe else: year = reference.year - holiday_key = next(iter([key for key, values in self.config.holiday_names.items( - ) if holiday_str in values]), None) + holiday_key = next( + iter([key for key, values in self.config.holiday_names.items() if holiday_str in values]), None + ) if holiday_key: func = self.config.holiday_func_dictionary.get(holiday_key) if func: value = func(year) - timex_str = self.config.variable_holidays_timex_dictionary.get( - holiday_key) + timex_str = self.config.variable_holidays_timex_dictionary.get(holiday_key) if not timex_str: - timex_str = f'-{DateTimeFormatUtil.to_str(value.month, 2)}-' \ - f'{DateTimeFormatUtil.to_str(value.day, 2)}' + timex_str = ( + f'-{DateTimeFormatUtil.to_str(value.month, 2)}-' f'{DateTimeFormatUtil.to_str(value.day, 2)}' + ) else: return result @@ -185,10 +184,8 @@ def _match2date(self, match: Match, reference: datetime) -> DateTimeResolutionRe return result result.timex = 'XXXX' + timex_str - result.future_value = self.__get_future_value( - value, reference, holiday_key) - result.past_value = self.__get_past_value( - value, reference, holiday_key) + result.future_value = self.__get_future_value(value, reference, holiday_key) + result.past_value = self.__get_past_value(value, reference, holiday_key) result.success = True return result @@ -198,14 +195,14 @@ def __get_future_value(self, value: datetime, reference: datetime, holiday: str) if value < reference: func = self.config.holiday_func_dictionary.get(holiday) if func: - return func(value.year+1) + return func(value.year + 1) return value def __get_past_value(self, value: datetime, reference: datetime, holiday: str) -> datetime: if value >= reference: func = self.config.holiday_func_dictionary.get(holiday) if func: - return func(value.year-1) + return func(value.year - 1) return value @@ -241,24 +238,26 @@ def __init__(self): self._holiday_func_dictionary = self._init_holiday_funcs() def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: - return dict([ - (Constants.FATHERS, BaseHolidayParserConfiguration.fathers_day), - (Constants.MOTHERS, BaseHolidayParserConfiguration.mothers_day), - (Constants.THANKS_GIVING_DAY, BaseHolidayParserConfiguration.thanksgiving_day), - (Constants.THANKS_GIVING, BaseHolidayParserConfiguration.thanksgiving_day), - (Constants.BLACK_FRIDAY, BaseHolidayParserConfiguration.black_friday), - (Constants.MARTIN_LUTHER_KING, BaseHolidayParserConfiguration.martin_luther_king_day), - (Constants.WASHINGTON_BIRTHDAY, BaseHolidayParserConfiguration.washingtons_birthday), - (Constants.LABOUR, BaseHolidayParserConfiguration.labour_day), - (Constants.CANBERRA, BaseHolidayParserConfiguration.canberra_day), - (Constants.COLUMBUS, BaseHolidayParserConfiguration.columbus_day), - (Constants.MEMORIAL, BaseHolidayParserConfiguration.memorial_day) - ]) + return dict( + [ + (Constants.FATHERS, BaseHolidayParserConfiguration.fathers_day), + (Constants.MOTHERS, BaseHolidayParserConfiguration.mothers_day), + (Constants.THANKS_GIVING_DAY, BaseHolidayParserConfiguration.thanksgiving_day), + (Constants.THANKS_GIVING, BaseHolidayParserConfiguration.thanksgiving_day), + (Constants.BLACK_FRIDAY, BaseHolidayParserConfiguration.black_friday), + (Constants.MARTIN_LUTHER_KING, BaseHolidayParserConfiguration.martin_luther_king_day), + (Constants.WASHINGTON_BIRTHDAY, BaseHolidayParserConfiguration.washingtons_birthday), + (Constants.LABOUR, BaseHolidayParserConfiguration.labour_day), + (Constants.CANBERRA, BaseHolidayParserConfiguration.canberra_day), + (Constants.COLUMBUS, BaseHolidayParserConfiguration.columbus_day), + (Constants.MEMORIAL, BaseHolidayParserConfiguration.memorial_day), + ] + ) @staticmethod def get_day(year: int, month: int, week: int, day_of_week: DayOfWeek) -> int: calendar = Calendar() - return [d for d in calendar.itermonthdays2(year, month) if d[0] and d[1] == day_of_week-1][week][0] + return [d for d in calendar.itermonthdays2(year, month) if d[0] and d[1] == day_of_week - 1][week][0] @staticmethod def get_last_day(year: int, month: int, day_of_week: DayOfWeek) -> int: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_merged.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_merged.py index fb8e551d04..dce7dddc55 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_merged.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_merged.py @@ -1,30 +1,39 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from abc import abstractmethod, ABC -from typing import List, Optional, Pattern, Dict, Match -from datetime import datetime +from abc import ABC, abstractmethod from collections import namedtuple +from datetime import datetime +from typing import Dict, List, Match, Optional, Pattern + import regex from recognizers_text.extractor import Extractor, ExtractResult from recognizers_text.meta_data import MetaData -from .constants import Constants, TimeTypeConstants -from .extractors import DateTimeExtractor -from .parsers import DateTimeParser, DateTimeParseResult + from .base_date import BaseDateParser -from .base_time import BaseTimeParser -from .base_datetime import BaseDateTimeParser -from .base_holiday import BaseHolidayParser from .base_dateperiod import BaseDatePeriodParser -from .base_timeperiod import BaseTimePeriodParser +from .base_datetime import BaseDateTimeParser from .base_datetimeperiod import BaseDateTimePeriodParser from .base_duration import BaseDurationParser -from .base_set import BaseSetParser -from .utilities import Token, merge_all_tokens, RegExpUtility, DateTimeOptions, DateTimeFormatUtil, DateUtils,\ - MatchingUtil, RegExpUtility, TimexUtil -from .datetime_zone_extractor import DateTimeZoneExtractor +from .base_holiday import BaseHolidayParser +from .base_time import BaseTimeParser +from .base_timeperiod import BaseTimePeriodParser +from .constants import Constants, TimeTypeConstants from .datetime_list_extractor import DateTimeListExtractor +from .extractors import DateTimeExtractor +from .parsers import DateTimeParser, DateTimeParseResult +from .utilities import ( + DateTimeFormatUtil, + DateTimeOptions, + DateUtils, + MatchingUtil, + RegExpUtility, + TimexUtil, + Token, + merge_all_tokens, +) + MatchedIndex = namedtuple('MatchedIndex', ['matched', 'index']) @@ -71,21 +80,11 @@ def date_time_period_extractor(self) -> DateTimeExtractor: def duration_extractor(self) -> DateTimeExtractor: raise NotImplementedError - @property - @abstractmethod - def set_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - @property @abstractmethod def holiday_extractor(self) -> DateTimeExtractor: raise NotImplementedError - @property - @abstractmethod - def time_zone_extractor(self) -> DateTimeZoneExtractor: - raise NotImplementedError - @property @abstractmethod def datetime_alt_extractor(self) -> DateTimeListExtractor: @@ -199,9 +198,9 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult if (self.options & DateTimeOptions.FAIL_FAST) != 0 and self.is_fail_fast_case(source): - ''' @TODO needs better handling of holidays and timezones. - self.add_to(result,self.config.holiday_extractor.extract(source,reference), source) - result = self.add_mod(result,source) + '''@TODO needs better handling of holidays and timezones. + self.add_to(result,self.config.holiday_extractor.extract(source,reference), source) + result = self.add_mod(result,source) ''' return result @@ -211,36 +210,20 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult if (self.options & DateTimeOptions.ENABLE_PREVIEW) != 0: source, superfluous_word_matches = MatchingUtil.pre_process_text_remove_superfluous_words( - source, - self.config.superfluous_word_matcher + source, self.config.superfluous_word_matcher ) # The order is important, since there can be conflicts in merging - result = self.add_to( - result, self.config.date_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.time_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.date_period_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.duration_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.time_period_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.date_time_period_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.date_time_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.set_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.holiday_extractor.extract(source, reference), source) - - if (self.options & DateTimeOptions.ENABLE_PREVIEW) != 0: - self.add_to(result, self.config.time_zone_extractor.extract(source, reference), source) - result = self.config.time_zone_extractor.remove_ambiguous_time_zone(result) + result = self.add_to(result, self.config.date_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.time_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.date_period_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.duration_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.time_period_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.date_time_period_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.date_time_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.holiday_extractor.extract(source, reference), source) # this should be at the end since if need the extractor to determine the previous text contains time or not - result = self.add_to( - result, self.number_ending_regex_match(source, result), source) + result = self.add_to(result, self.number_ending_regex_match(source, result), source) # Modify time entity to an alternative DateTime expression if it follows a DateTime entity if (self.options & DateTimeOptions.EXTENDED_TYPES) != 0: @@ -309,7 +292,11 @@ def filter_unespecific_date_period(self, extract_results: List[ExtractResult]) - return extract_results - def _filter_ambiguity(self, extract_results: List[ExtractResult], text: str, ) -> List[ExtractResult]: + def _filter_ambiguity( + self, + extract_results: List[ExtractResult], + text: str, + ) -> List[ExtractResult]: if self.config.ambiguity_filters_dict is not None: for regex_var in self.config.ambiguity_filters_dict: @@ -324,9 +311,18 @@ def _filter_ambiguity(self, extract_results: List[ExtractResult], text: str, ) - if reg_length > 0: matches = reg_len - new_ers = list(filter(lambda x: list( - filter(lambda m: m.start() < x.start + x.length and m.start() + - len(m.group()) > x.start, matches)), extract_results)) + new_ers = list( + filter( + lambda x: list( + filter( + lambda m: m.start() < x.start + x.length + and m.start() + len(m.group()) > x.start, + matches, + ) + ), + extract_results, + ) + ) if len(new_ers) > 0: for item in extract_results: for i in new_ers: @@ -342,20 +338,16 @@ def number_ending_regex_match(self, source: str, extract_results: List[ExtractRe for extract_result in extract_results: if extract_result.type in [Constants.SYS_DATETIME_TIME, Constants.SYS_DATETIME_DATETIME]: - after_str = source[extract_result.start + - extract_result.length:] - match = regex.search( - self.config.number_ending_pattern, after_str) + after_str = source[extract_result.start + extract_result.length :] + match = regex.search(self.config.number_ending_pattern, after_str) if match: new_time = RegExpUtility.get_group(match, Constants.NEW_TIME) num_res = self.config.integer_extractor.extract(new_time) if not num_res: continue - start_position = extract_result.start + \ - extract_result.length + match.group().index(new_time) - tokens.append( - Token(start_position, start_position + len(new_time))) + start_position = extract_result.start + extract_result.length + match.group().index(new_time) + tokens.append(Token(start_position, start_position + len(new_time))) return merge_all_tokens(tokens, source, Constants.SYS_DATETIME_TIME) @@ -376,13 +368,15 @@ def add_mod(self, extract_results: List[ExtractResult], source: str) -> List[Ext if not success: success = self.try_merge_modifier_token(extract_result, self.config.equal_regex, source) - if extract_result.type == Constants.SYS_DATETIME_DATEPERIOD or \ - extract_result.type == Constants.SYS_DATETIME_DATE or \ - extract_result.type == Constants.SYS_DATETIME_TIME: + if ( + extract_result.type == Constants.SYS_DATETIME_DATEPERIOD + or extract_result.type == Constants.SYS_DATETIME_DATE + or extract_result.type == Constants.SYS_DATETIME_TIME + ): start = extract_result.start if extract_result.start else 0 length = extract_result.length if extract_result.length else 0 - after_str = source[start + length:].strip() + after_str = source[start + length :].strip() match = RegExpUtility.match_begin(self.config.suffix_after_regex, after_str, True) @@ -392,7 +386,7 @@ def add_mod(self, extract_results: List[ExtractResult], source: str) -> List[Ext if match.length == len(after_str.strip()): is_followed_by_other_entity = False else: - next_str = after_str.strip()[match.length:].strip() + next_str = after_str.strip()[match.length :].strip() next_er = next((e for e in extract_results if e.start > extract_result.start), None) if next_er is None or not next_str.startswith(next_er.text): @@ -401,7 +395,7 @@ def add_mod(self, extract_results: List[ExtractResult], source: str) -> List[Ext if not is_followed_by_other_entity: mod_length = match.length + after_str.index(match.value) extract_result.length += mod_length - extract_result.text = source[start: extract_result.start + extract_result.length] + extract_result.text = source[start : extract_result.start + extract_result.length] extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) return extract_results @@ -416,17 +410,24 @@ def add_mod_item(self, extract_result: ExtractResult, source: str) -> ExtractRes success = self.try_merge_modifier_token(extract_result, self.config.since_regex, source, True) return extract_result - def try_merge_modifier_token(self, extract_result: ExtractResult, pattern: Pattern, source: str, - potential_ambiguity: bool = False) -> bool: - before_str = source[0:extract_result.start] - after_str = source[extract_result.start: extract_result.length] + def try_merge_modifier_token( + self, extract_result: ExtractResult, pattern: Pattern, source: str, potential_ambiguity: bool = False + ) -> bool: + before_str = source[0 : extract_result.start] + after_str = source[extract_result.start : extract_result.length] # Avoid adding mod for ambiguity cases, such as "from" in "from ... to ..." should not add mod - if potential_ambiguity and self.config.ambiguous_range_modifier_prefix and \ - regex.search(self.config.ambiguous_range_modifier_prefix, before_str): + if ( + potential_ambiguity + and self.config.ambiguous_range_modifier_prefix + and regex.search(self.config.ambiguous_range_modifier_prefix, before_str) + ): matches = list(regex.finditer(self.config.potential_ambiguous_range_regex, source)) if matches and len(matches): - return any(match.start() < extract_result.start + extract_result.length and match.end() > extract_result.start for match in matches) + return any( + match.start() < extract_result.start + extract_result.length and match.end() > extract_result.start + for match in matches + ) # return self._filter_item(extract_result, matches) token = self.has_token_index(before_str.strip(), pattern) @@ -434,18 +435,18 @@ def try_merge_modifier_token(self, extract_result: ExtractResult, pattern: Patte mod_len = len(before_str) - token.index extract_result.length += mod_len extract_result.start -= mod_len - extract_result.text = source[extract_result.start:extract_result.start + extract_result.length] + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) return True elif self.config.check_both_before_after: # check also after_str - after_str = source[extract_result.start: extract_result.length] + after_str = source[extract_result.start : extract_result.length] token = self.has_token_index(after_str.strip(), pattern) if token.matched: mod_len = token.index + len(after_str) - len(after_str.strip()) extract_result.length += mod_len - extract_result.text = source[extract_result.start: extract_result.start + extract_result.length] + extract_result.text = source[extract_result.start : extract_result.start + extract_result.length] extract_result.data = Constants.HAS_MOD extract_result.meta_data = self.assign_mod_metadata(extract_result.meta_data) @@ -476,7 +477,7 @@ def has_token_index(source: str, pattern: Pattern) -> MatchedIndex: match_result = list(regex.finditer(pattern, source)) if match_result: match = match_result[-1] - if not source[match.end():].strip(): + if not source[match.end() :].strip(): return MatchedIndex(True, match.start()) return MatchedIndex(False, -1) @@ -567,11 +568,6 @@ def date_time_period_parser(self) -> BaseDateTimePeriodParser: def duration_parser(self) -> BaseDurationParser: raise NotImplementedError - @property - @abstractmethod - def set_parser(self) -> BaseSetParser: - raise NotImplementedError - class BaseMergedParser(DateTimeParser): @property @@ -579,10 +575,8 @@ def parser_type_name(self) -> str: return Constants.SYS_DATETIME_MERGED def __init__(self, config: MergedParserConfiguration, options: DateTimeOptions): - self.__date_min_value = DateTimeFormatUtil.format_date( - DateUtils.min_value) - self.__date_time_min_value = DateTimeFormatUtil.format_date_time( - DateUtils.min_value) + self.__date_min_value = DateTimeFormatUtil.format_date(DateUtils.min_value) + self.__date_time_min_value = DateTimeFormatUtil.format_date_time(DateUtils.min_value) self.config = config self.options = options @@ -642,15 +636,25 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if around_match and around_match.success: has_around = True source.start += 0 if match_is_after else preLength + around_match.index + around_match.length - source.length -= around_match.length if match_is_after else preLength + around_match.index + around_match.length - source.text = source.text[0:source.length] if match_is_after else source.text[preLength + around_match.index + around_match.length:] - mod_str = around_match.group() if match_is_after else aroundText[0:around_match.index + around_match.length] + source.length -= ( + around_match.length if match_is_after else preLength + around_match.index + around_match.length + ) + source.text = ( + source.text[0 : source.length] + if match_is_after + else source.text[preLength + around_match.index + around_match.length :] + ) + mod_str = ( + around_match.group() if match_is_after else aroundText[0 : around_match.index + around_match.length] + ) if before_match and before_match.success: has_before = True if not (around_match and around_match.success): source.start += 0 if match_is_after else before_match.length source.length -= before_match.length - source.text = source.text[0:source.length] if match_is_after else source.text[before_match.length:] + source.text = ( + source.text[0 : source.length] if match_is_after else source.text[before_match.length :] + ) mod_str = before_match.group() + mod_str if RegExpUtility.get_group(before_match.match[0], "include"): has_inclusive_mod = True @@ -659,7 +663,9 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if not (around_match and around_match.success): source.start += 0 if match_is_after else after_match.length source.length -= after_match.length - source.text = source.text[0:source.length] if match_is_after else source.text[after_match.length:] + source.text = ( + source.text[0 : source.length] if match_is_after else source.text[after_match.length :] + ) mod_str = after_match.group() + mod_str if RegExpUtility.get_group(after_match.match[0], "include"): has_inclusive_mod = True @@ -668,17 +674,22 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if not (around_match and around_match.success): source.start += 0 if match_is_after else since_match.length source.length -= since_match.length - source.text = source.text[0:source.length] if match_is_after else source.text[since_match.length:] + source.text = ( + source.text[0 : source.length] if match_is_after else source.text[since_match.length :] + ) mod_str = since_match.group() + mod_str elif equal_match and equal_match.success: has_equal = True source.start += 0 if match_is_after else equal_match.length source.length -= equal_match.length - source.text = source.text[0:source.length] if match_is_after else source.text[equal_match.length:] + source.text = source.text[0 : source.length] if match_is_after else source.text[equal_match.length :] mod_str = equal_match.group() - elif source.type == Constants.SYS_DATETIME_DATEPERIOD and \ - regex.search(self.config.year_regex, source.text) or source.type == Constants.SYS_DATETIME_DATE or \ - source.type == Constants.SYS_DATETIME_TIME: + elif ( + source.type == Constants.SYS_DATETIME_DATEPERIOD + and regex.search(self.config.year_regex, source.text) + or source.type == Constants.SYS_DATETIME_DATE + or source.type == Constants.SYS_DATETIME_TIME + ): # This has to be put at the end of the if, or cases like "before 2012" and "after 2012" # would fall into this # 2012 or after/above @@ -687,7 +698,7 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if match and match.success: has_date_after = True source.length -= match.length - source.text = source.text[0:source.length] + source.text = source.text[0 : source.length] mod_str = match.group() result = self.parse_result(source, reference) @@ -701,8 +712,9 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D result.text = result.text + mod_str if match_is_after else mod_str + result.text val = result.value - val.mod = self.combine_mod(val.mod, TimeTypeConstants.BEFORE_MOD if not has_inclusive_mod else - TimeTypeConstants.UNTIL_MOD) + val.mod = self.combine_mod( + val.mod, TimeTypeConstants.BEFORE_MOD if not has_inclusive_mod else TimeTypeConstants.UNTIL_MOD + ) if has_around: val.mod = self.combine_mod(TimeTypeConstants.APPROX_MOD, val.mod) has_around = False @@ -714,8 +726,9 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D result.text = mod_str + result.text val = result.value - val.mod = self.combine_mod(val.mod, TimeTypeConstants.AFTER_MOD if not has_inclusive_mod else - TimeTypeConstants.SINCE_MOD) + val.mod = self.combine_mod( + val.mod, TimeTypeConstants.AFTER_MOD if not has_inclusive_mod else TimeTypeConstants.SINCE_MOD + ) if has_around: val.mod = self.combine_mod(TimeTypeConstants.APPROX_MOD, val.mod) has_around = False @@ -755,8 +768,7 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D # For cases like "3 pm or later on monday" match = self.config.suffix_after.match(result.text) - if result.value and (match.start() != 0 if match else match) and \ - result.type == Constants.SYS_DATETIME_DATETIME: + if result.value and (match.start() != 0 if match else match) and result.type == Constants.SYS_DATETIME_DATETIME: val = result.value val.mod = self.combine_mod(val.mod, TimeTypeConstants.SINCE_MOD) result.value = val @@ -765,8 +777,7 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if self.options & DateTimeOptions.SPLIT_DATE_AND_TIME and result.value and result.value.sub_date_time_entities: result.value = self._date_time_resolution_for_split(result) else: - result = self.set_parse_result( - result, has_before, has_after, has_since) + result = self.set_parse_result(result, has_before, has_after, has_since) return result @@ -786,12 +797,9 @@ def parse_result(self, source: ExtractResult, reference: datetime): elif source.type == Constants.SYS_DATETIME_TIMEPERIOD: result = self.config.time_period_parser.parse(source, reference) elif source.type == Constants.SYS_DATETIME_DATETIMEPERIOD: - result = self.config.date_time_period_parser.parse( - source, reference) + result = self.config.date_time_period_parser.parse(source, reference) elif source.type == Constants.SYS_DATETIME_DURATION: result = self.config.duration_parser.parse(source, reference) - elif source.type == Constants.SYS_DATETIME_SET: - result = self.config.set_parser.parse(source, reference) else: return None @@ -806,12 +814,14 @@ def combine_mod(original_mod: str, new_mod: str): return combined_mod - def set_parse_result(self, slot: DateTimeParseResult, has_before: bool, has_after: bool, has_since: bool)\ - -> DateTimeParseResult: - slot.value = self._date_time_resolution( - slot, has_before, has_after, has_since) - slot.type = f'{self.parser_type_name}.' \ - f'{self._determine_date_time_types(slot.type, has_before, has_after, has_since)}' + def set_parse_result( + self, slot: DateTimeParseResult, has_before: bool, has_after: bool, has_since: bool + ) -> DateTimeParseResult: + slot.value = self._date_time_resolution(slot, has_before, has_after, has_since) + slot.type = ( + f'{self.parser_type_name}.' + f'{self._determine_date_time_types(slot.type, has_before, has_after, has_since)}' + ) return slot def _get_parse_result(self, extractor_result: Extractor, reference: datetime) -> DateTimeParseResult: @@ -819,8 +829,7 @@ def _get_parse_result(self, extractor_result: Extractor, reference: datetime) -> if extractor_type == Constants.SYS_DATETIME_DATE: result = self.config.date_parser.parse(extractor_result, reference) if not result.value: - result = self.config.holiday_parser.parse( - extractor_result, reference) + result = self.config.holiday_parser.parse(extractor_result, reference) return result elif extractor_type == Constants.SYS_DATETIME_TIME: return self.config.time_parser.parse(extractor_result, reference) @@ -834,8 +843,6 @@ def _get_parse_result(self, extractor_result: Extractor, reference: datetime) -> return self.config.date_time_period_parser.parse(extractor_result, reference) elif extractor_type == Constants.SYS_DATETIME_DURATION: return self.config.duration_parser.parse(extractor_result, reference) - elif extractor_type == Constants.SYS_DATETIME_SET: - return self.config.set_parser.parse(extractor_result, reference) else: return None @@ -881,8 +888,9 @@ def _date_time_resolution_for_split(self, slot: DateTimeParseResult) -> List[Dat return results - def _date_time_resolution(self, slot: DateTimeParseResult, has_before, has_after, has_since) ->\ - List[Dict[str, str]]: + def _date_time_resolution( + self, slot: DateTimeParseResult, has_before, has_after, has_since + ) -> List[Dict[str, str]]: if not slot: return None @@ -907,8 +915,7 @@ def _date_time_resolution(self, slot: DateTimeParseResult, has_before, has_after self._add_resolution_fields_any(result, Constants.COMMENT_KEY, comment) self._add_resolution_fields_any(result, Constants.MOD_KEY, mod) self._add_resolution_fields_any(result, Constants.TYPE_KEY, output_type) - self._add_resolution_fields_any( - result, Constants.IS_LUNAR_KEY, str(is_lunar).lower() if is_lunar else '') + self._add_resolution_fields_any(result, Constants.IS_LUNAR_KEY, str(is_lunar).lower() if is_lunar else '') future_resolution = value.future_resolution past_resolution = value.past_resolution @@ -918,20 +925,16 @@ def _date_time_resolution(self, slot: DateTimeParseResult, has_before, has_after future_values = sorted(future.values()) past_values = sorted(past.values()) - intersect_values = [i for i, j in zip( - future_values, past_values) if i == j] + intersect_values = [i for i, j in zip(future_values, past_values) if i == j] if len(intersect_values) == len(past_values) and len(intersect_values) == len(future_values): if past_values: - self._add_resolution_fields_any( - result, Constants.RESOLVE_KEY, past) + self._add_resolution_fields_any(result, Constants.RESOLVE_KEY, past) else: if past_values: - self._add_resolution_fields_any( - result, Constants.RESOLVE_TO_PAST_KEY, past) + self._add_resolution_fields_any(result, Constants.RESOLVE_TO_PAST_KEY, past) if future_values: - self._add_resolution_fields_any( - result, Constants.RESOLVE_TO_FUTURE_KEY, future) + self._add_resolution_fields_any(result, Constants.RESOLVE_TO_FUTURE_KEY, future) if comment == Constants.AM_PM_GROUP_NAME: if Constants.RESOLVE_KEY in result: @@ -941,18 +944,20 @@ def _date_time_resolution(self, slot: DateTimeParseResult, has_before, has_after self._resolve_ampm(result, Constants.RESOLVE_TO_FUTURE_KEY) if TimexUtil._has_double_timex(comment): - TimexUtil._process_double_timex(result, Constants.RESOLVE_TO_FUTURE_KEY, Constants.RESOLVE_TO_PAST_KEY, timex) + TimexUtil._process_double_timex( + result, Constants.RESOLVE_TO_FUTURE_KEY, Constants.RESOLVE_TO_PAST_KEY, timex + ) for value in result.values(): if isinstance(value, dict): new_values = {} - self._add_resolution_fields( - new_values, Constants.TIMEX_KEY, timex) + self._add_resolution_fields(new_values, Constants.TIMEX_KEY, timex) self._add_resolution_fields(new_values, Constants.MOD_KEY, mod) self._add_resolution_fields(new_values, Constants.TYPE_KEY, output_type) - self._add_resolution_fields(new_values, Constants.IS_LUNAR_KEY, - str(is_lunar).lower() if is_lunar else '') + self._add_resolution_fields( + new_values, Constants.IS_LUNAR_KEY, str(is_lunar).lower() if is_lunar else '' + ) self._add_resolution_fields(new_values, Constants.SOURCE_TYPE, source_entity) for inner_key in value: @@ -984,34 +989,35 @@ def _generate_from_resolution(self, dtype: str, resolution: Dict[str, str], mod: result = {} if dtype == Constants.SYS_DATETIME_DATETIME: - self.__add_single_date_time_to_resolution( - resolution, TimeTypeConstants.DATETIME, mod, result) + self.__add_single_date_time_to_resolution(resolution, TimeTypeConstants.DATETIME, mod, result) elif dtype == Constants.SYS_DATETIME_TIME: - self.__add_single_date_time_to_resolution( - resolution, TimeTypeConstants.TIME, mod, result) + self.__add_single_date_time_to_resolution(resolution, TimeTypeConstants.TIME, mod, result) elif dtype == Constants.SYS_DATETIME_DATE: - self.__add_single_date_time_to_resolution( - resolution, TimeTypeConstants.DATE, mod, result) + self.__add_single_date_time_to_resolution(resolution, TimeTypeConstants.DATE, mod, result) elif dtype == Constants.SYS_DATETIME_DURATION: if TimeTypeConstants.DURATION in resolution: result[TimeTypeConstants.VALUE] = resolution[TimeTypeConstants.DURATION] if dtype == Constants.SYS_DATETIME_TIMEPERIOD: self.__add_period_to_resolution( - resolution, TimeTypeConstants.START_TIME, TimeTypeConstants.END_TIME, mod, result) + resolution, TimeTypeConstants.START_TIME, TimeTypeConstants.END_TIME, mod, result + ) if dtype == Constants.SYS_DATETIME_DATEPERIOD: self.__add_period_to_resolution( - resolution, TimeTypeConstants.START_DATE, TimeTypeConstants.END_DATE, mod, result) + resolution, TimeTypeConstants.START_DATE, TimeTypeConstants.END_DATE, mod, result + ) if dtype == Constants.SYS_DATETIME_DATETIMEPERIOD: self.__add_period_to_resolution( - resolution, TimeTypeConstants.START_DATETIME, TimeTypeConstants.END_DATETIME, mod, result) + resolution, TimeTypeConstants.START_DATETIME, TimeTypeConstants.END_DATETIME, mod, result + ) return result - def __add_single_date_time_to_resolution(self, resolutions: Dict[str, str], dtype: str, - mod: str, result: Dict[str, str]): + def __add_single_date_time_to_resolution( + self, resolutions: Dict[str, str], dtype: str, mod: str, result: Dict[str, str] + ): key = TimeTypeConstants.VALUE value = resolutions[dtype] if not value or value.startswith(self.__date_min_value): @@ -1029,8 +1035,9 @@ def __add_single_date_time_to_resolution(self, resolutions: Dict[str, str], dtyp result[key] = value - def __add_period_to_resolution(self, resolutions: Dict[str, str], start_type: str, - end_type: str, mod: str, result: Dict[str, str]): + def __add_period_to_resolution( + self, resolutions: Dict[str, str], start_type: str, end_type: str, mod: str, result: Dict[str, str] + ): start = resolutions.get(start_type, None) end = resolutions.get(end_type, None) if mod: @@ -1071,30 +1078,24 @@ def _resolve_ampm(self, values_map: Dict[str, str], key_name: str): resolution_pm = {} if values_map[Constants.TYPE_KEY] == Constants.SYS_DATETIME_TIME: - resolution_pm[TimeTypeConstants.VALUE] = DateTimeFormatUtil.to_pm( - resolution[TimeTypeConstants.VALUE]) + resolution_pm[TimeTypeConstants.VALUE] = DateTimeFormatUtil.to_pm(resolution[TimeTypeConstants.VALUE]) resolution_pm[Constants.TIMEX_KEY] = DateTimeFormatUtil.to_pm(timex) elif values_map[Constants.TYPE_KEY] == Constants.SYS_DATETIME_DATETIME: split_value = resolution[TimeTypeConstants.VALUE].split(' ') - resolution_pm[ - TimeTypeConstants.VALUE] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' + resolution_pm[TimeTypeConstants.VALUE] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' resolution_pm[Constants.TIMEX_KEY] = DateTimeFormatUtil.all_str_to_pm(timex) elif values_map[Constants.TYPE_KEY] == Constants.SYS_DATETIME_TIMEPERIOD: if TimeTypeConstants.START in resolution: - resolution_pm[TimeTypeConstants.START] = DateTimeFormatUtil.to_pm( - resolution[TimeTypeConstants.START]) + resolution_pm[TimeTypeConstants.START] = DateTimeFormatUtil.to_pm(resolution[TimeTypeConstants.START]) if TimeTypeConstants.END in resolution: - resolution_pm[TimeTypeConstants.END] = DateTimeFormatUtil.to_pm( - resolution[TimeTypeConstants.END]) + resolution_pm[TimeTypeConstants.END] = DateTimeFormatUtil.to_pm(resolution[TimeTypeConstants.END]) resolution_pm[Constants.TIMEX_KEY] = DateTimeFormatUtil.all_str_to_pm(timex) elif values_map[Constants.TYPE_KEY] == Constants.SYS_DATETIME_DATETIMEPERIOD: if TimeTypeConstants.START in resolution: split_value = resolution[TimeTypeConstants.START].split(' ') - resolution_pm[ - TimeTypeConstants.START] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' + resolution_pm[TimeTypeConstants.START] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' if TimeTypeConstants.END in resolution: split_value = resolution[TimeTypeConstants.END].split(' ') - resolution_pm[ - TimeTypeConstants.END] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' + resolution_pm[TimeTypeConstants.END] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' resolution_pm[Constants.TIMEX_KEY] = DateTimeFormatUtil.all_str_to_pm(timex) values_map[key_name + Constants.PM_GROUP_NAME] = resolution_pm diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_minimal_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_minimal_configs.py new file mode 100644 index 0000000000..bd1f2cdb7e --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_minimal_configs.py @@ -0,0 +1,93 @@ +from abc import ABC, abstractmethod +from typing import Dict, Pattern + +from recognizers_number import BaseNumberExtractor, BaseNumberParser + +from ..resources.base_date_time import BaseDateTime +from .extractors import DateTimeExtractor +from .parsers import DateTimeParser +from .utilities import DateTimeUtilityConfiguration + + +class MinimalBaseDateParserConfiguration(ABC): + @property + @abstractmethod + def cardinal_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def integer_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def ordinal_extractor(self) -> BaseNumberExtractor: + raise NotImplementedError + + @property + @abstractmethod + def number_parser(self) -> BaseNumberParser: + raise NotImplementedError + + @property + @abstractmethod + def date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_parser(self) -> DateTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def utility_configuration(self) -> DateTimeUtilityConfiguration: + raise NotImplementedError + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + @abstractmethod + def day_of_week(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def month_of_year(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def numbers(self) -> Dict[str, int]: + raise NotImplementedError + + @property + @abstractmethod + def check_both_before_after(self) -> Pattern: + raise NotImplementedError + + def __init__(self): + self._day_of_month = BaseDateTime.DayOfMonthDictionary diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_minimal_merged.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_minimal_merged.py new file mode 100644 index 0000000000..6e72ca381d --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_minimal_merged.py @@ -0,0 +1,576 @@ +from abc import ABC, abstractmethod +from collections import namedtuple +from datetime import datetime +from typing import Dict, List, Optional, Pattern + +import regex + +from recognizers_text.extractor import Extractor, ExtractResult + +from .base_date import BaseDateParser +from .base_time import BaseTimeParser +from .constants import Constants, TimeTypeConstants +from .extractors import DateTimeExtractor +from .parsers import DateTimeParser, DateTimeParseResult +from .utilities import DateTimeFormatUtil, DateTimeOptions, DateUtils, RegExpUtility, TimexUtil, Token, merge_all_tokens + + +MatchedIndex = namedtuple('MatchedIndex', ['matched', 'index']) + + +class MinimalMergedExtractorConfiguration: + + @property + @abstractmethod + def ambiguous_range_modifier_prefix(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def number_ending_pattern(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def date_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def date_time_extractor(self) -> DateTimeExtractor: + raise NotImplementedError + + @property + @abstractmethod + def integer_extractor(self) -> Extractor: + raise NotImplementedError + + @property + @abstractmethod + def equal_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def check_both_before_after(self): + raise NotImplementedError + + +class MinimalMergedExtractor(DateTimeExtractor): + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_MERGED + + def __init__(self, config: MinimalMergedExtractorConfiguration, options: DateTimeOptions): + self.config = config + self.options = options + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + if reference is None: + reference = datetime.now() + + result: List[ExtractResult] = list() + + # The order is important, since there can be conflicts in merging + result = self.add_to(result, self.config.date_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.time_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.date_time_extractor.extract(source, reference), source) + + # this should be at the end since if need the extractor to determine the previous text contains time or not + result = self.add_to(result, self.number_ending_regex_match(source, result), source) + + result = sorted(result, key=lambda x: x.start) + + return result + + def add_to(self, destinations: List[ExtractResult], source: List[ExtractResult], text: str) -> List[ExtractResult]: + for value in source: + is_found = False + overlap_indexes: List[int] = list() + first_index = -1 + + for index, destination in enumerate(destinations): + if destination.overlap(value): + is_found = True + if destination.cover(value): + if first_index == -1: + first_index = index + overlap_indexes.append(index) + else: + continue + + if not is_found: + destinations.append(value) + elif overlap_indexes: + temp_dst: List[ExtractResult] = list() + + for index, destination in enumerate(destinations): + if index not in overlap_indexes: + temp_dst.append(destination) + + # insert at the first overlap occurence to keep the order + temp_dst.insert(first_index, value) + destinations = temp_dst + return destinations + + def number_ending_regex_match(self, source: str, extract_results: List[ExtractResult]) -> List[ExtractResult]: + tokens: List[Token] = list() + + for extract_result in extract_results: + if extract_result.type in [Constants.SYS_DATETIME_TIME, Constants.SYS_DATETIME_DATETIME]: + after_str = source[extract_result.start + extract_result.length :] + match = regex.search(self.config.number_ending_pattern, after_str) + if match: + new_time = RegExpUtility.get_group(match, Constants.NEW_TIME) + num_res = self.config.integer_extractor.extract(new_time) + if not num_res: + continue + + start_position = extract_result.start + extract_result.length + match.group().index(new_time) + tokens.append(Token(start_position, start_position + len(new_time))) + + return merge_all_tokens(tokens, source, Constants.SYS_DATETIME_TIME) + + +class MinimalMergedParserConfiguration(ABC): + @property + @abstractmethod + def before_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def after_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def since_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def around_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def equal_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def year_regex(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def suffix_after(self) -> Pattern: + raise NotImplementedError + + @property + @abstractmethod + def date_parser(self) -> BaseDateParser: + raise NotImplementedError + + @property + @abstractmethod + def time_parser(self) -> BaseTimeParser: + raise NotImplementedError + + @property + @abstractmethod + def date_time_parser(self) -> BaseTimeParser: + raise NotImplementedError + + +class MinimalMergedParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_MERGED + + def __init__(self, config: MinimalMergedParserConfiguration, options: DateTimeOptions): + self.__date_min_value = DateTimeFormatUtil.format_date(DateUtils.min_value) + self.__date_time_min_value = DateTimeFormatUtil.format_date_time(DateUtils.min_value) + self.config = config + self.options = options + + def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: + if not reference: + reference = datetime.now() + + # Push, save the MOD string + has_before = False + has_after = False + has_since = False + has_around = False + has_equal = False + has_date_after = False + match_is_after = False + + # "inclusive_mod" means MOD should include the start/end time + # For example, cases like "on or later than", "earlier than or in" have inclusive modifier + has_inclusive_mod = False + mod_str = '' + + result = self.parse_result(source, reference) + if not result: + return None + + # Pop, restore the MOD string + if has_before and result.value: + result.length += len(mod_str) + result.start -= 0 if match_is_after else len(mod_str) + result.text = result.text + mod_str if match_is_after else mod_str + result.text + val = result.value + + val.mod = self.combine_mod( + val.mod, TimeTypeConstants.BEFORE_MOD if not has_inclusive_mod else TimeTypeConstants.UNTIL_MOD + ) + if has_around: + val.mod = self.combine_mod(TimeTypeConstants.APPROX_MOD, val.mod) + has_around = False + result.value = val + + if has_after and result.value: + result.length += len(mod_str) + result.start -= len(mod_str) + result.text = mod_str + result.text + val = result.value + + val.mod = self.combine_mod( + val.mod, TimeTypeConstants.AFTER_MOD if not has_inclusive_mod else TimeTypeConstants.SINCE_MOD + ) + if has_around: + val.mod = self.combine_mod(TimeTypeConstants.APPROX_MOD, val.mod) + has_around = False + result.value = val + + if has_since and result.value: + result.length += len(mod_str) + result.start -= len(mod_str) + result.text = mod_str + result.text + val = result.value + val.mod = TimeTypeConstants.SINCE_MOD + if has_around: + val.mod = self.combine_mod(TimeTypeConstants.APPROX_MOD, val.mod) + has_around = False + result.value = val + + if has_around and result.value: + result.length += len(mod_str) + result.start -= len(mod_str) + result.text = mod_str + result.text + val = result.value + val.mod = TimeTypeConstants.APPROX_MOD + result.value = val + + if has_equal and result.value: + result.length += len(mod_str) + result.start -= len(mod_str) + result.text = mod_str + result.text + + if has_date_after and result.value: + result.length += len(mod_str) + result.text = result.text + mod_str + val = result.value + val.mod = self.combine_mod(val.mod, TimeTypeConstants.SINCE_MOD) + result.value = val + has_since = True + + # For cases like "3 pm or later on monday" + match = self.config.suffix_after.match(result.text) + if result.value and (match.start() != 0 if match else match) and result.type == Constants.SYS_DATETIME_DATETIME: + val = result.value + val.mod = self.combine_mod(val.mod, TimeTypeConstants.SINCE_MOD) + result.value = val + has_since = True + + if self.options & DateTimeOptions.SPLIT_DATE_AND_TIME and result.value and result.value.sub_date_time_entities: + result.value = self._date_time_resolution_for_split(result) + else: + result = self.set_parse_result(result, has_before, has_after, has_since) + + return result + + def parse_result(self, source: ExtractResult, reference: datetime): + if source.type == Constants.SYS_DATETIME_DATE: + result = self.config.date_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_TIME: + result = self.config.time_parser.parse(source, reference) + elif source.type == Constants.SYS_DATETIME_DATETIME: + result = self.config.date_time_parser.parse(source, reference) + else: + return None + + return result + + @staticmethod + def combine_mod(original_mod: str, new_mod: str): + combined_mod = new_mod + + if original_mod: + combined_mod = f"{new_mod}-{original_mod}" + + return combined_mod + + def set_parse_result( + self, slot: DateTimeParseResult, has_before: bool, has_after: bool, has_since: bool + ) -> DateTimeParseResult: + slot.value = self._date_time_resolution(slot, has_before, has_after, has_since) + slot.type = ( + f'{self.parser_type_name}.' + f'{self._determine_date_time_types(slot.type, has_before, has_after, has_since)}' + ) + return slot + + def _get_parse_result(self, extractor_result: Extractor, reference: datetime) -> DateTimeParseResult: + extractor_type = extractor_result.type + if extractor_type == Constants.SYS_DATETIME_DATE: + result = self.config.date_parser.parse(extractor_result, reference) + return result + elif extractor_type == Constants.SYS_DATETIME_TIME: + return self.config.time_parser.parse(extractor_result, reference) + else: + return None + + def _determine_date_time_types(self, dtype: str, has_before: bool, has_after: bool, has_since: bool) -> str: + if self.options & DateTimeOptions.SPLIT_DATE_AND_TIME: + if dtype == Constants.SYS_DATETIME_DATETIME: + return Constants.SYS_DATETIME_TIME + else: + if has_before or has_after or has_since: + if dtype == Constants.SYS_DATETIME_DATE: + return Constants.SYS_DATETIME_DATEPERIOD + + if dtype == Constants.SYS_DATETIME_TIME: + return Constants.SYS_DATETIME_TIMEPERIOD + + if dtype == Constants.SYS_DATETIME_DATETIME: + return Constants.SYS_DATETIME_DATETIMEPERIOD + return dtype + + def _determine_source_entity_type(self, source_type: str, new_type: str, has_mod: bool) -> Optional[str]: + if not has_mod: + return None + + if new_type != source_type: + return Constants.SYS_DATETIME_DATETIMEPOINT + + if new_type == Constants.SYS_DATETIME_DATEPERIOD: + return Constants.SYS_DATETIME_DATETIMEPERIOD + + def _date_time_resolution_for_split(self, slot: DateTimeParseResult) -> List[DateTimeParseResult]: + results = [] + if slot.value.sub_date_time_entities: + sub_entities = slot.value.sub_date_time_entities + + for sub_entity in sub_entities: + result = sub_entity + result.start += slot.start + results += self._date_time_resolution_for_split(result) + else: + slot.value = self._date_time_resolution(slot, False, False, False) + slot.type = f'{self.parser_type_name}.{self._determine_date_time_types(slot.type, False, False, False)}' + results.append(slot) + + return results + + def _date_time_resolution( + self, slot: DateTimeParseResult, has_before, has_after, has_since + ) -> List[Dict[str, str]]: + if not slot: + return None + + result = dict() + resolutions = [] + + dtype = slot.type + output_type = self._determine_date_time_types(dtype, has_before, has_after, has_since) + source_entity = self._determine_source_entity_type(dtype, output_type, has_before or has_after or has_since) + + timex = slot.timex_str + + value = slot.value + if not value: + return None + + is_lunar = value.is_lunar + mod = value.mod + comment = value.comment + + self._add_resolution_fields_any(result, Constants.TIMEX_KEY, timex) + self._add_resolution_fields_any(result, Constants.COMMENT_KEY, comment) + self._add_resolution_fields_any(result, Constants.MOD_KEY, mod) + self._add_resolution_fields_any(result, Constants.TYPE_KEY, output_type) + self._add_resolution_fields_any(result, Constants.IS_LUNAR_KEY, str(is_lunar).lower() if is_lunar else '') + + future_resolution = value.future_resolution + past_resolution = value.past_resolution + + future = self._generate_from_resolution(dtype, future_resolution, mod) + past = self._generate_from_resolution(dtype, past_resolution, mod) + + future_values = sorted(future.values()) + past_values = sorted(past.values()) + intersect_values = [i for i, j in zip(future_values, past_values) if i == j] + + if len(intersect_values) == len(past_values) and len(intersect_values) == len(future_values): + if past_values: + self._add_resolution_fields_any(result, Constants.RESOLVE_KEY, past) + else: + if past_values: + self._add_resolution_fields_any(result, Constants.RESOLVE_TO_PAST_KEY, past) + if future_values: + self._add_resolution_fields_any(result, Constants.RESOLVE_TO_FUTURE_KEY, future) + + if comment == Constants.AM_PM_GROUP_NAME: + if Constants.RESOLVE_KEY in result: + self._resolve_ampm(result, Constants.RESOLVE_KEY) + else: + self._resolve_ampm(result, Constants.RESOLVE_TO_PAST_KEY) + self._resolve_ampm(result, Constants.RESOLVE_TO_FUTURE_KEY) + + if TimexUtil._has_double_timex(comment): + TimexUtil._process_double_timex( + result, Constants.RESOLVE_TO_FUTURE_KEY, Constants.RESOLVE_TO_PAST_KEY, timex + ) + + for value in result.values(): + if isinstance(value, dict): + new_values = {} + self._add_resolution_fields(new_values, Constants.TIMEX_KEY, timex) + self._add_resolution_fields(new_values, Constants.MOD_KEY, mod) + + self._add_resolution_fields(new_values, Constants.TYPE_KEY, output_type) + self._add_resolution_fields( + new_values, Constants.IS_LUNAR_KEY, str(is_lunar).lower() if is_lunar else '' + ) + self._add_resolution_fields(new_values, Constants.SOURCE_TYPE, source_entity) + + for inner_key in value: + new_values[inner_key] = value[inner_key] + + resolutions.append(new_values) + + if not past and not future: + o = {} + o['timex'] = timex + o['type'] = output_type + o['value'] = 'not resolved' + resolutions.append(o) + + return {'values': resolutions} + + def _add_resolution_fields_any(self, dic: Dict[str, str], key: str, value: object): + if isinstance(value, str): + if value: + dic[key] = value + else: + dic[key] = value + + def _add_resolution_fields(self, dic: [str, str], key: str, value: str): + if value: + dic[key] = value + + def _generate_from_resolution(self, dtype: str, resolution: Dict[str, str], mod: str) -> Dict[str, str]: + result = {} + + if dtype == Constants.SYS_DATETIME_DATETIME: + self.__add_single_date_time_to_resolution(resolution, TimeTypeConstants.DATETIME, mod, result) + elif dtype == Constants.SYS_DATETIME_TIME: + self.__add_single_date_time_to_resolution(resolution, TimeTypeConstants.TIME, mod, result) + elif dtype == Constants.SYS_DATETIME_DATE: + self.__add_single_date_time_to_resolution(resolution, TimeTypeConstants.DATE, mod, result) + + return result + + def __add_single_date_time_to_resolution( + self, resolutions: Dict[str, str], dtype: str, mod: str, result: Dict[str, str] + ): + key = TimeTypeConstants.VALUE + value = resolutions[dtype] + if not value or value.startswith(self.__date_min_value): + return + + if mod: + if mod.startswith(TimeTypeConstants.BEFORE_MOD): + key = TimeTypeConstants.END + elif mod.startswith(TimeTypeConstants.AFTER_MOD): + key = TimeTypeConstants.START + elif mod.startswith(TimeTypeConstants.SINCE_MOD): + key = TimeTypeConstants.START + elif mod.startswith(TimeTypeConstants.UNTIL_MOD): + key = TimeTypeConstants.END + + result[key] = value + + def __add_period_to_resolution( + self, resolutions: Dict[str, str], start_type: str, end_type: str, mod: str, result: Dict[str, str] + ): + start = resolutions.get(start_type, None) + end = resolutions.get(end_type, None) + if mod: + if mod.startswith(TimeTypeConstants.BEFORE_MOD): + if mod.endswith(TimeTypeConstants.LATE_MOD): + result[TimeTypeConstants.END] = end + else: + result[TimeTypeConstants.END] = start + return + if mod.startswith(TimeTypeConstants.AFTER_MOD): + if mod.endswith(TimeTypeConstants.EARLY_MOD): + result[TimeTypeConstants.START] = start + else: + result[TimeTypeConstants.START] = end + return + if mod == TimeTypeConstants.SINCE_MOD: + result[TimeTypeConstants.START] = start + return + + if not (start and end): + return + + if start.startswith(Constants.INVALID_DATE_STRING) or end.startswith(Constants.INVALID_DATE_STRING): + return + + result[TimeTypeConstants.START] = start + result[TimeTypeConstants.END] = end + + def _resolve_ampm(self, values_map: Dict[str, str], key_name: str): + if key_name not in values_map: + return + resolution = values_map[key_name] + if Constants.TIMEX_KEY not in values_map: + return + timex = values_map[Constants.TIMEX_KEY] + values_map.pop(key_name, None) + values_map[key_name + Constants.AM_GROUP_NAME] = resolution + + resolution_pm = {} + if values_map[Constants.TYPE_KEY] == Constants.SYS_DATETIME_TIME: + resolution_pm[TimeTypeConstants.VALUE] = DateTimeFormatUtil.to_pm(resolution[TimeTypeConstants.VALUE]) + resolution_pm[Constants.TIMEX_KEY] = DateTimeFormatUtil.to_pm(timex) + elif values_map[Constants.TYPE_KEY] == Constants.SYS_DATETIME_DATETIME: + split_value = resolution[TimeTypeConstants.VALUE].split(' ') + resolution_pm[TimeTypeConstants.VALUE] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' + resolution_pm[Constants.TIMEX_KEY] = DateTimeFormatUtil.all_str_to_pm(timex) + elif values_map[Constants.TYPE_KEY] == Constants.SYS_DATETIME_TIMEPERIOD: + if TimeTypeConstants.START in resolution: + resolution_pm[TimeTypeConstants.START] = DateTimeFormatUtil.to_pm(resolution[TimeTypeConstants.START]) + if TimeTypeConstants.END in resolution: + resolution_pm[TimeTypeConstants.END] = DateTimeFormatUtil.to_pm(resolution[TimeTypeConstants.END]) + resolution_pm[Constants.TIMEX_KEY] = DateTimeFormatUtil.all_str_to_pm(timex) + elif values_map[Constants.TYPE_KEY] == Constants.SYS_DATETIME_DATETIMEPERIOD: + if TimeTypeConstants.START in resolution: + split_value = resolution[TimeTypeConstants.START].split(' ') + resolution_pm[TimeTypeConstants.START] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' + if TimeTypeConstants.END in resolution: + split_value = resolution[TimeTypeConstants.END].split(' ') + resolution_pm[TimeTypeConstants.END] = f'{split_value[0]} {DateTimeFormatUtil.to_pm(split_value[1])}' + resolution_pm[Constants.TIMEX_KEY] = DateTimeFormatUtil.all_str_to_pm(timex) + values_map[key_name + Constants.PM_GROUP_NAME] = resolution_pm diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_set.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_set.py deleted file mode 100644 index 6f79d71328..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_set.py +++ /dev/null @@ -1,454 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from abc import ABC, abstractmethod -from typing import List, Optional, Pattern, Dict -from datetime import datetime -import regex - -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import ExtractResult -from .constants import Constants, TimeTypeConstants -from .extractors import DateTimeExtractor -from .parsers import DateTimeParser, DateTimeParseResult -from .utilities import Token, merge_all_tokens, DateTimeResolutionResult -from .base_duration import BaseDurationParser -from .base_timeperiod import BaseTimePeriodParser -from .base_time import BaseTimeParser -from .base_date import BaseDateParser -from .base_datetime import BaseDateTimeParser, MatchedTimex -from .base_dateperiod import BaseDatePeriodParser -from .base_datetimeperiod import BaseDateTimePeriodParser - - -class SetExtractorConfiguration(ABC): - @property - @abstractmethod - def last_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def each_prefix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def periodic_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def each_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def each_day_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def before_each_day_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def set_week_day_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def set_each_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def duration_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def time_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def date_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def date_time_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def date_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def time_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def date_time_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - -class BaseSetExtractor(DateTimeExtractor): - @property - def extractor_type_name(self) -> str: - return Constants.SYS_DATETIME_SET - - def __init__(self, config: SetExtractorConfiguration): - self.config = config - - def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: - if reference is None: - reference = datetime.now() - - tokens: List[Token] = list() - tokens.extend(self.match_each_unit(source)) - tokens.extend(self.match_periodic(source)) - tokens.extend(self.match_each_duration(source, reference)) - tokens.extend(self.time_everyday(source, reference)) - tokens.extend(self.match_each( - self.config.date_extractor, source, reference)) - tokens.extend(self.match_each( - self.config.time_extractor, source, reference)) - tokens.extend(self.match_each( - self.config.date_time_extractor, source, reference)) - tokens.extend(self.match_each( - self.config.date_period_extractor, source, reference)) - tokens.extend(self.match_each( - self.config.time_period_extractor, source, reference)) - tokens.extend(self.match_each( - self.config.date_time_period_extractor, source, reference)) - result = merge_all_tokens(tokens, source, self.extractor_type_name) - return result - - def match_each_unit(self, source: str) -> List[Token]: - for match in regex.finditer(self.config.each_unit_regex, source): - yield Token(match.start(), match.end()) - - def match_periodic(self, source: str) -> List[Token]: - for match in regex.finditer(self.config.periodic_regex, source): - yield Token(match.start(), match.end()) - - def match_each_duration(self, source: str, reference: datetime) -> List[Token]: - for extract_result in self.config.duration_extractor.extract(source, reference): - if regex.search(self.config.last_regex, extract_result.text): - continue - - before_str = source[0:extract_result.start] - match = regex.search(self.config.each_prefix_regex, before_str) - if match: - yield Token(match.start(), extract_result.start + extract_result.length) - - def time_everyday(self, source: str, reference: datetime) -> List[Token]: - for extract_result in self.config.time_extractor.extract(source, reference): - after_str = source[extract_result.start + extract_result.length:] - if not after_str and self.config.before_each_day_regex is not None: - before_str = source[0:extract_result.start] - before_match = regex.search( - self.config.before_each_day_regex, before_str) - if before_match: - yield Token(before_match.start(), extract_result.start + extract_result.length) - else: - after_match = regex.search( - self.config.each_day_regex, after_str) - if after_match: - yield Token( - extract_result.start, - extract_result.start + extract_result.length + len(after_match.group())) - - def match_each(self, extractor: DateTimeExtractor, source: str, reference: datetime) -> List[Token]: - for match in regex.finditer(self.config.set_each_regex, source): - trimmed_source = source[0:match.start()] + source[match.end():] - - for extract_result in extractor.extract(trimmed_source, reference): - if extract_result.start <= match.start() < extract_result.start + extract_result.length: - yield Token(extract_result.start, extract_result.start + extract_result.length + len(match.group())) - - for match in regex.finditer(self.config.set_week_day_regex, source): - trimmed_source = source[0:match.start()] \ - + RegExpUtility.get_group(match, Constants.WEEKDAY_GROUP_NAME) + source[match.end():] - - for extract_result in extractor.extract(trimmed_source, reference): - if extract_result.start <= match.start() and\ - RegExpUtility.get_group(match, Constants.WEEKDAY_GROUP_NAME) in extract_result.text: - length = extract_result.length + 1 - prefix = RegExpUtility.get_group(match, Constants.PREFIX_GROUP_NAME) - if prefix: - length += len(prefix) - - yield Token(extract_result.start, extract_result.start + length) - - -class SetParserConfiguration: - @property - @abstractmethod - def duration_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def duration_parser(self) -> BaseDurationParser: - raise NotImplementedError - - @property - @abstractmethod - def time_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def time_parser(self) -> BaseTimeParser: - raise NotImplementedError - - @property - @abstractmethod - def date_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def date_parser(self) -> BaseDateParser: - raise NotImplementedError - - @property - @abstractmethod - def date_time_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def date_time_parser(self) -> BaseDateTimeParser: - raise NotImplementedError - - @property - @abstractmethod - def date_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def date_period_parser(self) -> BaseDatePeriodParser: - raise NotImplementedError - - @property - @abstractmethod - def time_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def time_period_parser(self) -> BaseTimePeriodParser: - raise NotImplementedError - - @property - @abstractmethod - def date_time_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - - @property - @abstractmethod - def date_time_period_parser(self) -> BaseDateTimePeriodParser: - raise NotImplementedError - - @property - @abstractmethod - def unit_map(self) -> Dict[str, str]: - raise NotImplementedError - - @property - @abstractmethod - def each_prefix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def periodic_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def each_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def each_day_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def set_week_day_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def set_each_regex(self) -> Pattern: - raise NotImplementedError - - @abstractmethod - def get_matched_daily_timex(self, text: str) -> MatchedTimex: - raise NotImplementedError - - @abstractmethod - def get_matched_unit_timex(self, text: str) -> MatchedTimex: - raise NotImplementedError - - -class BaseSetParser(DateTimeParser): - @property - def parser_type_name(self) -> str: - return Constants.SYS_DATETIME_SET - - def __init__(self, config: SetParserConfiguration): - self.config = config - - def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: - if reference is None: - reference = datetime.now() - - result = DateTimeParseResult(source) - - if source.type is self.parser_type_name: - inner_result = self.parse_each_unit(source.text) - - if not inner_result.success: - inner_result = self.parse_each_duration(source.text, reference) - - if not inner_result.success: - inner_result = self.parser_time_everyday( - source.text, reference) - - # NOTE: Please do not change the order of following function - # datetimeperiod>dateperiod>timeperiod>datetime>date>time - if not inner_result.success: - inner_result = self.parse_each(self.config.date_time_period_extractor, - self.config.date_time_period_parser, source.text, reference) - if not inner_result.success: - inner_result = self.parse_each(self.config.date_period_extractor, - self.config.date_period_parser, source.text, reference) - if not inner_result.success: - inner_result = self.parse_each(self.config.time_period_extractor, - self.config.time_period_parser, source.text, reference) - if not inner_result.success: - inner_result = self.parse_each(self.config.date_time_extractor, - self.config.date_time_parser, source.text, reference) - if not inner_result.success: - inner_result = self.parse_each(self.config.date_extractor, - self.config.date_parser, source.text, reference) - if not inner_result.success: - inner_result = self.parse_each(self.config.time_extractor, - self.config.time_parser, source.text, reference) - - if inner_result.success: - inner_result.future_resolution[TimeTypeConstants.SET] = inner_result.future_value - inner_result.past_resolution[TimeTypeConstants.SET] = inner_result.past_value - result.value = inner_result - result.timex_str = inner_result.timex if inner_result is not None else '' - result.resolution_str = '' - - return result - - def parse_each_unit(self, source: str) -> DateTimeResolutionResult: - result = DateTimeResolutionResult() - # handle "daily", "weekly" - match = regex.match(self.config.periodic_regex, source) - if match: - get_matched_daily_timex = self.config.get_matched_daily_timex( - source) - if not get_matched_daily_timex.matched: - return result - - result.timex = get_matched_daily_timex.timex - result.future_value = result.past_value = 'Set: ' + result.timex - result.success = True - - # handle "each month" - match = regex.match(self.config.each_unit_regex, source) - if match and len(match.group()) == len(source): - source_unit = RegExpUtility.get_group(match, Constants.UNIT) - if source_unit and source_unit in self.config.unit_map: - get_matched_unit_timex = self.config.get_matched_unit_timex( - source_unit) - if not get_matched_unit_timex.matched: - return result - - if RegExpUtility.get_group(match, Constants.OTHER): - get_matched_unit_timex = MatchedTimex( - matched=get_matched_unit_timex.matched, timex=get_matched_unit_timex.timex.replace('1', '2')) - - result.timex = get_matched_unit_timex.timex - result.future_value = result.past_value = 'Set: ' + result.timex - result.success = True - - return result - - def parse_each_duration(self, source: str, reference: datetime) -> DateTimeResolutionResult: - result = DateTimeResolutionResult() - ers = self.config.duration_extractor.extract(source, reference) - if len(ers) != 1 or source[ers[0].start+ers[0].length:]: - return result - - before_str = source[0:ers[0].start] - matches = regex.match(self.config.each_prefix_regex, before_str) - if matches: - pr = self.config.duration_parser.parse(ers[0], datetime.now()) - result.timex = pr.timex_str - result.future_value = result.past_value = 'Set: ' + pr.timex_str - result.success = True - - return result - - def parser_time_everyday(self, source: str, reference: datetime) -> DateTimeResolutionResult: - result = DateTimeResolutionResult() - ers = self.config.time_extractor.extract(source, reference) - if len(ers) != 1: - return result - - after_str = source.replace(ers[0].text, '') - matches = regex.match(self.config.each_day_regex, after_str) - if matches: - pr = self.config.time_parser.parse(ers[0], datetime.now()) - result.timex = pr.timex_str - result.future_value = result.past_value = 'Set: ' + result.timex - result.success = True - - return result - - def parse_each(self, extractor: DateTimeExtractor, parser: DateTimeParser, - source: str, reference: datetime) -> DateTimeResolutionResult: - result = DateTimeResolutionResult() - success = False - er: List[ExtractResult] = list() - - match = regex.search(self.config.set_each_regex, source) - if match: - trimmed_text = source[0:match.start()] + source[match.end():] - er = extractor.extract(trimmed_text, reference) - if len(er) == 1 and er[0].length == len(trimmed_text): - success = True - - match = regex.search(self.config.set_week_day_regex, source) - if match: - trimmed_text = source[0:match.start()]\ - + RegExpUtility.get_group(match, Constants.WEEKDAY_GROUP_NAME) + source[match.end():] - er = extractor.extract(trimmed_text, reference) - if len(er) == 1 and er[0].length == len(trimmed_text): - success = True - - if success: - pr = parser.parse(er[0]) - result.timex = pr.timex_str - result.future_value = 'Set: ' + pr.timex_str - result.past_value = 'Set: ' + pr.timex_str - result.success = True - - return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_time.py index b746dc830f..90bf5b0e6e 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_time.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_time.py @@ -2,25 +2,22 @@ # Licensed under the MIT License. from abc import abstractmethod -from typing import List, Optional, Pattern, Dict, Match from datetime import datetime +from typing import Dict, List, Match, Optional, Pattern + import regex -from recognizers_text.utilities import RegExpUtility from recognizers_text.extractor import ExtractResult +from recognizers_text.utilities import RegExpUtility + from .constants import Constants, TimeTypeConstants from .extractors import DateTimeExtractor from .parsers import DateTimeParser, DateTimeParseResult -from .utilities import DateTimeOptionsConfiguration, DateTimeOptions, merge_all_tokens, TimeZoneUtility, RegExpUtility +from .utilities import DateTimeOptionsConfiguration, RegExpUtility, merge_all_tokens class TimeExtractorConfiguration(DateTimeOptionsConfiguration): - @property - @abstractmethod - def time_zone_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - @property @abstractmethod def time_regex_list(self) -> List[Pattern]: @@ -62,18 +59,13 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult result = merge_all_tokens(tokens, source, self.extractor_type_name) - if (self.config.options & DateTimeOptions.ENABLE_PREVIEW) != 0: - result = TimeZoneUtility().merge_time_zones( - result, - self.config.time_zone_extractor.extract(source, reference), - source - ) - return result def before_after_regex_match(self, source: str) -> []: from recognizers_date_time import DateTimeOptions + from .utilities import Token + result: List[Token] = list() if (self.config.options & DateTimeOptions.CALENDAR) != 0: @@ -82,8 +74,9 @@ def before_after_regex_match(self, source: str) -> []: if before_after_regex.search(source): matches: Match = before_after_regex.match(source) for match in matches: - result.append(Token(source.index(match.group()), source.index(match.group()) + - (match.end() - match.start()))) + result.append( + Token(source.index(match.group()), source.index(match.group()) + (match.end() - match.start())) + ) return result @@ -96,10 +89,13 @@ def lth_check(match: Match) -> bool: if match.re.groupindex.keys().__contains__('lth'): lth = match.group('lth') - return (lth is None) or (len(lth) != len(match_val) and not (len(match_val) == len(lth) + 1 and match_val.endswith(' '))) + return (lth is None) or ( + len(lth) != len(match_val) and not (len(match_val) == len(lth) + 1 and match_val.endswith(' ')) + ) def basic_regex_match(self, source: str) -> []: from .utilities import Token + result: List[Token] = list() for pattern in self.config.time_regex_list: @@ -114,9 +110,9 @@ def basic_regex_match(self, source: str) -> []: def at_regex_match(self, source: str) -> []: from .utilities import Token + result: List[Token] = list() - matches = list(filter(lambda x: x.group(), - regex.finditer(self.config.at_regex, source))) + matches = list(filter(lambda x: x.group(), regex.finditer(self.config.at_regex, source))) for match in matches: if match.end() < len(source) and source[match.end()] == '%': @@ -127,17 +123,18 @@ def at_regex_match(self, source: str) -> []: def specials_regex_match(self, source: str) -> []: from .utilities import Token + result: List[Token] = list() if self.config.ish_regex: - matches = list(filter(lambda x: x.group(), - regex.finditer(self.config.ish_regex, source))) + matches = list(filter(lambda x: x.group(), regex.finditer(self.config.ish_regex, source))) result.extend(map(lambda x: Token(x.start(), x.end()), matches)) return result class AdjustParams: - def __init__(self, hour: int = 0, minute: int = 0, has_minute: bool = False, - has_am: bool = False, has_pm: bool = False): + def __init__( + self, hour: int = 0, minute: int = 0, has_minute: bool = False, has_am: bool = False, has_pm: bool = False + ): self.hour = hour self.minute = minute self.has_minute = has_minute @@ -171,11 +168,6 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self): raise NotImplementedError - @property - @abstractmethod - def time_zone_parser(self) -> DateTimeParser: - raise NotImplementedError - @abstractmethod def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): raise NotImplementedError @@ -195,6 +187,7 @@ def __init__(self, config: TimeParserConfiguration): def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: from .utilities import DateTimeFormatUtil + if reference is None: reference = datetime.now() @@ -206,9 +199,11 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self.internal_parser(source_text, reference) if inner_result.success: inner_result.future_resolution[TimeTypeConstants.TIME] = DateTimeFormatUtil.format_time( - inner_result.future_value) + inner_result.future_value + ) inner_result.past_resolution[TimeTypeConstants.TIME] = DateTimeFormatUtil.format_time( - inner_result.past_value) + inner_result.past_value + ) result.value = inner_result result.timex_str = inner_result.timex if inner_result is not None else '' result.resolution_str = '' @@ -221,12 +216,12 @@ def internal_parser(self, source: str, reference: datetime): def parse_basic_regex_match(self, source: str, reference: datetime): from .utilities import DateTimeResolutionResult, DateUtils + source = source.strip().lower() offset = 0 match = regex.search(self.config.at_regex, source) if not match: - match = regex.search(self.config.at_regex, - self.config.time_token_prefix + source) + match = regex.search(self.config.at_regex, self.config.time_token_prefix + source) offset = len(self.config.time_token_prefix) if match is not None and match.start() == offset and match.group() == source: @@ -242,7 +237,8 @@ def parse_basic_regex_match(self, source: str, reference: datetime): result.timex = f'T{hour:02d}' result.future_value = DateUtils.safe_create_from_min_value( - reference.year, reference.month, reference.day, hour, 0, 0) + reference.year, reference.month, reference.day, hour, 0, 0 + ) result.past_value = result.future_value result.success = True return result @@ -315,9 +311,8 @@ def match_to_time(self, match: Match, reference: datetime): if hour is None: return result else: - hour = int(hour_str) if hour_str.isnumeric( - ) else self.config.numbers.get(hour_str, None) - if not hour: + hour = int(hour_str) if hour_str.isnumeric() else self.config.numbers.get(hour_str, None) + if hour is None: return result # get minute min_str = RegExpUtility.get_group(match, Constants.MINUTE_GROUP_NAME) @@ -344,15 +339,19 @@ def match_to_time(self, match: Match, reference: datetime): # adjust by desc string desc_str = RegExpUtility.get_group(match, Constants.DESC_GROUP_NAME).lower() - if any([regex.search(self.config.utility_configuration.am_desc_regex, desc_str), - regex.search(self.config.utility_configuration.am_pm_desc_regex, desc_str)]) or RegExpUtility.get_group( - match, Constants.IMPLICIT_AM_GROUP_NAME): + if any( + [ + regex.search(self.config.utility_configuration.am_desc_regex, desc_str), + regex.search(self.config.utility_configuration.am_pm_desc_regex, desc_str), + ] + ) or RegExpUtility.get_group(match, Constants.IMPLICIT_AM_GROUP_NAME): if hour >= 12: hour -= 12 if regex.search(self.config.utility_configuration.am_pm_desc_regex, desc_str) is None: has_am = True - elif regex.search(self.config.utility_configuration.pm_desc__regex, - desc_str) is not None or RegExpUtility.get_group(match, Constants.IMPLICIT_PM_GROUP_NAME): + elif regex.search( + self.config.utility_configuration.pm_desc__regex, desc_str + ) is not None or RegExpUtility.get_group(match, Constants.IMPLICIT_PM_GROUP_NAME): if hour < 12: hour += 12 has_pm = True diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_timeperiod.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_timeperiod.py index 6943be17ff..ad299f0785 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_timeperiod.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_timeperiod.py @@ -2,19 +2,30 @@ # Licensed under the MIT License. from abc import abstractmethod -from typing import List, Optional, Pattern, Dict, Match -from datetime import datetime, timedelta from collections import namedtuple +from datetime import datetime, timedelta +from typing import Dict, List, Optional, Pattern + import regex -from recognizers_text.utilities import RegExpUtility, QueryProcessor -from recognizers_text.extractor import Extractor, ExtractResult, Metadata from recognizers_date_time.date_time.base_time import BaseTimeExtractor, BaseTimeParser +from recognizers_text.extractor import Extractor, ExtractResult, Metadata +from recognizers_text.utilities import QueryProcessor, RegExpUtility + from .constants import Constants, TimeTypeConstants from .extractors import DateTimeExtractor from .parsers import DateTimeParser, DateTimeParseResult -from .utilities import Token, merge_all_tokens, DateTimeResolutionResult, \ - DateTimeUtilityConfiguration, DateTimeFormatUtil, ResolutionStartEnd, DateTimeOptionsConfiguration, DateTimeOptions +from .utilities import ( + DateTimeFormatUtil, + DateTimeOptions, + DateTimeOptionsConfiguration, + DateTimeResolutionResult, + DateTimeUtilityConfiguration, + ResolutionStartEnd, + Token, + merge_all_tokens, +) + MatchedIndex = namedtuple('MatchedIndex', ['matched', 'index']) @@ -78,11 +89,6 @@ def check_both_before_after(self) -> bool: def is_connector_token(self, middle): raise NotImplementedError - @property - @abstractmethod - def time_zone_extractor(self) -> DateTimeExtractor: - raise NotImplementedError - class BaseTimePeriodExtractor(DateTimeExtractor): @property @@ -121,11 +127,12 @@ def match_pure_number_cases(self, text): matches = regexp.search(text) for match in matches: - after_str = text[text.index(match.group()) + (match.end() - match.start()):] + after_str = text[text.index(match.group()) + (match.end() - match.start()) :] ending_match = self.config.general_ending_regex.search(after_str) if ending_match: - ret.append(Token(text.index(match.group()), - text.index(match.group()) + (match.end() - match.start()))) + ret.append( + Token(text.index(match.group()), text.index(match.group()) + (match.end() - match.start())) + ) return ret def match_simple_cases(self, source: str) -> List[Token]: @@ -138,8 +145,9 @@ def match_simple_cases(self, source: str) -> List[Token]: for match in matches: # Cases like "from 10:30 to 11", don't necessarily need "am/pm" - if RegExpUtility.get_group(match, Constants.MINUTE_GROUP_NAME) or\ - RegExpUtility.get_group(match, Constants.SECOND_GROUP_NAME): + if RegExpUtility.get_group(match, Constants.MINUTE_GROUP_NAME) or RegExpUtility.get_group( + match, Constants.SECOND_GROUP_NAME + ): # Cases like "from 3:30 to 4" should be supported # Cases like "from 3:30 to 5 on 1/1/2015" should be supported @@ -151,21 +159,28 @@ def match_simple_cases(self, source: str) -> List[Token]: end_with_valid_token = True else: - after_str = source[source.index(match.group()) + (match.end() - match.start()):] + after_str = source[source.index(match.group()) + (match.end() - match.start()) :] end_with_general_endings = self.config.general_ending_regex.match(after_str) end_with_am_pm = RegExpUtility.get_group(match, Constants.RIGHT_AM_PM_GROUP_NAME) - if end_with_general_endings or end_with_am_pm or\ - after_str.lstrip().startswith(self.config.token_before_date): + if ( + end_with_general_endings + or end_with_am_pm + or after_str.lstrip().startswith(self.config.token_before_date) + ): end_with_valid_token = True elif (self.config.options & DateTimeOptions.ENABLE_PREVIEW) != 0: # When TimeZone be migrated enable it end_with_valid_token = False if end_with_valid_token: - result.append(Token(source.index(match.group()), source.index(match.group()) + - (match.end() - match.start()))) + result.append( + Token( + source.index(match.group()), + source.index(match.group()) + (match.end() - match.start()), + ) + ) else: # Is there "pm" or "am"? match_pm_str = RegExpUtility.get_group(match, Constants.PM_GROUP_NAME) @@ -174,24 +189,26 @@ def match_simple_cases(self, source: str) -> List[Token]: # Check "pm", "am" if match_pm_str or match_am_str or desc_str: - result.append(Token(source.index(match.group()), source.index(match.group()) + - (match.end() - match.start()))) + result.append( + Token( + source.index(match.group()), + source.index(match.group()) + (match.end() - match.start()), + ) + ) else: - after_str = source[source.index(match.group()) + (match.end() - match.start()):] + after_str = source[source.index(match.group()) + (match.end() - match.start()) :] # When TimeZone be migrated enable it if (self.config.options & DateTimeOptions.ENABLE_PREVIEW) != 0: - result.append(Token(source.index(match.group()), - source.index(match.group()) + (match.end() - match.start()))) + result.append( + Token( + source.index(match.group()), + source.index(match.group()) + (match.end() - match.start()), + ) + ) return result - def starts_with_time_zone(self, after_text: str): - # it needs TimeZone - starts_with_time_zone = False - - time_zone_extract_results = self.config.time - def merge_two_time_points(self, source: str, reference: datetime) -> List[Token]: result: List[Token] = list() time_extract_results = self.config.single_time_extractor.extract(source, reference) @@ -207,7 +224,7 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] if num.start + num.length == len(source): ending_number = True else: - after = source[num.start + num.length:] + after = source[num.start + num.length :] if regex.search(self.config.general_ending_regex, after) is not None: ending_number = True if ending_number: @@ -226,9 +243,10 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] if j >= len(time_extract_results): break # check connector string - middle = source[num_end:time_extract_results[j].start] - if RegExpUtility.exact_match(self.config.till_regex, middle, True).success or\ - self.config.is_connector_token(middle.strip()): + middle = source[num_end : time_extract_results[j].start] + if RegExpUtility.exact_match( + self.config.till_regex, middle, True + ).success or self.config.is_connector_token(middle.strip()): time_numbers.append(num_extract_results[i]) i += 1 @@ -243,7 +261,7 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] # merge "{TimePoint} to {TimePoint}", "between {TimePoint} and {TimePoint}" i = 0 - while i < len(time_extract_results)-1: + while i < len(time_extract_results) - 1: middle_begin = time_extract_results[i].start + time_extract_results[i].length middle_end = time_extract_results[i + 1].start middle: str = source[middle_begin:middle_end].strip().lower() @@ -256,21 +274,18 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] # handle "from" before = source[0:period_begin].strip().lower() - after = source[period_end: len(source) - period_end].strip().lower() - from_index: MatchedIndex = self.config.get_from_token_index( - before) + after = source[period_end : len(source) - period_end].strip().lower() + from_index: MatchedIndex = self.config.get_from_token_index(before) if from_index.matched: period_begin = from_index.index # handle "between" - between_index: MatchedIndex = self.config.get_between_token_index( - before) + between_index: MatchedIndex = self.config.get_between_token_index(before) if between_index.matched: period_begin = between_index.index # handle "between" in afterStr - after_index: MatchedIndex = self.config.get_between_token_index( - after) + after_index: MatchedIndex = self.config.get_between_token_index(after) if after_index.matched: period_end = after_index.index @@ -285,8 +300,7 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] # handle "between" before = source[0:period_begin].strip().lower() - between_index: MatchedIndex = self.config.get_between_token_index( - before) + between_index: MatchedIndex = self.config.get_between_token_index(before) if between_index.matched: period_begin = between_index.index result.append(Token(period_begin, period_end)) @@ -294,7 +308,7 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] continue # handle "between...and..." case when "between" follows the datepoints - after_str = source[period_end: + len(source) - period_end] + after_str = source[period_end : +len(source) - period_end] after_index = self.config.get_between_token_index(after_str) if self.config.check_both_before_after and after_index.matched: period_end += after_index.index @@ -318,14 +332,17 @@ def match_time_of_day(self, source: str) -> List[Token]: meta = Metadata() meta.is_mealtime = True - result.append(Token(start=source.index(match.group()), - end=source.index(match.group()) + (match.end() - match.start()), - metadata=meta)) + result.append( + Token( + start=source.index(match.group()), + end=source.index(match.group()) + (match.end() - match.start()), + metadata=meta, + ) + ) return result -MatchedTimeRegex = namedtuple( - 'MatchedTimeRegex', ['matched', 'timex', 'begin_hour', 'end_hour', 'end_min']) +MatchedTimeRegex = namedtuple('MatchedTimeRegex', ['matched', 'timex', 'begin_hour', 'end_hour', 'end_min']) class TimePeriodParserConfiguration: @@ -344,11 +361,6 @@ def time_parser(self) -> BaseTimeParser: def integer_extractor(self) -> Extractor: raise NotImplementedError - @property - @abstractmethod - def time_zone_parser(self) -> DateTimeParser: - raise NotImplementedError - @property @abstractmethod def pure_number_from_to_regex(self) -> Pattern: @@ -413,21 +425,24 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self.parse_simple_cases(source_text, reference) if not inner_result.success: - inner_result = self.merge_two_time_points( - source_text, reference) + inner_result = self.merge_two_time_points(source_text, reference) if not inner_result.success: inner_result = self.parse_time_of_day(source_text, reference) if inner_result.success: inner_result.future_resolution[TimeTypeConstants.START_TIME] = DateTimeFormatUtil.format_time( - inner_result.future_value.start) + inner_result.future_value.start + ) inner_result.future_resolution[TimeTypeConstants.END_TIME] = DateTimeFormatUtil.format_time( - inner_result.future_value.end) + inner_result.future_value.end + ) inner_result.past_resolution[TimeTypeConstants.START_TIME] = DateTimeFormatUtil.format_time( - inner_result.past_value.start) + inner_result.past_value.start + ) inner_result.past_resolution[TimeTypeConstants.END_TIME] = DateTimeFormatUtil.format_time( - inner_result.past_value.end) + inner_result.past_value.end + ) value = inner_result result = DateTimeParseResult(source) @@ -456,8 +471,7 @@ def parse_pure_numbers(self, source: str, reference: datetime) -> DateTimeResolu match = regex.search(self.config.pure_number_from_to_regex, source) if not match: - match = regex.search( - self.config.pure_number_between_and_regex, source) + match = regex.search(self.config.pure_number_between_and_regex, source) if not match or match.start() != 0: return result @@ -488,9 +502,11 @@ def parse_pure_numbers(self, source: str, reference: datetime) -> DateTimeResolu if not left_desc: right_am_valid: bool = right_desc and regex.search( - self.config.utility_configuration.am_desc_regex, right_desc.lower()) + self.config.utility_configuration.am_desc_regex, right_desc.lower() + ) right_pm_valid: bool = right_desc and regex.search( - self.config.utility_configuration.pm_desc__regex, right_desc.lower()) + self.config.utility_configuration.pm_desc__regex, right_desc.lower() + ) if am_str or right_am_valid: if end_hour >= 12: @@ -526,10 +542,8 @@ def parse_pure_numbers(self, source: str, reference: datetime) -> DateTimeResolu result.timex = f'({begin},{end},PT{difference}H)' result.future_value = ResolutionStartEnd() result.past_value = ResolutionStartEnd() - result.future_value.start = datetime( - year, month, day) + timedelta(hours=begin_hour) - result.future_value.end = datetime( - year, month, day) + timedelta(hours=end_hour) + result.future_value.start = datetime(year, month, day) + timedelta(hours=begin_hour) + result.future_value.end = datetime(year, month, day) + timedelta(hours=end_hour) result.past_value.start = result.future_value.start result.past_value.end = result.future_value.end result.success = True @@ -546,8 +560,7 @@ def parse_specific_time(self, source: str, reference: datetime) -> DateTimeResol match = regex.search(self.config.specific_time_from_to_regex, source) if not match: - match = regex.search( - self.config.specific_time_between_and_regex, source) + match = regex.search(self.config.specific_time_between_and_regex, source) if not match or match.start() != 0: return result @@ -746,7 +759,7 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes middle_end = time_extract_results.start - middle_begin # check if the middle string between the time point and the valid number is a connect string. - middle_str = source[middle_begin:middle_begin + middle_end] + middle_str = source[middle_begin : middle_begin + middle_end] if regex.search(self.config.till_regex, middle_str) is not None: num.type = Constants.SYS_DATETIME_TIME extract_results.append(num) @@ -772,16 +785,22 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes begin_time: datetime = pr1.value.future_value end_time: datetime = pr2.value.future_value - if am_pm_str2 and am_pm_str2.endswith(Constants.AM_PM_GROUP_NAME) and\ - end_time <= begin_time < end_time + timedelta(hours=12): + if ( + am_pm_str2 + and am_pm_str2.endswith(Constants.AM_PM_GROUP_NAME) + and end_time <= begin_time < end_time + timedelta(hours=12) + ): end_time: datetime = end_time + timedelta(hours=12) pr2.value.future_value = end_time pr2.timex_str = f'T{end_time.hour}' if end_time.minute > 0: pr2.timex_str = f'{pr2.timex_str}:{end_time.minute}' - if am_pm_str1 and am_pm_str1.endswith(Constants.AM_PM_GROUP_NAME) and\ - end_time > begin_time + timedelta(hours=12): + if ( + am_pm_str1 + and am_pm_str1.endswith(Constants.AM_PM_GROUP_NAME) + and end_time > begin_time + timedelta(hours=12) + ): begin_time: datetime = begin_time + timedelta(hours=12) pr1.value.future_value = begin_time pr1.timex_str = f'T{begin_time.hour}' @@ -791,10 +810,8 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes if end_time < begin_time: end_time = end_time + timedelta(days=1) - hours = QueryProcessor.float_or_int( - (end_time - begin_time).total_seconds() // 3600) - minutes = QueryProcessor.float_or_int( - (end_time - begin_time).total_seconds() / 60 % 60) + hours = QueryProcessor.float_or_int((end_time - begin_time).total_seconds() // 3600) + minutes = QueryProcessor.float_or_int((end_time - begin_time).total_seconds() / 60 % 60) hours_str = f'{hours}H' if hours > 0 else '' minutes_str = f'{minutes}M' if 0 < minutes < 60 else '' @@ -802,8 +819,12 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes result.future_value = ResolutionStartEnd(begin_time, end_time) result.past_value = ResolutionStartEnd(begin_time, end_time) result.success = True - if am_pm_str1 and am_pm_str1.endswith(Constants.AM_PM_GROUP_NAME) and am_pm_str2 and\ - am_pm_str2.endswith(Constants.AM_PM_GROUP_NAME): + if ( + am_pm_str1 + and am_pm_str1.endswith(Constants.AM_PM_GROUP_NAME) + and am_pm_str2 + and am_pm_str2.endswith(Constants.AM_PM_GROUP_NAME) + ): result.comment = Constants.AM_PM_GROUP_NAME result.sub_date_time_entities = [pr1, pr2] @@ -845,7 +866,7 @@ def parse_time_of_day(self, source: str, reference: datetime) -> DateTimeResolut timex=timex_range.timex, begin_hour=timex_range.begin_hour, end_hour=timex_range.begin_hour + 2, - end_min=0 if timex_range.end_min == 59 else timex_range.end_min + end_min=0 if timex_range.end_min == 59 else timex_range.end_min, ) elif has_late: timex_range = MatchedTimeRegex( @@ -853,16 +874,16 @@ def parse_time_of_day(self, source: str, reference: datetime) -> DateTimeResolut timex=timex_range.timex, begin_hour=timex_range.begin_hour + 2, end_hour=timex_range.end_hour, - end_min=timex_range.end_min + end_min=timex_range.end_min, ) result.timex = timex_range.timex result.future_value = ResolutionStartEnd() result.past_value = ResolutionStartEnd() - result.future_value.start = datetime( - year, month, day, timex_range.begin_hour, 0, 0) + result.future_value.start = datetime(year, month, day, timex_range.begin_hour, 0, 0) result.future_value.end = datetime( - year, month, day, timex_range.end_hour, timex_range.end_min, timex_range.end_min) + year, month, day, timex_range.end_hour, timex_range.end_min, timex_range.end_min + ) result.past_value.start = result.future_value.start result.past_value.end = result.future_value.end diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_timezone.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_timezone.py deleted file mode 100644 index 405609eb35..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_timezone.py +++ /dev/null @@ -1,244 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -import regex -from typing import List, Pattern -from abc import abstractmethod -from datetime import datetime -from .utilities import DateTimeOptionsConfiguration, DateTimeResolutionResult, TimeZoneResolutionResult, Token,\ - MatchingUtil, DateUtils -from .parsers import DateTimeParser, DateTimeParseResult -from .datetime_zone_extractor import DateTimeZoneExtractor -from .constants import Constants -from ..resources import TimeZoneDefinitions -from recognizers_text import ExtractResult, RegExpUtility, QueryProcessor -from recognizers_text.matcher.string_matcher import StringMatcher - - -class TimeZoneExtractorConfiguration(DateTimeOptionsConfiguration): - @property - @abstractmethod - def direct_utc_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def timezone_matcher(self): - raise NotImplementedError - - @property - @abstractmethod - def location_time_suffix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def location_matcher(self) -> StringMatcher: - raise NotImplementedError - - @property - @abstractmethod - def ambiguous_timezone_list(self) -> List[str]: - raise NotImplementedError - - -class BaseTimeZoneParser(DateTimeParser): - @property - def parser_type_name(self) -> str: - return Constants.SYS_DATETIME_TIMEZONE - - @property - def time_zone_end_regex(self) -> Pattern: - return self._time_zone_end_regex - - def __init__(self): - self._time_zone_end_regex = RegExpUtility.get_safe_reg_exp( - "time$|timezone$") - - @staticmethod - def compute_minutes(utc_offset: str) -> int: - if len(utc_offset) == 0: - return Constants.INVALID_OFFSET_VALUE - - utc_offset = utc_offset.strip() - - sign = Constants.POSITIVE_SIGN # later than utc, default value - if utc_offset.startswith("+") or utc_offset.startswith("-") or utc_offset.startswith("±"): - if utc_offset.startswith("-"): - sign = Constants.NEGATIVE_SIGN # Earlier than utc 0 - utc_offset = utc_offset[1:].strip() - - hour = minutes = 0 - if ':' in utc_offset: - tokens = list(utc_offset.split(":")) - hour = int(tokens[0]) - minutes = int(tokens[1]) - elif DateUtils.int_try_parse(utc_offset) != 0: - hour, is_parsed = DateUtils.int_try_parse(utc_offset) - minutes = 0 - - if hour > Constants.HALF_DAY_HOUR_COUNT: - return Constants.INVALID_OFFSET_VALUE - - if minutes not in [0, 15, 30, 45, 60]: - return Constants.INVALID_OFFSET_VALUE - - offset_in_minutes = ((hour * 60) + minutes) * sign - - return offset_in_minutes - - def convert_offset_in_mins_to_offset_string(self, offset_mins: int) -> str: - return f'UTC{"+" if offset_mins >= 0 else "-"}{self.convert_mins_to_regular_format(abs(offset_mins))}' - - @staticmethod - def convert_mins_to_regular_format(offset_mins: int) -> str: - tokens = list((str(offset_mins/60)).split(".")) - hour = int(tokens[0]) - min = int(tokens[1]) - return f'{hour}:{min}' - - def normalize_text(self, text: str) -> str: - text = regex.sub(r'\s+', ' ', text) - text = self._time_zone_end_regex.sub('', text) - return text.strip().lower() - - def parse(self, extract_result: ExtractResult, ref_date: datetime = None) -> DateTimeParseResult: - datetime_result = DateTimeParseResult() - datetime_result.start = extract_result.start - datetime_result.length = extract_result.length - datetime_result.text = extract_result.text - datetime_result.type = extract_result.type - - text = extract_result.text - normalized_text = self.normalize_text(text) - match = regex.match(TimeZoneDefinitions.DirectUtcRegex, text) - matched = match.group(2) if match else '' - offset_minutes = self.compute_minutes(matched) - - if offset_minutes != Constants.INVALID_OFFSET_VALUE: - datetime_result.value = self.get_datetime_resolution_result(offset_minutes, text) - datetime_result.resolution_str = f'{Constants.UTC_OFFSET_MINS_KEY}: {offset_minutes}' - elif normalized_text in TimeZoneDefinitions.AbbrToMinMapping and\ - TimeZoneDefinitions.AbbrToMinMapping[normalized_text] != Constants.INVALID_OFFSET_VALUE: - utc_minute_shift = TimeZoneDefinitions.AbbrToMinMapping[normalized_text] - - datetime_result.value = self.get_datetime_resolution_result(utc_minute_shift, text) - datetime_result.resolution_str = f'{Constants.UTC_OFFSET_MINS_KEY}: {utc_minute_shift}' - elif normalized_text in TimeZoneDefinitions.FullToMinMapping and\ - TimeZoneDefinitions.FullToMinMapping[normalized_text] != Constants.INVALID_OFFSET_VALUE: - utc_minute_shift = TimeZoneDefinitions.FullToMinMapping[normalized_text] - - datetime_result.value = self.get_datetime_resolution_result(utc_minute_shift, text) - datetime_result.resolution_str = f'{Constants.UTC_OFFSET_MINS_KEY}: {utc_minute_shift}' - else: - datetime_result.value = DateTimeResolutionResult() - datetime_result.value.success = True - - timezone_resolution = TimeZoneResolutionResult() - timezone_resolution.value = "UTC+XX:XX" - timezone_resolution.utc_offset_mins = Constants.INVALID_OFFSET_VALUE - timezone_resolution.time_zone_text = text - - datetime_result.value.timezone_resolution = timezone_resolution - datetime_result.resolution_str = Constants.UTC_OFFSET_MINS_KEY + ": XX:XX" - - return datetime_result - - def get_datetime_resolution_result(self, offset_mins: int, text: str) -> DateTimeResolutionResult: - datetime_resolution = DateTimeResolutionResult() - datetime_resolution.success = True - - timezone_resolution = TimeZoneResolutionResult() - timezone_resolution.value = self.convert_offset_in_mins_to_offset_string(offset_mins) - timezone_resolution.utc_offset_mins = offset_mins - timezone_resolution.time_zone_text = text - - datetime_resolution.timezone_resolution = timezone_resolution - - return datetime_resolution - - -class BaseTimeZoneExtractor(DateTimeZoneExtractor): - @property - def extractor_type_name(self) -> str: - return Constants.SYS_DATETIME_TIMEZONE - - def __init__(self, config: TimeZoneExtractorConfiguration): - self.config = config - - def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: - from .utilities import merge_all_tokens - tokens = [] - - normalized_text = QueryProcessor.remove_diacritics(source) - - tokens.extend(self.match_timezones(normalized_text)) - tokens.extend(self.match_location_times(normalized_text, tokens)) - - return merge_all_tokens(tokens, source, self.extractor_type_name) - - def remove_ambiguous_time_zone(self, extract_result: List[ExtractResult]) -> List[ExtractResult]: - return [item for item in extract_result if self.config.ambiguous_time_zone_list in item.text] - - def match_location_times(self, text: str, tokens: List[Token]) -> List[Token]: - result: List[Token] = list() - - if not self.config.location_time_suffix_regex: - return result - - time_match = list(regex.finditer(self.config.location_time_suffix_regex, text)) - - # Before calling a Find() in location matcher, check if all the matched suffixes by - # LocationTimeSuffixRegex are already inside tokens extracted by TimeZone matcher. - # If so, don't call the Find() as they have been extracted by TimeZone matcher, otherwise, call it. - is_all_suffix_inside_tokens = True - for match in time_match: - is_inside = False - for token in tokens: - if token.start <= match.start() and token.end >= match.start() + len(match.group()): - is_inside = True - break - - if not is_inside: - is_all_suffix_inside_tokens = False - - if not is_all_suffix_inside_tokens: - break - - if len(time_match) != 0 and not is_all_suffix_inside_tokens: - last_match_index = time_match[len(time_match) - 1].start() - sub_str = text[0:last_match_index] - matches = self.config.location_matcher.find(sub_str) - location_matches = MatchingUtil.remove_sub_matches(matches) - - i = 0 - for match in time_match: - has_city_before = False - while i < len(location_matches) and location_matches[i].end <= match.start(): - has_city_before = True - i += 1 - - if i == len(location_matches): - break - - if has_city_before and location_matches[i - 1].end == match.start(): - result.append(Token(location_matches[i - 1].start, match.start() + len(match.group()))) - if i == len(location_matches): - break - - return result - - def match_timezones(self, text: str) -> List[Token]: - result = [] - - # Direct UTC matches - if self.config.direct_utc_regex: - direct_utc = list(regex.finditer(self.config.direct_utc_regex, text)) - for match in direct_utc: - result.append(Token(match.start(), match.start() + len(match.group()))) - - matches = self.config.timezone_matcher.find(text) - for match in matches: - result.append(Token(match.start, match.start + match.length)) - - return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/__init__.py new file mode 100644 index 0000000000..86f1fda5d0 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/__init__.py @@ -0,0 +1,7 @@ +from .base_configs import * +from .common_configs import * +from .date_extractor_config import * +from .date_parser_config import * +from .merged_parser_config import * +from .time_extractor_config import * +from .time_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/base_configs.py new file mode 100644 index 0000000000..a2dadb70b7 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/base_configs.py @@ -0,0 +1,8 @@ +from recognizers_date_time.date_time.utilities import DateTimeUtilityConfiguration +from recognizers_date_time.resources.catalan_date_time import CatalanDateTime + + +class CatalanDateTimeUtilityConfiguration(DateTimeUtilityConfiguration): + + def __init__(self): + super().__init__(CatalanDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/base_datetime.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/base_datetime.py new file mode 100644 index 0000000000..788256a0c5 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/base_datetime.py @@ -0,0 +1,92 @@ +from datetime import datetime +from typing import List, Match, Optional, Pattern + +import regex + +from recognizers_date_time.date_time.base_datetime import MatchedTimex +from recognizers_date_time.date_time.constants import Constants, TimeTypeConstants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeFormatUtil, + DateTimeResolutionResult, + Token, + merge_all_tokens, +) +from recognizers_date_time.resources.catalan_date_time import CatalanDateTime +from recognizers_text.extractor import ExtractResult +from recognizers_text.utilities import RegExpUtility + + +class MinimalDateTimeExtractor(DateTimeExtractor): + @property + def extractor_type_name(self) -> str: + return Constants.SYS_DATETIME_DATETIME + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + + tokens: List[Token] = list() + tokens.extend(self.basic_regex_match(source)) + + result = merge_all_tokens(tokens, source, self.extractor_type_name) + return result + + # match "now" + def basic_regex_match(self, source: str) -> List[Token]: + tokens: List[Token] = list() + # handle "now" + now_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.NowRegex) + matches: List[Match] = list(regex.finditer(now_regex, source)) + tokens.extend(map(lambda x: Token(x.start(), x.end()), matches)) + return tokens + + +class MinimalDateTimeParser(DateTimeParser): + @property + def parser_type_name(self) -> str: + return Constants.SYS_DATETIME_DATETIME + + def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: + if reference is None: + reference = datetime.now() + + result = DateTimeParseResult(source) + + if source.type is self.parser_type_name: + source_text = source.text.lower() + inner_result = self.parse_basic_regex(source_text, reference) + + if inner_result.success: + inner_result.future_resolution[TimeTypeConstants.DATETIME] = DateTimeFormatUtil.format_date_time( + inner_result.future_value + ) + inner_result.past_resolution[TimeTypeConstants.DATETIME] = DateTimeFormatUtil.format_date_time( + inner_result.past_value + ) + result.value = inner_result + result.timex_str = inner_result.timex if inner_result else '' + result.resolution_str = '' + + return result + + def parse_basic_regex(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + source = source.strip().lower() + + # handle "now" + now_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.NowRegex) + match = regex.search(now_regex, source) + if match and match.start() == 0 and match.group() == source: + matched_now_timex = self.get_matched_now_timex(source, now_regex) + result.timex = matched_now_timex.timex + result.future_value = reference + result.past_value = reference + result.success = matched_now_timex.matched + return result + + def get_matched_now_timex(self, source: str, now_time_regex: Pattern) -> MatchedTimex: + + if RegExpUtility.match_end(now_time_regex, source, True): + return MatchedTimex(True, 'PRESENT_REF') + + return MatchedTimex(False, None) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/common_configs.py new file mode 100644 index 0000000000..82f6369988 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/common_configs.py @@ -0,0 +1,140 @@ +from datetime import datetime +from typing import Dict, List, Pattern + +from recognizers_date_time.date_time.catalan.base_datetime import MinimalDateTimeExtractor, MinimalDateTimeParser +from recognizers_date_time.resources.base_date_time import BaseDateTime +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_number.number.catalan.extractors import ( + CatalanCardinalExtractor, + CatalanIntegerExtractor, + CatalanOrdinalExtractor, +) +from recognizers_number.number.catalan.parsers import CatalanNumberParserConfiguration +from recognizers_text.extractor import ExtractResult + +from ...resources.catalan_date_time import CatalanDateTime +from ..base_configs import DateTimeUtilityConfiguration +from ..base_date import BaseDateExtractor, BaseDateParser, DateExtractorConfiguration +from ..base_minimal_configs import MinimalBaseDateParserConfiguration +from ..base_time import BaseTimeExtractor, BaseTimeParser +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser +from .base_configs import CatalanDateTimeUtilityConfiguration +from .date_extractor_config import CatalanDateExtractorConfiguration +from .date_parser_config import CatalanDateParserConfiguration +from .time_extractor_config import CatalanTimeExtractorConfiguration +from .time_parser_config import CatalanTimeParserConfiguration + + +class CatalanBaseDateExtractor(BaseDateExtractor): + + def __init__(self, config: DateExtractorConfiguration): + super().__init__(config) + + def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: + from ..utilities import merge_all_tokens + + if reference is None: + reference = datetime.now() + + tokens = [] + tokens.extend(self.basic_regex_match(source)) + tokens.extend(self.implicit_date(source)) + tokens.extend(self.number_with_month(source, reference)) + + result = merge_all_tokens(tokens, source, self.extractor_type_name) + return result + + +class CatalanCommonDateTimeParserConfiguration(MinimalBaseDateParserConfiguration): + @property + def check_both_before_after(self) -> Pattern: + return self._check_both_before_after + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def ordinal_extractor(self) -> BaseNumberExtractor: + return self._ordinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> DateTimeParser: + return self._date_time_parser + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def day_of_week(self) -> Dict[str, int]: + return self._day_of_week + + @property + def unit_map(self): + return {} + + @property + def cardinal_map(self): + return {} + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self): + MinimalBaseDateParserConfiguration.__init__(self) + + self._utility_configuration = CatalanDateTimeUtilityConfiguration() + self._day_of_week = CatalanDateTime.DayOfWeek + self._month_of_year = CatalanDateTime.MonthOfYear + self._day_of_month = {**BaseDateTime.DayOfMonthDictionary, **CatalanDateTime.DayOfMonth} + self._numbers = CatalanDateTime.Numbers + self._check_both_before_after = CatalanDateTime.CheckBothBeforeAfter + self._cardinal_extractor = CatalanCardinalExtractor() + self._integer_extractor = CatalanIntegerExtractor() + self._ordinal_extractor = CatalanOrdinalExtractor() + self._number_parser = BaseNumberParser(CatalanNumberParserConfiguration()) + self._date_extractor = CatalanBaseDateExtractor(CatalanDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(CatalanTimeExtractorConfiguration()) + self._date_parser = BaseDateParser(CatalanDateParserConfiguration(self)) + self._time_parser = BaseTimeParser(CatalanTimeParserConfiguration(self)) + self._date_time_extractor = MinimalDateTimeExtractor() + self._date_time_parser = MinimalDateTimeParser() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/date_extractor_config.py new file mode 100644 index 0000000000..6ff56a57ee --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/date_extractor_config.py @@ -0,0 +1,71 @@ +from typing import List, Optional, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + CatalanIntegerExtractor, + CatalanNumberParserConfiguration, + CatalanOrdinalExtractor, +) +from recognizers_text.utilities import RegExpUtility + +from ...resources.catalan_date_time import CatalanDateTime +from ..base_date import DateExtractorConfiguration +from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..utilities import DateTimeUtilityConfiguration +from .base_configs import CatalanDateTimeUtilityConfiguration + + +class CatalanDateExtractorConfiguration(DateExtractorConfiguration): + + def __init__(self): + super().__init__(CatalanDateTime()) + self.ordinal_extractor: BaseNumberExtractor = CatalanOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = CatalanIntegerExtractor() + self.duration_extractor: Optional[DateTimeExtractor] = None + self.number_parser: BaseNumberParser = BaseNumberParser(CatalanNumberParserConfiguration()) + self.utility_configuration: DateTimeUtilityConfiguration = CatalanDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(CatalanDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.SpecialDayRegex), + # TODO - we might invest in resolving below in time. + # RegExpUtility.get_safe_reg_exp(CatalanDateTime.ThisRegex), + # RegExpUtility.get_safe_reg_exp(CatalanDateTime.LastDateRegex), + # RegExpUtility.get_safe_reg_exp(CatalanDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.WeekDayRegex), + # RegExpUtility.get_safe_reg_exp( + # CatalanDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.SpecialDateRegex), + ] + + @property + def date_regex_list(self) -> List[Pattern]: + if CatalanDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: + date_extractor_4 = CatalanDateTime.DateExtractor5 + date_extractor_5 = CatalanDateTime.DateExtractor8 + date_extractor_6 = CatalanDateTime.DateExtractor9 + date_extractor_8 = CatalanDateTime.DateExtractor4 + date_extractor_7 = CatalanDateTime.DateExtractor6 + date_extractor_9 = CatalanDateTime.DateExtractor7 + else: + date_extractor_4 = CatalanDateTime.DateExtractor4 + date_extractor_5 = CatalanDateTime.DateExtractor6 + date_extractor_6 = CatalanDateTime.DateExtractor7 + date_extractor_8 = CatalanDateTime.DateExtractor5 + date_extractor_7 = CatalanDateTime.DateExtractor8 + date_extractor_9 = CatalanDateTime.DateExtractor9 + + return [ + RegExpUtility.get_safe_reg_exp(CatalanDateTime.DateExtractor1), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.DateExtractor2), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.DateExtractor3), + RegExpUtility.get_safe_reg_exp(date_extractor_4), + RegExpUtility.get_safe_reg_exp(date_extractor_5), + RegExpUtility.get_safe_reg_exp(date_extractor_6), + RegExpUtility.get_safe_reg_exp(date_extractor_7), + RegExpUtility.get_safe_reg_exp(date_extractor_8), + RegExpUtility.get_safe_reg_exp(date_extractor_9), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.DateExtractor10), + ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/date_parser_config.py new file mode 100644 index 0000000000..71d4fcf801 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/date_parser_config.py @@ -0,0 +1,216 @@ +from typing import Dict, List, Pattern + +import regex + +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + +from ...resources.catalan_date_time import CatalanDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_date import DateParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser +from ..utilities import DateTimeUtilityConfiguration +from .date_extractor_config import CatalanDateExtractorConfiguration + + +class CatalanDateParserConfiguration(DateParserConfiguration): + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def ordinal_extractor(self) -> BaseNumberExtractor: + return self._ordinal_extractor + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return None + + @property + def duration_parser(self) -> DateTimeParser: + return None + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def day_of_week(self) -> Dict[str, int]: + return self._day_of_week + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def date_regex(self) -> List[Pattern]: + return self._date_regex + + @property + def on_regex(self) -> Pattern: + return self._on_regex + + @property + def special_day_regex(self) -> Pattern: + return self._special_day_regex + + @property + def special_day_with_num_regex(self) -> Pattern: + return self._special_day_with_num_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def month_regex(self) -> Pattern: + return self._month_regex + + @property + def week_day_regex(self) -> Pattern: + return self._week_day_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def this_regex(self) -> Pattern: + return self._this_regex + + @property + def week_day_of_month_regex(self) -> Pattern: + return self._week_day_of_month_regex + + @property + def for_the_regex(self) -> Pattern: + return self._for_the_regex + + @property + def week_day_and_day_of_month_regex(self) -> Pattern: + return self._week_day_and_day_of_month_regex + + @property + def week_day_and_day_regex(self) -> Pattern: + return self._week_day_and_day_regex + + @property + def relative_month_regex(self) -> Pattern: + return self._relative_month_regex + + @property + def relative_week_day_regex(self) -> Pattern: + return self._relative_week_day_regex + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + @property + def date_token_prefix(self) -> str: + return self._date_token_prefix + + _relative_day_regex = None + _next_prefix_regex = None + _past_prefix_regex = None + + def __init__(self, config: BaseDateParserConfiguration): + self._ordinal_extractor = config.ordinal_extractor + self._integer_extractor = config.integer_extractor + self._cardinal_extractor = config.cardinal_extractor + self._date_extractor = config.date_extractor + self._number_parser = config.number_parser + self._month_of_year = config.month_of_year + self._day_of_month = config.day_of_month + self._day_of_week = config.day_of_week + self._unit_map = config.unit_map + self._cardinal_map = config.cardinal_map + self._date_regex = (CatalanDateExtractorConfiguration()).date_regex_list + self._on_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.OnRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._unit_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._month_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.WeekDayRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._this_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._for_the_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( + CatalanDateTime.WeekDayAndDayOfMonthRegex + ) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.RelativeWeekDayRegex) + self._utility_configuration = config.utility_configuration + self._date_token_prefix = CatalanDateTime.DateTokenPrefix + self._check_both_before_after = CatalanDateTime.CheckBothBeforeAfter + + def get_swift_day(self, source: str) -> int: + trimmed_text = self.__normalize(source.strip().lower()) + swift = 0 + + if trimmed_text == 'avui': + swift = 0 + elif trimmed_text == 'mati' or trimmed_text == 'dema': + swift = 1 + elif trimmed_text == 'ahir': + swift = -1 + + return swift + + def get_swift_month(self, source: str) -> int: + trimmed_text = source.strip().lower() + swift = 0 + + if regex.search(CatalanDateParserConfiguration._next_prefix_regex, trimmed_text): + swift = 1 + + if regex.search(CatalanDateParserConfiguration._past_prefix_regex, trimmed_text): + swift = -1 + + return swift + + def is_cardinal_last(self, source: str) -> bool: + trimmed_text = source.strip().lower() + return regex.search(CatalanDateParserConfiguration._past_prefix_regex, trimmed_text) is not None + + def __normalize(self, source: str) -> str: + return ( + source.replace('á', 'a') + .replace('é', 'e') + .replace('í', 'i') + .replace('ó', 'o') + .replace('ú', 'u') + .replace('à', 'a') + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/merged_extractor_config.py new file mode 100644 index 0000000000..c1dd692a50 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/merged_extractor_config.py @@ -0,0 +1,71 @@ +from typing import List, Pattern + +from recognizers_date_time.date_time.catalan.base_datetime import MinimalDateTimeExtractor +from recognizers_number import CatalanIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + +from ...resources.base_date_time import BaseDateTime +from ...resources.catalan_date_time import CatalanDateTime +from ..base_date import BaseDateExtractor +from ..base_minimal_merged import MinimalMergedExtractorConfiguration +from ..base_time import BaseTimeExtractor +from ..extractors import DateTimeExtractor +from .date_extractor_config import CatalanDateExtractorConfiguration +from .time_extractor_config import CatalanTimeExtractorConfiguration + + +class CatalanMergedExtractorConfiguration(MinimalMergedExtractorConfiguration): + @property + def check_both_before_after(self): + return self._check_both_before_after + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def integer_extractor(self) -> Extractor: + return self._integer_extractor + + @property + def equal_regex(self) -> Pattern: + return self._equal_regex + + @property + def ambiguous_range_modifier_prefix(self) -> None: + return None + + @property + def potential_ambiguous_range_regex(self) -> None: + return None + + @property + def number_ending_pattern(self) -> Pattern: + return self._number_ending_pattern + + @property + def filter_word_regex_list(self) -> List[Pattern]: + return self._filter_word_regex_list + + def __init__(self): + self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( + CatalanDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(CatalanDateTime.NumberEndingPattern) + + self._date_extractor = BaseDateExtractor(CatalanDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(CatalanTimeExtractorConfiguration()) + self._date_time_extractor = MinimalDateTimeExtractor() + self._integer_extractor = CatalanIntegerExtractor() + self._filter_word_regex_list = [] + self._equal_regex = BaseDateTime.EqualRegex + self._check_both_before_after = CatalanDateTime.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/merged_parser_config.py new file mode 100644 index 0000000000..164a9ce4c3 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/merged_parser_config.py @@ -0,0 +1,61 @@ +from typing import Pattern + +from recognizers_text.utilities import RegExpUtility + +from ...resources.catalan_date_time import BaseDateTime, CatalanDateTime +from ..base_date import BaseDateParser +from ..base_minimal_merged import MinimalMergedParserConfiguration +from ..base_time import BaseTimeParser +from .common_configs import CatalanCommonDateTimeParserConfiguration + + +class CatalanMergedParserConfiguration(CatalanCommonDateTimeParserConfiguration, MinimalMergedParserConfiguration): + @property + def around_regex(self) -> Pattern: + return self._around_regex + + @property + def equal_regex(self) -> Pattern: + return self._equal_regex + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def suffix_after(self) -> Pattern: + return self._suffix_after + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def since_regex(self) -> Pattern: + return self._since_regex + + @property + def date_parser(self) -> BaseDateParser: + return self._date_parser + + @property + def time_parser(self) -> BaseTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> BaseTimeParser: + return self._date_time_parser + + def __init__(self, config): + CatalanCommonDateTimeParserConfiguration.__init__(self) + self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) + self._suffix_after = RegExpUtility.get_safe_reg_exp('^[.]') + self._year_regex = RegExpUtility.get_safe_reg_exp(CatalanDateTime.YearRegex) + self._around_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._before_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._after_regex = RegExpUtility.get_safe_reg_exp('^[.]') + self._since_regex = RegExpUtility.get_safe_reg_exp('^[.]') diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/time_extractor_config.py new file mode 100644 index 0000000000..3684f24a9a --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/time_extractor_config.py @@ -0,0 +1,56 @@ +from typing import List, Pattern + +from recognizers_text.utilities import RegExpUtility + +from ...resources.catalan_date_time import CatalanDateTime +from ..base_time import TimeExtractorConfiguration + + +class CatalanTimeExtractorConfiguration(TimeExtractorConfiguration): + @property + def options(self): + return self._options + + @property + def dmy_date_format(self) -> bool: + return self._dmy_date_format + + @property + def time_regex_list(self) -> List[Pattern]: + return self._time_regex_list + + @property + def at_regex(self) -> Pattern: + return self._at_regex + + @property + def ish_regex(self) -> Pattern: + return self._ish_regex + + @property + def time_before_after_regex(self) -> Pattern: + return self._time_before_after_regex + + def __init__(self): + super().__init__() + self._time_regex_list: List[Pattern] = CatalanTimeExtractorConfiguration.get_time_regex_list() + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(CatalanDateTime.AtRegex) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp('^[.]') + self._ish_regex: Pattern = None + + @staticmethod + def get_time_regex_list() -> List[Pattern]: + return [ + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex1), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex2), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex3), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex4), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex5), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex6), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex7), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex8), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex9), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex11), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeRegex12), + RegExpUtility.get_safe_reg_exp(CatalanDateTime.ConnectNumRegex), + ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/time_parser_config.py new file mode 100644 index 0000000000..7388e2cf66 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/catalan/time_parser_config.py @@ -0,0 +1,137 @@ +from typing import Dict, List, Pattern + +import regex + +from recognizers_text.utilities import RegExpUtility + +from ...resources.catalan_date_time import CatalanDateTime +from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_time import AdjustParams, TimeParserConfiguration +from .time_extractor_config import CatalanTimeExtractorConfiguration + + +class CatalanTimeParserConfiguration(TimeParserConfiguration): + @property + def time_token_prefix(self) -> str: + return self._time_token_prefix + + @property + def at_regex(self) -> Pattern: + return self._at_regex + + @property + def time_regexes(self) -> List[Pattern]: + return self._time_regexes + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self, config: BaseDateParserConfiguration): + self._time_token_prefix: str = CatalanDateTime.TimeTokenPrefix + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(CatalanDateTime.AtRegex) + self._time_regexes: List[Pattern] = CatalanTimeExtractorConfiguration.get_time_regex_list() + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(CatalanDateTime.LessThanOneHour) + self.time_suffix = RegExpUtility.get_safe_reg_exp(CatalanDateTime.TimeSuffix) + + self._utility_configuration = config.utility_configuration + self._numbers: Dict[str, int] = config.numbers + + def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): + delta_min = 0 + prefix = prefix.strip().lower() + + if ( + prefix.startswith('menys quart') + or prefix.startswith('quarts') + or prefix.startswith('tres quarts') + or prefix.startswith('quart menys') + or prefix.startswith('3/4') + ): + delta_min = -45 + elif prefix.startswith('i quart'): + delta_min = 15 + elif prefix.startswith('quart') or prefix.startswith('un quart') or prefix.startswith('1/4'): + delta_min = -15 + elif ( + prefix.startswith('mitjana') + or prefix.startswith('i mitjana') + or prefix.startswith('i mitja') + or prefix.startswith('mitja') + or prefix.startswith('1/2') + or prefix.startswith('2/4') + ): + delta_min = 30 + elif prefix.startswith("dos quarts"): + delta_min = -30 + else: + match = regex.search(self.less_than_one_hour, prefix) + if match: + min_str = RegExpUtility.get_group(match, 'deltamin') + if min_str: + delta_min = int(min_str) + else: + min_str = RegExpUtility.get_group(match, 'deltaminnum').lower() + delta_min = self.numbers.get(min_str) + + if ( + prefix.endswith('passades') + or prefix.endswith('passats') + or prefix.endswith('passades les') + or prefix.endswith('passats les') + or prefix.endswith('passades de les') + or prefix.endswith('passats de les') + ): + # deltaMin it's positive + pass + elif ( + prefix.endswith('per a la') + or prefix.endswith('per a les') + or prefix.endswith('abans de la') + or prefix.endswith('abans de les') + ): + delta_min = delta_min * -1 + + adjust.minute += delta_min + + if adjust.minute < 0: + if adjust.minute == -15: + adjust.hour -= 1 + adjust.minute += 30 + elif adjust.minute == -45: + adjust.hour -= 1 + adjust.minute += 90 + else: + adjust.hour -= 1 + adjust.minute += 60 + + adjust.has_minute = True + + def adjust_by_suffix(self, suffix: str, adjust: AdjustParams): + suffix = suffix.strip().lower() + + delta_hour = 0 + match = regex.match(self.time_suffix, suffix) + + if match and match.group() == suffix: + oclock_str = RegExpUtility.get_group(match, 'oclock') + if not oclock_str: + am_str = RegExpUtility.get_group(match, 'am') + if am_str: + if adjust.hour >= 12: + delta_hour -= 12 + + adjust.has_am = True + + pm_str = RegExpUtility.get_group(match, 'pm') + if pm_str: + if adjust.hour < 12: + delta_hour = 12 + + adjust.has_pm = True + + adjust.hour = (adjust.hour + delta_hour) % 24 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/__init__.py index 508faef7e4..f33395f800 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/__init__.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/__init__.py @@ -2,39 +2,35 @@ # Licensed under the MIT License. from .base_date_time_extractor import * -from .duration_extractor_config import * -from .duration_extractor import * -from .time_extractor import * -from .date_extractor_config import * from .date_extractor import * -from .timeperiod_extractor import * -from .dateperiod_extractor_config import * +from .date_extractor_config import * +from .date_parser import * +from .date_parser_config import * from .dateperiod_extractor import * -from .datetime_extractor_config import * +from .dateperiod_extractor_config import * +from .dateperiod_parser import * +from .dateperiod_parser_config import * from .datetime_extractor import * -from .datetimeperiod_extractor_config import * +from .datetime_extractor_config import * +from .datetime_parser import * +from .datetime_parser_config import * from .datetimeperiod_extractor import * -from .set_extractor_config import * -from .set_extractor import * +from .datetimeperiod_extractor_config import * +from .datetimeperiod_parser import * +from .datetimeperiod_parser_config import * +from .duration_extractor import * +from .duration_extractor_config import * +from .duration_parser import * +from .duration_parser_config import * from .holiday_extractor_config import * -from .merged_extractor_config import * +from .holiday_parser import * +from .holiday_parser_config import * from .merged_extractor import * -from .duration_parser_config import * -from .duration_parser import * +from .merged_extractor_config import * +from .merged_parser import * +from .merged_parser_config import * +from .time_extractor import * from .time_parser import * -from .date_parser_config import * -from .date_parser import * -from .timeperiod_parser_config import * +from .timeperiod_extractor import * from .timeperiod_parser import * -from .dateperiod_parser_config import * -from .dateperiod_parser import * -from .datetime_parser_config import * -from .datetime_parser import * -from .datetimeperiod_parser_config import * -from .datetimeperiod_parser import * -from .holiday_parser_config import * -from .holiday_parser import * -from .set_parser_config import * -from .set_parser import * -from .merged_parser_config import * -from .merged_parser import * +from .timeperiod_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/base_date_time_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/base_date_time_extractor.py index 6ec042c527..eca2a8b46a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/base_date_time_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/base_date_time_extractor.py @@ -1,11 +1,13 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Pattern, Match from datetime import datetime +from typing import Dict, List, Match, Pattern + import regex from recognizers_text import ExtractResult + from ..extractors import DateTimeExtractor @@ -77,8 +79,7 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult match_source: Dict[Match, any] = dict() matched: List[bool] = [False] * len(source) - collections = list(map(lambda x: ( - list(regex.finditer(x[0], source)), x[1]), self._regex_dict.items())) + collections = list(map(lambda x: (list(regex.finditer(x[0], source)), x[1]), self._regex_dict.items())) collections = list(filter(lambda x: len(x[0]) > 0, collections)) for collection in collections: @@ -93,9 +94,11 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult if i + 1 == len(source) or not matched[i + 1]: start = last + 1 length = i - last - text = source[start:start+length].strip() - src_match = next((x for x in iter(match_source) if ( - x.start() == start and (x.end() - x.start()) == length)), None) + text = source[start : start + length].strip() + src_match = next( + (x for x in iter(match_source) if (x.start() == start and (x.end() - x.start()) == length)), + None, + ) if src_match: value = ExtractResult() value.start = start diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_extractor.py index 07f0423b69..8c12c90867 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_extractor.py @@ -1,25 +1,24 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List from datetime import datetime +from typing import List + import regex -from ...resources.chinese_date_time import ChineseDateTime -from recognizers_text import ExtractResult, RegExpUtility, MetaData -from ..utilities import merge_all_tokens, Token, get_tokens_from_regex +from recognizers_text import ExtractResult, MetaData, RegExpUtility + +from ...resources.chinese_date_time import ChineseDateTime from ..base_date import BaseDateExtractor +from ..utilities import Token, get_tokens_from_regex, merge_all_tokens from .date_extractor_config import ChineseDateExtractorConfiguration from .duration_extractor import ChineseDurationExtractor class ChineseDateExtractor(BaseDateExtractor): - before_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.BeforeRegex) - after_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.AfterRegex) - date_time_period_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodUnitRegex) + before_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.BeforeRegex) + after_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.AfterRegex) + date_time_period_unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodUnitRegex) def __init__(self): super().__init__(ChineseDateExtractorConfiguration()) @@ -48,8 +47,9 @@ def relative_duration_date(self, source: str, reference: datetime) -> List[Token before_match = RegExpUtility.get_matches(self.before_regex, suffix) after_match = RegExpUtility.get_matches(self.after_regex, suffix) - if (before_match and suffix.startswith(before_match[0])) \ - or (after_match and suffix.startswith(after_match[0])): + if (before_match and suffix.startswith(before_match[0])) or ( + after_match and suffix.startswith(after_match[0]) + ): meta_data = MetaData() meta_data.is_duration_with_ago_and_later = True ret.append(Token(er.start, pos + 1, meta_data)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_extractor_config.py index 470bfae589..6fc0484f36 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_extractor_config.py @@ -1,249 +1,32 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern, Dict +from typing import List, Pattern from recognizers_text import RegExpUtility -from recognizers_number import BaseNumberExtractor + from ...resources import ChineseDateTime -from ..constants import Constants -from ..extractors import DateTimeExtractor -from ..base_date import DateTimeUtilityConfiguration from ..base_date import DateExtractorConfiguration -from ...resources.base_date_time import BaseDateTime class ChineseDateExtractorConfiguration(DateExtractorConfiguration): - @property - def week_day_start(self) -> Pattern: - pass - - @property - def check_both_before_after(self) -> Pattern: - pass - @property - def week_day_end(self) -> Pattern: - pass - - @property - def number_parser(self): - pass - - @property - def month_regex(self) -> Pattern: - return self._month_regex - - @property - def day_regex(self): - return self._day_regex + def __init__(self): + super().__init__(ChineseDateTime()) + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(ChineseDateTime.LunarRegex), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateThisRegex), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateLastRegex), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateNextRegex), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.WeekDayRegex), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecialDate), + ] @property def date_regex_list(self) -> List[Pattern]: - return self._date_regex_list - - @property - def implicit_date_list(self) -> List[Pattern]: - return self._implicit_date_list - - @property - def range_connector_symbol_regex(self) -> Pattern: - return self._range_connector_symbol_regex - - @property - def date_day_regex_in_chinese(self) -> Pattern: - return self._date_day_regex_in_chinese - - @property - def day_regex_num_in_chinese(self) -> Pattern: - return self._day_regex_num_in_chinese - - @property - def month_num_regex(self) -> Pattern: - return self._month_num_regex - - @property - def year_regex(self) -> Pattern: - return self._year_regex - - @property - def relative_regex(self) -> Pattern: - return self._relative_regex - - @property - def zero_to_nine_integer_regex_chinese(self) -> Pattern: - return self._zero_to_nine_integer_regex_chinese - - @property - def date_year_in_chinese_regex(self) -> Pattern: - return self._date_year_in_chinese_regex - - @property - def this_prefix_regex(self) -> Pattern: - return self._this_prefix_regex - - @property - def last_prefix_regex(self) -> Pattern: - return self._last_prefix_regex - - @property - def next_prefix_regex(self) -> Pattern: - return self._next_prefix_regex - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def before_regex(self) -> Pattern: - return self._before_regex - - @property - def after_regex(self) -> Pattern: - return self._after_regex - - @property - def datetime_period_unit_regex(self) -> Pattern: - return self._datetime_period_unit_regex - - @property - def week_day_and_day_regex(self) -> Pattern: - return self._week_day_and_day_regex - - @property - def prefix_article_regex(self) -> Pattern: - return self._prefix_article_regex - - @property - def month_of_year(self) -> Dict[str, int]: - return self._month_of_year - - @property - def year_suffix(self) -> Pattern: - return self._year_suffix - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_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 since_year_suffix_regex(self) -> Pattern: - return self._since_year_suffix_regex - - @property - def month_end(self) -> Pattern: - return None - - @property - def of_month(self) -> Pattern: - return None - - @property - def for_the_regex(self) -> Pattern: - return None - - @property - def week_day_and_day_of_month_regex(self) -> Pattern: - return None - - @property - def relative_month_regex(self) -> Pattern: - return None - - @property - def week_day_regex(self) -> Pattern: - return None - - @property - def day_of_week(self) -> Dict[str, int]: - return None - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return None - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return None - - @property - def duration_extractor(self) -> DateTimeExtractor: - return None - - @property - def strict_relative_regex(self) -> Pattern: - return None - - @property - def utility_configuration(self) -> DateTimeUtilityConfiguration: - return None - - @property - def week_day_end(self) -> Pattern: - pass - - def __init__(self): - self._datetime_period_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodUnitRegex - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.AfterRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.BeforeRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.UnitRegex - ) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NextPrefixRegex - ) - self._last_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.LastPrefixRegex - ) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.ThisPrefixRegex - ) - self._date_year_in_chinese_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateYearInCJKRegex - ) - self._zero_to_nine_integer_regex_chinese = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.ZeroToNineIntegerRegexCJK - ) - self._relative_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.RelativeRegex - ) - self._year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearRegex - ) - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.MonthNumRegex - ) - self._day_regex_num_in_chinese = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DayRegexNumInCJK - ) - self._date_day_regex_in_chinese = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateDayRegexInCJK - ) - self._day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DayRegex - ) - self._month_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.MonthRegex - ) - self._date_regex_list = [ + return [ RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList1), RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList2), RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList3), @@ -251,30 +34,5 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList5), RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList6), RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList7), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList8) - ] - self._implicit_date_list = [ - RegExpUtility.get_safe_reg_exp(ChineseDateTime.LunarRegex), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecialDayRegex), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateThisRegex), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateLastRegex), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateNextRegex), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.WeekDayRegex), - RegExpUtility.get_safe_reg_exp( - ChineseDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecialDate) + RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList8), ] - self._range_connector_symbol_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.RangeConnectorSymbolRegex - ) - self._check_both_before_after = False - # TODO When the implementation for these properties is added, change the None values to their respective Regexps - self._since_year_suffix_regex = None - self._range_unit_regex = None - self._in_connector_regex = None - self._less_than_regex = None - self._more_than_regex = None - self._year_suffix = None - self._month_of_year = None - self._prefix_article_regex = None - self._week_day_and_day_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_parser.py index 00a400df1f..ae2f9e9a65 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_parser.py @@ -1,24 +1,24 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from numbers import Number -from typing import List, Dict, Optional -from datedelta import datedelta from datetime import datetime, timedelta +from typing import Dict, List, Optional + import regex +from datedelta import datedelta -from recognizers_text import RegExpUtility, ExtractResult -from recognizers_number import Constants as NumberConstants, ChineseIntegerExtractor -from .date_extractor import ChineseDateExtractor -from .duration_extractor import ChineseDurationExtractor +from recognizers_number import ChineseIntegerExtractor +from recognizers_number import Constants as NumberConstants +from recognizers_text import ExtractResult, RegExpUtility from ...resources.chinese_date_time import ChineseDateTime -from ..constants import TimeTypeConstants, Constants -from ..utilities import DateTimeResolutionResult, DateTimeFormatUtil, DateUtils, DayOfWeek -from ..parsers import DateTimeParseResult from ..base_date import BaseDateParser +from ..constants import Constants, TimeTypeConstants +from ..parsers import DateTimeParseResult +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils +from .date_extractor import ChineseDateExtractor from .date_parser_config import ChineseDateParserConfiguration -from ..utilities import parse_chinese_dynasty_year +from .duration_extractor import ChineseDurationExtractor class ChineseDateParser(BaseDateParser): @@ -26,16 +26,11 @@ class ChineseDateParser(BaseDateParser): def __init__(self): super().__init__(ChineseDateParserConfiguration()) - self.lunar_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.LunarRegex) - self.special_date_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SpecialDate) - self.token_next_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NextPrefixRegex) - self.token_last_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.LastPrefixRegex) - self.month_max_days: List[int] = [ - 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] + self.lunar_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.LunarRegex) + self.special_date_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecialDate) + self.token_next_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NextPrefixRegex) + self.token_last_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.LastPrefixRegex) + self.month_max_days: List[int] = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] self.duration_extractor = ChineseDurationExtractor() def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: @@ -52,22 +47,21 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self.parse_implicit_date(source_text, reference) if not inner_result.success: - inner_result = self.parse_weekday_of_month( - source_text, reference) + inner_result = self.parse_weekday_of_month(source_text, reference) if not inner_result.success: - inner_result = self.parser_duration_with_ago_and_later( - source_text, reference) + inner_result = self.parser_duration_with_ago_and_later(source_text, reference) if inner_result.success: inner_result.future_resolution: Dict[str, str] = dict() inner_result.future_resolution[TimeTypeConstants.DATE] = DateTimeFormatUtil.format_date( - inner_result.future_value) + inner_result.future_value + ) inner_result.past_resolution: Dict[str, str] = dict() inner_result.past_resolution[TimeTypeConstants.DATE] = DateTimeFormatUtil.format_date( - inner_result.past_value) - inner_result.is_lunar = self.__parse_lunar_calendar( - source_text) + inner_result.past_value + ) + inner_result.is_lunar = self.__parse_lunar_calendar(source_text) result_value = inner_result result = DateTimeParseResult(source) @@ -131,8 +125,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeResol elif regex.search(self.token_last_regex, year_str): year -= 1 - result.timex = DateTimeFormatUtil.luis_date( - year if has_year else -1, month if has_month else -1, day) + result.timex = DateTimeFormatUtil.luis_date(year if has_year else -1, month if has_month else -1, day) if day > self.get_month_max_day(year, month): future_month = month + 1 @@ -148,8 +141,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeResol past_month = Constants.MAX_MONTH past_year = year - 1 - is_future_valid = DateUtils.is_valid_date( - future_year, future_month, day) + is_future_valid = DateUtils.is_valid_date(future_year, future_month, day) is_past_valid = DateUtils.is_valid_date(past_year, past_month, day) if is_future_valid and is_past_valid: @@ -195,8 +187,9 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeResol value = reference + timedelta(days=swift) result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) - result.future_value = result.past_value = DateUtils.safe_create_from_min_value(value.year, value.month, - value.day) + result.future_value = result.past_value = DateUtils.safe_create_from_min_value( + value.year, value.month, value.day + ) result.success = True return result @@ -204,8 +197,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeResol match = regex.match(self.config.this_regex, trimmed_source) if match and match.start() == 0 and len(match.group()) == len(trimmed_source): weekday_str = RegExpUtility.get_group(match, 'weekday') - value = DateUtils.this( - reference, self.config.day_of_week.get(weekday_str)) + value = DateUtils.this(reference, self.config.day_of_week.get(weekday_str)) result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) result.future_value = value @@ -217,8 +209,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeResol match = regex.match(self.config.next_regex, trimmed_source) if match and match.start() == 0 and len(match.group()) == len(trimmed_source): weekday_str = RegExpUtility.get_group(match, 'weekday') - value = DateUtils.next( - reference, self.config.day_of_week.get(weekday_str)) + value = DateUtils.next(reference, self.config.day_of_week.get(weekday_str)) result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) result.future_value = value @@ -230,8 +221,7 @@ def parse_implicit_date(self, source: str, reference: datetime) -> DateTimeResol match = regex.match(self.config.last_regex, trimmed_source) if match and match.start() == 0 and len(match.group()) == len(trimmed_source): weekday_str = RegExpUtility.get_group(match, 'weekday') - value = DateUtils.last( - reference, self.config.day_of_week.get(weekday_str)) + value = DateUtils.last(reference, self.config.day_of_week.get(weekday_str)) result.timex = DateTimeFormatUtil.luis_date_from_datetime(value) result.future_value = value @@ -311,8 +301,7 @@ def match_to_date(self, match, reference: datetime) -> DateTimeResolutionResult: # convert Chinese Number to Integer def parse_chinese_written_number_to_value(self, source: str) -> int: num = -1 - er: ExtractResult = next( - iter(self.integer_extractor.extract(source)), None) + er: ExtractResult = next(iter(self.integer_extractor.extract(source)), None) if er and er.type == NumberConstants.SYS_NUM_INTEGER: num = int(self.config.number_parser.parse(er).value) @@ -320,12 +309,18 @@ def parse_chinese_written_number_to_value(self, source: str) -> int: def convert_chinese_year_to_number(self, source: str) -> int: year = 0 - dynasty_year = parse_chinese_dynasty_year(source, self.config.dynasty_year_regex, self.config.dynasty_start_year, self.config.dynasty_year_map, self.integer_extractor, self.config.number_parser) + dynasty_year = DateTimeFormatUtil.parse_dynasty_year( + source, + self.config.dynasty_year_regex, + self.config.dynasty_start_year, + self.config.dynasty_year_map, + self.integer_extractor, + self.config.number_parser, + ) if dynasty_year is not None: return dynasty_year - er: ExtractResult = next( - iter(self.config.integer_extractor.extract(source)), None) + er: ExtractResult = next(iter(self.config.integer_extractor.extract(source)), None) if er and er.type == NumberConstants.SYS_NUM_INTEGER: year = int(self.config.number_parser.parse(er).value) @@ -333,11 +328,9 @@ def convert_chinese_year_to_number(self, source: str) -> int: year = 0 for char in source: year = year * 10 - er = next( - iter(self.config.integer_extractor.extract(char)), None) + er = next(iter(self.config.integer_extractor.extract(char)), None) if er and er.type == NumberConstants.SYS_NUM_INTEGER: - year = year + \ - int(self.config.number_parser.parse(er).value) + year = year + int(self.config.number_parser.parse(er).value) return -1 if year < 10 else year @@ -372,15 +365,18 @@ def is_valid_date(self, year, month, day): # Handle cases like "三天前" def parser_duration_with_ago_and_later(self, source: str, reference: datetime) -> DateTimeResolutionResult: result = DateTimeResolutionResult() - duration_res = self.duration_extractor.extract(source, reference).pop() if self.duration_extractor.extract( - source, reference) else [] + duration_res = ( + self.duration_extractor.extract(source, reference).pop() + if self.duration_extractor.extract(source, reference) + else [] + ) if duration_res: match = self.config._unit_regex.search(source) if match: - suffix = source[duration_res.start + duration_res.length:] + suffix = source[duration_res.start + duration_res.length :] src_unit = RegExpUtility.get_group(match, 'unit') - number_str = source[duration_res.start:match.lastindex - duration_res.start + 1] + number_str = source[duration_res.start : match.lastindex - duration_res.start + 1] number = self.parse_chinese_written_number_to_value(number_str) if src_unit in self.config.unit_map: @@ -393,9 +389,9 @@ def parser_duration_with_ago_and_later(self, source: str, reference: datetime) - elif unit_str == Constants.TIMEX_WEEK: date = reference + timedelta(days=-7 * number) elif unit_str == Constants.TIMEX_MONTH_FULL: - date = reference.replace(month=reference.month-1) + date = reference.replace(month=reference.month - 1) elif unit_str == Constants.TIMEX_YEAR: - date = reference.replace(year=reference.year-1) + date = reference.replace(year=reference.year - 1) else: return result @@ -411,9 +407,9 @@ def parser_duration_with_ago_and_later(self, source: str, reference: datetime) - elif unit_str == Constants.TIMEX_WEEK: date = reference + timedelta(days=7 * number) elif unit_str == Constants.TIMEX_MONTH_FULL: - date = reference.replace(month=reference.month+1) + date = reference.replace(month=reference.month + 1) elif unit_str == Constants.TIMEX_YEAR: - date = reference.replace(year=reference.year+1) + date = reference.replace(year=reference.year + 1) else: return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_parser_config.py index fdec4faa60..b5adad8cc0 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/date_parser_config.py @@ -1,14 +1,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern, Dict +from typing import Dict, List, Pattern -from recognizers_text import RegExpUtility, Extractor, Parser -from recognizers_number import CJKNumberParser, ChineseIntegerExtractor, ChineseNumberParserConfiguration +from recognizers_number import ChineseIntegerExtractor, ChineseNumberParserConfiguration, CJKNumberParser +from recognizers_text import Extractor, Parser, RegExpUtility from ...resources.chinese_date_time import ChineseDateTime -from ..constants import Constants from ..base_date import DateParserConfiguration +from ..constants import Constants from ..extractors import DateTimeExtractor @@ -187,7 +187,7 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList2), RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList3), # 2015-12-23 - This regex represents the standard format in Chinese dates (YMD) and has precedence over other orderings - RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList8) + RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateRegexList8), ] # Regex precedence where the order between D and M varies is controlled by DefaultLanguageFallback @@ -196,7 +196,10 @@ def __init__(self): else: order_regex_list = [ChineseDateTime.DateRegexList4, ChineseDateTime.DateRegexList5] - if ChineseDateTime.DefaultLanguageFallback in [Constants.DEFAULT_LANGUAGE_FALLBACK_DMY, Constants.DEFAULT_LANGUAGE_FALLBACK_YMD]: + if ChineseDateTime.DefaultLanguageFallback in [ + Constants.DEFAULT_LANGUAGE_FALLBACK_DMY, + Constants.DEFAULT_LANGUAGE_FALLBACK_YMD, + ]: order_regex_list.extend([ChineseDateTime.DateRegexList7, ChineseDateTime.DateRegexList6]) else: order_regex_list.extend([ChineseDateTime.DateRegexList6, ChineseDateTime.DateRegexList7]) @@ -205,27 +208,17 @@ def __init__(self): self._month_of_year = ChineseDateTime.ParserConfigurationMonthOfYear self._day_of_month = ChineseDateTime.ParserConfigurationDayOfMonth self._day_of_week = ChineseDateTime.ParserConfigurationDayOfWeek - self._special_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SpecialDayRegex) - self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SpecialDayWithNumRegex) - self._this_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateThisRegex) - self._next_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateNextRegex) - self._last_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateLastRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateUnitRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecialDayWithNumRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateThisRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateNextRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateLastRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateUnitRegex) self._unit_map = ChineseDateTime.ParserConfigurationUnitMap - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.WeekDayOfMonthRegex) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.WeekDayAndDayRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.WeekDayRegex) - self._dynasty_year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DynastyYearRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.WeekDayOfMonthRegex) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.WeekDayAndDayRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.WeekDayRegex) + self._dynasty_year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DynastyYearRegex) self._dynasty_year_map = ChineseDateTime.DynastyYearMap self._integer_extractor = ChineseIntegerExtractor() self._number_parser = CJKNumberParser(ChineseNumberParserConfiguration()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_extractor.py index 30b4c6c0ac..5a4c53acaf 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_extractor.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List from datetime import datetime +from typing import List + import regex from recognizers_text import ExtractResult from ..base_dateperiod import BaseDatePeriodExtractor -from ..utilities import merge_all_tokens, Token, RegExpUtility +from ..utilities import RegExpUtility, Token, merge_all_tokens from .dateperiod_extractor_config import ChineseDatePeriodExtractorConfiguration @@ -76,32 +77,30 @@ def match_number_with_unit(self, source: str) -> List[Token]: durations: List[Token] = list() for er in self.config.integer_extractor.extract(source): - after_str = source[er.start + er.length:] - followed_unit_match = regex.search( - self.config.followed_unit, after_str) + after_str = source[er.start + er.length :] + followed_unit_match = regex.search(self.config.followed_unit, after_str) if followed_unit_match and followed_unit_match.start() == 0: - durations.append(Token(er.start, er.start + - er.length + len(followed_unit_match.group()))) + durations.append(Token(er.start, er.start + er.length + len(followed_unit_match.group()))) for match in regex.finditer(self.config.number_combined_with_unit, source): durations.append(Token(match.start(), match.end())) for duration in durations: - before_str = source[:duration.start].lower() + before_str = source[: duration.start].lower() if not before_str.strip(): continue match = regex.search(self.config.past_regex, before_str) - if match and not before_str[match.end():].strip(): + if match and not before_str[match.end() :].strip(): tokens.append(Token(match.start(), duration.end)) continue match = regex.search(self.config.future_regex, before_str) - if match and not before_str[match.end():].strip(): + if match and not before_str[match.end() :].strip(): tokens.append(Token(match.start(), duration.end)) return tokens diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_extractor_config.py index c94c988b4b..56d4e65b27 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_extractor_config.py @@ -3,13 +3,19 @@ from typing import List, Pattern +from recognizers_number import ( + BaseNumberParser, + ChineseCardinalExtractor, + ChineseNumberExtractor, + ChineseNumberParserConfiguration, + ChineseOrdinalExtractor, +) from recognizers_text import Extractor, Parser, RegExpUtility -from recognizers_number import ChineseNumberExtractor, ChineseNumberParserConfiguration, BaseNumberParser, \ - ChineseCardinalExtractor, ChineseOrdinalExtractor + from ...resources.base_date_time import BaseDateTime from ...resources.chinese_date_time import ChineseDateTime -from ..extractors import DateTimeExtractor from ..base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex +from ..extractors import DateTimeExtractor from .date_extractor import ChineseDateExtractor @@ -199,83 +205,49 @@ def range_connector_regex(self) -> Pattern: return None def __init__(self): - self._season_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SeasonRegex - ) - self._month_suffix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.MonthSuffixRegex - ) - self._year_regex_in_number = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearRegexInNumber - ) - self._strict_year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.StrictYearRegex - ) - self._last_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodLastRegex - ) - self._next_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodNextRegex - ) - self._this_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodThisRegex - ) - self._month_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.MonthRegex - ) + self._season_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SeasonRegex) + self._month_suffix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.MonthSuffixRegex) + self._year_regex_in_number = RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearRegexInNumber) + self._strict_year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.StrictYearRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodLastRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodNextRegex) + self._next_next_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodNextNextRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodThisRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.MonthRegex) self._zero_to_nine_integer_regex_chinese = RegExpUtility.get_safe_reg_exp( ChineseDateTime.ZeroToNineIntegerRegexCJK ) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.RelativeMonthRegex - ) - self._day_regex_in_chinese = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodDayRegexInCJK - ) - self._day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DayRegex - ) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.RelativeMonthRegex) + self._day_regex_in_chinese = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodDayRegexInCJK) + self._day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DayRegex) self._simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(ChineseDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(ChineseDateTime.OneWordPeriodRegex), RegExpUtility.get_safe_reg_exp(ChineseDateTime.StrictYearRegex), RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearToYear), - RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearToYearSuffixRequired), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearToYearSuffixRequired), RegExpUtility.get_safe_reg_exp(ChineseDateTime.MonthToMonth), RegExpUtility.get_safe_reg_exp(ChineseDateTime.MonthToMonthSuffixRequired), RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearAndMonth), - RegExpUtility.get_safe_reg_exp( - ChineseDateTime.PureNumYearAndMonth), - RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodYearInCJKRegex), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.PureNumYearAndMonth), + RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodYearInCJKRegex), RegExpUtility.get_safe_reg_exp(ChineseDateTime.WeekOfMonthRegex), RegExpUtility.get_safe_reg_exp(ChineseDateTime.SeasonWithYear), RegExpUtility.get_safe_reg_exp(ChineseDateTime.QuarterRegex), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.DecadeRegex) + RegExpUtility.get_safe_reg_exp(ChineseDateTime.DecadeRegex), ] - self._illegal_year_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.IllegalYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodTillRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.FollowedUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NumberCombinedWithUnit) - self._past_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.PastRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.FutureRegex) + self._illegal_year_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.IllegalYearRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodTillRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(ChineseDateTime.FollowedUnit) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NumberCombinedWithUnit) + self._past_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.FutureRegex) self._date_point_extractor = ChineseDateExtractor() self._integer_extractor = ChineseNumberExtractor() - self._number_parser = BaseNumberParser( - ChineseNumberParserConfiguration()) - self._now_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NowRegex) - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.MonthNumRegex) + self._number_parser = BaseNumberParser(ChineseNumberParserConfiguration()) + self._now_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NowRegex) + self._month_num_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.MonthNumRegex) self._cardinal_extractor = ChineseCardinalExtractor() self._ordinal_extractor = ChineseOrdinalExtractor() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_parser.py index d2a385db0f..418e48a102 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_parser.py @@ -1,56 +1,43 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Optional from datetime import datetime, timedelta -from datedelta import datedelta +from typing import Optional + import regex +from datedelta import datedelta -from recognizers_text import RegExpUtility, ExtractResult -from recognizers_number import ChineseIntegerExtractor, CJKNumberParser, ChineseNumberParserConfiguration,\ - Constants as NumberConstants +from recognizers_number import ChineseIntegerExtractor, ChineseNumberParserConfiguration, CJKNumberParser +from recognizers_number import Constants as NumberConstants +from recognizers_text import ExtractResult, RegExpUtility from ...resources.chinese_date_time import ChineseDateTime +from ..base_dateperiod import BaseDatePeriodParser from ..constants import Constants, TimeTypeConstants -from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils, DayOfWeek from ..parsers import DateTimeParseResult -from ..base_dateperiod import BaseDatePeriodParser +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils, DayOfWeek from .dateperiod_parser_config import ChineseDatePeriodParserConfiguration -from ..utilities import parse_chinese_dynasty_year class ChineseDatePeriodParser(BaseDatePeriodParser): def __init__(self): super().__init__(ChineseDatePeriodParserConfiguration()) self.integer_extractor = ChineseIntegerExtractor() - self.number_parser = CJKNumberParser( - ChineseNumberParserConfiguration()) - self.year_in_chinese_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodYearInCJKRegex) - self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NumberCombinedWithUnit) - self.unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.UnitRegex) - self.year_and_month_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearAndMonth) - self.pure_number_year_and_month_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.PureNumYearAndMonth) - self.year_to_year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearToYear) - self.year_to_year_suffix_required = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearToYearSuffixRequired) - self.chinese_year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodYearInCJKRegex) - self.season_with_year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SeasonWithYear) - self.decade_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DecadeRegex) - self.date_this_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodThisRegex) - self.date_last_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodLastRegex) - self.date_next_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodNextRegex) + self.number_parser = CJKNumberParser(ChineseNumberParserConfiguration()) + self.year_in_chinese_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodYearInCJKRegex) + self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NumberCombinedWithUnit) + self.unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.UnitRegex) + self.year_and_month_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearAndMonth) + self.pure_number_year_and_month_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.PureNumYearAndMonth) + self.year_to_year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearToYear) + self.year_to_year_suffix_required = RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearToYearSuffixRequired) + self.chinese_year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodYearInCJKRegex) + self.season_with_year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SeasonWithYear) + self.decade_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DecadeRegex) + self.date_this_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodThisRegex) + self.date_last_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodLastRegex) + self.date_next_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodNextRegex) + self.date_next_next_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodNextNextRegex) def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: result_value = None @@ -62,23 +49,19 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self._parse_simple_cases(source_text, reference) if not inner_result.success: - inner_result = self._parse_one_word_period( - source_text, reference) + inner_result = self._parse_one_word_period(source_text, reference) if not inner_result.success: - inner_result = self._merge_two_times_points( - source_text, reference) + inner_result = self._merge_two_times_points(source_text, reference) if not inner_result.success: - inner_result = self._parse_number_with_unit( - source_text, reference) + inner_result = self._parse_number_with_unit(source_text, reference) if not inner_result.success: inner_result = self._parse_duration(source_text, reference) if not inner_result.success: - inner_result = self._parse_year_and_month( - source_text, reference) + inner_result = self._parse_year_and_month(source_text, reference) if not inner_result.success: inner_result = self._parse_year_to_year(source_text, reference) @@ -87,8 +70,7 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D inner_result = self._parse_year(source_text, reference) if not inner_result.success: - inner_result = self._parse_week_of_month( - source_text, reference) + inner_result = self._parse_week_of_month(source_text, reference) if not inner_result.success: inner_result = self._parse_season(source_text, reference) @@ -103,13 +85,11 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if inner_result.future_value and inner_result.past_value: inner_result.future_resolution = { TimeTypeConstants.START_DATE: DateTimeFormatUtil.format_date(inner_result.future_value[0]), - TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date( - inner_result.future_value[1]) + TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date(inner_result.future_value[1]), } inner_result.past_resolution = { TimeTypeConstants.START_DATE: DateTimeFormatUtil.format_date(inner_result.past_value[0]), - TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date( - inner_result.past_value[1]) + TimeTypeConstants.END_DATE: DateTimeFormatUtil.format_date(inner_result.past_value[1]), } else: inner_result.future_resolution = {} @@ -162,23 +142,19 @@ def _parse_simple_cases(self, source: str, reference: datetime) -> DateTimeResol no_year = True begin_date_luis = DateTimeFormatUtil.luis_date( - year if input_year or self.config.is_future(month_str) else -1, month, begin_day) + year if input_year or self.config.is_future(month_str) else -1, month, begin_day + ) end_date_luis = DateTimeFormatUtil.luis_date( - year if input_year or self.config.is_future(month_str) else -1, month, end_day) + year if input_year or self.config.is_future(month_str) else -1, month, end_day + ) future_past_begin_date = DateUtils.generate_dates(no_year, reference, year, month, begin_day) future_past_end_date = DateUtils.generate_dates(no_year, reference, year, month, end_day) result.timex = f'({begin_date_luis},{end_date_luis},P{end_day - begin_day}D)' - result.future_value = [ - future_past_begin_date[0], - future_past_end_date[0] - ] - result.past_value = [ - future_past_begin_date[1], - future_past_end_date[1] - ] + result.future_value = [future_past_begin_date[0], future_past_end_date[0]] + result.past_value = [future_past_begin_date[1], future_past_end_date[1]] result.success = True return result @@ -195,7 +171,7 @@ def _parse_number_with_unit(self, source: str, reference: datetime) -> DateTimeR return result num_str = RegExpUtility.get_group(match, Constants.NUM) - before_str = source[:match.start()].strip().lower() + before_str = source[: match.start()].strip().lower() return self.__parse_common_duration_with_unit(before_str, source_unit, num_str, reference) @@ -203,8 +179,7 @@ def _parse_duration(self, source: str, reference: datetime) -> DateTimeResolutio result = DateTimeResolutionResult() # for case "前两年" "后三年" - duration_result = next( - iter(self.config.duration_extractor.extract(source, reference)), None) + duration_result = next(iter(self.config.duration_extractor.extract(source, reference)), None) if not duration_result: return result @@ -216,14 +191,16 @@ def _parse_duration(self, source: str, reference: datetime) -> DateTimeResolutio if source_unit not in self.config.unit_map: return result - before_str = source[:duration_result.start].strip().lower() - number_str = duration_result.text[:match.start()].strip().lower() + before_str = source[: duration_result.start].strip().lower() + number_str = duration_result.text[: match.start()].strip().lower() number_val = self.__convert_chinese_to_number(number_str) num_str = str(number_val) return self.__parse_common_duration_with_unit(before_str, source_unit, num_str, reference) - def __parse_common_duration_with_unit(self, before: str, unit: str, num: str, reference: datetime) -> DateTimeResolutionResult: + def __parse_common_duration_with_unit( + self, before: str, unit: str, num: str, reference: datetime + ) -> DateTimeResolutionResult: result = DateTimeResolutionResult() unit_str = self.config.unit_map[unit] @@ -326,8 +303,7 @@ def _parse_year_and_month(self, source: str, reference: datetime) -> DateTimeRes month = 12 begin_date = DateUtils.safe_create_from_min_value(year, month, 1) - end_date = DateUtils.safe_create_from_min_value( - year, month, 1) + datedelta(months=1) + end_date = DateUtils.safe_create_from_min_value(year, month, 1) + datedelta(months=1) result.future_value = [begin_date, end_date] result.past_value = [begin_date, end_date] @@ -347,33 +323,40 @@ def _parse_year_to_year(self, source: str, reference: datetime) -> DateTimeResol return result year_matches = list(regex.finditer(self.config.year_regex, source)) - chinese_year_matches = list( - regex.finditer(self.chinese_year_regex, source)) + chinese_year_matches = list(regex.finditer(self.chinese_year_regex, source)) begin_year = 0 end_year = 0 if len(year_matches) == 2: begin_year = self.__convert_chinese_to_number( - RegExpUtility.get_group(year_matches[0], Constants.YEAR_GROUP_NAME)) + RegExpUtility.get_group(year_matches[0], Constants.YEAR_GROUP_NAME) + ) end_year = self.__convert_chinese_to_number( - RegExpUtility.get_group(year_matches[1], Constants.YEAR_GROUP_NAME)) + RegExpUtility.get_group(year_matches[1], Constants.YEAR_GROUP_NAME) + ) elif len(chinese_year_matches) == 2: - begin_year = self._convert_year(RegExpUtility.get_group( - chinese_year_matches[0], Constants.YEAR_CHINESE), True) - end_year = self._convert_year(RegExpUtility.get_group( - chinese_year_matches[1], Constants.YEAR_CHINESE), True) + begin_year = self._convert_year( + RegExpUtility.get_group(chinese_year_matches[0], Constants.YEAR_CHINESE), True + ) + end_year = self._convert_year( + RegExpUtility.get_group(chinese_year_matches[1], Constants.YEAR_CHINESE), True + ) elif len(year_matches) == 1 and len(chinese_year_matches) == 1: if year_matches[0].start() < chinese_year_matches[0].start(): begin_year = self.__convert_chinese_to_number( - RegExpUtility.get_group(year_matches[0], Constants.YEAR_GROUP_NAME)) + RegExpUtility.get_group(year_matches[0], Constants.YEAR_GROUP_NAME) + ) end_year = self.__convert_chinese_to_number( - RegExpUtility.get_group(chinese_year_matches[0], Constants.YEAR_CHINESE)) + RegExpUtility.get_group(chinese_year_matches[0], Constants.YEAR_CHINESE) + ) else: begin_year = self.__convert_chinese_to_number( - RegExpUtility.get_group(chinese_year_matches[0], Constants.YEAR_CHINESE)) + RegExpUtility.get_group(chinese_year_matches[0], Constants.YEAR_CHINESE) + ) end_year = self.__convert_chinese_to_number( - RegExpUtility.get_group(year_matches[0], Constants.YEAR_GROUP_NAME)) + RegExpUtility.get_group(year_matches[0], Constants.YEAR_GROUP_NAME) + ) begin_year = self.__sanitize_year(begin_year) end_year = self.__sanitize_year(end_year) @@ -436,7 +419,14 @@ def _parse_year(self, source: str, reference: datetime) -> DateTimeResolutionRes def _convert_year(self, year_str: str, is_chinese: bool) -> int: year = -1 if is_chinese: - dynasty_year = parse_chinese_dynasty_year(year_str, self.config.dynasty_year_regex, self.config.dynasty_start_year, self.config.dynasty_year_map, self.integer_extractor, self.number_parser) + dynasty_year = DateTimeFormatUtil.parse_dynasty_year( + year_str, + self.config.dynasty_year_regex, + self.config.dynasty_start_year, + self.config.dynasty_year_map, + self.integer_extractor, + self.number_parser, + ) if dynasty_year is not None: return dynasty_year @@ -477,14 +467,11 @@ def _get_week_of_month(self, cardinal, month, year, reference, no_year) -> DateT if not past_date.month == month: past_date = past_date + timedelta(days=-7) - result.timex = ( - 'XXXX' if no_year else f'{year:04d}') + f'-{month:02d}-W{cardinal:02d}' + result.timex = ('XXXX' if no_year else f'{year:04d}') + f'-{month:02d}-W{cardinal:02d}' days_to_add = 6 if self._inclusive_end_period else 7 - result.future_value = [future_date, - future_date + timedelta(days=days_to_add)] - result.past_value = [past_date, - past_date + timedelta(days=days_to_add)] + result.future_value = [future_date, future_date + timedelta(days=days_to_add)] + result.past_value = [past_date, past_date + timedelta(days=days_to_add)] result.success = True return result @@ -586,10 +573,8 @@ def _parse_quarter(self, source: str, reference: datetime) -> DateTimeResolution cardinal_str = RegExpUtility.get_group(match, Constants.CARDINAL) quarter_num = self.config.cardinal_map.get(cardinal_str, None) - begin_date = DateUtils.safe_create_from_min_value( - year, quarter_num * 3 - 2, 1) - end_date = DateUtils.safe_create_from_min_value( - year, quarter_num * 3 + 1, 1) + begin_date = DateUtils.safe_create_from_min_value(year, quarter_num * 3 - 2, 1) + end_date = DateUtils.safe_create_from_min_value(year, quarter_num * 3 + 1, 1) result.future_value = [begin_date, end_date] result.past_value = [begin_date, end_date] @@ -658,8 +643,14 @@ def _parse_decade(self, source: str, reference: datetime) -> DateTimeResolutionR if not input_century and start_date >= reference: past_year -= 100 - result.future_value = [DateUtils.safe_create_from_min_value(future_year, 1, 1), DateUtils.safe_create_from_min_value(future_year + decade_last_year, 1, 1)] - result.past_value = [DateUtils.safe_create_from_min_value(past_year, 1, 1), DateUtils.safe_create_from_min_value(past_year + decade_last_year, 1, 1)] + result.future_value = [ + DateUtils.safe_create_from_min_value(future_year, 1, 1), + DateUtils.safe_create_from_min_value(future_year + decade_last_year, 1, 1), + ] + result.past_value = [ + DateUtils.safe_create_from_min_value(past_year, 1, 1), + DateUtils.safe_create_from_min_value(past_year + decade_last_year, 1, 1), + ] result.success = True return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_parser_config.py index 52ac95930e..9de0caff25 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/dateperiod_parser_config.py @@ -1,18 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern + import regex from recognizers_text import RegExpUtility from ...resources.chinese_date_time import ChineseDateTime +from ..base_dateperiod import DatePeriodParserConfiguration from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_dateperiod import DatePeriodParserConfiguration -from .duration_extractor import ChineseDurationExtractor from .date_extractor import ChineseDateExtractor from .date_parser import ChineseDateParser +from .duration_extractor import ChineseDurationExtractor class ChineseDatePeriodParserConfiguration(DatePeriodParserConfiguration): @@ -223,46 +224,32 @@ def dynasty_start_year(self) -> str: def __init__(self): self._complex_dateperiod_regex = None self._relative_decade_regex = None - self._relative_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.RelativeRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.RelativeRegex) self._date_extractor = ChineseDateExtractor() self._date_parser = ChineseDateParser() self._duration_extractor = ChineseDurationExtractor() - self._simple_cases_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SimpleCasesRegex) - self._one_word_period_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.OneWordPeriodRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.PastRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.FutureRegex) - self._week_of_month_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.WeekOfMonthRegex) - self._quarter_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.QuarterRegex) - self._season_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SeasonRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodNextRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodLastRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DatePeriodThisRegex) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.OneWordPeriodRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.FutureRegex) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.WeekOfMonthRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.QuarterRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SeasonRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodNextRegex) + self._next_next_prefix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodNextNextRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodLastRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DatePeriodThisRegex) self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(r'\0') - self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp( - r'\0') + self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(r'\0') self._token_before_date = ' on ' self._day_of_month = ChineseDateTime.ParserConfigurationDayOfMonth self._month_of_year = ChineseDateTime.ParserConfigurationMonthOfYear self._cardinal_map = ChineseDateTime.ParserConfigurationCardinalMap self._season_map = ChineseDateTime.ParserConfigurationSeasonMap self._unit_map = ChineseDateTime.ParserConfigurationUnitMap - self._now_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NowRegex) - self._dynasty_year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DynastyYearRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NowRegex) + self._dynasty_year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DynastyYearRegex) self._dynasty_year_map = ChineseDateTime.DynastyYearMap self._dynasty_start_year = ChineseDateTime.DynastyStartYear # TODO When the implementation for these properties is added, change the None values to their respective Regexps diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor.py index 906906cdb8..9929f70875 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor.py @@ -1,28 +1,25 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List from datetime import datetime -import regex -from .duration_extractor import ChineseDurationExtractor +from typing import List -from ...resources.chinese_date_time import ChineseDateTime +import regex -from recognizers_text import ExtractResult, RegExpUtility, MetaData +from recognizers_text import ExtractResult, MetaData, RegExpUtility +from ...resources.chinese_date_time import ChineseDateTime +from ..base_datetime import BaseDateTimeExtractor from ..constants import Constants from ..utilities import Token, merge_all_tokens -from ..base_datetime import BaseDateTimeExtractor from .datetime_extractor_config import ChineseDateTimeExtractorConfiguration +from .duration_extractor import ChineseDurationExtractor class ChineseDateTimeExtractor(BaseDateTimeExtractor): - before_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.BeforeRegex) - after_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.AfterRegex) - date_time_period_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodUnitRegex) + before_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.BeforeRegex) + after_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.AfterRegex) + date_time_period_unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodUnitRegex) def __init__(self): super().__init__(ChineseDateTimeExtractorConfiguration()) @@ -44,8 +41,7 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: tokens: List[Token] = list() - ers: List[ExtractResult] = self.config.date_point_extractor.extract( - source, reference) + ers: List[ExtractResult] = self.config.date_point_extractor.extract(source, reference) if len(ers) < 1: return tokens @@ -58,8 +54,8 @@ def merge_date_and_time(self, source: str, reference: datetime) -> List[Token]: ers = sorted(ers, key=lambda x: x.start) i = 0 - while i < len(ers)-1: - j = i+1 + while i < len(ers) - 1: + j = i + 1 while j < len(ers) and ers[i].overlap(ers[j]): j += 1 @@ -91,18 +87,17 @@ def time_of_today(self, source: str, reference: datetime) -> List[Token]: ers = self.config.time_point_extractor.extract(source, reference) for er in ers: - before = source[:er.start] + before = source[: er.start] inner_match = regex.search(self.config.night_regex, er.text) if inner_match is not None and inner_match.start() == 0: - before = source[:er.start + len(inner_match.group())] + before = source[: er.start + len(inner_match.group())] if not before: continue - match = regex.search( - self.config.time_of_today_before_regex, before) - if match is not None and not before[match.end():].strip(): + match = regex.search(self.config.time_of_today_before_regex, before) + if match is not None and not before[match.end() :].strip(): begin = match.start() end = er.start + er.length tokens.append(Token(begin, end)) @@ -120,8 +115,9 @@ def duration_with_ago_and_later(self, source: str, reference: datetime) -> List[ before_match = RegExpUtility.get_matches(self.before_regex, suffix) after_match = RegExpUtility.get_matches(self.after_regex, suffix) - if (before_match and suffix.startswith(before_match[0])) \ - or (after_match and suffix.startswith(after_match[0])): + if (before_match and suffix.startswith(before_match[0])) or ( + after_match and suffix.startswith(after_match[0]) + ): meta_data = MetaData() meta_data.is_duration_with_ago_and_later = True ret.append(Token(er.start, pos + 1, meta_data)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor_config.py index 7fce33ffb9..9e6cd68a8c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor_config.py @@ -2,13 +2,14 @@ # Licensed under the MIT License. from typing import Pattern + import regex from recognizers_text import RegExpUtility from ...resources.chinese_date_time import ChineseDateTime -from ..extractors import DateTimeExtractor from ..base_datetime import DateTimeExtractorConfiguration +from ..extractors import DateTimeExtractor from .date_extractor import ChineseDateExtractor from .time_extractor import ChineseTimeExtractor @@ -108,25 +109,15 @@ def utility_configuration(self) -> any: def __init__(self): super().__init__() - self._datetime_period_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodUnitRegex - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.AfterRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.BeforeRegex - ) + self._datetime_period_unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodUnitRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.AfterRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.BeforeRegex) self._date_point_extractor = ChineseDateExtractor() self._time_point_extractor = ChineseTimeExtractor() - self._now_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NowRegex) - self._night_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NightRegex) - self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeOfSpecialDayRegex) - self._preposition_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NowRegex) + self._night_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NightRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeOfSpecialDayRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.PrepositionRegex) # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._year_regex = None self._year_suffix = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_parser.py index 1328cfaee9..39c0d8daf2 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_parser.py @@ -1,19 +1,20 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Optional from datetime import datetime, timedelta +from typing import Optional + +from recognizers_text import ExtractResult, RegExpUtility + +from ..base_datetime import BaseDateTimeParser +from ..constants import Constants, TimeTypeConstants +from ..parsers import DateTimeParseResult +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult from .date_extractor import ChineseDateExtractor from .date_parser import ChineseDateParser from .datetime_extractor import ChineseDateTimeExtractor -from .duration_extractor import ChineseDurationExtractor -from ..base_datetime import BaseDateTimeParser -from ..parsers import DateTimeParseResult -from ..constants import TimeTypeConstants, Constants -from recognizers_number import Constants as NumberConstants -from recognizers_text import RegExpUtility, ExtractResult -from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils from .datetime_parser_config import ChineseDateTimeParserConfiguration +from .duration_extractor import ChineseDurationExtractor class ChineseDateTimeParser(BaseDateTimeParser): @@ -40,9 +41,11 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if inner_result.success: inner_result.future_resolution = { - TimeTypeConstants.DATETIME: DateTimeFormatUtil.format_date_time(inner_result.future_value)} + TimeTypeConstants.DATETIME: DateTimeFormatUtil.format_date_time(inner_result.future_value) + } inner_result.past_resolution = { - TimeTypeConstants.DATETIME: DateTimeFormatUtil.format_date_time(inner_result.past_value)} + TimeTypeConstants.DATETIME: DateTimeFormatUtil.format_date_time(inner_result.past_value) + } value = inner_result ret = DateTimeParseResult(source) @@ -84,19 +87,22 @@ def _merge_date_and_time(self, source: str, reference: datetime) -> DateTimeReso time_str = pr2.timex_str if time_str.endswith('ampm'): - time_str = time_str[0:len(time_str)-4] + time_str = time_str[0 : len(time_str) - 4] time_str = 'T' + DateTimeFormatUtil.to_str(hour, 2) + time_str[3:] ret.timex = pr1.timex_str + time_str val = pr2.value - if hour <= 12 and not self.config.pm_time_regex.search(source) and not self.config.am_time_regex.search(source) and val.comment: + if ( + hour <= 12 + and not self.config.pm_time_regex.search(source) + and not self.config.am_time_regex.search(source) + and val.comment + ): ret.comment = 'ampm' - ret.future_value = datetime( - future_date.year, future_date.month, future_date.day, hour, minute, second) - ret.past_value = datetime( - past_date.year, past_date.month, past_date.day, hour, minute, second) + ret.future_value = datetime(future_date.year, future_date.month, future_date.day, hour, minute, second) + ret.past_value = datetime(past_date.year, past_date.month, past_date.day, hour, minute, second) ret.success = True return ret @@ -136,8 +142,7 @@ def _parse_time_of_today(self, source: str, reference: datetime) -> DateTimeReso time_str = 'T' + DateTimeFormatUtil.to_str(hour, 2) + time_str[3:] ret.timex = DateTimeFormatUtil.format_date(date) + time_str - ret.future_value = datetime( - date.year, date.month, date.day, hour, minute, second) + ret.future_value = datetime(date.year, date.month, date.day, hour, minute, second) ret.past_value = ret.future_value ret.success = True return ret @@ -152,10 +157,10 @@ def _parser_duration_with_ago_and_later(self, source: str, reference: datetime) if duration_res: match = ChineseDateTimeExtractor.date_time_period_unit_regex.search(source) if match: - suffix = source[duration_res.start + duration_res.length:] + suffix = source[duration_res.start + duration_res.length :] src_unit = RegExpUtility.get_group(match, 'unit') - number_str = source[duration_res.start:match.lastindex - duration_res.start + 1] + number_str = source[duration_res.start : match.lastindex - duration_res.start + 1] number = ChineseDateParser.parse_chinese_written_number_to_value(ChineseDateParser(), number_str) if src_unit in self.config.unit_map: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_parser_config.py index 4bdcc67843..f89b8ef73c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_parser_config.py @@ -1,24 +1,24 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.chinese_date_time import ChineseDateTime +from ..base_datetime import MatchedTimex from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_configs import BaseDateParserConfiguration -from ..base_datetime import DateTimeParserConfiguration, MatchedTimex from .date_extractor import ChineseDateExtractor -from .time_extractor import ChineseTimeExtractor from .date_parser import ChineseDateParser +from .time_extractor import ChineseTimeExtractor from .time_parser import ChineseTimeParser -class ChineseDateTimeParserConfiguration(): +class ChineseDateTimeParserConfiguration: @property def token_before_date(self) -> str: raise NotImplementedError() @@ -112,14 +112,10 @@ def __init__(self): self._time_extractor = ChineseTimeExtractor() self._date_parser = ChineseDateParser() self._time_parser = ChineseTimeParser() - self._pm_time_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimeSimplePmRegex) - self._am_time_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimeSimpleAmRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeOfSpecialDayRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NowRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimeSimplePmRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimeSimpleAmRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeOfSpecialDayRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NowRegex) def have_ambiguous_token(self, source: str, matched_text: str) -> bool: return False diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_extractor.py index b19111febb..9407422eb7 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_extractor.py @@ -1,28 +1,26 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List from datetime import datetime +from typing import List + import regex -from recognizers_text import RegExpUtility, ExtractResult +from recognizers_text import ExtractResult, RegExpUtility from ...resources.chinese_date_time import ChineseDateTime -from ..constants import Constants -from ..utilities import merge_all_tokens, Token from ..base_datetimeperiod import BaseDateTimePeriodExtractor +from ..constants import Constants +from ..utilities import Token, merge_all_tokens from .datetimeperiod_extractor_config import ChineseDateTimePeriodExtractorConfiguration class ChineseDateTimePeriodExtractor(BaseDateTimePeriodExtractor): def __init__(self): super().__init__(ChineseDateTimePeriodExtractorConfiguration()) - self.zhijian_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.ZhijianRegex) - self.past_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.PastRegex) - self.future_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.FutureRegex) + self.zhijian_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.ZhijianRegex) + self.past_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.PastRegex) + self.future_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.FutureRegex) def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: if reference is None: @@ -46,8 +44,10 @@ def merge_date_and_time_period(self, source: str, reference: datetime) -> List[T for extract_result_date in extract_results_date: time_results.append(extract_result_date) - while j < len(extract_results_time) and extract_results_time[j].start + extract_results_time[j].length\ - <= extract_result_date.start: + while ( + j < len(extract_results_time) + and extract_results_time[j].start + extract_results_time[j].length <= extract_result_date.start + ): time_results.append(extract_results_time[j]) j = j + 1 @@ -79,9 +79,9 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] tokens: List[Token] = list() source = source.strip().lower() extract_results_datetime: List[ExtractResult] = self.config.single_date_time_extractor.extract( - source, reference) - extract_results_time: List[ExtractResult] = self.config.single_time_extractor.extract( - source, reference) + source, reference + ) + extract_results_time: List[ExtractResult] = self.config.single_time_extractor.extract(source, reference) inner_marks: List[ExtractResult] = list() j = 0 @@ -89,8 +89,10 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] for er_datetime in extract_results_datetime: inner_marks.append(er_datetime) - while j < len(extract_results_time) and extract_results_time[j].start + extract_results_time[j].length\ - < er_datetime.start: + while ( + j < len(extract_results_time) + and extract_results_time[j].start + extract_results_time[j].length < er_datetime.start + ): inner_marks.append(extract_results_time[j]) j += 1 @@ -136,8 +138,7 @@ def merge_two_time_points(self, source: str, reference: datetime) -> List[Token] after_str = source[period_end:].strip() match = regex.search(self.zhijian_regex, after_str) if match: - tokens.append( - Token(period_begin, period_end + len(match.group()))) + tokens.append(Token(period_begin, period_end + len(match.group()))) index += 2 continue @@ -150,32 +151,35 @@ def match_number_with_unit(self, source: str) -> List[Token]: durations: List[Token] = list() for extract_result in self.config.cardinal_extractor.extract(source): - after_str = source[extract_result.start + extract_result.length:] - followed_unit_match = regex.search( - self.config.followed_unit, after_str) + after_str = source[extract_result.start + extract_result.length :] + followed_unit_match = regex.search(self.config.followed_unit, after_str) if followed_unit_match and followed_unit_match.start() == 0: - durations.append(Token(extract_result.start, extract_result.start + - extract_result.length + len(followed_unit_match.group()))) + durations.append( + Token( + extract_result.start, + extract_result.start + extract_result.length + len(followed_unit_match.group()), + ) + ) for match in regex.finditer(self.config.time_unit_regex, source): durations.append(Token(match.start(), match.end())) for duration in durations: - before_str = source[:duration.start].lower() + before_str = source[: duration.start].lower() if not before_str.strip(): continue match = regex.search(self.past_regex, before_str) - if match and not before_str[match.end():].strip(): + if match and not before_str[match.end() :].strip(): tokens.append(Token(match.start(), duration.end)) continue match = regex.search(self.future_regex, before_str) - if match and not before_str[match.end():].strip(): + if match and not before_str[match.end() :].strip(): tokens.append(Token(match.start(), duration.end)) return tokens @@ -184,21 +188,18 @@ def match_night(self, source: str, reference: datetime) -> List[Token]: tokens: List[Token] = list() source = source.strip().lower() - matches = regex.finditer( - self.config.specific_time_of_day_regex, source) + matches = regex.finditer(self.config.specific_time_of_day_regex, source) tokens.extend(map(lambda x: Token(x.start(), x.end()), matches)) - ers_date: List[ExtractResult] = self.config.single_date_extractor.extract( - source, reference) + ers_date: List[ExtractResult] = self.config.single_date_extractor.extract(source, reference) for er in ers_date: - after_str = source[er.start + er.length:] + after_str = source[er.start + er.length :] match = regex.search(self.config.time_of_day_regex, after_str) if match: - middle_str = source[0:match.start()] + middle_str = source[0 : match.start()] if not middle_str.strip() or regex.search(self.config.preposition_regex, middle_str): - tokens.append( - Token(er.start, er.start + er.length + match.end())) + tokens.append(Token(er.start, er.start + er.length + match.end())) return tokens diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_extractor_config.py index fc7c2efa35..b81ffd6c06 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_extractor_config.py @@ -3,15 +3,15 @@ from typing import Pattern -from recognizers_text import Extractor, RegExpUtility from recognizers_number import ChineseCardinalExtractor +from recognizers_text import Extractor, RegExpUtility from ...resources.chinese_date_time import ChineseDateTime -from ..extractors import DateTimeExtractor from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex +from ..extractors import DateTimeExtractor from .date_extractor import ChineseDateExtractor -from .time_extractor import ChineseTimeExtractor from .datetime_extractor import ChineseDateTimeExtractor +from .time_extractor import ChineseTimeExtractor class ChineseDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): @@ -181,49 +181,25 @@ def simple_cases_regexes(self) -> Pattern: def __init__(self): super().__init__() - self._past_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.PastRegex - ) - self._future_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.FutureRegex - ) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.NumberCombinedWithUnit - ) - self._this_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateThisRegex - ) - self._last_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateLastRegex - ) - self._next_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateNextRegex - ) - self._zhijian_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.ZhijianRegex - ) - self._hour_num_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.HourNumRegex - ) - self._hour_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.HourRegex - ) + self._past_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.FutureRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(ChineseDateTime.NumberCombinedWithUnit) + self._this_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateThisRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateLastRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateNextRegex) + self._zhijian_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.ZhijianRegex) + self._hour_num_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.HourNumRegex) + self._hour_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.HourRegex) self._cardinal_extractor = ChineseCardinalExtractor() self._single_date_extractor = ChineseDateExtractor() self._single_time_extractor = ChineseTimeExtractor() self._single_date_time_extractor = ChineseDateTimeExtractor() - self._preposition_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodPrepositionRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodTillRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeOfDayRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodFollowedUnit) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodUnitRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodPrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodTillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeOfDayRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodFollowedUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodUnitRegex) # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._check_both_before_after = None self._suffix_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_parser.py index e42f40bb04..9e5c6b5583 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_parser.py @@ -1,46 +1,43 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Optional from datetime import datetime, timedelta +from typing import Optional + import regex +from recognizers_number import ( + ChineseCardinalExtractor, + ChineseNumberParserConfiguration, + CJKNumberParser, + ExtractResult, +) from recognizers_text import RegExpUtility -from recognizers_number import ExtractResult, ChineseCardinalExtractor,\ - CJKNumberParser, ChineseNumberParserConfiguration from ...resources.chinese_date_time import ChineseDateTime -from ..constants import TimeTypeConstants, Constants -from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils -from ..parsers import DateTimeParseResult from ..base_datetimeperiod import BaseDateTimePeriodParser, BeginEnd -from .datetimeperiod_parser_config import ChineseDateTimePeriodParserConfiguration +from ..constants import Constants, TimeTypeConstants +from ..parsers import DateTimeParseResult +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils from .date_extractor import ChineseDateExtractor +from .datetimeperiod_parser_config import ChineseDateTimePeriodParserConfiguration from .timeperiod_extractor import ChineseTimePeriodExtractor class ChineseDateTimePeriodParser(BaseDateTimePeriodParser): def __init__(self): super().__init__(ChineseDateTimePeriodParserConfiguration()) - self.tmo_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodMORegex) - self.tmi_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodMIRegex) - self.taf_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodAFRegex) - self.tev_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodEVRegex) - self.tni_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodNIRegex) - self.unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DateTimePeriodUnitRegex) - self.time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeOfDayRegex) + self.tmo_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodMORegex) + self.tmi_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodMIRegex) + self.taf_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodAFRegex) + self.tev_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodEVRegex) + self.tni_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodNIRegex) + self.unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DateTimePeriodUnitRegex) + self.time_of_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeOfDayRegex) self.single_date_extractor = ChineseDateExtractor() self.time_period_extractor = ChineseTimePeriodExtractor() self.cardinal_extractor = ChineseCardinalExtractor() - self.cardinal_parser = CJKNumberParser( - ChineseNumberParserConfiguration()) + self.cardinal_parser = CJKNumberParser(ChineseNumberParserConfiguration()) def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: if reference is None: @@ -51,30 +48,30 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if source.type is self.parser_type_name: source_text = source.text.strip().lower() - inner_result = self.merge_date_and_time_periods( - source_text, reference) + inner_result = self.merge_date_and_time_periods(source_text, reference) if not inner_result.success: - inner_result = self.merge_two_time_points( - source_text, reference) + inner_result = self.merge_two_time_points(source_text, reference) if not inner_result.success: - inner_result = self.parse_specific_time_of_day( - source_text, reference) + inner_result = self.parse_specific_time_of_day(source_text, reference) if not inner_result.success: - inner_result = self._parse_number_with_unit( - source_text, reference) + inner_result = self._parse_number_with_unit(source_text, reference) if inner_result.success: inner_result.future_resolution[TimeTypeConstants.START_DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.future_value[0]) + inner_result.future_value[0] + ) inner_result.future_resolution[TimeTypeConstants.END_DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.future_value[1]) + inner_result.future_value[1] + ) inner_result.past_resolution[TimeTypeConstants.START_DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.past_value[0]) + inner_result.past_value[0] + ) inner_result.past_resolution[TimeTypeConstants.END_DATETIME] = DateTimeFormatUtil.format_date_time( - inner_result.past_value[1]) + inner_result.past_value[1] + ) result.value = inner_result result.timex_str = inner_result.timex if inner_result is not None else '' result.resolution_str = '' @@ -99,20 +96,25 @@ def merge_date_and_time_periods(self, trimmed_source: str, reference: datetime) result.future_value = ( DateUtils.safe_create_from_min_value( - future_date.year, future_date.month, future_date.day, - begin_time.hour, begin_time.minute, begin_time.second), + future_date.year, + future_date.month, + future_date.day, + begin_time.hour, + begin_time.minute, + begin_time.second, + ), DateUtils.safe_create_from_min_value( - future_date.year, future_date.month, future_date.day, - end_time.hour, end_time.minute, end_time.second) + future_date.year, future_date.month, future_date.day, end_time.hour, end_time.minute, end_time.second + ), ) result.past_value = ( DateUtils.safe_create_from_min_value( - past_date.year, past_date.month, past_date.day, - begin_time.hour, begin_time.minute, begin_time.second), + past_date.year, past_date.month, past_date.day, begin_time.hour, begin_time.minute, begin_time.second + ), DateUtils.safe_create_from_min_value( - past_date.year, past_date.month, past_date.day, - end_time.hour, end_time.minute, end_time.second) + past_date.year, past_date.month, past_date.day, end_time.hour, end_time.minute, end_time.second + ), ) split = parsed_result2.timex_str.split('T') @@ -130,8 +132,7 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes prs: BeginEnd = None time_ers = self.config.time_extractor.extract(source, reference) - datetime_ers = self.config.date_time_extractor.extract( - source, reference) + datetime_ers = self.config.date_time_extractor.extract(source, reference) both_has_date = False begin_has_date = False @@ -139,25 +140,30 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes if len(datetime_ers) == 2: prs = self.get_two_points( - datetime_ers[0], datetime_ers[1], self.config.date_time_parser, self.config.date_time_parser, reference) + datetime_ers[0], datetime_ers[1], self.config.date_time_parser, self.config.date_time_parser, reference + ) both_has_date = True elif len(datetime_ers) == 1 and len(time_ers) == 2: if datetime_ers[0].overlap(time_ers[0]): prs = self.get_two_points( - datetime_ers[0], time_ers[1], self.config.date_time_parser, self.config.time_parser, reference) + datetime_ers[0], time_ers[1], self.config.date_time_parser, self.config.time_parser, reference + ) begin_has_date = True else: prs = self.get_two_points( - time_ers[0], datetime_ers[0], self.config.time_parser, self.config.date_time_parser, reference) + time_ers[0], datetime_ers[0], self.config.time_parser, self.config.date_time_parser, reference + ) end_has_date = True elif len(datetime_ers) == 1 and len(time_ers) == 1: if time_ers[0].start < datetime_ers[0].start: prs = self.get_two_points( - time_ers[0], datetime_ers[0], self.config.time_parser, self.config.date_time_parser, reference) + time_ers[0], datetime_ers[0], self.config.time_parser, self.config.date_time_parser, reference + ) end_has_date = True else: prs = self.get_two_points( - datetime_ers[0], time_ers[0], self.config.date_time_parser, self.config.time_parser, reference) + datetime_ers[0], time_ers[0], self.config.date_time_parser, self.config.time_parser, reference + ) begin_has_date = True if prs is None or not prs.begin.value or not prs.end.value: @@ -181,32 +187,30 @@ def merge_two_time_points(self, source: str, reference: datetime) -> DateTimeRes left_time = DateUtils.safe_create_from_min_value_date_time(reference) if both_has_date: - right_time = DateUtils.safe_create_from_min_value_date_time( - future_end) - left_time = DateUtils.safe_create_from_min_value_date_time( - future_begin) + right_time = DateUtils.safe_create_from_min_value_date_time(future_end) + left_time = DateUtils.safe_create_from_min_value_date_time(future_begin) elif begin_has_date: # TODO: Handle "明天下午两点到五点" future_end = self.get_datetime(future_begin, future_end) past_end = self.get_datetime(past_begin, past_end) - left_time = DateUtils.safe_create_from_min_value_date_time( - future_begin) + left_time = DateUtils.safe_create_from_min_value_date_time(future_begin) elif end_has_date: # TODO: Handle "明天下午两点到五点" future_begin = self.get_datetime(future_end, future_begin) past_begin = self.get_datetime(past_end, past_begin) - right_time = DateUtils.safe_create_from_min_value_date_time( - future_end) + right_time = DateUtils.safe_create_from_min_value_date_time(future_end) left: DateTimeResolutionResult = prs.begin.value right: DateTimeResolutionResult = prs.end.value left_result_time: datetime = left.future_value right_result_time: datetime = right.future_value - left_time += timedelta(hours=left_result_time.hour, - minutes=left_result_time.minute, seconds=left_result_time.second) - right_time += timedelta(hours=right_result_time.hour, - minutes=right_result_time.minute, seconds=right_result_time.second) + left_time += timedelta( + hours=left_result_time.hour, minutes=left_result_time.minute, seconds=left_result_time.second + ) + right_time += timedelta( + hours=right_result_time.hour, minutes=right_result_time.minute, seconds=right_result_time.second + ) # the right side time contains "ampm", while the left side doesn't if right.comment == 'ampm' and not left.comment and right_time < left_time: @@ -249,10 +253,8 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.timex = DateTimeFormatUtil.format_date(date) + values.time_str result.future_value = result.past_value = [ - DateUtils.safe_create_from_min_value( - year, month, day, values.begin_hour, 0, 0), - DateUtils.safe_create_from_min_value( - year, month, day, values.end_hour, values.end_min, values.end_min) + DateUtils.safe_create_from_min_value(year, month, day, values.begin_hour, 0, 0), + DateUtils.safe_create_from_min_value(year, month, day, values.end_hour, values.end_min, values.end_min), ] result.success = True @@ -297,10 +299,8 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.timex = DateTimeFormatUtil.format_date(date) + time_str result.future_value = result.past_value = [ - DateUtils.safe_create_from_min_value( - year, month, day, begin_hour, 0, 0), - DateUtils.safe_create_from_min_value( - year, month, day, end_hour, end_min, end_min) + DateUtils.safe_create_from_min_value(year, month, day, begin_hour, 0, 0), + DateUtils.safe_create_from_min_value(year, month, day, end_hour, end_min, end_min), ] result.success = True @@ -309,7 +309,7 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi # handle Date followed by morning, afternoon match = regex.search(self.config.time_of_day_regex, trimmed_source) if match: - before_str = trimmed_source[0:match.start()].strip() + before_str = trimmed_source[0 : match.start()].strip() extracted_results = self.single_date_extractor.extract(before_str, reference) if len(extracted_results) == 0 or extracted_results[0].length != len(before_str): @@ -322,17 +322,19 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.timex = parse_result.timex_str + time_str result.future_value = ( - DateUtils.safe_create_from_min_value(future_date.year, future_date.month, future_date.day, - begin_hour, 0, 0), - DateUtils.safe_create_from_min_value(future_date.year, future_date.month, future_date.day, - end_hour, end_min, end_min) + DateUtils.safe_create_from_min_value( + future_date.year, future_date.month, future_date.day, begin_hour, 0, 0 + ), + DateUtils.safe_create_from_min_value( + future_date.year, future_date.month, future_date.day, end_hour, end_min, end_min + ), ) result.past_value = ( - DateUtils.safe_create_from_min_value(past_date.year, past_date.month, past_date.day, - begin_hour, 0, 0), - DateUtils.safe_create_from_min_value(past_date.year, past_date.month, past_date.day, - end_hour, end_min, end_min) + DateUtils.safe_create_from_min_value(past_date.year, past_date.month, past_date.day, begin_hour, 0, 0), + DateUtils.safe_create_from_min_value( + past_date.year, past_date.month, past_date.day, end_hour, end_min, end_min + ), ) result.success = True @@ -347,29 +349,31 @@ def _parse_number_with_unit(self, source: str, reference: datetime) -> DateTimeR if len(ers) == 1: er = ers[0] pr = self.cardinal_parser.parse(er) - source_unit: str = source[er.start + er.length:].strip().lower() + source_unit: str = source[er.start + er.length :].strip().lower() if source_unit.startswith('个'): source_unit = source_unit[1:] - before_str = source[:er.start].strip().lower() + before_str = source[: er.start].strip().lower() - return self.__parse_common_duration_with_unit(before_str, source_unit, - pr.resolution_str, float(pr.value), reference) + return self.__parse_common_duration_with_unit( + before_str, source_unit, pr.resolution_str, float(pr.value), reference + ) # handle "last hour" match = regex.search(self.unit_regex, source) if match: source_unit = RegExpUtility.get_group(match, 'unit') - before_str = source[:match.start()].strip().lower() + before_str = source[: match.start()].strip().lower() return self.__parse_common_duration_with_unit(before_str, source_unit, '1', 1, reference) return result - def __parse_common_duration_with_unit(self, before: str, unit: str, num: str, swift: float, reference: datetime)\ - -> DateTimeResolutionResult: + def __parse_common_duration_with_unit( + self, before: str, unit: str, num: str, swift: float, reference: datetime + ) -> DateTimeResolutionResult: result = DateTimeResolutionResult() if unit not in self.config.unit_map: @@ -407,10 +411,16 @@ def __parse_common_duration_with_unit(self, before: str, unit: str, num: str, sw else: return result - begin_timex = DateTimeFormatUtil.luis_date_from_datetime( - begin_date) + 'T' + DateTimeFormatUtil.luis_time_from_datetime(begin_date) - end_timex = DateTimeFormatUtil.luis_date_from_datetime( - end_date) + 'T' + DateTimeFormatUtil.luis_time_from_datetime(end_date) + begin_timex = ( + DateTimeFormatUtil.luis_date_from_datetime(begin_date) + + 'T' + + DateTimeFormatUtil.luis_time_from_datetime(begin_date) + ) + end_timex = ( + DateTimeFormatUtil.luis_date_from_datetime(end_date) + + 'T' + + DateTimeFormatUtil.luis_time_from_datetime(end_date) + ) result.timex = f'({begin_timex},{end_timex},PT{num}{unit_str[0]})' diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_parser_config.py index d535390161..37de016525 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetimeperiod_parser_config.py @@ -6,18 +6,18 @@ from recognizers_text import RegExpUtility from ...resources.chinese_date_time import ChineseDateTime -from ..extractors import DateTimeExtractor +from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange from ..constants import Constants +from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange from .date_extractor import ChineseDateExtractor -from .time_extractor import ChineseTimeExtractor -from .timeperiod_extractor import ChineseTimePeriodExtractor -from .datetime_extractor import ChineseDateTimeExtractor from .date_parser import ChineseDateParser +from .datetime_extractor import ChineseDateTimeExtractor +from .datetime_parser import ChineseDateTimeParser +from .time_extractor import ChineseTimeExtractor from .time_parser import ChineseTimeParser +from .timeperiod_extractor import ChineseTimePeriodExtractor from .timeperiod_parser import ChineseTimePeriodParser -from .datetime_parser import ChineseDateTimeParser class ChineseDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): @@ -149,17 +149,11 @@ def duration_parser(self) -> any: def __init__(self): self._after_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.AfterRegex) self._before_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.BeforeRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeOfDayRegex - ) - self._past_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.PastRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.FutureRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeOfDayRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.FutureRegex) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeOfDayRegex) self._unit_map = ChineseDateTime.ParserConfigurationUnitMap self._date_extractor = ChineseDateExtractor() self._time_extractor = ChineseTimeExtractor() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_extractor.py index ee9fea6181..e4db852581 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_extractor.py @@ -1,12 +1,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List from datetime import datetime +from typing import List + import regex -from recognizers_text import RegExpUtility, ExtractResult from recognizers_number_with_unit import NumberWithUnitExtractor +from recognizers_text import ExtractResult, RegExpUtility + from ...resources.chinese_date_time import ChineseDateTime from ..constants import Constants from .base_date_time_extractor import ChineseBaseDateTimeExtractor @@ -20,12 +22,9 @@ def extractor_type_name(self) -> str: def __init__(self): super().__init__(None) - self.extractor = NumberWithUnitExtractor( - ChineseDurationExtractorConfiguration()) - self.year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DurationYearRegex) - self.half_suffix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DurationHalfSuffixRegex) + self.extractor = NumberWithUnitExtractor(ChineseDurationExtractorConfiguration()) + self.year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DurationYearRegex) + self.half_suffix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DurationHalfSuffixRegex) def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: @@ -39,7 +38,7 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult continue # match suffix - suffix = source[er_result.start + er_result.length:] + suffix = source[er_result.start + er_result.length :] result.append(er_result) return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_extractor_config.py index cea9879cd8..e4d019285f 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_extractor_config.py @@ -3,9 +3,10 @@ from typing import Dict -from recognizers_text import RegExpUtility from recognizers_number.culture import Culture, CultureInfo -from recognizers_number_with_unit.number_with_unit.chinese.extractors import ChineseNumberWithUnitExtractorConfiguration +from recognizers_number_with_unit import ChineseNumberWithUnitExtractorConfiguration +from recognizers_text import RegExpUtility + from ...resources.chinese_date_time import ChineseDateTime from ..constants import Constants @@ -37,12 +38,8 @@ def half_suffix_regex(self): def __init__(self): super().__init__(CultureInfo(Culture.Chinese)) - self._year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DurationYearRegex - ) - self._half_suffix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.DurationHalfSuffixRegex - ) + self._year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DurationYearRegex) + self._half_suffix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.DurationHalfSuffixRegex) self._extract_type = Constants.SYS_DATETIME_DURATION self._suffix_list = ChineseDateTime.DurationSuffixList self._prefix_list = dict() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_parser.py index eaf2c24390..4594c4c730 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_parser.py @@ -1,24 +1,23 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Optional from datetime import datetime +from typing import Optional from recognizers_number_with_unit import NumberWithUnitParser +from ..base_duration import BaseDurationParser from ..constants import TimeTypeConstants -from ..utilities import DateTimeResolutionResult from ..extractors import ExtractResult from ..parsers import DateTimeParseResult -from ..base_duration import BaseDurationParser -from .duration_parser_config import ChineseDurationParserConfiguration, ChineseDurationNumberWithUnitParserConfiguration +from ..utilities import DateTimeResolutionResult +from .duration_parser_config import ChineseDurationNumberWithUnitParserConfiguration, ChineseDurationParserConfiguration class ChineseDurationParser(BaseDurationParser): def __init__(self): super().__init__(ChineseDurationParserConfiguration()) - self._internal_parser = NumberWithUnitParser( - ChineseDurationNumberWithUnitParserConfiguration()) + self._internal_parser = NumberWithUnitParser(ChineseDurationNumberWithUnitParserConfiguration()) def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: if reference is None: @@ -41,16 +40,13 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D number_str = unit_result.number unit_type = 'T' if self.is_less_than_day(unit_str) else '' - time_value = int(float(number_str) * - self.config.unit_value_map.get(unit_str, 1)) + time_value = int(float(number_str) * self.config.unit_value_map.get(unit_str, 1)) inner_result.timex = f'P{unit_type}{number_str}{unit_str[0]}' inner_result.future_value = time_value inner_result.past_value = time_value - inner_result.future_resolution[TimeTypeConstants.DURATION] = str( - inner_result.future_value) - inner_result.past_resolution[TimeTypeConstants.DURATION] = str( - inner_result.past_value) + inner_result.future_resolution[TimeTypeConstants.DURATION] = str(inner_result.future_value) + inner_result.past_resolution[TimeTypeConstants.DURATION] = str(inner_result.past_value) result = DateTimeParseResult(source) result.value = inner_result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_parser_config.py index 8a4aa7f7be..d147035edf 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/duration_parser_config.py @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from recognizers_number import CultureInfo, Culture +from recognizers_number import Culture, CultureInfo from recognizers_number_with_unit import ChineseNumberWithUnitParserConfiguration from ...resources.chinese_date_time import ChineseDateTime diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_extractor_config.py index 0e12a0c044..637f314f02 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_extractor_config.py @@ -18,5 +18,5 @@ def __init__(self): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(ChineseDateTime.HolidayRegexList1), RegExpUtility.get_safe_reg_exp(ChineseDateTime.HolidayRegexList2), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.LunarHolidayRegex) + RegExpUtility.get_safe_reg_exp(ChineseDateTime.LunarHolidayRegex), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_parser.py index 7aeece4cb0..5743e60281 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_parser.py @@ -1,62 +1,67 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Optional, Match from datetime import datetime, timedelta +from typing import Match, Optional + from datedelta import datedelta -from recognizers_number import ChineseIntegerExtractor, AgnosticNumberParserFactory,\ - ParserType as AgnosticNumberParserType, ChineseNumberParserConfiguration, Constants as NumberConstants + +from recognizers_number import AgnosticNumberParserFactory, ChineseIntegerExtractor, ChineseNumberParserConfiguration +from recognizers_number import Constants as NumberConstants +from recognizers_number import ParserType as AgnosticNumberParserType from recognizers_text.extractor import ExtractResult from ...resources.chinese_date_time import ChineseDateTime from ..base_holiday import BaseHolidayParser -from ..parsers import DateTimeParseResult -from .holiday_parser_config import ChineseHolidayParserConfiguration from ..constants import TimeTypeConstants +from ..parsers import DateTimeParseResult from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, RegExpUtility +from .holiday_parser_config import ChineseHolidayParserConfiguration class ChineseHolidayParser(BaseHolidayParser): def __init__(self): config = ChineseHolidayParserConfiguration() BaseHolidayParser.__init__(self, config) - self.__lunar_holiday_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.LunarHolidayRegex) + self.__lunar_holiday_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.LunarHolidayRegex) self.__integer_extractor = ChineseIntegerExtractor() self.__number_parser = AgnosticNumberParserFactory.get_parser( - AgnosticNumberParserType.INTEGER, ChineseNumberParserConfiguration()) - self.__fixed_holiday_dictionary = dict([ - ('元旦', ChineseHolidayParser.new_year), - ('元旦节', ChineseHolidayParser.new_year), - ('教师节', ChineseHolidayParser.teacher_day), - ('青年节', ChineseHolidayParser.youth_day), - ('儿童节', ChineseHolidayParser.children_day), - ('妇女节', ChineseHolidayParser.female_day), - ('植树节', ChineseHolidayParser.tree_plant_day), - ('情人节', ChineseHolidayParser.lover_day), - ('平安夜', ChineseHolidayParser.christmas_eve), - ('圣诞节', ChineseHolidayParser.christmas_day), - ('新年', ChineseHolidayParser.new_year), - ('愚人节', ChineseHolidayParser.fool_day), - ('五一', ChineseHolidayParser.labor_day), - ('劳动节', ChineseHolidayParser.labor_day), - ('万圣节', ChineseHolidayParser.halloween_day), - ('中秋节', ChineseHolidayParser.midautumn_day), - ('中秋', ChineseHolidayParser.midautumn_day), - ('春节', ChineseHolidayParser.spring_day), - ('除夕', ChineseHolidayParser.new_year_eve), - ('元宵节', ChineseHolidayParser.lantern_day), - ('清明节', ChineseHolidayParser.qing_ming_day), - ('清明', ChineseHolidayParser.qing_ming_day), - ('端午节', ChineseHolidayParser.dragon_boat_day), - ('端午', ChineseHolidayParser.dragon_boat_day), - ('国庆节', ChineseHolidayParser.chs_national_day), - ('建军节', ChineseHolidayParser.chs_mil_build_day), - ('女生节', ChineseHolidayParser.girls_day), - ('光棍节', ChineseHolidayParser.singles_day), - ('双十一', ChineseHolidayParser.singles_day), - ('重阳节', ChineseHolidayParser.chong_yang_day) - ]) + AgnosticNumberParserType.INTEGER, ChineseNumberParserConfiguration() + ) + self.__fixed_holiday_dictionary = dict( + [ + ('元旦', ChineseHolidayParser.new_year), + ('元旦节', ChineseHolidayParser.new_year), + ('教师节', ChineseHolidayParser.teacher_day), + ('青年节', ChineseHolidayParser.youth_day), + ('儿童节', ChineseHolidayParser.children_day), + ('妇女节', ChineseHolidayParser.female_day), + ('植树节', ChineseHolidayParser.tree_plant_day), + ('情人节', ChineseHolidayParser.lover_day), + ('平安夜', ChineseHolidayParser.christmas_eve), + ('圣诞节', ChineseHolidayParser.christmas_day), + ('新年', ChineseHolidayParser.new_year), + ('愚人节', ChineseHolidayParser.fool_day), + ('五一', ChineseHolidayParser.labor_day), + ('劳动节', ChineseHolidayParser.labor_day), + ('万圣节', ChineseHolidayParser.halloween_day), + ('中秋节', ChineseHolidayParser.midautumn_day), + ('中秋', ChineseHolidayParser.midautumn_day), + ('春节', ChineseHolidayParser.spring_day), + ('除夕', ChineseHolidayParser.new_year_eve), + ('元宵节', ChineseHolidayParser.lantern_day), + ('清明节', ChineseHolidayParser.qing_ming_day), + ('清明', ChineseHolidayParser.qing_ming_day), + ('端午节', ChineseHolidayParser.dragon_boat_day), + ('端午', ChineseHolidayParser.dragon_boat_day), + ('国庆节', ChineseHolidayParser.chs_national_day), + ('建军节', ChineseHolidayParser.chs_mil_build_day), + ('女生节', ChineseHolidayParser.girls_day), + ('光棍节', ChineseHolidayParser.singles_day), + ('双十一', ChineseHolidayParser.singles_day), + ('重阳节', ChineseHolidayParser.chong_yang_day), + ] + ) @staticmethod def new_year(year: int) -> datetime: @@ -157,17 +162,14 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D value = None if source.type == self.parser_type_name: - inner_result = self._parse_holiday_regex_match( - source.text, reference) + inner_result = self._parse_holiday_regex_match(source.text, reference) if inner_result.success: inner_result.future_resolution = { - TimeTypeConstants.DATE: DateTimeFormatUtil.format_date( - inner_result.future_value) + TimeTypeConstants.DATE: DateTimeFormatUtil.format_date(inner_result.future_value) } inner_result.past_resolution = { - TimeTypeConstants.DATE: DateTimeFormatUtil.format_date( - inner_result.past_value) + TimeTypeConstants.DATE: DateTimeFormatUtil.format_date(inner_result.past_value) } inner_result.is_lunar = self.__is_lunar(source.text) value = inner_result @@ -184,8 +186,7 @@ def __is_lunar(self, source: str) -> bool: def _match2date(self, match: Match, reference: datetime) -> DateTimeResolutionResult: result = DateTimeResolutionResult() - holiday_str = self.config.sanitize_holiday_token( - match.group('holiday').lower()) + holiday_str = self.config.sanitize_holiday_token(match.group('holiday').lower()) if not holiday_str: return result @@ -199,12 +200,12 @@ def _match2date(self, match: Match, reference: datetime) -> DateTimeResolutionRe if year_num: has_year = True if self.config.get_swift_year(year_num) == 0: - year_num = year_num[0:len(year_num) - 1] + year_num = year_num[0 : len(year_num) - 1] year = self.__convert_year(year_num, False) elif year_chinese: has_year = True if self.config.get_swift_year(year_chinese) == 0: - year_chinese = year_chinese[0:len(year_chinese) - 1] + year_chinese = year_chinese[0 : len(year_chinese) - 1] year = self.__convert_year(year_chinese, True) elif year_relative: has_year = True @@ -231,10 +232,8 @@ def _match2date(self, match: Match, reference: datetime) -> DateTimeResolutionRe result.past_value = datetime(year, date.month, date.day) else: result.timex = 'XXXX' + timex - result.future_value = self.__get_date_value( - date, reference, holiday_str, 1, lambda d, r: d < r) - result.past_value = self.__get_date_value( - date, reference, holiday_str, -1, lambda d, r: d >= r) + result.future_value = self.__get_date_value(date, reference, holiday_str, 1, lambda d, r: d < r) + result.past_value = self.__get_date_value(date, reference, holiday_str, -1, lambda d, r: d >= r) result.success = True @@ -269,7 +268,6 @@ def __get_date_value(self, date: datetime, reference: datetime, holiday: str, sw return date + datedelta(years=swift) if holiday in self.config.holiday_func_dictionary: - result = self.config.holiday_func_dictionary[holiday]( - reference.year + swift) + result = self.config.holiday_func_dictionary[holiday](reference.year + swift) return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_parser_config.py index 933214da3e..75ea2377aa 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/holiday_parser_config.py @@ -1,13 +1,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Callable from datetime import datetime +from typing import Callable, Dict, List from recognizers_text.utilities import RegExpUtility -from ..utilities import DateUtils -from ..base_holiday import BaseHolidayParserConfiguration + from ...resources.chinese_date_time import ChineseDateTime +from ..base_holiday import BaseHolidayParserConfiguration +from ..utilities import DateUtils class ChineseHolidayParserConfiguration(BaseHolidayParserConfiguration): @@ -43,16 +44,18 @@ def __init__(self): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(ChineseDateTime.HolidayRegexList1), RegExpUtility.get_safe_reg_exp(ChineseDateTime.HolidayRegexList2), - RegExpUtility.get_safe_reg_exp(ChineseDateTime.LunarHolidayRegex) + RegExpUtility.get_safe_reg_exp(ChineseDateTime.LunarHolidayRegex), ] self._variable_holidays_timex_dictionary = ChineseDateTime.HolidayNoFixedTimex def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: - local = dict([ - ('父亲节', BaseHolidayParserConfiguration.fathers_day), - ('母亲节', BaseHolidayParserConfiguration.mothers_day), - ('感恩节', BaseHolidayParserConfiguration.thanksgiving_day) - ]) + local = dict( + [ + ('父亲节', BaseHolidayParserConfiguration.fathers_day), + ('母亲节', BaseHolidayParserConfiguration.mothers_day), + ('感恩节', BaseHolidayParserConfiguration.thanksgiving_day), + ] + ) return {**super()._init_holiday_funcs(), **local} diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_extractor.py index 5ca4851970..aa3ee6a5a0 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_extractor.py @@ -1,8 +1,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List from datetime import datetime +from typing import List + import regex from recognizers_text import RegExpUtility @@ -15,32 +16,21 @@ class ChineseMergedExtractor(BaseMergedExtractor): def __init__(self, options: DateTimeOptions): super().__init__(ChineseMergedExtractorConfiguration(), options) - self.day_of_month_regex = RegExpUtility.get_safe_reg_exp( - '^\\d{1,2}号', regex.I) + self.day_of_month_regex = RegExpUtility.get_safe_reg_exp('^\\d{1,2}号', regex.I) def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: if reference is None: reference = datetime.now() result: List[ExtractResult] = list() - result = self.add_to( - result, self.config.date_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.time_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.duration_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.date_period_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.date_time_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.time_period_extractor.extract(source, reference), source) - result = self.add_to(result, self.config.date_time_period_extractor.extract( - source, reference), source) - result = self.add_to( - result, self.config.set_extractor.extract(source, reference), source) - result = self.add_to( - result, self.config.holiday_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.date_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.time_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.duration_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.date_period_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.date_time_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.time_period_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.date_time_period_extractor.extract(source, reference), source) + result = self.add_to(result, self.config.holiday_extractor.extract(source, reference), source) result = self._filter_ambiguity(result, source) @@ -53,49 +43,53 @@ def extract(self, source: str, reference: datetime = None) -> List[ExtractResult def add_mod(self, extract_results: List[ExtractResult], source: str): last_end = 0 for extract_result in extract_results: - before_str = source[last_end:extract_result.start].strip() - after_str = source[extract_result.start + extract_result.length:].strip() + before_str = source[last_end : extract_result.start].strip() + after_str = source[extract_result.start + extract_result.length :].strip() match = RegExpUtility.match_begin(self.config.before_regex, after_str, True) if match: mod_len = match.index + match.length extract_result.length += mod_len - extract_result.text = source[extract_result.start:extract_result.length + 1] + extract_result.text = source[extract_result.start : extract_result.length + 1] match = RegExpUtility.match_begin(self.config.after_regex, after_str, True) if match: mod_len = match.index + match.length extract_result.length += mod_len - extract_result.text = source[extract_result.start:extract_result.length + 1] + extract_result.text = source[extract_result.start : extract_result.length + 1] match = RegExpUtility.match_begin(self.config.until_regex, before_str, True) if match: mod_len = len(before_str) - match.index extract_result.length += mod_len extract_result.start -= mod_len - extract_result.text = source[extract_result.start:extract_result.length] + extract_result.text = source[extract_result.start : extract_result.length] match = RegExpUtility.match_begin(self.config.since_prefix_regex, before_str, True) if match: mod_len = len(before_str) + match.index extract_result.length += mod_len extract_result.start -= mod_len - extract_result.text = source[extract_result.start:extract_result.length] + extract_result.text = source[extract_result.start : extract_result.length] match = RegExpUtility.match_begin(self.config.since_suffix_regex, after_str, True) if match: mod_len = match.index + match.length extract_result.length += mod_len - extract_result.text = source[extract_result.start:extract_result.length] + extract_result.text = source[extract_result.start : extract_result.length] match = RegExpUtility.match_begin(self.config.equal_regex, before_str, True) if match: mod_len = len(before_str) + match.index extract_result.length += mod_len extract_result.start -= mod_len - extract_result.text = source[extract_result.start:extract_result.length] + extract_result.text = source[extract_result.start : extract_result.length] - def _filter_ambiguity(self, extract_results: List[ExtractResult], text: str, ) -> List[ExtractResult]: + def _filter_ambiguity( + self, + extract_results: List[ExtractResult], + text: str, + ) -> List[ExtractResult]: if self.config.ambiguity_filters_dict is not None: for regex_var in self.config.ambiguity_filters_dict: @@ -108,9 +102,18 @@ def _filter_ambiguity(self, extract_results: List[ExtractResult], text: str, ) - if reg_length > 0: matches = reg_len - new_ers = list(filter(lambda x: list( - filter(lambda m: m.start() < x.start + x.length and m.start() + - len(m.group()) > x.start, matches)), extract_results)) + new_ers = list( + filter( + lambda x: list( + filter( + lambda m: m.start() < x.start + x.length + and m.start() + len(m.group()) > x.start, + matches, + ) + ), + extract_results, + ) + ) if len(new_ers) > 0: for item in extract_results: for i in new_ers: @@ -141,7 +144,7 @@ def add_to(self, destination: List[ExtractResult], source: List[ExtractResult], if not is_found: destination.append(value) elif rm_index >= 0: - del destination[rm_index:rm_index + rm_len] + del destination[rm_index : rm_index + rm_len] destination = self.move_overlap(destination, value) destination.insert(rm_index, value) return destination @@ -150,8 +153,7 @@ def move_overlap(self, destination: List[ExtractResult], source: ExtractResult) duplicated: List[int] = list() for index, dest in enumerate(destination): includes_text = dest.text in source.text - same_boundary = source.start == dest.start or source.start + \ - source.length == dest.start + dest.length + same_boundary = source.start == dest.start or source.start + source.length == dest.start + dest.length if includes_text and same_boundary: duplicated.append(index) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_extractor_config.py index 9ec8e44250..8bfa1aa9e2 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_extractor_config.py @@ -1,31 +1,26 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List +from typing import List, Pattern from recognizers_text import RegExpUtility -from ...resources.chinese_date_time import ChineseDateTime, BaseDateTime -from ..extractors import DateTimeExtractor -from ..base_merged import MergedExtractorConfiguration +from ...resources.chinese_date_time import BaseDateTime, ChineseDateTime from ..base_holiday import BaseHolidayExtractor -from .duration_extractor import ChineseDurationExtractor -from .time_extractor import ChineseTimeExtractor +from ..base_merged import MergedExtractorConfiguration +from ..extractors import DateTimeExtractor from .date_extractor import ChineseDateExtractor -from .datetime_extractor import ChineseDateTimeExtractor -from .timeperiod_extractor import ChineseTimePeriodExtractor from .dateperiod_extractor import ChineseDatePeriodExtractor +from .datetime_extractor import ChineseDateTimeExtractor from .datetimeperiod_extractor import ChineseDateTimePeriodExtractor -from .set_extractor import ChineseSetExtractor +from .duration_extractor import ChineseDurationExtractor from .holiday_extractor_config import ChineseHolidayExtractorConfiguration +from .time_extractor import ChineseTimeExtractor +from .timeperiod_extractor import ChineseTimePeriodExtractor class ChineseMergedExtractorConfiguration(MergedExtractorConfiguration): - @property - def time_zone_extractor(self) -> any: - return self._time_zone_extractor - @property def datetime_alt_extractor(self) -> any: return self._datetime_alt_extractor @@ -98,10 +93,6 @@ def holiday_extractor(self) -> DateTimeExtractor: def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor - @property - def set_extractor(self) -> DateTimeExtractor: - return self._set_extractor - @property def integer_extractor(self) -> any: return None @@ -155,24 +146,12 @@ def equal_regex(self) -> Pattern: return self._equal_regex def __init__(self): - self._equal_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.EqualRegex - ) - self._since_suffix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.ParserConfigurationSinceSuffix - ) - self._since_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.ParserConfigurationSincePrefix - ) - self._until_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.ParserConfigurationUntil - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.AfterRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.BeforeRegex - ) + self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) + self._since_suffix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.ParserConfigurationSinceSuffix) + self._since_prefix_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.ParserConfigurationSincePrefix) + self._until_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.ParserConfigurationUntil) + self._after_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.AfterRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.BeforeRegex) self._ambiguity_filters_dict = ChineseDateTime.AmbiguityFiltersDict self._date_extractor = ChineseDateExtractor() self._time_extractor = ChineseTimeExtractor() @@ -180,10 +159,8 @@ def __init__(self): self._date_period_extractor = ChineseDatePeriodExtractor() self._time_period_extractor = ChineseTimePeriodExtractor() self._date_time_period_extractor = ChineseDateTimePeriodExtractor() - self._holiday_extractor = BaseHolidayExtractor( - ChineseHolidayExtractorConfiguration()) + self._holiday_extractor = BaseHolidayExtractor(ChineseHolidayExtractorConfiguration()) self._duration_extractor = ChineseDurationExtractor() - self._set_extractor = ChineseSetExtractor() # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._superfluous_word_matcher = None self._fail_fast_regex = None @@ -194,4 +171,3 @@ def __init__(self): self._around_regex = None self._term_filter_regexes = None self._datetime_alt_extractor = None - self._time_zone_extractor = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_parser.py index d5165528a0..e517163be1 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_parser.py @@ -1,15 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Optional, Dict, List from datetime import datetime +from typing import Dict, List, Optional from recognizers_text import ExtractResult -from ..utilities import DateTimeOptions, DateTimeResolutionResult, TimexUtil +from ..base_merged import BaseMergedParser from ..constants import Constants, TimeTypeConstants from ..parsers import DateTimeParseResult -from ..base_merged import BaseMergedParser +from ..utilities import DateTimeOptions, DateTimeResolutionResult, TimexUtil from .merged_parser_config import ChineseMergedParserConfiguration @@ -34,13 +34,13 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D has_before = True result.start += before_match.start() result.length -= len(before_match.group()) - result.text = result.text[before_match.start():] + result.text = result.text[before_match.start() :] mod_str = before_match.group() elif after_match and not self._is_duration_with_ago_and_later: has_after = True result.start += after_match.start() result.length -= len(after_match.group()) - result.text = result.text[after_match.start():] + result.text = result.text[after_match.start() :] mod_str = after_match.group() if source.type == Constants.SYS_DATETIME_DATE: @@ -56,12 +56,9 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D elif source.type == Constants.SYS_DATETIME_TIMEPERIOD: result = self.config.time_period_parser.parse(source, reference) elif source.type == Constants.SYS_DATETIME_DATETIMEPERIOD: - result = self.config.date_time_period_parser.parse( - source, reference) + result = self.config.date_time_period_parser.parse(source, reference) elif source.type == Constants.SYS_DATETIME_DURATION: result = self.config.duration_parser.parse(source, reference) - elif source.type == Constants.SYS_DATETIME_SET: - result = self.config.set_parser.parse(source, reference) else: return None @@ -82,15 +79,15 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D value.mod = TimeTypeConstants.AFTER_MOD result.value = value - result.value = self._date_time_resolution( - result, has_before, has_after) + result.value = self._date_time_resolution(result, has_before, has_after) - result.type = self.parser_type_name + '.' + \ - self._determine_date_time_types(result.type, has_before, has_after) + result.type = self.parser_type_name + '.' + self._determine_date_time_types(result.type, has_before, has_after) return result - def _date_time_resolution(self, slot: DateTimeParseResult, has_before: bool = False, has_after: bool = False, has_since: bool = False) -> Dict[str, List[Dict[str, str]]]: + def _date_time_resolution( + self, slot: DateTimeParseResult, has_before: bool = False, has_after: bool = False, has_since: bool = False + ) -> Dict[str, List[Dict[str, str]]]: if not slot: return None @@ -98,8 +95,7 @@ def _date_time_resolution(self, slot: DateTimeParseResult, has_before: bool = Fa resolutions: List[Dict[str, str]] = list() d_type = slot.type - output_type = self._determine_date_time_types( - d_type, has_before, has_after) + output_type = self._determine_date_time_types(d_type, has_before, has_after) timex = slot.timex_str value: DateTimeResolutionResult = slot.value @@ -124,20 +120,16 @@ def _date_time_resolution(self, slot: DateTimeParseResult, has_before: bool = Fa future_values = sorted(future.values()) past_values = sorted(past.values()) - intersect_values = [i for i, j in zip( - future_values, past_values) if i == j] + intersect_values = [i for i, j in zip(future_values, past_values) if i == j] if len(intersect_values) == len(past_values) and len(intersect_values) == len(future_values): if past_values: - self._add_resolution_fields_any( - result, Constants.RESOLVE_KEY, past) + self._add_resolution_fields_any(result, Constants.RESOLVE_KEY, past) else: if past_values: - self._add_resolution_fields_any( - result, Constants.RESOLVE_TO_PAST_KEY, past) + self._add_resolution_fields_any(result, Constants.RESOLVE_TO_PAST_KEY, past) if future_values: - self._add_resolution_fields_any( - result, Constants.RESOLVE_TO_FUTURE_KEY, future) + self._add_resolution_fields_any(result, Constants.RESOLVE_TO_FUTURE_KEY, future) if comment == 'ampm': if 'resolve' in result: @@ -147,20 +139,19 @@ def _date_time_resolution(self, slot: DateTimeParseResult, has_before: bool = Fa self._resolve_ampm(result, 'resolveToFuture') if TimexUtil._has_double_timex(comment): - TimexUtil._process_double_timex(result, Constants.RESOLVE_TO_FUTURE_KEY, Constants.RESOLVE_TO_PAST_KEY, timex) + TimexUtil._process_double_timex( + result, Constants.RESOLVE_TO_FUTURE_KEY, Constants.RESOLVE_TO_PAST_KEY, timex + ) if is_lunar: - self._add_resolution_fields_any( - result, Constants.IS_LUNAR_KEY, is_lunar) + self._add_resolution_fields_any(result, Constants.IS_LUNAR_KEY, is_lunar) for value in result.values(): if isinstance(value, dict): new_values = {} - self._add_resolution_fields( - new_values, Constants.TIMEX_KEY, timex) + self._add_resolution_fields(new_values, Constants.TIMEX_KEY, timex) self._add_resolution_fields(new_values, Constants.MOD_KEY, mod) - self._add_resolution_fields( - new_values, Constants.TYPE_KEY, output_type) + self._add_resolution_fields(new_values, Constants.TYPE_KEY, output_type) for inner_key in value: new_values[inner_key] = value[inner_key] @@ -173,7 +164,9 @@ def _date_time_resolution(self, slot: DateTimeParseResult, has_before: bool = Fa return {'values': resolutions} - def _determine_date_time_types(self, d_type: str, before: bool = False, after: bool = False, since: bool = False) -> str: + def _determine_date_time_types( + self, d_type: str, before: bool = False, after: bool = False, since: bool = False + ) -> str: if before or after or since: if d_type == Constants.SYS_DATETIME_DATE: return Constants.SYS_DATETIME_DATEPERIOD diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_parser_config.py index a4cd628efe..4abc0b606c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/merged_parser_config.py @@ -5,18 +5,17 @@ from recognizers_text import RegExpUtility -from ...resources.chinese_date_time import ChineseDateTime, BaseDateTime -from ..parsers import DateTimeParser +from ...resources.chinese_date_time import BaseDateTime, ChineseDateTime from ..base_merged import MergedParserConfiguration -from .duration_parser import ChineseDurationParser +from ..parsers import DateTimeParser from .date_parser import ChineseDateParser -from .time_parser import ChineseTimeParser from .dateperiod_parser import ChineseDatePeriodParser -from .timeperiod_parser import ChineseTimePeriodParser from .datetime_parser import ChineseDateTimeParser from .datetimeperiod_parser import ChineseDateTimePeriodParser +from .duration_parser import ChineseDurationParser from .holiday_parser import ChineseHolidayParser -from .set_parser import ChineseSetParser +from .time_parser import ChineseTimeParser +from .timeperiod_parser import ChineseTimePeriodParser class ChineseMergedParserConfiguration(MergedParserConfiguration): @@ -80,21 +79,12 @@ def date_time_period_parser(self) -> DateTimeParser: def duration_parser(self) -> DateTimeParser: return self._duration_parser - @property - def set_parser(self) -> DateTimeParser: - return self._set_parser - def __init__(self): self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.YearRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.MergedBeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.MergedAfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.MergedAfterRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.YearRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.MergedBeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.MergedAfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.MergedAfterRegex) self._date_parser = ChineseDateParser() self._holiday_parser = ChineseHolidayParser() self._time_parser = ChineseTimeParser() @@ -103,7 +93,6 @@ def __init__(self): self._time_period_parser = ChineseTimePeriodParser() self._date_time_period_parser = ChineseDateTimePeriodParser() self._duration_parser = ChineseDurationParser() - self._set_parser = ChineseSetParser() # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._around_regex = None self._suffix_after = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_extractor.py deleted file mode 100644 index 24c49dc6f0..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_extractor.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import List, Pattern -from datetime import datetime -import regex - -from recognizers_text import ExtractResult - -from ..extractors import DateTimeExtractor -from ..utilities import Token, merge_all_tokens -from ..base_set import BaseSetExtractor -from .set_extractor_config import ChineseSetExtractorConfiguration - - -class ChineseSetExtractor(BaseSetExtractor): - def __init__(self): - super().__init__(ChineseSetExtractorConfiguration()) - - def extract(self, source: str, reference: datetime = None) -> List[ExtractResult]: - if reference is None: - reference = datetime.now() - - tokens: List[Token] = list() - tokens.extend(self.match_each_unit(source)) - tokens.extend(self.match_each_duration(source, reference)) - tokens.extend(self.match_each_specific( - self.config.time_extractor, self.config.each_day_regex, source, reference)) - tokens.extend(self.match_each_specific( - self.config.date_extractor, self.config.each_prefix_regex, source, reference)) - tokens.extend(self.match_each_specific( - self.config.date_time_extractor, self.config.each_prefix_regex, source, reference)) - result = merge_all_tokens(tokens, source, self.extractor_type_name) - return result - - def match_each_specific(self, extractor: DateTimeExtractor, pattern: Pattern, source: str, reference: datetime) -> List[Token]: - for er in extractor.extract(source, reference): - before_str = source[0:er.start] - match = regex.search(pattern, before_str) - if match: - yield Token(match.start(), er.start + er.length) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_extractor_config.py deleted file mode 100644 index f8dafbe4fd..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_extractor_config.py +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern - -from recognizers_text import RegExpUtility - -from ...resources.chinese_date_time import ChineseDateTime -from ..base_set import SetExtractorConfiguration -from .duration_extractor import ChineseDurationExtractor -from .time_extractor import ChineseTimeExtractor -from .date_extractor import ChineseDateExtractor -from .datetime_extractor import ChineseDateTimeExtractor - - -class ChineseSetExtractorConfiguration(SetExtractorConfiguration): - @property - def last_regex(self) -> Pattern: - return self._last_regex - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> any: - return None - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def before_each_day_regex(self) -> Pattern: - return self._before_each_day_regex - - @property - def set_week_day_regex(self) -> any: - return None - - @property - def set_each_regex(self) -> any: - return None - - @property - def duration_extractor(self) -> ChineseDurationExtractor: - return self._duration_extractor - - @property - def time_extractor(self) -> ChineseTimeExtractor: - return self._time_extractor - - @property - def date_extractor(self) -> ChineseDateExtractor: - return self._date_extractor - - @property - def date_time_extractor(self) -> ChineseDateTimeExtractor: - return self._date_time_extractor - - @property - def date_period_extractor(self) -> any: - return None - - @property - def time_period_extractor(self) -> any: - return None - - @property - def date_time_period_extractor(self) -> any: - return None - - def __init__(self): - self._last_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SetLastRegex) - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SetEachPrefixRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SetEachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SetEachDayRegex) - self._before_each_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SetEachDayRegex) - self._duration_extractor = ChineseDurationExtractor() - self._time_extractor = ChineseTimeExtractor() - self._date_extractor = ChineseDateExtractor() - self._date_time_extractor = ChineseDateTimeExtractor() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_parser.py deleted file mode 100644 index 2b264c0e6f..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_parser.py +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Optional -from datetime import datetime - -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import ExtractResult -from ..constants import TimeTypeConstants -from ..utilities import DateTimeResolutionResult -from ..base_set import BaseSetParser -from ..parsers import DateTimeParser, DateTimeParseResult -from ..extractors import DateTimeExtractor -from .set_parser_config import ChineseSetParserConfiguration - - -class ChineseSetParser(BaseSetParser): - def __init__(self): - config = ChineseSetParserConfiguration() - BaseSetParser.__init__(self, config) - - def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: - if reference is None: - reference = datetime.now() - - value = None - - if source.type is self.parser_type_name: - inner_result = self.parse_each_unit(source.text) - - if not inner_result.success: - inner_result = self.parse_each_duration(source.text, reference) - - if not inner_result.success: - inner_result = self.parser_time_everyday(source.text, reference) - - if not inner_result.success: - inner_result = self.parse_each( - self.config.date_time_extractor, self.config.date_time_parser, source.text, reference) - - if not inner_result.success: - inner_result = self.parse_each( - self.config.date_extractor, self.config.date_parser, source.text, reference) - - if inner_result.success: - inner_result.future_resolution[TimeTypeConstants.SET] = inner_result.future_value - inner_result.past_resolution[TimeTypeConstants.SET] = inner_result.past_value - value = inner_result - - result = DateTimeParseResult(source) - result.value = value - result.timex_str = value.timex if value else '' - result.resolution_str = '' - - return result - - def parse_each_unit(self, source: str) -> DateTimeResolutionResult: - result = DateTimeResolutionResult() - - match = self.config.each_unit_regex.search(source) - if not (match and (match.end() - match.start()) == len(source)): - return result - - source_unit = RegExpUtility.get_group(match, 'unit') - if not (source_unit and source_unit in self.config.unit_map): - return result - - get_matched_unit_timex = self.config.get_matched_unit_timex( - source_unit) - if not get_matched_unit_timex.matched: - return result - - result.timex = get_matched_unit_timex.timex - result.future_value = result.past_value = 'Set: ' + result.timex - result.success = True - return result - - def parser_time_everyday(self, source: str, reference: datetime) -> DateTimeResolutionResult: - result = DateTimeResolutionResult() - ers = self.config.time_extractor.extract(source, reference) - if len(ers) != 1: - return result - - er = ers[0] - before_str = source[0: er.start] - match = self.config.each_day_regex.search(before_str) - if not match: - return result - - pr = self.config.time_parser.parse(er) - result.timex = pr.timex_str - result.future_value = result.past_value = 'Set: ' + result.timex - result.success = True - - return result - - def parse_each(self, extractor: DateTimeExtractor, parser: DateTimeParser, - source: str, reference: datetime) -> DateTimeResolutionResult: - result = DateTimeResolutionResult() - ers = extractor.extract(source, reference) - if len(ers) != 1: - return result - - er = ers[0] - before_str = source[0:er.start] - match = self.config.each_prefix_regex.search(before_str) - if not match: - return result - - timex = parser.parse(er).timex_str - result.timex = timex - result.future_value = 'Set: ' + timex - result.past_value = 'Set: ' + timex - result.success = True - - return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_parser_config.py deleted file mode 100644 index d8054db90e..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/set_parser_config.py +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern, Dict - -from recognizers_text.utilities import RegExpUtility -from ...resources.chinese_date_time import ChineseDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser -from ..base_set import SetParserConfiguration, MatchedTimex -from .date_extractor import ChineseDateExtractor -from .time_extractor import ChineseTimeExtractor -from .duration_extractor import ChineseDurationExtractor -from .datetime_extractor import ChineseDateTimeExtractor -from .date_parser import ChineseDateParser -from .time_parser import ChineseTimeParser -from .duration_parser import ChineseDurationParser -from .datetime_parser import ChineseDateTimeParser - - -class ChineseSetParserConfiguration(SetParserConfiguration): - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def duration_parser(self) -> DateTimeParser: - return self._duration_parser - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def time_parser(self) -> DateTimeParser: - return self._time_parser - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_parser(self) -> DateTimeParser: - return self._date_parser - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_time_parser(self) -> DateTimeParser: - return self._date_time_parser - - @property - def date_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError() - - @property - def date_period_parser(self) -> DateTimeParser: - raise NotImplementedError() - - @property - def time_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError() - - @property - def time_period_parser(self) -> DateTimeParser: - raise NotImplementedError() - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - raise NotImplementedError() - - @property - def date_time_period_parser(self) -> DateTimeParser: - raise NotImplementedError() - - @property - def unit_map(self) -> Dict[str, str]: - return self._unit_map - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - raise NotImplementedError() - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - raise NotImplementedError() - - @property - def set_each_regex(self) -> Pattern: - raise NotImplementedError() - - def __init__(self): - self._date_extractor = ChineseDateExtractor() - self._time_extractor = ChineseTimeExtractor() - self._duration_extractor = ChineseDurationExtractor() - self._date_time_extractor = ChineseDateTimeExtractor() - self._date_parser = ChineseDateParser() - self._time_parser = ChineseTimeParser() - self._duration_parser = ChineseDurationParser() - self._date_time_parser = ChineseDateTimeParser() - self._unit_map = ChineseDateTime.ParserConfigurationUnitMap - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SetEachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SetEachDayRegex) - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.SetEachPrefixRegex) - - def get_matched_daily_timex(self, text: str) -> MatchedTimex: - return None - - def get_matched_unit_timex(self, text: str) -> MatchedTimex: - timex = '' - - if text == '天' or text == '日': - timex = 'P1D' - elif text == '周' or text == '星期': - timex = 'P1W' - elif text == '月': - timex = 'P1M' - elif text == '年': - timex = 'P1Y' - - return MatchedTimex(not timex == '', timex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/time_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/time_extractor.py index 2975bbe7ed..fde56a4513 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/time_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/time_extractor.py @@ -2,6 +2,7 @@ # Licensed under the MIT License. from enum import Enum + from recognizers_text import RegExpUtility from ...resources.chinese_date_time import ChineseDateTime @@ -21,11 +22,12 @@ def extractor_type_name(self) -> str: return Constants.SYS_DATETIME_TIME def __init__(self): - super().__init__(dict([ - (RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeRegexes1), TimeType.ChineseTime), - (RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeRegexes2), TimeType.DigitTime), - (RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeRegexes3), TimeType.LessTime) - ])) + super().__init__( + dict( + [ + (RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeRegexes1), TimeType.ChineseTime), + (RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeRegexes2), TimeType.DigitTime), + (RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeRegexes3), TimeType.LessTime), + ] + ) + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/time_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/time_parser.py index 0c2a627111..af7642c2ed 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/time_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/time_parser.py @@ -1,18 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Optional from datetime import datetime +from typing import Optional from recognizers_text import RegExpUtility from ...resources.chinese_date_time import ChineseDateTime +from ..base_time import BaseTimeParser from ..constants import TimeTypeConstants -from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils from ..extractors import ExtractResult from ..parsers import DateTimeParseResult -from ..base_time import BaseTimeParser -from .base_date_time_extractor import DateTimeExtra, TimeResult, TimeResolutionUtils +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils +from .base_date_time_extractor import DateTimeExtra, TimeResolutionUtils, TimeResult from .time_extractor import ChineseTimeExtractor, TimeType @@ -25,7 +25,7 @@ def __init__(self): self.function_map = { TimeType.ChineseTime: self.handle_chinese, TimeType.DigitTime: self.handle_digit, - TimeType.LessTime: self.handle_less + TimeType.LessTime: self.handle_less, } self.inner_extractor = ChineseTimeExtractor() @@ -36,8 +36,7 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D extra: DateTimeExtra = source.data if not extra: - inner_result = next(iter(self.inner_extractor.extract( - source.text, reference)), ExtractResult()) + inner_result = next(iter(self.inner_extractor.extract(source.text, reference)), ExtractResult()) extra = inner_result.data time_result = self.function_map[extra.data_type](extra) @@ -45,9 +44,11 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D if parse_result.success: parse_result.future_resolution[TimeTypeConstants.TIME] = DateTimeFormatUtil.format_time( - parse_result.future_value) + parse_result.future_value + ) parse_result.past_resolution[TimeTypeConstants.TIME] = DateTimeFormatUtil.format_time( - parse_result.past_value) + parse_result.past_value + ) result = DateTimeParseResult(source) result.value = parse_result @@ -59,8 +60,7 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D def handle_less(self, extra: DateTimeExtra) -> TimeResult: hour = self.match_to_value(next(iter(extra.named_entity['hour']), '')) - quarter = self.match_to_value( - next(iter(extra.named_entity['quarter']), '')) + quarter = self.match_to_value(next(iter(extra.named_entity['quarter']), '')) has_half = next(iter(extra.named_entity['half']), '') == '' minute = 30 if not has_half else quarter * 15 if quarter != -1 else 0 second = self.match_to_value(next(iter(extra.named_entity['sec']), '')) @@ -81,16 +81,20 @@ def handle_digit(self, extra: DateTimeExtra) -> TimeResult: def handle_chinese(self, extra: DateTimeExtra) -> TimeResult: hour = self.match_to_value(next(iter(extra.named_entity['hour']), '')) - quarter = self.match_to_value( - next(iter(extra.named_entity['quarter']), '')) + quarter = self.match_to_value(next(iter(extra.named_entity['quarter']), '')) has_half = next(iter(extra.named_entity['half']), '') == '' - minute = 30 if not has_half else quarter * 15 if quarter != - \ - 1 else self.match_to_value(next(iter(extra.named_entity['min']), '')) + minute = ( + 30 + if not has_half + else quarter * 15 if quarter != -1 else self.match_to_value(next(iter(extra.named_entity['min']), '')) + ) second = self.match_to_value(next(iter(extra.named_entity['sec']), '')) return TimeResult(hour, minute, second) - def pack_time_result(self, extra: DateTimeExtra, time_result: TimeResult, reference: datetime) -> DateTimeResolutionResult: + def pack_time_result( + self, extra: DateTimeExtra, time_result: TimeResult, reference: datetime + ) -> DateTimeResolutionResult: result = DateTimeResolutionResult() day_description = next(iter(extra.named_entity['daydesc']), '') @@ -120,10 +124,8 @@ def pack_time_result(self, extra: DateTimeExtra, time_result: TimeResult, refere if hour == 24: hour = 0 - result.future_value = DateUtils.safe_create_from_min_value( - year, month, day, hour, minute, second) - result.past_value = DateUtils.safe_create_from_min_value( - year, month, day, hour, minute, second) + result.future_value = DateUtils.safe_create_from_min_value(year, month, day, hour, minute, second) + result.past_value = DateUtils.safe_create_from_min_value(year, month, day, hour, minute, second) result.timex = timex result.success = True @@ -136,5 +138,4 @@ def match_to_value(self, source: str) -> int: return TimeResolutionUtils.match_to_value(self.only_digit_match, self.numbers_map, source) def add_description(self, time_result: TimeResult, description: str): - TimeResolutionUtils.add_description( - time_result, self.low_bound_map, description) + TimeResolutionUtils.add_description(time_result, self.low_bound_map, description) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_extractor.py index c2bb7f1048..636b353496 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_extractor.py @@ -2,6 +2,7 @@ # Licensed under the MIT License. from enum import Enum + from recognizers_text import RegExpUtility from ...resources.chinese_date_time import ChineseDateTime @@ -20,11 +21,12 @@ def extractor_type_name(self) -> str: return Constants.SYS_DATETIME_TIMEPERIOD def __init__(self): - super().__init__(dict([ - (RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimePeriodRegexes1), TimePeriodType.FullTime), - (RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimePeriodRegexes2), TimePeriodType.ShortTime), - (RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeOfDayRegex), TimePeriodType.ShortTime) - ])) + super().__init__( + dict( + [ + (RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimePeriodRegexes1), TimePeriodType.FullTime), + (RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimePeriodRegexes2), TimePeriodType.ShortTime), + (RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeOfDayRegex), TimePeriodType.ShortTime), + ] + ) + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_parser.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_parser.py index 28082ffb20..9cf9bbe380 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_parser.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_parser.py @@ -1,18 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Optional, Match from datetime import datetime, timedelta +from typing import Match, Optional + import regex -from recognizers_text import RegExpUtility, ExtractResult +from recognizers_text import ExtractResult, RegExpUtility from ...resources.chinese_date_time import ChineseDateTime +from ..base_timeperiod import BaseTimePeriodParser from ..constants import Constants from ..parsers import DateTimeParseResult -from ..utilities import TimeTypeConstants, DateTimeFormatUtil, DateTimeResolutionResult, DateUtils, TimexUtil -from ..base_timeperiod import BaseTimePeriodParser -from .base_date_time_extractor import DateTimeExtra, TimeResult, TimeResolutionUtils +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils, TimeTypeConstants, TimexUtil +from .base_date_time_extractor import DateTimeExtra, TimeResolutionUtils, TimeResult from .timeperiod_extractor import TimePeriodType from .timeperiod_parser_config import ChineseTimePeriodParserConfiguration @@ -20,8 +21,7 @@ class ChineseTimePeriodParser(BaseTimePeriodParser): def __init__(self): super().__init__(ChineseTimePeriodParserConfiguration()) - self.day_description_regex = RegExpUtility.get_safe_reg_exp( - ChineseDateTime.TimeDayDescRegex) + self.day_description_regex = RegExpUtility.get_safe_reg_exp(ChineseDateTime.TimeDayDescRegex) self.only_digit_match = RegExpUtility.get_safe_reg_exp(r'\d+') self.numbers_map = ChineseDateTime.TimeNumberDictionary self.low_bound_map = ChineseDateTime.TimeLowBoundDesc @@ -37,21 +37,24 @@ def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[D return result if source.type is self.parser_type_name: - inner_result = self.parse_chinese_time_of_day( - source.text, reference) + inner_result = self.parse_chinese_time_of_day(source.text, reference) if inner_result.success is False: inner_result = self.parse_time_period(extra, reference) if inner_result.success: inner_result.future_resolution[TimeTypeConstants.START_TIME] = DateTimeFormatUtil.format_time( - inner_result.future_value[0]) + inner_result.future_value[0] + ) inner_result.future_resolution[TimeTypeConstants.END_TIME] = DateTimeFormatUtil.format_time( - inner_result.future_value[1]) + inner_result.future_value[1] + ) inner_result.past_resolution[TimeTypeConstants.START_TIME] = DateTimeFormatUtil.format_time( - inner_result.past_value[0]) + inner_result.past_value[0] + ) inner_result.past_resolution[TimeTypeConstants.END_TIME] = DateTimeFormatUtil.format_time( - inner_result.past_value[1]) + inner_result.past_value[1] + ) result.value = inner_result result.timex_str = inner_result.timex if inner_result is not None else '' @@ -72,10 +75,8 @@ def parse_chinese_time_of_day(self, text: str, reference: datetime) -> DateTimeR result.timex = parameters['timex'] result.future_value = result.past_value = [ - DateUtils.safe_create_from_min_value( - year, month, day, parameters['begin_hour'], 0, 0), - DateUtils.safe_create_from_min_value( - year, month, day, parameters['end_hour'], parameters['end_min'], 0) + DateUtils.safe_create_from_min_value(year, month, day, parameters['begin_hour'], 0, 0), + DateUtils.safe_create_from_min_value(year, month, day, parameters['end_hour'], parameters['end_min'], 0), ] result.success = True @@ -104,8 +105,13 @@ def get_matched_timex_range(self, text: str) -> dict: timex = None matched = False - return {'matched': matched, 'timex': timex, 'begin_hour': begin_hour, - 'end_hour': end_hour, 'end_min': end_min} + return { + 'matched': matched, + 'timex': timex, + 'begin_hour': begin_hour, + 'end_hour': end_hour, + 'end_min': end_min, + } parse_result = TimexUtil.parse_time_of_day(time_of_day) timex = parse_result.timex @@ -114,8 +120,7 @@ def get_matched_timex_range(self, text: str) -> dict: end_min = parse_result.end_min matched = True - return {'matched': matched, 'timex': timex, 'begin_hour': begin_hour, - 'end_hour': end_hour, 'end_min': end_min} + return {'matched': matched, 'timex': timex, 'begin_hour': begin_hour, 'end_hour': end_hour, 'end_min': end_min} def parse_time_period(self, extra: DateTimeExtra, reference: datetime) -> DateTimeResolutionResult: result = DateTimeResolutionResult() @@ -123,14 +128,12 @@ def parse_time_period(self, extra: DateTimeExtra, reference: datetime) -> DateTi left_entity = next(iter(extra.named_entity['left']), '') left_result: TimeResult = None if extra.data_type == TimePeriodType.FullTime: - left_result = self.get_parse_time_result( - left_entity, extra.match, reference) + left_result = self.get_parse_time_result(left_entity, extra.match, reference) else: left_result = self.get_short_left(left_entity) right_entity = next(iter(extra.named_entity['right']), '') - right_result = self.get_parse_time_result( - right_entity, extra.match, reference) + right_result = self.get_parse_time_result(right_entity, extra.match, reference) # the right side doesn't contain desc while the left side does if right_result.low_bound == -1 and left_result.low_bound != -1 and right_result.hour <= left_result.low_bound: @@ -171,18 +174,18 @@ def get_short_left(self, source: str) -> TimeResult: if regex.match(self.day_description_regex, source): description = source[:-1] - hour = TimeResolutionUtils.match_to_value( - self.only_digit_match, self.numbers_map, source[-1]) + hour = TimeResolutionUtils.match_to_value(self.only_digit_match, self.numbers_map, source[-1]) time_result = TimeResult(hour, -1, -1) - TimeResolutionUtils.add_description( - time_result, self.low_bound_map, description) + TimeResolutionUtils.add_description(time_result, self.low_bound_map, description) return time_result def build_date(self, time: TimeResult, reference: datetime) -> datetime: hour = self.__min_with_floor(time.hour) minute = self.__min_with_floor(time.minute) second = self.__min_with_floor(time.second) - return DateUtils.safe_create_from_min_value(reference.year, reference.month, reference.day, hour, minute, second) + return DateUtils.safe_create_from_min_value( + reference.year, reference.month, reference.day, hour, minute, second + ) def __min_with_floor(self, value: int) -> int: return value if value > 0 else 0 @@ -217,7 +220,7 @@ def build_span(self, left: TimeResult, right: TimeResult) -> str: if span_hour < 0: span_hour += 24 - span_timex = f'PT' + span_timex = 'PT' if span_hour != 0: span_timex += f'{span_hour}H' if span_min != 0: @@ -229,6 +232,5 @@ def build_span(self, left: TimeResult, right: TimeResult) -> str: def sanitize_time_result(self, source: TimeResult) -> TimeResult: return TimeResult( - source.hour, - 0 if source.minute == -1 else source.minute, - 0 if source.second == -1 else source.second) + source.hour, 0 if source.minute == -1 else source.minute, 0 if source.second == -1 else source.second + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_parser_config.py index 4e8e7ad278..a292870e17 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/timeperiod_parser_config.py @@ -1,11 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from recognizers_text import Extractor from recognizers_number import ChineseIntegerExtractor +from recognizers_text import Extractor -from ..parsers import DateTimeParser from ..base_timeperiod import TimePeriodParserConfiguration +from ..parsers import DateTimeParser from .time_parser import ChineseTimeParser diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/constants.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/constants.py index e7365193bd..b3e96ddd88 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/constants.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/constants.py @@ -13,8 +13,7 @@ class Constants: SYS_DATETIME_TIMEPERIOD: str = 'timerange' SYS_DATETIME_DATETIMEPERIOD: str = 'datetimerange' SYS_DATETIME_DURATION: str = 'duration' - SYS_DATETIME_SET: str = 'set' - SYS_DATETIME_TIMEZONE: str = 'timezone' + SYS_DATETIME_DATETIMEALT: str = 'datetimealt' SYS_DATETIME_MERGED: str = 'datetimeV2' @@ -44,25 +43,60 @@ class Constants: MIN_MONTH: int = 1 MAX_MONTH: int = 12 INVALID_YEAR = -2147483648 + INVALID_MONTH = -2147483648 INVALID_HOUR = -2147483648 INVALID_MINUTE = -2147483648 INVALID_SECOND = -2147483648 COMMENT_KEY: str = 'Comment' COMMENT_AMPM = 'ampm' + COMMENT_AM = 'am' COMMENT_DOUBLETIMEX = "doubleTimex" + # Default boundaries for time of day resolution + EARLY_MORNING_BEGIN_HOUR = 4 + EARLY_MORNING_END_HOUR = 8 + MORNING_BEGIN_HOUR = 8 + MORNING_END_HOUR = 12 + MID_DAY_BEGIN_HOUR = 11 + MID_DAY_END_HOUR = 13 + AFTERNOON_BEGIN_HOUR = 12 + AFTERNOON_END_HOUR = 16 + EVENING_BEGIN_HOUR = 16 + EVENING_END_HOUR = 20 + DAYTIME_BEGIN_HOUR = 8 + DAYTIME_END_HOUR = 18 + NIGHTTIME_BEGIN_HOUR = 0 + NIGHTTIME_END_HOUR = 8 + BUSINESS_BEGIN_HOUR = 8 + BUSINESS_END_HOUR = 18 + NIGHT_BEGIN_HOUR = 20 + NIGHT_END_HOUR = 23 + NIGHT_END_MINUTE = 59 + MEAL_TIME_BREAKFAST_BEGIN_HOUR = 8 + MEAL_TIME_BREAKFAST_END_HOUR = 12 + MEAL_TIME_BRUNCH_BEGIN_HOUR = 8 + MEAL_TIME_BRUNCH_END_HOUR = 12 + MEAL_TIME_LUNCH_BEGIN_HOUR = 11 + MEAL_TIME_LUNCH_END_HOUR = 13 + MEAL_TIME_DINNER_BEGIN_HOUR = 16 + MEAL_TIME_DINNER_END_HOUR = 20 + # Failed connector extraction INVALID_CONNECTOR_CODE = -1 MIN_YEAR_NUM: int = int(BaseDateTime.MinYearNum) MAX_YEAR_NUM: int = int(BaseDateTime.MaxYearNum) + QUARTER_DAY_HOUR_COUNT = 6 HALF_DAY_HOUR_COUNT = 12 DAY_HOUR_COUNT = 24 + DAY_HOUR_START = 0 HOUR_SECOND_COUNT = 3600 MINUTE_SECOND_COUNT = 60 HALF_MID_DAY_DURATION_HOUR_COUNT = 2 + WEEK_DAY_COUNT = 7 + CENTURY_YEARS_COUNT = 100 # specifies the priority interpreting month and day order DEFAULT_LANGUAGE_FALLBACK_MDY: str = 'MDY' @@ -72,6 +106,9 @@ class Constants: MAX_TWO_DIGIT_YEAR_FUTURE_NUM: int = int(BaseDateTime.MaxTwoDigitYearFutureNum) MIN_TWO_DIGIT_YEAR_PAST_NUM: int = int(BaseDateTime.MinTwoDigitYearPastNum) + BASE_YEAR_PAST_CENTURY = 1900 + BASE_YEAR_CURRENT_CENTURY = 2000 + # Timex TIMEX_YEAR: str = "Y" TIMEX_MONTH: str = "M" @@ -85,11 +122,13 @@ class Constants: TIMEX_SECOND: str = "S" TIMEX_FUZZY: str = 'X' TIMEX_FUZZY_YEAR: str = "XXXX" + TIMEX_FUZZY_TWO_DIGIT_YEAR = "XX" TIMEX_FUZZY_MONTH: str = "XX" TIMEX_FUZZY_WEEK: str = "WXX" TIMEX_FUZZY_DAY: str = "XX" DATE_TIMEX_CONNECTOR: str = "-" TIME_TIMEX_CONNECTOR: str = ":" + TIMEX_SEPARATOR: str = "," GENERAL_PERIOD_PREFIX: str = "P" TIME_TIMEX_PREFIX: str = "T" @@ -99,6 +138,7 @@ class Constants: AFTERNOON: str = "TAF" EVENING: str = "TEV" DAYTIME: str = "TDT" + NIGHTTIME: str = "TNT" NIGHT: str = "TNI" BUSINESS_HOUR: str = "TBH" MEALTIME_BREAKFAST: str = "TMEB" @@ -109,8 +149,12 @@ class Constants: INVALID_DATE_STRING = "0001-01-01" COMPOSTIE_TIMEX_DELIMITER = "|" + # Timex non-constant + DURATION_UNIT_CHAR = ['D', 'W', 'M', 'Y', 'B'] + # Groups' names for named groups in regexes NEXT_GROUP_NAME = "next" + LAST_GROUP_NAME = "last" AM_GROUP_NAME = 'am' PM_GROUP_NAME = 'pm' AM_PM_GROUP_NAME = 'ampm' @@ -129,11 +173,38 @@ class Constants: WEEK_GROUP_NAME = 'week' WEEKDAY_GROUP_NAME = 'weekday' MONTH_GROUP_NAME = 'month' + MONTH_FROM_GROUP_NAME = "monthFrom" + MONTH_TO_GROUP_NAME = "monthTo" YEAR_GROUP_NAME = 'year' + THIS_YEAR_GROUP_NAME = 'thisyear' + THIS_MONTH_GROUP_NAME = 'thismonth' FULL_YEAR_GROUP_NAME = 'fullyear' HOUR_NUM_GROUP_NAME = 'hournum' TENS_GROUP_NAME = 'tens' YEAR_CJK_GROUP_NAME = 'yearCJK' + UNIT_OF_YEAR_GROUP_NAME = 'uoy' + LATER_GROUP_NAME = 'later' + FEW_GROUP_NAME = 'few' + LESS_GROUP_NAME = 'less' + MORE_GROUP_NAME = 'more' + SPECIFIC_END_OF_GROUP_NAME = "SpecificEndOf" + TOMORROW_GROUP_NAME = "tomorrow" + YESTERDAY_GROUP_NAME = "yesterday" + REST_OF_GROUP_NAME = "restof" + TO_DATE_GROUP_NAME = "toDate" + HALF_GROUP_NAME = "half" + FIRST_HALF_GROUP_NAME = 'firstHalf' + SECOND_HALF_GROUP_NAME = 'secondHalf' + HALF_TAG_GROUP_NAME = "halfTag" + UNIT_GROUP_NAME = "unit" + WITHIN_GROUP_NAME = "within" + EARLY_PREFIX_GROUP_NAME = "EarlyPrefix" + MID_PREFIX_GROUP_NAME = "MidPrefix" + LATE_PREFIX_GROUP_NAME = "LatePrefix" + SPECIAL_GROUP_NAME = 'special' + HALF_GROUP_NAME = 'half' + QUARTER_GROUP_NAME = 'quarter' + THREE_QUARTER_GROUP_NAME = 'threequarter' TIME_OF_DAY_GROUP_NAME = 'timeOfDay' BUSINESS_DAY_GROUP_NAME = 'business' @@ -141,6 +212,7 @@ class Constants: RIGHT_AM_PM_GROUP_NAME = 'rightDesc' MEALTIME_GROUP_NAME = 'mealTime' HOLIDAY_GROUP_NAME = 'holiday' + ANOTHER_GROUP_NAME = 'another' REL_MONTH = 'relmonth' FIRST_TWO_YEAR_NUM = 'firsttwoyearnum' @@ -148,6 +220,7 @@ class Constants: YEAR_CHINESE = 'yearCJK' OTHER = 'other' YEAR_RELATIVE = 'yearrel' + FOUR_DIGIT_YEAR_GROUP_NAME = "FourDigitYear" DAY_OF_MONTH = 'DayOfMonth' NEW_TIME = 'newTime' @@ -169,8 +242,16 @@ class Constants: MID_MORNING = 'midmorning' MID_NIGHT = 'midnight' + # Include the date mentioned, to make "before" -> "until" or "after" -> "since". Such as "on or earlier than 1/1/2016". + INCLUDE_GROUP_NAME = "include" + CARDINAL = 'cardinal' + DECADE_UNIT = '10Y' + FORTNIGHT_UNIT = '2W' + QUARTER_UNIT = '3MON' + WEEKEND_UNIT = 'WE' + DECADE = 'decade' CENTURY = 'century' REL_CENTURY = 'relcentury' @@ -198,10 +279,23 @@ class Constants: REL_LATE = 'RelLate' COMMENT_EARLY = 'early' COMMENT_LATE = 'late' + COMMENT_WEEK_OF = "WeekOf" + COMMENT_MONTH_OF = "MonthOf" HALF = 'half' HAS_MOD = 'mod' + LESS_THAN_MOD = 'less' + MORE_THAN_MOD = 'more' + + BEFORE_MOD = "before" + AFTER_MOD = "after" + UNTIL_MOD = "until" + SINCE_MOD = "since" + APPROX_MOD = "approx" + EARLY_MOD = "start" + MID_MOD = "mid" + LATE_MOD = "end" # Holidays # These should not be constants, they should go on the resources files for English @@ -220,15 +314,6 @@ class Constants: AGO_LABEL = "ago" LATER_LABEL = "later" - # These are some particular values for timezone recognition - INVALID_OFFSET_VALUE = -10000 - UTC_OFFSET_MINS_KEY = "utcOffsetMins" - POSITIVE_SIGN = 1 - NEGATIVE_SIGN = -1 - - # hours of one half day - HALF_DAY_HOUR_COUNT = 12 - class TimeTypeConstants: DATE: str = 'date' @@ -243,6 +328,7 @@ class TimeTypeConstants: VALUE: str = 'value' START_TIME: str = 'startTime' END_TIME: str = 'endTime' + DATETIME_ALT = "dateTimeAlt" START: str = 'start' END: str = 'end' diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/data_structures.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/data_structures.py new file mode 100644 index 0000000000..39aadbb1aa --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/data_structures.py @@ -0,0 +1,20 @@ +from enum import Enum + + +class TimeType(Enum): + CJKTime = 1 + LessTime = 2 + DigitTime = 3 + + +class PeriodType(Enum): + ShortTime = 1 + FullTime = 2 + + +class DatePeriodTimexType(Enum): + ByDay = 1 + ByWeek = 2 + ByFortNight = 3 + ByMonth = 4 + ByYear = 5 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_extractor.py index a764d371b3..bc12584ad3 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_extractor.py @@ -3,6 +3,7 @@ from abc import abstractmethod from typing import Match + from recognizers_date_time.date_time.date_time_extractor import DateTimeExtractor diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_time_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_time_extractor.py index 2cb82097fb..4edca5159c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_time_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_time_extractor.py @@ -3,8 +3,8 @@ from abc import abstractmethod from typing import List -from recognizers_text.extractor import ExtractResult -from recognizers_text.extractor import Extractor + +from recognizers_text.extractor import Extractor, ExtractResult class DateTimeExtractor(Extractor): diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_time_recognizer.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_time_recognizer.py index ccbeaaa7dc..1bf3afd3a3 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_time_recognizer.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/date_time_recognizer.py @@ -3,95 +3,195 @@ from datetime import datetime from typing import List + from recognizers_text import Culture, Recognizer from recognizers_text.model import Model, ModelResult -from .utilities import DateTimeOptions -from .models import DateTimeModel + +from .arabic.common_configs import ArabicCommonDateTimeParserConfiguration +from .arabic.merged_extractor_config import ArabicMergedExtractorConfiguration +from .arabic.merged_parser_config import ArabicMergedParserConfiguration from .base_merged import BaseMergedExtractor, BaseMergedParser +from .base_minimal_merged import MinimalMergedExtractor, MinimalMergedParser +from .catalan.common_configs import CatalanCommonDateTimeParserConfiguration +from .catalan.merged_extractor_config import CatalanMergedExtractorConfiguration +from .catalan.merged_parser_config import CatalanMergedParserConfiguration +from .chinese.merged_extractor import ChineseMergedExtractor +from .chinese.merged_parser import ChineseMergedParser +from .CJK.base_merged import BaseCJKMergedExtractor, BaseCJKMergedParser +from .dutch.common_configs import DutchCommonDateTimeParserConfiguration +from .dutch.merged_extractor_config import DutchMergedExtractorConfiguration +from .dutch.merged_parser_config import DutchMergedParserConfiguration from .english.common_configs import EnglishCommonDateTimeParserConfiguration from .english.merged_extractor_config import EnglishMergedExtractorConfiguration from .english.merged_parser_config import EnglishMergedParserConfiguration -from .spanish.common_configs import SpanishCommonDateTimeParserConfiguration -from .spanish.merged_extractor_config import SpanishMergedExtractorConfiguration -from .spanish.merged_parser_config import SpanishMergedParserConfiguration -from .chinese.merged_extractor import ChineseMergedExtractor -from .chinese.merged_parser import ChineseMergedParser from .french.common_configs import FrenchCommonDateTimeParserConfiguration from .french.merged_extractor_config import FrenchMergedExtractorConfiguration from .french.merged_parser_config import FrenchMergedParserConfiguration -from .portuguese.common_configs import PortugueseCommonDateTimeParserConfiguration -from .portuguese.merged_extractor_config import PortugueseMergedExtractorConfiguration -from .portuguese.merged_parser_config import PortugueseMergedParserConfiguration -from .italian.common_configs import ItalianCommonDateTimeParserConfiguration -from .italian.merged_extractor_config import ItalianMergedExtractorConfiguration -from .italian.merged_parser_config import ItalianMergedParserConfiguration from .german.common_configs import GermanCommonDateTimeParserConfiguration from .german.merged_extractor_config import GermanMergedExtractorConfiguration from .german.merged_parser_config import GermanMergedParserConfiguration +from .italian.common_configs import ItalianCommonDateTimeParserConfiguration +from .italian.merged_extractor_config import ItalianMergedExtractorConfiguration +from .italian.merged_parser_config import ItalianMergedParserConfiguration +from .japanese.common_configs import JapaneseCommonDateTimeParserConfiguration +from .japanese.merged_extractor_config import JapaneseMergedExtractorConfiguration +from .japanese.merged_parser_config import JapaneseMergedParserConfiguration +from .models import DateTimeModel +from .portuguese.common_configs import PortugueseCommonDateTimeParserConfiguration +from .portuguese.merged_extractor_config import PortugueseMergedExtractorConfiguration +from .portuguese.merged_parser_config import PortugueseMergedParserConfiguration +from .spanish.common_configs import SpanishCommonDateTimeParserConfiguration +from .spanish.merged_extractor_config import SpanishMergedExtractorConfiguration +from .spanish.merged_parser_config import SpanishMergedParserConfiguration +from .utilities import DateTimeOptions class DateTimeRecognizer(Recognizer[DateTimeOptions]): - def __init__(self, target_culture: str = None, - options: DateTimeOptions = DateTimeOptions.NONE, - lazy_initialization: bool = True): + def __init__( + self, + target_culture: str = None, + options: DateTimeOptions = DateTimeOptions.NONE, + lazy_initialization: bool = True, + ): if options < DateTimeOptions.NONE or options > DateTimeOptions.CALENDAR: raise ValueError() super().__init__(target_culture, options, lazy_initialization) def initialize_configuration(self): - self.register_model('DateTimeModel', Culture.English, lambda options: DateTimeModel( - BaseMergedParser(EnglishMergedParserConfiguration( - EnglishCommonDateTimeParserConfiguration()), options), - BaseMergedExtractor(EnglishMergedExtractorConfiguration(), options) - )) - - self.register_model('DateTimeModel', Culture.Chinese, lambda options: DateTimeModel( - ChineseMergedParser(), - ChineseMergedExtractor(options) - )) - - self.register_model('DateTimeModel', Culture.Spanish, lambda options: DateTimeModel( - BaseMergedParser(SpanishMergedParserConfiguration( - SpanishCommonDateTimeParserConfiguration()), options), - BaseMergedExtractor(SpanishMergedExtractorConfiguration(), options) - )) - - self.register_model('DateTimeModel', Culture.SpanishMexican, lambda options: DateTimeModel( - BaseMergedParser(SpanishMergedParserConfiguration( - SpanishCommonDateTimeParserConfiguration()), options), - BaseMergedExtractor(SpanishMergedExtractorConfiguration(), options) - )) - - self.register_model('DateTimeModel', Culture.French, lambda options: DateTimeModel( - BaseMergedParser(FrenchMergedParserConfiguration( - FrenchCommonDateTimeParserConfiguration()), options), - BaseMergedExtractor(FrenchMergedExtractorConfiguration(), options) - )) - - self.register_model('DateTimeModel', Culture.Portuguese, lambda options: DateTimeModel( - BaseMergedParser(PortugueseMergedParserConfiguration( - PortugueseCommonDateTimeParserConfiguration()), options), - BaseMergedExtractor(PortugueseMergedExtractorConfiguration(), options) - )) - - self.register_model('DateTimeModel', Culture.Italian, lambda options: DateTimeModel( - BaseMergedParser(ItalianMergedParserConfiguration( - ItalianCommonDateTimeParserConfiguration()), options), - BaseMergedExtractor(ItalianMergedExtractorConfiguration(), options) - )) - - self.register_model('DateTimeModel', Culture.German, lambda options: DateTimeModel( - BaseMergedParser(GermanMergedParserConfiguration( - GermanCommonDateTimeParserConfiguration()), options), - BaseMergedExtractor(GermanMergedExtractorConfiguration(), options) - )) + self.register_model( + 'DateTimeModel', + Culture.English, + lambda options: DateTimeModel( + BaseMergedParser(EnglishMergedParserConfiguration(EnglishCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(EnglishMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.EnglishOthers, + lambda options: DateTimeModel( + BaseMergedParser( + EnglishMergedParserConfiguration(EnglishCommonDateTimeParserConfiguration(dmyDateFormat=True)), + options, + ), + BaseMergedExtractor(EnglishMergedExtractorConfiguration(dmyDateFormat=True), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.Chinese, + lambda options: DateTimeModel(ChineseMergedParser(), ChineseMergedExtractor(options)), + ) + + self.register_model( + 'DateTimeModel', + Culture.Japanese, + lambda options: DateTimeModel( + BaseCJKMergedParser( + JapaneseMergedParserConfiguration(JapaneseCommonDateTimeParserConfiguration()), options + ), + BaseCJKMergedExtractor(JapaneseMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.Spanish, + lambda options: DateTimeModel( + BaseMergedParser(SpanishMergedParserConfiguration(SpanishCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(SpanishMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.SpanishMexican, + lambda options: DateTimeModel( + BaseMergedParser(SpanishMergedParserConfiguration(SpanishCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(SpanishMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.French, + lambda options: DateTimeModel( + BaseMergedParser(FrenchMergedParserConfiguration(FrenchCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(FrenchMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.Portuguese, + lambda options: DateTimeModel( + BaseMergedParser( + PortugueseMergedParserConfiguration(PortugueseCommonDateTimeParserConfiguration()), options + ), + BaseMergedExtractor(PortugueseMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.Italian, + lambda options: DateTimeModel( + BaseMergedParser(ItalianMergedParserConfiguration(ItalianCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(ItalianMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.German, + lambda options: DateTimeModel( + BaseMergedParser(GermanMergedParserConfiguration(GermanCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(GermanMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.Dutch, + lambda options: DateTimeModel( + BaseMergedParser(DutchMergedParserConfiguration(DutchCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(DutchMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.Arabic, + lambda options: DateTimeModel( + BaseMergedParser(ArabicMergedParserConfiguration(ArabicCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(ArabicMergedExtractorConfiguration(), options), + ), + ) + + self.register_model( + 'DateTimeModel', + Culture.Catalan, + lambda options: DateTimeModel( + MinimalMergedParser( + CatalanMergedParserConfiguration(CatalanCommonDateTimeParserConfiguration()), options + ), + MinimalMergedExtractor(CatalanMergedExtractorConfiguration(), options), + ), + ) def get_datetime_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: return self.get_model('DateTimeModel', culture, fallback_to_default_culture) -def recognize_datetime(query: str, culture: str, options: DateTimeOptions = DateTimeOptions.NONE, - reference: datetime = None, fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_datetime( + query: str, + culture: str, + options: DateTimeOptions = DateTimeOptions.NONE, + reference: datetime = None, + fallback_to_default_culture: bool = True, +) -> List[ModelResult]: recognizer = DateTimeRecognizer(culture, options) model = recognizer.get_datetime_model(culture, fallback_to_default_culture) return model.parse(query, reference) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/datetime_list_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/datetime_list_extractor.py index 8265e6195b..af62622db4 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/datetime_list_extractor.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/datetime_list_extractor.py @@ -3,6 +3,7 @@ from abc import abstractmethod from typing import List + from recognizers_text.extractor import ExtractResult diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/datetime_zone_extractor.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/datetime_zone_extractor.py deleted file mode 100644 index 8c55c7d3e9..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/datetime_zone_extractor.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from abc import abstractmethod -from typing import List -from recognizers_text.extractor import ExtractResult -from recognizers_date_time.date_time.extractors import DateTimeExtractor - - -class DateTimeZoneExtractor(DateTimeExtractor): - - @abstractmethod - def remove_ambiguous_time_zone(self, extract_result) -> List[ExtractResult]: - raise NotImplementedError diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/__init__.py new file mode 100644 index 0000000000..cc7166985a --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/__init__.py @@ -0,0 +1,24 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from .base_configs import * +from .common_configs import * +from .date_extractor_config import * +from .date_parser_config import * +from .dateperiod_extractor_config import * +from .dateperiod_parser_config import * +from .datetime_extractor_config import * +from .datetime_parser_config import * +from .datetimeperiod_extractor_config import * +from .datetimeperiod_parser_config import * +from .duration_extractor_config import * +from .duration_parser_config import * +from .holiday_extractor_config import * +from .holiday_parser_config import * +from .merged_extractor_config import * +from .merged_parser_config import * +from .parsers import * +from .time_extractor_config import * +from .time_parser_config import * +from .timeperiod_extractor_config import * +from .timeperiod_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/base_configs.py new file mode 100644 index 0000000000..ece3e599be --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/base_configs.py @@ -0,0 +1,11 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from ...resources.dutch_date_time import DutchDateTime +from ..utilities import DateTimeUtilityConfiguration + + +class DutchDateTimeUtilityConfiguration(DateTimeUtilityConfiguration): + + def __init__(self): + super().__init__(DutchDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/common_configs.py new file mode 100644 index 0000000000..f71ca9d7c4 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/common_configs.py @@ -0,0 +1,189 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + DutchCardinalExtractor, + DutchIntegerExtractor, + DutchNumberParserConfiguration, + DutchOrdinalExtractor, +) + +from ...resources import BaseDateTime, DutchDateTime +from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_date import BaseDateExtractor, BaseDateParser +from ..base_dateperiod import BaseDatePeriodExtractor, BaseDatePeriodParser +from ..base_datetime import BaseDateTimeExtractor, BaseDateTimeParser +from ..base_datetimeperiod import BaseDateTimePeriodExtractor, BaseDateTimePeriodParser +from ..base_duration import BaseDurationExtractor, BaseDurationParser +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser +from .base_configs import DutchDateTimeUtilityConfiguration +from .date_extractor_config import DutchDateExtractorConfiguration +from .date_parser_config import DutchDateParserConfiguration +from .dateperiod_extractor_config import DutchDatePeriodExtractorConfiguration +from .dateperiod_parser_config import DutchDatePeriodParserConfiguration +from .datetime_extractor_config import DutchDateTimeExtractorConfiguration +from .datetime_parser_config import DutchDateTimeParserConfiguration +from .datetimeperiod_extractor_config import DutchDateTimePeriodExtractorConfiguration +from .datetimeperiod_parser_config import DutchDateTimePeriodParserConfiguration +from .duration_extractor_config import DutchDurationExtractorConfiguration +from .duration_parser_config import DutchDurationParserConfiguration +from .parsers import DutchTimeParser +from .time_extractor_config import DutchTimeExtractorConfiguration +from .time_parser_config import DutchTimeParserConfiguration +from .timeperiod_extractor_config import DutchTimePeriodExtractorConfiguration +from .timeperiod_parser_config import DutchTimePeriodParserConfiguration + + +class DutchCommonDateTimeParserConfiguration(BaseDateParserConfiguration): + @property + def check_both_before_after(self) -> Pattern: + return self._check_both_before_after + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def ordinal_extractor(self) -> BaseNumberExtractor: + return self._ordinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def date_period_extractor(self) -> DateTimeExtractor: + return self._date_period_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def date_time_period_extractor(self) -> DateTimeExtractor: + return self._date_time_period_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> DateTimeParser: + return self._date_time_parser + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def date_period_parser(self) -> DateTimeParser: + return self._date_period_parser + + @property + def time_period_parser(self) -> DateTimeParser: + return self._time_period_parser + + @property + def date_time_period_parser(self) -> DateTimeParser: + return self._date_time_period_parser + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def unit_value_map(self) -> Dict[str, int]: + return self._unit_value_map + + @property + def season_map(self) -> Dict[str, str]: + return self._season_map + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def day_of_week(self) -> Dict[str, int]: + return self._day_of_week + + @property + def double_numbers(self) -> Dict[str, int]: + return self._double_numbers + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self): + super().__init__() + self._utility_configuration = DutchDateTimeUtilityConfiguration() + self._unit_map = DutchDateTime.UnitMap + self._unit_value_map = DutchDateTime.UnitValueMap + self._season_map = DutchDateTime.SeasonMap + self._cardinal_map = DutchDateTime.CardinalMap + self._day_of_week = DutchDateTime.DayOfWeek + self._month_of_year = DutchDateTime.MonthOfYear + self._numbers = DutchDateTime.Numbers + self._double_numbers = DutchDateTime.DoubleNumbers + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + + self._cardinal_extractor = DutchCardinalExtractor() + self._integer_extractor = DutchIntegerExtractor() + self._ordinal_extractor = DutchOrdinalExtractor() + + self._day_of_month = {**BaseDateTime.DayOfMonthDictionary, **DutchDateTime.DayOfMonth} + self._number_parser = BaseNumberParser(DutchNumberParserConfiguration()) + self._date_extractor = BaseDateExtractor(DutchDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(DutchTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(DutchDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(DutchDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(DutchTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(DutchDateTimeExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(DutchDateTimePeriodExtractorConfiguration()) + self._duration_parser = BaseDurationParser(DutchDurationParserConfiguration(self)) + self._date_parser = BaseDateParser(DutchDateParserConfiguration(self)) + self._time_parser = DutchTimeParser(DutchTimeParserConfiguration(self)) + self._date_period_parser = BaseDatePeriodParser(DutchDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(DutchTimePeriodParserConfiguration(self)) + self._date_time_parser = BaseDateTimeParser(DutchDateTimeParserConfiguration(self)) + self._date_time_period_parser = BaseDateTimePeriodParser(DutchDateTimePeriodParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/date_extractor_config.py new file mode 100644 index 0000000000..bcda5c64a0 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/date_extractor_config.py @@ -0,0 +1,81 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import List, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + DutchIntegerExtractor, + DutchNumberParserConfiguration, + DutchOrdinalExtractor, +) +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_date import DateExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..utilities import DateTimeUtilityConfiguration +from .base_configs import DutchDateTimeUtilityConfiguration +from .duration_extractor_config import DutchDurationExtractorConfiguration + + +class DutchDateExtractorConfiguration(DateExtractorConfiguration): + + def __init__(self): + super().__init__(DutchDateTime()) + self.ordinal_extractor: BaseNumberExtractor = DutchOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = DutchIntegerExtractor() + self.number_parser: BaseNumberParser = BaseNumberParser(DutchNumberParserConfiguration()) + self.duration_extractor: DateTimeExtractor = BaseDurationExtractor(DutchDurationExtractorConfiguration()) + self.utility_configuration: DateTimeUtilityConfiguration = DutchDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(DutchDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.ThisRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.LastDateRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.SingleWeekDayRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecialDate), + RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecialDayWithNumRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeWeekDayRegex), + ] + + @property + def date_regex_list(self) -> List[Pattern]: + if DutchDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: + date_extractor_4 = DutchDateTime.DateExtractor5 + date_extractor_5 = DutchDateTime.DateExtractor8 + date_extractor_6 = DutchDateTime.DateExtractor9L + date_extractor_7 = DutchDateTime.DateExtractor9S + date_extractor_8 = DutchDateTime.DateExtractor4 + date_extractor_9 = DutchDateTime.DateExtractor6 + date_extractor_10 = DutchDateTime.DateExtractor7L + date_extractor_11 = DutchDateTime.DateExtractor7S + else: + date_extractor_4 = DutchDateTime.DateExtractor4 + date_extractor_5 = DutchDateTime.DateExtractor6 + date_extractor_6 = DutchDateTime.DateExtractor7L + date_extractor_7 = DutchDateTime.DateExtractor7S + date_extractor_8 = DutchDateTime.DateExtractor5 + date_extractor_9 = DutchDateTime.DateExtractor8 + date_extractor_10 = DutchDateTime.DateExtractor9L + date_extractor_11 = DutchDateTime.DateExtractor9S + + return [ + RegExpUtility.get_safe_reg_exp(DutchDateTime.DateExtractor1), + RegExpUtility.get_safe_reg_exp(DutchDateTime.DateExtractor3), + RegExpUtility.get_safe_reg_exp(date_extractor_4), + RegExpUtility.get_safe_reg_exp(date_extractor_5), + RegExpUtility.get_safe_reg_exp(date_extractor_6), + RegExpUtility.get_safe_reg_exp(date_extractor_7), + RegExpUtility.get_safe_reg_exp(date_extractor_8), + RegExpUtility.get_safe_reg_exp(date_extractor_9), + RegExpUtility.get_safe_reg_exp(date_extractor_10), + RegExpUtility.get_safe_reg_exp(date_extractor_11), + RegExpUtility.get_safe_reg_exp(DutchDateTime.DateExtractorA), + ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/date_parser_config.py new file mode 100644 index 0000000000..2d5f84637f --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/date_parser_config.py @@ -0,0 +1,222 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +import regex + +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_date import DateParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser +from ..utilities import DateTimeUtilityConfiguration +from .date_extractor_config import DutchDateExtractorConfiguration + + +class DutchDateParserConfiguration(DateParserConfiguration): + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def ordinal_extractor(self) -> BaseNumberExtractor: + return self._ordinal_extractor + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def day_of_week(self) -> Dict[str, int]: + return self._day_of_week + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def date_regex(self) -> List[Pattern]: + return self._date_regex + + @property + def on_regex(self) -> Pattern: + return self._on_regex + + @property + def special_day_regex(self) -> Pattern: + return self._special_day_regex + + @property + def special_day_with_num_regex(self) -> Pattern: + return self._special_day_with_num_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def month_regex(self) -> Pattern: + return self._month_regex + + @property + def week_day_regex(self) -> Pattern: + return self._week_day_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def this_regex(self) -> Pattern: + return self._this_regex + + @property + def week_day_of_month_regex(self) -> Pattern: + return self._week_day_of_month_regex + + @property + def week_day_and_day_regex(self) -> Pattern: + return self._week_day_and_day_regex + + @property + def for_the_regex(self) -> Pattern: + return self._for_the_regex + + @property + def week_day_and_day_of_month_regex(self) -> Pattern: + return self._week_day_and_day_of_month_regex + + @property + def relative_month_regex(self) -> Pattern: + return self._relative_month_regex + + @property + def relative_week_day_regex(self) -> Pattern: + return self._relative_week_day_regex + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + @property + def date_token_prefix(self) -> str: + return self._date_token_prefix + + _relative_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeDayRegex) + _next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NextPrefixRegex) + _past_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PreviousPrefixRegex) + + def __init__(self, config: BaseDateParserConfiguration): + self._ordinal_extractor = config.ordinal_extractor + self._integer_extractor = config.integer_extractor + self._cardinal_extractor = config.cardinal_extractor + self._date_extractor = config.date_extractor + self._duration_extractor = config.duration_extractor + self._number_parser = config.number_parser + self._duration_parser = config.duration_parser + self._month_of_year = config.month_of_year + self._day_of_month = config.day_of_month + self._day_of_week = config.day_of_week + self._unit_map = config.unit_map + self._cardinal_map = config.cardinal_map + self._date_regex = (DutchDateExtractorConfiguration()).date_regex_list + self._on_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.OnRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NextDateRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.DateUnitRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekDayRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.LastDateRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ThisRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekDayOfMonthRegex) + self._for_the_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ForTheRegex) + self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekDayAndDayOfMonthRegex) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeMonthRegex) + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeWeekDayRegex) + self._utility_configuration = config.utility_configuration + self._date_token_prefix = DutchDateTime.DateTokenPrefix + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + + def get_swift_day(self, source: str) -> int: + trimmed_text = source.strip().lower() + swift = 0 + matches = regex.search(DutchDateParserConfiguration._relative_day_regex, source) + if trimmed_text == 'vandaag': + swift = 0 + elif trimmed_text == 'morgen': + swift = 1 + elif trimmed_text == 'gisteren': + swift = -1 + elif trimmed_text.endswith('overmorgen'): + swift = 2 + elif trimmed_text.endswith('eergisteren'): + swift = -2 + elif trimmed_text.endswith('dag na'): + swift = 1 + elif trimmed_text.endswith('de dag ervoor'): + swift = -1 + elif matches: + swift = self.get_swift(source) + + return swift + + def get_swift_month(self, source: str) -> int: + return self.get_swift(source) + + def get_swift(self, source: str) -> int: + trimmed_text = source.strip().lower() + swift = 0 + next_prefix_matches = regex.search(DutchDateParserConfiguration._next_prefix_regex, trimmed_text) + past_prefix_matches = regex.search(DutchDateParserConfiguration._past_prefix_regex, trimmed_text) + if next_prefix_matches: + swift = 1 + elif past_prefix_matches: + swift = -1 + + return swift + + def is_cardinal_last(self, source: str) -> bool: + trimmed_text = source.strip().lower() + return regex.search(DutchDateParserConfiguration._past_prefix_regex, trimmed_text) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/dateperiod_extractor_config.py new file mode 100644 index 0000000000..466c988536 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/dateperiod_extractor_config.py @@ -0,0 +1,71 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + + +from recognizers_number import DutchCardinalExtractor, DutchOrdinalExtractor +from recognizers_number.number import BaseNumberParser +from recognizers_number.number.dutch.extractors import DutchCardinalExtractor, DutchIntegerExtractor +from recognizers_number.number.dutch.parsers import DutchNumberParserConfiguration +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_date import BaseDateExtractor +from ..base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex +from ..base_duration import BaseDurationExtractor +from .date_extractor_config import DutchDateExtractorConfiguration +from .duration_extractor_config import DutchDurationExtractorConfiguration + + +class DutchDatePeriodExtractorConfiguration(DatePeriodExtractorConfiguration): + + def __init__(self): + super().__init__(DutchDateTime()) + self.ordinal_extractor = DutchOrdinalExtractor() + self.cardinal_extractor = DutchCardinalExtractor() + self.cardinal_extractor = DutchCardinalExtractor() + self.date_point_extractor = BaseDateExtractor(DutchDateExtractorConfiguration()) + self.number_parser = BaseNumberParser(DutchNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(DutchDurationExtractorConfiguration()) + self.integer_extractor = DutchIntegerExtractor() + self.from_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FromRegex) + self.simple_cases_regexes = [ + RegExpUtility.get_safe_reg_exp(DutchDateTime.SimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.BetweenRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.OneWordPeriodRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthWithYear), + RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthNumWithYear), + RegExpUtility.get_safe_reg_exp(DutchDateTime.YearRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekOfMonthRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekOfYearRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthFrontBetweenRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthFrontSimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.QuarterRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.QuarterRegexYearFront), + RegExpUtility.get_safe_reg_exp(DutchDateTime.AllHalfYearRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.SeasonRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.WhichWeekRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.RestOfDateRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.LaterEarlyPeriodRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekWithWeekDayRangeRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.YearPlusNumberRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.DecadeWithCenturyRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeDecadeRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.ReferenceDatePeriodRegex), + ] + + def get_from_token_index(self, source: str) -> MatchedIndex: + match = self.from_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def get_between_token_index(self, source: str) -> MatchedIndex: + match = self.between_token_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def has_connector_token(self, source: str) -> bool: + return self.range_connector_regex.search(source) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/dateperiod_parser_config.py new file mode 100644 index 0000000000..ad75ef52f2 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/dateperiod_parser_config.py @@ -0,0 +1,372 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, Pattern + +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_dateperiod import DatePeriodParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser + + +class DutchDatePeriodParserConfiguration(DatePeriodParserConfiguration): + @property + def less_than_regex(self) -> Pattern: + return self._less_than_regex + + @property + def more_than_regex(self) -> Pattern: + return self._more_than_regex + + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def reference_date_period_regex(self) -> Pattern: + return self._reference_date_period_regex + + @property + def decade_with_century_regex(self) -> Pattern: + return self._decade_with_century_regex + + @property + def relative_regex(self) -> Pattern: + return self._relative_regex + + @property + def ago_regex(self) -> Pattern: + return self._ago_regex + + @property + def later_regex(self) -> Pattern: + return self._later_regex + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def month_front_between_regex(self) -> Pattern: + return self._month_front_between_regex + + @property + def between_regex(self) -> Pattern: + return self._between_regex + + @property + def month_front_simple_cases_regex(self) -> Pattern: + return self._month_front_simple_cases_regex + + @property + def simple_cases_regex(self) -> Pattern: + return self._simple_cases_regex + + @property + def one_word_period_regex(self) -> Pattern: + return self._one_word_period_regex + + @property + def month_with_year(self) -> Pattern: + return self._month_with_year + + @property + def month_num_with_year(self) -> Pattern: + return self._month_num_with_year + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def past_regex(self) -> Pattern: + return self._past_regex + + @property + def future_regex(self) -> Pattern: + return self._future_regex + + @property + def in_connector_regex(self) -> Pattern: + return self._in_connector_regex + + @property + def week_of_month_regex(self) -> Pattern: + return self._week_of_month_regex + + @property + def week_of_year_regex(self) -> Pattern: + return self._week_of_year_regex + + @property + def quarter_regex(self) -> Pattern: + return self._quarter_regex + + @property + def quarter_regex_year_front(self) -> Pattern: + return self._quarter_regex_year_front + + @property + def all_half_year_regex(self) -> Pattern: + return self._all_half_year_regex + + @property + def season_regex(self) -> Pattern: + return self._season_regex + + @property + def week_of_regex(self) -> Pattern: + return self._week_of_regex + + @property + def month_of_regex(self) -> Pattern: + return self._month_of_regex + + @property + def which_week_regex(self) -> Pattern: + return self._which_week_regex + + @property + def next_prefix_regex(self) -> Pattern: + return self._next_prefix_regex + + @property + def previous_prefix_regex(self) -> Pattern: + return self._past_prefix_regex + + @property + def this_prefix_regex(self) -> Pattern: + return self._this_prefix_regex + + @property + def rest_of_date_regex(self) -> Pattern: + return self._rest_of_date_regex + + @property + def later_early_period_regex(self) -> Pattern: + return self._later_early_period_regex + + @property + def week_with_week_day_range_regex(self) -> Pattern: + return self._week_with_week_day_range_regex + + @property + def unspecific_end_of_range_regex(self) -> Pattern: + return self._unspecific_end_of_range_regex + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def season_map(self) -> Dict[str, str]: + return self._season_map + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def now_regex(self) -> Pattern: + return self._now_regex + + @property + def complex_dateperiod_regex(self) -> Pattern: + return self._complex_dateperiod_regex + + @property + def relative_decade_regex(self) -> Pattern: + return self._relative_decade_regex + + @property + def dynasty_year_regex(self) -> Pattern: + return None + + @property + def dynasty_year_map(self) -> Dict[str, int]: + return None + + @property + def year_plus_number_regex(self) -> Pattern: + return self._year_plus_number_regex + + @property + def year_period_regex(self) -> Pattern: + return self._year_period_regex + + @property + def within_next_prefix_regex(self) -> Pattern: + return self._within_next_prefix_regex + + @property + def century_suffix_regex(self) -> Pattern: + return self._century_suffix_regex + + @property + def first_last_regex(self) -> Pattern: + return self._first_last_regex + + @property + def special_day_regex(self) -> Pattern: + return self._special_day_regex + + @property + def after_next_suffix_regex(self) -> Pattern: + return self._after_next_suffix_regex + + def __init__(self, config: BaseDateParserConfiguration): + self._relative_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeRegex) + self._later_regex = DutchDateTime.LaterRegex + self._ago_regex = DutchDateTime.AgoRegex + self._token_before_date = DutchDateTime.TokenBeforeDate + self.cardinal_extractor = config.cardinal_extractor + self.number_parser = config.number_parser + self._duration_extractor = config.duration_extractor + self._date_extractor = config.date_extractor + self._duration_parser = config.duration_parser + self._date_parser = config.date_parser + + self._after_next_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AfterNextSuffixRegex) + self._year_plus_number_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.YearPlusNumberRegex) + self._year_period_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.YearPeriodRegex) + self._month_front_between_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthFrontBetweenRegex) + self._between_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BetweenRegex) + self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthFrontSimpleCasesRegex) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.OneWordPeriodRegex) + self._month_with_year = RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthWithYear) + self._month_num_with_year = RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthNumWithYear) + self._year_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NextPrefixRegex) + self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp(DutchDateTime.NumberCombinedWithDurationUnit) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekOfYearRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.QuarterRegex) + self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp(DutchDateTime.QuarterRegexYearFront) + self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AllHalfYearRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SeasonRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WhichWeekRegex) + self._week_of_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekOfRegex) + self._month_of_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MonthOfRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RestOfDateRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.LaterEarlyPeriodRegex) + self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekWithWeekDayRangeRegex) + self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.UnspecificEndOfRangeRegex) + + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NextPrefixRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PreviousPrefixRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ThisPrefixRegex) + self._next_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FutureSuffixRegex) + self._past_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PastSuffixRegex) + + self._in_connector_regex = config.utility_configuration.in_connector_regex + self._unit_map = config.unit_map + self._cardinal_map = config.cardinal_map + self._day_of_month = config.day_of_month + self._month_of_year = config.month_of_year + self._season_map = config.season_map + self._now_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NowRegex) + self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.DecadeWithCenturyRegex) + self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ComplexDatePeriodRegex) + self._relative_decade_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeDecadeRegex) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ReferenceDatePeriodRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.LessThanRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MoreThanRegex) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WithinNextPrefixRegex) + self._century_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.CenturySuffixRegex) + self._first_last_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FirstLastRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecialDayRegex) + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + + def get_swift_day_or_month(self, source: str) -> int: + trimmed_source = source.strip().lower() + swift = 0 + if self.after_next_suffix_regex.search(trimmed_source): + swift = 2 + elif self.next_prefix_regex.search(trimmed_source): + swift = 1 + elif self.previous_prefix_regex.search(trimmed_source): + swift = -1 + + return swift + + def get_swift_year(self, source: str) -> int: + trimmed_source = source.strip().lower() + swift = -10 + + if self.after_next_suffix_regex.search(trimmed_source): + swift = 2 + elif self.next_prefix_regex.search(trimmed_source): + swift = 1 + elif self.previous_prefix_regex.search(trimmed_source): + swift = -1 + elif self.this_prefix_regex.search(trimmed_source): + swift = 0 + + return swift + + def is_future(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.startswith(o) for o in DutchDateTime.FutureTerms) + + def is_year_to_date(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in DutchDateTime.YearToDateTerms) + + def is_month_to_date(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in DutchDateTime.MonthToDateTerms) + + def is_week_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return ( + any(trimmed_source.endswith(o) for o in DutchDateTime.WeekTerms) + or ( + any(trimmed_source.__contains__(o) for o in DutchDateTime.WeekTerms) + and (self._next_suffix_regex.search(trimmed_source) or self._past_suffix_regex.search(trimmed_source)) + ) + ) and not any(trimmed_source.endswith(o) for o in DutchDateTime.WeekendTerms) + + def is_weekend(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in DutchDateTime.WeekendTerms) + + def is_month_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in DutchDateTime.MonthTerms) + + def is_year_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in DutchDateTime.YearTerms) + + def is_last_cardinal(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in DutchDateTime.LastCardinalTerms) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetime_extractor_config.py new file mode 100644 index 0000000000..663cb7c25c --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetime_extractor_config.py @@ -0,0 +1,145 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Pattern + +import regex + +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_date import BaseDateExtractor +from ..base_datetime import DateTimeExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor +from ..extractors import DateTimeExtractor +from .base_configs import DutchDateTimeUtilityConfiguration +from .date_extractor_config import DutchDateExtractorConfiguration +from .duration_extractor_config import DutchDurationExtractorConfiguration +from .time_extractor_config import DutchTimeExtractorConfiguration + + +class DutchDateTimeExtractorConfiguration(DateTimeExtractorConfiguration): + + @property + def date_point_extractor(self) -> DateTimeExtractor: + return self._date_point_extractor + + @property + def time_point_extractor(self) -> DateTimeExtractor: + return self._time_point_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def suffix_regex(self) -> Pattern: + return self._suffix_regex + + @property + def now_regex(self) -> Pattern: + return self._now_regex + + @property + def time_of_today_after_regex(self) -> Pattern: + return self._time_of_today_after_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def simple_time_of_today_after_regex(self) -> Pattern: + return self._simple_time_of_today_after_regex + + @property + def night_regex(self) -> Pattern: + return self._night_regex + + @property + def time_of_today_before_regex(self) -> Pattern: + return self._time_of_today_before_regex + + @property + def simple_time_of_today_before_regex(self) -> Pattern: + return self._simple_time_of_today_before_regex + + @property + def specific_end_of_regex(self) -> Pattern: + return self._specific_end_of_regex + + @property + def unspecific_end_of_regex(self) -> Pattern: + return self._unspecific_end_of_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def utility_configuration(self) -> DutchDateTimeUtilityConfiguration: + return self._utility_configuration + + @property + def number_as_time_regex(self) -> Pattern: + return self._number_as_time_regex + + @property + def date_number_connector_regex(self) -> Pattern: + return self._date_number_connector_regex + + @property + def suffix_after_regex(self) -> Pattern: + return self._suffix_after_regex + + @property + def year_suffix(self) -> Pattern: + return self._year_suffix + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + def __init__(self): + super().__init__() + self.preposition_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NowRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SuffixRegex) + + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeOfDayRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeOfDayRegex) + self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeOfTodayAfterRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeOfTodayBeforeRegex) + self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( + DutchDateTime.SimpleTimeOfTodayAfterRegex + ) + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + DutchDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeUnitRegex) + self.connector_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ConnectorRegex) + self._night_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NightRegex) + self._number_as_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NumberAsTimeRegex) + self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.DateNumberConnectorRegex) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SuffixAfterRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(DutchDateTime.YearSuffix) + self._year_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.YearRegex) + + self._date_point_extractor = BaseDateExtractor(DutchDateExtractorConfiguration()) + self._time_point_extractor = BaseTimeExtractor(DutchTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(DutchDurationExtractorConfiguration()) + self._utility_configuration = DutchDateTimeUtilityConfiguration() + + def is_connector_token(self, source: str) -> bool: + return ( + source.strip() == '' + or regex.search(self.connector_regex, source) is not None + or regex.search(self.preposition_regex, source) is not None + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetime_parser_config.py new file mode 100644 index 0000000000..a7403c48e1 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetime_parser_config.py @@ -0,0 +1,205 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, Pattern + +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_datetime import DateTimeParserConfiguration, MatchedTimex +from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser +from ..utilities import DateTimeUtilityConfiguration + + +class DutchDateTimeParserConfiguration(DateTimeParserConfiguration): + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def token_before_time(self) -> str: + return self._token_before_time + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def now_regex(self) -> Pattern: + return self._now_regex + + @property + def am_time_regex(self) -> Pattern: + return self._am_time_regex + + @property + def pm_time_regex(self) -> Pattern: + return self._pm_time_regex + + @property + def simple_time_of_today_after_regex(self) -> Pattern: + return self._simple_time_of_today_after_regex + + @property + def simple_time_of_today_before_regex(self) -> Pattern: + return self._simple_time_of_today_before_regex + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def specific_end_of_regex(self) -> Pattern: + return self._specific_end_of_regex + + @property + def unspecific_end_of_regex(self) -> Pattern: + return self._unspecific_end_of_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def night_time_regex(self) -> Pattern: + return self._night_time_regex + + @property + def morning_time_regex(self) -> Pattern: + return self._morning_time_regex + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + @property + def now_time_regex(self) -> Pattern: + return self._now_time_regex + + @property + def recently_time_regex(self) -> Pattern: + return self._recently_time_regex + + @property + def asap_time_regex(self) -> Pattern: + return self._asap_time_regex + + def __init__(self, config: BaseDateParserConfiguration): + self._token_before_date = DutchDateTime.TokenBeforeDate + self._token_before_time = DutchDateTime.TokenBeforeTime + self._now_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NowRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AMTimeRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PMTimeRegex) + self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( + DutchDateTime.SimpleTimeOfTodayAfterRegex + ) + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + DutchDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeOfDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeUnitRegex) + + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PreviousPrefixRegex) + self._night_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NightTimeRegex) + self._morning_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MorningTimeRegex) + self._now_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NowTimeRegex) + self._recently_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RecentlyTimeRegex) + self._asap_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AsapTimeRegex) + + self._date_extractor = config.date_extractor + self._time_extractor = config.time_extractor + self._date_parser = config.date_parser + self._time_parser = config.time_parser + self._numbers = config.numbers + self._cardinal_extractor = config.cardinal_extractor + self._number_parser = config.number_parser + self._duration_extractor = config.duration_extractor + self._duration_parser = config.duration_parser + self._unit_map = config.unit_map + self._utility_configuration = config.utility_configuration + + def have_ambiguous_token(self, source: str, matched_text: str) -> bool: + return False + + def get_matched_now_timex(self, source: str) -> MatchedTimex: + source = source.strip().lower() + + if self.now_time_regex.search(source): + timex = 'PRESENT_REF' + elif self.recently_time_regex.search(source): + timex = 'PAST_REF' + elif self.asap_time_regex.search(source): + timex = 'FUTURE_REF' + else: + return MatchedTimex(False, None) + + return MatchedTimex(True, timex) + + def get_swift_day(self, source: str) -> int: + source = source.strip().lower() + swift = 0 + + if self.previous_prefix_regex.search(source): + swift = -1 + elif self.next_prefix_regex.search(source): + swift = 1 + + return swift + + def get_hour(self, source: str, hour: int) -> int: + source = source.strip().lower() + result = hour + + if self.morning_time_regex.search(source) and hour >= Constants.HALF_DAY_HOUR_COUNT: + result -= 12 + elif ( + not (self.morning_time_regex.search(source) or self.night_time_regex.search(source)) + and hour < Constants.HALF_DAY_HOUR_COUNT + ): + result += 12 + + return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetimeperiod_extractor_config.py new file mode 100644 index 0000000000..138f849fa1 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetimeperiod_extractor_config.py @@ -0,0 +1,227 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import List, Pattern + +from recognizers_number import BaseNumberExtractor, DutchCardinalExtractor +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_date import BaseDateExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex +from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..extractors import DateTimeExtractor +from .date_extractor_config import DutchDateExtractorConfiguration +from .datetime_extractor_config import DutchDateTimeExtractorConfiguration +from .duration_extractor_config import DutchDurationExtractorConfiguration +from .time_extractor_config import DutchTimeExtractorConfiguration +from .timeperiod_extractor_config import DutchTimePeriodExtractorConfiguration + + +class DutchDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): + @property + def check_both_before_after(self) -> Pattern: + return self._check_both_before_after + + @property + def suffix_regex(self) -> Pattern: + return self._suffix_regex + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def single_date_extractor(self) -> DateTimeExtractor: + return self._single_date_extractor + + @property + def single_time_extractor(self) -> DateTimeExtractor: + return self._single_time_extractor + + @property + def single_date_time_extractor(self) -> DateTimeExtractor: + return self._single_date_time_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def simple_cases_regexes(self) -> List[Pattern]: + return self._simple_cases_regexes + + @property + def preposition_regex(self) -> Pattern: + return self._preposition_regex + + @property + def till_regex(self) -> Pattern: + return self._till_regex + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def period_time_of_day_with_date_regex(self) -> Pattern: + return self._period_time_of_day_with_date_regex + + @property + def followed_unit(self) -> Pattern: + return self._followed_unit + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def time_unit_regex(self) -> Pattern: + return self._time_unit_regex + + @property + def previous_prefix_regex(self) -> Pattern: + return self._past_prefix_regex + + @property + def next_prefix_regex(self) -> Pattern: + return self._next_prefix_regex + + @property + def relative_time_unit_regex(self) -> Pattern: + return self._relative_time_unit_regex + + @property + def rest_of_date_time_regex(self) -> Pattern: + return self._rest_of_date_time_regex + + @property + def week_day_regex(self) -> Pattern: + return self._week_day_regex + + @property + def general_ending_regex(self) -> Pattern: + return self._general_ending_regex + + @property + def middle_pause_regex(self) -> Pattern: + return self._middle_pause_regex + + @property + def within_next_prefix_regex(self) -> Pattern: + return self._within_next_prefix_regex + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def future_suffix_regex(self) -> Pattern: + return self._future_suffix_regex + + @property + def date_unit_regex(self) -> Pattern: + return self._date_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 prefix_day_regex(self) -> Pattern: + return self._prefix_day_regex + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + def __init__(self): + super().__init__() + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + self._simple_cases_regexes = [ + RegExpUtility.get_safe_reg_exp(DutchDateTime.PureNumFromTo), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeDateFromTo), + RegExpUtility.get_safe_reg_exp(DutchDateTime.PureNumBetweenAnd), + RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeOfDayRegex), + ] + + self._preposition_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PeriodTimeOfDayRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeFollowedUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeUnitRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PastSuffixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NextPrefixRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeNumberCombinedWithUnit) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WeekDayRegex) + self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( + DutchDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RestOfDateTimeRegex) + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.GeneralEndingRegex) + self._middle_pause_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MiddlePauseRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FromRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RangeConnectorRegex) + + self._cardinal_extractor = DutchCardinalExtractor() + + self._single_date_extractor = BaseDateExtractor(DutchDateExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(DutchTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseDateTimeExtractor(DutchDateTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(DutchDurationExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(DutchTimePeriodExtractorConfiguration()) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WithinNextPrefixRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeUnitRegex) + self._token_before_date = DutchDateTime.TokenBeforeDate + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FutureSuffixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.DateUnitRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PmDescRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AfterRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SuffixRegex) + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + + def get_from_token_index(self, source: str) -> MatchedIndex: + match = self.from_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def get_between_token_index(self, source: str) -> MatchedIndex: + match = self.before_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def has_connector_token(self, source: str) -> bool: + match = self.range_connector_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetimeperiod_parser_config.py new file mode 100644 index 0000000000..ef4b1c6184 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/datetimeperiod_parser_config.py @@ -0,0 +1,235 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, Pattern + +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange +from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser + + +class DutchDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def future_suffix_regex(self): + return self._future_suffix_regex + + @property + def within_next_prefix_regex(self): + return self._within_next_prefix_regex + + def __init__(self, config: BaseDateParserConfiguration): + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WithinNextPrefixRegex) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FutureSuffixRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PmDescRegex) + self._date_extractor = config.date_extractor + self._time_extractor = config.time_extractor + self._date_time_extractor = config.date_time_extractor + self._time_period_extractor = config.time_period_extractor + self._cardinal_extractor = config.cardinal_extractor + self._duration_extractor = config.duration_extractor + self.number_parser = config.number_parser + self._date_parser = config.date_parser + self._time_parser = config.time_parser + self._date_time_parser = config.date_time_parser + self._time_period_parser = config.time_period_parser + self._duration_parser = config.duration_parser + self._unit_map = config.unit_map + self._numbers = config.numbers + + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + self._token_before_date = DutchDateTime.TokenBeforeDate + self._token_before_time = DutchDateTime.TokenBeforeTime + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AfterRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NextPrefixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PreviousPrefixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ThisPrefixRegex) + self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MorningStartEndRegex) + self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AfternoonStartEndRegex) + self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.EveningStartEndRegex) + self.night_start_end_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NightStartEndRegex) + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PureNumBetweenAnd) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FutureSuffixRegex) + self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeNumberCombinedWithUnit) + self.unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeUnitRegex) + self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( + DutchDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RestOfDateTimeRegex) + + @property + def previous_prefix_regex(self): + return self._previous_prefix_regex + + @property + def cardinal_extractor(self): + return self._cardinal_extractor + + @property + def am_desc_regex(self): + return self._am_desc_regex + + @property + def pm_desc_regex(self): + return self._pm_desc_regex + + @property + def before_regex(self): + return self._before_regex + + @property + def after_regex(self): + return self._after_regex + + @property + def prefix_day_regex(self): + return self._prefix_day_regex + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def token_before_time(self): + return self._token_before_time + + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def pure_number_from_to_regex(self) -> Pattern: + return self._pure_number_from_to_regex + + @property + def pure_number_between_and_regex(self) -> Pattern: + return self._pure_number_between_and_regex + + @property + def period_time_of_day_with_date_regex(self) -> Pattern: + return self._period_time_of_day_with_date_regex + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def past_regex(self) -> Pattern: + return self._past_regex + + @property + def future_regex(self) -> Pattern: + return self._future_regex + + @property + def relative_time_unit_regex(self) -> Pattern: + return self._relative_time_unit_regex + + @property + def rest_of_date_time_regex(self) -> Pattern: + return self._rest_of_date_time_regex + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> DateTimeParser: + return self._date_time_parser + + @property + def time_period_parser(self) -> DateTimeParser: + return self._time_period_parser + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + def get_matched_time_range(self, source: str) -> MatchedTimeRange: + trimmed_source = source.strip().lower() + begin_hour = 0 + end_hour = 0 + end_min = 0 + + if self.morning_start_end_regex.search(trimmed_source): + time_str = Constants.MORNING + begin_hour = 8 + end_hour = 12 + elif self.afternoon_start_end_regex.search(trimmed_source): + time_str = Constants.AFTERNOON + begin_hour = 12 + end_hour = 16 + elif self.evening_start_end_regex.search(trimmed_source): + time_str = Constants.EVENING + begin_hour = 16 + end_hour = 20 + elif self.night_start_end_regex.search(trimmed_source): + time_str = Constants.NIGHT + begin_hour = 20 + end_hour = 23 + end_min = 59 + else: + time_str = '' + return MatchedTimeRange(time_str, begin_hour, end_hour, end_min, False) + + return MatchedTimeRange(time_str, begin_hour, end_hour, end_min, True) + + def get_swift_prefix(self, source: str) -> int: + trimmed_source = source.strip().lower() + swift = 0 + + if self.previous_prefix_regex.search(trimmed_source): + swift = -1 + elif self.next_prefix_regex.search(trimmed_source): + swift = 1 + + return swift diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/duration_extractor_config.py new file mode 100644 index 0000000000..1899b458cb --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/duration_extractor_config.py @@ -0,0 +1,138 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Pattern + +from recognizers_number.number.dutch.extractors import DutchCardinalExtractor +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_duration import DurationExtractorConfiguration + + +class DutchDurationExtractorConfiguration(DurationExtractorConfiguration): + + @property + def check_both_before_after(self): + return self._check_both_before_after + + @property + def dmy_date_format(self) -> bool: + return self._dmy_date_format + + @property + def all_regex(self) -> Pattern: + return self._all_regex + + @property + def half_regex(self) -> Pattern: + return self._half_regex + + @property + def followed_unit(self) -> Pattern: + return self._followed_unit + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def an_unit_regex(self) -> Pattern: + return self._an_unit_regex + + @property + def inexact_number_unit_regex(self) -> Pattern: + return self._inexact_number_unit_regex + + @property + def suffix_and_regex(self) -> Pattern: + return self._suffix_and_regex + + @property + def relative_duration_unit_regex(self) -> Pattern: + return self._relative_duration_unit_regex + + @property + def more_than_regex(self) -> Pattern: + return self._more_than_regex + + @property + def less_than_regex(self) -> Pattern: + return self._less_than_regex + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def during_regex(self) -> Pattern: + return self._during_regex + + @property + def unit_map(self) -> {}: + return self._unit_map + + @property + def unit_value_map(self) -> {}: + return self._unit_value_map + + @property + def duration_unit_regex(self) -> Pattern: + return self._duration_unit_regex + + @property + def duration_connector_regex(self) -> Pattern: + return self._duration_connector_regex + + @property + def conjunction_regex(self) -> Pattern: + return self._conjunction_regex + + @property + def mod_prefix_regex(self) -> Pattern: + return self._mod_prefix_regex + + @property + def mod_suffix_regex(self) -> Pattern: + return self._mod_suffix_regex + + @property + def inexact_number_regex(self): + return self._inexact_number_regex + + @property + def special_number_unit_regex(self): + return self._special_number_unit_regex + + def __init__(self): + super().__init__() + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + self._inexact_number_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.InexactNumberRegex) + self._conjunction_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ConjunctionRegex) + self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.AllRegex) + self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.HalfRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.DurationFollowedUnit) + self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( + DutchDateTime.NumberCombinedWithDurationUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.AnUnitRegex) + self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.InexactNumberUnitRegex) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.SuffixAndRegex) + self._relative_duration_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( + DutchDateTime.RelativeDurationUnitRegex + ) + self._more_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.MoreThanRegex) + self._less_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.LessThanOneHour) + self._cardinal_extractor: BaseNumberExtractor = DutchCardinalExtractor() + self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.DuringRegex) + self._unit_map = DutchDateTime.UnitMap + self._unit_value_map = DutchDateTime.UnitValueMap + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.DurationUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.DurationConnectorRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MoreThanRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.LessThanRegex) + self._mod_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ModPrefixRegex) + self._mod_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ModSuffixRegex) + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + self._special_number_unit_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/duration_parser_config.py new file mode 100644 index 0000000000..00a2934d63 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/duration_parser_config.py @@ -0,0 +1,81 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, Pattern + +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_duration import BaseDurationExtractor, DurationParserConfiguration +from ..extractors import DateTimeExtractor +from .duration_extractor_config import DutchDurationExtractorConfiguration + + +class DutchDurationParserConfiguration(DurationParserConfiguration): + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def followed_unit(self) -> Pattern: + return self._followed_unit + + @property + def suffix_and_regex(self) -> Pattern: + return self._suffix_and_regex + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def an_unit_regex(self) -> Pattern: + return self._an_unit_regex + + @property + def all_date_unit_regex(self) -> Pattern: + return self._all_date_unit_regex + + @property + def half_date_unit_regex(self) -> Pattern: + return self._half_date_unit_regex + + @property + def inexact_number_unit_regex(self) -> Pattern: + return self._inexact_number_unit_regex + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def unit_value_map(self) -> Dict[str, int]: + return self._unit_value_map + + @property + def double_numbers(self) -> Dict[str, float]: + return self._double_numbers + + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + def __init__(self, config): + self._duration_extractor = BaseDurationExtractor(DutchDurationExtractorConfiguration(), False) + self._cardinal_extractor = config.cardinal_extractor + self._number_parser = config.number_parser + self._followed_unit = RegExpUtility.get_safe_reg_exp(DutchDateTime.DurationFollowedUnit) + self._suffix_and_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SuffixAndRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(DutchDateTime.NumberCombinedWithDurationUnit) + self._an_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AnUnitRegex) + self._all_date_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AllRegex) + self._half_date_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.HalfRegex) + self._inexact_number_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.InexactNumberUnitRegex) + self._unit_map = config.unit_map + self._unit_value_map = config.unit_value_map + self._double_numbers = config.double_numbers diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/holiday_extractor_config.py new file mode 100644 index 0000000000..c57f943c3d --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/holiday_extractor_config.py @@ -0,0 +1,23 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import List, Pattern + +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_holiday import HolidayExtractorConfiguration + + +class DutchHolidayExtractorConfiguration(HolidayExtractorConfiguration): + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def holiday_regexes(self) -> List[Pattern]: + return self._holiday_regexes + + def __init__(self): + self._year_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.YearRegex) + self._holiday_regexes = [RegExpUtility.get_safe_reg_exp(DutchDateTime.HolidayRegex)] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/holiday_parser_config.py new file mode 100644 index 0000000000..636ca97c3e --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/holiday_parser_config.py @@ -0,0 +1,236 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from datetime import datetime +from typing import Callable, Dict, List, Pattern + +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_holiday import BaseHolidayParserConfiguration +from ..utilities import DateUtils + + +class DutchHolidayParserConfiguration(BaseHolidayParserConfiguration): + @property + def holiday_names(self) -> Dict[str, List[str]]: + return self._holiday_names + + @property + def holiday_regex_list(self) -> List[Pattern]: + return self._holiday_regexes + + @property + def holiday_func_dictionary(self) -> Dict[str, Callable[[int], datetime]]: + return self._holiday_func_dictionary + + def __init__(self, config): + super().__init__() + self._holiday_regexes = [ + RegExpUtility.get_safe_reg_exp(DutchDateTime.HolidayRegex), + ] + self._holiday_names = DutchDateTime.HolidayNames + + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PreviousPrefixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ThisPrefixRegex) + + def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: + local = dict( + [ + ("maosbirthday", DutchHolidayParserConfiguration.mao_birthday), + ("teachersday", DutchHolidayParserConfiguration.teacher_day), + ("singleday", DutchHolidayParserConfiguration.singles_day), + ("allsaintsday", DutchHolidayParserConfiguration.halloween_day), + ("youthday", DutchHolidayParserConfiguration.youth_day), + ("childrenday", DutchHolidayParserConfiguration.children_day), + ("femaleday", DutchHolidayParserConfiguration.female_day), + ("treeplantingday", DutchHolidayParserConfiguration.tree_plant_day), + ("arborday", DutchHolidayParserConfiguration.tree_plant_day), + ("girlsday", DutchHolidayParserConfiguration.girls_day), + ("whiteloverday", DutchHolidayParserConfiguration.white_lover_day), + ("loverday", DutchHolidayParserConfiguration.valentines_day), + ("christmas", DutchHolidayParserConfiguration.christmas_day), + ("xmas", DutchHolidayParserConfiguration.children_day), + ("newyear", DutchHolidayParserConfiguration.new_year), + ("newyearday", DutchHolidayParserConfiguration.new_year), + ("newyearsday", DutchHolidayParserConfiguration.new_year), + ("groundhougday", DutchHolidayParserConfiguration.groundhog_day), + ("valentinesday", DutchHolidayParserConfiguration.valentines_day), + ("stpatrickday", DutchHolidayParserConfiguration.st_patrick_day), + ("aprilfools", DutchHolidayParserConfiguration.fool_day), + ("stgeorgeday", DutchHolidayParserConfiguration.st_george_day), + ("mayday", DutchHolidayParserConfiguration.mayday), + ("cincodemayoday", DutchHolidayParserConfiguration.cinco_de_mayo_day), + ("baptisteday", DutchHolidayParserConfiguration.baptiste_day), + ("usindependenceday", DutchHolidayParserConfiguration.usa_independence_day), + ("independenceday", DutchHolidayParserConfiguration.usa_independence_day), + ("bastilleday", DutchHolidayParserConfiguration.bastille_day), + ("halloweenday", DutchHolidayParserConfiguration.halloween_day), + ("allhallowday", DutchHolidayParserConfiguration.all_hallow_day), + ("allsoulsday", DutchHolidayParserConfiguration.all_souls_day), + ("guyfawkesday", DutchHolidayParserConfiguration.guyfawkes_day), + ("veteransday", DutchHolidayParserConfiguration.veterans_day), + ("christmaseve", DutchHolidayParserConfiguration.christmas_eve), + ("newyeareve", DutchHolidayParserConfiguration.new_year_eve), + ("fathersday", DutchHolidayParserConfiguration.fathers_day), + ("mothersday", DutchHolidayParserConfiguration.mothers_day), + ("labourday", DutchHolidayParserConfiguration.international_workers_day), + ("memorialday", DutchHolidayParserConfiguration.memorial_day), + ("easterday", DutchHolidayParserConfiguration.easter_day), + ("eastermonday", DutchHolidayParserConfiguration.easter_day), + ("mardigras", DutchHolidayParserConfiguration.easter_day), + ] + ) + + return {**super()._init_holiday_funcs(), **local} + + @staticmethod + def new_year(year: int) -> datetime: + return datetime(year, 1, 1) + + @staticmethod + def new_year_eve(year: int) -> datetime: + return datetime(year, 12, 31) + + @staticmethod + def christmas_day(year: int) -> datetime: + return datetime(year, 12, 25) + + @staticmethod + def christmas_eve(year: int) -> datetime: + return datetime(year, 12, 24) + + @staticmethod + def female_day(year: int) -> datetime: + return datetime(year, 3, 8) + + @staticmethod + def children_day(year: int) -> datetime: + return datetime(year, 6, 1) + + @staticmethod + def halloween_day(year: int) -> datetime: + return datetime(year, 10, 31) + + @staticmethod + def easter_day(year: int) -> datetime: + return DateUtils.min_value + + @staticmethod + def valentines_day(year: int) -> datetime: + return datetime(year, 2, 14) + + @staticmethod + def white_lover_day(year: int) -> datetime: + return datetime(year, 3, 14) + + @staticmethod + def fool_day(year: int) -> datetime: + return datetime(year, 4, 1) + + @staticmethod + def girls_day(year: int) -> datetime: + return datetime(year, 3, 7) + + @staticmethod + def tree_plant_day(year: int) -> datetime: + return datetime(year, 3, 12) + + @staticmethod + def youth_day(year: int) -> datetime: + return datetime(year, 5, 4) + + @staticmethod + def teacher_day(year: int) -> datetime: + return datetime(year, 9, 10) + + @staticmethod + def singles_day(year: int) -> datetime: + return datetime(year, 11, 11) + + @staticmethod + def mao_birthday(year: int) -> datetime: + return datetime(year, 12, 26) + + @staticmethod + def inauguration_day(year: int) -> datetime: + return datetime(year, 1, 20) + + @staticmethod + def groundhog_day(year: int) -> datetime: + return datetime(year, 2, 2) + + @staticmethod + def st_patrick_day(year: int) -> datetime: + return datetime(year, 3, 17) + + @staticmethod + def st_george_day(year: int) -> datetime: + return datetime(year, 4, 23) + + @staticmethod + def mayday(year: int) -> datetime: + return datetime(year, 5, 1) + + @staticmethod + def cinco_de_mayo_day(year: int) -> datetime: + return datetime(year, 5, 5) + + @staticmethod + def baptiste_day(year: int) -> datetime: + return datetime(year, 6, 24) + + @staticmethod + def usa_independence_day(year: int) -> datetime: + return datetime(year, 7, 4) + + @staticmethod + def bastille_day(year: int) -> datetime: + return datetime(year, 7, 14) + + @staticmethod + def all_hallow_day(year: int) -> datetime: + return datetime(year, 11, 1) + + @staticmethod + def all_souls_day(year: int) -> datetime: + return datetime(year, 11, 2) + + @staticmethod + def guyfawkes_day(year: int) -> datetime: + return datetime(year, 11, 5) + + @staticmethod + def veterans_day(year: int) -> datetime: + return datetime(year, 11, 11) + + @staticmethod + def fathers_day(year: int) -> datetime: + return datetime(year, 6, 17) + + @staticmethod + def mothers_day(year: int) -> datetime: + return datetime(year, 5, 27) + + @staticmethod + def labour_day(year: int) -> datetime: + return datetime(year, 5, 1) + + def get_swift_year(self, text: str) -> int: + trimmed_text = text.strip().lower() + swift = -10 + + if self.next_prefix_regex.search(trimmed_text): + swift = 1 + + if self.previous_prefix_regex.search(trimmed_text): + swift = -1 + + if self.this_prefix_regex.search(trimmed_text): + swift = 0 + + return swift + + def sanitize_holiday_token(self, holiday: str) -> str: + return holiday.replace(' ', '').replace("'", '').replace('-', '') diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/merged_extractor_config.py new file mode 100644 index 0000000000..ac8c17bb7f --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/merged_extractor_config.py @@ -0,0 +1,192 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import List, Pattern + +from recognizers_number import DutchIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + +from ...resources.base_date_time import BaseDateTime +from ...resources.dutch_date_time import DutchDateTime +from ..base_date import BaseDateExtractor +from ..base_dateperiod import BaseDatePeriodExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_datetimeperiod import BaseDateTimePeriodExtractor +from ..base_duration import BaseDurationExtractor +from ..base_holiday import BaseHolidayExtractor +from ..base_merged import MergedExtractorConfiguration +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..extractors import DateTimeExtractor +from .date_extractor_config import DutchDateExtractorConfiguration +from .dateperiod_extractor_config import DutchDatePeriodExtractorConfiguration +from .datetime_extractor_config import DutchDateTimeExtractorConfiguration +from .datetimeperiod_extractor_config import DutchDateTimePeriodExtractorConfiguration +from .duration_extractor_config import DutchDurationExtractorConfiguration +from .holiday_extractor_config import DutchHolidayExtractorConfiguration +from .time_extractor_config import DutchTimeExtractorConfiguration +from .timeperiod_extractor_config import DutchTimePeriodExtractorConfiguration + + +class DutchMergedExtractorConfiguration(MergedExtractorConfiguration): + @property + def check_both_before_after(self): + return self._check_both_before_after + + @property + def datetime_alt_extractor(self): + return self._datetime_alt_extractor + + @property + def term_filter_regexes(self) -> List[Pattern]: + return self._term_filter_regexes + + @property + def fail_fast_regex(self) -> Pattern: + return self._fail_fast_regex + + @property + def superfluous_word_matcher(self) -> Pattern: + return self._superfluous_word_matcher + + @property + def unspecified_date_period_regex(self) -> Pattern: + return self._unspecified_date_period_regex + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def date_period_extractor(self) -> DateTimeExtractor: + return self._date_period_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def date_time_period_extractor(self) -> DateTimeExtractor: + return self._date_time_period_extractor + + @property + def holiday_extractor(self) -> DateTimeExtractor: + return self._holiday_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def integer_extractor(self) -> Extractor: + return self._integer_extractor + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def since_regex(self) -> Pattern: + return self._since_regex + + @property + def around_regex(self) -> Pattern: + return self._around_regex + + @property + def equal_regex(self) -> Pattern: + return self._equal_regex + + @property + def suffix_after_regex(self) -> Pattern: + return self._suffix_after_regex + + @property + def from_to_regex(self) -> Pattern: + return self._from_to_regex + + @property + def single_ambiguous_month_regex(self) -> Pattern: + return self._single_ambiguous_month_regex + + @property + def preposition_suffix_regex(self) -> Pattern: + return self._preposition_suffix_regex + + @property + def number_ending_pattern(self) -> Pattern: + return self._number_ending_pattern + + @property + def filter_word_regex_list(self) -> List[Pattern]: + return self._filter_word_regex_list + + @property + def ambiguous_range_modifier_prefix(self) -> Pattern: + return None + + @property + def ambiguity_filters_dict(self) -> Pattern: + return self._ambiguity_filters_dict + + @property + def potential_ambiguous_range_regex(self) -> Pattern: + return self._potential_ambiguous_range_regex + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + def __init__(self): + self._before_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SinceRegex) + self._from_to_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FromToRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.YearRegex) + self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SingleAmbiguousMonthRegex) + self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PrepositionSuffixRegex) + self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( + DutchDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.NumberEndingPattern) + + self._date_extractor = BaseDateExtractor(DutchDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(DutchTimeExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(DutchDateTimeExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(DutchDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(DutchTimePeriodExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(DutchDateTimePeriodExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(DutchDurationExtractorConfiguration()) + self._holiday_extractor = BaseHolidayExtractor(DutchHolidayExtractorConfiguration()) + self._integer_extractor = DutchIntegerExtractor() + self._filter_word_regex_list = [] + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.UnspecificDatePeriodRegex) + self._around_regex = DutchDateTime.AroundRegex + self._equal_regex = BaseDateTime.EqualRegex + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SuffixAfterRegex) + self._potential_ambiguous_range_regex = RegExpUtility.get_safe_reg_exp( + DutchDateTime.PotentialAmbiguousRangeRegex + ) + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + self._term_filter_regexes = [ + RegExpUtility.get_safe_reg_exp(DutchDateTime.OneOnOneRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.SingleAmbiguousTermsRegex), + ] + # TODO When the implementation for these properties is added, change the None values to their respective Regexps + self._superfluous_word_matcher = None + self._fail_fast_regex = None + self._datetime_alt_extractor = None + self._ambiguity_filters_dict = DefinitionLoader.load_ambiguity_filters(DutchDateTime.AmbiguityFiltersDict) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/merged_parser_config.py new file mode 100644 index 0000000000..b54eb2ac08 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/merged_parser_config.py @@ -0,0 +1,97 @@ +# 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 BaseDateTime, DutchDateTime +from ..base_date import BaseDateParser +from ..base_dateperiod import BaseDatePeriodParser +from ..base_datetime import BaseDateTimeParser +from ..base_datetimeperiod import BaseDateTimePeriodParser +from ..base_duration import BaseDurationParser +from ..base_holiday import BaseHolidayParser +from ..base_merged import MergedParserConfiguration +from ..base_time import BaseTimeParser +from ..base_timeperiod import BaseTimePeriodParser +from .common_configs import DutchCommonDateTimeParserConfiguration +from .dateperiod_parser_config import DutchDatePeriodParserConfiguration +from .holiday_parser_config import DutchHolidayParserConfiguration +from .timeperiod_parser_config import DutchTimePeriodParserConfiguration + + +class DutchMergedParserConfiguration(DutchCommonDateTimeParserConfiguration, MergedParserConfiguration): + @property + def around_regex(self) -> Pattern: + return self._around_regex + + @property + def equal_regex(self) -> Pattern: + return self._equal_regex + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def suffix_after(self) -> Pattern: + return self._suffix_after + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def since_regex(self) -> Pattern: + return self._since_regex + + @property + def date_parser(self) -> BaseDateParser: + return self._date_parser + + @property + def holiday_parser(self) -> BaseHolidayParser: + return self._holiday_parser + + @property + def time_parser(self) -> BaseTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> BaseDateTimeParser: + return self._date_time_parser + + @property + def date_period_parser(self) -> BaseDatePeriodParser: + return self._date_period_parser + + @property + def time_period_parser(self) -> BaseTimePeriodParser: + return self._time_period_parser + + @property + def date_time_period_parser(self) -> BaseDateTimePeriodParser: + return self._date_time_period_parser + + @property + def duration_parser(self) -> BaseDurationParser: + return self._duration_parser + + def __init__(self, config): + DutchCommonDateTimeParserConfiguration.__init__(self) + self._suffix_after = RegExpUtility.get_safe_reg_exp(DutchDateTime.SuffixAfterRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.YearRegex) + self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) + self._around_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AroundRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SinceRegex) + + self._date_period_parser = BaseDatePeriodParser(DutchDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(DutchTimePeriodParserConfiguration(self)) + self._holiday_parser = BaseHolidayParser(DutchHolidayParserConfiguration(config)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/parsers.py new file mode 100644 index 0000000000..28b570735a --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/parsers.py @@ -0,0 +1,38 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from datetime import datetime + +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_time import BaseTimeParser +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils + + +class DutchTimeParser(BaseTimeParser): + def internal_parser(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = super().internal_parser(source, reference) + if not result.success: + result = self.parse_ish(source, reference) + + return result + + def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + trimmed_source = source.strip().lower() + + match = RegExpUtility.get_safe_reg_exp(DutchDateTime.IshRegex).match(source) + if match and match.end() == len(trimmed_source): + hour_str = RegExpUtility.get_group(match, 'hour') + hour = 12 + if hour_str: + hour = int(hour_str) + + result.timex = 'T' + DateTimeFormatUtil.to_str(hour, 2) + result.future_value = result.past_value = DateUtils.safe_create_from_min_value( + reference.year, reference.month, reference.day, hour, 0, 0 + ) + result.success = True + + return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/time_extractor_config.py new file mode 100644 index 0000000000..412587a117 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/time_extractor_config.py @@ -0,0 +1,139 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import List, Pattern + +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_time import TimeExtractorConfiguration +from ..utilities import DateTimeOptions + + +class DutchTimeExtractorConfiguration(TimeExtractorConfiguration): + @property + def time_regex_list(self) -> List[Pattern]: + return self._time_regex_list + + @property + def at_regex(self) -> Pattern: + return self._at_regex + + @property + def ish_regex(self) -> Pattern: + return self._ish_regex + + @property + def time_before_after_regex(self) -> Pattern: + return self._time_before_after_regex + + @property + def desc_regex(self) -> Pattern: + return self._desc_regex + + @property + def hour_num_regex(self) -> Pattern: + return self._hour_num_regex + + @property + def minute_num_regex(self) -> Pattern: + return self._minute_num_regex + + @property + def oclock_regex(self) -> Pattern: + return self._oclock_regex + + @property + def pm_regex(self) -> Pattern: + return self._pm_regex + + @property + def am_regex(self) -> Pattern: + return self._am_regex + + @property + def less_than_one_hour_regex(self) -> Pattern: + return self._less_than_one_hour + + @property + def written_time_regex(self) -> Pattern: + return self._written_time_regex + + @property + def time_prefix_regex(self) -> Pattern: + return self._time_prefix_regex + + @property + def time_suffix_regex(self) -> Pattern: + return self._time_suffix_regex + + @property + def basic_time_regex(self) -> Pattern: + return self._basic_time_regex + + @property + def midnight_regex(self) -> Pattern: + return self._midnight_regex + + @property + def midmorning_regex(self) -> Pattern: + return self._midmorning_regex + + @property + def midafternoon_regex(self) -> Pattern: + return self._midafternoon_regex + + @property + def midday_regex(self) -> Pattern: + return self._midday_regex + + @property + def midtime_regex(self) -> Pattern: + return self._midtime_regex + + @property + def time_unit_regex(self) -> Pattern: + return self._time_unit_regex + + def __init__(self): + super().__init__() + self._time_regex_list: List[Pattern] = DutchTimeExtractorConfiguration.get_time_regex_list() + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.AtRegex) + self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.IshRegex) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeBeforeAfterRegex) + self._options = DateTimeOptions.NONE + self._desc_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.DescRegex) + self._hour_num_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.HourNumRegex) + self._minute_num_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MinuteNumRegex) + self._oclock_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.OclockRegex) + self._pm_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PmRegex) + self._am_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.AmRegex) + self._less_than_one_hour = RegExpUtility.get_safe_reg_exp(DutchDateTime.LessThanOneHour) + self._written_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.WrittenTimeRegex) + self._time_prefix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimePrefix) + self._time_suffix_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeSuffix) + self._basic_time_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BasicTime) + self._midnight_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MidnightRegex) + self._midmorning_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MidmorningRegex) + self._midafternoon_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MidafternoonRegex) + self._midday_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MiddayRegex) + self._midtime_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.MidTimeRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeUnitRegex) + + @staticmethod + def get_time_regex_list() -> List[Pattern]: + return [ + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex1), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex2), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex3), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex4), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex5), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex6), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex7), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex8), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex9), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex10), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex11), + RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeRegex12), + RegExpUtility.get_safe_reg_exp(DutchDateTime.ConnectNumRegex), + ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/time_parser_config.py new file mode 100644 index 0000000000..8f25ae2c88 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/time_parser_config.py @@ -0,0 +1,132 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +import regex + +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_time import AdjustParams, TimeParserConfiguration +from ..constants import Constants +from .time_extractor_config import DutchTimeExtractorConfiguration + + +class DutchTimeParserConfiguration(TimeParserConfiguration): + @property + def time_token_prefix(self) -> str: + return self._time_token_prefix + + @property + def at_regex(self) -> Pattern: + return self._at_regex + + @property + def time_regexes(self) -> List[Pattern]: + return self._time_regexes + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self, config: BaseDateParserConfiguration): + self._time_token_prefix: str = DutchDateTime.TimeTokenPrefix + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.AtRegex) + self._time_regexes: List[Pattern] = DutchTimeExtractorConfiguration.get_time_regex_list() + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(DutchDateTime.LessThanOneHour) + self.time_suffix = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeSuffix) + self.night_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.NightRegex) + self.time_suffix_full_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeSuffixFull) + self.lunch_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.LunchRegex) + self.to_token_regex_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ToTokenRegex) + self.to_half_token_regex_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ToHalfTokenRegex) + self.for_half_token_regex_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ForHalfTokenRegex) + + self._half_token_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.HalfTokenRegex) + self._quarter_token_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.QuarterTokenRegex) + self._three_quarter_token_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.ThreeQuarterTokenRegex) + + self._utility_configuration = config.utility_configuration + self._numbers: Dict[str, int] = config.numbers + + def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): + delta_min = 0 + trimmed_prefix = prefix.strip().lower() + + if regex.search(self._half_token_regex, prefix): + delta_min = -30 + elif regex.search(self._quarter_token_regex, prefix): + delta_min = 15 + elif regex.search(self._three_quarter_token_regex, prefix): + delta_min = 45 + else: + match = regex.search(self.less_than_one_hour, trimmed_prefix) + if match: + min_str = RegExpUtility.get_group(match, 'deltamin') + if min_str: + delta_min = int(min_str) + else: + min_str = RegExpUtility.get_group(match, 'deltaminnum').lower() + delta_min = self.numbers.get(min_str) + + if regex.search(self.to_half_token_regex_regex, prefix): + delta_min = delta_min - 30 + elif regex.search(self.for_half_token_regex_regex, prefix): + delta_min = -delta_min - 30 + elif regex.search(self.to_token_regex_regex, prefix): + delta_min = delta_min * -1 + + adjust.minute += delta_min + + if adjust.minute < 0: + adjust.minute += 60 + adjust.hour -= 1 + + adjust.has_minute = True + + def adjust_by_suffix(self, suffix: str, adjust: AdjustParams): + suffix = suffix.strip().lower() + delta_hour = 0 + match = regex.search(self.time_suffix_full_regex, suffix) + if match is not None and match.start() == 0 and match.group() == suffix: + oclock_str = RegExpUtility.get_group(match, 'oclock') + if not oclock_str: + am_str = RegExpUtility.get_group(match, Constants.AM_GROUP_NAME) + if am_str: + if adjust.hour >= Constants.HALF_DAY_HOUR_COUNT: + delta_hour -= Constants.HALF_DAY_HOUR_COUNT + else: + adjust.has_am = True + pm_str = RegExpUtility.get_group(match, Constants.PM_GROUP_NAME) + + if pm_str: + if adjust.hour < Constants.HALF_DAY_HOUR_COUNT: + delta_hour = Constants.HALF_DAY_HOUR_COUNT + if regex.search(self.lunch_regex, pm_str): + if adjust.hour >= 10 and adjust.hour <= Constants.HALF_DAY_HOUR_COUNT: + delta_hour = 0 + if adjust.hour == Constants.HALF_DAY_HOUR_COUNT: + adjust.has_pm = True + else: + adjust.has_am = True + else: + adjust.has_pm = True + + elif regex.search(self.night_regex, pm_str): + if adjust.hour <= 3 or adjust.hour == Constants.HALF_DAY_HOUR_COUNT: + if adjust.hour == Constants.HALF_DAY_HOUR_COUNT: + adjust.hour = 0 + delta_hour = 0 + adjust.has_am = True + else: + adjust.has_pm = True + else: + adjust.has_pm = True + + adjust.hour = (adjust.hour + delta_hour) % 24 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/timeperiod_extractor_config.py new file mode 100644 index 0000000000..4fcd5760da --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/timeperiod_extractor_config.py @@ -0,0 +1,145 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import List, Pattern + +from recognizers_number.number.dutch.extractors import DutchIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import MatchedIndex, TimePeriodExtractorConfiguration +from ..extractors import DateTimeExtractor +from .base_configs import DutchDateTimeUtilityConfiguration +from .time_extractor_config import DutchTimeExtractorConfiguration + + +class DutchTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def simple_cases_regex(self) -> List[Pattern]: + return self._simple_cases_regex + + @property + def till_regex(self) -> Pattern: + return self._till_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def general_ending_regex(self) -> Pattern: + return self._general_ending_regex + + @property + def single_time_extractor(self) -> DateTimeExtractor: + return self._single_time_extractor + + @property + def integer_extractor(self) -> Extractor: + return self._integer_extractor + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def pure_number_regex(self) -> List[Pattern]: + return self._pure_number_regex + + @property + def hour_regex(self) -> Pattern: + return self._hour_regex + + @property + def period_hour_num_regex(self) -> Pattern: + return self._period_hour_num_regex + + @property + def period_desc_regex(self) -> Pattern: + return self._period_desc_regex + + @property + def time_date_from_to_regex(self): + return self._time_date_from_to_regex + + @property + def specific_time_from_to(self): + return self._specific_time_from_to_regex + + @property + def specific_time_between_and(self): + return self._specific_time_between_and_regex + + @property + def preposition_regex(self): + return self._preposition_regex + + @property + def specific_time_of_day_regex(self): + return self._specific_time_of_day_regex + + @property + def time_unit_regex(self): + return self._time_unit_regex + + def __init__(self): + super().__init__() + self._check_both_before_after = DutchDateTime.CheckBothBeforeAfter + self._single_time_extractor = BaseTimeExtractor(DutchTimeExtractorConfiguration()) + self._integer_extractor = DutchIntegerExtractor() + self.utility_configuration = DutchDateTimeUtilityConfiguration() + + self._simple_cases_regex: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(DutchDateTime.PureNumFromTo), + RegExpUtility.get_safe_reg_exp(DutchDateTime.PureNumBetweenAnd), + RegExpUtility.get_safe_reg_exp(DutchDateTime.PmRegex), + RegExpUtility.get_safe_reg_exp(DutchDateTime.AmRegex), + ] + + self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.TillRegex) + self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeOfDayRegex) + self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.GeneralEndingRegex) + self._hour_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.HourRegex) + self._period_desc_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.DescRegex) + self._period_hour_num_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.PeriodHourNumRegex) + self._specific_time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeOfDayRegex) + self.time_followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeFollowedUnit) + self.time_number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( + DutchDateTime.TimeNumberCombinedWithUnit + ) + + self.from_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.FromRegex) + self.between_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BetweenRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeUnitRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.RangeConnectorRegex) + self.before_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BeforeRegex) + self._time_date_from_to_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeDateFromTo) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeBetweenAnd) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PrepositionRegex) + self._token_before_date = DutchDateTime.TokenBeforeDate + self._pure_number_regex = [DutchDateTime.PureNumFromTo, DutchDateTime.PureNumFromTo] + self.between_token_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.BetweenTokenRegex) + + def get_from_token_index(self, source: str) -> MatchedIndex: + match = self.from_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def get_between_token_index(self, source: str) -> MatchedIndex: + match = self.between_token_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def is_connector_token(self, source: str): + return self.range_connector_regex.match(source) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/timeperiod_parser_config.py new file mode 100644 index 0000000000..c46f59c1f4 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/dutch/timeperiod_parser_config.py @@ -0,0 +1,110 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, Pattern + +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + +from ...resources.dutch_date_time import DutchDateTime +from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_timeperiod import MatchedTimeRegex, TimePeriodParserConfiguration +from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser +from ..utilities import TimexUtil + + +class DutchTimePeriodParserConfiguration(TimePeriodParserConfiguration): + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def integer_extractor(self) -> Extractor: + return self._integer_extractor + + @property + def pure_number_from_to_regex(self) -> Pattern: + return self._pure_number_from_to_regex + + @property + def pure_number_between_and_regex(self) -> Pattern: + return self._pure_number_between_and_regex + + @property + def specific_time_from_to_regex(self) -> Pattern: + return self._specific_time_from_to_regex + + @property + def specific_time_between_and_regex(self) -> Pattern: + return self._specific_time_between_and_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def till_regex(self) -> Pattern: + return self._till_regex + + @property + def numbers(self) -> Dict[str, int]: + return self._numbers + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self, config: BaseDateParserConfiguration): + self._time_extractor = config.time_extractor + self._time_parser = config.time_parser + self._integer_extractor = config.integer_extractor + self._numbers = config.numbers + self._utility_configuration = config.utility_configuration + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.PureNumBetweenAnd) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.SpecificTimeBetweenAnd) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TimeOfDayRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(DutchDateTime.TillRegex) + + def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: + trimmed_text = source.strip().lower() + if trimmed_text.endswith('s'): + trimmed_text = trimmed_text[:-1] + + if any(trimmed_text.endswith(o) for o in DutchDateTime.MorningTermList): + time_of_day = Constants.MORNING + elif any(trimmed_text.endswith(o) for o in DutchDateTime.AfternoonTermList): + time_of_day = Constants.AFTERNOON + elif any(trimmed_text.endswith(o) for o in DutchDateTime.EveningTermList): + time_of_day = Constants.EVENING + elif any(trimmed_text.endswith(o) for o in DutchDateTime.DaytimeTermList): + time_of_day = Constants.DAYTIME + elif any(trimmed_text.endswith(o) for o in DutchDateTime.NightTermList): + time_of_day = Constants.NIGHT + elif all(trimmed_text.endswith(o) for o in DutchDateTime.BusinessHourSplitStrings): + time_of_day = Constants.BUSINESS_HOUR + elif all(trimmed_text.endswith(o) for o in DutchDateTime.BusinessHourSplitStrings2): + time_of_day = Constants.BUSINESS_HOUR + elif any(trimmed_text.endswith(o) for o in DutchDateTime.MealtimeBreakfastTermList): + time_of_day = Constants.MEALTIME_BREAKFAST + elif any(trimmed_text.endswith(o) for o in DutchDateTime.MealtimeLunchTermList): + time_of_day = Constants.MEALTIME_LUNCH + elif any(trimmed_text.endswith(o) for o in DutchDateTime.MealtimeDinnerTermList): + time_of_day = Constants.MEALTIME_DINNER + else: + return MatchedTimeRegex(matched=False, timex='', begin_hour=0, end_hour=0, end_min=0) + + parse_result = TimexUtil.parse_time_of_day(time_of_day) + timex = parse_result.timex + begin_hour = parse_result.begin_hour + end_hour = parse_result.end_hour + end_min = parse_result.end_min + + return MatchedTimeRegex(matched=True, timex=timex, begin_hour=begin_hour, end_hour=end_hour, end_min=end_min) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/__init__.py index 405e50c1ce..cc7166985a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/__init__.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/__init__.py @@ -4,24 +4,21 @@ from .base_configs import * from .common_configs import * from .date_extractor_config import * -from .time_extractor_config import * -from .duration_extractor_config import * -from .dateperiod_extractor_config import * -from .timeperiod_extractor_config import * -from .datetime_extractor_config import * -from .datetimeperiod_extractor_config import * -from .set_extractor_config import * -from .holiday_extractor_config import * -from .merged_extractor_config import * from .date_parser_config import * -from .time_parser_config import * -from .duration_parser_config import * +from .dateperiod_extractor_config import * from .dateperiod_parser_config import * -from .timeperiod_parser_config import * +from .datetime_extractor_config import * from .datetime_parser_config import * +from .datetimeperiod_extractor_config import * from .datetimeperiod_parser_config import * -from .set_parser_config import * +from .duration_extractor_config import * +from .duration_parser_config import * +from .holiday_extractor_config import * from .holiday_parser_config import * +from .merged_extractor_config import * from .merged_parser_config import * from .parsers import * -from .timezone_extractor_config import * +from .time_extractor_config import * +from .time_parser_config import * +from .timeperiod_extractor_config import * +from .timeperiod_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/base_configs.py index e201aa3754..5161af973d 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/base_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/base_configs.py @@ -1,90 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_date_time.date_time.base_date import DateTimeUtilityConfiguration +from recognizers_date_time.date_time.utilities import DateTimeUtilityConfiguration from recognizers_date_time.resources.english_date_time import EnglishDateTime class EnglishDateTimeUtilityConfiguration(DateTimeUtilityConfiguration): - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def range_prefix_regex(self) -> Pattern: - return self._range_prefix_regex - - @property - def check_both_before_after(self) -> Pattern: - return self._check_both_before_after - - @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 def __init__(self): - self._later_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AgoRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RangeUnitRegex) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AmDescRegex) - self._pm_desc__regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PmDescRegex) - self._am_pm_desc_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AmPmDescRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WithinNextPrefixRegex) - self._common_date_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.CommonDatePrefixRegex) - self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - self._range_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RangePrefixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DateUnitRegex - ) + super().__init__(EnglishDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/common_configs.py index fcba6e90b4..2c09337ddc 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/common_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/common_configs.py @@ -4,38 +4,40 @@ from typing import Dict, Pattern from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_number.number.english.extractors import ( + EnglishCardinalExtractor, + EnglishIntegerExtractor, + EnglishOrdinalExtractor, +) from recognizers_number.number.english.parsers import EnglishNumberParserConfiguration -from recognizers_number.number.english.extractors import EnglishCardinalExtractor, EnglishIntegerExtractor, EnglishOrdinalExtractor from ...resources.english_date_time import BaseDateTime, EnglishDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration from ..base_date import BaseDateExtractor, BaseDateParser -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor, BaseDurationParser from ..base_dateperiod import BaseDatePeriodExtractor, BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser from ..base_datetime import BaseDateTimeExtractor, BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodExtractor, BaseDateTimePeriodParser - +from ..base_duration import BaseDurationExtractor, BaseDurationParser +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from .base_configs import EnglishDateTimeUtilityConfiguration from .date_extractor_config import EnglishDateExtractorConfiguration from .date_parser_config import EnglishDateParserConfiguration -from .time_extractor_config import EnglishTimeExtractorConfiguration -from .time_parser_config import EnglishTimeParserConfiguration -from .parsers import EnglishTimeParser -from .duration_extractor_config import EnglishDurationExtractorConfiguration -from .duration_parser_config import EnglishDurationParserConfiguration from .dateperiod_extractor_config import EnglishDatePeriodExtractorConfiguration from .dateperiod_parser_config import EnglishDatePeriodParserConfiguration -from .timeperiod_extractor_config import EnglishTimePeriodExtractorConfiguration -from .timeperiod_parser_config import EnglishTimePeriodParserConfiguration from .datetime_extractor_config import EnglishDateTimeExtractorConfiguration from .datetime_parser_config import EnglishDateTimeParserConfiguration from .datetimeperiod_extractor_config import EnglishDateTimePeriodExtractorConfiguration from .datetimeperiod_parser_config import EnglishDateTimePeriodParserConfiguration -from ..base_timezone import BaseTimeZoneParser +from .duration_extractor_config import EnglishDurationExtractorConfiguration +from .duration_parser_config import EnglishDurationParserConfiguration +from .parsers import EnglishTimeParser +from .time_extractor_config import EnglishTimeExtractorConfiguration +from .time_parser_config import EnglishTimeParserConfiguration +from .timeperiod_extractor_config import EnglishTimePeriodExtractorConfiguration +from .timeperiod_parser_config import EnglishTimePeriodParserConfiguration class EnglishCommonDateTimeParserConfiguration(BaseDateParserConfiguration): @@ -55,10 +57,6 @@ def integer_extractor(self) -> BaseNumberExtractor: def ordinal_extractor(self) -> BaseNumberExtractor: return self._ordinal_extractor - @property - def time_zone_parser(self) -> BaseTimeZoneParser: - return self._time_zone_parser - @property def number_parser(self) -> BaseNumberParser: return self._number_parser @@ -171,36 +169,21 @@ def __init__(self, dmyDateFormat=False): self._integer_extractor = EnglishIntegerExtractor() self._ordinal_extractor = EnglishOrdinalExtractor() self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - self._day_of_month = { - **BaseDateTime.DayOfMonthDictionary, **EnglishDateTime.DayOfMonth} - self._time_zone_parser = BaseTimeZoneParser() - self._number_parser = BaseNumberParser( - EnglishNumberParserConfiguration()) - self._date_extractor = BaseDateExtractor( - EnglishDateExtractorConfiguration(dmyDateFormat)) - self._time_extractor = BaseTimeExtractor( - EnglishTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - EnglishDurationExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - EnglishDatePeriodExtractorConfiguration(dmyDateFormat)) - self._time_period_extractor = BaseTimePeriodExtractor( - EnglishTimePeriodExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - EnglishDateTimeExtractorConfiguration(dmyDateFormat)) + self._day_of_month = {**BaseDateTime.DayOfMonthDictionary, **EnglishDateTime.DayOfMonth} + self._number_parser = BaseNumberParser(EnglishNumberParserConfiguration()) + self._date_extractor = BaseDateExtractor(EnglishDateExtractorConfiguration(dmyDateFormat)) + self._time_extractor = BaseTimeExtractor(EnglishTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(EnglishDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(EnglishDatePeriodExtractorConfiguration(dmyDateFormat)) + self._time_period_extractor = BaseTimePeriodExtractor(EnglishTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(EnglishDateTimeExtractorConfiguration(dmyDateFormat)) self._date_time_period_extractor = BaseDateTimePeriodExtractor( - EnglishDateTimePeriodExtractorConfiguration(dmyDateFormat)) - self._duration_parser = BaseDurationParser( - EnglishDurationParserConfiguration(self)) - self._date_parser = BaseDateParser( - EnglishDateParserConfiguration(self, dmyDateFormat)) - self._time_parser = EnglishTimeParser( - EnglishTimeParserConfiguration(self)) - self._date_period_parser = BaseDatePeriodParser( - EnglishDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - EnglishTimePeriodParserConfiguration(self)) - self._date_time_parser = BaseDateTimeParser( - EnglishDateTimeParserConfiguration(self)) - self._date_time_period_parser = BaseDateTimePeriodParser( - EnglishDateTimePeriodParserConfiguration(self)) + EnglishDateTimePeriodExtractorConfiguration(dmyDateFormat) + ) + self._duration_parser = BaseDurationParser(EnglishDurationParserConfiguration(self)) + self._date_parser = BaseDateParser(EnglishDateParserConfiguration(self, dmyDateFormat)) + self._time_parser = EnglishTimeParser(EnglishTimeParserConfiguration(self)) + self._date_period_parser = BaseDatePeriodParser(EnglishDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(EnglishTimePeriodParserConfiguration(self)) + self._date_time_parser = BaseDateTimeParser(EnglishDateTimeParserConfiguration(self)) + self._date_time_period_parser = BaseDateTimePeriodParser(EnglishDateTimePeriodParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/date_extractor_config.py index d69090ff7b..27ee5fdb5f 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/date_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/date_extractor_config.py @@ -1,164 +1,53 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict -from recognizers_number import (BaseNumberExtractor, BaseNumberParser, - EnglishOrdinalExtractor, EnglishIntegerExtractor, EnglishNumberParserConfiguration) +from typing import List, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + EnglishIntegerExtractor, + EnglishNumberParserConfiguration, + EnglishOrdinalExtractor, +) from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import DateExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..extractors import DateTimeExtractor from ..utilities import DateTimeUtilityConfiguration -from .duration_extractor_config import EnglishDurationExtractorConfiguration from .base_configs import EnglishDateTimeUtilityConfiguration -from ...resources.base_date_time import BaseDateTime +from .duration_extractor_config import EnglishDurationExtractorConfiguration class EnglishDateExtractorConfiguration(DateExtractorConfiguration): - @property - def week_day_start(self) -> Pattern: - return self._week_day_start - @property - def check_both_before_after(self) -> Pattern: - return self._check_both_before_after + def __init__(self, dmyDateFormat: bool = False): + self._dmy_date_format = dmyDateFormat + super().__init__(EnglishDateTime()) + self.ordinal_extractor: BaseNumberExtractor = EnglishOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = EnglishIntegerExtractor() + self.number_parser: BaseNumberParser = BaseNumberParser(EnglishNumberParserConfiguration()) + self.duration_extractor: DateTimeExtractor = BaseDurationExtractor(EnglishDurationExtractorConfiguration()) + self.utility_configuration: DateTimeUtilityConfiguration = EnglishDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(EnglishDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.ThisRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.LastDateRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.SingleWeekDayRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecialDate), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecialDayWithNumRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeWeekDayRegex), + ] @property def date_regex_list(self) -> List[Pattern]: - return self._date_regex_list - - @property - def implicit_date_list(self) -> List[Pattern]: - return self._implicit_date_list - - @property - def month_end(self) -> Pattern: - return self._month_end - - @property - def week_day_end(self) -> Pattern: - return self._week_day_end - - @property - def week_day_start(self) -> Pattern: - return self._week_day_start - - @property - def of_month(self) -> Pattern: - return self._of_month - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def for_the_regex(self) -> Pattern: - return self._for_the_regex - - @property - def week_day_and_day_of_month_regex(self) -> Pattern: - return self._week_day_and_day_of_month_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def prefix_article_regex(self) -> Pattern: - return self._prefix_article_regex - - @property - def day_of_week(self) -> Dict[str, int]: - return self._day_of_week - - @property - def month_of_year(self) -> Dict[str, int]: - return self._month_of_year - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def strict_relative_regex(self) -> Pattern: - return self._strict_relative_regex - - @property - def range_connector_symbol_regex(self) -> Pattern: - return self._range_connector_symbol_regex - - @property - def utility_configuration(self) -> DateTimeUtilityConfiguration: - return self._utility_configuration - - @property - def year_suffix(self) -> Pattern: - return self._year_suffix - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_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 since_year_suffix_regex(self) -> Pattern: - return self._since_year_suffix_regex - - @property - def week_day_and_day_regex(self) -> Pattern: - return self._week_day_and_day_regex - - @property - def month_regex(self) -> Pattern: - return self._month_regex - - @property - def month_num_regex(self) -> Pattern: - return self._month_num_regex - - @property - def year_regex(self) -> Pattern: - return self._year_regex - - @property - def written_month_regex(self) -> Pattern: - return self._written_month_regex - - @property - def month_suffix_regex(self) -> Pattern: - return self._month_suffix_regex - - def __init__(self, dmyDateFormat=False): - self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - if dmyDateFormat: + if self._dmy_date_format: date_extractor_4 = EnglishDateTime.DateExtractor5 date_extractor_5 = EnglishDateTime.DateExtractor8 date_extractor_6 = EnglishDateTime.DateExtractor9L @@ -177,7 +66,7 @@ def __init__(self, dmyDateFormat=False): date_extractor_10 = EnglishDateTime.DateExtractor9L date_extractor_11 = EnglishDateTime.DateExtractor9S - self._date_regex_list = [ + return [ RegExpUtility.get_safe_reg_exp(EnglishDateTime.DateExtractor1), RegExpUtility.get_safe_reg_exp(EnglishDateTime.DateExtractor3), RegExpUtility.get_safe_reg_exp(date_extractor_4), @@ -190,99 +79,3 @@ def __init__(self, dmyDateFormat=False): RegExpUtility.get_safe_reg_exp(date_extractor_11), RegExpUtility.get_safe_reg_exp(EnglishDateTime.DateExtractorA), ] - self._implicit_date_list = [ - RegExpUtility.get_safe_reg_exp(EnglishDateTime.OnRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelaxedOnRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecialDayRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.ThisRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.LastDateRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.NextDateRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.SingleWeekDayRegex), - RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecialDate), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecialDayWithNumRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeWeekDayRegex) - ] - self._month_end = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthEnd) - self._of_month = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.OfMonth) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DateUnitRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.ForTheRegex) - self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayAndDayOfMonthRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayRegex) - self._day_of_week = EnglishDateTime.DayOfWeek - self._ordinal_extractor = EnglishOrdinalExtractor() - self._integer_extractor = EnglishIntegerExtractor() - self._number_parser = BaseNumberParser( - EnglishNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - EnglishDurationExtractorConfiguration()) - self._utility_configuration = EnglishDateTimeUtilityConfiguration() - self._range_connector_symbol_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.RangeConnectorSymbolRegex - ) - self._strict_relative_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.StrictRelativeRegex - ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.YearSuffix - ) - self._month_of_year = EnglishDateTime.MonthOfYear - self._prefix_article_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PrefixArticleRegex - ) - self._week_day_end = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayEnd - ) - self._week_day_start = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayStart - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LessThanRegex - ) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.InConnectorRegex - ) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RangeUnitRegex - ) - self._since_year_suffix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SinceYearSuffixRegex - ) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayAndDayRegex - ) - self._week_day_start = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayStart - ) - self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - - self._month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthRegex - ) - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthNumRegex - ) - self._year_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.YearRegex - ) - self._day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DayRegex - ) - self._written_month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WrittenMonthRegex - ) - self._month_suffix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthSuffixRegex - ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/date_parser_config.py index 23ab7f635a..c88be62945 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/date_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/date_parser_config.py @@ -1,17 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict +from typing import Dict, List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_date import DateParserConfiguration from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_date import DateParserConfiguration -from ..base_configs import BaseDateParserConfiguration from .date_extractor_config import EnglishDateExtractorConfiguration @@ -143,12 +145,9 @@ def date_token_prefix(self) -> str: # The following three regexes only used in this configuration # They are not used in the base parser, therefore they are not extracted # If the spanish date parser need the same regexes, they should be extracted - _relative_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RelativeDayRegex) - _next_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NextPrefixRegex) - _past_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PreviousPrefixRegex) + _relative_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeDayRegex) + _next_prefix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NextPrefixRegex) + _past_prefix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PreviousPrefixRegex) def __init__(self, config: BaseDateParserConfiguration, dmyDateFormat=False): self._ordinal_extractor = config.ordinal_extractor @@ -163,37 +162,24 @@ def __init__(self, config: BaseDateParserConfiguration, dmyDateFormat=False): self._day_of_week = config.day_of_week self._unit_map = config.unit_map self._cardinal_map = config.cardinal_map - self._date_regex = EnglishDateExtractorConfiguration(dmyDateFormat)._date_regex_list - self._on_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.OnRegex) - self._special_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SpecialDayRegex) - self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SpecialDayWithNumRegex) - self._next_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NextDateRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DateUnitRegex) - self._month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayRegex) - self._last_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LastDateRegex) - self._this_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.ThisRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayOfMonthRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.ForTheRegex) + self._date_regex = EnglishDateExtractorConfiguration(dmyDateFormat).date_regex_list + self._on_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.OnRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NextDateRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DateUnitRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekDayRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.LastDateRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.ThisRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekDayOfMonthRegex) + self._for_the_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.ForTheRegex) self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayAndDayOfMonthRegex) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayAndDayRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RelativeMonthRegex) - self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RelativeWeekDayRegex) + EnglishDateTime.WeekDayAndDayOfMonthRegex + ) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeMonthRegex) + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeWeekDayRegex) self._utility_configuration = config.utility_configuration self._date_token_prefix = EnglishDateTime.DateTokenPrefix self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter @@ -201,8 +187,7 @@ def __init__(self, config: BaseDateParserConfiguration, dmyDateFormat=False): def get_swift_day(self, source: str) -> int: trimmed_text = source.strip().lower() swift = 0 - matches = regex.search( - EnglishDateParserConfiguration._relative_day_regex, source) + matches = regex.search(EnglishDateParserConfiguration._relative_day_regex, source) if trimmed_text == 'today': swift = 0 elif trimmed_text == 'tomorrow' or trimmed_text == 'tmr': @@ -228,10 +213,8 @@ def get_swift_month(self, source: str) -> int: def get_swift(self, source: str) -> int: trimmed_text = source.strip().lower() swift = 0 - next_prefix_matches = regex.search( - EnglishDateParserConfiguration._next_prefix_regex, trimmed_text) - past_prefix_matches = regex.search( - EnglishDateParserConfiguration._past_prefix_regex, trimmed_text) + next_prefix_matches = regex.search(EnglishDateParserConfiguration._next_prefix_regex, trimmed_text) + past_prefix_matches = regex.search(EnglishDateParserConfiguration._past_prefix_regex, trimmed_text) if next_prefix_matches: swift = 1 elif past_prefix_matches: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/dateperiod_extractor_config.py index f805acc747..272ceee08c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/dateperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/dateperiod_extractor_config.py @@ -1,174 +1,33 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number import BaseNumberParser, BaseNumberExtractor +from recognizers_number.number import BaseNumberParser from recognizers_number.number.english.extractors import EnglishIntegerExtractor from recognizers_number.number.english.parsers import EnglishNumberParserConfiguration -from ...resources.base_date_time import BaseDateTime +from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import BaseDateExtractor from ..base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex -from .duration_extractor_config import EnglishDurationExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from .common_configs import EnglishCardinalExtractor, EnglishOrdinalExtractor from .date_extractor_config import EnglishDateExtractorConfiguration -from .common_configs import EnglishOrdinalExtractor, EnglishCardinalExtractor +from .duration_extractor_config import EnglishDurationExtractorConfiguration class EnglishDatePeriodExtractorConfiguration(DatePeriodExtractorConfiguration): - @property - def previous_prefix_regex(self) -> Pattern: - return self._previous_prefix_regex - - @property - def check_both_before_after(self) -> bool: - return self._check_both_before_after - - @property - def simple_cases_regexes(self) -> List[Pattern]: - return self._simple_cases_regexes - - @property - def illegal_year_regex(self) -> Pattern: - return self._illegal_year_regex - - @property - def year_regex(self) -> Pattern: - return self._year_regex - - @property - def till_regex(self) -> Pattern: - return self._till_regex - - @property - def followed_unit(self) -> Pattern: - return self._followed_unit - - @property - def number_combined_with_unit(self) -> Pattern: - return self._number_combined_with_unit - - @property - def past_regex(self) -> Pattern: - return self._past_regex - - @property - def decade_with_century_regex(self) -> Pattern: - return self._decade_with_century_regex - - @property - def future_regex(self) -> Pattern: - return self._future_regex - - @property - def week_of_regex(self) -> Pattern: - return self._week_of_regex - - @property - def month_of_regex(self) -> Pattern: - return self._month_of_regex - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def time_unit_regex(self) -> Pattern: - return self._time_unit_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 date_point_extractor(self) -> DateTimeExtractor: - return self._date_point_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def range_connector_regex(self) -> Pattern: - return self._range_connector_regex - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def cardinal_extractor(self) -> Extractor: - return self._cardinal_extractor - - @property - def now_regex(self) -> Pattern: - return self._now_regex - - @property - def within_next_prefix_regex(self) -> Pattern: - return self._within_next_prefix_regex - - @property - def future_suffix_regex(self) -> Pattern: - return self._future_suffix_regex - - @property - def ago_regex(self) -> Pattern: - return self._ago_regex - - @property - def later_regex(self) -> Pattern: - return self._later_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_regex - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def duration_date_restrictions(self) -> [str]: - return self._duration_date_restrictions - - @property - def year_period_regex(self) -> Pattern: - return self._year_period_regex - - @property - def decade_with_century_regex(self) -> Pattern: - return self._decade_with_century_regex - - @property - def month_num_regex(self) -> Pattern: - return self._month_num_regex - - @property - def century_suffix_regex(self) -> Pattern: - return self._century_suffix_regex def __init__(self, dmyDateFormat=False): - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PreviousPrefixRegex) - self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - self._simple_cases_regexes = [ + super().__init__(EnglishDateTime()) + self.ordinal_extractor = EnglishOrdinalExtractor() + self.cardinal_extractor = EnglishCardinalExtractor() + self.cardinal_extractor = EnglishCardinalExtractor() + self.date_point_extractor = BaseDateExtractor(EnglishDateExtractorConfiguration(dmyDateFormat)) + self.number_parser = BaseNumberParser(EnglishNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(EnglishDurationExtractorConfiguration()) + self.integer_extractor = EnglishIntegerExtractor() + self.simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(EnglishDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.BetweenRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.OneWordPeriodRegex), @@ -178,102 +37,21 @@ def __init__(self, dmyDateFormat=False): RegExpUtility.get_safe_reg_exp(EnglishDateTime.DecadeWithCenturyRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekOfMonthRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekOfYearRegex), - RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthFrontBetweenRegex), - RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthFrontSimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.MonthFrontBetweenRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.MonthFrontSimpleCasesRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.QuarterRegex), - RegExpUtility.get_safe_reg_exp( - EnglishDateTime.QuarterRegexYearFront), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.QuarterRegexYearFront), RegExpUtility.get_safe_reg_exp(EnglishDateTime.AllHalfYearRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.SeasonRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.WhichWeekRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.RestOfDateRegex), - RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LaterEarlyPeriodRegex), - RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekWithWeekDayRangeRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.LaterEarlyPeriodRegex), + RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekWithWeekDayRangeRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.YearPlusNumberRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.DecadeWithCenturyRegex), RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeDecadeRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.ReferenceDatePeriodRegex) + RegExpUtility.get_safe_reg_exp(EnglishDateTime.ReferenceDatePeriodRegex), ] - self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - self._illegal_year_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.IllegalYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.YearRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TillRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.FollowedDateUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NumberCombinedWithDateUnit) - self._past_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PreviousPrefixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NextPrefixRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthOfRegex) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DateUnitRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RangeUnitRegex) - self._date_point_extractor = BaseDateExtractor( - EnglishDateExtractorConfiguration(dmyDateFormat)) - self._integer_extractor = EnglishIntegerExtractor() - self._number_parser = BaseNumberParser( - EnglishNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - EnglishDurationExtractorConfiguration()) - self._range_connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RangeConnectorRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NowRegex - ) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WithinNextPrefixRegex - ) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeUnitRegex - ) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.FutureSuffixRegex - ) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AgoRegex - ) - self._later_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LaterRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LessThanRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MoreThanRegex - ) - self._duration_date_restrictions = EnglishDateTime.DurationDateRestrictions - self._year_period_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.YearPeriodRegex - ) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DecadeWithCenturyRegex - ) - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthNumRegex - ) - self._century_suffix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.CenturySuffixRegex - ) - self._ordinal_extractor = EnglishOrdinalExtractor() - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PreviousPrefixRegex - ) - self._cardinal_extractor = EnglishCardinalExtractor() def get_from_token_index(self, source: str) -> MatchedIndex: return MatchedIndex(True, source.rfind('from')) if source.endswith('from') else MatchedIndex(False, -1) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/dateperiod_parser_config.py index d084855d0a..bedcbd3a1b 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/dateperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/dateperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration from ..base_dateperiod import DatePeriodParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser class EnglishDatePeriodParserConfiguration(DatePeriodParserConfiguration): @@ -202,91 +203,54 @@ def check_both_before_after(self) -> bool: def __init__(self, config: BaseDateParserConfiguration): self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - self._later_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AgoRegex) + self._later_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.LaterRegex) + self._ago_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AgoRegex) self._date_extractor = config.date_extractor self._date_parser = config.date_parser self._duration_extractor = config.duration_extractor self._duration_parser = config.duration_parser - self._month_front_between_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthFrontBetweenRegex) - self._between_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.BetweenRegex) + self._month_front_between_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MonthFrontBetweenRegex) + self._between_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.BetweenRegex) self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthFrontSimpleCasesRegex) - self._simple_cases_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SimpleCasesRegex) - self._one_word_period_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.OneWordPeriodRegex) - self._month_with_year = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthWithYear) - self._month_num_with_year = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthNumWithYear) - self._year_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.YearRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PreviousPrefixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NextPrefixRegex) + EnglishDateTime.MonthFrontSimpleCasesRegex + ) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.OneWordPeriodRegex) + self._month_with_year = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MonthWithYear) + self._month_num_with_year = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MonthNumWithYear) + self._year_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PreviousPrefixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NextPrefixRegex) self._in_connector_regex = config.utility_configuration.in_connector_regex - self._week_of_month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekOfMonthRegex) - self._week_of_year_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekOfYearRegex) - self._quarter_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.QuarterRegex) - self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.QuarterRegexYearFront) - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AllHalfYearRegex) - self._season_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SeasonRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MonthOfRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WhichWeekRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NextPrefixRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PreviousPrefixRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.ThisPrefixRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RestOfDateRegex) - self._later_early_period_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LaterEarlyPeriodRegex) - self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekWithWeekDayRangeRegex) - self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.UnspecificEndOfRangeRegex) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekOfYearRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.QuarterRegex) + self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp(EnglishDateTime.QuarterRegexYearFront) + self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AllHalfYearRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SeasonRegex) + self._week_of_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekOfRegex) + self._month_of_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MonthOfRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WhichWeekRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NextPrefixRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PreviousPrefixRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.ThisPrefixRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RestOfDateRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.LaterEarlyPeriodRegex) + self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekWithWeekDayRangeRegex) + self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.UnspecificEndOfRangeRegex) self._token_before_date = EnglishDateTime.TokenBeforeDate self._day_of_month = config.day_of_month self._month_of_year = config.month_of_year self._cardinal_map = config.cardinal_map self._season_map = config.season_map self._unit_map = config.unit_map - self._now_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NowRegex) - self._relative_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RelativeRegex) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DecadeWithCenturyRegex) - self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.ComplexDatePeriodRegex - ) - self._relative_decade_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RelativeDecadeRegex - ) - self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.ReferenceDatePeriodRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LessThanRegex - ) + self._now_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NowRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeRegex) + self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DecadeWithCenturyRegex) + self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.ComplexDatePeriodRegex) + self._relative_decade_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeDecadeRegex) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.ReferenceDatePeriodRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.LessThanRegex) def get_swift_day_or_month(self, source: str) -> int: trimmed_source = source.strip().lower() @@ -342,6 +306,7 @@ def is_last_cardinal(self, source: str) -> bool: def is_year_only(self, source: str) -> bool: trimmed_source = source.strip().lower() - return any(trimmed_source.endswith(o) for o in EnglishDateTime.YearTerms) or\ - (any(trimmed_source.endswith(o) for o in EnglishDateTime.GenericYearTerms) - and self.unspecific_end_of_range_regex.match(trimmed_source)) + return any(trimmed_source.endswith(o) for o in EnglishDateTime.YearTerms) or ( + any(trimmed_source.endswith(o) for o in EnglishDateTime.GenericYearTerms) + and self.unspecific_end_of_range_regex.match(trimmed_source) + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_extractor_config.py index 193fee4e4a..65e67a6acf 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_extractor_config.py @@ -2,19 +2,21 @@ # Licensed under the MIT License. from typing import Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_datetime import DateTimeExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor +from ..extractors import DateTimeExtractor from .base_configs import EnglishDateTimeUtilityConfiguration from .date_extractor_config import EnglishDateExtractorConfiguration -from .time_extractor_config import EnglishTimeExtractorConfiguration from .duration_extractor_config import EnglishDurationExtractorConfiguration +from .time_extractor_config import EnglishTimeExtractorConfiguration class EnglishDateTimeExtractorConfiguration(DateTimeExtractorConfiguration): @@ -108,56 +110,37 @@ def prefix_day_regex(self) -> Pattern: def __init__(self, dmyDateFormat=False): super().__init__() - self._date_point_extractor = BaseDateExtractor( - EnglishDateExtractorConfiguration(dmyDateFormat)) - self._time_point_extractor = BaseTimeExtractor( - EnglishTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - EnglishDurationExtractorConfiguration()) + self._date_point_extractor = BaseDateExtractor(EnglishDateExtractorConfiguration(dmyDateFormat)) + self._time_point_extractor = BaseTimeExtractor(EnglishTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(EnglishDurationExtractorConfiguration()) self._utility_configuration = EnglishDateTimeUtilityConfiguration() - self.preposition_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PrepositionRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NowRegex) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SuffixRegex) - self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeOfTodayAfterRegex) + self.preposition_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NowRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SuffixRegex) + self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeOfTodayAfterRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SimpleTimeOfTodayAfterRegex) - self._night_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeOfDayRegex) - self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeOfTodayBeforeRegex) - self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeUnitRegex) - self.connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.ConnectorRegex) - self._number_as_time_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NumberAsTimeRegex) - self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DateNumberConnectorRegex - ) - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SuffixAfterRegex + EnglishDateTime.SimpleTimeOfTodayAfterRegex ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.YearSuffix - ) - self._year_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.YearRegex - ) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SpecificTimeOfDayRegex + self._night_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeOfDayRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeOfTodayBeforeRegex) + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + EnglishDateTime.SimpleTimeOfTodayBeforeRegex ) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PrefixDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeUnitRegex) + self.connector_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.ConnectorRegex) + self._number_as_time_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NumberAsTimeRegex) + self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DateNumberConnectorRegex) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SuffixAfterRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(EnglishDateTime.YearSuffix) + self._year_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.YearRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificTimeOfDayRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PrefixDayRegex) def is_connector_token(self, source: str) -> bool: - return source.strip() == '' or regex.search(self.connector_regex, source) is not None or regex.search(self.preposition_regex, source) is not None + return ( + source.strip() == '' + or regex.search(self.connector_regex, source) is not None + or regex.search(self.preposition_regex, source) is not None + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_parser_config.py index f6baefe34b..6e5279ff4a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_parser_config.py @@ -1,17 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_datetime import DateTimeParserConfiguration, MatchedTimex from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_configs import BaseDateParserConfiguration -from ..base_datetime import DateTimeParserConfiguration, MatchedTimex class EnglishDateTimeParserConfiguration(DateTimeParserConfiguration): @@ -110,24 +111,19 @@ def __init__(self, config: BaseDateParserConfiguration): self._time_extractor = config.time_extractor self._date_parser = config.date_parser self._time_parser = config.time_parser - self._now_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NowRegex) - self._am_time_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AMTimeRegex) - self._pm_time_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PMTimeRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NowRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AMTimeRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PMTimeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SimpleTimeOfTodayAfterRegex) + EnglishDateTime.SimpleTimeOfTodayAfterRegex + ) self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SpecificTimeOfDayRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeUnitRegex) + EnglishDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificTimeOfDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeUnitRegex) self._numbers = config.numbers self._cardinal_extractor = config.cardinal_extractor self._number_parser = config.number_parser diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetimeperiod_extractor_config.py index c1493f6153..0f1cc4a083 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetimeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetimeperiod_extractor_config.py @@ -2,26 +2,26 @@ # Licensed under the MIT License. from typing import List, Pattern + import regex from recognizers_number import BaseNumberExtractor, EnglishCardinalExtractor from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor -from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor +from ..extractors import DateTimeExtractor +from ..utilities import DateTimeOptions from .date_extractor_config import EnglishDateExtractorConfiguration -from .time_extractor_config import EnglishTimeExtractorConfiguration +from .datetime_extractor_config import EnglishDateTimeExtractorConfiguration from .duration_extractor_config import EnglishDurationExtractorConfiguration +from .time_extractor_config import EnglishTimeExtractorConfiguration from .timeperiod_extractor_config import EnglishTimePeriodExtractorConfiguration -from .datetime_extractor_config import EnglishDateTimeExtractorConfiguration -from .timezone_extractor_config import EnglishTimeZoneExtractorConfiguration -from ..utilities import DateTimeOptions class EnglishDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): @@ -54,10 +54,6 @@ def duration_extractor(self) -> DateTimeExtractor: def time_period_extractor(self) -> DateTimeExtractor: return self._time_period_extractor - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - @property def simple_cases_regexes(self) -> List[Pattern]: return self._simple_cases_regexes @@ -164,85 +160,45 @@ def week_day_regex(self) -> Pattern: def __init__(self, dmyDateFormat=False): super().__init__() - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WeekDayRegex - ) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WeekDayRegex) self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter self._cardinal_extractor = EnglishCardinalExtractor() - self._single_date_extractor = BaseDateExtractor( - EnglishDateExtractorConfiguration(dmyDateFormat)) - self._single_time_extractor = BaseTimeExtractor( - EnglishTimeExtractorConfiguration()) - self._single_date_time_extractor = BaseDateTimeExtractor( - EnglishDateTimeExtractorConfiguration(dmyDateFormat)) - self._duration_extractor = BaseDurationExtractor( - EnglishDurationExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - EnglishTimePeriodExtractorConfiguration()) - self._time_zone_extractor = BaseTimeZoneExtractor( - EnglishTimeZoneExtractorConfiguration()) + self._single_date_extractor = BaseDateExtractor(EnglishDateExtractorConfiguration(dmyDateFormat)) + self._single_time_extractor = BaseTimeExtractor(EnglishTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseDateTimeExtractor(EnglishDateTimeExtractorConfiguration(dmyDateFormat)) + self._duration_extractor = BaseDurationExtractor(EnglishDurationExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(EnglishTimePeriodExtractorConfiguration()) self._simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumFromTo), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumBetweenAnd) + RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumBetweenAnd), ] - self._preposition_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PrepositionRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TillRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PeriodSpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PeriodTimeOfDayRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PeriodSpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PeriodTimeOfDayRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PeriodTimeOfDayWithDateRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeFollowedUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeNumberCombinedWithUnit) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeUnitRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PreviousPrefixRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NextPrefixRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RestOfDateTimeRegex) - self._general_ending_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.GeneralEndingRegex) - self._middle_pause_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MiddlePauseRegex) - self.range_connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RangeConnectorRegex) - self._token_before_date = EnglishDateTime.TokenBeforeDate - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WithinNextPrefixRegex - ) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.FutureSuffixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DateUnitRegex - ) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AmDescRegex - ) - self._pm_desc_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PmDescRegex - ) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PrefixDayRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.BeforeRegex - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AfterRegex - ) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SuffixRegex + EnglishDateTime.PeriodTimeOfDayWithDateRegex ) + self._followed_unit = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeFollowedUnit) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeNumberCombinedWithUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeUnitRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PreviousPrefixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NextPrefixRegex) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RestOfDateTimeRegex) + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.GeneralEndingRegex) + self._middle_pause_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MiddlePauseRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RangeConnectorRegex) + self._token_before_date = EnglishDateTime.TokenBeforeDate + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WithinNextPrefixRegex) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.FutureSuffixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DateUnitRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PmDescRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AfterRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SuffixRegex) self._options = DateTimeOptions.NONE self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetimeperiod_parser_config.py index d5f0fbcbfe..2f5b8d2995 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetimeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetimeperiod_parser_config.py @@ -1,16 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime +from ..base_configs import BaseDateParserConfiguration from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange -from ..constants import Constants, TimeTypeConstants +from ..constants import Constants from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_configs import BaseDateParserConfiguration class EnglishDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): @@ -38,22 +40,16 @@ def __init__(self, config: BaseDateParserConfiguration): self._token_before_date = EnglishDateTime.TokenBeforeDate self._token_before_time = EnglishDateTime.TokenBeforeTime self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PureNumBetweenAnd) + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumBetweenAnd) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PeriodTimeOfDayWithDateRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PeriodSpecificTimeOfDayRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PreviousPrefixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NextPrefixRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.RestOfDateTimeRegex) + EnglishDateTime.PeriodTimeOfDayWithDateRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PeriodSpecificTimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PreviousPrefixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NextPrefixRegex) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.RestOfDateTimeRegex) self._numbers = config.numbers self._unit_map = config.unit_map self._date_extractor = config.date_extractor @@ -66,21 +62,13 @@ def __init__(self, config: BaseDateParserConfiguration): self._date_time_parser = config.date_time_parser self._time_period_parser = config.time_period_parser self._duration_parser = config.duration_parser - self._time_zone_parser = config.time_zone_parser - self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MorningStartEndRegex) - self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AfternoonStartEndRegex) - self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.EveningStartEndRegex) - self.night_start_end_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NightStartEndRegex) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PrefixDayRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AfterRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.BeforeRegex) + self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MorningStartEndRegex) + self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AfternoonStartEndRegex) + self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.EveningStartEndRegex) + self.night_start_end_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NightStartEndRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PrefixDayRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AfterRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.BeforeRegex) @property def previous_prefix_regex(self): @@ -202,10 +190,6 @@ def time_period_parser(self) -> DateTimeParser: def duration_parser(self) -> DateTimeParser: return self._duration_parser - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def get_matched_time_range(self, source: str): trimmed_source = source.strip() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/duration_extractor_config.py index 536cb24ae3..5ed96c16f1 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/duration_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/duration_extractor_config.py @@ -3,9 +3,10 @@ from typing import Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.english.extractors import EnglishCardinalExtractor +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime from ..base_duration import DurationExtractorConfiguration @@ -95,47 +96,30 @@ def inexact_number_regex(self) -> Pattern: def __init__(self): super().__init__() self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AllRegex) - self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.HalfRegex) - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DurationFollowedUnit) + self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AllRegex) + self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.HalfRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DurationFollowedUnit) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NumberCombinedWithDurationUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AnUnitRegex) + EnglishDateTime.NumberCombinedWithDurationUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AnUnitRegex) self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.InexactNumberUnitRegex) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SuffixAndRegex) + EnglishDateTime.InexactNumberUnitRegex + ) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SuffixAndRegex) self._relative_duration_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( EnglishDateTime.RelativeDurationUnitRegex ) - self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DuringRegex - ) + self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DuringRegex) self._cardinal_extractor: BaseNumberExtractor = EnglishCardinalExtractor() self._unit_map = EnglishDateTime.UnitMap self._unit_value_map = EnglishDateTime.UnitValueMap - self._duration_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DurationUnitRegex - ) - self._duration_connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DurationConnectorRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LessThanRegex - ) - self._conjunction_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.ConjunctionRegex - ) - self._inexact_number_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.InexactNumberRegex - ) + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DurationUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DurationConnectorRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MoreThanRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.LessThanRegex) + self._conjunction_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.ConjunctionRegex) + self._inexact_number_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.InexactNumberRegex) self._special_number_with_unit_regex = None self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter # TODO When the implementation for these properties is added, change the None values to their respective Regexps diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/duration_parser_config.py index acc0008fbf..40013d55b5 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/duration_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/duration_parser_config.py @@ -1,16 +1,17 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.extractors import BaseNumberExtractor -from recognizers_number.number.parsers import BaseNumberParser from recognizers_number.number.english.extractors import EnglishCardinalExtractor from recognizers_number.number.english.parsers import EnglishNumberParserConfiguration +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime +from ..base_duration import BaseDurationExtractor, DurationParserConfiguration from ..extractors import DateTimeExtractor -from ..base_duration import DurationParserConfiguration, BaseDurationExtractor from .duration_extractor_config import EnglishDurationExtractorConfiguration @@ -72,25 +73,20 @@ def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor def __init__(self, config): - self._duration_extractor = BaseDurationExtractor( - EnglishDurationExtractorConfiguration(), False) + self._duration_extractor = BaseDurationExtractor(EnglishDurationExtractorConfiguration(), False) self._cardinal_extractor: BaseNumberExtractor = EnglishCardinalExtractor() - self._number_parser: BaseNumberParser = BaseNumberParser( - EnglishNumberParserConfiguration()) - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DurationFollowedUnit) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SuffixAndRegex) + self._number_parser: BaseNumberParser = BaseNumberParser(EnglishNumberParserConfiguration()) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DurationFollowedUnit) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SuffixAndRegex) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NumberCombinedWithDurationUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AnUnitRegex) - self._all_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AllRegex) - self._half_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.HalfRegex) + EnglishDateTime.NumberCombinedWithDurationUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AnUnitRegex) + self._all_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AllRegex) + self._half_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.HalfRegex) self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.InexactNumberUnitRegex) + EnglishDateTime.InexactNumberUnitRegex + ) self._unit_map: Dict[str, str] = EnglishDateTime.UnitMap self._unit_value_map: Dict[str, int] = EnglishDateTime.UnitValueMap self._double_numbers: Dict[str, float] = EnglishDateTime.DoubleNumbers diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/holiday_extractor_config.py index 7ace38fadc..012d970dee 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/holiday_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/holiday_extractor_config.py @@ -2,10 +2,11 @@ # Licensed under the MIT License. from typing import List, Pattern + from recognizers_text.utilities import RegExpUtility -from ..base_holiday import HolidayExtractorConfiguration from ...resources.english_date_time import EnglishDateTime +from ..base_holiday import HolidayExtractorConfiguration class EnglishHolidayExtractorConfiguration(HolidayExtractorConfiguration): @@ -24,6 +25,4 @@ def holiday_regexes(self) -> List[Pattern]: def __init__(self): self._year_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.YearRegex) - self._holiday_regexes = [ - RegExpUtility.get_safe_reg_exp(EnglishDateTime.HolidayRegex) - ] + self._holiday_regexes = [RegExpUtility.get_safe_reg_exp(EnglishDateTime.HolidayRegex)] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/holiday_parser_config.py index 72fd105929..be0be5cb33 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/holiday_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/holiday_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Callable import re from datetime import datetime +from typing import Callable, Dict, List from recognizers_text.utilities import RegExpUtility -from ..utilities import DateUtils -from ..base_holiday import BaseHolidayParserConfiguration + from ...resources.english_date_time import EnglishDateTime +from ..base_holiday import BaseHolidayParserConfiguration +from ..utilities import DateUtils class EnglishHolidayParserConfiguration(BaseHolidayParserConfiguration): @@ -40,53 +41,53 @@ def sanitize_holiday_token(self, holiday: str) -> str: def __init__(self, config): super().__init__() - self._holiday_regexes = [ - RegExpUtility.get_safe_reg_exp(EnglishDateTime.HolidayRegex) - ] + self._holiday_regexes = [RegExpUtility.get_safe_reg_exp(EnglishDateTime.HolidayRegex)] self._holiday_names = EnglishDateTime.HolidayNames def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: - local = dict([ - ('maosbirthday', EnglishHolidayParserConfiguration.mao_birthday), - ('yuandan', EnglishHolidayParserConfiguration.new_year), - ('teachersday', EnglishHolidayParserConfiguration.teacher_day), - ('singleday', EnglishHolidayParserConfiguration.singles_day), - ('allsaintsday', EnglishHolidayParserConfiguration.halloween_day), - ('youthday', EnglishHolidayParserConfiguration.youth_day), - ('childrenday', EnglishHolidayParserConfiguration.children_day), - ('femaleday', EnglishHolidayParserConfiguration.female_day), - ('treeplantingday', EnglishHolidayParserConfiguration.tree_plant_day), - ('arborday', EnglishHolidayParserConfiguration.tree_plant_day), - ('girlsday', EnglishHolidayParserConfiguration.girls_day), - ('whiteloverday', EnglishHolidayParserConfiguration.white_lover_day), - ('loverday', EnglishHolidayParserConfiguration.valentines_day), - ('christmas', EnglishHolidayParserConfiguration.christmas_day), - ('xmas', EnglishHolidayParserConfiguration.christmas_day), - ('newyear', EnglishHolidayParserConfiguration.new_year), - ('newyearday', EnglishHolidayParserConfiguration.new_year), - ('newyearsday', EnglishHolidayParserConfiguration.new_year), - ('inaugurationday', EnglishHolidayParserConfiguration.inauguration_day), - ('groundhougday', EnglishHolidayParserConfiguration.groundhog_day), - ('valentinesday', EnglishHolidayParserConfiguration.valentines_day), - ('stpatrickday', EnglishHolidayParserConfiguration.st_patrick_day), - ('aprilfools', EnglishHolidayParserConfiguration.fool_day), - ('stgeorgeday', EnglishHolidayParserConfiguration.st_george_day), - ('mayday', EnglishHolidayParserConfiguration.may_day), - ('cincodemayoday', EnglishHolidayParserConfiguration.cinco_de_mayo_day), - ('baptisteday', EnglishHolidayParserConfiguration.baptiste_day), - ('usindependenceday', EnglishHolidayParserConfiguration.usa_independence_day), - ('independenceday', EnglishHolidayParserConfiguration.usa_independence_day), - ('bastilleday', EnglishHolidayParserConfiguration.bastille_day), - ('halloweenday', EnglishHolidayParserConfiguration.halloween_day), - ('allhallowday', EnglishHolidayParserConfiguration.all_hallow_day), - ('allsoulsday', EnglishHolidayParserConfiguration.all_souls_day), - ('guyfawkesday', EnglishHolidayParserConfiguration.guy_fawkes_day), - ('veteransday', EnglishHolidayParserConfiguration.veterans_day), - ('christmaseve', EnglishHolidayParserConfiguration.christmas_eve), - ('newyeareve', EnglishHolidayParserConfiguration.new_year_eve), - ('easterday', EnglishHolidayParserConfiguration.easter_day), - ('juneteenth', EnglishHolidayParserConfiguration.juneteenth), - ]) + local = dict( + [ + ('maosbirthday', EnglishHolidayParserConfiguration.mao_birthday), + ('yuandan', EnglishHolidayParserConfiguration.new_year), + ('teachersday', EnglishHolidayParserConfiguration.teacher_day), + ('singleday', EnglishHolidayParserConfiguration.singles_day), + ('allsaintsday', EnglishHolidayParserConfiguration.halloween_day), + ('youthday', EnglishHolidayParserConfiguration.youth_day), + ('childrenday', EnglishHolidayParserConfiguration.children_day), + ('femaleday', EnglishHolidayParserConfiguration.female_day), + ('treeplantingday', EnglishHolidayParserConfiguration.tree_plant_day), + ('arborday', EnglishHolidayParserConfiguration.tree_plant_day), + ('girlsday', EnglishHolidayParserConfiguration.girls_day), + ('whiteloverday', EnglishHolidayParserConfiguration.white_lover_day), + ('loverday', EnglishHolidayParserConfiguration.valentines_day), + ('christmas', EnglishHolidayParserConfiguration.christmas_day), + ('xmas', EnglishHolidayParserConfiguration.christmas_day), + ('newyear', EnglishHolidayParserConfiguration.new_year), + ('newyearday', EnglishHolidayParserConfiguration.new_year), + ('newyearsday', EnglishHolidayParserConfiguration.new_year), + ('inaugurationday', EnglishHolidayParserConfiguration.inauguration_day), + ('groundhougday', EnglishHolidayParserConfiguration.groundhog_day), + ('valentinesday', EnglishHolidayParserConfiguration.valentines_day), + ('stpatrickday', EnglishHolidayParserConfiguration.st_patrick_day), + ('aprilfools', EnglishHolidayParserConfiguration.fool_day), + ('stgeorgeday', EnglishHolidayParserConfiguration.st_george_day), + ('mayday', EnglishHolidayParserConfiguration.may_day), + ('cincodemayoday', EnglishHolidayParserConfiguration.cinco_de_mayo_day), + ('baptisteday', EnglishHolidayParserConfiguration.baptiste_day), + ('usindependenceday', EnglishHolidayParserConfiguration.usa_independence_day), + ('independenceday', EnglishHolidayParserConfiguration.usa_independence_day), + ('bastilleday', EnglishHolidayParserConfiguration.bastille_day), + ('halloweenday', EnglishHolidayParserConfiguration.halloween_day), + ('allhallowday', EnglishHolidayParserConfiguration.all_hallow_day), + ('allsoulsday', EnglishHolidayParserConfiguration.all_souls_day), + ('guyfawkesday', EnglishHolidayParserConfiguration.guy_fawkes_day), + ('veteransday', EnglishHolidayParserConfiguration.veterans_day), + ('christmaseve', EnglishHolidayParserConfiguration.christmas_eve), + ('newyeareve', EnglishHolidayParserConfiguration.new_year_eve), + ('easterday', EnglishHolidayParserConfiguration.easter_day), + ('juneteenth', EnglishHolidayParserConfiguration.juneteenth), + ] + ) return {**super()._init_holiday_funcs(), **local} diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/merged_extractor_config.py index e72d52c35a..80ec66182d 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/merged_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/merged_extractor_config.py @@ -3,33 +3,30 @@ from typing import List, Pattern +from recognizers_number import EnglishIntegerExtractor from recognizers_text.extractor import Extractor from recognizers_text.utilities import RegExpUtility -from recognizers_number import EnglishIntegerExtractor + +from ...resources.base_date_time import BaseDateTime from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor -from ..base_merged import MergedExtractorConfiguration from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor from ..base_datetime import BaseDateTimeExtractor from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from ..base_set import BaseSetExtractor +from ..base_duration import BaseDurationExtractor from ..base_holiday import BaseHolidayExtractor +from ..base_merged import MergedExtractorConfiguration +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import EnglishDateExtractorConfiguration -from .time_extractor_config import EnglishTimeExtractorConfiguration -from .duration_extractor_config import EnglishDurationExtractorConfiguration from .dateperiod_extractor_config import EnglishDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import EnglishTimePeriodExtractorConfiguration from .datetime_extractor_config import EnglishDateTimeExtractorConfiguration from .datetimeperiod_extractor_config import EnglishDateTimePeriodExtractorConfiguration -from .set_extractor_config import EnglishSetExtractorConfiguration +from .duration_extractor_config import EnglishDurationExtractorConfiguration from .holiday_extractor_config import EnglishHolidayExtractorConfiguration -from ...resources.base_date_time import BaseDateTime -from ..base_timezone import BaseTimeZoneExtractor -from .timezone_extractor_config import EnglishTimeZoneExtractorConfiguration +from .time_extractor_config import EnglishTimeExtractorConfiguration +from .timeperiod_extractor_config import EnglishTimePeriodExtractorConfiguration class EnglishMergedExtractorConfiguration(MergedExtractorConfiguration): @@ -77,18 +74,10 @@ def date_time_period_extractor(self) -> DateTimeExtractor: def holiday_extractor(self) -> DateTimeExtractor: return self._holiday_extractor - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor - @property - def set_extractor(self) -> DateTimeExtractor: - return self._set_extractor - @property def integer_extractor(self) -> Extractor: return self._integer_extractor @@ -155,59 +144,37 @@ def term_filter_regexes(self) -> List[Pattern]: def __init__(self, dmyDateFormat=False): self._integer_extractor = EnglishIntegerExtractor() - self._date_extractor = BaseDateExtractor( - EnglishDateExtractorConfiguration(dmyDateFormat)) - self._time_extractor = BaseTimeExtractor( - EnglishTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - EnglishDurationExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - EnglishDatePeriodExtractorConfiguration(dmyDateFormat)) - self._time_period_extractor = BaseTimePeriodExtractor( - EnglishTimePeriodExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - EnglishDateTimeExtractorConfiguration(dmyDateFormat)) + self._date_extractor = BaseDateExtractor(EnglishDateExtractorConfiguration(dmyDateFormat)) + self._time_extractor = BaseTimeExtractor(EnglishTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(EnglishDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(EnglishDatePeriodExtractorConfiguration(dmyDateFormat)) + self._time_period_extractor = BaseTimePeriodExtractor(EnglishTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(EnglishDateTimeExtractorConfiguration(dmyDateFormat)) self._date_time_period_extractor = BaseDateTimePeriodExtractor( - EnglishDateTimePeriodExtractorConfiguration(dmyDateFormat)) - self._set_extractor = BaseSetExtractor( - EnglishSetExtractorConfiguration(dmyDateFormat)) - self._holiday_extractor = BaseHolidayExtractor( - EnglishHolidayExtractorConfiguration()) - self._after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AfterRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.BeforeRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SinceRegex) - self._from_to_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.FromToRegex) - self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SingleAmbiguousMonthRegex) - self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PrepositionSuffixRegex) + EnglishDateTimePeriodExtractorConfiguration(dmyDateFormat) + ) + self._holiday_extractor = BaseHolidayExtractor(EnglishHolidayExtractorConfiguration()) + self._after_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AfterRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.BeforeRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SinceRegex) + self._from_to_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.FromToRegex) + self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SingleAmbiguousMonthRegex) + self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PrepositionSuffixRegex) self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AmbiguousRangeModifierPrefix) - self._number_ending_pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NumberEndingPattern) + EnglishDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NumberEndingPattern) self._term_filter_regexes = [ RegExpUtility.get_safe_reg_exp(EnglishDateTime.OneOnOneRegex), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.SingleAmbiguousTermsRegex) + RegExpUtility.get_safe_reg_exp(EnglishDateTime.SingleAmbiguousTermsRegex), ] - self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.UnspecificDatePeriodRegex - ) + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.UnspecificDatePeriodRegex) self._ambiguity_filters_dict = EnglishDateTime.AmbiguityFiltersDict self._around_regex = EnglishDateTime.AroundRegex self._equal_regex = BaseDateTime.EqualRegex - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SuffixAfterRegex - ) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SuffixAfterRegex) self._superfluous_word_matcher = EnglishDateTime.SuperfluousWordList - self._fail_fast_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.FailFastRegex - ) + self._fail_fast_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.FailFastRegex) self._check_both_before_after = EnglishDateTime.CheckBothBeforeAfter - self._time_zone_extractor = BaseTimeZoneExtractor( - EnglishTimeZoneExtractorConfiguration()) # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._datetime_alt_extractor = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/merged_parser_config.py index ffdfd994cf..e22660f361 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/merged_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/merged_parser_config.py @@ -3,22 +3,20 @@ from typing import Pattern -from ...resources.base_date_time import BaseDateTime from recognizers_text.utilities import RegExpUtility -from .holiday_parser_config import EnglishHolidayParserConfiguration -from .set_parser_config import EnglishSetParserConfiguration +from ...resources.base_date_time import BaseDateTime +from ...resources.english_date_time import EnglishDateTime from ..base_date import BaseDateParser -from ..base_time import BaseTimeParser -from ..base_datetime import BaseDateTimeParser -from ..base_holiday import BaseHolidayParser from ..base_dateperiod import BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodParser +from ..base_datetime import BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodParser from ..base_duration import BaseDurationParser -from ..base_set import BaseSetParser +from ..base_holiday import BaseHolidayParser from ..base_merged import MergedParserConfiguration -from ...resources.english_date_time import EnglishDateTime +from ..base_time import BaseTimeParser +from ..base_timeperiod import BaseTimePeriodParser +from .holiday_parser_config import EnglishHolidayParserConfiguration class EnglishMergedParserConfiguration(MergedParserConfiguration): @@ -82,27 +80,15 @@ def date_time_period_parser(self) -> BaseDateTimePeriodParser: def duration_parser(self) -> BaseDurationParser: return self.__duration_parser - @property - def set_parser(self) -> BaseSetParser: - return self.__set_parser - def __init__(self, config): - self._equal_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.EqualRegex) - self._suffix_after = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SuffixAfterRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.YearRegex) - self._around_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AroundRegex) - self.__before_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.BeforeRegex) - self.__after_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AfterRegex) - self.__since_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SinceRegex) - self.__holiday_parser = BaseHolidayParser( - EnglishHolidayParserConfiguration(config)) + self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) + self._suffix_after = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SuffixAfterRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.YearRegex) + self._around_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AroundRegex) + self.__before_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.BeforeRegex) + self.__after_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AfterRegex) + self.__since_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SinceRegex) + self.__holiday_parser = BaseHolidayParser(EnglishHolidayParserConfiguration(config)) self.__date_parser = config.date_parser self.__time_parser = config.time_parser self.__date_time_parser = config.date_time_parser @@ -110,5 +96,3 @@ def __init__(self, config): self.__time_period_parser = config.time_period_parser self.__date_time_period_parser = config.date_time_period_parser self.__duration_parser = config.duration_parser - self.__set_parser = BaseSetParser( - EnglishSetParserConfiguration(config)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/parsers.py index ba06b62b3c..5c65b92a59 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/parsers.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/parsers.py @@ -2,11 +2,13 @@ # Licensed under the MIT License. from datetime import datetime + import regex from recognizers_text.utilities import RegExpUtility -from ..utilities import DateTimeResolutionResult + from ..base_time import BaseTimeParser +from ..utilities import DateTimeResolutionResult from .time_parser_config import EnglishTimeParserConfiguration @@ -33,8 +35,7 @@ def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResul hour = int(hour_str) result.timex = f'T{hour:02d}' - result.future_value = datetime( - reference.year, reference.month, reference.day, hour, 0, 0) + result.future_value = datetime(reference.year, reference.month, reference.day, hour, 0, 0) result.past_value = result.future_value result.success = True return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/set_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/set_extractor_config.py deleted file mode 100644 index c1165b98b7..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/set_extractor_config.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern - -from recognizers_text.utilities import RegExpUtility -from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor -from ..base_set import SetExtractorConfiguration -from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor -from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from .date_extractor_config import EnglishDateExtractorConfiguration -from .time_extractor_config import EnglishTimeExtractorConfiguration -from .duration_extractor_config import EnglishDurationExtractorConfiguration -from .dateperiod_extractor_config import EnglishDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import EnglishTimePeriodExtractorConfiguration -from .datetime_extractor_config import EnglishDateTimeExtractorConfiguration -from .datetimeperiod_extractor_config import EnglishDateTimePeriodExtractorConfiguration - - -class EnglishSetExtractorConfiguration(SetExtractorConfiguration): - @property - def last_regex(self) -> Pattern: - return self._last_regex - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def before_each_day_regex(self) -> Pattern: - return self._before_each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def duration_unit_regex(self) -> Pattern: - return self._duration_unit_regex - - def __init__(self, dmyDateFormat=False): - self._duration_extractor = BaseDurationExtractor( - EnglishDurationExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - EnglishTimeExtractorConfiguration()) - self._date_extractor = BaseDateExtractor( - EnglishDateExtractorConfiguration(dmyDateFormat)) - self._date_time_extractor = BaseDateTimeExtractor( - EnglishDateTimeExtractorConfiguration(dmyDateFormat)) - self._date_period_extractor = BaseDatePeriodExtractor( - EnglishDatePeriodExtractorConfiguration(dmyDateFormat)) - self._time_period_extractor = BaseTimePeriodExtractor( - EnglishTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - EnglishDateTimePeriodExtractorConfiguration(dmyDateFormat)) - self._last_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SetLastRegex) - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.EachPrefixRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.EachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.EachDayRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SetWeekDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SetEachRegex) - self._duration_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DurationUnitRegex - ) - self._before_each_day_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/set_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/set_parser_config.py deleted file mode 100644 index 384b2e0683..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/set_parser_config.py +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern, Dict - -from recognizers_text.utilities import RegExpUtility -from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser -from ..base_set import SetParserConfiguration, MatchedTimex -from ..base_configs import BaseDateParserConfiguration - - -class EnglishSetParserConfiguration(SetParserConfiguration): - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def duration_parser(self) -> DateTimeParser: - return self._duration_parser - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def time_parser(self) -> DateTimeParser: - return self._time_parser - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_parser(self) -> DateTimeParser: - return self._date_parser - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_time_parser(self) -> DateTimeParser: - return self._date_time_parser - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def date_period_parser(self) -> DateTimeParser: - return self._date_period_parser - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def time_period_parser(self) -> DateTimeParser: - return self._time_period_parser - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def date_time_period_parser(self) -> DateTimeParser: - return self._date_time_period_parser - - @property - def unit_map(self) -> Dict[str, str]: - return self._unit_map - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - def __init__(self, config: BaseDateParserConfiguration): - self._duration_extractor = config.duration_extractor - self._duration_parser = config.duration_parser - self._time_extractor = config.time_extractor - self._time_parser = config.time_parser - self._date_extractor = config.date_extractor - self._date_parser = config.date_parser - self._date_time_extractor = config.date_time_extractor - self._date_time_parser = config.date_time_parser - self._date_period_extractor = config.date_period_extractor - self._date_period_parser = config.date_period_parser - self._time_period_extractor = config.time_period_extractor - self._time_period_parser = config.time_period_parser - self._date_time_period_extractor = config.date_time_period_extractor - self._date_time_period_parser = config.date_time_period_parser - self._unit_map = EnglishDateTime.UnitMap - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.EachPrefixRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.EachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.EachDayRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SetWeekDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SetEachRegex) - - def get_matched_daily_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - if trimmed_text == 'daily': - timex = 'P1D' - elif trimmed_text == 'weekly': - timex = 'P1W' - elif trimmed_text == 'biweekly': - timex = 'P2W' - elif trimmed_text == 'monthly': - timex = 'P1M' - elif trimmed_text == 'quarterly': - timex = 'P3M' - elif trimmed_text in ('yearly', 'annually', 'annual'): - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) - - def get_matched_unit_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - if trimmed_text == 'day': - timex = 'P1D' - elif trimmed_text == 'week': - timex = 'P1W' - elif trimmed_text == 'month': - timex = 'P1M' - elif trimmed_text == 'year': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/time_extractor_config.py index 9d4c73618a..91d4c7580f 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/time_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/time_extractor_config.py @@ -4,11 +4,9 @@ from typing import List, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime from ..base_time import TimeExtractorConfiguration -from ..base_timezone import BaseTimeZoneExtractor -from ..extractors import DateTimeExtractor -from .timezone_extractor_config import EnglishTimeZoneExtractorConfiguration class EnglishTimeExtractorConfiguration(TimeExtractorConfiguration): @@ -28,10 +26,6 @@ def ish_regex(self) -> Pattern: def time_before_after_regex(self) -> Pattern: return self._time_before_after_regex - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - @property def desc_regex(self) -> Pattern: return self._desc_regex @@ -102,57 +96,23 @@ def time_unit_regex(self) -> Pattern: def __init__(self): super().__init__() - self._desc_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.DescRegex - ) - self._hour_num_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.HourNumRegex - ) - self._minute_num_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MinuteNumRegex - ) - self._oclock_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.OclockRegex - ) - self._pm_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PmRegex - ) - self._am_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AmRegex - ) - self._less_than_one_hour = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LessThanOneHour - ) - self._written_time_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.WrittenTimeRegex - ) - self._time_prefix = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimePrefix - ) - self._time_suffix = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeSuffix - ) - self._basic_time = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.BasicTime - ) - self._midnight_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MidnightRegex - ) - self._midmorning_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MidmorningRegex - ) - self._midafternoon_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MidafternoonRegex - ) - self._midday_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MiddayRegex - ) - self._midtime_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MidTimeRegex - ) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeUnitRegex - ) + self._desc_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.DescRegex) + self._hour_num_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.HourNumRegex) + self._minute_num_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MinuteNumRegex) + self._oclock_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.OclockRegex) + self._pm_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PmRegex) + self._am_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AmRegex) + self._less_than_one_hour = RegExpUtility.get_safe_reg_exp(EnglishDateTime.LessThanOneHour) + self._written_time_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.WrittenTimeRegex) + self._time_prefix = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimePrefix) + self._time_suffix = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeSuffix) + self._basic_time = RegExpUtility.get_safe_reg_exp(EnglishDateTime.BasicTime) + self._midnight_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MidnightRegex) + self._midmorning_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MidmorningRegex) + self._midafternoon_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MidafternoonRegex) + self._midday_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MiddayRegex) + self._midtime_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MidTimeRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeUnitRegex) self._time_regex_list: List[Pattern] = [ RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex1), RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex2), @@ -165,13 +125,8 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex9), RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex10), RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex11), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.ConnectNumRegex) + RegExpUtility.get_safe_reg_exp(EnglishDateTime.ConnectNumRegex), ] - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AtRegex) - self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.IshRegex) - self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeBeforeAfterRegex) - self._time_zone_extractor = BaseTimeZoneExtractor( - EnglishTimeZoneExtractorConfiguration()) + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AtRegex) + self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.IshRegex) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeBeforeAfterRegex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/time_parser_config.py index 09462640cd..e4f1329437 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/time_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/time_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern, Dict +from typing import Dict, List, Pattern + import regex -from ..parsers import DateTimeParser from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime -from ..base_time import TimeParserConfiguration, AdjustParams from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_time import AdjustParams, TimeParserConfiguration class EnglishTimeParserConfiguration(TimeParserConfiguration): @@ -36,16 +37,10 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_token_prefix: str = EnglishDateTime.TimeTokenPrefix - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.AtRegex) - self._meal_time_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.MealTimeRegex) + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.AtRegex) + self._meal_time_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.MealTimeRegex) self._time_regexes: List[Pattern] = [ RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex1), RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex2), @@ -58,21 +53,15 @@ def __init__(self, config: BaseDateParserConfiguration): RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex9), RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex10), RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeRegex11), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.ConnectNumRegex) + RegExpUtility.get_safe_reg_exp(EnglishDateTime.ConnectNumRegex), ] self._numbers: Dict[str, int] = EnglishDateTime.Numbers - self._time_zone_parser = config.time_zone_parser self._utility_configuration = config.utility_configuration - self.less_than_one_hour = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LessThanOneHour) - self.time_suffix_full = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeSuffixFull) - self.lunch_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.LunchRegex) - self.night_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.NightRegex) - self.ish_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.IshRegex) + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(EnglishDateTime.LessThanOneHour) + self.time_suffix_full = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeSuffixFull) + self.lunch_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.LunchRegex) + self.night_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.NightRegex) + self.ish_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.IshRegex) def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): delta_min = 0 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timeperiod_extractor_config.py index 46b7573bfb..84457abfe7 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timeperiod_extractor_config.py @@ -3,17 +3,16 @@ from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor from recognizers_number.number.english.extractors import EnglishIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime -from ..extractors import DateTimeExtractor -from ..base_timeperiod import TimePeriodExtractorConfiguration, MatchedIndex from ..base_time import BaseTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor -from .time_extractor_config import EnglishTimeExtractorConfiguration -from .timezone_extractor_config import EnglishTimeZoneExtractorConfiguration +from ..base_timeperiod import MatchedIndex, TimePeriodExtractorConfiguration +from ..extractors import DateTimeExtractor from ..utilities import DateTimeOptions +from .time_extractor_config import EnglishTimeExtractorConfiguration class EnglishTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): @@ -46,10 +45,6 @@ def general_ending_regex(self) -> Pattern: def single_time_extractor(self) -> DateTimeExtractor: return self._single_time_extractor - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - @property def integer_extractor(self) -> Extractor: return self._integer_extractor @@ -109,19 +104,13 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumBetweenAnd), RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificTimeFromTo), - RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificTimeBetweenAnd) + RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificTimeBetweenAnd), ] - self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TillRegex) - self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeOfDayRegex) - self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.GeneralEndingRegex) - self._single_time_extractor = BaseTimeExtractor( - EnglishTimeExtractorConfiguration()) + self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TillRegex) + self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeOfDayRegex) + self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishDateTime.GeneralEndingRegex) + self._single_time_extractor = BaseTimeExtractor(EnglishTimeExtractorConfiguration()) self._integer_extractor = EnglishIntegerExtractor() - self._time_zone_extractor = BaseTimeZoneExtractor( - EnglishTimeZoneExtractorConfiguration()) self._token_before_date = EnglishDateTime.TokenBeforeDate self._pure_number_regex = [EnglishDateTime.PureNumFromTo, EnglishDateTime.PureNumFromTo] self._options = DateTimeOptions.NONE diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timeperiod_parser_config.py index 60127a9934..8d7223ae9e 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timeperiod_parser_config.py @@ -1,18 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor from recognizers_number.number.english.extractors import EnglishIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.english_date_time import EnglishDateTime +from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_timeperiod import MatchedTimeRegex, TimePeriodParserConfiguration +from ..constants import Constants from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration -from ..base_timeperiod import TimePeriodParserConfiguration, MatchedTimeRegex from ..utilities import TimexUtil -from ..constants import Constants class EnglishTimePeriodParserConfiguration(TimePeriodParserConfiguration): @@ -28,10 +29,6 @@ def time_parser(self) -> DateTimeParser: def integer_extractor(self) -> Extractor: return self._integer_extractor - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - @property def pure_number_from_to_regex(self) -> Pattern: return self._pure_number_from_to_regex @@ -67,20 +64,13 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self, config: BaseDateParserConfiguration): self._time_extractor = config.time_extractor self._time_parser = config.time_parser - self._time_zone_parser = config.time_zone_parser self._integer_extractor = EnglishIntegerExtractor() - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.PureNumBetweenAnd) - self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SpecificTimeFromTo) - self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.SpecificTimeBetweenAnd) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TimeOfDayRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - EnglishDateTime.TillRegex) + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.PureNumBetweenAnd) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.SpecificTimeBetweenAnd) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TimeOfDayRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(EnglishDateTime.TillRegex) self._numbers = EnglishDateTime.Numbers self._utility_configuration = config.utility_configuration @@ -116,13 +106,7 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: elif any(trimmed_text.endswith(o) for o in EnglishDateTime.MealtimeDinnerTermList): time_of_day = Constants.MEALTIME_DINNER else: - return MatchedTimeRegex( - matched=False, - timex='', - begin_hour=0, - end_hour=0, - end_min=0 - ) + return MatchedTimeRegex(matched=False, timex='', begin_hour=0, end_hour=0, end_min=0) parse_result = TimexUtil.parse_time_of_day(time_of_day) timex = parse_result.timex @@ -130,10 +114,4 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: end_hour = parse_result.end_hour end_min = parse_result.end_min - return MatchedTimeRegex( - matched=True, - timex=timex, - begin_hour=begin_hour, - end_hour=end_hour, - end_min=end_min - ) + return MatchedTimeRegex(matched=True, timex=timex, begin_hour=begin_hour, end_hour=end_hour, end_min=end_min) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timezone_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timezone_extractor_config.py deleted file mode 100644 index c1dc6d50e2..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/timezone_extractor_config.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import List, Pattern -from recognizers_text.matcher.string_matcher import StringMatcher -from recognizers_text.utilities import QueryProcessor -from ..base_timezone import TimeZoneExtractorConfiguration -from ...resources.english_time_zone import TimeZoneDefinitions -from ..utilities import TimeZoneUtility, RegExpUtility - - -class EnglishTimeZoneExtractorConfiguration(TimeZoneExtractorConfiguration): - @property - def timezone_matcher(self): - return self._timezone_matcher - - @property - def direct_utc_regex(self) -> Pattern: - return self._direct_utc_regex - - @property - def abbreviations_list(self) -> List[str]: - return self._abbreviations_list - - @property - def full_name_list(self) -> List[str]: - return self._full_name_list - - @property - def location_time_suffix_regex(self) -> Pattern: - return self._location_time_suffix_regex - - @property - def location_matcher(self) -> StringMatcher: - return self._location_matcher - - @property - def ambiguous_timezone_list(self) -> List[str]: - return self._ambiguous_timezone_list - - def __init__(self): - super().__init__() - - self._direct_utc_regex = RegExpUtility.get_safe_reg_exp(TimeZoneDefinitions.DirectUtcRegex) - self._abbreviations_list = list(TimeZoneDefinitions.AbbreviationsList) - self._full_name_list = list(TimeZoneDefinitions.FullNameList) - self._timezone_matcher = TimeZoneUtility.build_matcher_from_lists(self.full_name_list, self.abbreviations_list) - self._location_time_suffix_regex = RegExpUtility.get_safe_reg_exp(TimeZoneDefinitions.LocationTimeSuffixRegex) - self._location_matcher = StringMatcher() - self._ambiguous_timezone_list = list(TimeZoneDefinitions.AmbiguousTimezoneList) - - self._location_matcher.init(list(map(lambda o: QueryProcessor.remove_diacritics(o.lower()), TimeZoneDefinitions.MajorLocations))) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/extractors.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/extractors.py index 067d256a6c..959f61a50a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/extractors.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/extractors.py @@ -2,8 +2,8 @@ # Licensed under the MIT License. from abc import abstractmethod -from typing import List from datetime import datetime +from typing import List from recognizers_text.extractor import Extractor, ExtractResult diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/__init__.py index 1db9c35b94..cc7166985a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/__init__.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/__init__.py @@ -3,24 +3,22 @@ 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_extractor_config import * from .dateperiod_parser_config import * -from .timeperiod_parser_config import * +from .datetime_extractor_config import * +from .datetime_parser_config import * +from .datetimeperiod_extractor_config import * from .datetimeperiod_parser_config import * -from .set_parser_config import * +from .duration_extractor_config import * +from .duration_parser_config import * +from .holiday_extractor_config import * from .holiday_parser_config import * +from .merged_extractor_config import * from .merged_parser_config import * from .parsers import * +from .time_extractor_config import * +from .time_parser_config import * +from .timeperiod_extractor_config import * +from .timeperiod_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/base_configs.py index ff7ed9de62..1e5edf7b9b 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/base_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/base_configs.py @@ -1,90 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern -from recognizers_text.utilities import RegExpUtility from ...resources.french_date_time import FrenchDateTime -from ..base_date import DateTimeUtilityConfiguration +from ..utilities import DateTimeUtilityConfiguration class FrenchDateTimeUtilityConfiguration(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 def __init__(self): - self._later_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AgoPrefixRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RangeUnitRegex) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AmDescRegex) - self._pm_desc__regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PmDescRegex) - self._am_pm_desc_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AmPmDescRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WithinNextPrefixRegex) - self._common_date_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.CommonDatePrefixRegex) - self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter - self._range_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RangePrefixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DateUnitRegex - ) + super().__init__(FrenchDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/common_configs.py index 6fd4c899c4..b4b20e6337 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/common_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/common_configs.py @@ -3,43 +3,45 @@ from typing import Dict, Pattern -from recognizers_number import BaseNumberExtractor, FrenchCardinalExtractor, FrenchIntegerExtractor, FrenchOrdinalExtractor, BaseNumberParser, FrenchNumberParserConfiguration - -from ...resources import FrenchDateTime, BaseDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + FrenchCardinalExtractor, + FrenchIntegerExtractor, + FrenchNumberParserConfiguration, + FrenchOrdinalExtractor, +) + +from ...resources import BaseDateTime, FrenchDateTime from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration from ..base_date import BaseDateExtractor, BaseDateParser -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor, BaseDurationParser from ..base_dateperiod import BaseDatePeriodExtractor, BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser from ..base_datetime import BaseDateTimeExtractor, BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodExtractor, BaseDateTimePeriodParser -from ..base_timezone import BaseTimeZoneParser +from ..base_duration import BaseDurationExtractor, BaseDurationParser +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from .base_configs import FrenchDateTimeUtilityConfiguration -from .duration_extractor_config import FrenchDurationExtractorConfiguration from .date_extractor_config import FrenchDateExtractorConfiguration -from .time_extractor_config import FrenchTimeExtractorConfiguration -from .datetime_extractor_config import FrenchDateTimeExtractorConfiguration +from .date_parser_config import FrenchDateParserConfiguration from .dateperiod_extractor_config import FrenchDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import FrenchTimePeriodExtractorConfiguration +from .dateperiod_parser_config import FrenchDatePeriodParserConfiguration +from .datetime_extractor_config import FrenchDateTimeExtractorConfiguration +from .datetime_parser_config import FrenchDateTimeParserConfiguration from .datetimeperiod_extractor_config import FrenchDateTimePeriodExtractorConfiguration +from .datetimeperiod_parser_config import FrenchDateTimePeriodParserConfiguration +from .duration_extractor_config import FrenchDurationExtractorConfiguration from .duration_parser_config import FrenchDurationParserConfiguration -from .date_parser_config import FrenchDateParserConfiguration +from .parsers import FrenchTimeParser +from .time_extractor_config import FrenchTimeExtractorConfiguration from .time_parser_config import FrenchTimeParserConfiguration -from .datetime_parser_config import FrenchDateTimeParserConfiguration -from .dateperiod_parser_config import FrenchDatePeriodParserConfiguration +from .timeperiod_extractor_config import FrenchTimePeriodExtractorConfiguration from .timeperiod_parser_config import FrenchTimePeriodParserConfiguration -from .datetimeperiod_parser_config import FrenchDateTimePeriodParserConfiguration -from .parsers import FrenchTimeParser class FrenchCommonDateTimeParserConfiguration(BaseDateParserConfiguration): - @property - def time_zone_parser(self) -> DateTimeParser: - self._time_zone_parser - @property def check_both_before_after(self) -> Pattern: return self._check_both_before_after @@ -154,7 +156,6 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self): super().__init__() - self._time_zone_parser = BaseTimeZoneParser() self._utility_configuration = FrenchDateTimeUtilityConfiguration() self._unit_map = FrenchDateTime.UnitMap self._unit_value_map = FrenchDateTime.UnitValueMap @@ -170,34 +171,19 @@ def __init__(self): self._integer_extractor = FrenchIntegerExtractor() self._ordinal_extractor = FrenchOrdinalExtractor() - self._day_of_month = { - **BaseDateTime.DayOfMonthDictionary, **FrenchDateTime.DayOfMonth} - self._number_parser = BaseNumberParser( - FrenchNumberParserConfiguration()) - self._date_extractor = BaseDateExtractor( - FrenchDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - FrenchTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - FrenchDurationExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - FrenchDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - FrenchTimePeriodExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - FrenchDateTimeExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - FrenchDateTimePeriodExtractorConfiguration()) - self._duration_parser = BaseDurationParser( - FrenchDurationParserConfiguration(self)) + self._day_of_month = {**BaseDateTime.DayOfMonthDictionary, **FrenchDateTime.DayOfMonth} + self._number_parser = BaseNumberParser(FrenchNumberParserConfiguration()) + self._date_extractor = BaseDateExtractor(FrenchDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(FrenchTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(FrenchDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(FrenchDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(FrenchTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(FrenchDateTimeExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(FrenchDateTimePeriodExtractorConfiguration()) + self._duration_parser = BaseDurationParser(FrenchDurationParserConfiguration(self)) self._date_parser = BaseDateParser(FrenchDateParserConfiguration(self)) - self._time_parser = FrenchTimeParser( - FrenchTimeParserConfiguration(self)) - self._date_period_parser = BaseDatePeriodParser( - FrenchDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - FrenchTimePeriodParserConfiguration(self)) - self._date_time_parser = BaseDateTimeParser( - FrenchDateTimeParserConfiguration(self)) - self._date_time_period_parser = BaseDateTimePeriodParser( - FrenchDateTimePeriodParserConfiguration(self)) + self._time_parser = FrenchTimeParser(FrenchTimeParserConfiguration(self)) + self._date_period_parser = BaseDatePeriodParser(FrenchDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(FrenchTimePeriodParserConfiguration(self)) + self._date_time_parser = BaseDateTimeParser(FrenchDateTimeParserConfiguration(self)) + self._date_time_period_parser = BaseDateTimePeriodParser(FrenchDateTimePeriodParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/date_extractor_config.py index 2752ec1c8a..6b45a0a8ff 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/date_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/date_extractor_config.py @@ -1,142 +1,50 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict -from recognizers_number import (BaseNumberExtractor, BaseNumberParser, - FrenchOrdinalExtractor, FrenchIntegerExtractor, FrenchNumberParserConfiguration) +from typing import List, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + FrenchIntegerExtractor, + FrenchNumberParserConfiguration, + FrenchOrdinalExtractor, +) from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import DateExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..constants import Constants +from ..extractors import DateTimeExtractor from ..utilities import DateTimeUtilityConfiguration -from .duration_extractor_config import FrenchDurationExtractorConfiguration from .base_configs import FrenchDateTimeUtilityConfiguration -from ..constants import Constants -from ...resources.base_date_time import BaseDateTime -from ..utilities import DateTimeOptions +from .duration_extractor_config import FrenchDurationExtractorConfiguration class FrenchDateExtractorConfiguration(DateExtractorConfiguration): - @property - def week_day_start(self) -> Pattern: - return self._week_day_start - - @property - def check_both_before_after(self) -> Pattern: - return self._check_both_before_after + def __init__(self): + super().__init__(FrenchDateTime()) + self.ordinal_extractor: BaseNumberExtractor = FrenchOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = FrenchIntegerExtractor() + self.number_parser: BaseNumberParser = BaseNumberParser(FrenchNumberParserConfiguration()) + self.duration_extractor: DateTimeExtractor = BaseDurationExtractor(FrenchDurationExtractorConfiguration()) + self.utility_configuration: DateTimeUtilityConfiguration = FrenchDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(FrenchDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.ThisRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.LastDateRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.StrictWeekDay), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecialDate), + ] @property def date_regex_list(self) -> List[Pattern]: - return self._date_regex_list - - @property - def implicit_date_list(self) -> List[Pattern]: - return self._implicit_date_list - - @property - def month_end(self) -> Pattern: - return self._month_end - - @property - def week_day_end(self) -> Pattern: - return self._week_day_end - - @property - def of_month(self) -> Pattern: - return self._of_month - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def for_the_regex(self) -> Pattern: - return self._for_the_regex - - @property - def week_day_and_day_of_month_regex(self) -> Pattern: - return self._week_day_and_day_of_month_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def prefix_article_regex(self) -> Pattern: - return self._prefix_article_regex - - @property - def day_of_week(self) -> Dict[str, int]: - return self._day_of_week - - @property - def month_of_year(self) -> Dict[str, int]: - return self._month_of_year - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def utility_configuration(self) -> DateTimeUtilityConfiguration: - return self._utility_configuration - - @property - def strict_relative_regex(self) -> Pattern: - return self._strict_relative_regex - - @property - def range_connector_symbol_regex(self) -> Pattern: - return self._range_connector_symbol_regex - - @property - def year_suffix(self) -> Pattern: - return self._year_suffix - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_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 since_year_suffix_regex(self) -> Pattern: - return self._since_year_suffix_regex - - @property - def week_day_and_day_regex(self) -> Pattern: - return self._week_day_and_day_regex - - def __init__(self): - self._check_both_before_after = False if FrenchDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: date_extractor_4 = FrenchDateTime.DateExtractor5 date_extractor_5 = FrenchDateTime.DateExtractor4 @@ -148,7 +56,7 @@ def __init__(self): date_extractor_6 = FrenchDateTime.DateExtractor6 date_extractor_7 = FrenchDateTime.DateExtractor7 - self._date_regex_list = [ + return [ RegExpUtility.get_safe_reg_exp(FrenchDateTime.DateExtractor1), RegExpUtility.get_safe_reg_exp(FrenchDateTime.DateExtractor2), RegExpUtility.get_safe_reg_exp(FrenchDateTime.DateExtractor3), @@ -160,74 +68,3 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(FrenchDateTime.DateExtractor9), RegExpUtility.get_safe_reg_exp(FrenchDateTime.DateExtractorA), ] - - self._implicit_date_list = [ - RegExpUtility.get_safe_reg_exp(FrenchDateTime.OnRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelaxedOnRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecialDayRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.ThisRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.LastDateRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextDateRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.StrictWeekDay), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecialDate), - ] - self._month_end = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthEnd) - self._of_month = RegExpUtility.get_safe_reg_exp(FrenchDateTime.OfMonth) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DateUnitRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ForTheRegex) - self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayAndDayOfMonthRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayRegex) - self._day_of_week = FrenchDateTime.DayOfWeek - self._ordinal_extractor = FrenchOrdinalExtractor() - self._integer_extractor = FrenchIntegerExtractor() - self._number_parser = BaseNumberParser( - FrenchNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - FrenchDurationExtractorConfiguration()) - self._utility_configuration = FrenchDateTimeUtilityConfiguration() - self._range_connector_symbol_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.RangeConnectorSymbolRegex - ) - self._strict_relative_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.StrictRelativeRegex - ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.YearSuffix - ) - self._month_of_year = FrenchDateTime.MonthOfYear - self._prefix_article_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PrefixArticleRegex - ) - self._week_day_end = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayEnd - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LessThanRegex - ) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.InConnectorRegex - ) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RangeUnitRegex - ) - self._since_year_suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SinceYearSuffixRegex - ) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayAndDayRegex - ) - self._week_day_start = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayStart - ) - self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/date_parser_config.py index 974d06d08a..f790129577 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/date_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/date_parser_config.py @@ -1,17 +1,17 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict -import regex +from typing import Dict, List, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_date import DateParserConfiguration from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_date import DateParserConfiguration -from ..base_configs import BaseDateParserConfiguration from .date_extractor_config import FrenchDateExtractorConfiguration @@ -155,36 +155,21 @@ def __init__(self, config: BaseDateParserConfiguration): self._cardinal_map = config.cardinal_map self._date_regex = (FrenchDateExtractorConfiguration()).date_regex_list self._on_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.OnRegex) - self._special_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecialDayRegex) - self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecialDayWithNumRegex) - self._next_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NextDateRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DateUnitRegex) - self._month_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayRegex) - self._strict_week_day = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.StrictWeekDay) - self._last_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LastDateRegex) - self._this_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ThisRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayOfMonthRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ForTheRegex) - self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayAndDayOfMonthRegex) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayAndDayRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RelativeMonthRegex) - self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RelativeWeekDayRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextDateRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DateUnitRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayRegex) + self._strict_week_day = RegExpUtility.get_safe_reg_exp(FrenchDateTime.StrictWeekDay) + self._last_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.LastDateRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ThisRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayOfMonthRegex) + self._for_the_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ForTheRegex) + self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayAndDayOfMonthRegex) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeMonthRegex) + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeWeekDayRegex) self._utility_configuration = config.utility_configuration self._date_token_prefix = FrenchDateTime.DateTokenPrefix self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter @@ -195,11 +180,20 @@ def get_swift_day(self, source: str) -> int: if trimmed_text == 'aujourd\'hui' or trimmed_text == 'auj': swift = 0 - elif trimmed_text == 'demain' or trimmed_text.endswith('a2m1') or trimmed_text.endswith('lendemain') or trimmed_text.endswith('jour suivant'): + elif ( + trimmed_text == 'demain' + or trimmed_text.endswith('a2m1') + or trimmed_text.endswith('lendemain') + or trimmed_text.endswith('jour suivant') + ): swift = 1 elif trimmed_text == 'hier': swift = -1 - elif trimmed_text.endswith('après demain') or trimmed_text.endswith('après-demain') or trimmed_text.endswith('apres-demain'): + elif ( + trimmed_text.endswith('après demain') + or trimmed_text.endswith('après-demain') + or trimmed_text.endswith('apres-demain') + ): swift = 2 elif trimmed_text.endswith('avant-hier') or trimmed_text.endswith('avant hier'): swift = -2 @@ -215,11 +209,21 @@ def get_swift_month(self, source: str) -> int: if trimmed_text.endswith('prochaine') or trimmed_text.endswith('prochain'): swift = 1 - if trimmed_text == 'dernière' or trimmed_text.endswith('dernières') or trimmed_text.endswith('derniere') or trimmed_text.endswith('dernieres'): + if ( + trimmed_text == 'dernière' + or trimmed_text.endswith('dernières') + or trimmed_text.endswith('derniere') + or trimmed_text.endswith('dernieres') + ): swift = -1 return swift def is_cardinal_last(self, source: str) -> bool: trimmed_text = source.strip().lower() - return trimmed_text.endswith('dernière') or trimmed_text.endswith('dernières') or trimmed_text.endswith('derniere') or trimmed_text.endswith('dernieres') + return ( + trimmed_text.endswith('dernière') + or trimmed_text.endswith('dernières') + or trimmed_text.endswith('derniere') + or trimmed_text.endswith('dernieres') + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/dateperiod_extractor_config.py index d648dad30d..df21c137d1 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/dateperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/dateperiod_extractor_config.py @@ -1,237 +1,36 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility +from recognizers_number import FrenchCardinalExtractor, FrenchOrdinalExtractor from recognizers_number.number import BaseNumberParser -from recognizers_number.number.french.extractors import FrenchIntegerExtractor, FrenchCardinalExtractor +from recognizers_number.number.french.extractors import FrenchCardinalExtractor, FrenchIntegerExtractor from recognizers_number.number.french.parsers import FrenchNumberParserConfiguration -from ...resources.base_date_time import BaseDateTime +from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import BaseDateExtractor from ..base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex -from .duration_extractor_config import FrenchDurationExtractorConfiguration +from ..base_duration import BaseDurationExtractor from .date_extractor_config import FrenchDateExtractorConfiguration -from recognizers_text.extractor import Extractor -from recognizers_number import FrenchOrdinalExtractor, BaseNumberExtractor, FrenchCardinalExtractor +from .duration_extractor_config import FrenchDurationExtractorConfiguration class FrenchDatePeriodExtractorConfiguration(DatePeriodExtractorConfiguration): - @property - def previous_prefix_regex(self) -> Pattern: - return self._previous_prefix_regex - - @property - def check_both_before_after(self) -> bool: - return self._check_both_before_after - - @property - def simple_cases_regexes(self) -> List[Pattern]: - return self._simple_cases_regexes - - @property - def illegal_year_regex(self) -> Pattern: - return self._illegal_year_regex - - @property - def year_regex(self) -> Pattern: - return self._year_regex - - @property - def till_regex(self) -> Pattern: - return self._till_regex - - @property - def followed_unit(self) -> Pattern: - return self._followed_unit - - @property - def number_combined_with_unit(self) -> Pattern: - return self._number_combined_with_unit - - @property - def past_regex(self) -> Pattern: - return self._past_regex - - @property - def decade_with_century_regex(self) -> Pattern: - return self._decade_with_century_regex - - @property - def future_regex(self) -> Pattern: - return self._future_regex - - @property - def week_of_regex(self) -> Pattern: - return self._week_of_regex - - @property - def month_of_regex(self) -> Pattern: - return self._month_of_regex - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_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 date_point_extractor(self) -> DateTimeExtractor: - return self._date_point_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def now_regex(self) -> Pattern: - return self._now_regex - - @property - def future_suffix_regex(self) -> Pattern: - return self._future_suffix_regex - - @property - def ago_regex(self) -> Pattern: - return self._ago_regex - - @property - def later_regex(self) -> Pattern: - return self._later_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_regex - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def duration_date_restrictions(self) -> [str]: - return self._duration_date_restrictions - - @property - def year_period_regex(self) -> Pattern: - return self._year_period_regex - - @property - def month_num_regex(self) -> Pattern: - return self._month_num_regex - - @property - def century_suffix_regex(self) -> Pattern: - return self._century_suffix_regex - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def cardinal_extractor(self) -> Extractor: - return self._cardinal_extractor - - @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 range_connector_regex(self) -> Pattern: - return self._range_connector_regex - - @property - def day_regex(self) -> Pattern: - return self._day_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def written_month_regex(self) -> Pattern: - return self._written_month_regex - - @property - def month_suffix_regex(self) -> Pattern: - return self._month_suffix_regex - - @property - def past_prefix_regex(self) -> Pattern: - return self._past_prefix_regex - - @property - def next_prefix_regex(self) -> Pattern: - return self._next_prefix_regex - - @property - def this_prefix_regex(self) -> Pattern: - return self._this_prefix_regex - - @property - def which_week_regex(self) -> Pattern: - return self._which_week_regex - - @property - def rest_of_date_regex(self) -> Pattern: - return self._rest_of_date_regex - - @property - def complex_date_period_regex(self) -> Pattern: - return self._complex_date_period_regex - - @property - def week_day_of_month_regex(self) -> Pattern: - return self._week_day_of_month_regex - - @property - def all_half_year_regex(self) -> Pattern: - return self._all_half_year_regex def __init__(self): - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AllHalfYearRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayOfMonthRegex) - self._complex_date_period_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ComplexDatePeriodRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RestOfDateRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WhichWeekRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ThisPrefixRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextSuffixRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PastSuffixRegex) - self._month_suffix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthSuffixRegex) - self._written_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WrittenMonthRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayRegex) - self._day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DayRegex) - self._range_connector_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RangeConnectorRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeUnitRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PastSuffixRegex) - self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter - self._simple_cases_regexes = [ + super().__init__(FrenchDateTime()) + self.ordinal_extractor = FrenchOrdinalExtractor() + self.cardinal_extractor = FrenchCardinalExtractor() + self.cardinal_extractor = FrenchCardinalExtractor() + self.date_point_extractor = BaseDateExtractor(FrenchDateExtractorConfiguration()) + self.number_parser = BaseNumberParser(FrenchNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(FrenchDurationExtractorConfiguration()) + self.integer_extractor = FrenchIntegerExtractor() + self.connector_and_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ConnectorAndRegex) + self.week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayOfMonthRegex) + self.past_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PastSuffixRegex) + self.simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(FrenchDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(FrenchDateTime.BetweenRegex), RegExpUtility.get_safe_reg_exp(FrenchDateTime.OneWordPeriodRegex), @@ -241,99 +40,17 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(FrenchDateTime.YearPeriodRegex), RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekOfYearRegex), RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthFrontBetweenRegex), - RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthFrontSimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthFrontBetweenRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthFrontSimpleCasesRegex), RegExpUtility.get_safe_reg_exp(FrenchDateTime.QuarterRegex), - RegExpUtility.get_safe_reg_exp( - FrenchDateTime.QuarterRegexYearFront), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.QuarterRegexYearFront), RegExpUtility.get_safe_reg_exp(FrenchDateTime.SeasonRegex), - RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LaterEarlyPeriodRegex), - RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekWithWeekDayRangeRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.LaterEarlyPeriodRegex), + RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekWithWeekDayRangeRegex), RegExpUtility.get_safe_reg_exp(FrenchDateTime.YearPlusNumberRegex), RegExpUtility.get_safe_reg_exp(FrenchDateTime.DecadeWithCenturyRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeDecadeRegex) + RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeDecadeRegex), ] - self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter - self._illegal_year_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.IllegalYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.YearRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TillRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.FollowedDateUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NumberCombinedWithDateUnit) - self._past_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NextSuffixRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthOfRegex) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DateUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WithinNextPrefixRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RangeUnitRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.FromRegex) - self.connector_and_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ConnectorAndRegex) - self.before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.BeforeRegex2) - - self._date_point_extractor = BaseDateExtractor( - FrenchDateExtractorConfiguration()) - self._integer_extractor = FrenchIntegerExtractor() - self._number_parser = BaseNumberParser( - FrenchNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - FrenchDurationExtractorConfiguration()) - self._now_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NowRegex) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.FutureSuffixRegex - ) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AgoRegex - ) - self._later_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LaterRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LessThanRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MoreThanRegex - ) - self._duration_date_restrictions = FrenchDateTime.DurationDateRestrictions - self._year_period_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.YearPeriodRegex - ) - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthNumRegex - ) - self._century_suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.CenturySuffixRegex - ) - self._ordinal_extractor = FrenchOrdinalExtractor() - self._cardinal_extractor = FrenchCardinalExtractor() - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PreviousPrefixRegex - ) - self._cardinal_extractor = FrenchCardinalExtractor() - # TODO When the implementation for these properties is added, change the None values to their respective Regexps - self._time_unit_regex = None def get_from_token_index(self, source: str) -> MatchedIndex: match = self.from_regex.search(source) @@ -350,4 +67,4 @@ def get_between_token_index(self, source: str) -> MatchedIndex: return MatchedIndex(False, -1) def has_connector_token(self, source: str) -> bool: - return not self.connector_and_regex.search(source) is None + return self.connector_and_regex.search(source) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/dateperiod_parser_config.py index a7a05580d4..13caf196b1 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/dateperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/dateperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration from ..base_dateperiod import DatePeriodParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser class FrenchDatePeriodParserConfiguration(DatePeriodParserConfiguration): @@ -209,8 +210,7 @@ def dynasty_year_map(self) -> Dict[str, int]: return None def __init__(self, config: BaseDateParserConfiguration): - self._relative_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RelativeRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeRegex) self._later_regex = FrenchDateTime.LaterRegex self._ago_regex = FrenchDateTime.AgoRegex self._token_before_date = FrenchDateTime.TokenBeforeDate @@ -221,64 +221,36 @@ def __init__(self, config: BaseDateParserConfiguration): self._duration_parser = config.duration_parser self._date_parser = config.date_parser - self._month_front_between_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthFrontBetweenRegex) - self._between_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.BetweenRegex) - self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthFrontSimpleCasesRegex) - self._simple_cases_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SimpleCasesRegex) - self._one_word_period_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.OneWordPeriodRegex) - self._month_with_year = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthWithYear) - self._month_num_with_year = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthNumWithYear) - self._year_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.YearRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NextSuffixRegex) - self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NumberCombinedWithDurationUnit) - self._week_of_month_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekOfMonthRegex) - self._week_of_year_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekOfYearRegex) - self._quarter_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.QuarterRegex) - self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.QuarterRegexYearFront) - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AllHalfYearRegex) - self._season_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SeasonRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WhichWeekRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MonthOfRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RestOfDateRegex) - self._later_early_period_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LaterEarlyPeriodRegex) - self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekWithWeekDayRangeRegex) - self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.UnspecificEndOfRangeRegex) - - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - '(prochain|prochaine)\b') + self._month_front_between_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthFrontBetweenRegex) + self._between_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.BetweenRegex) + self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthFrontSimpleCasesRegex) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.OneWordPeriodRegex) + self._month_with_year = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthWithYear) + self._month_num_with_year = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthNumWithYear) + self._year_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextSuffixRegex) + self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NumberCombinedWithDurationUnit) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekOfYearRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.QuarterRegex) + self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp(FrenchDateTime.QuarterRegexYearFront) + self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AllHalfYearRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SeasonRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WhichWeekRegex) + self._week_of_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekOfRegex) + self._month_of_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MonthOfRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RestOfDateRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.LaterEarlyPeriodRegex) + self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekWithWeekDayRangeRegex) + self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.UnspecificEndOfRangeRegex) + + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp('(prochain|prochaine)\b') self._past_prefix_regex = RegExpUtility.get_safe_reg_exp('(dernier)\b') - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp( - '(ce|cette)\b') - self._next_suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NextSuffixRegex) - self._past_suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PastSuffixRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp('(ce|cette)\b') + self._next_suffix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextSuffixRegex) + self._past_suffix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PastSuffixRegex) self._in_connector_regex = config.utility_configuration.in_connector_regex self._unit_map = config.unit_map @@ -286,22 +258,12 @@ def __init__(self, config: BaseDateParserConfiguration): self._day_of_month = config.day_of_month self._month_of_year = config.month_of_year self._season_map = config.season_map - self._now_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NowRegex) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DecadeWithCenturyRegex) - self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ComplexDatePeriodRegex - ) - self._relative_decade_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RelativeDecadeRegex - ) - self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ReferenceDatePeriodRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LessThanRegex - ) + self._now_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NowRegex) + self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DecadeWithCenturyRegex) + self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ComplexDatePeriodRegex) + self._relative_decade_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeDecadeRegex) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ReferenceDatePeriodRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.LessThanRegex) self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter def get_swift_day_or_month(self, source: str) -> int: @@ -312,10 +274,10 @@ def get_swift_day_or_month(self, source: str) -> int: swift = 1 if ( - trimmed_source.endswith('dernière') or - trimmed_source.endswith('dernières') or - trimmed_source.endswith('derniere') or - trimmed_source.endswith('dernieres') + trimmed_source.endswith('dernière') + or trimmed_source.endswith('dernières') + or trimmed_source.endswith('derniere') + or trimmed_source.endswith('dernieres') ): swift = -1 @@ -329,10 +291,10 @@ def get_swift_year(self, source: str) -> int: swift = 1 if ( - trimmed_source.endswith('dernière') or - trimmed_source.endswith('dernières') or - trimmed_source.endswith('derniere') or - trimmed_source.endswith('dernieres') + trimmed_source.endswith('dernière') + or trimmed_source.endswith('dernières') + or trimmed_source.endswith('derniere') + or trimmed_source.endswith('dernieres') ): swift = -1 elif trimmed_source.startswith('cette'): @@ -342,9 +304,9 @@ def get_swift_year(self, source: str) -> int: def is_future(self, source: str) -> bool: trimmed_source = source.strip().lower() - return any(trimmed_source.startswith(o) for o in FrenchDateTime.FutureStartTerms) or\ - any(trimmed_source.endswith(o) - for o in FrenchDateTime.FutureEndTerms) + return any(trimmed_source.startswith(o) for o in FrenchDateTime.FutureStartTerms) or any( + trimmed_source.endswith(o) for o in FrenchDateTime.FutureEndTerms + ) def is_year_to_date(self, source: str) -> bool: trimmed_source = source.strip().lower() @@ -356,12 +318,13 @@ def is_month_to_date(self, source: str) -> bool: def is_week_only(self, source: str) -> bool: trimmed_source = source.strip().lower() - return (any(trimmed_source.endswith(o) for o in FrenchDateTime.WeekTerms) or - (any(trimmed_source.__contains__(o) for o in FrenchDateTime.WeekTerms) and - (self._next_suffix_regex.search(trimmed_source) or - self._past_suffix_regex.search(trimmed_source)))) and not\ - any(trimmed_source.endswith(o) - for o in FrenchDateTime.WeekendTerms) + return ( + any(trimmed_source.endswith(o) for o in FrenchDateTime.WeekTerms) + or ( + any(trimmed_source.__contains__(o) for o in FrenchDateTime.WeekTerms) + and (self._next_suffix_regex.search(trimmed_source) or self._past_suffix_regex.search(trimmed_source)) + ) + ) and not any(trimmed_source.endswith(o) for o in FrenchDateTime.WeekendTerms) def is_weekend(self, source: str) -> bool: trimmed_source = source.strip().lower() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetime_extractor_config.py index 7abca8f1ee..7264b4f8dd 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetime_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetime_extractor_config.py @@ -2,19 +2,21 @@ # Licensed under the MIT License. from typing import Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_datetime import DateTimeExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor +from ..extractors import DateTimeExtractor from .base_configs import FrenchDateTimeUtilityConfiguration from .date_extractor_config import FrenchDateExtractorConfiguration -from .time_extractor_config import FrenchTimeExtractorConfiguration from .duration_extractor_config import FrenchDurationExtractorConfiguration +from .time_extractor_config import FrenchTimeExtractorConfiguration class FrenchDateTimeExtractorConfiguration(DateTimeExtractorConfiguration): @@ -105,61 +107,40 @@ def year_regex(self) -> Pattern: def __init__(self): super().__init__() - self.preposition_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PrepositionRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NowRegex) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SuffixRegex) - - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeOfDayRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecificTimeOfDayRegex) - self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeOfTodayAfterRegex) - self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeOfTodayBeforeRegex) + self.preposition_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NowRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SuffixRegex) + + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeOfDayRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecificTimeOfDayRegex) + self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeOfTodayAfterRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeOfTodayBeforeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SimpleTimeOfTodayAfterRegex) - self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeUnitRegex) - self.connector_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ConnectorRegex) - self._night_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NightRegex) - self._number_as_time_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NumberAsTimeRegex) - self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DateNumberConnectorRegex - ) - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SuffixAfterRegex + FrenchDateTime.SimpleTimeOfTodayAfterRegex ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.YearSuffix - ) - self._year_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.YearRegex + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + FrenchDateTime.SimpleTimeOfTodayBeforeRegex ) - - self._date_point_extractor = BaseDateExtractor( - FrenchDateExtractorConfiguration()) - self._time_point_extractor = BaseTimeExtractor( - FrenchTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - FrenchDurationExtractorConfiguration()) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeUnitRegex) + self.connector_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ConnectorRegex) + self._night_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NightRegex) + self._number_as_time_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NumberAsTimeRegex) + self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DateNumberConnectorRegex) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SuffixAfterRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(FrenchDateTime.YearSuffix) + self._year_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.YearRegex) + + self._date_point_extractor = BaseDateExtractor(FrenchDateExtractorConfiguration()) + self._time_point_extractor = BaseTimeExtractor(FrenchTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(FrenchDurationExtractorConfiguration()) self._utility_configuration = FrenchDateTimeUtilityConfiguration() def is_connector_token(self, source: str) -> bool: return ( - source == '' or source == ',' or - regex.search(self.preposition_regex, source) is not None or - regex.search(self.connector_regex, source) is not None + source == '' + or source == ',' + or regex.search(self.preposition_regex, source) is not None + or regex.search(self.connector_regex, source) is not None ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetime_parser_config.py index 3188d4fea9..b22f6636d4 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetime_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetime_parser_config.py @@ -1,17 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_datetime import DateTimeParserConfiguration, MatchedTimex from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_configs import BaseDateParserConfiguration -from ..base_datetime import DateTimeParserConfiguration, MatchedTimex class FrenchDateTimeParserConfiguration(DateTimeParserConfiguration): @@ -106,24 +107,19 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self, config: BaseDateParserConfiguration): self._token_before_date = FrenchDateTime.TokenBeforeDate self._token_before_time = FrenchDateTime.TokenBeforeTime - self._now_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NowRegex) - self._am_time_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AMTimeRegex) - self._pm_time_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PMTimeRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NowRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AMTimeRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PMTimeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SimpleTimeOfTodayAfterRegex) + FrenchDateTime.SimpleTimeOfTodayAfterRegex + ) self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecificTimeOfDayRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeUnitRegex) + FrenchDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecificTimeOfDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeUnitRegex) self._date_extractor = config.date_extractor self._time_extractor = config.time_extractor @@ -146,11 +142,7 @@ def get_matched_now_timex(self, source: str) -> MatchedTimex: if source.endswith('maintenant'): timex = 'PRESENT_REF' - elif ( - source == 'récemment' or - source == 'précédemment' or - source == 'auparavant' - ): + elif source == 'récemment' or source == 'précédemment' or source == 'auparavant': timex = 'PAST_REF' elif source == 'dès que possible' or source == 'dqp': timex = 'FUTURE_REF' @@ -164,17 +156,17 @@ def get_swift_day(self, source: str) -> int: swift = 0 if ( - source.startswith('prochain') or - source.endswith('prochain') or - source.startswith('prochaine') or - source.endswith('prochaine') + source.startswith('prochain') + or source.endswith('prochain') + or source.startswith('prochaine') + or source.endswith('prochaine') ): swift = -1 elif ( - source.startswith('dernier') or - source.startswith('dernière') or - source.endswith('dernier') or - source.endswith('dernière') + source.startswith('dernier') + or source.startswith('dernière') + or source.endswith('dernier') + or source.endswith('dernière') ): swift = 1 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_extractor_config.py index fc081cb6a8..3cd1a2d99c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_extractor_config.py @@ -5,21 +5,20 @@ from recognizers_number import BaseNumberExtractor, FrenchCardinalExtractor from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import FrenchDateExtractorConfiguration -from .time_extractor_config import FrenchTimeExtractorConfiguration +from .datetime_extractor_config import FrenchDateTimeExtractorConfiguration from .duration_extractor_config import FrenchDurationExtractorConfiguration +from .time_extractor_config import FrenchTimeExtractorConfiguration from .timeperiod_extractor_config import FrenchTimePeriodExtractorConfiguration -from .timezone_extractor_config import FrenchTimeZoneExtractorConfiguration -from .datetime_extractor_config import FrenchDateTimeExtractorConfiguration class FrenchDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): @@ -55,10 +54,6 @@ def duration_extractor(self) -> DateTimeExtractor: def time_period_extractor(self) -> DateTimeExtractor: return self._time_period_extractor - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - @property def simple_cases_regexes(self) -> List[Pattern]: return self._simple_cases_regexes @@ -165,91 +160,48 @@ def __init__(self): self._simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(FrenchDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(FrenchDateTime.PureNumBetweenAnd), - RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecificTimeOfDayRegex) + RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecificTimeOfDayRegex), ] - self._preposition_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PrepositionRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TillRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PeriodSpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PeriodTimeOfDayRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeFollowedUnit) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeUnitRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PastSuffixRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NextSuffixRegex) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeNumberCombinedWithUnit) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WeekDayRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PeriodSpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PeriodTimeOfDayRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeFollowedUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeUnitRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PastSuffixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextSuffixRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeNumberCombinedWithUnit) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WeekDayRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PeriodTimeOfDayWithDateRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RestOfDateTimeRegex) - self._general_ending_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.GeneralEndingRegex) - self._middle_pause_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MiddlePauseRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.FromRegex2) - self.connector_and_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ConnectorAndRegex) + FrenchDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RestOfDateTimeRegex) + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.GeneralEndingRegex) + self._middle_pause_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MiddlePauseRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.FromRegex2) + self.connector_and_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ConnectorAndRegex) self._cardinal_extractor = FrenchCardinalExtractor() - self._single_date_extractor = BaseDateExtractor( - FrenchDateExtractorConfiguration()) - self._single_time_extractor = BaseTimeExtractor( - FrenchTimeExtractorConfiguration()) - self._single_date_time_extractor = BaseDateTimeExtractor( - FrenchDateTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - FrenchDurationExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - FrenchTimePeriodExtractorConfiguration()) - self._time_zone_extractor = BaseTimeZoneExtractor( - FrenchTimeZoneExtractorConfiguration()) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.WithinNextPrefixRegex - ) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeUnitRegex - ) + self._single_date_extractor = BaseDateExtractor(FrenchDateExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(FrenchTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseDateTimeExtractor(FrenchDateTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(FrenchDurationExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(FrenchTimePeriodExtractorConfiguration()) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.WithinNextPrefixRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeUnitRegex) self._token_before_date = FrenchDateTime.TokenBeforeDate - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.FutureSuffixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DateUnitRegex - ) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AmDescRegex - ) - self._pm_desc_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PmDescRegex - ) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PrefixDayRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.BeforeRegex - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AfterRegex - ) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SuffixRegex - ) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.FutureSuffixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DateUnitRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PmDescRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AfterRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SuffixRegex) self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter def get_from_token_index(self, source: str) -> MatchedIndex: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_parser_config.py index e4be35a22b..416785d5ff 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern + from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime +from ..base_configs import BaseDateParserConfiguration from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_configs import BaseDateParserConfiguration -from ..base_timezone import BaseTimeZoneParser class FrenchDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): @@ -48,49 +49,29 @@ def __init__(self, config: BaseDateParserConfiguration): self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter self._token_before_date = FrenchDateTime.TokenBeforeDate self._token_before_time = FrenchDateTime.TokenBeforeTime - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PrefixDayRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AfterRegex) - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NextSuffixRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PastSuffixRegex) - self.this_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ThisPrefixRegex) - self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MorningStartEndRegex) - self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AfternoonStartEndRegex) - self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.EveningStartEndRegex) - self.night_start_end_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NightStartEndRegex) - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PureNumBetweenAnd) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeOfDayRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NextSuffixRegex) - self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeNumberCombinedWithUnit) - self.unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeUnitRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AfterRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextSuffixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PastSuffixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ThisPrefixRegex) + self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MorningStartEndRegex) + self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AfternoonStartEndRegex) + self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.EveningStartEndRegex) + self.night_start_end_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NightStartEndRegex) + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PureNumBetweenAnd) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NextSuffixRegex) + self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeNumberCombinedWithUnit) + self.unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeUnitRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PeriodTimeOfDayWithDateRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RestOfDateTimeRegex) - self._time_zone_parser = config.time_zone_parser + FrenchDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.RestOfDateTimeRegex) @property def previous_prefix_regex(self): @@ -212,10 +193,6 @@ def time_period_parser(self) -> DateTimeParser: def duration_parser(self) -> DateTimeParser: return self._duration_parser - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def get_matched_time_range(self, source: str) -> MatchedTimeRange: trimmed_source = source.strip().lower() begin_hour = 0 @@ -251,17 +228,17 @@ def get_swift_prefix(self, source: str) -> int: # TODO: replace with regex if ( - trimmed_source.startswith('prochain') or - trimmed_source.endswith('prochain') or - trimmed_source.startswith('prochaine') or - trimmed_source.endswith('prochaine') + trimmed_source.startswith('prochain') + or trimmed_source.endswith('prochain') + or trimmed_source.startswith('prochaine') + or trimmed_source.endswith('prochaine') ): swift = 1 elif ( - trimmed_source.startswith('derniere') or - trimmed_source.startswith('dernier') or - trimmed_source.endswith('derniere') or - trimmed_source.endswith('dernier') + trimmed_source.startswith('derniere') + or trimmed_source.startswith('dernier') + or trimmed_source.endswith('derniere') + or trimmed_source.endswith('dernier') ): swift = -1 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/duration_extractor_config.py index fbf9781bf9..cc3beaf626 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/duration_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/duration_extractor_config.py @@ -3,9 +3,10 @@ from typing import Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.french.extractors import FrenchCardinalExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime from ..base_duration import DurationExtractorConfiguration @@ -101,43 +102,27 @@ def __init__(self): self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter self._inexact_number_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.InexactNumberRegex) self._conjunction_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ConjunctionRegex) - self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AllRegex) - self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.HalfRegex) - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DurationFollowedUnit) + self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AllRegex) + self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.HalfRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DurationFollowedUnit) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NumberCombinedWithDurationUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AnUnitRegex) - self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.InexactNumberUnitRegex) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SuffixAndRegex) + FrenchDateTime.NumberCombinedWithDurationUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AnUnitRegex) + self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.InexactNumberUnitRegex) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SuffixAndRegex) self._relative_duration_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.RelativeDurationUnitRegex) - self._more_than_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MoreThanRegex) - self._less_than_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LessThanOneHour) - self._cardinal_extractor: BaseNumberExtractor = FrenchCardinalExtractor() - self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DuringRegex + FrenchDateTime.RelativeDurationUnitRegex ) + self._more_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MoreThanRegex) + self._less_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.LessThanOneHour) + self._cardinal_extractor: BaseNumberExtractor = FrenchCardinalExtractor() + self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DuringRegex) self._unit_map = FrenchDateTime.UnitMap self._unit_value_map = FrenchDateTime.UnitValueMap - self._duration_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DurationUnitRegex - ) - self._duration_connector_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DurationConnectorRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LessThanRegex - ) + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DurationUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DurationConnectorRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.MoreThanRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.LessThanRegex) self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter self._special_number_unit_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/duration_parser_config.py index 13295d59bd..b86cbd37e9 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/duration_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/duration_parser_config.py @@ -1,15 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser -from ...resources.french_date_time import FrenchDateTime +from recognizers_text.utilities import RegExpUtility +from ...resources.french_date_time import FrenchDateTime +from ..base_duration import BaseDurationExtractor, DurationParserConfiguration from ..extractors import DateTimeExtractor -from ..base_duration import DurationParserConfiguration, BaseDurationExtractor from .duration_extractor_config import FrenchDurationExtractorConfiguration @@ -66,24 +66,16 @@ def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor def __init__(self, config): - self.duration_extractor = BaseDurationExtractor( - FrenchDurationExtractorConfiguration(), False) + self.duration_extractor = BaseDurationExtractor(FrenchDurationExtractorConfiguration(), False) self._cardinal_extractor = config.cardinal_extractor self._number_parser = config.number_parser - self._followed_unit = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.DurationFollowedUnit) - self._suffix_and_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SuffixAndRegex) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NumberCombinedWithDurationUnit) - self._an_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AnUnitRegex) - self._all_date_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AllRegex) - self._half_date_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.HalfRegex) - self._inexact_number_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.InexactNumberUnitRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(FrenchDateTime.DurationFollowedUnit) + self._suffix_and_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SuffixAndRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NumberCombinedWithDurationUnit) + self._an_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AnUnitRegex) + self._all_date_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AllRegex) + self._half_date_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.HalfRegex) + self._inexact_number_unit_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.InexactNumberUnitRegex) self._unit_map = config.unit_map self._unit_value_map = config.unit_value_map self._double_numbers = config.double_numbers diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_extractor_config.py index b33b8057fd..3e91399b66 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_extractor_config.py @@ -2,10 +2,11 @@ # Licensed under the MIT License. from typing import List, Pattern + from recognizers_text.utilities import RegExpUtility -from ..base_holiday import HolidayExtractorConfiguration from ...resources.french_date_time import FrenchDateTime +from ..base_holiday import HolidayExtractorConfiguration class FrenchHolidayExtractorConfiguration(HolidayExtractorConfiguration): @@ -23,5 +24,5 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex2), RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex3), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex4) + RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex4), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_parser_config.py index c2dd5b9566..b629531c02 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_parser_config.py @@ -1,13 +1,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Callable from datetime import datetime +from typing import Callable, Dict, List from recognizers_text.utilities import RegExpUtility -from ..utilities import DateUtils -from ..base_holiday import BaseHolidayParserConfiguration + from ...resources.french_date_time import FrenchDateTime +from ..base_holiday import BaseHolidayParserConfiguration +from ..utilities import DateUtils class FrenchHolidayParserConfiguration(BaseHolidayParserConfiguration): @@ -29,54 +30,56 @@ def __init__(self, config): RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex2), RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex3), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex4) + RegExpUtility.get_safe_reg_exp(FrenchDateTime.HolidayRegex4), ] self._holiday_names = FrenchDateTime.HolidayNames # self._variable_holidays_timex_dictionary = FrenchDateTime.VariableHolidaysTimexDictionary def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: - local = dict([ - ('maosbirthday', FrenchHolidayParserConfiguration.mao_birthday), - ('yuandan', FrenchHolidayParserConfiguration.new_year), - ('teachersday', FrenchHolidayParserConfiguration.teacher_day), - ('singleday', FrenchHolidayParserConfiguration.singles_day), - ('allsaintsday', FrenchHolidayParserConfiguration.halloween_day), - ('youthday', FrenchHolidayParserConfiguration.youth_day), - ('childrenday', FrenchHolidayParserConfiguration.children_day), - ('femaleday', FrenchHolidayParserConfiguration.female_day), - ('treeplantingday', FrenchHolidayParserConfiguration.tree_plant_day), - ('arborday', FrenchHolidayParserConfiguration.tree_plant_day), - ('girlsday', FrenchHolidayParserConfiguration.girls_day), - ('whiteloverday', FrenchHolidayParserConfiguration.white_lover_day), - ('loverday', FrenchHolidayParserConfiguration.valentines_day), - ('christmas', FrenchHolidayParserConfiguration.christmas_day), - ('xmas', FrenchHolidayParserConfiguration.christmas_day), - ('newyear', FrenchHolidayParserConfiguration.new_year), - ('newyearday', FrenchHolidayParserConfiguration.new_year), - ('newyearsday', FrenchHolidayParserConfiguration.new_year), - ('inaugurationday', FrenchHolidayParserConfiguration.inauguration_day), - ('groundhougday', FrenchHolidayParserConfiguration.groundhog_day), - ('valentinesday', FrenchHolidayParserConfiguration.valentines_day), - ('stpatrickday', FrenchHolidayParserConfiguration.st_patrick_day), - ('aprilfools', FrenchHolidayParserConfiguration.fool_day), - ('stgeorgeday', FrenchHolidayParserConfiguration.st_george_day), - ('mayday', FrenchHolidayParserConfiguration.mayday), - ('cincodemayoday', FrenchHolidayParserConfiguration.cinco_de_mayo_day), - ('baptisteday', FrenchHolidayParserConfiguration.baptiste_day), - ('usindependenceday', FrenchHolidayParserConfiguration.usa_independence_day), - ('independenceday', FrenchHolidayParserConfiguration.usa_independence_day), - ('bastilleday', FrenchHolidayParserConfiguration.bastille_day), - ('halloweenday', FrenchHolidayParserConfiguration.halloween_day), - ('allhallowday', FrenchHolidayParserConfiguration.all_hallow_day), - ('allsoulsday', FrenchHolidayParserConfiguration.all_souls_day), - ('guyfawkesday', FrenchHolidayParserConfiguration.guyfawkes_day), - ('veteransday', FrenchHolidayParserConfiguration.veterans_day), - ('christmaseve', FrenchHolidayParserConfiguration.christmas_eve), - ('newyeareve', FrenchHolidayParserConfiguration.new_year_eve), - ('fathersday', FrenchHolidayParserConfiguration.fathers_day), - ('mothersday', FrenchHolidayParserConfiguration.mothers_day), - ('labourday', FrenchHolidayParserConfiguration.labour_day) - ]) + local = dict( + [ + ('maosbirthday', FrenchHolidayParserConfiguration.mao_birthday), + ('yuandan', FrenchHolidayParserConfiguration.new_year), + ('teachersday', FrenchHolidayParserConfiguration.teacher_day), + ('singleday', FrenchHolidayParserConfiguration.singles_day), + ('allsaintsday', FrenchHolidayParserConfiguration.halloween_day), + ('youthday', FrenchHolidayParserConfiguration.youth_day), + ('childrenday', FrenchHolidayParserConfiguration.children_day), + ('femaleday', FrenchHolidayParserConfiguration.female_day), + ('treeplantingday', FrenchHolidayParserConfiguration.tree_plant_day), + ('arborday', FrenchHolidayParserConfiguration.tree_plant_day), + ('girlsday', FrenchHolidayParserConfiguration.girls_day), + ('whiteloverday', FrenchHolidayParserConfiguration.white_lover_day), + ('loverday', FrenchHolidayParserConfiguration.valentines_day), + ('christmas', FrenchHolidayParserConfiguration.christmas_day), + ('xmas', FrenchHolidayParserConfiguration.christmas_day), + ('newyear', FrenchHolidayParserConfiguration.new_year), + ('newyearday', FrenchHolidayParserConfiguration.new_year), + ('newyearsday', FrenchHolidayParserConfiguration.new_year), + ('inaugurationday', FrenchHolidayParserConfiguration.inauguration_day), + ('groundhougday', FrenchHolidayParserConfiguration.groundhog_day), + ('valentinesday', FrenchHolidayParserConfiguration.valentines_day), + ('stpatrickday', FrenchHolidayParserConfiguration.st_patrick_day), + ('aprilfools', FrenchHolidayParserConfiguration.fool_day), + ('stgeorgeday', FrenchHolidayParserConfiguration.st_george_day), + ('mayday', FrenchHolidayParserConfiguration.mayday), + ('cincodemayoday', FrenchHolidayParserConfiguration.cinco_de_mayo_day), + ('baptisteday', FrenchHolidayParserConfiguration.baptiste_day), + ('usindependenceday', FrenchHolidayParserConfiguration.usa_independence_day), + ('independenceday', FrenchHolidayParserConfiguration.usa_independence_day), + ('bastilleday', FrenchHolidayParserConfiguration.bastille_day), + ('halloweenday', FrenchHolidayParserConfiguration.halloween_day), + ('allhallowday', FrenchHolidayParserConfiguration.all_hallow_day), + ('allsoulsday', FrenchHolidayParserConfiguration.all_souls_day), + ('guyfawkesday', FrenchHolidayParserConfiguration.guyfawkes_day), + ('veteransday', FrenchHolidayParserConfiguration.veterans_day), + ('christmaseve', FrenchHolidayParserConfiguration.christmas_eve), + ('newyeareve', FrenchHolidayParserConfiguration.new_year_eve), + ('fathersday', FrenchHolidayParserConfiguration.fathers_day), + ('mothersday', FrenchHolidayParserConfiguration.mothers_day), + ('labourday', FrenchHolidayParserConfiguration.labour_day), + ] + ) return {**super()._init_holiday_funcs(), **local} diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/merged_extractor_config.py index 96d8a3c307..544dfc1afa 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/merged_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/merged_extractor_config.py @@ -3,31 +3,30 @@ from typing import List, Pattern -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility, DefinitionLoader from recognizers_number import FrenchIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + +from ...resources.base_date_time import BaseDateTime from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..base_merged import MergedExtractorConfiguration from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor from ..base_datetime import BaseDateTimeExtractor from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from ..base_set import BaseSetExtractor +from ..base_duration import BaseDurationExtractor from ..base_holiday import BaseHolidayExtractor +from ..base_merged import MergedExtractorConfiguration +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import FrenchDateExtractorConfiguration -from .time_extractor_config import FrenchTimeExtractorConfiguration -from .duration_extractor_config import FrenchDurationExtractorConfiguration from .dateperiod_extractor_config import FrenchDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import FrenchTimePeriodExtractorConfiguration from .datetime_extractor_config import FrenchDateTimeExtractorConfiguration from .datetimeperiod_extractor_config import FrenchDateTimePeriodExtractorConfiguration -from .set_extractor_config import FrenchSetExtractorConfiguration +from .duration_extractor_config import FrenchDurationExtractorConfiguration from .holiday_extractor_config import FrenchHolidayExtractorConfiguration -from ...resources.base_date_time import BaseDateTime +from .time_extractor_config import FrenchTimeExtractorConfiguration +from .timeperiod_extractor_config import FrenchTimePeriodExtractorConfiguration class FrenchMergedExtractorConfiguration(MergedExtractorConfiguration): @@ -35,10 +34,6 @@ class FrenchMergedExtractorConfiguration(MergedExtractorConfiguration): def check_both_before_after(self): return self._check_both_before_after - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def datetime_alt_extractor(self): return self._datetime_alt_extractor @@ -91,10 +86,6 @@ def holiday_extractor(self) -> DateTimeExtractor: def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor - @property - def set_extractor(self) -> DateTimeExtractor: - return self._set_extractor - @property def integer_extractor(self) -> Extractor: return self._integer_extractor @@ -156,56 +147,35 @@ def ambiguity_filters_dict(self) -> Pattern: return self._ambiguity_filters_dict def __init__(self): - self._before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SinceRegex) - self._from_to_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.FromToRegex) - self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SingleAmbiguousMonthRegex) - self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PrepositionSuffixRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SinceRegex) + self._from_to_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.FromToRegex) + self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SingleAmbiguousMonthRegex) + self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PrepositionSuffixRegex) self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AmbiguousRangeModifierPrefix) - self._number_ending_pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.NumberEndingPattern) - - self._date_extractor = BaseDateExtractor( - FrenchDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - FrenchTimeExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - FrenchDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - FrenchDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - FrenchTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - FrenchDateTimePeriodExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - FrenchDurationExtractorConfiguration()) - self._set_extractor = BaseSetExtractor( - FrenchSetExtractorConfiguration()) - self._holiday_extractor = BaseHolidayExtractor( - FrenchHolidayExtractorConfiguration()) + FrenchDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.NumberEndingPattern) + + self._date_extractor = BaseDateExtractor(FrenchDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(FrenchTimeExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(FrenchDateTimeExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(FrenchDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(FrenchTimePeriodExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(FrenchDateTimePeriodExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(FrenchDurationExtractorConfiguration()) + self._holiday_extractor = BaseHolidayExtractor(FrenchHolidayExtractorConfiguration()) self._integer_extractor = FrenchIntegerExtractor() self._filter_word_regex_list = [] - self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.UnspecificDatePeriodRegex - ) + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.UnspecificDatePeriodRegex) self._around_regex = FrenchDateTime.AroundRegex self._equal_regex = BaseDateTime.EqualRegex - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SuffixAfterRegex - ) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SuffixAfterRegex) self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._superfluous_word_matcher = None self._fail_fast_regex = None self._term_filter_regexes = None self._datetime_alt_extractor = None - self._time_zone_extractor = None self._ambiguity_filters_dict = DefinitionLoader.load_ambiguity_filters(FrenchDateTime.AmbiguityFiltersDict) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/merged_parser_config.py index a54ad4b2cd..2f3d3c6183 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/merged_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/merged_parser_config.py @@ -5,22 +5,20 @@ from recognizers_text.utilities import RegExpUtility -from .holiday_parser_config import FrenchHolidayParserConfiguration -from .set_parser_config import FrenchSetParserConfiguration -from .dateperiod_parser_config import FrenchDatePeriodParserConfiguration -from .timeperiod_parser_config import FrenchTimePeriodParserConfiguration -from .common_configs import FrenchCommonDateTimeParserConfiguration +from ...resources.french_date_time import BaseDateTime, FrenchDateTime from ..base_date import BaseDateParser -from ..base_time import BaseTimeParser -from ..base_datetime import BaseDateTimeParser -from ..base_holiday import BaseHolidayParser from ..base_dateperiod import BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodParser +from ..base_datetime import BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodParser from ..base_duration import BaseDurationParser -from ..base_set import BaseSetParser +from ..base_holiday import BaseHolidayParser from ..base_merged import MergedParserConfiguration -from ...resources.french_date_time import FrenchDateTime, BaseDateTime +from ..base_time import BaseTimeParser +from ..base_timeperiod import BaseTimePeriodParser +from .common_configs import FrenchCommonDateTimeParserConfiguration +from .dateperiod_parser_config import FrenchDatePeriodParserConfiguration +from .holiday_parser_config import FrenchHolidayParserConfiguration +from .timeperiod_parser_config import FrenchTimePeriodParserConfiguration class FrenchMergedParserConfiguration(FrenchCommonDateTimeParserConfiguration, MergedParserConfiguration): @@ -84,28 +82,16 @@ def date_time_period_parser(self) -> BaseDateTimePeriodParser: def duration_parser(self) -> BaseDurationParser: return self._duration_parser - @property - def set_parser(self) -> BaseSetParser: - return self._set_parser - def __init__(self, config): FrenchCommonDateTimeParserConfiguration.__init__(self) - self._suffix_after = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SuffixAfterRegex) + self._suffix_after = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SuffixAfterRegex) self._year_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.YearRegex) self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) self._around_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AroundRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SinceRegex) - - self._date_period_parser = BaseDatePeriodParser( - FrenchDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - FrenchTimePeriodParserConfiguration(self)) - self._set_parser = BaseSetParser(FrenchSetParserConfiguration(config)) - self._holiday_parser = BaseHolidayParser( - FrenchHolidayParserConfiguration(config)) + self._before_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SinceRegex) + + self._date_period_parser = BaseDatePeriodParser(FrenchDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(FrenchTimePeriodParserConfiguration(self)) + self._holiday_parser = BaseHolidayParser(FrenchHolidayParserConfiguration(config)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/parsers.py index 44a8505925..9868c72dee 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/parsers.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/parsers.py @@ -4,9 +4,10 @@ from datetime import datetime from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime from ..base_time import BaseTimeParser -from ..utilities import DateTimeResolutionResult, DateTimeFormatUtil, DateUtils +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils class FrenchTimeParser(BaseTimeParser): @@ -21,8 +22,7 @@ def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResul result = DateTimeResolutionResult() trimmed_source = source.strip().lower() - match = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.IshRegex).match(source) + match = RegExpUtility.get_safe_reg_exp(FrenchDateTime.IshRegex).match(source) if match and match.end() == len(trimmed_source): hour_str = RegExpUtility.get_group(match, 'hour') hour = 12 @@ -31,7 +31,8 @@ def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResul result.timex = 'T' + DateTimeFormatUtil.to_str(hour, 2) result.future_value = result.past_value = DateUtils.safe_create_from_min_value( - reference.year, reference.month, reference.day, hour, 0, 0) + reference.year, reference.month, reference.day, hour, 0, 0 + ) result.success = True return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/set_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/set_extractor_config.py deleted file mode 100644 index 9eddf81fd3..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/set_extractor_config.py +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern - -from recognizers_text.utilities import RegExpUtility -from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..base_set import SetExtractorConfiguration -from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor -from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from .date_extractor_config import FrenchDateExtractorConfiguration -from .time_extractor_config import FrenchTimeExtractorConfiguration -from .duration_extractor_config import FrenchDurationExtractorConfiguration -from .dateperiod_extractor_config import FrenchDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import FrenchTimePeriodExtractorConfiguration -from .datetime_extractor_config import FrenchDateTimeExtractorConfiguration -from .datetimeperiod_extractor_config import FrenchDateTimePeriodExtractorConfiguration - - -class FrenchSetExtractorConfiguration(SetExtractorConfiguration): - @property - def last_regex(self) -> Pattern: - return self._last_regex - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def before_each_day_regex(self) -> Pattern: - return self._before_each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - def __init__(self): - self._last_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SetLastRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.EachUnitRegex) - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.EachPrefixRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.EachDayRegex) - self._before_each_day_regex = None - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SetEachRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SetWeekDayRegex) - - self._duration_extractor = BaseDurationExtractor( - FrenchDurationExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - FrenchTimeExtractorConfiguration()) - self._date_extractor = BaseDateExtractor( - FrenchDateExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - FrenchDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - FrenchDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - FrenchTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - FrenchDateTimePeriodExtractorConfiguration()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/set_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/set_parser_config.py deleted file mode 100644 index 19985e0938..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/set_parser_config.py +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern, Dict - -from recognizers_text.utilities import RegExpUtility -from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser -from ..base_set import SetParserConfiguration, MatchedTimex -from ..base_configs import BaseDateParserConfiguration - - -class FrenchSetParserConfiguration(SetParserConfiguration): - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def duration_parser(self) -> DateTimeParser: - return self._duration_parser - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def time_parser(self) -> DateTimeParser: - return self._time_parser - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_parser(self) -> DateTimeParser: - return self._date_parser - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_time_parser(self) -> DateTimeParser: - return self._date_time_parser - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def date_period_parser(self) -> DateTimeParser: - return self._date_period_parser - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def time_period_parser(self) -> DateTimeParser: - return self._time_period_parser - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def date_time_period_parser(self) -> DateTimeParser: - return self._date_time_period_parser - - @property - def unit_map(self) -> Dict[str, str]: - return self._unit_map - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - def __init__(self, config: BaseDateParserConfiguration): - self._duration_extractor = config.duration_extractor - self._time_extractor = config.time_extractor - self._date_extractor = config.date_extractor - self._date_time_extractor = config.date_time_extractor - self._date_period_extractor = config.date_period_extractor - self._time_period_extractor = config.time_period_extractor - self._date_time_period_extractor = config.date_time_period_extractor - self._duration_parser = config.duration_parser - self._time_parser = config.time_parser - self._date_parser = config.date_parser - self._date_time_parser = config.date_time_parser - self._date_period_parser = config.date_period_parser - self._time_period_parser = config.time_period_parser - self._date_time_period_parser = config.date_time_period_parser - self._unit_map = FrenchDateTime.UnitMap - - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.EachPrefixRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.EachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.EachDayRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SetWeekDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SetEachRegex) - - def get_matched_daily_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - timex = '' - - if ( - trimmed_text == 'quotidien' or trimmed_text == 'quotidienne' or - trimmed_text == 'jours' or trimmed_text == 'journellement' - ): - timex = 'P1D' - elif trimmed_text == 'hebdomadaire': - timex = 'P1W' - elif trimmed_text == 'bihebdomadaire': - timex = 'P2W' - elif trimmed_text == 'mensuel' or trimmed_text == 'mensuelle': - timex = 'P1M' - elif trimmed_text == 'annuel' or trimmed_text == 'annuellement': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) - - def get_matched_unit_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - timex = '' - - if trimmed_text == 'jour' or trimmed_text == 'journee': - timex = 'P1D' - elif trimmed_text == 'semaine': - timex = 'P1W' - elif trimmed_text == 'mois': - timex = 'P1M' - elif trimmed_text == 'an' or trimmed_text == 'annee': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/time_extractor_config.py index a240a54ae8..a043ab2f25 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/time_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/time_extractor_config.py @@ -4,18 +4,13 @@ from typing import List, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime from ..base_time import TimeExtractorConfiguration from ..utilities import DateTimeOptions -from ..base_timezone import BaseTimeZoneExtractor -from .timezone_extractor_config import FrenchTimeZoneExtractorConfiguration class FrenchTimeExtractorConfiguration(TimeExtractorConfiguration): - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def time_regex_list(self) -> List[Pattern]: return self._time_regex_list @@ -34,17 +29,11 @@ def time_before_after_regex(self) -> Pattern: def __init__(self): super().__init__() - self._time_regex_list: List[Pattern] = FrenchTimeExtractorConfiguration.get_time_regex_list( - ) - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AtRegex) - self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.IshRegex) - self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeBeforeAfterRegex) + self._time_regex_list: List[Pattern] = FrenchTimeExtractorConfiguration.get_time_regex_list() + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AtRegex) + self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.IshRegex) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeBeforeAfterRegex) self._options = DateTimeOptions.NONE - self._time_zone_extractor = BaseTimeZoneExtractor( - FrenchTimeZoneExtractorConfiguration()) @staticmethod def get_time_regex_list() -> List[Pattern]: @@ -59,5 +48,5 @@ def get_time_regex_list() -> List[Pattern]: RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeRegex8), RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeRegex9), RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeRegex10), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.ConnectNumRegex) + RegExpUtility.get_safe_reg_exp(FrenchDateTime.ConnectNumRegex), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/time_parser_config.py index 5c0f685527..0f56d5288f 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/time_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/time_parser_config.py @@ -1,15 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern, Dict +from typing import Dict, List, Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime -from ..base_time import TimeParserConfiguration, AdjustParams from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_time import AdjustParams, TimeParserConfiguration from .time_extractor_config import FrenchTimeExtractorConfiguration -from ..parsers import DateTimeParser class FrenchTimeParserConfiguration(TimeParserConfiguration): @@ -33,24 +34,15 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_token_prefix: str = FrenchDateTime.TimeTokenPrefix - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.AtRegex) - self._time_regexes: List[Pattern] = FrenchTimeExtractorConfiguration.get_time_regex_list( - ) - self.less_than_one_hour = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.LessThanOneHour) - self.time_suffix = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeSuffix) + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.AtRegex) + self._time_regexes: List[Pattern] = FrenchTimeExtractorConfiguration.get_time_regex_list() + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(FrenchDateTime.LessThanOneHour) + self.time_suffix = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeSuffix) self._utility_configuration = config.utility_configuration self._numbers: Dict[str, int] = config.numbers - self._time_zone_parser = config.time_zone_parser def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): delta_min = 0 @@ -70,8 +62,7 @@ def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): if min_str: delta_min = int(min_str) else: - min_str = RegExpUtility.get_group( - match, 'deltaminnum').lower() + min_str = RegExpUtility.get_group(match, 'deltaminnum').lower() delta_min = self.numbers.get(min_str) if trimmed_prefix.endswith('à') or 'moins' in trimmed_prefix: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_extractor_config.py index 70936bd58b..420b9fa377 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_extractor_config.py @@ -3,17 +3,16 @@ from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor from recognizers_number.number.french.extractors import FrenchIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..base_timeperiod import TimePeriodExtractorConfiguration, MatchedIndex from ..base_time import BaseTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor -from .time_extractor_config import FrenchTimeExtractorConfiguration +from ..base_timeperiod import MatchedIndex, TimePeriodExtractorConfiguration +from ..extractors import DateTimeExtractor from .base_configs import FrenchDateTimeUtilityConfiguration -from .timezone_extractor_config import FrenchTimeZoneExtractorConfiguration +from .time_extractor_config import FrenchTimeExtractorConfiguration class FrenchTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): @@ -53,15 +52,10 @@ def token_before_date(self) -> str: def pure_number_regex(self) -> List[Pattern]: return self._pure_number_regex - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - def __init__(self): super().__init__() self._check_both_before_after = FrenchDateTime.CheckBothBeforeAfter - self._single_time_extractor = BaseTimeExtractor( - FrenchTimeExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(FrenchTimeExtractorConfiguration()) self._integer_extractor = FrenchIntegerExtractor() self.utility_configuration = FrenchDateTimeUtilityConfiguration() @@ -69,26 +63,18 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(FrenchDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(FrenchDateTime.PureNumBetweenAnd), RegExpUtility.get_safe_reg_exp(FrenchDateTime.PmRegex), - RegExpUtility.get_safe_reg_exp(FrenchDateTime.AmRegex) + RegExpUtility.get_safe_reg_exp(FrenchDateTime.AmRegex), ] - self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TillRegex) - self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeOfDayRegex) - self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.GeneralEndingRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.FromRegex2) - self.connector_and_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.ConnectorAndRegex) - self.before_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.BeforeRegex2) + self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TillRegex) + self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeOfDayRegex) + self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchDateTime.GeneralEndingRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.FromRegex2) + self.connector_and_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.ConnectorAndRegex) + self.before_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.BeforeRegex2) self._token_before_date = FrenchDateTime.TokenBeforeDate self._pure_number_regex = [FrenchDateTime.PureNumFromTo, FrenchDateTime.PureNumFromTo] - self._time_zone_extractor = BaseTimeZoneExtractor( - FrenchTimeZoneExtractorConfiguration()) def get_from_token_index(self, source: str) -> MatchedIndex: match = self.from_regex.search(source) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_parser_config.py index 8d21bbcf5b..b1467a0fd6 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_parser_config.py @@ -1,19 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_text.extractor import Extractor -from recognizers_number.number.french.extractors import FrenchIntegerExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.french_date_time import FrenchDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration -from ..base_timeperiod import TimePeriodParserConfiguration, MatchedTimeRegex +from ..base_timeperiod import MatchedTimeRegex, TimePeriodParserConfiguration from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from ..utilities import TimexUtil -from ..base_timezone import BaseTimeZoneParser class FrenchTimePeriodParserConfiguration(TimePeriodParserConfiguration): @@ -61,29 +60,18 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_extractor = config.time_extractor self._time_parser = config.time_parser self._integer_extractor = config.integer_extractor self._numbers = config.numbers self._utility_configuration = config.utility_configuration - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.PureNumBetweenAnd) - self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecificTimeFromTo) - self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.SpecificTimeBetweenAnd) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TimeOfDayRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - FrenchDateTime.TillRegex) - self._time_zone_parser = config.time_zone_parser + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.PureNumBetweenAnd) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.SpecificTimeBetweenAnd) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TimeOfDayRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(FrenchDateTime.TillRegex) def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: trimmed_text = source.strip().lower() @@ -102,19 +90,16 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: time_of_day = Constants.AFTERNOON elif any(trimmed_text.endswith(o) for o in FrenchDateTime.EveningTermList): time_of_day = Constants.EVENING - elif source == FrenchDateTime.DaytimeTermList[0] or source.endswith(FrenchDateTime.DaytimeTermList[1]) \ - or source.endswith(FrenchDateTime.DaytimeTermList[2]): + elif ( + source == FrenchDateTime.DaytimeTermList[0] + or source.endswith(FrenchDateTime.DaytimeTermList[1]) + or source.endswith(FrenchDateTime.DaytimeTermList[2]) + ): time_of_day = Constants.DAYTIME elif any(trimmed_text.endswith(o) for o in FrenchDateTime.NightTermList): time_of_day = Constants.NIGHT else: - return MatchedTimeRegex( - matched=False, - timex='', - begin_hour=0, - end_hour=0, - end_min=0 - ) + return MatchedTimeRegex(matched=False, timex='', begin_hour=0, end_hour=0, end_min=0) parse_result = TimexUtil.parse_time_of_day(time_of_day) timex = parse_result.timex @@ -122,10 +107,4 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: end_hour = parse_result.end_hour end_min = parse_result.end_min - return MatchedTimeRegex( - matched=True, - timex=timex, - begin_hour=begin_hour, - end_hour=end_hour, - end_min=end_min - ) + return MatchedTimeRegex(matched=True, timex=timex, begin_hour=begin_hour, end_hour=end_hour, end_min=end_min) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timezone_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timezone_extractor_config.py deleted file mode 100644 index a7b9f6aabf..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timezone_extractor_config.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import List, Pattern -from recognizers_text.matcher.string_matcher import StringMatcher -from ..base_timezone import TimeZoneExtractorConfiguration - - -class FrenchTimeZoneExtractorConfiguration(TimeZoneExtractorConfiguration): - @property - def timezone_matcher(self): - return self._timezone_matcher - - @property - def direct_utc_regex(self) -> Pattern: - return self._direct_utc_regex - - @property - def location_time_suffix_regex(self) -> Pattern: - return self._location_time_suffix_regex - - @property - def location_matcher(self) -> StringMatcher: - return self._location_matcher - - @property - def ambiguous_timezone_list(self) -> List[str]: - return self._ambiguous_timezone_list diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/__init__.py index 1db9c35b94..cc7166985a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/__init__.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/__init__.py @@ -3,24 +3,22 @@ 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_extractor_config import * from .dateperiod_parser_config import * -from .timeperiod_parser_config import * +from .datetime_extractor_config import * +from .datetime_parser_config import * +from .datetimeperiod_extractor_config import * from .datetimeperiod_parser_config import * -from .set_parser_config import * +from .duration_extractor_config import * +from .duration_parser_config import * +from .holiday_extractor_config import * from .holiday_parser_config import * +from .merged_extractor_config import * from .merged_parser_config import * from .parsers import * +from .time_extractor_config import * +from .time_parser_config import * +from .timeperiod_extractor_config import * +from .timeperiod_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/base_configs.py index 70df7f41ff..dfef2aff6f 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/base_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/base_configs.py @@ -1,90 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern -from recognizers_text.utilities import RegExpUtility from ...resources.german_date_time import GermanDateTime -from ..base_date import DateTimeUtilityConfiguration +from ..utilities import DateTimeUtilityConfiguration class GermanDateTimeUtilityConfiguration(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 def __init__(self): - self._later_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AgoRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RangeUnitRegex) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AmDescRegex) - self._pm_desc__regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PmDescRegex) - self._am_pm_desc_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AmPmDescRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WithinNextPrefixRegex) - self._common_date_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.CommonDatePrefixRegex) - self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter - self._range_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RangePrefixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DateUnitRegex - ) + super().__init__(GermanDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/common_configs.py index 31ff8f29f1..74235d2d25 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/common_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/common_configs.py @@ -3,43 +3,45 @@ from typing import Dict, Pattern -from recognizers_number import BaseNumberExtractor, GermanCardinalExtractor, GermanIntegerExtractor, GermanOrdinalExtractor, BaseNumberParser, GermanNumberParserConfiguration - -from ...resources import GermanDateTime, BaseDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + GermanCardinalExtractor, + GermanIntegerExtractor, + GermanNumberParserConfiguration, + GermanOrdinalExtractor, +) + +from ...resources import BaseDateTime, GermanDateTime from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration from ..base_date import BaseDateExtractor, BaseDateParser -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor, BaseDurationParser from ..base_dateperiod import BaseDatePeriodExtractor, BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser from ..base_datetime import BaseDateTimeExtractor, BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodExtractor, BaseDateTimePeriodParser -from ..base_timezone import BaseTimeZoneParser +from ..base_duration import BaseDurationExtractor, BaseDurationParser +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from .base_configs import GermanDateTimeUtilityConfiguration -from .duration_extractor_config import GermanDurationExtractorConfiguration from .date_extractor_config import GermanDateExtractorConfiguration -from .time_extractor_config import GermanTimeExtractorConfiguration -from .datetime_extractor_config import GermanDateTimeExtractorConfiguration +from .date_parser_config import GermanDateParserConfiguration from .dateperiod_extractor_config import GermanDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import GermanTimePeriodExtractorConfiguration +from .dateperiod_parser_config import GermanDatePeriodParserConfiguration +from .datetime_extractor_config import GermanDateTimeExtractorConfiguration +from .datetime_parser_config import GermanDateTimeParserConfiguration from .datetimeperiod_extractor_config import GermanDateTimePeriodExtractorConfiguration +from .datetimeperiod_parser_config import GermanDateTimePeriodParserConfiguration +from .duration_extractor_config import GermanDurationExtractorConfiguration from .duration_parser_config import GermanDurationParserConfiguration -from .date_parser_config import GermanDateParserConfiguration +from .parsers import GermanTimeParser +from .time_extractor_config import GermanTimeExtractorConfiguration from .time_parser_config import GermanTimeParserConfiguration -from .datetime_parser_config import GermanDateTimeParserConfiguration -from .dateperiod_parser_config import GermanDatePeriodParserConfiguration +from .timeperiod_extractor_config import GermanTimePeriodExtractorConfiguration from .timeperiod_parser_config import GermanTimePeriodParserConfiguration -from .datetimeperiod_parser_config import GermanDateTimePeriodParserConfiguration -from .parsers import GermanTimeParser class GermanCommonDateTimeParserConfiguration(BaseDateParserConfiguration): - @property - def time_zone_parser(self) -> DateTimeParser: - self._time_zone_parser - @property def check_both_before_after(self) -> Pattern: return self._check_both_before_after @@ -154,7 +156,6 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self): super().__init__() - self._time_zone_parser = BaseTimeZoneParser() self._utility_configuration = GermanDateTimeUtilityConfiguration() self._unit_map = GermanDateTime.UnitMap self._unit_value_map = GermanDateTime.UnitValueMap @@ -170,34 +171,19 @@ def __init__(self): self._integer_extractor = GermanIntegerExtractor() self._ordinal_extractor = GermanOrdinalExtractor() - self._day_of_month = { - **BaseDateTime.DayOfMonthDictionary, **GermanDateTime.DayOfMonth} - self._number_parser = BaseNumberParser( - GermanNumberParserConfiguration()) - self._date_extractor = BaseDateExtractor( - GermanDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - GermanTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - GermanDurationExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - GermanDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - GermanTimePeriodExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - GermanDateTimeExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - GermanDateTimePeriodExtractorConfiguration()) - self._duration_parser = BaseDurationParser( - GermanDurationParserConfiguration(self)) + self._day_of_month = {**BaseDateTime.DayOfMonthDictionary, **GermanDateTime.DayOfMonth} + self._number_parser = BaseNumberParser(GermanNumberParserConfiguration()) + self._date_extractor = BaseDateExtractor(GermanDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(GermanTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(GermanDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(GermanDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(GermanTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(GermanDateTimeExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(GermanDateTimePeriodExtractorConfiguration()) + self._duration_parser = BaseDurationParser(GermanDurationParserConfiguration(self)) self._date_parser = BaseDateParser(GermanDateParserConfiguration(self)) - self._time_parser = GermanTimeParser( - GermanTimeParserConfiguration(self)) - self._date_period_parser = BaseDatePeriodParser( - GermanDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - GermanTimePeriodParserConfiguration(self)) - self._date_time_parser = BaseDateTimeParser( - GermanDateTimeParserConfiguration(self)) - self._date_time_period_parser = BaseDateTimePeriodParser( - GermanDateTimePeriodParserConfiguration(self)) + self._time_parser = GermanTimeParser(GermanTimeParserConfiguration(self)) + self._date_period_parser = BaseDatePeriodParser(GermanDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(GermanTimePeriodParserConfiguration(self)) + self._date_time_parser = BaseDateTimeParser(GermanDateTimeParserConfiguration(self)) + self._date_time_period_parser = BaseDateTimePeriodParser(GermanDateTimePeriodParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/date_extractor_config.py index 12d867418d..d7e4795374 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/date_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/date_extractor_config.py @@ -1,141 +1,49 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict -from recognizers_number import (BaseNumberExtractor, BaseNumberParser, - GermanOrdinalExtractor, GermanIntegerExtractor, GermanNumberParserConfiguration) +from typing import List, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + GermanIntegerExtractor, + GermanNumberParserConfiguration, + GermanOrdinalExtractor, +) from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import DateExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..constants import Constants from ..utilities import DateTimeUtilityConfiguration -from .duration_extractor_config import GermanDurationExtractorConfiguration from .base_configs import GermanDateTimeUtilityConfiguration -from ..constants import Constants -from ...resources.base_date_time import BaseDateTime +from .duration_extractor_config import GermanDurationExtractorConfiguration class GermanDateExtractorConfiguration(DateExtractorConfiguration): - @property - def week_day_start(self) -> Pattern: - return self._week_day_start - - @property - def check_both_before_after(self) -> Pattern: - return self._check_both_before_after + def __init__(self): + super().__init__(GermanDateTime()) + self.ordinal_extractor: BaseNumberExtractor = GermanOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = GermanIntegerExtractor() + self.number_parser: BaseNumberParser = BaseNumberParser(GermanNumberParserConfiguration()) + self.duration_extractor: BaseDurationExtractor = BaseDurationExtractor(GermanDurationExtractorConfiguration()) + self.utility_configuration: DateTimeUtilityConfiguration = GermanDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(GermanDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.ThisRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.LastDateRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.SingleWeekDayRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecialDate), + ] @property def date_regex_list(self) -> List[Pattern]: - return self._date_regex_list - - @property - def implicit_date_list(self) -> List[Pattern]: - return self._implicit_date_list - - @property - def month_end(self) -> Pattern: - return self._month_end - - @property - def week_day_end(self) -> Pattern: - return self._week_day_end - - @property - def of_month(self) -> Pattern: - return self._of_month - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def for_the_regex(self) -> Pattern: - return self._for_the_regex - - @property - def week_day_and_day_of_month_regex(self) -> Pattern: - return self._week_day_and_day_of_month_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def prefix_article_regex(self) -> Pattern: - return self._prefix_article_regex - - @property - def day_of_week(self) -> Dict[str, int]: - return self._day_of_week - - @property - def month_of_year(self) -> Dict[str, int]: - return self._month_of_year - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def utility_configuration(self) -> DateTimeUtilityConfiguration: - return self._utility_configuration - - @property - def strict_relative_regex(self) -> Pattern: - return self._strict_relative_regex - - @property - def range_connector_symbol_regex(self) -> Pattern: - return self._range_connector_symbol_regex - - @property - def year_suffix(self) -> Pattern: - return self._year_suffix - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_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 since_year_suffix_regex(self) -> Pattern: - return self._since_year_suffix_regex - - @property - def week_day_and_day_regex(self) -> Pattern: - return self._week_day_and_day_regex - - def __init__(self): - self._check_both_before_after = False if GermanDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: date_extractor_4 = GermanDateTime.DateExtractor5 date_extractor_5 = GermanDateTime.DateExtractor4 @@ -147,7 +55,7 @@ def __init__(self): date_extractor_6 = GermanDateTime.DateExtractor6 date_extractor_7 = GermanDateTime.DateExtractor7 - self._date_regex_list = [ + return [ RegExpUtility.get_safe_reg_exp(GermanDateTime.DateExtractor1), RegExpUtility.get_safe_reg_exp(GermanDateTime.DateExtractor2), RegExpUtility.get_safe_reg_exp(GermanDateTime.DateExtractor3), @@ -159,74 +67,3 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(GermanDateTime.DateExtractor9), RegExpUtility.get_safe_reg_exp(GermanDateTime.DateExtractorA), ] - - self._implicit_date_list = [ - RegExpUtility.get_safe_reg_exp(GermanDateTime.OnRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.RelaxedOnRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecialDayRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.ThisRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.LastDateRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.NextDateRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.SingleWeekDayRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecialDate), - ] - self._month_end = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthEnd) - self._of_month = RegExpUtility.get_safe_reg_exp(GermanDateTime.OfMonth) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DateUnitRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ForTheRegex) - self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayAndDayOfMonthRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayRegex) - self._day_of_week = GermanDateTime.DayOfWeek - self._ordinal_extractor = GermanOrdinalExtractor() - self._integer_extractor = GermanIntegerExtractor() - self._number_parser = BaseNumberParser( - GermanNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - GermanDurationExtractorConfiguration()) - self._utility_configuration = GermanDateTimeUtilityConfiguration() - self._range_connector_symbol_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.RangeConnectorSymbolRegex - ) - self._strict_relative_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.StrictRelativeRegex - ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - GermanDateTime.YearSuffix - ) - self._month_of_year = GermanDateTime.MonthOfYear - self._prefix_article_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PrefixArticleRegex - ) - self._week_day_end = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayEnd - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LessThanRegex - ) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.InConnectorRegex - ) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RangeUnitRegex - ) - self._since_year_suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SinceYearSuffixRegex - ) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayAndDayRegex - ) - self._week_day_start = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayStart - ) - self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/date_parser_config.py index c63cf336ad..007a316e4a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/date_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/date_parser_config.py @@ -1,17 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict +from typing import Dict, List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_date import DateParserConfiguration from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_date import DateParserConfiguration -from ..base_configs import BaseDateParserConfiguration from .date_extractor_config import GermanDateExtractorConfiguration @@ -140,12 +142,9 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def date_token_prefix(self) -> str: return self._date_token_prefix - _relative_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeDayRegex) - _next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextPrefixRegex) - _past_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PreviousPrefixRegex) + _relative_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeDayRegex) + _next_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextPrefixRegex) + _past_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PreviousPrefixRegex) def __init__(self, config: BaseDateParserConfiguration): self._ordinal_extractor = config.ordinal_extractor @@ -162,34 +161,20 @@ def __init__(self, config: BaseDateParserConfiguration): self._cardinal_map = config.cardinal_map self._date_regex = (GermanDateExtractorConfiguration()).date_regex_list self._on_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.OnRegex) - self._special_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecialDayRegex) - self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecialDayWithNumRegex) - self._next_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextDateRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DateUnitRegex) - self._month_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayRegex) - self._last_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LastDateRegex) - self._this_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ThisRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayOfMonthRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ForTheRegex) - self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayAndDayOfMonthRegex) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayAndDayRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeMonthRegex) - self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeWeekDayRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextDateRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.DateUnitRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.LastDateRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ThisRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayOfMonthRegex) + self._for_the_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ForTheRegex) + self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayAndDayOfMonthRegex) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeMonthRegex) + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeWeekDayRegex) self._utility_configuration = config.utility_configuration self._date_token_prefix = GermanDateTime.DateTokenPrefix self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter @@ -197,8 +182,7 @@ def __init__(self, config: BaseDateParserConfiguration): def get_swift_day(self, source: str) -> int: trimmed_text = source.strip().lower() swift = 0 - matches = regex.search( - GermanDateParserConfiguration._relative_day_regex, source) + matches = regex.search(GermanDateParserConfiguration._relative_day_regex, source) if trimmed_text == 'heute': swift = 0 elif trimmed_text == 'morgen': @@ -224,10 +208,8 @@ def get_swift_month(self, source: str) -> int: def get_swift(self, source: str) -> int: trimmed_text = source.strip().lower() swift = 0 - next_prefix_matches = regex.search( - GermanDateParserConfiguration._next_prefix_regex, trimmed_text) - past_prefix_matches = regex.search( - GermanDateParserConfiguration._past_prefix_regex, trimmed_text) + next_prefix_matches = regex.search(GermanDateParserConfiguration._next_prefix_regex, trimmed_text) + past_prefix_matches = regex.search(GermanDateParserConfiguration._past_prefix_regex, trimmed_text) if next_prefix_matches: swift = 1 elif past_prefix_matches: @@ -237,4 +219,4 @@ def get_swift(self, source: str) -> int: def is_cardinal_last(self, source: str) -> bool: trimmed_text = source.strip().lower() - return not regex.search(GermanDateParserConfiguration._past_prefix_regex, trimmed_text) is None + return regex.search(GermanDateParserConfiguration._past_prefix_regex, trimmed_text) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/dateperiod_extractor_config.py index 9b89b8f27f..9caeeb3c79 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/dateperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/dateperiod_extractor_config.py @@ -1,232 +1,34 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility +from recognizers_number import GermanCardinalExtractor, GermanOrdinalExtractor from recognizers_number.number import BaseNumberParser -from recognizers_number.number.german.extractors import GermanIntegerExtractor, GermanCardinalExtractor +from recognizers_number.number.german.extractors import GermanCardinalExtractor, GermanIntegerExtractor from recognizers_number.number.german.parsers import GermanNumberParserConfiguration -from ...resources.base_date_time import BaseDateTime +from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import BaseDateExtractor from ..base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex -from .duration_extractor_config import GermanDurationExtractorConfiguration +from ..base_duration import BaseDurationExtractor from .date_extractor_config import GermanDateExtractorConfiguration -from recognizers_text.extractor import Extractor -from recognizers_number import GermanOrdinalExtractor, BaseNumberExtractor, GermanCardinalExtractor +from .duration_extractor_config import GermanDurationExtractorConfiguration class GermanDatePeriodExtractorConfiguration(DatePeriodExtractorConfiguration): - @property - def previous_prefix_regex(self) -> Pattern: - return self._previous_prefix_regex - - @property - def check_both_before_after(self) -> bool: - return self._check_both_before_after - - @property - def simple_cases_regexes(self) -> List[Pattern]: - return self._simple_cases_regexes - - @property - def illegal_year_regex(self) -> Pattern: - return self._illegal_year_regex - - @property - def year_regex(self) -> Pattern: - return self._year_regex - - @property - def till_regex(self) -> Pattern: - return self._till_regex - - @property - def followed_unit(self) -> Pattern: - return self._followed_unit - - @property - def number_combined_with_unit(self) -> Pattern: - return self._number_combined_with_unit - - @property - def past_regex(self) -> Pattern: - return self._past_regex - - @property - def decade_with_century_regex(self) -> Pattern: - return self._decade_with_century_regex - - @property - def future_regex(self) -> Pattern: - return self._future_regex - - @property - def week_of_regex(self) -> Pattern: - return self._week_of_regex - - @property - def month_of_regex(self) -> Pattern: - return self._month_of_regex - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_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 date_point_extractor(self) -> DateTimeExtractor: - return self._date_point_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def now_regex(self) -> Pattern: - return self._now_regex - - @property - def future_suffix_regex(self) -> Pattern: - return self._future_suffix_regex - - @property - def ago_regex(self) -> Pattern: - return self._ago_regex - - @property - def later_regex(self) -> Pattern: - return self._later_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_regex - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def duration_date_restrictions(self) -> [str]: - return self._duration_date_restrictions - - @property - def year_period_regex(self) -> Pattern: - return self._year_period_regex - - @property - def month_num_regex(self) -> Pattern: - return self._month_num_regex - - @property - def century_suffix_regex(self) -> Pattern: - return self._century_suffix_regex - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def cardinal_extractor(self) -> Extractor: - return self._cardinal_extractor - - @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 range_connector_regex(self) -> Pattern: - return self._range_connector_regex - - @property - def day_regex(self) -> Pattern: - return self._day_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def month_suffix_regex(self) -> Pattern: - return self._month_suffix_regex - - @property - def past_prefix_regex(self) -> Pattern: - return self._past_prefix_regex - - @property - def next_prefix_regex(self) -> Pattern: - return self._next_prefix_regex - - @property - def this_prefix_regex(self) -> Pattern: - return self._this_prefix_regex - - @property - def which_week_regex(self) -> Pattern: - return self._which_week_regex - - @property - def rest_of_date_regex(self) -> Pattern: - return self._rest_of_date_regex - - @property - def complex_date_period_regex(self) -> Pattern: - return self._complex_date_period_regex - - @property - def week_day_of_month_regex(self) -> Pattern: - return self._week_day_of_month_regex - - @property - def all_half_year_regex(self) -> Pattern: - return self._all_half_year_regex def __init__(self): - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AllHalfYearRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayOfMonthRegex) - self._complex_date_period_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ComplexDatePeriodRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RestOfDateRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WhichWeekRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ThisPrefixRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextPrefixRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PastSuffixRegex) - self._month_suffix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthSuffixRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayRegex) - self._day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.DayRegex) - self._range_connector_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RangeConnectorRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeUnitRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PastSuffixRegex) - self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter - self._simple_cases_regexes = [ + super().__init__(GermanDateTime()) + self.ordinal_extractor = GermanOrdinalExtractor() + self.cardinal_extractor = GermanCardinalExtractor() + self.cardinal_extractor = GermanCardinalExtractor() + self.date_point_extractor = BaseDateExtractor(GermanDateExtractorConfiguration()) + self.number_parser = BaseNumberParser(GermanNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(GermanDurationExtractorConfiguration()) + self.integer_extractor = GermanIntegerExtractor() + self.from_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.FromRegex) + self.simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(GermanDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(GermanDateTime.BetweenRegex), RegExpUtility.get_safe_reg_exp(GermanDateTime.OneWordPeriodRegex), @@ -236,100 +38,17 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(GermanDateTime.YearPeriodRegex), RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekOfYearRegex), RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthFrontBetweenRegex), - RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthFrontSimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthFrontBetweenRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthFrontSimpleCasesRegex), RegExpUtility.get_safe_reg_exp(GermanDateTime.QuarterRegex), - RegExpUtility.get_safe_reg_exp( - GermanDateTime.QuarterRegexYearFront), + RegExpUtility.get_safe_reg_exp(GermanDateTime.QuarterRegexYearFront), RegExpUtility.get_safe_reg_exp(GermanDateTime.SeasonRegex), - RegExpUtility.get_safe_reg_exp( - GermanDateTime.LaterEarlyPeriodRegex), - RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekWithWeekDayRangeRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.LaterEarlyPeriodRegex), + RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekWithWeekDayRangeRegex), RegExpUtility.get_safe_reg_exp(GermanDateTime.YearPlusNumberRegex), RegExpUtility.get_safe_reg_exp(GermanDateTime.DecadeWithCenturyRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeDecadeRegex) + RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeDecadeRegex), ] - self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter - self._illegal_year_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.IllegalYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.YearRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TillRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FollowedDateUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NumberCombinedWithDateUnit) - self._past_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextPrefixRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthOfRegex) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DateUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WithinNextPrefixRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RangeUnitRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FromRegex) - self.before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.BeforeRegex) - - self._date_point_extractor = BaseDateExtractor( - GermanDateExtractorConfiguration()) - self._integer_extractor = GermanIntegerExtractor() - self._number_parser = BaseNumberParser( - GermanNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - GermanDurationExtractorConfiguration()) - self._now_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NowRegex) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FutureSuffixRegex - ) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AgoRegex - ) - self._later_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LaterRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LessThanRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MoreThanRegex - ) - self._duration_date_restrictions = GermanDateTime.DurationDateRestrictions - self._year_period_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.YearPeriodRegex - ) - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthNumRegex - ) - self._century_suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.CenturySuffixRegex - ) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DecadeWithCenturyRegex - ) - self._ordinal_extractor = GermanOrdinalExtractor() - self._cardinal_extractor = GermanCardinalExtractor() - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PreviousPrefixRegex - ) - self._cardinal_extractor = GermanCardinalExtractor() - # TODO When the implementation for these properties is added, change the None values to their respective Regexps - self._time_unit_regex = None def get_from_token_index(self, source: str) -> MatchedIndex: match = self.from_regex.search(source) @@ -346,4 +65,4 @@ def get_between_token_index(self, source: str) -> MatchedIndex: return MatchedIndex(False, -1) def has_connector_token(self, source: str) -> bool: - return not self.range_connector_regex.search(source) is None + return self.range_connector_regex.search(source) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/dateperiod_parser_config.py index b575769102..07523cb739 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/dateperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/dateperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration from ..base_dateperiod import DatePeriodParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser class GermanDatePeriodParserConfiguration(DatePeriodParserConfiguration): @@ -209,8 +210,7 @@ def dynasty_year_map(self) -> Dict[str, int]: return None def __init__(self, config: BaseDateParserConfiguration): - self._relative_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeRegex) self._later_regex = GermanDateTime.LaterRegex self._ago_regex = GermanDateTime.AgoRegex self._token_before_date = GermanDateTime.TokenBeforeDate @@ -221,65 +221,36 @@ def __init__(self, config: BaseDateParserConfiguration): self._duration_parser = config.duration_parser self._date_parser = config.date_parser - self._month_front_between_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthFrontBetweenRegex) - self._between_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.BetweenRegex) - self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthFrontSimpleCasesRegex) - self._simple_cases_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SimpleCasesRegex) - self._one_word_period_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.OneWordPeriodRegex) - self._month_with_year = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthWithYear) - self._month_num_with_year = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthNumWithYear) - self._year_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.YearRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextPrefixRegex) - self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NumberCombinedWithDurationUnit) - self._week_of_month_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekOfMonthRegex) - self._week_of_year_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekOfYearRegex) - self._quarter_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.QuarterRegex) - self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp( - GermanDateTime.QuarterRegexYearFront) - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AllHalfYearRegex) - self._season_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SeasonRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WhichWeekRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MonthOfRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RestOfDateRegex) - self._later_early_period_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LaterEarlyPeriodRegex) - self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekWithWeekDayRangeRegex) - self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.UnspecificEndOfRangeRegex) - - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextPrefixRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PastPrefixRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ThisPrefixRegex) - self._next_suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FutureSuffixRegex) - self._past_suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PastSuffixRegex) + self._month_front_between_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthFrontBetweenRegex) + self._between_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.BetweenRegex) + self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthFrontSimpleCasesRegex) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.OneWordPeriodRegex) + self._month_with_year = RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthWithYear) + self._month_num_with_year = RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthNumWithYear) + self._year_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextPrefixRegex) + self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp(GermanDateTime.NumberCombinedWithDurationUnit) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekOfYearRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.QuarterRegex) + self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp(GermanDateTime.QuarterRegexYearFront) + self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AllHalfYearRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SeasonRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WhichWeekRegex) + self._week_of_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekOfRegex) + self._month_of_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.MonthOfRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RestOfDateRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.LaterEarlyPeriodRegex) + self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekWithWeekDayRangeRegex) + self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.UnspecificEndOfRangeRegex) + + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextPrefixRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PastPrefixRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ThisPrefixRegex) + self._next_suffix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.FutureSuffixRegex) + self._past_suffix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PastSuffixRegex) self._in_connector_regex = config.utility_configuration.in_connector_regex self._unit_map = config.unit_map @@ -287,22 +258,12 @@ def __init__(self, config: BaseDateParserConfiguration): self._day_of_month = config.day_of_month self._month_of_year = config.month_of_year self._season_map = config.season_map - self._now_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NowRegex) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DecadeWithCenturyRegex) - self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ComplexDatePeriodRegex - ) - self._relative_decade_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeDecadeRegex - ) - self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ReferenceDatePeriodRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LessThanRegex - ) + self._now_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NowRegex) + self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.DecadeWithCenturyRegex) + self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ComplexDatePeriodRegex) + self._relative_decade_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeDecadeRegex) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ReferenceDatePeriodRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.LessThanRegex) self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter def get_swift_day_or_month(self, source: str) -> int: @@ -343,12 +304,13 @@ def is_month_to_date(self, source: str) -> bool: def is_week_only(self, source: str) -> bool: trimmed_source = source.strip().lower() - return (any(trimmed_source.endswith(o) for o in GermanDateTime.WeekTerms) or - (any(trimmed_source.__contains__(o) for o in GermanDateTime.WeekTerms) and - (self._next_suffix_regex.search(trimmed_source) or - self._past_suffix_regex.search(trimmed_source)))) and not\ - any(trimmed_source.endswith(o) - for o in GermanDateTime.WeekendTerms) + return ( + any(trimmed_source.endswith(o) for o in GermanDateTime.WeekTerms) + or ( + any(trimmed_source.__contains__(o) for o in GermanDateTime.WeekTerms) + and (self._next_suffix_regex.search(trimmed_source) or self._past_suffix_regex.search(trimmed_source)) + ) + ) and not any(trimmed_source.endswith(o) for o in GermanDateTime.WeekendTerms) def is_weekend(self, source: str) -> bool: trimmed_source = source.strip().lower() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetime_extractor_config.py index 443055e019..1ab6169458 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetime_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetime_extractor_config.py @@ -2,19 +2,21 @@ # Licensed under the MIT License. from typing import Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_datetime import DateTimeExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor +from ..extractors import DateTimeExtractor from .base_configs import GermanDateTimeUtilityConfiguration from .date_extractor_config import GermanDateExtractorConfiguration -from .time_extractor_config import GermanTimeExtractorConfiguration from .duration_extractor_config import GermanDurationExtractorConfiguration +from .time_extractor_config import GermanTimeExtractorConfiguration class GermanDateTimeExtractorConfiguration(DateTimeExtractorConfiguration): @@ -105,57 +107,39 @@ def year_regex(self) -> Pattern: def __init__(self): super().__init__() - self.preposition_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PrepositionRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NowRegex) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SuffixRegex) - - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeOfDayRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecificTimeOfDayRegex) - self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeOfTodayAfterRegex) - self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeOfTodayBeforeRegex) + self.preposition_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NowRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SuffixRegex) + + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeOfDayRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecificTimeOfDayRegex) + self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeOfTodayAfterRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeOfTodayBeforeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SimpleTimeOfTodayAfterRegex) - self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeUnitRegex) - self.connector_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ConnectorRegex) - self._night_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NightRegex) - self._number_as_time_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NumberAsTimeRegex) - self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DateNumberConnectorRegex - ) - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SuffixAfterRegex + GermanDateTime.SimpleTimeOfTodayAfterRegex ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - GermanDateTime.YearSuffix - ) - self._year_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.YearRegex + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + GermanDateTime.SimpleTimeOfTodayBeforeRegex ) - - self._date_point_extractor = BaseDateExtractor( - GermanDateExtractorConfiguration()) - self._time_point_extractor = BaseTimeExtractor( - GermanTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - GermanDurationExtractorConfiguration()) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeUnitRegex) + self.connector_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ConnectorRegex) + self._night_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NightRegex) + self._number_as_time_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NumberAsTimeRegex) + self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.DateNumberConnectorRegex) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SuffixAfterRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(GermanDateTime.YearSuffix) + self._year_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.YearRegex) + + self._date_point_extractor = BaseDateExtractor(GermanDateExtractorConfiguration()) + self._time_point_extractor = BaseTimeExtractor(GermanTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(GermanDurationExtractorConfiguration()) self._utility_configuration = GermanDateTimeUtilityConfiguration() def is_connector_token(self, source: str) -> bool: - return source.strip() == '' or regex.search(self.connector_regex, source) is not None or regex.search(self.preposition_regex, source) is not None + return ( + source.strip() == '' + or regex.search(self.connector_regex, source) is not None + or regex.search(self.preposition_regex, source) is not None + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetime_parser_config.py index 087fbb4516..3c0efe5f76 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetime_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetime_parser_config.py @@ -1,17 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_datetime import DateTimeParserConfiguration, MatchedTimex from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_configs import BaseDateParserConfiguration -from ..base_datetime import DateTimeParserConfiguration, MatchedTimex class GermanDateTimeParserConfiguration(DateTimeParserConfiguration): @@ -106,29 +107,22 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self, config: BaseDateParserConfiguration): self._token_before_date = GermanDateTime.TokenBeforeDate self._token_before_time = GermanDateTime.TokenBeforeTime - self._now_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NowRegex) - self._am_time_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AMTimeRegex) - self._pm_time_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PMTimeRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NowRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AMTimeRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PMTimeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SimpleTimeOfTodayAfterRegex) + GermanDateTime.SimpleTimeOfTodayAfterRegex + ) self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecificTimeOfDayRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeUnitRegex) - - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextPrefixRegex) - self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PreviousPrefixRegex) + GermanDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecificTimeOfDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeUnitRegex) + + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PreviousPrefixRegex) self._date_extractor = config.date_extractor self._time_extractor = config.time_extractor @@ -150,26 +144,19 @@ def get_matched_now_timex(self, source: str) -> MatchedTimex: timex = '' if ( - source.endswith('jetzt') or - source.endswith('momentan') or - source.endswith('gerade') or - source.endswith('aktuell') or - source.endswith('aktuelle') or - source.endswith('im moment') or - source.endswith('in diesem moment') or - source.endswith('derzeit') + source.endswith('jetzt') + or source.endswith('momentan') + or source.endswith('gerade') + or source.endswith('aktuell') + or source.endswith('aktuelle') + or source.endswith('im moment') + or source.endswith('in diesem moment') + or source.endswith('derzeit') ): timex = 'PRESENT_REF' - elif ( - source == 'neulich' or - source == 'vorher' or - source == 'vorhin' - ): + elif source == 'neulich' or source == 'vorher' or source == 'vorhin': timex = 'PAST_REF' - elif ( - source == 'so früh wie möglich' or - source == 'asap' - ): + elif source == 'so früh wie möglich' or source == 'asap': timex = 'FUTURE_REF' else: return MatchedTimex(False, None) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetimeperiod_extractor_config.py index 186b1b4b5c..c760846a32 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetimeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetimeperiod_extractor_config.py @@ -5,21 +5,20 @@ from recognizers_number import BaseNumberExtractor, GermanCardinalExtractor from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import GermanDateExtractorConfiguration -from .time_extractor_config import GermanTimeExtractorConfiguration +from .datetime_extractor_config import GermanDateTimeExtractorConfiguration from .duration_extractor_config import GermanDurationExtractorConfiguration +from .time_extractor_config import GermanTimeExtractorConfiguration from .timeperiod_extractor_config import GermanTimePeriodExtractorConfiguration -from .timezone_extractor_config import GermanTimeZoneExtractorConfiguration -from .datetime_extractor_config import GermanDateTimeExtractorConfiguration class GermanDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): @@ -55,10 +54,6 @@ def duration_extractor(self) -> DateTimeExtractor: def time_period_extractor(self) -> DateTimeExtractor: return self._time_period_extractor - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - @property def simple_cases_regexes(self) -> List[Pattern]: return self._simple_cases_regexes @@ -165,91 +160,48 @@ def __init__(self): self._simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(GermanDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(GermanDateTime.PureNumBetweenAnd), - RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecificTimeOfDayRegex) + RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecificTimeOfDayRegex), ] - self._preposition_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PrepositionRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TillRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PeriodSpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PeriodTimeOfDayRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeFollowedUnit) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeUnitRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PastSuffixRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextPrefixRegex) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeNumberCombinedWithUnit) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WeekDayRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PeriodSpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PeriodTimeOfDayRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeFollowedUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeUnitRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PastSuffixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextPrefixRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeNumberCombinedWithUnit) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WeekDayRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PeriodTimeOfDayWithDateRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RestOfDateTimeRegex) - self._general_ending_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.GeneralEndingRegex) - self._middle_pause_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MiddlePauseRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FromRegex) - self.range_connector_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RangeConnectorRegex) + GermanDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RestOfDateTimeRegex) + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.GeneralEndingRegex) + self._middle_pause_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.MiddlePauseRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.FromRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RangeConnectorRegex) self._cardinal_extractor = GermanCardinalExtractor() - self._single_date_extractor = BaseDateExtractor( - GermanDateExtractorConfiguration()) - self._single_time_extractor = BaseTimeExtractor( - GermanTimeExtractorConfiguration()) - self._single_date_time_extractor = BaseDateTimeExtractor( - GermanDateTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - GermanDurationExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - GermanTimePeriodExtractorConfiguration()) - self._time_zone_extractor = BaseTimeZoneExtractor( - GermanTimeZoneExtractorConfiguration()) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.WithinNextPrefixRegex - ) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeUnitRegex - ) + self._single_date_extractor = BaseDateExtractor(GermanDateExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(GermanTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseDateTimeExtractor(GermanDateTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(GermanDurationExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(GermanTimePeriodExtractorConfiguration()) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.WithinNextPrefixRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeUnitRegex) self._token_before_date = GermanDateTime.TokenBeforeDate - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FutureSuffixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DateUnitRegex - ) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AmDescRegex - ) - self._pm_desc_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PmDescRegex - ) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PrefixDayRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.BeforeRegex - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AfterRegex - ) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SuffixRegex - ) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.FutureSuffixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.DateUnitRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PmDescRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AfterRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SuffixRegex) self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter def get_from_token_index(self, source: str) -> MatchedIndex: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetimeperiod_parser_config.py index 27f6af184a..8040264dff 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetimeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/datetimeperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern + from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime +from ..base_configs import BaseDateParserConfiguration from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_configs import BaseDateParserConfiguration -from ..base_timezone import BaseTimeZoneParser class GermanDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): @@ -48,49 +49,29 @@ def __init__(self, config: BaseDateParserConfiguration): self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter self._token_before_date = GermanDateTime.TokenBeforeDate self._token_before_time = GermanDateTime.TokenBeforeTime - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PrefixDayRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AfterRegex) - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextPrefixRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PastSuffixRegex) - self.this_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ThisPrefixRegex) - self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MorningStartEndRegex) - self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AfternoonStartEndRegex) - self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.EveningStartEndRegex) - self.night_start_end_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NightStartEndRegex) - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PureNumBetweenAnd) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeOfDayRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FutureSuffixRegex) - self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeNumberCombinedWithUnit) - self.unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeUnitRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AfterRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextPrefixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PastSuffixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ThisPrefixRegex) + self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.MorningStartEndRegex) + self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AfternoonStartEndRegex) + self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.EveningStartEndRegex) + self.night_start_end_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NightStartEndRegex) + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PureNumBetweenAnd) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.FutureSuffixRegex) + self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeNumberCombinedWithUnit) + self.unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeUnitRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PeriodTimeOfDayWithDateRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RestOfDateTimeRegex) - self._time_zone_parser = config.time_zone_parser + GermanDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RestOfDateTimeRegex) @property def previous_prefix_regex(self): @@ -212,10 +193,6 @@ def time_period_parser(self) -> DateTimeParser: def duration_parser(self) -> DateTimeParser: return self._duration_parser - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def get_matched_time_range(self, source: str) -> MatchedTimeRange: trimmed_source = source.strip().lower() begin_hour = 0 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/duration_extractor_config.py index 45bb3c1412..435cd47210 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/duration_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/duration_extractor_config.py @@ -3,9 +3,10 @@ from typing import Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.german.extractors import GermanCardinalExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime from ..base_duration import DurationExtractorConfiguration @@ -101,43 +102,27 @@ def __init__(self): self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter self._inexact_number_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.InexactNumberRegex) self._conjunction_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ConjunctionRegex) - self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AllRegex) - self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.HalfRegex) - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DurationFollowedUnit) + self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.AllRegex) + self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.HalfRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.DurationFollowedUnit) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NumberCombinedWithDurationUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AnUnitRegex) - self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.InexactNumberUnitRegex) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SuffixAndRegex) + GermanDateTime.NumberCombinedWithDurationUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.AnUnitRegex) + self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.InexactNumberUnitRegex) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.SuffixAndRegex) self._relative_duration_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RelativeDurationUnitRegex) - self._more_than_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MoreThanRegex) - self._less_than_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LessThanOneHour) - self._cardinal_extractor: BaseNumberExtractor = GermanCardinalExtractor() - self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DuringRegex + GermanDateTime.RelativeDurationUnitRegex ) + self._more_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.MoreThanRegex) + self._less_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.LessThanOneHour) + self._cardinal_extractor: BaseNumberExtractor = GermanCardinalExtractor() + self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.DuringRegex) self._unit_map = GermanDateTime.UnitMap self._unit_value_map = GermanDateTime.UnitValueMap - self._duration_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DurationUnitRegex - ) - self._duration_connector_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DurationConnectorRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LessThanRegex - ) + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.DurationUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.DurationConnectorRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.MoreThanRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.LessThanRegex) self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter self._special_number_unit_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/duration_parser_config.py index ae517d4320..329c43afa9 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/duration_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/duration_parser_config.py @@ -1,15 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser -from ...resources.german_date_time import GermanDateTime +from recognizers_text.utilities import RegExpUtility +from ...resources.german_date_time import GermanDateTime +from ..base_duration import BaseDurationExtractor, DurationParserConfiguration from ..extractors import DateTimeExtractor -from ..base_duration import DurationParserConfiguration, BaseDurationExtractor from .duration_extractor_config import GermanDurationExtractorConfiguration @@ -66,24 +66,16 @@ def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor def __init__(self, config): - self._duration_extractor = BaseDurationExtractor( - GermanDurationExtractorConfiguration(), False) + self._duration_extractor = BaseDurationExtractor(GermanDurationExtractorConfiguration(), False) self._cardinal_extractor = config.cardinal_extractor self._number_parser = config.number_parser - self._followed_unit = RegExpUtility.get_safe_reg_exp( - GermanDateTime.DurationFollowedUnit) - self._suffix_and_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SuffixAndRegex) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NumberCombinedWithDurationUnit) - self._an_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AnUnitRegex) - self._all_date_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AllRegex) - self._half_date_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.HalfRegex) - self._inexact_number_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.InexactNumberUnitRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(GermanDateTime.DurationFollowedUnit) + self._suffix_and_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SuffixAndRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(GermanDateTime.NumberCombinedWithDurationUnit) + self._an_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AnUnitRegex) + self._all_date_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AllRegex) + self._half_date_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.HalfRegex) + self._inexact_number_unit_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.InexactNumberUnitRegex) self._unit_map = config.unit_map self._unit_value_map = config.unit_value_map self._double_numbers = config.double_numbers diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/holiday_extractor_config.py index 407671e0de..df69ccc971 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/holiday_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/holiday_extractor_config.py @@ -2,10 +2,11 @@ # Licensed under the MIT License. from typing import List, Pattern + from recognizers_text.utilities import RegExpUtility -from ..base_holiday import HolidayExtractorConfiguration from ...resources.german_date_time import GermanDateTime +from ..base_holiday import HolidayExtractorConfiguration class GermanHolidayExtractorConfiguration(HolidayExtractorConfiguration): @@ -22,5 +23,5 @@ def __init__(self): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(GermanDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(GermanDateTime.HolidayRegex2), - RegExpUtility.get_safe_reg_exp(GermanDateTime.HolidayRegex3) + RegExpUtility.get_safe_reg_exp(GermanDateTime.HolidayRegex3), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/holiday_parser_config.py index 90905eabb9..c863c37d9e 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/holiday_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/holiday_parser_config.py @@ -1,13 +1,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Callable from datetime import datetime +from typing import Callable, Dict, List from recognizers_text.utilities import RegExpUtility -from ..utilities import DateUtils -from ..base_holiday import BaseHolidayParserConfiguration + from ...resources.german_date_time import GermanDateTime +from ..base_holiday import BaseHolidayParserConfiguration +from ..utilities import DateUtils class GermanHolidayParserConfiguration(BaseHolidayParserConfiguration): @@ -28,62 +29,61 @@ def __init__(self, config): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(GermanDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(GermanDateTime.HolidayRegex2), - RegExpUtility.get_safe_reg_exp(GermanDateTime.HolidayRegex3) + RegExpUtility.get_safe_reg_exp(GermanDateTime.HolidayRegex3), ] self._holiday_names = GermanDateTime.HolidayNames - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NextPrefixRegex) - self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PreviousPrefixRegex) - self.this_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ThisPrefixRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PreviousPrefixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ThisPrefixRegex) def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: - local = dict([ - ("maosbirthday", GermanHolidayParserConfiguration.mao_birthday), - ("teachersday", GermanHolidayParserConfiguration.teacher_day), - ("singleday", GermanHolidayParserConfiguration.singles_day), - ("allsaintsday", GermanHolidayParserConfiguration.halloween_day), - ("youthday", GermanHolidayParserConfiguration.youth_day), - ("childrenday", GermanHolidayParserConfiguration.children_day), - ("femaleday", GermanHolidayParserConfiguration.female_day), - ("treeplantingday", GermanHolidayParserConfiguration.tree_plant_day), - ("arborday", GermanHolidayParserConfiguration.tree_plant_day), - ("girlsday", GermanHolidayParserConfiguration.girls_day), - ("whiteloverday", GermanHolidayParserConfiguration.white_lover_day), - ("loverday", GermanHolidayParserConfiguration.valentines_day), - ("christmas", GermanHolidayParserConfiguration.christmas_day), - ("xmas", GermanHolidayParserConfiguration.children_day), - ("newyear", GermanHolidayParserConfiguration.new_year), - ("newyearday", GermanHolidayParserConfiguration.new_year), - ("newyearsday", GermanHolidayParserConfiguration.new_year), - ("groundhougday", GermanHolidayParserConfiguration.groundhog_day), - ("valentinesday", GermanHolidayParserConfiguration.valentines_day), - ("stpatrickday", GermanHolidayParserConfiguration.st_patrick_day), - ("aprilfools", GermanHolidayParserConfiguration.fool_day), - ("stgeorgeday", GermanHolidayParserConfiguration.st_george_day), - ("mayday", GermanHolidayParserConfiguration.mayday), - ("cincodemayoday", GermanHolidayParserConfiguration.cinco_de_mayo_day), - ("baptisteday", GermanHolidayParserConfiguration.baptiste_day), - ("usindependenceday", GermanHolidayParserConfiguration.usa_independence_day), - ("independenceday", GermanHolidayParserConfiguration.usa_independence_day), - ("bastilleday", GermanHolidayParserConfiguration.bastille_day), - ("halloweenday", GermanHolidayParserConfiguration.halloween_day), - ("allhallowday", GermanHolidayParserConfiguration.all_hallow_day), - ("allsoulsday", GermanHolidayParserConfiguration.all_souls_day), - ("guyfawkesday", GermanHolidayParserConfiguration.guyfawkes_day), - ("veteransday", GermanHolidayParserConfiguration.veterans_day), - ("christmaseve", GermanHolidayParserConfiguration.christmas_eve), - ("newyeareve", GermanHolidayParserConfiguration.new_year_eve), - ("fathersday", GermanHolidayParserConfiguration.fathers_day), - ("mothersday", GermanHolidayParserConfiguration.mothers_day), - ("labourday", GermanHolidayParserConfiguration.international_workers_day), - ("memorialday", GermanHolidayParserConfiguration.memorial_day), - ("easterday", GermanHolidayParserConfiguration.easter_day), - ("eastermonday", GermanHolidayParserConfiguration.easter_day), - ("mardigras", GermanHolidayParserConfiguration.easter_day), - ]) + local = dict( + [ + ("maosbirthday", GermanHolidayParserConfiguration.mao_birthday), + ("teachersday", GermanHolidayParserConfiguration.teacher_day), + ("singleday", GermanHolidayParserConfiguration.singles_day), + ("allsaintsday", GermanHolidayParserConfiguration.halloween_day), + ("youthday", GermanHolidayParserConfiguration.youth_day), + ("childrenday", GermanHolidayParserConfiguration.children_day), + ("femaleday", GermanHolidayParserConfiguration.female_day), + ("treeplantingday", GermanHolidayParserConfiguration.tree_plant_day), + ("arborday", GermanHolidayParserConfiguration.tree_plant_day), + ("girlsday", GermanHolidayParserConfiguration.girls_day), + ("whiteloverday", GermanHolidayParserConfiguration.white_lover_day), + ("loverday", GermanHolidayParserConfiguration.valentines_day), + ("christmas", GermanHolidayParserConfiguration.christmas_day), + ("xmas", GermanHolidayParserConfiguration.children_day), + ("newyear", GermanHolidayParserConfiguration.new_year), + ("newyearday", GermanHolidayParserConfiguration.new_year), + ("newyearsday", GermanHolidayParserConfiguration.new_year), + ("groundhougday", GermanHolidayParserConfiguration.groundhog_day), + ("valentinesday", GermanHolidayParserConfiguration.valentines_day), + ("stpatrickday", GermanHolidayParserConfiguration.st_patrick_day), + ("aprilfools", GermanHolidayParserConfiguration.fool_day), + ("stgeorgeday", GermanHolidayParserConfiguration.st_george_day), + ("mayday", GermanHolidayParserConfiguration.mayday), + ("cincodemayoday", GermanHolidayParserConfiguration.cinco_de_mayo_day), + ("baptisteday", GermanHolidayParserConfiguration.baptiste_day), + ("usindependenceday", GermanHolidayParserConfiguration.usa_independence_day), + ("independenceday", GermanHolidayParserConfiguration.usa_independence_day), + ("bastilleday", GermanHolidayParserConfiguration.bastille_day), + ("halloweenday", GermanHolidayParserConfiguration.halloween_day), + ("allhallowday", GermanHolidayParserConfiguration.all_hallow_day), + ("allsoulsday", GermanHolidayParserConfiguration.all_souls_day), + ("guyfawkesday", GermanHolidayParserConfiguration.guyfawkes_day), + ("veteransday", GermanHolidayParserConfiguration.veterans_day), + ("christmaseve", GermanHolidayParserConfiguration.christmas_eve), + ("newyeareve", GermanHolidayParserConfiguration.new_year_eve), + ("fathersday", GermanHolidayParserConfiguration.fathers_day), + ("mothersday", GermanHolidayParserConfiguration.mothers_day), + ("labourday", GermanHolidayParserConfiguration.international_workers_day), + ("memorialday", GermanHolidayParserConfiguration.memorial_day), + ("easterday", GermanHolidayParserConfiguration.easter_day), + ("eastermonday", GermanHolidayParserConfiguration.easter_day), + ("mardigras", GermanHolidayParserConfiguration.easter_day), + ] + ) return {**super()._init_holiday_funcs(), **local} @@ -235,7 +235,4 @@ def get_swift_year(self, text: str) -> int: return swift def sanitize_holiday_token(self, holiday: str) -> str: - return holiday\ - .replace(' ', '')\ - .replace('-', '') \ - .replace('\'', '') + return holiday.replace(' ', '').replace('-', '').replace('\'', '') diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/merged_extractor_config.py index 220f6e3d2c..9571f71ad3 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/merged_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/merged_extractor_config.py @@ -3,31 +3,30 @@ from typing import List, Pattern -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility, DefinitionLoader from recognizers_number import GermanIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + +from ...resources.base_date_time import BaseDateTime from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..base_merged import MergedExtractorConfiguration from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor from ..base_datetime import BaseDateTimeExtractor from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from ..base_set import BaseSetExtractor +from ..base_duration import BaseDurationExtractor from ..base_holiday import BaseHolidayExtractor +from ..base_merged import MergedExtractorConfiguration +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import GermanDateExtractorConfiguration -from .time_extractor_config import GermanTimeExtractorConfiguration -from .duration_extractor_config import GermanDurationExtractorConfiguration from .dateperiod_extractor_config import GermanDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import GermanTimePeriodExtractorConfiguration from .datetime_extractor_config import GermanDateTimeExtractorConfiguration from .datetimeperiod_extractor_config import GermanDateTimePeriodExtractorConfiguration -from .set_extractor_config import GermanSetExtractorConfiguration +from .duration_extractor_config import GermanDurationExtractorConfiguration from .holiday_extractor_config import GermanHolidayExtractorConfiguration -from ...resources.base_date_time import BaseDateTime +from .time_extractor_config import GermanTimeExtractorConfiguration +from .timeperiod_extractor_config import GermanTimePeriodExtractorConfiguration class GermanMergedExtractorConfiguration(MergedExtractorConfiguration): @@ -35,10 +34,6 @@ class GermanMergedExtractorConfiguration(MergedExtractorConfiguration): def check_both_before_after(self): return self._check_both_before_after - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def datetime_alt_extractor(self): return self._datetime_alt_extractor @@ -91,10 +86,6 @@ def holiday_extractor(self) -> DateTimeExtractor: def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor - @property - def set_extractor(self) -> DateTimeExtractor: - return self._set_extractor - @property def integer_extractor(self) -> Extractor: return self._integer_extractor @@ -156,56 +147,35 @@ def ambiguity_filters_dict(self) -> Pattern: return self._ambiguity_filters_dict def __init__(self): - self._before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SinceRegex) - self._from_to_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FromToRegex) - self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SingleAmbiguousMonthRegex) - self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PrepositionSuffixRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SinceRegex) + self._from_to_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.FromToRegex) + self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SingleAmbiguousMonthRegex) + self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PrepositionSuffixRegex) self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AmbiguousRangeModifierPrefix) - self._number_ending_pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NumberEndingPattern) - - self._date_extractor = BaseDateExtractor( - GermanDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - GermanTimeExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - GermanDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - GermanDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - GermanTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - GermanDateTimePeriodExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - GermanDurationExtractorConfiguration()) - self._set_extractor = BaseSetExtractor( - GermanSetExtractorConfiguration()) - self._holiday_extractor = BaseHolidayExtractor( - GermanHolidayExtractorConfiguration()) + GermanDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.NumberEndingPattern) + + self._date_extractor = BaseDateExtractor(GermanDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(GermanTimeExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(GermanDateTimeExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(GermanDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(GermanTimePeriodExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(GermanDateTimePeriodExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(GermanDurationExtractorConfiguration()) + self._holiday_extractor = BaseHolidayExtractor(GermanHolidayExtractorConfiguration()) self._integer_extractor = GermanIntegerExtractor() self._filter_word_regex_list = [] - self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.UnspecificDatePeriodRegex - ) + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.UnspecificDatePeriodRegex) self._around_regex = GermanDateTime.AroundRegex self._equal_regex = BaseDateTime.EqualRegex - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SuffixAfterRegex - ) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SuffixAfterRegex) self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._superfluous_word_matcher = None self._fail_fast_regex = None self._term_filter_regexes = None self._datetime_alt_extractor = None - self._time_zone_extractor = None self._ambiguity_filters_dict = DefinitionLoader.load_ambiguity_filters(GermanDateTime.AmbiguityFiltersDict) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/merged_parser_config.py index b7891603a6..47f70ce2ee 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/merged_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/merged_parser_config.py @@ -5,22 +5,20 @@ from recognizers_text.utilities import RegExpUtility -from .holiday_parser_config import GermanHolidayParserConfiguration -from .set_parser_config import GermanSetParserConfiguration -from .dateperiod_parser_config import GermanDatePeriodParserConfiguration -from .timeperiod_parser_config import GermanTimePeriodParserConfiguration -from .common_configs import GermanCommonDateTimeParserConfiguration +from ...resources.german_date_time import BaseDateTime, GermanDateTime from ..base_date import BaseDateParser -from ..base_time import BaseTimeParser -from ..base_datetime import BaseDateTimeParser -from ..base_holiday import BaseHolidayParser from ..base_dateperiod import BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodParser +from ..base_datetime import BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodParser from ..base_duration import BaseDurationParser -from ..base_set import BaseSetParser +from ..base_holiday import BaseHolidayParser from ..base_merged import MergedParserConfiguration -from ...resources.german_date_time import GermanDateTime, BaseDateTime +from ..base_time import BaseTimeParser +from ..base_timeperiod import BaseTimePeriodParser +from .common_configs import GermanCommonDateTimeParserConfiguration +from .dateperiod_parser_config import GermanDatePeriodParserConfiguration +from .holiday_parser_config import GermanHolidayParserConfiguration +from .timeperiod_parser_config import GermanTimePeriodParserConfiguration class GermanMergedParserConfiguration(GermanCommonDateTimeParserConfiguration, MergedParserConfiguration): @@ -84,28 +82,16 @@ def date_time_period_parser(self) -> BaseDateTimePeriodParser: def duration_parser(self) -> BaseDurationParser: return self._duration_parser - @property - def set_parser(self) -> BaseSetParser: - return self._set_parser - def __init__(self, config): GermanCommonDateTimeParserConfiguration.__init__(self) - self._suffix_after = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SuffixAfterRegex) + self._suffix_after = RegExpUtility.get_safe_reg_exp(GermanDateTime.SuffixAfterRegex) self._year_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.YearRegex) self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) self._around_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AroundRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SinceRegex) - - self._date_period_parser = BaseDatePeriodParser( - GermanDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - GermanTimePeriodParserConfiguration(self)) - self._set_parser = BaseSetParser(GermanSetParserConfiguration(config)) - self._holiday_parser = BaseHolidayParser( - GermanHolidayParserConfiguration(config)) + self._before_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SinceRegex) + + self._date_period_parser = BaseDatePeriodParser(GermanDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(GermanTimePeriodParserConfiguration(self)) + self._holiday_parser = BaseHolidayParser(GermanHolidayParserConfiguration(config)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/parsers.py index 140065e00e..cefc064e96 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/parsers.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/parsers.py @@ -4,9 +4,10 @@ from datetime import datetime from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime from ..base_time import BaseTimeParser -from ..utilities import DateTimeResolutionResult, DateTimeFormatUtil, DateUtils +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils class GermanTimeParser(BaseTimeParser): @@ -21,8 +22,7 @@ def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResul result = DateTimeResolutionResult() trimmed_source = source.strip().lower() - match = RegExpUtility.get_safe_reg_exp( - GermanDateTime.IshRegex).match(source) + match = RegExpUtility.get_safe_reg_exp(GermanDateTime.IshRegex).match(source) if match and match.end() == len(trimmed_source): hour_str = RegExpUtility.get_group(match, 'hour') hour = 12 @@ -31,7 +31,8 @@ def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResul result.timex = 'T' + DateTimeFormatUtil.to_str(hour, 2) result.future_value = result.past_value = DateUtils.safe_create_from_min_value( - reference.year, reference.month, reference.day, hour, 0, 0) + reference.year, reference.month, reference.day, hour, 0, 0 + ) result.success = True return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/set_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/set_extractor_config.py deleted file mode 100644 index 2243f404d9..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/set_extractor_config.py +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern - -from recognizers_text.utilities import RegExpUtility -from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..base_set import SetExtractorConfiguration -from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor -from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from .date_extractor_config import GermanDateExtractorConfiguration -from .time_extractor_config import GermanTimeExtractorConfiguration -from .duration_extractor_config import GermanDurationExtractorConfiguration -from .dateperiod_extractor_config import GermanDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import GermanTimePeriodExtractorConfiguration -from .datetime_extractor_config import GermanDateTimeExtractorConfiguration -from .datetimeperiod_extractor_config import GermanDateTimePeriodExtractorConfiguration - - -class GermanSetExtractorConfiguration(SetExtractorConfiguration): - @property - def last_regex(self) -> Pattern: - return self._last_regex - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def before_each_day_regex(self) -> Pattern: - return self._before_each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - def __init__(self): - self._last_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SetLastRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.EachUnitRegex) - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.EachPrefixRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.EachDayRegex) - self._before_each_day_regex = None - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SetEachRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SetWeekDayRegex) - - self._duration_extractor = BaseDurationExtractor( - GermanDurationExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - GermanTimeExtractorConfiguration()) - self._date_extractor = BaseDateExtractor( - GermanDateExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - GermanDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - GermanDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - GermanTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - GermanDateTimePeriodExtractorConfiguration()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/set_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/set_parser_config.py deleted file mode 100644 index 041d8c6f6d..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/set_parser_config.py +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern, Dict - -from recognizers_text.utilities import RegExpUtility -from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser -from ..base_set import SetParserConfiguration, MatchedTimex -from ..base_configs import BaseDateParserConfiguration - - -class GermanSetParserConfiguration(SetParserConfiguration): - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def duration_parser(self) -> DateTimeParser: - return self._duration_parser - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def time_parser(self) -> DateTimeParser: - return self._time_parser - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_parser(self) -> DateTimeParser: - return self._date_parser - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_time_parser(self) -> DateTimeParser: - return self._date_time_parser - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def date_period_parser(self) -> DateTimeParser: - return self._date_period_parser - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def time_period_parser(self) -> DateTimeParser: - return self._time_period_parser - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def date_time_period_parser(self) -> DateTimeParser: - return self._date_time_period_parser - - @property - def unit_map(self) -> Dict[str, str]: - return self._unit_map - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - def __init__(self, config: BaseDateParserConfiguration): - self._duration_extractor = config.duration_extractor - self._time_extractor = config.time_extractor - self._date_extractor = config.date_extractor - self._date_time_extractor = config.date_time_extractor - self._date_period_extractor = config.date_period_extractor - self._time_period_extractor = config.time_period_extractor - self._date_time_period_extractor = config.date_time_period_extractor - self._duration_parser = config.duration_parser - self._time_parser = config.time_parser - self._date_parser = config.date_parser - self._date_time_parser = config.date_time_parser - self._date_period_parser = config.date_period_parser - self._time_period_parser = config.time_period_parser - self._date_time_period_parser = config.date_time_period_parser - self._unit_map = GermanDateTime.UnitMap - - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.EachPrefixRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.EachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.EachDayRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SetWeekDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SetEachRegex) - - def get_matched_daily_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - timex = '' - - if ( - trimmed_text == 'täglich' or - trimmed_text == 'täglicher' or - trimmed_text == 'tägliches' or - trimmed_text == 'tägliche' or - trimmed_text == 'täglichen' or - trimmed_text == 'alltäglich' or - trimmed_text == 'alltäglicher' or - trimmed_text == 'alltägliches' or - trimmed_text == 'alltägliche' or - trimmed_text == 'alltäglichen' or - trimmed_text == 'jeden tag' - ): - timex = 'P1D' - elif ( - trimmed_text == 'wöchentlich' or - trimmed_text == 'wöchentlicher' or - trimmed_text == 'wöchentliches' or - trimmed_text == 'wöchentliche' or - trimmed_text == 'wöchentlichen' or - trimmed_text == 'allwöchentlich' or - trimmed_text == 'allwöchentlicher' or - trimmed_text == 'allwöchentliches' or - trimmed_text == 'allwöchentliche' or - trimmed_text == 'allwöchentlichen' - ): - timex = 'P1W' - elif ( - trimmed_text == 'monatlich' or - trimmed_text == 'monatlicher' or - trimmed_text == 'monatliches' or - trimmed_text == 'monatliche' or - trimmed_text == 'monatlichen' or - trimmed_text == 'allmonatlich' or - trimmed_text == 'allmonatlicher' or - trimmed_text == 'allmonatliches' or - trimmed_text == 'allmonatliche' or - trimmed_text == 'allmonatlichen' - ): - timex = 'P1M' - elif ( - trimmed_text == 'jährlich' or - trimmed_text == 'jährlicher' or - trimmed_text == 'jährliches' or - trimmed_text == 'jährliche' or - trimmed_text == 'jährlichen' or - trimmed_text == 'alljährlich' or - trimmed_text == 'alljährlicher' or - trimmed_text == 'alljährliches' or - trimmed_text == 'alljährliche' or - trimmed_text == 'alljährlichen' - ): - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) - - def get_matched_unit_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - timex = '' - - if trimmed_text == 'tag': - timex = 'P1D' - elif trimmed_text == 'woche': - timex = 'P1W' - elif trimmed_text == 'monat': - timex = 'P1M' - elif trimmed_text == 'jahr': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/time_extractor_config.py index 8f16dbb335..611f10c763 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/time_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/time_extractor_config.py @@ -4,18 +4,13 @@ from typing import List, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime from ..base_time import TimeExtractorConfiguration from ..utilities import DateTimeOptions -from ..base_timezone import BaseTimeZoneExtractor -from .timezone_extractor_config import GermanTimeZoneExtractorConfiguration class GermanTimeExtractorConfiguration(TimeExtractorConfiguration): - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def time_regex_list(self) -> List[Pattern]: return self._time_regex_list @@ -34,17 +29,11 @@ def time_before_after_regex(self) -> Pattern: def __init__(self): super().__init__() - self._time_regex_list: List[Pattern] = GermanTimeExtractorConfiguration.get_time_regex_list( - ) - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AtRegex) - self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.IshRegex) - self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeBeforeAfterRegex) + self._time_regex_list: List[Pattern] = GermanTimeExtractorConfiguration.get_time_regex_list() + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.AtRegex) + self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.IshRegex) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeBeforeAfterRegex) self._options = DateTimeOptions.NONE - self._time_zone_extractor = BaseTimeZoneExtractor( - GermanTimeZoneExtractorConfiguration()) @staticmethod def get_time_regex_list() -> List[Pattern]: @@ -59,5 +48,5 @@ def get_time_regex_list() -> List[Pattern]: RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeRegex8), RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeRegex9), RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeRegex10), - RegExpUtility.get_safe_reg_exp(GermanDateTime.ConnectNumRegex) + RegExpUtility.get_safe_reg_exp(GermanDateTime.ConnectNumRegex), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/time_parser_config.py index b48ec064aa..5b12ea5d5d 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/time_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/time_parser_config.py @@ -1,15 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern, Dict +from typing import Dict, List, Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime -from ..base_time import TimeParserConfiguration, AdjustParams from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_time import AdjustParams, TimeParserConfiguration from .time_extractor_config import GermanTimeExtractorConfiguration -from ..parsers import DateTimeParser class GermanTimeParserConfiguration(TimeParserConfiguration): @@ -33,37 +34,22 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_token_prefix: str = GermanDateTime.TimeTokenPrefix - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.AtRegex) - self._time_regexes: List[Pattern] = GermanTimeExtractorConfiguration.get_time_regex_list( - ) - self.less_than_one_hour = RegExpUtility.get_safe_reg_exp( - GermanDateTime.LessThanOneHour) - self.time_suffix = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeSuffix) - self.night_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.NightRegex) - - self._half_token_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.HalfTokenRegex) - self._quarter_to_token_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.QuarterToTokenRegex) - self._quarter_past_token_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.QuarterPastTokenRegex) - self._three_quarter_to_token_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ThreeQuarterToTokenRegex) - self._three_quarter_past_token_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.ThreeQuarterPastTokenRegex) + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.AtRegex) + self._time_regexes: List[Pattern] = GermanTimeExtractorConfiguration.get_time_regex_list() + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(GermanDateTime.LessThanOneHour) + self.time_suffix = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeSuffix) + self.night_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.NightRegex) + + self._half_token_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.HalfTokenRegex) + self._quarter_to_token_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.QuarterToTokenRegex) + self._quarter_past_token_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.QuarterPastTokenRegex) + self._three_quarter_to_token_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ThreeQuarterToTokenRegex) + self._three_quarter_past_token_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.ThreeQuarterPastTokenRegex) self._utility_configuration = config.utility_configuration self._numbers: Dict[str, int] = config.numbers - self._time_zone_parser = config.time_zone_parser def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): delta_min = 0 @@ -87,12 +73,11 @@ def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): if min_str: delta_min = int(min_str) else: - min_str = RegExpUtility.get_group( - match, 'deltaminnum').lower() + min_str = RegExpUtility.get_group(match, 'deltaminnum').lower() delta_min = self.numbers.get(min_str) - if trimmed_prefix.startswith('zum'): - delta_min = delta_min * -1 + if trimmed_prefix.endswith('vor'): + delta_min = delta_min * -1 adjust.minute += delta_min diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timeperiod_extractor_config.py index 0883778f4f..f3cdfab014 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timeperiod_extractor_config.py @@ -3,17 +3,16 @@ from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor from recognizers_number.number.german.extractors import GermanIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..base_timeperiod import TimePeriodExtractorConfiguration, MatchedIndex from ..base_time import BaseTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor -from .time_extractor_config import GermanTimeExtractorConfiguration +from ..base_timeperiod import MatchedIndex, TimePeriodExtractorConfiguration +from ..extractors import DateTimeExtractor from .base_configs import GermanDateTimeUtilityConfiguration -from .timezone_extractor_config import GermanTimeZoneExtractorConfiguration +from .time_extractor_config import GermanTimeExtractorConfiguration class GermanTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): @@ -53,15 +52,10 @@ def token_before_date(self) -> str: def pure_number_regex(self) -> List[Pattern]: return self._pure_number_regex - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - def __init__(self): super().__init__() self._check_both_before_after = GermanDateTime.CheckBothBeforeAfter - self._single_time_extractor = BaseTimeExtractor( - GermanTimeExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(GermanTimeExtractorConfiguration()) self._integer_extractor = GermanIntegerExtractor() self.utility_configuration = GermanDateTimeUtilityConfiguration() @@ -69,26 +63,18 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(GermanDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(GermanDateTime.PureNumBetweenAnd), RegExpUtility.get_safe_reg_exp(GermanDateTime.PmRegex), - RegExpUtility.get_safe_reg_exp(GermanDateTime.AmRegex) + RegExpUtility.get_safe_reg_exp(GermanDateTime.AmRegex), ] - self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TillRegex) - self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeOfDayRegex) - self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp( - GermanDateTime.GeneralEndingRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.FromRegex) - self.range_connector_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.RangeConnectorRegex) - self.before_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.BeforeRegex) + self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.TillRegex) + self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeOfDayRegex) + self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanDateTime.GeneralEndingRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.FromRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.RangeConnectorRegex) + self.before_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.BeforeRegex) self._token_before_date = GermanDateTime.TokenBeforeDate self._pure_number_regex = [GermanDateTime.PureNumFromTo, GermanDateTime.PureNumFromTo] - self._time_zone_extractor = BaseTimeZoneExtractor( - GermanTimeZoneExtractorConfiguration()) def get_from_token_index(self, source: str) -> MatchedIndex: match = self.from_regex.search(source) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timeperiod_parser_config.py index 275a9b10ed..8df1c96699 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timeperiod_parser_config.py @@ -1,19 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_text.extractor import Extractor -from recognizers_number.number.german.extractors import GermanIntegerExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.german_date_time import GermanDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration -from ..base_timeperiod import TimePeriodParserConfiguration, MatchedTimeRegex +from ..base_timeperiod import MatchedTimeRegex, TimePeriodParserConfiguration from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from ..utilities import TimexUtil -from ..base_timezone import BaseTimeZoneParser class GermanTimePeriodParserConfiguration(TimePeriodParserConfiguration): @@ -61,29 +60,18 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_extractor = config.time_extractor self._time_parser = config.time_parser self._integer_extractor = config.integer_extractor self._numbers = config.numbers self._utility_configuration = config.utility_configuration - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.PureNumBetweenAnd) - self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecificTimeFromTo) - self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.SpecificTimeBetweenAnd) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TimeOfDayRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - GermanDateTime.TillRegex) - self._time_zone_parser = config.time_zone_parser + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.PureNumBetweenAnd) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.SpecificTimeBetweenAnd) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TimeOfDayRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(GermanDateTime.TillRegex) def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: trimmed_text = source.strip().lower() @@ -102,19 +90,16 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: time_of_day = Constants.AFTERNOON elif any(trimmed_text.endswith(o) for o in GermanDateTime.EveningTermList): time_of_day = Constants.EVENING - elif source == GermanDateTime.DaytimeTermList[0] or source.endswith(GermanDateTime.DaytimeTermList[1]) \ - or source.endswith(GermanDateTime.DaytimeTermList[2]): + elif ( + source == GermanDateTime.DaytimeTermList[0] + or source.endswith(GermanDateTime.DaytimeTermList[1]) + or source.endswith(GermanDateTime.DaytimeTermList[2]) + ): time_of_day = Constants.DAYTIME elif any(trimmed_text.endswith(o) for o in GermanDateTime.NightTermList): time_of_day = Constants.NIGHT else: - return MatchedTimeRegex( - matched=False, - timex='', - begin_hour=0, - end_hour=0, - end_min=0 - ) + return MatchedTimeRegex(matched=False, timex='', begin_hour=0, end_hour=0, end_min=0) parse_result = TimexUtil.parse_time_of_day(time_of_day) timex = parse_result.timex @@ -122,10 +107,4 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: end_hour = parse_result.end_hour end_min = parse_result.end_min - return MatchedTimeRegex( - matched=True, - timex=timex, - begin_hour=begin_hour, - end_hour=end_hour, - end_min=end_min - ) + return MatchedTimeRegex(matched=True, timex=timex, begin_hour=begin_hour, end_hour=end_hour, end_min=end_min) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timezone_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timezone_extractor_config.py deleted file mode 100644 index c00f8f211b..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/german/timezone_extractor_config.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import List, Pattern -from recognizers_text.matcher.string_matcher import StringMatcher -from recognizers_text.utilities import QueryProcessor -from ..base_timezone import TimeZoneExtractorConfiguration -from ...resources.english_time_zone import TimeZoneDefinitions -from ..utilities import TimeZoneUtility, RegExpUtility - - -class GermanTimeZoneExtractorConfiguration(TimeZoneExtractorConfiguration): - @property - def timezone_matcher(self): - return self._timezone_matcher - - @property - def direct_utc_regex(self) -> Pattern: - return self._direct_utc_regex - - @property - def abbreviations_list(self) -> List[str]: - return self._abbreviations_list - - @property - def full_name_list(self) -> List[str]: - return self._full_name_list - - @property - def location_time_suffix_regex(self) -> Pattern: - return self._location_time_suffix_regex - - @property - def location_matcher(self) -> StringMatcher: - return self._location_matcher - - @property - def ambiguous_timezone_list(self) -> List[str]: - return self._ambiguous_timezone_list - - def __init__(self): - super().__init__() - - self._direct_utc_regex = RegExpUtility.get_safe_reg_exp(TimeZoneDefinitions.DirectUtcRegex) - self._abbreviations_list = list(TimeZoneDefinitions.AbbreviationsList) - self._full_name_list = list(TimeZoneDefinitions.FullNameList) - self._timezone_matcher = TimeZoneUtility.build_matcher_from_lists(self.full_name_list, self.abbreviations_list) - self._location_time_suffix_regex = RegExpUtility.get_safe_reg_exp(TimeZoneDefinitions.LocationTimeSuffixRegex) - self._location_matcher = StringMatcher() - self._ambiguous_timezone_list = list(TimeZoneDefinitions.AmbiguousTimezoneList) - - self._location_matcher.init(list(map(lambda o: QueryProcessor.remove_diacritics(o.lower()), TimeZoneDefinitions.MajorLocations))) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/__init__.py index 1db9c35b94..cc7166985a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/__init__.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/__init__.py @@ -3,24 +3,22 @@ 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_extractor_config import * from .dateperiod_parser_config import * -from .timeperiod_parser_config import * +from .datetime_extractor_config import * +from .datetime_parser_config import * +from .datetimeperiod_extractor_config import * from .datetimeperiod_parser_config import * -from .set_parser_config import * +from .duration_extractor_config import * +from .duration_parser_config import * +from .holiday_extractor_config import * from .holiday_parser_config import * +from .merged_extractor_config import * from .merged_parser_config import * from .parsers import * +from .time_extractor_config import * +from .time_parser_config import * +from .timeperiod_extractor_config import * +from .timeperiod_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/base_configs.py index 119e13d94f..f46fc2c2d9 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/base_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/base_configs.py @@ -1,90 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern -from recognizers_text.utilities import RegExpUtility from ...resources.italian_date_time import ItalianDateTime -from ..base_date import DateTimeUtilityConfiguration +from ..utilities import DateTimeUtilityConfiguration class ItalianDateTimeUtilityConfiguration(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 def __init__(self): - self._later_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AgoPrefixRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RangeUnitRegex) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AmDescRegex) - self._pm_desc__regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PmDescRegex) - self._am_pm_desc_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AmPmDescRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WithinNextPrefixRegex) - self._common_date_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.CommonDatePrefixRegex) - self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter - self._range_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RangePrefixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DateUnitRegex - ) + super().__init__(ItalianDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/common_configs.py index a7fe6b9db9..9471211c06 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/common_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/common_configs.py @@ -3,43 +3,45 @@ from typing import Dict, Pattern -from recognizers_number import BaseNumberExtractor, ItalianCardinalExtractor, ItalianIntegerExtractor, ItalianOrdinalExtractor, BaseNumberParser, ItalianNumberParserConfiguration - -from ...resources import ItalianDateTime, BaseDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + ItalianCardinalExtractor, + ItalianIntegerExtractor, + ItalianNumberParserConfiguration, + ItalianOrdinalExtractor, +) + +from ...resources import BaseDateTime, ItalianDateTime from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration from ..base_date import BaseDateExtractor, BaseDateParser -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor, BaseDurationParser from ..base_dateperiod import BaseDatePeriodExtractor, BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser from ..base_datetime import BaseDateTimeExtractor, BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodExtractor, BaseDateTimePeriodParser -from ..base_timezone import BaseTimeZoneParser +from ..base_duration import BaseDurationExtractor, BaseDurationParser +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from .base_configs import ItalianDateTimeUtilityConfiguration -from .duration_extractor_config import ItalianDurationExtractorConfiguration from .date_extractor_config import ItalianDateExtractorConfiguration -from .time_extractor_config import ItalianTimeExtractorConfiguration -from .datetime_extractor_config import ItalianDateTimeExtractorConfiguration +from .date_parser_config import ItalianDateParserConfiguration from .dateperiod_extractor_config import ItalianDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import ItalianTimePeriodExtractorConfiguration +from .dateperiod_parser_config import ItalianDatePeriodParserConfiguration +from .datetime_extractor_config import ItalianDateTimeExtractorConfiguration +from .datetime_parser_config import ItalianDateTimeParserConfiguration from .datetimeperiod_extractor_config import ItalianDateTimePeriodExtractorConfiguration +from .datetimeperiod_parser_config import ItalianDateTimePeriodParserConfiguration +from .duration_extractor_config import ItalianDurationExtractorConfiguration from .duration_parser_config import ItalianDurationParserConfiguration -from .date_parser_config import ItalianDateParserConfiguration +from .parsers import ItalianTimeParser +from .time_extractor_config import ItalianTimeExtractorConfiguration from .time_parser_config import ItalianTimeParserConfiguration -from .datetime_parser_config import ItalianDateTimeParserConfiguration -from .dateperiod_parser_config import ItalianDatePeriodParserConfiguration +from .timeperiod_extractor_config import ItalianTimePeriodExtractorConfiguration from .timeperiod_parser_config import ItalianTimePeriodParserConfiguration -from .datetimeperiod_parser_config import ItalianDateTimePeriodParserConfiguration -from .parsers import ItalianTimeParser class ItalianCommonDateTimeParserConfiguration(BaseDateParserConfiguration): - @property - def time_zone_parser(self) -> DateTimeParser: - self._time_zone_parser - @property def check_both_before_after(self) -> Pattern: return self._check_both_before_after @@ -154,7 +156,6 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self): super().__init__() - self._time_zone_parser = BaseTimeZoneParser() self._utility_configuration = ItalianDateTimeUtilityConfiguration() self._unit_map = ItalianDateTime.UnitMap self._unit_value_map = ItalianDateTime.UnitValueMap @@ -170,34 +171,19 @@ def __init__(self): self._integer_extractor = ItalianIntegerExtractor() self._ordinal_extractor = ItalianOrdinalExtractor() - self._day_of_month = { - **BaseDateTime.DayOfMonthDictionary, **ItalianDateTime.DayOfMonth} - self._number_parser = BaseNumberParser( - ItalianNumberParserConfiguration()) - self._date_extractor = BaseDateExtractor( - ItalianDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - ItalianTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - ItalianDurationExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - ItalianDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - ItalianTimePeriodExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - ItalianDateTimeExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - ItalianDateTimePeriodExtractorConfiguration()) - self._duration_parser = BaseDurationParser( - ItalianDurationParserConfiguration(self)) + self._day_of_month = {**BaseDateTime.DayOfMonthDictionary, **ItalianDateTime.DayOfMonth} + self._number_parser = BaseNumberParser(ItalianNumberParserConfiguration()) + self._date_extractor = BaseDateExtractor(ItalianDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(ItalianTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(ItalianDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(ItalianDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(ItalianTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(ItalianDateTimeExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(ItalianDateTimePeriodExtractorConfiguration()) + self._duration_parser = BaseDurationParser(ItalianDurationParserConfiguration(self)) self._date_parser = BaseDateParser(ItalianDateParserConfiguration(self)) - self._time_parser = ItalianTimeParser( - ItalianTimeParserConfiguration(self)) - self._date_period_parser = BaseDatePeriodParser( - ItalianDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - ItalianTimePeriodParserConfiguration(self)) - self._date_time_parser = BaseDateTimeParser( - ItalianDateTimeParserConfiguration(self)) - self._date_time_period_parser = BaseDateTimePeriodParser( - ItalianDateTimePeriodParserConfiguration(self)) + self._time_parser = ItalianTimeParser(ItalianTimeParserConfiguration(self)) + self._date_period_parser = BaseDatePeriodParser(ItalianDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(ItalianTimePeriodParserConfiguration(self)) + self._date_time_parser = BaseDateTimeParser(ItalianDateTimeParserConfiguration(self)) + self._date_time_period_parser = BaseDateTimePeriodParser(ItalianDateTimePeriodParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/date_extractor_config.py index 1855dcfea2..548e4ffdfb 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/date_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/date_extractor_config.py @@ -1,142 +1,49 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict -from recognizers_number import (BaseNumberExtractor, BaseNumberParser, - ItalianOrdinalExtractor, ItalianIntegerExtractor, ItalianNumberParserConfiguration) +from typing import List, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + ItalianIntegerExtractor, + ItalianNumberParserConfiguration, + ItalianOrdinalExtractor, +) from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import DateExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..constants import Constants from ..utilities import DateTimeUtilityConfiguration -from .duration_extractor_config import ItalianDurationExtractorConfiguration from .base_configs import ItalianDateTimeUtilityConfiguration -from ..constants import Constants -from ...resources.base_date_time import BaseDateTime -from ..utilities import DateTimeOptions +from .duration_extractor_config import ItalianDurationExtractorConfiguration class ItalianDateExtractorConfiguration(DateExtractorConfiguration): - @property - def week_day_start(self) -> Pattern: - return self._week_day_start - - @property - def check_both_before_after(self) -> Pattern: - return self._check_both_before_after + def __init__(self): + super().__init__(ItalianDateTime()) + self.ordinal_extractor: BaseNumberExtractor = ItalianOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = ItalianIntegerExtractor() + self.number_parser: BaseNumberParser = BaseNumberParser(ItalianNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(ItalianDurationExtractorConfiguration()) + self.utility_configuration: DateTimeUtilityConfiguration = ItalianDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(ItalianDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.ThisRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.LastDateRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.StrictWeekDay), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecialDate), + ] @property def date_regex_list(self) -> List[Pattern]: - return self._date_regex_list - - @property - def implicit_date_list(self) -> List[Pattern]: - return self._implicit_date_list - - @property - def month_end(self) -> Pattern: - return self._month_end - - @property - def week_day_end(self) -> Pattern: - return self._week_day_end - - @property - def of_month(self) -> Pattern: - return self._of_month - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def for_the_regex(self) -> Pattern: - return self._for_the_regex - - @property - def week_day_and_day_of_month_regex(self) -> Pattern: - return self._week_day_and_day_of_month_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def prefix_article_regex(self) -> Pattern: - return self._prefix_article_regex - - @property - def day_of_week(self) -> Dict[str, int]: - return self._day_of_week - - @property - def month_of_year(self) -> Dict[str, int]: - return self._month_of_year - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def utility_configuration(self) -> DateTimeUtilityConfiguration: - return self._utility_configuration - - @property - def strict_relative_regex(self) -> Pattern: - return self._strict_relative_regex - - @property - def range_connector_symbol_regex(self) -> Pattern: - return self._range_connector_symbol_regex - - @property - def year_suffix(self) -> Pattern: - return self._year_suffix - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_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 since_year_suffix_regex(self) -> Pattern: - return self._since_year_suffix_regex - - @property - def week_day_and_day_regex(self) -> Pattern: - return self._week_day_and_day_regex - - def __init__(self): - self._check_both_before_after = False if ItalianDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: date_extractor_4 = ItalianDateTime.DateExtractor5 date_extractor_5 = ItalianDateTime.DateExtractor4 @@ -148,7 +55,7 @@ def __init__(self): date_extractor_6 = ItalianDateTime.DateExtractor6 date_extractor_7 = ItalianDateTime.DateExtractor7 - self._date_regex_list = [ + return [ RegExpUtility.get_safe_reg_exp(ItalianDateTime.DateExtractor1), RegExpUtility.get_safe_reg_exp(ItalianDateTime.DateExtractor2), RegExpUtility.get_safe_reg_exp(ItalianDateTime.DateExtractor3), @@ -160,74 +67,3 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(ItalianDateTime.DateExtractor9), RegExpUtility.get_safe_reg_exp(ItalianDateTime.DateExtractorA), ] - - self._implicit_date_list = [ - RegExpUtility.get_safe_reg_exp(ItalianDateTime.OnRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelaxedOnRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecialDayRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.ThisRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.LastDateRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextDateRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.StrictWeekDay), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecialDate), - ] - self._month_end = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthEnd) - self._of_month = RegExpUtility.get_safe_reg_exp(ItalianDateTime.OfMonth) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DateUnitRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ForTheRegex) - self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayAndDayOfMonthRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayRegex) - self._day_of_week = ItalianDateTime.DayOfWeek - self._ordinal_extractor = ItalianOrdinalExtractor() - self._integer_extractor = ItalianIntegerExtractor() - self._number_parser = BaseNumberParser( - ItalianNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - ItalianDurationExtractorConfiguration()) - self._utility_configuration = ItalianDateTimeUtilityConfiguration() - self._range_connector_symbol_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.RangeConnectorSymbolRegex - ) - self._strict_relative_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.StrictRelativeRegex - ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.YearSuffix - ) - self._month_of_year = ItalianDateTime.MonthOfYear - self._prefix_article_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PrefixArticleRegex - ) - self._week_day_end = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayEnd - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LessThanRegex - ) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.InConnectorRegex - ) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RangeUnitRegex - ) - self._since_year_suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SinceYearSuffixRegex - ) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayAndDayRegex - ) - self._week_day_start = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayStart - ) - self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/date_parser_config.py index d44224e3a3..73149a9f6c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/date_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/date_parser_config.py @@ -1,17 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict +from typing import Dict, List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_date import DateParserConfiguration from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_date import DateParserConfiguration -from ..base_configs import BaseDateParserConfiguration from .date_extractor_config import ItalianDateExtractorConfiguration @@ -140,12 +142,9 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def date_token_prefix(self) -> str: return self._date_token_prefix - _relative_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeDayRegex) - _next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextPrefixRegex) - _past_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PreviousPrefixRegex) + _relative_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeDayRegex) + _next_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextPrefixRegex) + _past_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PreviousPrefixRegex) def __init__(self, config: BaseDateParserConfiguration): self._ordinal_extractor = config.ordinal_extractor @@ -162,36 +161,23 @@ def __init__(self, config: BaseDateParserConfiguration): self._cardinal_map = config.cardinal_map self._date_regex = (ItalianDateExtractorConfiguration()).date_regex_list self._on_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.OnRegex) - self._special_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecialDayRegex) - self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecialDayWithNumRegex) - self._next_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextDateRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DateUnitRegex) - self._month_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayRegex) - self._strict_week_day = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.StrictWeekDay) - self._last_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LastDateRegex) - self._this_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ThisRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayOfMonthRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ForTheRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextDateRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DateUnitRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayRegex) + self._strict_week_day = RegExpUtility.get_safe_reg_exp(ItalianDateTime.StrictWeekDay) + self._last_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.LastDateRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ThisRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayOfMonthRegex) + self._for_the_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ForTheRegex) self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayAndDayOfMonthRegex) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayAndDayRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeMonthRegex) - self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeWeekDayRegex) + ItalianDateTime.WeekDayAndDayOfMonthRegex + ) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeMonthRegex) + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeWeekDayRegex) self._utility_configuration = config.utility_configuration self._date_token_prefix = ItalianDateTime.DateTokenPrefix self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter @@ -199,8 +185,7 @@ def __init__(self, config: BaseDateParserConfiguration): def get_swift_day(self, source: str) -> int: trimmed_text = source.strip().lower() swift = 0 - matches = regex.search( - ItalianDateParserConfiguration._relative_day_regex, source) + matches = regex.search(ItalianDateParserConfiguration._relative_day_regex, source) if trimmed_text == 'oggi': swift = 0 elif trimmed_text == 'domani': @@ -226,10 +211,8 @@ def get_swift_month(self, source: str) -> int: def get_swift(self, source: str) -> int: trimmed_text = source.strip().lower() swift = 0 - next_prefix_matches = regex.search( - ItalianDateParserConfiguration._next_prefix_regex, trimmed_text) - past_prefix_matches = regex.search( - ItalianDateParserConfiguration._past_prefix_regex, trimmed_text) + next_prefix_matches = regex.search(ItalianDateParserConfiguration._next_prefix_regex, trimmed_text) + past_prefix_matches = regex.search(ItalianDateParserConfiguration._past_prefix_regex, trimmed_text) if next_prefix_matches: swift = 1 elif past_prefix_matches: @@ -239,4 +222,4 @@ def get_swift(self, source: str) -> int: def is_cardinal_last(self, source: str) -> bool: trimmed_text = source.strip().lower() - return not regex.search(ItalianDateParserConfiguration._past_prefix_regex, trimmed_text) is None + return regex.search(ItalianDateParserConfiguration._past_prefix_regex, trimmed_text) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_extractor_config.py index 0730aed278..7c6ce65c09 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_extractor_config.py @@ -1,232 +1,35 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility +from recognizers_number import ItalianCardinalExtractor, ItalianOrdinalExtractor from recognizers_number.number import BaseNumberParser -from recognizers_number.number.italian.extractors import ItalianIntegerExtractor, ItalianCardinalExtractor +from recognizers_number.number.italian.extractors import ItalianCardinalExtractor, ItalianIntegerExtractor from recognizers_number.number.italian.parsers import ItalianNumberParserConfiguration -from ...resources.base_date_time import BaseDateTime +from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import BaseDateExtractor from ..base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex -from .duration_extractor_config import ItalianDurationExtractorConfiguration +from ..base_duration import BaseDurationExtractor from .date_extractor_config import ItalianDateExtractorConfiguration -from recognizers_text.extractor import Extractor -from recognizers_number import ItalianOrdinalExtractor, BaseNumberExtractor, ItalianCardinalExtractor +from .duration_extractor_config import ItalianDurationExtractorConfiguration class ItalianDatePeriodExtractorConfiguration(DatePeriodExtractorConfiguration): - @property - def previous_prefix_regex(self) -> Pattern: - return self._previous_prefix_regex - - @property - def check_both_before_after(self) -> bool: - return self._check_both_before_after - - @property - def simple_cases_regexes(self) -> List[Pattern]: - return self._simple_cases_regexes - - @property - def illegal_year_regex(self) -> Pattern: - return self._illegal_year_regex - - @property - def year_regex(self) -> Pattern: - return self._year_regex - - @property - def till_regex(self) -> Pattern: - return self._till_regex - - @property - def followed_unit(self) -> Pattern: - return self._followed_unit - - @property - def number_combined_with_unit(self) -> Pattern: - return self._number_combined_with_unit - - @property - def past_regex(self) -> Pattern: - return self._past_regex - - @property - def decade_with_century_regex(self) -> Pattern: - return self._decade_with_century_regex - - @property - def future_regex(self) -> Pattern: - return self._future_regex - - @property - def week_of_regex(self) -> Pattern: - return self._week_of_regex - - @property - def month_of_regex(self) -> Pattern: - return self._month_of_regex - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_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 date_point_extractor(self) -> DateTimeExtractor: - return self._date_point_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def now_regex(self) -> Pattern: - return self._now_regex - - @property - def future_suffix_regex(self) -> Pattern: - return self._future_suffix_regex - - @property - def ago_regex(self) -> Pattern: - return self._ago_regex - - @property - def later_regex(self) -> Pattern: - return self._later_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_regex - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def duration_date_restrictions(self) -> [str]: - return self._duration_date_restrictions - - @property - def year_period_regex(self) -> Pattern: - return self._year_period_regex - - @property - def month_num_regex(self) -> Pattern: - return self._month_num_regex - - @property - def century_suffix_regex(self) -> Pattern: - return self._century_suffix_regex - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def cardinal_extractor(self) -> Extractor: - return self._cardinal_extractor - - @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 range_connector_regex(self) -> Pattern: - return self._range_connector_regex - - @property - def day_regex(self) -> Pattern: - return self._day_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def month_suffix_regex(self) -> Pattern: - return self._month_suffix_regex - - @property - def past_prefix_regex(self) -> Pattern: - return self._past_prefix_regex - - @property - def next_prefix_regex(self) -> Pattern: - return self._next_prefix_regex - - @property - def this_prefix_regex(self) -> Pattern: - return self._this_prefix_regex - - @property - def which_week_regex(self) -> Pattern: - return self._which_week_regex - - @property - def rest_of_date_regex(self) -> Pattern: - return self._rest_of_date_regex - - @property - def complex_date_period_regex(self) -> Pattern: - return self._complex_date_period_regex - - @property - def week_day_of_month_regex(self) -> Pattern: - return self._week_day_of_month_regex - - @property - def all_half_year_regex(self) -> Pattern: - return self._all_half_year_regex def __init__(self): - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AllHalfYearRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayOfMonthRegex) - self._complex_date_period_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ComplexDatePeriodRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RestOfDateRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WhichWeekRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ThisPrefixRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextSuffixRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PastSuffixRegex) - self._month_suffix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MonthSuffixRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayRegex) - self._day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DayRegex) - self._range_connector_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RangeConnectorRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeUnitRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PastSuffixRegex) - self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter - self._simple_cases_regexes = [ + super().__init__(ItalianDateTime()) + self.ordinal_extractor = ItalianOrdinalExtractor() + self.cardinal_extractor = ItalianCardinalExtractor() + self.cardinal_extractor = ItalianCardinalExtractor() + self.date_point_extractor = BaseDateExtractor(ItalianDateExtractorConfiguration()) + self.number_parser = BaseNumberParser(ItalianNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(ItalianDurationExtractorConfiguration()) + self.integer_extractor = ItalianIntegerExtractor() + self.from_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.FromRegex) + self.connector_and_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ConnectorAndRegex) + self.simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(ItalianDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(ItalianDateTime.BetweenRegex), RegExpUtility.get_safe_reg_exp(ItalianDateTime.OneWordPeriodRegex), @@ -236,99 +39,17 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(ItalianDateTime.YearPeriodRegex), RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekOfYearRegex), RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthFrontBetweenRegex), - RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthFrontSimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.MonthFrontBetweenRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.MonthFrontSimpleCasesRegex), RegExpUtility.get_safe_reg_exp(ItalianDateTime.QuarterRegex), - RegExpUtility.get_safe_reg_exp( - ItalianDateTime.QuarterRegexYearFront), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.QuarterRegexYearFront), RegExpUtility.get_safe_reg_exp(ItalianDateTime.SeasonRegex), - RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LaterEarlyPeriodRegex), - RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekWithWeekDayRangeRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.LaterEarlyPeriodRegex), + RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekWithWeekDayRangeRegex), RegExpUtility.get_safe_reg_exp(ItalianDateTime.YearPlusNumberRegex), RegExpUtility.get_safe_reg_exp(ItalianDateTime.DecadeWithCenturyRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeDecadeRegex) + RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeDecadeRegex), ] - self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter - self._illegal_year_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.IllegalYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.YearRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TillRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.FollowedDateUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NumberCombinedWithDateUnit) - self._past_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextSuffixRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthOfRegex) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DateUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WithinNextPrefixRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RangeUnitRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.FromRegex) - self.connector_and_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ConnectorAndRegex) - self.before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.BeforeRegex2) - - self._date_point_extractor = BaseDateExtractor( - ItalianDateExtractorConfiguration()) - self._integer_extractor = ItalianIntegerExtractor() - self._number_parser = BaseNumberParser( - ItalianNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - ItalianDurationExtractorConfiguration()) - self._now_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NowRegex) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.FutureSuffixRegex - ) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AgoRegex - ) - self._later_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LaterRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LessThanRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MoreThanRegex - ) - self._duration_date_restrictions = ItalianDateTime.DurationDateRestrictions - self._year_period_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.YearPeriodRegex - ) - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthNumRegex - ) - self._century_suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.CenturySuffixRegex - ) - self._ordinal_extractor = ItalianOrdinalExtractor() - self._cardinal_extractor = ItalianCardinalExtractor() - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PreviousPrefixRegex - ) - self._cardinal_extractor = ItalianCardinalExtractor() - # TODO When the implementation for these properties is added, change the None values to their respective Regexps - self._time_unit_regex = None def get_from_token_index(self, source: str) -> MatchedIndex: match = self.from_regex.search(source) @@ -345,4 +66,4 @@ def get_between_token_index(self, source: str) -> MatchedIndex: return MatchedIndex(False, -1) def has_connector_token(self, source: str) -> bool: - return not self.connector_and_regex.search(source) is None + return self.connector_and_regex.search(source) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_parser_config.py index 52f1cd5692..5a2b37bf36 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration from ..base_dateperiod import DatePeriodParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser class ItalianDatePeriodParserConfiguration(DatePeriodParserConfiguration): @@ -209,8 +210,7 @@ def dynasty_year_map(self) -> Dict[str, int]: return None def __init__(self, config: BaseDateParserConfiguration): - self._relative_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeRegex) self._later_regex = ItalianDateTime.LaterRegex self._ago_regex = ItalianDateTime.AgoRegex self._token_before_date = ItalianDateTime.TokenBeforeDate @@ -221,65 +221,38 @@ def __init__(self, config: BaseDateParserConfiguration): self._duration_parser = config.duration_parser self._date_parser = config.date_parser - self._month_front_between_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthFrontBetweenRegex) - self._between_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.BetweenRegex) + self._month_front_between_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MonthFrontBetweenRegex) + self._between_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.BetweenRegex) self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthFrontSimpleCasesRegex) - self._simple_cases_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SimpleCasesRegex) - self._one_word_period_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.OneWordPeriodRegex) - self._month_with_year = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthWithYear) - self._month_num_with_year = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthNumWithYear) - self._year_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.YearRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextSuffixRegex) - self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NumberCombinedWithDurationUnit) - self._week_of_month_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekOfMonthRegex) - self._week_of_year_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekOfYearRegex) - self._quarter_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.QuarterRegex) - self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.QuarterRegexYearFront) - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AllHalfYearRegex) - self._season_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SeasonRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WhichWeekRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MonthOfRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RestOfDateRegex) - self._later_early_period_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LaterEarlyPeriodRegex) - self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekWithWeekDayRangeRegex) - self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.UnspecificEndOfRangeRegex) - - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextPrefixRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PastPrefixRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ThisPrefixRegex) - self._next_suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextSuffixRegex) - self._past_suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PastSuffixRegex) + ItalianDateTime.MonthFrontSimpleCasesRegex + ) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.OneWordPeriodRegex) + self._month_with_year = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MonthWithYear) + self._month_num_with_year = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MonthNumWithYear) + self._year_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextSuffixRegex) + self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NumberCombinedWithDurationUnit) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekOfYearRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.QuarterRegex) + self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp(ItalianDateTime.QuarterRegexYearFront) + self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AllHalfYearRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SeasonRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WhichWeekRegex) + self._week_of_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekOfRegex) + self._month_of_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MonthOfRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RestOfDateRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.LaterEarlyPeriodRegex) + self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekWithWeekDayRangeRegex) + self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.UnspecificEndOfRangeRegex) + + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextPrefixRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PastPrefixRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ThisPrefixRegex) + self._next_suffix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextSuffixRegex) + self._past_suffix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PastSuffixRegex) self._in_connector_regex = config.utility_configuration.in_connector_regex self._unit_map = config.unit_map @@ -287,22 +260,12 @@ def __init__(self, config: BaseDateParserConfiguration): self._day_of_month = config.day_of_month self._month_of_year = config.month_of_year self._season_map = config.season_map - self._now_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NowRegex) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DecadeWithCenturyRegex) - self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ComplexDatePeriodRegex - ) - self._relative_decade_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeDecadeRegex - ) - self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ReferenceDatePeriodRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LessThanRegex - ) + self._now_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NowRegex) + self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DecadeWithCenturyRegex) + self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ComplexDatePeriodRegex) + self._relative_decade_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeDecadeRegex) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ReferenceDatePeriodRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.LessThanRegex) self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter def get_swift_day_or_month(self, source: str) -> int: @@ -331,9 +294,9 @@ def get_swift_year(self, source: str) -> int: def is_future(self, source: str) -> bool: trimmed_source = source.strip().lower() - return any(trimmed_source.startswith(o) for o in ItalianDateTime.FutureStartTerms) or\ - any(trimmed_source.endswith(o) - for o in ItalianDateTime.FutureEndTerms) + return any(trimmed_source.startswith(o) for o in ItalianDateTime.FutureStartTerms) or any( + trimmed_source.endswith(o) for o in ItalianDateTime.FutureEndTerms + ) def is_year_to_date(self, source: str) -> bool: trimmed_source = source.strip().lower() @@ -345,12 +308,13 @@ def is_month_to_date(self, source: str) -> bool: def is_week_only(self, source: str) -> bool: trimmed_source = source.strip().lower() - return (any(trimmed_source.endswith(o) for o in ItalianDateTime.WeekTerms) or - (any(trimmed_source.__contains__(o) for o in ItalianDateTime.WeekTerms) and - (self._next_suffix_regex.search(trimmed_source) or - self._past_suffix_regex.search(trimmed_source)))) and not\ - any(trimmed_source.endswith(o) - for o in ItalianDateTime.WeekendTerms) + return ( + any(trimmed_source.endswith(o) for o in ItalianDateTime.WeekTerms) + or ( + any(trimmed_source.__contains__(o) for o in ItalianDateTime.WeekTerms) + and (self._next_suffix_regex.search(trimmed_source) or self._past_suffix_regex.search(trimmed_source)) + ) + ) and not any(trimmed_source.endswith(o) for o in ItalianDateTime.WeekendTerms) def is_weekend(self, source: str) -> bool: trimmed_source = source.strip().lower() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetime_extractor_config.py index 30767bffcf..023201c1e1 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetime_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetime_extractor_config.py @@ -2,19 +2,21 @@ # Licensed under the MIT License. from typing import Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_datetime import DateTimeExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor +from ..extractors import DateTimeExtractor from .base_configs import ItalianDateTimeUtilityConfiguration from .date_extractor_config import ItalianDateExtractorConfiguration -from .time_extractor_config import ItalianTimeExtractorConfiguration from .duration_extractor_config import ItalianDurationExtractorConfiguration +from .time_extractor_config import ItalianTimeExtractorConfiguration class ItalianDateTimeExtractorConfiguration(DateTimeExtractorConfiguration): @@ -105,57 +107,39 @@ def year_regex(self) -> Pattern: def __init__(self): super().__init__() - self.preposition_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PrepositionRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NowRegex) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SuffixRegex) - - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeOfDayRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecificTimeOfDayRegex) - self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeOfTodayAfterRegex) - self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeOfTodayBeforeRegex) + self.preposition_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NowRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SuffixRegex) + + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeOfDayRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecificTimeOfDayRegex) + self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeOfTodayAfterRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeOfTodayBeforeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SimpleTimeOfTodayAfterRegex) - self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeUnitRegex) - self.connector_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ConnectorRegex) - self._night_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NightRegex) - self._number_as_time_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NumberAsTimeRegex) - self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DateNumberConnectorRegex - ) - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SuffixAfterRegex + ItalianDateTime.SimpleTimeOfTodayAfterRegex ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.YearSuffix - ) - self._year_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.YearRegex + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + ItalianDateTime.SimpleTimeOfTodayBeforeRegex ) - - self._date_point_extractor = BaseDateExtractor( - ItalianDateExtractorConfiguration()) - self._time_point_extractor = BaseTimeExtractor( - ItalianTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - ItalianDurationExtractorConfiguration()) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeUnitRegex) + self.connector_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ConnectorRegex) + self._night_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NightRegex) + self._number_as_time_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NumberAsTimeRegex) + self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DateNumberConnectorRegex) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SuffixAfterRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(ItalianDateTime.YearSuffix) + self._year_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.YearRegex) + + self._date_point_extractor = BaseDateExtractor(ItalianDateExtractorConfiguration()) + self._time_point_extractor = BaseTimeExtractor(ItalianTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(ItalianDurationExtractorConfiguration()) self._utility_configuration = ItalianDateTimeUtilityConfiguration() def is_connector_token(self, source: str) -> bool: - return source.strip() == '' or regex.search(self.connector_regex, source) is not None or regex.search(self.preposition_regex, source) is not None + return ( + source.strip() == '' + or regex.search(self.connector_regex, source) is not None + or regex.search(self.preposition_regex, source) is not None + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetime_parser_config.py index ea80551fc2..62cc31eaa3 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetime_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetime_parser_config.py @@ -1,17 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_datetime import DateTimeParserConfiguration, MatchedTimex from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_configs import BaseDateParserConfiguration -from ..base_datetime import DateTimeParserConfiguration, MatchedTimex class ItalianDateTimeParserConfiguration(DateTimeParserConfiguration): @@ -106,29 +107,22 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self, config: BaseDateParserConfiguration): self._token_before_date = ItalianDateTime.TokenBeforeDate self._token_before_time = ItalianDateTime.TokenBeforeTime - self._now_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NowRegex) - self._am_time_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AMTimeRegex) - self._pm_time_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PMTimeRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NowRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AMTimeRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PMTimeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SimpleTimeOfTodayAfterRegex) + ItalianDateTime.SimpleTimeOfTodayAfterRegex + ) self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecificTimeOfDayRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeUnitRegex) - - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextPrefixRegex) - self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PreviousPrefixRegex) + ItalianDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecificTimeOfDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeUnitRegex) + + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PreviousPrefixRegex) self._date_extractor = config.date_extractor self._time_extractor = config.time_extractor @@ -151,10 +145,7 @@ def get_matched_now_timex(self, source: str) -> MatchedTimex: if source.endswith('ora') or source.endswith('adesso') or source.endswith('in questo momento'): timex = 'PRESENT_REF' - elif ( - source == 'recentemente' or - source == 'precedentemente' - ): + elif source == 'recentemente' or source == 'precedentemente': timex = 'PAST_REF' elif source == 'il prima possibile' or source == 'asap': timex = 'FUTURE_REF' diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetimeperiod_extractor_config.py index 6cffd7216c..0f41a50da6 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetimeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetimeperiod_extractor_config.py @@ -5,21 +5,20 @@ from recognizers_number import BaseNumberExtractor, ItalianCardinalExtractor from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import ItalianDateExtractorConfiguration -from .time_extractor_config import ItalianTimeExtractorConfiguration +from .datetime_extractor_config import ItalianDateTimeExtractorConfiguration from .duration_extractor_config import ItalianDurationExtractorConfiguration +from .time_extractor_config import ItalianTimeExtractorConfiguration from .timeperiod_extractor_config import ItalianTimePeriodExtractorConfiguration -from .timezone_extractor_config import ItalianTimeZoneExtractorConfiguration -from .datetime_extractor_config import ItalianDateTimeExtractorConfiguration class ItalianDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): @@ -55,10 +54,6 @@ def duration_extractor(self) -> DateTimeExtractor: def time_period_extractor(self) -> DateTimeExtractor: return self._time_period_extractor - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - @property def simple_cases_regexes(self) -> List[Pattern]: return self._simple_cases_regexes @@ -165,91 +160,48 @@ def __init__(self): self._simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(ItalianDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(ItalianDateTime.PureNumBetweenAnd), - RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecificTimeOfDayRegex) + RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecificTimeOfDayRegex), ] - self._preposition_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PrepositionRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TillRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PeriodSpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PeriodTimeOfDayRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeFollowedUnit) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeUnitRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PastSuffixRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextSuffixRegex) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeNumberCombinedWithUnit) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WeekDayRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PeriodSpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PeriodTimeOfDayRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeFollowedUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeUnitRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PastSuffixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextSuffixRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeNumberCombinedWithUnit) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WeekDayRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PeriodTimeOfDayWithDateRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RestOfDateTimeRegex) - self._general_ending_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.GeneralEndingRegex) - self._middle_pause_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MiddlePauseRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.FromRegex2) - self.connector_and_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ConnectorAndRegex) + ItalianDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RestOfDateTimeRegex) + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.GeneralEndingRegex) + self._middle_pause_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MiddlePauseRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.FromRegex2) + self.connector_and_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ConnectorAndRegex) self._cardinal_extractor = ItalianCardinalExtractor() - self._single_date_extractor = BaseDateExtractor( - ItalianDateExtractorConfiguration()) - self._single_time_extractor = BaseTimeExtractor( - ItalianTimeExtractorConfiguration()) - self._single_date_time_extractor = BaseDateTimeExtractor( - ItalianDateTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - ItalianDurationExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - ItalianTimePeriodExtractorConfiguration()) - self._time_zone_extractor = BaseTimeZoneExtractor( - ItalianTimeZoneExtractorConfiguration()) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.WithinNextPrefixRegex - ) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeUnitRegex - ) + self._single_date_extractor = BaseDateExtractor(ItalianDateExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(ItalianTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseDateTimeExtractor(ItalianDateTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(ItalianDurationExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(ItalianTimePeriodExtractorConfiguration()) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.WithinNextPrefixRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeUnitRegex) self._token_before_date = ItalianDateTime.TokenBeforeDate - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.FutureSuffixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DateUnitRegex - ) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AmDescRegex - ) - self._pm_desc_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PmDescRegex - ) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PrefixDayRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.BeforeRegex - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AfterRegex - ) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SuffixRegex - ) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.FutureSuffixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DateUnitRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PmDescRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AfterRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SuffixRegex) self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter def get_from_token_index(self, source: str) -> MatchedIndex: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetimeperiod_parser_config.py index 3f54b7717e..383cafa39c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetimeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/datetimeperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern + from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime +from ..base_configs import BaseDateParserConfiguration from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_configs import BaseDateParserConfiguration -from ..base_timezone import BaseTimeZoneParser class ItalianDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): @@ -48,49 +49,31 @@ def __init__(self, config: BaseDateParserConfiguration): self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter self._token_before_date = ItalianDateTime.TokenBeforeDate self._token_before_time = ItalianDateTime.TokenBeforeTime - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PrefixDayRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AfterRegex) - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextSuffixRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PastSuffixRegex) - self.this_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ThisPrefixRegex) - self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MorningStartEndRegex) - self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AfternoonStartEndRegex) - self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.EveningStartEndRegex) - self.night_start_end_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NightStartEndRegex) - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PureNumBetweenAnd) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeOfDayRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PastSuffixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextSuffixRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AfterRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextSuffixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PastSuffixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ThisPrefixRegex) + self.morning_start_end_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MorningStartEndRegex) + self.afternoon_start_end_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AfternoonStartEndRegex) + self.evening_start_end_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.EveningStartEndRegex) + self.night_start_end_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NightStartEndRegex) + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PureNumBetweenAnd) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PastSuffixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextSuffixRegex) self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeNumberCombinedWithUnit) - self.unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeUnitRegex) + ItalianDateTime.TimeNumberCombinedWithUnit + ) + self.unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeUnitRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PeriodTimeOfDayWithDateRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RestOfDateTimeRegex) - self._time_zone_parser = config.time_zone_parser + ItalianDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.RestOfDateTimeRegex) @property def previous_prefix_regex(self): @@ -212,10 +195,6 @@ def time_period_parser(self) -> DateTimeParser: def duration_parser(self) -> DateTimeParser: return self._duration_parser - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def get_matched_time_range(self, source: str) -> MatchedTimeRange: trimmed_source = source.strip().lower() begin_hour = 0 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/duration_extractor_config.py index 2f29cbccd4..f576f181b8 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/duration_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/duration_extractor_config.py @@ -3,9 +3,10 @@ from typing import Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.italian.extractors import ItalianCardinalExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime from ..base_duration import DurationExtractorConfiguration @@ -101,43 +102,29 @@ def __init__(self): self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter self._inexact_number_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.InexactNumberRegex) self._conjunction_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ConjunctionRegex) - self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AllRegex) - self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.HalfRegex) - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DurationFollowedUnit) + self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AllRegex) + self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.HalfRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DurationFollowedUnit) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NumberCombinedWithDurationUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AnUnitRegex) + ItalianDateTime.NumberCombinedWithDurationUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AnUnitRegex) self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.InexactNumberUnitRegex) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SuffixAndRegex) + ItalianDateTime.InexactNumberUnitRegex + ) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SuffixAndRegex) self._relative_duration_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.RelativeDurationUnitRegex) - self._more_than_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MoreThanRegex) - self._less_than_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LessThanOneHour) - self._cardinal_extractor: BaseNumberExtractor = ItalianCardinalExtractor() - self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DuringRegex + ItalianDateTime.RelativeDurationUnitRegex ) + self._more_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MoreThanRegex) + self._less_than_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.LessThanOneHour) + self._cardinal_extractor: BaseNumberExtractor = ItalianCardinalExtractor() + self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DuringRegex) self._unit_map = ItalianDateTime.UnitMap self._unit_value_map = ItalianDateTime.UnitValueMap - self._duration_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DurationUnitRegex - ) - self._duration_connector_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DurationConnectorRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LessThanRegex - ) + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DurationUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DurationConnectorRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.MoreThanRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.LessThanRegex) self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter self._special_number_unit_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/duration_parser_config.py index aa8015de26..64f60d9a45 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/duration_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/duration_parser_config.py @@ -1,15 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser -from ...resources.italian_date_time import ItalianDateTime +from recognizers_text.utilities import RegExpUtility +from ...resources.italian_date_time import ItalianDateTime +from ..base_duration import BaseDurationExtractor, DurationParserConfiguration from ..extractors import DateTimeExtractor -from ..base_duration import DurationParserConfiguration, BaseDurationExtractor from .duration_extractor_config import ItalianDurationExtractorConfiguration @@ -66,24 +66,16 @@ def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor def __init__(self, config): - self.duration_extractor = BaseDurationExtractor( - ItalianDurationExtractorConfiguration(), False) + self.duration_extractor = BaseDurationExtractor(ItalianDurationExtractorConfiguration(), False) self._cardinal_extractor = config.cardinal_extractor self._number_parser = config.number_parser - self._followed_unit = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.DurationFollowedUnit) - self._suffix_and_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SuffixAndRegex) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NumberCombinedWithDurationUnit) - self._an_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AnUnitRegex) - self._all_date_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AllRegex) - self._half_date_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.HalfRegex) - self._inexact_number_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.InexactNumberUnitRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(ItalianDateTime.DurationFollowedUnit) + self._suffix_and_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SuffixAndRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NumberCombinedWithDurationUnit) + self._an_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AnUnitRegex) + self._all_date_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AllRegex) + self._half_date_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.HalfRegex) + self._inexact_number_unit_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.InexactNumberUnitRegex) self._unit_map = config.unit_map self._unit_value_map = config.unit_value_map self._double_numbers = config.double_numbers diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/holiday_extractor_config.py index d9ecda4194..264da24e62 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/holiday_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/holiday_extractor_config.py @@ -2,10 +2,11 @@ # Licensed under the MIT License. from typing import List, Pattern + from recognizers_text.utilities import RegExpUtility -from ..base_holiday import HolidayExtractorConfiguration from ...resources.italian_date_time import ItalianDateTime +from ..base_holiday import HolidayExtractorConfiguration class ItalianHolidayExtractorConfiguration(HolidayExtractorConfiguration): @@ -22,5 +23,5 @@ def __init__(self): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(ItalianDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(ItalianDateTime.HolidayRegex2), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.HolidayRegex3) + RegExpUtility.get_safe_reg_exp(ItalianDateTime.HolidayRegex3), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/holiday_parser_config.py index 417a09361a..f5ca786630 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/holiday_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/holiday_parser_config.py @@ -1,13 +1,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Callable from datetime import datetime +from typing import Callable, Dict, List from recognizers_text.utilities import RegExpUtility -from ..utilities import DateUtils -from ..base_holiday import BaseHolidayParserConfiguration + from ...resources.italian_date_time import ItalianDateTime +from ..base_holiday import BaseHolidayParserConfiguration +from ..utilities import DateUtils class ItalianHolidayParserConfiguration(BaseHolidayParserConfiguration): @@ -28,62 +29,61 @@ def __init__(self, config): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(ItalianDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(ItalianDateTime.HolidayRegex2), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.HolidayRegex3) + RegExpUtility.get_safe_reg_exp(ItalianDateTime.HolidayRegex3), ] self._holiday_names = ItalianDateTime.HolidayNames - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NextPrefixRegex) - self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PreviousPrefixRegex) - self.this_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ThisPrefixRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PreviousPrefixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ThisPrefixRegex) def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: - local = dict([ - ("maosbirthday", ItalianHolidayParserConfiguration.mao_birthday), - ("teachersday", ItalianHolidayParserConfiguration.teacher_day), - ("singleday", ItalianHolidayParserConfiguration.singles_day), - ("allsaintsday", ItalianHolidayParserConfiguration.halloween_day), - ("youthday", ItalianHolidayParserConfiguration.youth_day), - ("childrenday", ItalianHolidayParserConfiguration.children_day), - ("femaleday", ItalianHolidayParserConfiguration.female_day), - ("treeplantingday", ItalianHolidayParserConfiguration.tree_plant_day), - ("arborday", ItalianHolidayParserConfiguration.tree_plant_day), - ("girlsday", ItalianHolidayParserConfiguration.girls_day), - ("whiteloverday", ItalianHolidayParserConfiguration.white_lover_day), - ("loverday", ItalianHolidayParserConfiguration.valentines_day), - ("christmas", ItalianHolidayParserConfiguration.christmas_day), - ("xmas", ItalianHolidayParserConfiguration.children_day), - ("newyear", ItalianHolidayParserConfiguration.new_year), - ("newyearday", ItalianHolidayParserConfiguration.new_year), - ("newyearsday", ItalianHolidayParserConfiguration.new_year), - ("groundhougday", ItalianHolidayParserConfiguration.groundhog_day), - ("valentinesday", ItalianHolidayParserConfiguration.valentines_day), - ("stpatrickday", ItalianHolidayParserConfiguration.st_patrick_day), - ("aprilfools", ItalianHolidayParserConfiguration.fool_day), - ("stgeorgeday", ItalianHolidayParserConfiguration.st_george_day), - ("mayday", ItalianHolidayParserConfiguration.mayday), - ("cincodemayoday", ItalianHolidayParserConfiguration.cinco_de_mayo_day), - ("baptisteday", ItalianHolidayParserConfiguration.baptiste_day), - ("usindependenceday", ItalianHolidayParserConfiguration.usa_independence_day), - ("independenceday", ItalianHolidayParserConfiguration.usa_independence_day), - ("bastilleday", ItalianHolidayParserConfiguration.bastille_day), - ("halloweenday", ItalianHolidayParserConfiguration.halloween_day), - ("allhallowday", ItalianHolidayParserConfiguration.all_hallow_day), - ("allsoulsday", ItalianHolidayParserConfiguration.all_souls_day), - ("guyfawkesday", ItalianHolidayParserConfiguration.guyfawkes_day), - ("veteransday", ItalianHolidayParserConfiguration.veterans_day), - ("christmaseve", ItalianHolidayParserConfiguration.christmas_eve), - ("newyeareve", ItalianHolidayParserConfiguration.new_year_eve), - ("fathersday", ItalianHolidayParserConfiguration.fathers_day), - ("mothersday", ItalianHolidayParserConfiguration.mothers_day), - ("labourday", ItalianHolidayParserConfiguration.international_workers_day), - ("memorialday", ItalianHolidayParserConfiguration.memorial_day), - ("easterday", ItalianHolidayParserConfiguration.easter_day), - ("eastermonday", ItalianHolidayParserConfiguration.easter_day), - ("mardigras", ItalianHolidayParserConfiguration.easter_day), - ]) + local = dict( + [ + ("maosbirthday", ItalianHolidayParserConfiguration.mao_birthday), + ("teachersday", ItalianHolidayParserConfiguration.teacher_day), + ("singleday", ItalianHolidayParserConfiguration.singles_day), + ("allsaintsday", ItalianHolidayParserConfiguration.halloween_day), + ("youthday", ItalianHolidayParserConfiguration.youth_day), + ("childrenday", ItalianHolidayParserConfiguration.children_day), + ("femaleday", ItalianHolidayParserConfiguration.female_day), + ("treeplantingday", ItalianHolidayParserConfiguration.tree_plant_day), + ("arborday", ItalianHolidayParserConfiguration.tree_plant_day), + ("girlsday", ItalianHolidayParserConfiguration.girls_day), + ("whiteloverday", ItalianHolidayParserConfiguration.white_lover_day), + ("loverday", ItalianHolidayParserConfiguration.valentines_day), + ("christmas", ItalianHolidayParserConfiguration.christmas_day), + ("xmas", ItalianHolidayParserConfiguration.children_day), + ("newyear", ItalianHolidayParserConfiguration.new_year), + ("newyearday", ItalianHolidayParserConfiguration.new_year), + ("newyearsday", ItalianHolidayParserConfiguration.new_year), + ("groundhougday", ItalianHolidayParserConfiguration.groundhog_day), + ("valentinesday", ItalianHolidayParserConfiguration.valentines_day), + ("stpatrickday", ItalianHolidayParserConfiguration.st_patrick_day), + ("aprilfools", ItalianHolidayParserConfiguration.fool_day), + ("stgeorgeday", ItalianHolidayParserConfiguration.st_george_day), + ("mayday", ItalianHolidayParserConfiguration.mayday), + ("cincodemayoday", ItalianHolidayParserConfiguration.cinco_de_mayo_day), + ("baptisteday", ItalianHolidayParserConfiguration.baptiste_day), + ("usindependenceday", ItalianHolidayParserConfiguration.usa_independence_day), + ("independenceday", ItalianHolidayParserConfiguration.usa_independence_day), + ("bastilleday", ItalianHolidayParserConfiguration.bastille_day), + ("halloweenday", ItalianHolidayParserConfiguration.halloween_day), + ("allhallowday", ItalianHolidayParserConfiguration.all_hallow_day), + ("allsoulsday", ItalianHolidayParserConfiguration.all_souls_day), + ("guyfawkesday", ItalianHolidayParserConfiguration.guyfawkes_day), + ("veteransday", ItalianHolidayParserConfiguration.veterans_day), + ("christmaseve", ItalianHolidayParserConfiguration.christmas_eve), + ("newyeareve", ItalianHolidayParserConfiguration.new_year_eve), + ("fathersday", ItalianHolidayParserConfiguration.fathers_day), + ("mothersday", ItalianHolidayParserConfiguration.mothers_day), + ("labourday", ItalianHolidayParserConfiguration.international_workers_day), + ("memorialday", ItalianHolidayParserConfiguration.memorial_day), + ("easterday", ItalianHolidayParserConfiguration.easter_day), + ("eastermonday", ItalianHolidayParserConfiguration.easter_day), + ("mardigras", ItalianHolidayParserConfiguration.easter_day), + ] + ) return {**super()._init_holiday_funcs(), **local} diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/merged_extractor_config.py index 38fe4b3773..6596caeac2 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/merged_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/merged_extractor_config.py @@ -3,31 +3,30 @@ from typing import List, Pattern -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility, DefinitionLoader from recognizers_number import ItalianIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + +from ...resources.base_date_time import BaseDateTime from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..base_merged import MergedExtractorConfiguration from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor from ..base_datetime import BaseDateTimeExtractor from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from ..base_set import BaseSetExtractor +from ..base_duration import BaseDurationExtractor from ..base_holiday import BaseHolidayExtractor +from ..base_merged import MergedExtractorConfiguration +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import ItalianDateExtractorConfiguration -from .time_extractor_config import ItalianTimeExtractorConfiguration -from .duration_extractor_config import ItalianDurationExtractorConfiguration from .dateperiod_extractor_config import ItalianDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import ItalianTimePeriodExtractorConfiguration from .datetime_extractor_config import ItalianDateTimeExtractorConfiguration from .datetimeperiod_extractor_config import ItalianDateTimePeriodExtractorConfiguration -from .set_extractor_config import ItalianSetExtractorConfiguration +from .duration_extractor_config import ItalianDurationExtractorConfiguration from .holiday_extractor_config import ItalianHolidayExtractorConfiguration -from ...resources.base_date_time import BaseDateTime +from .time_extractor_config import ItalianTimeExtractorConfiguration +from .timeperiod_extractor_config import ItalianTimePeriodExtractorConfiguration class ItalianMergedExtractorConfiguration(MergedExtractorConfiguration): @@ -35,10 +34,6 @@ class ItalianMergedExtractorConfiguration(MergedExtractorConfiguration): def check_both_before_after(self): return self._check_both_before_after - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def datetime_alt_extractor(self): return self._datetime_alt_extractor @@ -91,10 +86,6 @@ def holiday_extractor(self) -> DateTimeExtractor: def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor - @property - def set_extractor(self) -> DateTimeExtractor: - return self._set_extractor - @property def integer_extractor(self) -> Extractor: return self._integer_extractor @@ -156,56 +147,35 @@ def ambiguity_filters_dict(self) -> Pattern: return self._ambiguity_filters_dict def __init__(self): - self._before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SinceRegex) - self._from_to_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.FromToRegex) - self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SingleAmbiguousMonthRegex) - self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PrepositionSuffixRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SinceRegex) + self._from_to_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.FromToRegex) + self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SingleAmbiguousMonthRegex) + self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PrepositionSuffixRegex) self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AmbiguousRangeModifierPrefix) - self._number_ending_pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NumberEndingPattern) - - self._date_extractor = BaseDateExtractor( - ItalianDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - ItalianTimeExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - ItalianDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - ItalianDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - ItalianTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - ItalianDateTimePeriodExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - ItalianDurationExtractorConfiguration()) - self._set_extractor = BaseSetExtractor( - ItalianSetExtractorConfiguration()) - self._holiday_extractor = BaseHolidayExtractor( - ItalianHolidayExtractorConfiguration()) + ItalianDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NumberEndingPattern) + + self._date_extractor = BaseDateExtractor(ItalianDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(ItalianTimeExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(ItalianDateTimeExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(ItalianDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(ItalianTimePeriodExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(ItalianDateTimePeriodExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(ItalianDurationExtractorConfiguration()) + self._holiday_extractor = BaseHolidayExtractor(ItalianHolidayExtractorConfiguration()) self._integer_extractor = ItalianIntegerExtractor() self._filter_word_regex_list = [] - self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.UnspecificDatePeriodRegex - ) + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.UnspecificDatePeriodRegex) self._around_regex = ItalianDateTime.AroundRegex self._equal_regex = BaseDateTime.EqualRegex - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SuffixAfterRegex - ) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SuffixAfterRegex) self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._superfluous_word_matcher = None self._fail_fast_regex = None self._term_filter_regexes = None self._datetime_alt_extractor = None - self._time_zone_extractor = None self._ambiguity_filters_dict = DefinitionLoader.load_ambiguity_filters(ItalianDateTime.AmbiguityFiltersDict) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/merged_parser_config.py index 17b850bd5c..c0b08e62c4 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/merged_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/merged_parser_config.py @@ -5,22 +5,20 @@ from recognizers_text.utilities import RegExpUtility -from .holiday_parser_config import ItalianHolidayParserConfiguration -from .set_parser_config import ItalianSetParserConfiguration -from .dateperiod_parser_config import ItalianDatePeriodParserConfiguration -from .timeperiod_parser_config import ItalianTimePeriodParserConfiguration -from .common_configs import ItalianCommonDateTimeParserConfiguration +from ...resources.italian_date_time import BaseDateTime, ItalianDateTime from ..base_date import BaseDateParser -from ..base_time import BaseTimeParser -from ..base_datetime import BaseDateTimeParser -from ..base_holiday import BaseHolidayParser from ..base_dateperiod import BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodParser +from ..base_datetime import BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodParser from ..base_duration import BaseDurationParser -from ..base_set import BaseSetParser +from ..base_holiday import BaseHolidayParser from ..base_merged import MergedParserConfiguration -from ...resources.italian_date_time import ItalianDateTime, BaseDateTime +from ..base_time import BaseTimeParser +from ..base_timeperiod import BaseTimePeriodParser +from .common_configs import ItalianCommonDateTimeParserConfiguration +from .dateperiod_parser_config import ItalianDatePeriodParserConfiguration +from .holiday_parser_config import ItalianHolidayParserConfiguration +from .timeperiod_parser_config import ItalianTimePeriodParserConfiguration class ItalianMergedParserConfiguration(ItalianCommonDateTimeParserConfiguration, MergedParserConfiguration): @@ -84,28 +82,16 @@ def date_time_period_parser(self) -> BaseDateTimePeriodParser: def duration_parser(self) -> BaseDurationParser: return self._duration_parser - @property - def set_parser(self) -> BaseSetParser: - return self._set_parser - def __init__(self, config): ItalianCommonDateTimeParserConfiguration.__init__(self) - self._suffix_after = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SuffixAfterRegex) + self._suffix_after = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SuffixAfterRegex) self._year_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.YearRegex) self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) self._around_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AroundRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SinceRegex) - - self._date_period_parser = BaseDatePeriodParser( - ItalianDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - ItalianTimePeriodParserConfiguration(self)) - self._set_parser = BaseSetParser(ItalianSetParserConfiguration(config)) - self._holiday_parser = BaseHolidayParser( - ItalianHolidayParserConfiguration(config)) + self._before_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SinceRegex) + + self._date_period_parser = BaseDatePeriodParser(ItalianDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(ItalianTimePeriodParserConfiguration(self)) + self._holiday_parser = BaseHolidayParser(ItalianHolidayParserConfiguration(config)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/parsers.py index c70095382f..af2075c292 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/parsers.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/parsers.py @@ -4,9 +4,10 @@ from datetime import datetime from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime from ..base_time import BaseTimeParser -from ..utilities import DateTimeResolutionResult, DateTimeFormatUtil, DateUtils +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils class ItalianTimeParser(BaseTimeParser): @@ -21,8 +22,7 @@ def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResul result = DateTimeResolutionResult() trimmed_source = source.strip().lower() - match = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.IshRegex).match(source) + match = RegExpUtility.get_safe_reg_exp(ItalianDateTime.IshRegex).match(source) if match and match.end() == len(trimmed_source): hour_str = RegExpUtility.get_group(match, 'hour') hour = 12 @@ -31,7 +31,8 @@ def parse_ish(self, source: str, reference: datetime) -> DateTimeResolutionResul result.timex = 'T' + DateTimeFormatUtil.to_str(hour, 2) result.future_value = result.past_value = DateUtils.safe_create_from_min_value( - reference.year, reference.month, reference.day, hour, 0, 0) + reference.year, reference.month, reference.day, hour, 0, 0 + ) result.success = True return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/set_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/set_extractor_config.py deleted file mode 100644 index c7db7423ec..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/set_extractor_config.py +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern - -from recognizers_text.utilities import RegExpUtility -from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..base_set import SetExtractorConfiguration -from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor -from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from .date_extractor_config import ItalianDateExtractorConfiguration -from .time_extractor_config import ItalianTimeExtractorConfiguration -from .duration_extractor_config import ItalianDurationExtractorConfiguration -from .dateperiod_extractor_config import ItalianDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import ItalianTimePeriodExtractorConfiguration -from .datetime_extractor_config import ItalianDateTimeExtractorConfiguration -from .datetimeperiod_extractor_config import ItalianDateTimePeriodExtractorConfiguration - - -class ItalianSetExtractorConfiguration(SetExtractorConfiguration): - @property - def last_regex(self) -> Pattern: - return self._last_regex - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def before_each_day_regex(self) -> Pattern: - return self._before_each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - def __init__(self): - self._last_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SetLastRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.EachUnitRegex) - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.EachPrefixRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.EachDayRegex) - self._before_each_day_regex = None - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SetEachRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SetWeekDayRegex) - - self._duration_extractor = BaseDurationExtractor( - ItalianDurationExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - ItalianTimeExtractorConfiguration()) - self._date_extractor = BaseDateExtractor( - ItalianDateExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - ItalianDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - ItalianDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - ItalianTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - ItalianDateTimePeriodExtractorConfiguration()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/set_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/set_parser_config.py deleted file mode 100644 index 6c909b4cac..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/set_parser_config.py +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern, Dict - -from recognizers_text.utilities import RegExpUtility -from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser -from ..base_set import SetParserConfiguration, MatchedTimex -from ..base_configs import BaseDateParserConfiguration - - -class ItalianSetParserConfiguration(SetParserConfiguration): - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def duration_parser(self) -> DateTimeParser: - return self._duration_parser - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def time_parser(self) -> DateTimeParser: - return self._time_parser - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_parser(self) -> DateTimeParser: - return self._date_parser - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_time_parser(self) -> DateTimeParser: - return self._date_time_parser - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def date_period_parser(self) -> DateTimeParser: - return self._date_period_parser - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def time_period_parser(self) -> DateTimeParser: - return self._time_period_parser - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def date_time_period_parser(self) -> DateTimeParser: - return self._date_time_period_parser - - @property - def unit_map(self) -> Dict[str, str]: - return self._unit_map - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - def __init__(self, config: BaseDateParserConfiguration): - self._duration_extractor = config.duration_extractor - self._time_extractor = config.time_extractor - self._date_extractor = config.date_extractor - self._date_time_extractor = config.date_time_extractor - self._date_period_extractor = config.date_period_extractor - self._time_period_extractor = config.time_period_extractor - self._date_time_period_extractor = config.date_time_period_extractor - self._duration_parser = config.duration_parser - self._time_parser = config.time_parser - self._date_parser = config.date_parser - self._date_time_parser = config.date_time_parser - self._date_period_parser = config.date_period_parser - self._time_period_parser = config.time_period_parser - self._date_time_period_parser = config.date_time_period_parser - self._unit_map = ItalianDateTime.UnitMap - - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.EachPrefixRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.EachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.EachDayRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SetWeekDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SetEachRegex) - - def get_matched_daily_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - timex = '' - - if ( - trimmed_text == 'quotidianamente' or - trimmed_text == 'quotidiano' or - trimmed_text == 'quotidiana' or - trimmed_text == 'giornalmente' or - trimmed_text == 'giornaliero' or - trimmed_text == 'giornaliera' - ): - timex = 'P1D' - elif trimmed_text == 'settimanale' or trimmed_text == 'settimanalmente': - timex = 'P1W' - elif trimmed_text == 'bisettimanale': - timex = 'P2W' - elif trimmed_text == 'mensile' or trimmed_text == 'mensilmente': - timex = 'P1M' - elif trimmed_text == 'annuale' or trimmed_text == 'annualmente': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) - - def get_matched_unit_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - timex = '' - - if trimmed_text == 'giorno' or trimmed_text == 'giornata' or trimmed_text == 'giorni': - timex = 'P1D' - elif trimmed_text == 'settimana' or trimmed_text == 'settimane': - timex = 'P1W' - elif trimmed_text == 'mese' or trimmed_text == 'mesi': - timex = 'P1M' - elif trimmed_text == 'anno' or trimmed_text == 'annata' or trimmed_text == 'anni': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/time_extractor_config.py index 9eedb82345..68bd244372 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/time_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/time_extractor_config.py @@ -4,18 +4,13 @@ from typing import List, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime from ..base_time import TimeExtractorConfiguration from ..utilities import DateTimeOptions -from ..base_timezone import BaseTimeZoneExtractor -from .timezone_extractor_config import ItalianTimeZoneExtractorConfiguration class ItalianTimeExtractorConfiguration(TimeExtractorConfiguration): - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def time_regex_list(self) -> List[Pattern]: return self._time_regex_list @@ -34,17 +29,11 @@ def time_before_after_regex(self) -> Pattern: def __init__(self): super().__init__() - self._time_regex_list: List[Pattern] = ItalianTimeExtractorConfiguration.get_time_regex_list( - ) - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AtRegex) - self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.IshRegex) - self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeBeforeAfterRegex) + self._time_regex_list: List[Pattern] = ItalianTimeExtractorConfiguration.get_time_regex_list() + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AtRegex) + self._ish_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.IshRegex) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeBeforeAfterRegex) self._options = DateTimeOptions.NONE - self._time_zone_extractor = BaseTimeZoneExtractor( - ItalianTimeZoneExtractorConfiguration()) @staticmethod def get_time_regex_list() -> List[Pattern]: @@ -59,5 +48,5 @@ def get_time_regex_list() -> List[Pattern]: RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeRegex8), RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeRegex9), RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeRegex10), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.ConnectNumRegex) + RegExpUtility.get_safe_reg_exp(ItalianDateTime.ConnectNumRegex), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/time_parser_config.py index b5d735b54b..ee972e780b 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/time_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/time_parser_config.py @@ -1,15 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern, Dict +from typing import Dict, List, Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime -from ..base_time import TimeParserConfiguration, AdjustParams from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_time import AdjustParams, TimeParserConfiguration from .time_extractor_config import ItalianTimeExtractorConfiguration -from ..parsers import DateTimeParser class ItalianTimeParserConfiguration(TimeParserConfiguration): @@ -33,26 +34,16 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_token_prefix: str = ItalianDateTime.TimeTokenPrefix - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.AtRegex) - self._time_regexes: List[Pattern] = ItalianTimeExtractorConfiguration.get_time_regex_list( - ) - self.less_than_one_hour = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.LessThanOneHour) - self.time_suffix = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeSuffix) - self.night_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.NightRegex) + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.AtRegex) + self._time_regexes: List[Pattern] = ItalianTimeExtractorConfiguration.get_time_regex_list() + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(ItalianDateTime.LessThanOneHour) + self.time_suffix = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeSuffix) + self.night_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.NightRegex) self._utility_configuration = config.utility_configuration self._numbers: Dict[str, int] = config.numbers - self._time_zone_parser = config.time_zone_parser def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): delta_min = 0 @@ -72,11 +63,10 @@ def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): if min_str: delta_min = int(min_str) else: - min_str = RegExpUtility.get_group( - match, 'deltaminnum').lower() + min_str = RegExpUtility.get_group(match, 'deltaminnum').lower() delta_min = self.numbers.get(min_str) - if trimmed_prefix.startswith('meno'): + if trimmed_prefix.startswith('meno') or trimmed_prefix.endswith('alle'): delta_min = delta_min * -1 adjust.minute += delta_min diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_extractor_config.py index ab224c0b7d..c2c57207a0 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_extractor_config.py @@ -3,17 +3,16 @@ from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor from recognizers_number.number.italian.extractors import ItalianIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..base_timeperiod import TimePeriodExtractorConfiguration, MatchedIndex from ..base_time import BaseTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor -from .time_extractor_config import ItalianTimeExtractorConfiguration +from ..base_timeperiod import MatchedIndex, TimePeriodExtractorConfiguration +from ..extractors import DateTimeExtractor from .base_configs import ItalianDateTimeUtilityConfiguration -from .timezone_extractor_config import ItalianTimeZoneExtractorConfiguration +from .time_extractor_config import ItalianTimeExtractorConfiguration class ItalianTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): @@ -53,15 +52,10 @@ def token_before_date(self) -> str: def pure_number_regex(self) -> List[Pattern]: return self._pure_number_regex - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - def __init__(self): super().__init__() self._check_both_before_after = ItalianDateTime.CheckBothBeforeAfter - self._single_time_extractor = BaseTimeExtractor( - ItalianTimeExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(ItalianTimeExtractorConfiguration()) self._integer_extractor = ItalianIntegerExtractor() self.utility_configuration = ItalianDateTimeUtilityConfiguration() @@ -69,26 +63,18 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(ItalianDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(ItalianDateTime.PureNumBetweenAnd), RegExpUtility.get_safe_reg_exp(ItalianDateTime.PmRegex), - RegExpUtility.get_safe_reg_exp(ItalianDateTime.AmRegex) + RegExpUtility.get_safe_reg_exp(ItalianDateTime.AmRegex), ] - self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TillRegex) - self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeOfDayRegex) - self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.GeneralEndingRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.FromRegex2) - self.connector_and_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.ConnectorAndRegex) - self.before_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.BeforeRegex2) + self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TillRegex) + self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeOfDayRegex) + self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianDateTime.GeneralEndingRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.FromRegex2) + self.connector_and_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.ConnectorAndRegex) + self.before_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.BeforeRegex2) self._token_before_date = ItalianDateTime.TokenBeforeDate self._pure_number_regex = [ItalianDateTime.PureNumFromTo, ItalianDateTime.PureNumFromTo] - self._time_zone_extractor = BaseTimeZoneExtractor( - ItalianTimeZoneExtractorConfiguration()) def get_from_token_index(self, source: str) -> MatchedIndex: match = self.from_regex.search(source) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_parser_config.py index 02a8df24fc..726c6837bb 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_parser_config.py @@ -1,19 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_text.extractor import Extractor -from recognizers_number.number.italian.extractors import ItalianIntegerExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.italian_date_time import ItalianDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration -from ..base_timeperiod import TimePeriodParserConfiguration, MatchedTimeRegex +from ..base_timeperiod import MatchedTimeRegex, TimePeriodParserConfiguration from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from ..utilities import TimexUtil -from ..base_timezone import BaseTimeZoneParser class ItalianTimePeriodParserConfiguration(TimePeriodParserConfiguration): @@ -61,29 +60,18 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_extractor = config.time_extractor self._time_parser = config.time_parser self._integer_extractor = config.integer_extractor self._numbers = config.numbers self._utility_configuration = config.utility_configuration - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.PureNumBetweenAnd) - self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecificTimeFromTo) - self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.SpecificTimeBetweenAnd) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TimeOfDayRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - ItalianDateTime.TillRegex) - self._time_zone_parser = config.time_zone_parser + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.PureNumBetweenAnd) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.SpecificTimeBetweenAnd) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TimeOfDayRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(ItalianDateTime.TillRegex) def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: trimmed_text = source.strip().lower() @@ -102,19 +90,16 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: time_of_day = Constants.AFTERNOON elif any(trimmed_text.endswith(o) for o in ItalianDateTime.EveningTermList): time_of_day = Constants.EVENING - elif source == ItalianDateTime.DaytimeTermList[0] or source.endswith(ItalianDateTime.DaytimeTermList[1]) \ - or source.endswith(ItalianDateTime.DaytimeTermList[2]): + elif ( + source == ItalianDateTime.DaytimeTermList[0] + or source.endswith(ItalianDateTime.DaytimeTermList[1]) + or source.endswith(ItalianDateTime.DaytimeTermList[2]) + ): time_of_day = Constants.DAYTIME elif any(trimmed_text.endswith(o) for o in ItalianDateTime.NightTermList): time_of_day = Constants.NIGHT else: - return MatchedTimeRegex( - matched=False, - timex='', - begin_hour=0, - end_hour=0, - end_min=0 - ) + return MatchedTimeRegex(matched=False, timex='', begin_hour=0, end_hour=0, end_min=0) parse_result = TimexUtil.parse_time_of_day(time_of_day) timex = parse_result.timex @@ -122,10 +107,4 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: end_hour = parse_result.end_hour end_min = parse_result.end_min - return MatchedTimeRegex( - matched=True, - timex=timex, - begin_hour=begin_hour, - end_hour=end_hour, - end_min=end_min - ) + return MatchedTimeRegex(matched=True, timex=timex, begin_hour=begin_hour, end_hour=end_hour, end_min=end_min) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timezone_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timezone_extractor_config.py deleted file mode 100644 index 957e990c33..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timezone_extractor_config.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import List, Pattern -from recognizers_text.matcher.string_matcher import StringMatcher -from ..base_timezone import TimeZoneExtractorConfiguration - - -class ItalianTimeZoneExtractorConfiguration(TimeZoneExtractorConfiguration): - @property - def timezone_matcher(self): - return self._timezone_matcher - - @property - def direct_utc_regex(self) -> Pattern: - return self._direct_utc_regex - - @property - def location_time_suffix_regex(self) -> Pattern: - return self._location_time_suffix_regex - - @property - def location_matcher(self) -> StringMatcher: - return self._location_matcher - - @property - def ambiguous_timezone_list(self) -> List[str]: - return self._ambiguous_timezone_list diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/__init__.py new file mode 100644 index 0000000000..c3da3bdfb5 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/__init__.py @@ -0,0 +1,19 @@ +from .common_configs import * +from .date_extractor_config import * +from .date_parser_config import * +from .dateperiod_extractor_config import * +from .dateperiod_parser_config import * +from .datetime_extractor_config import * +from .datetime_parser_config import * +from .datetimeperiod_extractor_config import * +from .datetimeperiod_parser_config import * +from .duration_extractor_config import * +from .duration_parser_config import * +from .holiday_extractor_config import * +from .holiday_parser_config import * +from .merged_extractor_config import * +from .merged_parser_config import * +from .time_extractor_config import * +from .time_parser_config import * +from .timeperiod_extractor_config import * +from .timeperiod_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/common_configs.py new file mode 100644 index 0000000000..f180cec9a3 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/common_configs.py @@ -0,0 +1,234 @@ +from typing import Dict + +from recognizers_date_time.date_time.CJK import ( + BaseCJKDateExtractor, + BaseCJKDateParser, + BaseCJKDatePeriodExtractor, + BaseCJKDatePeriodParser, + BaseCJKDateTimeExtractor, + BaseCJKDateTimeParser, + BaseCJKDateTimePeriodExtractor, + BaseCJKDateTimePeriodParser, + BaseCJKDurationExtractor, + BaseCJKDurationParser, + BaseCJKHolidayExtractor, + BaseCJKHolidayParser, + BaseCJKTimeExtractor, + BaseCJKTimeParser, + BaseCJKTimePeriodExtractor, + BaseCJKTimePeriodParser, + CJKCommonDateTimeParserConfiguration, +) +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.date_extractor_config import JapaneseDateExtractorConfiguration +from recognizers_date_time.date_time.japanese.date_parser_config import JapaneseDateParserConfiguration +from recognizers_date_time.date_time.japanese.dateperiod_extractor_config import ( + JapaneseDatePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.japanese.dateperiod_parser_config import JapaneseDatePeriodParserConfiguration +from recognizers_date_time.date_time.japanese.datetime_extractor_config import JapaneseDateTimeExtractorConfiguration +from recognizers_date_time.date_time.japanese.datetime_parser_config import JapaneseDateTimeParserConfiguration +from recognizers_date_time.date_time.japanese.datetimeperiod_extractor_config import ( + JapaneseDateTimePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.japanese.datetimeperiod_parser_config import ( + JapaneseDateTimePeriodParserConfiguration, +) +from recognizers_date_time.date_time.japanese.duration_extractor_config import JapaneseDurationExtractorConfiguration +from recognizers_date_time.date_time.japanese.duration_parser_config import JapaneseDurationParserConfiguration +from recognizers_date_time.date_time.japanese.holiday_extractor_config import JapaneseHolidayExtractorConfiguration +from recognizers_date_time.date_time.japanese.holiday_parser_config import JapaneseHolidayParserConfiguration +from recognizers_date_time.date_time.japanese.time_extractor_config import JapaneseTimeExtractorConfiguration +from recognizers_date_time.date_time.japanese.time_parser_config import JapaneseTimeParserConfiguration +from recognizers_date_time.date_time.japanese.timeperiod_extractor_config import ( + JapaneseTimePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.japanese.timeperiod_parser_config import JapaneseTimePeriodParserConfiguration +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities.datetime_utility_config import DateTimeUtilityConfiguration +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number import BaseNumberExtractor +from recognizers_number.number.cjk_parsers import CJKNumberParser +from recognizers_number.number.japanese.extractors import ( + JapaneseCardinalExtractor, + JapaneseIntegerExtractor, + JapaneseOrdinalExtractor, +) +from recognizers_number.number.japanese.parsers import JapaneseNumberParserConfiguration + + +class JapaneseCommonDateTimeParserConfiguration(CJKCommonDateTimeParserConfiguration): + + @property + def cardinal_extractor(self) -> BaseNumberExtractor: + return self._cardinal_extractor + + @property + def integer_extractor(self) -> JapaneseIntegerExtractor: + return self._integer_extractor + + @property + def ordinal_extractor(self) -> BaseNumberExtractor: + return self._ordinal_extractor + + @property + def number_parser(self) -> CJKNumberParser: + return self._number_parser + + @property + def date_extractor(self) -> BaseCJKDateExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def date_period_extractor(self) -> DateTimeExtractor: + return self._date_period_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def date_time_period_extractor(self) -> DateTimeExtractor: + return self._date_time_period_extractor + + @property + def holiday_extractor(self) -> DateTimeExtractor: + return self._holiday_extractor + + @property + def date_parser(self) -> BaseCJKDateParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> DateTimeParser: + return self._date_time_parser + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def date_period_parser(self) -> DateTimeParser: + return self._date_period_parser + + @property + def time_period_parser(self) -> DateTimeParser: + return self._time_period_parser + + @property + def date_time_period_parser(self) -> DateTimeParser: + return self._date_time_period_parser + + @property + def holiday_parser(self) -> DateTimeParser: + return self._holiday_parser + + @property + def date_time_alt_parser(self) -> DateTimeParser: + return None + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def numbers(self) -> Dict[str, int]: + return None + + @property + def unit_value_map(self) -> Dict[str, int]: + return self._unit_value_map + + @property + def season_map(self) -> Dict[str, str]: + return self._season_map + + @property + def special_year_prefixes_map(self) -> Dict[str, str]: + return None + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def day_of_week(self) -> Dict[str, int]: + return self._day_of_week + + @property + def double_numbers(self) -> Dict[str, int]: + return None + + @property + def written_decades(self) -> Dict[str, int]: + return None + + @property + def special_decade_cases(self) -> Dict[str, int]: + return None + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return None + + def __init__(self): + super().__init__() + + self._unit_map = JapaneseDateTime.ParserConfigurationUnitMap + self._unit_value_map = JapaneseDateTime.DurationUnitValueMap + self._cardinal_map = JapaneseDateTime.ParserConfigurationCardinalMap + self._day_of_month = JapaneseDateTime.ParserConfigurationDayOfMonth + self._day_of_week = JapaneseDateTime.ParserConfigurationDayOfWeek + self._month_of_year = JapaneseDateTime.ParserConfigurationMonthOfYear + + self._integer_extractor = JapaneseIntegerExtractor() + self._cardinal_extractor = JapaneseCardinalExtractor() + self._ordinal_extractor = JapaneseOrdinalExtractor() + self._number_parser = CJKNumberParser(JapaneseNumberParserConfiguration()) + + # Do not change order. The order of initialization can lead to side effects + self._date_extractor = BaseCJKDateExtractor(JapaneseDateExtractorConfiguration()) + self._time_extractor = BaseCJKTimeExtractor(JapaneseTimeExtractorConfiguration()) + self._date_time_extractor = BaseCJKDateTimeExtractor(JapaneseDateTimeExtractorConfiguration()) + self._duration_extractor = BaseCJKDurationExtractor(JapaneseDurationExtractorConfiguration()) + self._date_period_extractor = BaseCJKDatePeriodExtractor(JapaneseDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseCJKTimePeriodExtractor(JapaneseTimePeriodExtractorConfiguration()) + self._date_time_period_extractor = BaseCJKDateTimePeriodExtractor( + JapaneseDateTimePeriodExtractorConfiguration() + ) + self._holiday_extractor = BaseCJKHolidayExtractor(JapaneseHolidayExtractorConfiguration()) + + self._duration_parser = BaseCJKDurationParser(JapaneseDurationParserConfiguration(self)) + self._date_parser = BaseCJKDateParser(JapaneseDateParserConfiguration(self)) + self._time_parser = BaseCJKTimeParser(JapaneseTimeParserConfiguration(self)) + self._date_time_parser = BaseCJKDateTimeParser(JapaneseDateTimeParserConfiguration(self)) + self._date_period_parser = BaseCJKDatePeriodParser(JapaneseDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseCJKTimePeriodParser(JapaneseTimePeriodParserConfiguration(self)) + self._date_time_period_parser = BaseCJKDateTimePeriodParser(JapaneseDateTimePeriodParserConfiguration(self)) + self._holiday_parser = BaseCJKHolidayParser(JapaneseHolidayParserConfiguration(self)) + + self._season_map = JapaneseDateTime.ParserConfigurationSeasonMap diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/date_extractor_config.py new file mode 100644 index 0000000000..ed7bd33d91 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/date_extractor_config.py @@ -0,0 +1,283 @@ +from typing import Dict, List, Pattern + +from recognizers_date_time.date_time.CJK import BaseCJKDurationExtractor, CJKDateExtractorConfiguration +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.duration_extractor_config import JapaneseDurationExtractorConfiguration +from recognizers_date_time.resources import JapaneseDateTime +from recognizers_date_time.resources.base_date_time import BaseDateTime +from recognizers_number import CJKNumberParser, JapaneseIntegerExtractor, JapaneseNumberParserConfiguration +from recognizers_text import RegExpUtility + + +class JapaneseDateExtractorConfiguration(CJKDateExtractorConfiguration): + + @property + def week_day_regex(self) -> Pattern: + return self._week_day_regex + + @property + def lunar_regex(self) -> Pattern: + return self._lunar_regex + + @property + def this_regex(self) -> Pattern: + return self._this_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def special_day_regex(self) -> Pattern: + return self._special_day_regex + + @property + def week_day_of_month_regex(self) -> Pattern: + return self._week_day_of_month + + @property + def special_date_regex(self) -> Pattern: + return self._special_date_regex + + @property + def special_day_with_num_regex(self) -> Pattern: + return self._special_day_with_num_regex + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def week_day_start_end(self) -> Pattern: + return self._week_day_start_end + + @property + def datetime_period_unit_regex(self) -> Pattern: + return self._datetime_period_unit_regex + + @property + def range_connector_symbol_regex(self) -> Pattern: + return self._range_connector_symbol_regex + + @property + def month_regex(self) -> Pattern: + return self._month_regex + + @property + def day_regex(self): + return self._day_regex + + @property + def date_day_regex_in_cjk(self) -> Pattern: + return self._date_day_regex_in_CJK + + @property + def day_regex_num_in_cjk(self) -> Pattern: + return self._day_regex_num_in_CJK + + @property + def month_num_regex(self) -> Pattern: + return self._month_num_regex + + @property + def week_day_and_day_regex(self) -> Pattern: + return self._week_day_and_day_regex + + @property + def duration_relative_duration_unit_regex(self) -> Pattern: + return self._duration_relative_duration_unit_regex + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def relative_regex(self) -> Pattern: + return self._relative_regex + + @property + def relative_month_regex(self) -> Pattern: + return self._relative_month_regex + + @property + def zero_to_nine_integer_regex_cjk(self) -> Pattern: + return self._zero_to_nine_integer_regex_cjk + + @property + def date_year_in_cjk_regex(self) -> Pattern: + return self._date_year_in_cjk_regex + + @property + def this_prefix_regex(self) -> Pattern: + return self._this_prefix_regex + + @property + def last_prefix_regex(self) -> Pattern: + return self._last_prefix_regex + + @property + def next_prefix_regex(self) -> Pattern: + return self._next_prefix_regex + + @property + def date_unit_regex(self) -> Pattern: + return self._date_unit_regex + + @property + def dynasty_year_regex(self) -> Pattern: + return self._dynasty_year_regex + + @property + def dynasty_start_year(self) -> str: + return self._dynasty_start_year + + @property + def dynasty_year_map(self) -> Dict[str, int]: + return self._dynasty_year_map + + @property + def date_regex_list(self) -> List[Pattern]: + return self._date_regex_list + + @property + def implicit_date_list(self) -> List[Pattern]: + return self._implicit_date_list + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def ambiguity_date_filters_dict(self) -> Dict[Pattern, Pattern]: + return self._ambiguity_date_filters_dict + + @property + def number_parser(self) -> CJKNumberParser: + return self._number_parser + + @property + def time_clock_desc_regex(self) -> Pattern: + return self._time_clock_desc_regex + + @property + def time_minutes_desc_regex(self) -> Pattern: + return self._time_minutes_desc_regex + + def __init__(self): + self._duration_extractor = BaseCJKDurationExtractor(JapaneseDurationExtractorConfiguration(), False) + + # 2016年12月1日 + self._date_regex_list_1 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList1) + + # 金曜日 6月 15日 + self._date_regex_list_2 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList2) + + # (2015年)?(农历)?十月二十(星期三)? + self._date_regex_list_3 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList3) + + # 2015-12-23 + self._date_regex_list_8 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList8) + + # 23/7 + self._date_regex_list_5 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList5) + + # 7/23 + self._date_regex_list_4 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList4) + + # 23-3-2017 + self._date_regex_list_7 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList7) + + # 3-23-2015 + self._date_regex_list_6 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList6) + + # 12月1日 + self._date_regex_list_9 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList9) + + # 2015/12/23 + self._date_regex_list_10 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList10) + + # 2016/12 (this is not a Date) + # self._date_regex_list_11 = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateRegexList11) + + self._date_regex_list = [ + self._date_regex_list_1, + self._date_regex_list_10, + self._date_regex_list_2, + self._date_regex_list_9, + self._date_regex_list_3, + self._date_regex_list_4, + self._date_regex_list_5, + ] + + # Regex precedence where the order between D and M varies is controlled by DefaultLanguageFallback + + if JapaneseDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: + self._date_regex_list.extend([self._date_regex_list_7, self._date_regex_list_6, self._date_regex_list_8]) + else: + self._date_regex_list.extend([self._date_regex_list_6, self._date_regex_list_7, self._date_regex_list_8]) + + self._integer_extractor = JapaneseIntegerExtractor() + self._number_parser = CJKNumberParser(JapaneseNumberParserConfiguration()) + + self._week_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekDayRegex) + self._lunar_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.LunarRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateThisRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateLastRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateNextRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SpecialDayRegex) + self._week_day_of_month = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekDayOfMonthRegex) + self._special_date_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SpecialDate) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SpecialDayWithNumRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MonthRegex) + self._day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DayRegex) + self._date_day_regex_in_CJK = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateDayRegexInCJK) + self._day_regex_num_in_CJK = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DayRegexNumInCJK) + self._month_num_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MonthNumRegex) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekDayAndDayRegex) + self._duration_relative_duration_unit_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.DurationRelativeDurationUnitRegex + ) + self._year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.YearRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.RelativeRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.RelativeMonthRegex) + self._zero_to_nine_integer_regex_cjk = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.ZeroToNineIntegerRegexCJK + ) + self._date_year_in_cjk_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateYearInCJKRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ThisPrefixRegex) + self._last_prefix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.LastPrefixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.NextPrefixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.UnitRegex) + self._dynasty_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DynastyYearRegex) + self._dynasty_start_year = JapaneseDateTime.DynastyStartYear + self._dynasty_year_map = JapaneseDateTime.DynastyYearMap + + self._datetime_period_unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodUnitRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.AfterRegex) + self._week_day_start_end = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekDayStartEnd) + self._range_connector_symbol_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.RangeConnectorSymbolRegex) + self._ambiguity_date_filters_dict = JapaneseDateTime.AmbiguityDateTimeFiltersDict + self._time_clock_desc_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeClockDescRegex) + self._time_minutes_desc_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeMinuteDescRegex) + + self._implicit_date_list = [ + self.special_day_with_num_regex, + self.special_day_regex, + self.this_regex, + self.last_regex, + self.next_regex, + self.week_day_regex, + self.week_day_of_month_regex, + self.special_date_regex, + self.week_day_and_day_regex, + ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/date_parser_config.py new file mode 100644 index 0000000000..5f0dfacddf --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/date_parser_config.py @@ -0,0 +1,254 @@ +from typing import Dict, List, Pattern + +from recognizers_date_time.date_time.CJK.base_configs import CJKCommonDateTimeParserConfiguration +from recognizers_date_time.date_time.CJK.base_date import CJKDateParserConfiguration +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.date_extractor_config import JapaneseDateExtractorConfiguration +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text import RegExpUtility + + +class JapaneseDateParserConfiguration(CJKDateParserConfiguration): + + @property + def plus_one_day_regex(self) -> Pattern: + return self._plus_one_day_regex + + @property + def minus_one_day_regex(self) -> Pattern: + return self._minus_one_day_regex + + @property + def plus_two_day_regex(self) -> Pattern: + return self._plus_two_day_regex + + @property + def minus_two_day_regex(self) -> Pattern: + return self._minus_two_day_regex + + @property + def plus_three_day_regex(self) -> Pattern: + return self._plus_three_day_regex + + @property + def minus_three_day_regex(self) -> Pattern: + return self._minus_three_day_regex + + @property + def plus_four_day_regex(self) -> Pattern: + return self._plus_four_day_regex + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def ordinal_extractor(self) -> BaseNumberExtractor: + return self._ordinal_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def date_regex_list(self) -> List[Pattern]: + return self._date_regex_list + + @property + def special_date(self) -> Pattern: + return self._special_date + + @property + def next_re(self) -> Pattern: + return self._next_re + + @property + def last_re(self) -> Pattern: + return self._last_re + + @property + def special_day_regex(self) -> Pattern: + return self._special_day_regex + + @property + def strict_week_day_regex(self) -> Pattern: + return self._strict_week_day_regex + + @property + def lunar_regex(self) -> Pattern: + return self._lunar_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def this_regex(self) -> Pattern: + return self._this_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def week_day_of_month_regex(self) -> any: + return self._week_day_of_month_regex + + @property + def week_day_and_day_regex(self) -> Pattern: + return self._week_day_and_day_regex + + @property + def duration_relative_duration_unit_regex(self) -> Pattern: + return self._duration_relative_duration_unit_regex + + @property + def special_day_with_num_regex(self) -> Pattern: + return self._special_day_with_num_regex + + @property + def dynasty_year_regex(self) -> Pattern: + return self._dynasty_year_regex + + @property + def dynasty_year_map(self) -> Dict[str, int]: + return self._dynasty_year_map + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def day_of_week(self) -> Dict[str, int]: + return self._day_of_week + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def dynasty_start_year(self) -> Pattern: + return self._dynasty_start_year + + @property + def last_week_day_regex(self) -> Pattern: + return self._last_week_day_regex + + @property + def next_month_regex(self) -> Pattern: + return self._next_month_regex + + @property + def last_month_regex(self) -> Pattern: + return self._last_month_regex + + def get_swift_day(self, source: str) -> int: + source = source.strip().lower() + swift = 0 + + if RegExpUtility.match_begin(self.plus_one_day_regex, source, trim=True): + swift = 1 + elif RegExpUtility.match_begin(self.minus_one_day_regex, source, trim=True): + swift = -1 + + if RegExpUtility.is_exact_match(self.plus_one_day_regex, source, trim=False): + swift = 1 + elif RegExpUtility.is_exact_match(self.plus_three_day_regex, source, trim=False): + swift = 3 + elif RegExpUtility.is_exact_match(self.plus_four_day_regex, source, trim=False): + swift = 4 + elif RegExpUtility.is_exact_match(self.minus_three_day_regex, source, trim=False): + swift = -3 + elif RegExpUtility.is_exact_match(self.minus_one_day_regex, source, trim=False): + swift = -1 + elif RegExpUtility.is_exact_match(self.plus_two_day_regex, source, trim=False): + swift = 2 + elif RegExpUtility.is_exact_match(self.minus_two_day_regex, source, trim=False): + swift = -2 + return swift + + def __init__(self, config: CJKCommonDateTimeParserConfiguration): + super().__init__() + self._integer_extractor = config.integer_extractor + self._ordinal_extractor = config.ordinal_extractor + + self._number_parser = config.number_parser + + self._date_extractor = config.date_extractor + self._duration_extractor = config.duration_extractor + self._duration_parser = config.duration_parser + + self._date_regex_list = JapaneseDateExtractorConfiguration().date_regex_list + self._special_date = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SpecialDate) + self._next_re = JapaneseDateExtractorConfiguration().next_prefix_regex + self._last_re = JapaneseDateExtractorConfiguration().last_prefix_regex + self._special_day_regex = JapaneseDateExtractorConfiguration().special_day_regex + self._strict_week_day_regex = JapaneseDateExtractorConfiguration().week_day_regex + self._lunar_regex = JapaneseDateExtractorConfiguration().lunar_regex + + self._unit_regex = JapaneseDateExtractorConfiguration().date_unit_regex + self._before_regex = JapaneseDateExtractorConfiguration().before_regex + self._after_regex = JapaneseDateExtractorConfiguration().after_regex + self._dynasty_year_regex = JapaneseDateExtractorConfiguration().dynasty_year_regex + self._dynasty_start_year = JapaneseDateExtractorConfiguration().dynasty_start_year + self._dynasty_year_map = JapaneseDateExtractorConfiguration().dynasty_year_map + self._next_regex = JapaneseDateExtractorConfiguration().next_regex + self._this_regex = JapaneseDateExtractorConfiguration().this_regex + self._last_regex = JapaneseDateExtractorConfiguration().last_regex + self._week_day_of_month_regex = JapaneseDateExtractorConfiguration().week_day_of_month_regex + self._week_day_and_day_regex = JapaneseDateExtractorConfiguration().week_day_and_day_regex + self._duration_relative_duration_unit_regex = ( + JapaneseDateExtractorConfiguration().duration_relative_duration_unit_regex + ) + self._special_day_with_num_regex = JapaneseDateExtractorConfiguration().special_day_with_num_regex + + self._cardinal_map = config.cardinal_map + self._unit_map = config.unit_map + self._day_of_month = config.day_of_month + self._day_of_week = config.day_of_week + self._month_of_year = config.month_of_year + + self._plus_one_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.PlusOneDayRegex) + self._minus_one_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MinusOneDayRegex) + self._plus_two_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.PlusTwoDayRegex) + self._minus_two_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MinusTwoDayRegex) + self._plus_three_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.PlusThreeDayRegex) + self._minus_three_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MinusThreeDayRegex) + self._plus_four_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.PlusFourDayRegex) + self._next_month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationNextMonthRegex) + self._last_month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationLastMonthRegex) + self._last_week_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationLastWeekDayRegex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/dateperiod_extractor_config.py new file mode 100644 index 0000000000..50b87ad021 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/dateperiod_extractor_config.py @@ -0,0 +1,362 @@ +from typing import Dict, List, Pattern + +from recognizers_date_time.date_time.CJK import ( + BaseCJKDateExtractor, + BaseCJKDurationExtractor, + CJKDatePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.date_extractor_config import JapaneseDateExtractorConfiguration +from recognizers_date_time.date_time.japanese.duration_extractor_config import JapaneseDurationExtractorConfiguration +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number import JapaneseNumberExtractor +from recognizers_text import Extractor, RegExpUtility + + +class JapaneseDatePeriodExtractorConfiguration(CJKDatePeriodExtractorConfiguration): + + @property + def till_regex(self) -> Pattern: + return self._till_regex + + @property + def range_prefix_regex(self) -> Pattern: + return self._range_prefix_regex + + @property + def range_suffix_regex(self) -> Pattern: + return self._range_suffix_regex + + @property + def strict_year_regex(self) -> Pattern: + return self._strict_year_regex + + @property + def year_in_cjk_regex(self) -> Pattern: + return self._year_in_cjk_regex + + # for case "(より)?(2017)?12日に1月10日" + @property + def simple_cases_regex(self) -> Pattern: + return self._simple_cases_regex + + @property + def year_and_month(self) -> Pattern: + return self._year_and_month + + # 2017.12, 2017-12, 2017/12, 12/2017 + @property + def pure_num_year_and_month(self) -> Pattern: + return self._pure_num_year_and_month + + @property + def simple_year_and_month(self) -> Pattern: + return self._simple_year_and_month + + @property + def one_word_period_regex(self) -> Pattern: + return self._one_word_period_regex + + @property + def week_of_month_regex(self) -> Pattern: + return self._week_of_month_regex + + @property + def week_of_year_regex(self) -> Pattern: + return self._week_of_year_regex + + @property + def week_of_date_regex(self) -> Pattern: + return self._week_of_date_regex + + @property + def month_of_date_regex(self) -> Pattern: + return self._month_of_date_regex + + @property + def which_week_regex(self) -> Pattern: + return self._which_week_regex + + @property + def followed_unit(self) -> Pattern: + return self._followed_unit + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def year_to_year(self) -> Pattern: + return self._year_to_year + + @property + def year_to_year_suffix_required(self) -> Pattern: + return self._year_to_year_suffix_required + + @property + def month_to_month(self) -> Pattern: + return self._month_to_month + + @property + def month_to_month_suffix_required(self) -> Pattern: + return self._month_to_month_suffix_required + + @property + def day_to_day(self) -> Pattern: + return self._day_to_day + + @property + def day_regex_for_period(self) -> Pattern: + return self._day_regex_for_period + + @property + def month_day_range(self) -> Pattern: + return self._month_day_range + + @property + def year_month_range(self) -> Pattern: + return self._year_month_range + + @property + def year_month_day_range(self) -> Pattern: + return self._year_month_day_range + + @property + def past_regex(self) -> Pattern: + return self._past_regex + + @property + def future_regex(self) -> Pattern: + return self._future_regex + + @property + def week_with_weekday_range_regex(self) -> Pattern: + return self._week_with_weekday_range_regex + + @property + def first_last_of_year_regex(self) -> Pattern: + return self._first_last_of_year_regex + + @property + def season_with_year_regex(self) -> Pattern: + return self._season_with_year_regex + + @property + def quarter_regex(self) -> Pattern: + return self._quarter_regex + + @property + def decade_regex(self) -> Pattern: + return self._decade_regex + + @property + def century_regex(self) -> Pattern: + return self._century_regex + + @property + def special_month_regex(self) -> Pattern: + return self._special_month_regex + + @property + def special_year_regex(self) -> Pattern: + return self._special_year_regex + + @property + def day_regex(self) -> Pattern: + return self._day_regex + + @property + def day_regex_in_cjk(self) -> Pattern: + return self._day_regex_in_cjk + + @property + def month_num_regex(self) -> Pattern: + return self._month_num_regex + + @property + def this_regex(self) -> Pattern: + return self._this_regex + + @property + def date_unit_regex(self) -> Pattern: + return self._date_unit_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def relative_month_regex(self) -> Pattern: + return self._relative_month_regex + + @property + def later_early_period_regex(self) -> Pattern: + return self._later_early_period_regex + + @property + def date_point_with_ago_and_later(self) -> Pattern: + return self._date_point_with_ago_and_later + + @property + def reference_date_period_regex(self) -> Pattern: + return self._reference_date_period_regex + + @property + def complex_date_period_regex(self) -> Pattern: + return self._complex_date_period_regex + + @property + def month_regex(self) -> Pattern: + return self._month_regex + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def year_regex_in_number(self) -> Pattern: + return self._year_regex_in_number + + @property + def zero_to_nine_integer_regex_cjk(self) -> Pattern: + return self._zero_to_nine_integer_regex_cjk + + @property + def month_suffix_regex(self) -> Pattern: + return self._month_suffix_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def duration_unit_regex(self) -> Pattern: + return self._duration_unit_regex + + @property + def season_regex(self): + return self._season_regex + + @property + def date_point_extractor(self) -> DateTimeExtractor: + return self._date_point_extractor + + @property + def duration_extractor(self): + return self._duration_extractor + + @property + def integer_extractor(self) -> Extractor: + return self._integer_extractor + + @property + def simple_cases_regexes(self) -> List[Pattern]: + return self._simple_cases_regexes + + @property + def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: + return self._ambiguity_filters_dict + + def __init__(self): + super().__init__() + self._till_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodTillRegex) + self._range_prefix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodRangePrefixRegex) + self._range_suffix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodRangeSuffixRegex) + self._strict_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.StrictYearRegex) + self._year_in_cjk_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodYearInCJKRegex) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SimpleCasesRegex) + self._year_and_month = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.YearAndMonth) + self._pure_num_year_and_month = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.PureNumYearAndMonth) + self._simple_year_and_month = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SimpleYearAndMonth) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.OneWordPeriodRegex) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekOfYearRegex) + self._week_of_date_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekOfDateRegex) + self._month_of_date_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MonthOfDateRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WhichWeekRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.FollowedUnit) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.NumberCombinedWithUnit) + self._year_to_year = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.YearToYear) + self._year_to_year_suffix_required = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.YearToYearSuffixRequired) + self._month_to_month = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MonthToMonth) + self._month_to_month_suffix_required = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.MonthToMonthSuffixRequired + ) + self._day_to_day = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DayToDay) + self._day_regex_for_period = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DayRegexForPeriod) + self._month_day_range = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MonthDayRange) + self._year_month_range = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.YearMonthRange) + self._year_month_day_range = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.YearMonthDayRange) + self._past_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.FutureRegex) + self._week_with_weekday_range_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekWithWeekDayRangeRegex) + self._first_last_of_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekWithWeekDayRangeRegex) + self._season_with_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SeasonWithYear) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.QuarterRegex) + self._decade_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DecadeRegex) + self._century_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.CenturyRegex) + self._special_month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SpecialMonthRegex) + self._special_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SpecialYearRegex) + + self._day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DayRegex) + self._day_regex_in_cjk = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodDayRegexInCJK) + self._month_num_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MonthNumRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodThisRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateUnitRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodLastRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodNextRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.RelativeMonthRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.LaterEarlyPeriodRegex) + self._date_point_with_ago_and_later = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePointWithAgoAndLater) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ReferenceDatePeriodRegex) + self._complex_date_period_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ComplexDatePeriodRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MonthRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.YearRegex) + self._year_regex_in_number = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.YearRegexInNumber) + self._zero_to_nine_integer_regex_cjk = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.ZeroToNineIntegerRegexCJK + ) + self._month_suffix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.MonthSuffixRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.UnitRegex) + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationUnitRegex) + self._season_regex = JapaneseDateTime.SeasonRegex + + self._simple_cases_regexes = [ + self._simple_cases_regex, + self._one_word_period_regex, + self._strict_year_regex, + self._year_to_year, + self._year_to_year_suffix_required, + self._month_to_month, + self._day_to_day, + self._year_month_range, + self._month_day_range, + self._year_month_day_range, + self._month_to_month_suffix_required, + self._year_and_month, + self._pure_num_year_and_month, + self._year_in_cjk_regex, + self._special_month_regex, + self._special_year_regex, + self._week_of_month_regex, + self._week_of_year_regex, + self._week_of_date_regex, + self._month_of_date_regex, + self._which_week_regex, + self._later_early_period_regex, + self._season_with_year_regex, + self._quarter_regex, + self._decade_regex, + self._century_regex, + self._reference_date_period_regex, + self._date_point_with_ago_and_later, + ] + + self._date_point_extractor = BaseCJKDateExtractor(JapaneseDateExtractorConfiguration()) + self._duration_extractor = BaseCJKDurationExtractor(JapaneseDurationExtractorConfiguration(), False) + self._integer_extractor = JapaneseNumberExtractor() + self._ambiguity_filters_dict = JapaneseDateTime.AmbiguityFiltersDict diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/dateperiod_parser_config.py new file mode 100644 index 0000000000..9363525048 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/dateperiod_parser_config.py @@ -0,0 +1,457 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.CJK.base_date import BaseCJKDateExtractor, BaseCJKDateParser +from recognizers_date_time.date_time.CJK.base_dateperiod import CJKDatePeriodParserConfiguration +from recognizers_date_time.date_time.japanese.date_extractor_config import JapaneseDateExtractorConfiguration +from recognizers_date_time.date_time.japanese.dateperiod_extractor_config import ( + JapaneseDatePeriodExtractorConfiguration, +) +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number import CJKNumberParser, JapaneseIntegerExtractor +from recognizers_text import RegExpUtility + + +class JapaneseDatePeriodParserConfiguration(CJKDatePeriodParserConfiguration): + + @property + def wom_last_regex(self) -> Pattern: + return self._wom_last_regex + + @property + def wom_previous_regex(self) -> Pattern: + return self._wom_previous_regex + + @property + def wom_next_regex(self) -> Pattern: + return self._wom_next_regex + + @property + def month_of_year(self) -> Dict[str, int]: + return self._month_of_year + + @property + def next_month_regex(self) -> Pattern: + return self._next_month_regex + + @property + def after_next_month_regex(self) -> Pattern: + return self._after_next_month_regex + + @property + def last_month_regex(self) -> Pattern: + return self._last_month_regex + + @property + def next_year_regex(self) -> Pattern: + return self._next_year_regex + + @property + def after_next_year_regex(self) -> Pattern: + return self._after_next_year_regex + + @property + def last_year_regex(self) -> Pattern: + return self._last_year_regex + + @property + def this_year_regex(self) -> Pattern: + return self._this_year_regex + + @property + def date_extractor(self) -> BaseCJKDateExtractor: + return self._date_extractor + + @property + def duration_extractor(self): + return self._duration_extractor + + @property + def cardinal_extractor(self): + return self._cardinal_extractor + + @property + def duration_parser(self): + raise self._duration_parser + + @property + def date_parser(self) -> BaseCJKDateParser: + return self._date_parser + + @property + def integer_extractor(self) -> JapaneseIntegerExtractor: + return self._integer_extractor + + @property + def number_parser(self) -> CJKNumberParser: + return self._number_parser + + @property + def dynasty_year_map(self) -> Dict[str, int]: + return self._dynasty_year_map + + @property + def unit_map(self) -> Dict[str, int]: + return self._unit_map + + @property + def cardinal_map(self) -> Dict[str, int]: + return self._cardinal_map + + @property + def day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @property + def season_map(self) -> Dict[str, int]: + return self._season_map + + @property + def dynasty_start_year(self) -> Pattern: + return self._dynasty_start_year + + @property + def token_before_date(self) -> str: + return self._token_before_date + + @property + def dynasty_year_regex(self) -> Pattern: + return self._dynasty_year_regex + + @property + def simple_cases_regex(self) -> Pattern: + return self._simple_cases_regex + + @property + def this_regex(self) -> Pattern: + return self._this_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def year_to_year(self) -> Pattern: + return self._year_to_year + + @property + def year_to_year_suffix_required(self) -> Pattern: + return self._year_to_year_suffix_required + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def relative_regex(self) -> Pattern: + return self._relative_regex + + @property + def relative_month_regex(self) -> Pattern: + return self._relative_month_regex + + @property + def later_early_period_regex(self) -> Pattern: + return self._later_early_period_regex + + @property + def date_period_with_ago_and_later(self) -> Pattern: + return self._date_period_with_ago_and_later + + @property + def reference_date_period_regex(self) -> Pattern: + return self._reference_date_period_regex + + @property + def complex_date_period_regex(self) -> Pattern: + return self._complex_date_period_regex + + @property + def duration_relative_duration_unit_regex(self) -> Pattern: + return self._duration_relative_duration_unit_regex + + @property + def year_in_cjk_regex(self) -> Pattern: + return self._year_in_cjk_regex + + @property + def month_to_month(self) -> Pattern: + return self._month_to_month + + @property + def month_to_month_suffix_required(self) -> Pattern: + return self._month_to_month_suffix_required + + @property + def month_regex(self) -> Pattern: + return self._month_regex + + @property + def year_and_month(self) -> Pattern: + return self._year_and_month + + @property + def pure_num_year_and_month(self) -> Pattern: + return self._pure_num_year_and_month + + @property + def one_word_period_regex(self) -> Pattern: + return self._one_word_period_regex + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def past_regex(self) -> Pattern: + return self._past_regex + + @property + def future_regex(self) -> Pattern: + return self._future_regex + + @property + def week_with_week_day_range_regex(self) -> Pattern: + return self._week_with_week_day_range_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def duration_unit_regex(self) -> Pattern: + return self._duration_unit_regex + + @property + def week_of_month_regex(self) -> Pattern: + return self._week_of_month_regex + + @property + def week_of_year_regex(self) -> Pattern: + return self._week_of_year_regex + + @property + def week_of_date_regex(self) -> Pattern: + return self._week_of_date_regex + + @property + def month_of_date_regex(self) -> Pattern: + return self._month_of_date_regex + + @property + def which_week_regex(self) -> Pattern: + return self._which_week_regex + + @property + def first_last_of_year_regex(self) -> Pattern: + return self._first_last_of_year_regex + + @property + def season_with_year(self) -> Pattern: + return self._season_with_year + + @property + def quarter_regex(self) -> Pattern: + return self._quarter_regex + + @property + def decade_regex(self) -> Pattern: + return self._decade_regex + + @property + def century_regex(self) -> Pattern: + return self._century_regex + + @property + def day_to_day(self) -> Pattern: + return self._day_to_day + + @property + def month_day_range(self) -> Pattern: + return self._month_day_range + + @property + def day_regex_for_period(self) -> Pattern: + return self._day_regex_for_period + + @property + def simple_year_and_month(self) -> Pattern: + return self._simple_year_and_month + + @property + def special_month_regex(self) -> Pattern: + return self._special_month_regex + + @property + def special_year_regex(self) -> Pattern: + return self._special_year_regex + + @property + def two_num_year(self) -> int: + return self._two_num_year + + @property + def date_point_with_ago_and_later(self) -> Pattern: + return self.date_period_with_ago_and_later + + def __init__(self, config): + super().__init__() + self._integer_extractor = config.integer_extractor + self._number_parser = config.number_parser + self._date_extractor = config.date_extractor + self._duration = config.duration_extractor + self._cardinal_extractor = config.cardinal_extractor + self._date_parser = config.date_parser + + self._dynasty_year_regex = JapaneseDateExtractorConfiguration().dynasty_year_regex + self._dynasty_start_year = JapaneseDateExtractorConfiguration().dynasty_start_year + self._dynasty_year_map = JapaneseDateExtractorConfiguration().dynasty_year_map + self._simple_cases_regex = JapaneseDatePeriodExtractorConfiguration().simple_cases_regex + self._this_regex = JapaneseDatePeriodExtractorConfiguration().this_regex + self._next_regex = JapaneseDatePeriodExtractorConfiguration().next_regex + self._last_regex = JapaneseDatePeriodExtractorConfiguration().last_regex + + self._year_to_year = JapaneseDatePeriodExtractorConfiguration().year_to_year + self._year_to_year_suffix_required = JapaneseDatePeriodExtractorConfiguration().year_to_year_suffix_required + self._year_regex = JapaneseDatePeriodExtractorConfiguration().year_regex + self._year_in_cjk_regex = JapaneseDatePeriodExtractorConfiguration().year_in_cjk_regex + self._month_to_month = JapaneseDatePeriodExtractorConfiguration().month_to_month + self._month_to_month_suffix_required = JapaneseDatePeriodExtractorConfiguration().month_to_month_suffix_required + self._day_to_day = JapaneseDatePeriodExtractorConfiguration().day_to_day + self._month_day_range = JapaneseDatePeriodExtractorConfiguration().month_day_range + self._day_regex_for_period = JapaneseDatePeriodExtractorConfiguration().day_regex_for_period + self._month_regex = JapaneseDatePeriodExtractorConfiguration().month_regex + self._special_month_regex = JapaneseDatePeriodExtractorConfiguration().special_month_regex + self._special_year_regex = JapaneseDatePeriodExtractorConfiguration().special_year_regex + self._year_and_month = JapaneseDatePeriodExtractorConfiguration().year_and_month + self._pure_num_year_and_month = JapaneseDatePeriodExtractorConfiguration().pure_num_year_and_month + self._simple_year_and_month = JapaneseDatePeriodExtractorConfiguration().simple_year_and_month + self._one_word_period_regex = JapaneseDatePeriodExtractorConfiguration().one_word_period_regex + self._number_combined_with_unit = JapaneseDatePeriodExtractorConfiguration().number_combined_with_unit + self._past_regex = JapaneseDatePeriodExtractorConfiguration().past_regex + self._future_regex = JapaneseDatePeriodExtractorConfiguration().future_regex + self._week_with_week_day_range_regex = JapaneseDatePeriodExtractorConfiguration().week_with_weekday_range_regex + self._unit_regex = JapaneseDatePeriodExtractorConfiguration().unit_regex + self._duration_unit_regex = JapaneseDatePeriodExtractorConfiguration().duration_unit_regex + self._week_of_month_regex = JapaneseDatePeriodExtractorConfiguration().week_of_month_regex + self._week_of_year_regex = JapaneseDatePeriodExtractorConfiguration().week_of_year_regex + self._week_of_date_regex = JapaneseDatePeriodExtractorConfiguration().week_of_date_regex + self._month_of_date_regex = JapaneseDatePeriodExtractorConfiguration().month_of_date_regex + self._which_week_regex = JapaneseDatePeriodExtractorConfiguration().which_week_regex + self._first_last_of_year_regex = JapaneseDatePeriodExtractorConfiguration().first_last_of_year_regex + self._season_with_year = JapaneseDatePeriodExtractorConfiguration().season_with_year_regex + self._quarter_regex = JapaneseDatePeriodExtractorConfiguration().quarter_regex + self._decade_regex = JapaneseDatePeriodExtractorConfiguration().decade_regex + self._century_regex = JapaneseDatePeriodExtractorConfiguration().century_regex + self._relative_regex = JapaneseDateExtractorConfiguration().relative_regex + self._relative_month_regex = JapaneseDateExtractorConfiguration().relative_month_regex + self._later_early_period_regex = JapaneseDatePeriodExtractorConfiguration().later_early_period_regex + self._date_period_with_ago_and_later = JapaneseDatePeriodExtractorConfiguration().date_point_with_ago_and_later + self._reference_date_period_regex = JapaneseDatePeriodExtractorConfiguration().reference_date_period_regex + self._complex_date_period_regex = JapaneseDatePeriodExtractorConfiguration().complex_date_period_regex + self._duration_relative_duration_unit_regex = ( + JapaneseDateExtractorConfiguration().duration_relative_duration_unit_regex + ) + self._unit_map = JapaneseDateTime.ParserConfigurationUnitMap + self._cardinal_map = JapaneseDateTime.ParserConfigurationCardinalMap + self._day_of_month = JapaneseDateTime.ParserConfigurationDayOfMonth + self._season_map = JapaneseDateTime.ParserConfigurationSeasonMap + self._month_of_year = JapaneseDateTime.ParserConfigurationMonthOfYear + self._token_before_date = '' + + self._wom_previous_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WoMPreviousRegex) + self._wom_next_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WoMNextRegex) + self._wom_last_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WoMLastRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.NextPrefixRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.AfterRegex) + self._next_month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationNextMonthRegex) + self._after_next_month_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.ParserConfigurationAfterNextMonthRegex + ) + self._last_month_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationLastMonthRegex) + self._next_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationNextYearRegex) + self._after_next_year_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.ParserConfigurationAfterNextYearRegex + ) + self._last_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationLastYearRegex) + self._this_year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationThisYearRegex) + self._two_num_year = int(JapaneseDateTime.TwoNumYear) + + self._duration_extractor = config.duration_extractor + self._duration_parser = config.duration_parser + + def to_month_number(self, month_str: str) -> int: + return ( + self.month_of_year[month_str] % 12 if self.month_of_year[month_str] > 12 else self.month_of_year[month_str] + ) + + def is_month_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in JapaneseDateTime.MonthTerms) + + def is_weekend(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in JapaneseDateTime.WeekendTerms) + + def is_week_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in JapaneseDateTime.WeekTerms) + + def is_year_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.startswith(o) or trimmed_source.endswith(o) for o in JapaneseDateTime.YearTerms) + + def is_this_year(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in JapaneseDateTime.ThisYearTerms) + + def is_year_to_date(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in JapaneseDateTime.YearToDateTerms) + + def is_last_year(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in JapaneseDateTime.LastYearTerms) + + def is_next_year(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in JapaneseDateTime.NextYearTerms) + + def is_year_after_next(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in JapaneseDateTime.YearAfterNextTerms) + + def is_year_before_last(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in JapaneseDateTime.YearBeforeLastTerms) + + def get_swift_month(self, source: str) -> int: + # Current month: 今月 + value = 0 + + if self.next_month_regex.search(source): + value = 1 + elif self.last_month_regex.search(source): + value = -1 + elif self.after_next_month_regex.search(source): + value = 2 + + return value + + def get_swift_year(self, source: str) -> int: + value = -10 + + if self.after_next_year_regex.search(source): + value = 2 + elif self.next_year_regex.search(source): + value = 1 + elif self.last_year_regex.search(source): + value = -1 + elif self.this_year_regex.search(source): + # Current year: 今年 + value = 0 + + return value diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetime_extractor_config.py new file mode 100644 index 0000000000..4f3215ecf7 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetime_extractor_config.py @@ -0,0 +1,100 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.CJK import ( + BaseCJKDateExtractor, + BaseCJKDurationExtractor, + BaseCJKTimeExtractor, + CJKDateTimeExtractorConfiguration, +) +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.date_extractor_config import JapaneseDateExtractorConfiguration +from recognizers_date_time.date_time.japanese.duration_extractor_config import JapaneseDurationExtractorConfiguration +from recognizers_date_time.date_time.japanese.time_extractor_config import JapaneseTimeExtractorConfiguration +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class JapaneseDateTimeExtractorConfiguration(CJKDateTimeExtractorConfiguration): + @property + def preposition_regex(self) -> Pattern: + return self._preposition_regex + + @property + def now_regex(self) -> Pattern: + return self._now_regex + + @property + def night_regex(self) -> Pattern: + return self._night_regex + + @property + def time_of_special_day_regex(self) -> Pattern: + return self._time_of_special_day_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def datetime_period_unit_regex(self) -> Pattern: + return self._datetime_period_unit_regex + + @property + def duration_relative_duration_unit_regex(self) -> Pattern: + return self._duration_relative_duration_unit_regex + + @property + def ago_later_regex(self) -> Pattern: + return self._ago_later_regex + + @property + def connector_regex(self) -> Pattern: + return self._connector_regex + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def date_point_extractor(self) -> DateTimeExtractor: + return self._date_point_extractor + + @property + def time_point_extractor(self) -> DateTimeExtractor: + return self._time_point_extractor + + @property + def ambiguity_date_time_filters(self) -> Dict[Pattern, Pattern]: + return self._ambiguity_date_time_filters + + def __init__(self): + super().__init__() + self._date_point_extractor = BaseCJKDateExtractor(JapaneseDateExtractorConfiguration()) + self._time_point_extractor = BaseCJKTimeExtractor(JapaneseTimeExtractorConfiguration()) + self._duration_extractor = BaseCJKDurationExtractor(JapaneseDurationExtractorConfiguration()) + + self._preposition_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.NowRegex) + self._night_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.NightRegex) + self._time_of_special_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeOfSpecialDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeOfDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.AfterRegex) + self._datetime_period_unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodUnitRegex) + self._duration_relative_duration_unit_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.DurationRelativeDurationUnitRegex + ) + self._ago_later_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.AgoLaterRegex) + self._connector_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ConnectorRegex) + + self._ambiguity_date_time_filters = DefinitionLoader.load_ambiguity_filters( + JapaneseDateTime.AmbiguityDateTimeFiltersDict + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetime_parser_config.py new file mode 100644 index 0000000000..63a1ab53ac --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetime_parser_config.py @@ -0,0 +1,192 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.base_datetime import MatchedTimex +from recognizers_date_time.date_time.CJK import CJKCommonDateTimeParserConfiguration, CJKDateTimeParserConfiguration +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.datetime_extractor_config import JapaneseDateTimeExtractorConfiguration +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + + +class JapaneseDateTimeParserConfiguration(CJKDateTimeParserConfiguration): + @property + def lunar_regex(self) -> Pattern: + return self._lunar_regex + + @property + def lunar_holiday_regex(self) -> Pattern: + return self._lunar_holiday_regex + + @property + def simple_am_regex(self) -> Pattern: + return self._simple_am_regex + + @property + def simple_pm_regex(self) -> Pattern: + return self._simple_pm_regex + + @property + def now_time_regex(self) -> Pattern: + return self._now_time_regex + + @property + def recently_time_regex(self) -> Pattern: + return self._recently_time_regex + + @property + def asap_time_regex(self) -> Pattern: + return self._asap_time_regex + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def now_regex(self) -> Pattern: + return self._now_regex + + @property + def time_of_special_day_regex(self) -> Pattern: + return self._time_of_special_day_regex + + @property + def datetime_period_unit_regex(self) -> Pattern: + return self._datetime_period_unit_regex + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def duration_relative_duration_unit_regex(self) -> Pattern: + return self._duration_relative_duration_unit_regex + + @property + def ago_later_regex(self) -> Pattern: + return self._ago_later_regex + + def __init__(self, config: CJKCommonDateTimeParserConfiguration = None): + super().__init__() + self._integer_extractor = config.integer_extractor + self._date_extractor = config.date_extractor + self._time_extractor = config.time_extractor + self._duration_extractor = config.duration_extractor + + self._date_parser = config.date_parser + self._duration_parser = config.duration_parser + self._time_parser = config.time_parser + + self._number_parser = config.number_parser + + self._unit_map = JapaneseDateTime.ParserConfigurationUnitMap + self._now_regex = JapaneseDateTimeExtractorConfiguration().now_regex + self._time_of_special_day_regex = JapaneseDateTimeExtractorConfiguration().time_of_special_day_regex + self._datetime_period_unit_regex = JapaneseDateTimeExtractorConfiguration().datetime_period_unit_regex + self._before_regex = JapaneseDateTimeExtractorConfiguration().before_regex + self._after_regex = JapaneseDateTimeExtractorConfiguration().after_regex + self._duration_relative_duration_unit_regex = ( + JapaneseDateTimeExtractorConfiguration().duration_relative_duration_unit_regex + ) + self._ago_later_regex = JapaneseDateTimeExtractorConfiguration().ago_later_regex + + self._lunar_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.LunarRegex) + self._lunar_holiday_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.LunarHolidayRegex) + self._simple_am_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimeSimpleAmRegex) + self._simple_pm_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimeSimplePmRegex) + self._now_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.NowTimeRegex) + self._recently_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.RecentlyTimeRegex) + self._asap_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.AsapTimeRegex) + + def get_matched_now_timex(self, source: str) -> MatchedTimex: + source = source.strip().lower() + if RegExpUtility.match_end(self.now_time_regex, source, False): + timex = 'PRESENT_REF' + elif RegExpUtility.exact_match(self.recently_time_regex, source, False): + timex = 'PAST_REF' + elif RegExpUtility.exact_match(self.asap_time_regex, source, False): + timex = 'FUTURE_REF' + else: + return MatchedTimex(False, None) + + return MatchedTimex(True, timex) + + def get_swift_day(self, source: str) -> int: + source = source.strip().lower() + swift = 0 + + if source == '今天' or source == '今日' or source == '最近': + swift = 0 + elif source.startswith('明'): + swift = 1 + elif source.startswith('昨'): + swift = -1 + elif source == '大后天' or source == '大後天': + swift = 3 + elif source == '大前天': + swift = -3 + elif source == '后天' or source == '後天': + swift = 2 + elif source == '前天': + swift = -2 + + return swift + + def adjust_by_time_of_day(self, source: str, hour: int, swift: int) -> None: + # TODO: THIS DOESN'T DO ANYTHING + if source == '今晚': + if hour < Constants.HALF_DAY_HOUR_COUNT: + hour += Constants.HALF_DAY_HOUR_COUNT + elif source == '今早': + if hour >= Constants.HALF_DAY_HOUR_COUNT: + hour -= Constants.HALF_DAY_HOUR_COUNT + elif source == '明晚': + swift = 1 + if hour < Constants.HALF_DAY_HOUR_COUNT: + hour += Constants.HALF_DAY_HOUR_COUNT + elif source == '明晨': + swift = -1 + if hour >= Constants.HALF_DAY_HOUR_COUNT: + hour -= Constants.HALF_DAY_HOUR_COUNT + elif "昨晚": + swift = -1 + if hour < Constants.HALF_DAY_HOUR_COUNT: + hour += Constants.HALF_DAY_HOUR_COUNT diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetimeperiod_extractor_config.py new file mode 100644 index 0000000000..1efc9036dd --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetimeperiod_extractor_config.py @@ -0,0 +1,203 @@ +from typing import Pattern + +from recognizers_date_time.date_time.CJK import ( + BaseCJKDateExtractor, + BaseCJKDateTimeExtractor, + BaseCJKDurationExtractor, + BaseCJKTimeExtractor, + BaseCJKTimePeriodExtractor, + CJKDateTimePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.date_extractor_config import JapaneseDateExtractorConfiguration +from recognizers_date_time.date_time.japanese.datetime_extractor_config import JapaneseDateTimeExtractorConfiguration +from recognizers_date_time.date_time.japanese.duration_extractor_config import JapaneseDurationExtractorConfiguration +from recognizers_date_time.date_time.japanese.time_extractor_config import JapaneseTimeExtractorConfiguration +from recognizers_date_time.date_time.japanese.timeperiod_extractor_config import ( + JapaneseTimePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.utilities import MatchedIndex +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number.number.japanese.extractors import JapaneseCardinalExtractor +from recognizers_text import Extractor +from recognizers_text.utilities import RegExpUtility + + +class JapaneseDateTimePeriodExtractorConfiguration(CJKDateTimePeriodExtractorConfiguration): + @property + def till_regex(self) -> Pattern: + return self._till_regex + + @property + def from_prefix_regex(self) -> Pattern: + return self._from_prefix_regex + + @property + def from_suffix_regex(self) -> Pattern: + return self._from_suffix_regex + + @property + def connector_regex(self) -> Pattern: + return self._connector_regex + + @property + def preposition_regex(self) -> Pattern: + return self._preposition_regex + + @property + def zhijian_regex(self) -> Pattern: + return self._zhijian_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def followed_unit(self) -> Pattern: + return self._followed_unit + + @property + def past_regex(self) -> Pattern: + return self._past_regex + + @property + def future_regex(self) -> Pattern: + return self._future_regex + + @property + def weekday_regex(self) -> Pattern: + return self._weekday_regex + + @property + def time_period_left_regex(self) -> Pattern: + return self._time_period_left_regex + + @property + def relative_regex(self) -> Pattern: + return self._relative_regex + + @property + def rest_of_date_regex(self) -> Pattern: + return self._rest_of_date_regex + + @property + def am_pm_desc_regex(self) -> Pattern: + return self._am_pm_desc_regex + + @property + def before_after_regex(self) -> Pattern: + return self._before_after_regex + + @property + def hour_regex(self) -> Pattern: + return self._hour_regex + + @property + def hour_num_regex(self) -> Pattern: + return self._hour_num_regex + + @property + def this_regex(self) -> Pattern: + return self._this_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def number_combined_with_unit(self) -> Pattern: + return self._number_combined_with_unit + + @property + def cardinal_extractor(self) -> Extractor: + return self._cardinal_extractor + + @property + def single_date_extractor(self) -> DateTimeExtractor: + return self._single_date_extractor + + @property + def single_time_extractor(self) -> DateTimeExtractor: + return self._single_time_extractor + + @property + def single_date_time_extractor(self) -> DateTimeExtractor: + return self._single_date_time_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + def __init__(self): + super().__init__() + + self._cardinal_extractor = JapaneseCardinalExtractor() + + self._single_date_extractor = BaseCJKDateExtractor(JapaneseDateExtractorConfiguration()) + self._single_time_extractor = BaseCJKTimeExtractor(JapaneseTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseCJKDateTimeExtractor(JapaneseDateTimeExtractorConfiguration()) + self._duration_extractor = BaseCJKDurationExtractor(JapaneseDurationExtractorConfiguration()) + self._time_period_extractor = BaseCJKTimePeriodExtractor(JapaneseTimePeriodExtractorConfiguration()) + + self._from_prefix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodFromPrefixRegex) + self._from_suffix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodFromSuffixRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodTillRegex) + self._connector_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodConnectorRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodPrepositionRegex) + self._zhijian_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ZhijianRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeOfDayRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.SpecificTimeOfDayRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodUnitRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodFollowedUnit) + self._past_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.FutureRegex) + self._weekday_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.WeekDayRegex) + self._time_period_left_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimePeriodLeftRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.RelativeRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.RestOfDateRegex) + self._am_pm_desc_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.AmPmDescRegex) + self._before_after_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.BeforeAfterRegex) + + self._hour_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.HourRegex) + self._hour_num_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.HourNumRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodThisRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodLastRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DatePeriodNextRegex) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.NumberCombinedWithUnit) + + def get_from_token_index(self, text: str) -> MatchedIndex: + index = -1 + match = RegExpUtility.match_end(self.from_prefix_regex, text, True) + if match.success: + return MatchedIndex(True, match.index) + else: + match = RegExpUtility.match_end(self.from_suffix_regex, text, True) + if match.success: + return MatchedIndex(True, match.index) + return MatchedIndex(False, index) + + def has_connector_token(self, text: str) -> MatchedIndex: + return RegExpUtility.exact_match(self.connector_regex, text, True) + + def get_between_token_index(self, text: str) -> MatchedIndex: + index = -1 + match = RegExpUtility.get_matches(self.zhijian_regex, text) + if match and match[0].success: + return MatchedIndex(True, match.index) + return MatchedIndex(False, index) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetimeperiod_parser_config.py new file mode 100644 index 0000000000..fdbe9bf2b1 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/datetimeperiod_parser_config.py @@ -0,0 +1,226 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.CJK import ( + CJKCommonDateTimeParserConfiguration, + CJKDateTimePeriodParserConfiguration, + MatchedTimeRegexAndSwift, +) +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.datetimeperiod_extractor_config import ( + JapaneseDateTimePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities import TimexUtil +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number.number import AgnosticNumberParserFactory, JapaneseNumberParserConfiguration, ParserType +from recognizers_number.number.japanese.extractors import JapaneseCardinalExtractor +from recognizers_text import Extractor, Parser +from recognizers_text.utilities import RegExpUtility + + +class JapaneseDateTimePeriodParserConfiguration(CJKDateTimePeriodParserConfiguration): + @property + def mo_regex(self) -> Pattern: + return self._mo_regex + + @property + def mi_regex(self) -> Pattern: + return self._mi_regex + + @property + def af_regex(self) -> Pattern: + return self._af_regex + + @property + def ev_regex(self) -> Pattern: + return self._ev_regex + + @property + def ni_regex(self) -> Pattern: + return self._ni_regex + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def duration_parser(self) -> DateTimeParser: + return self._duration_parser + + @property + def cardinal_extractor(self) -> Extractor: + return self._cardinal_extractor + + @property + def cardinal_parser(self) -> Parser: + return self._cardinal_parser + + @property + def date_parser(self) -> DateTimeParser: + return self._date_parser + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def date_time_parser(self) -> DateTimeParser: + return self._date_time_parser + + @property + def time_period_parser(self) -> DateTimeParser: + return self._time_period_parser + + @property + def specific_time_of_day_regex(self) -> Pattern: + return self._specific_time_of_day_regex + + @property + def time_of_day_regex(self) -> Pattern: + return self._time_of_day_regex + + @property + def next_regex(self) -> Pattern: + return self._next_regex + + @property + def last_regex(self) -> Pattern: + return self._last_regex + + @property + def past_regex(self) -> Pattern: + return self._past_regex + + @property + def future_regex(self) -> Pattern: + return self._future_regex + + @property + def weekday_regex(self) -> Pattern: + return self._weekday_regex + + @property + def time_period_left_regex(self) -> Pattern: + return self._time_period_left_regex + + @property + def unit_regex(self) -> Pattern: + return self._unit_regex + + @property + def rest_of_date_regex(self) -> Pattern: + return self._rest_of_date_regex + + @property + def am_pm_desc_regex(self) -> Pattern: + return self._am_pm_desc_regex + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + def __init__(self, config: CJKCommonDateTimeParserConfiguration): + + super().__init__() + self._cardinal_extractor = JapaneseCardinalExtractor() + self._cardinal_parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, JapaneseNumberParserConfiguration() + ) + + self._date_extractor = config.date_extractor + self._time_extractor = config.time_extractor + self._date_time_extractor = config.date_time_extractor + self._time_period_extractor = config.time_period_extractor + self._duration_extractor = config.duration_extractor + self._duration_parser = config.duration_parser + self._date_parser = config.date_parser + self._time_parser = config.time_parser + self._date_time_parser = config.date_time_parser + self._time_period_parser = config.time_period_parser + + self._mo_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodMORegex) + self._mi_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodMIRegex) + self._af_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodAFRegex) + self._ev_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodEVRegex) + self._ni_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DateTimePeriodNIRegex) + + self._specific_time_of_day_regex = JapaneseDateTimePeriodExtractorConfiguration().specific_time_of_day_regex + self._time_of_day_regex = JapaneseDateTimePeriodExtractorConfiguration().time_of_day_regex + self._next_regex = JapaneseDateTimePeriodExtractorConfiguration().next_regex + self._last_regex = JapaneseDateTimePeriodExtractorConfiguration().last_regex + self._past_regex = JapaneseDateTimePeriodExtractorConfiguration().past_regex + self._future_regex = JapaneseDateTimePeriodExtractorConfiguration().future_regex + self._weekday_regex = JapaneseDateTimePeriodExtractorConfiguration().weekday_regex + self._time_period_left_regex = JapaneseDateTimePeriodExtractorConfiguration().time_period_left_regex + self._unit_regex = JapaneseDateTimePeriodExtractorConfiguration().unit_regex + self._rest_of_date_regex = JapaneseDateTimePeriodExtractorConfiguration().rest_of_date_regex + self._am_pm_desc_regex = JapaneseDateTimePeriodExtractorConfiguration().am_pm_desc_regex + self._unit_map = config.unit_map + + def get_matched_time_range(self, text: str) -> MatchedTimeRegexAndSwift: + trimmed_text = text.strip().lower() + + begin_hour = 0 + end_hour = 0 + end_minute = 0 + swift = 0 + + tod = "" + + if trimmed_text == "今晚": + swift = 0 + tod = Constants.EVENING + elif trimmed_text == "今早" or trimmed_text == "今晨": + swift = 0 + tod = Constants.MORNING + elif trimmed_text == "明晚": + swift = 1 + tod = Constants.EVENING + elif trimmed_text == "明早" or trimmed_text == "明晨": + swift = 1 + tod = Constants.MORNING + elif trimmed_text == "昨晚": + swift = -1 + tod = Constants.EVENING + + if RegExpUtility.get_matches(self.mo_regex, trimmed_text): + tod = Constants.MORNING + elif RegExpUtility.get_matches(self.mi_regex, trimmed_text): + tod = Constants.MIDDAY + elif RegExpUtility.get_matches(self.af_regex, trimmed_text): + tod = Constants.AFTERNOON + elif RegExpUtility.get_matches(self.ev_regex, trimmed_text): + tod = Constants.EVENING + elif RegExpUtility.get_matches(self.ni_regex, trimmed_text): + tod = Constants.NIGHT + elif not tod: + tod_symbol = None + return MatchedTimeRegexAndSwift(False, tod_symbol, begin_hour, end_hour, end_minute, swift) + + parse_result = TimexUtil.resolve_time_of_day(tod) + tod_symbol = parse_result.timex + begin_hour = parse_result.begin_hour + end_hour = parse_result.end_hour + end_minute = parse_result.end_min + + return MatchedTimeRegexAndSwift(True, tod_symbol, begin_hour, end_hour, end_minute, swift) + + def get_matched_time_range_and_swift(self, text: str) -> MatchedTimeRegexAndSwift: + return self.get_matched_time_range(text) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/duration_extractor_config.py new file mode 100644 index 0000000000..bc33952a31 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/duration_extractor_config.py @@ -0,0 +1,119 @@ +from typing import Dict, List, Pattern + +from recognizers_date_time.date_time.CJK import CJKDurationExtractorConfiguration +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number.culture import Culture, CultureInfo +from recognizers_number_with_unit.number_with_unit import ( + JapaneseNumberWithUnitExtractorConfiguration, + NumberWithUnitExtractor, +) +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class JapaneseDurationExtractorConfiguration(CJKDurationExtractorConfiguration): + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def duration_unit_regex(self) -> Pattern: + return self._duration_unit_regex + + @property + def an_unit_regex(self) -> Pattern: + return self._an_unit_regex + + @property + def duration_connector_regex(self) -> Pattern: + return self._duration_connector_regex + + @property + def all_regex(self) -> Pattern: + return self._all_regex + + @property + def half_regex(self) -> Pattern: + return self._half_regex + + @property + def relative_duration_unit_regex(self) -> Pattern: + return self._relative_duration_unit_regex + + @property + def during_regex(self) -> Pattern: + return self._during_regex + + @property + def some_regex(self) -> Pattern: + return self._some_regex + + @property + def more_or_less_regex(self) -> Pattern: + return self._more_or_less_regex + + @property + def internal_extractor(self) -> Extractor: + return self._internal_extractor + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def unit_value_map(self) -> Dict[str, float]: + return self._unit_value_map + + @property + def ambiguity_duration_filters_dict(self) -> Dict[Pattern, Pattern]: + return self._ambiguity_duration_filters_dict + + class DurationExtractorConfiguration(JapaneseNumberWithUnitExtractorConfiguration): + @property + def duration_suffix_list(self) -> Dict[str, str]: + return JapaneseDateTime.DurationSuffixList + + @property + def extract_type(self) -> str: + return Constants.SYS_DATETIME_DURATION + + @property + def suffix_list(self) -> Dict[str, str]: + return self.duration_suffix_list + + @property + def prefix_list(self) -> Dict[str, str]: + return {} + + @property + def ambiguous_unit_list(self) -> List[str]: + return JapaneseDateTime.DurationAmbiguousUnits + + def __init__(self, culture_info: CultureInfo = CultureInfo(Culture.Japanese)): + super().__init__(culture_info) + + def __init__(self, merge: bool = True): + super().__init__() + self.merge = merge + self._year_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationYearRegex) + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationUnitRegex) + self._an_unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.AnUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationConnectorRegex) + self._all_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationAllRegex) + self._half_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationHalfRegex) + self._relative_duration_unit_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.DurationRelativeDurationUnitRegex + ) + self._during_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationDuringRegex) + self._some_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationSomeRegex) + self._more_or_less_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.DurationMoreOrLessRegex) + + self._internal_extractor = NumberWithUnitExtractor(self.DurationExtractorConfiguration()) + + self._unit_map = JapaneseDateTime.ParserConfigurationUnitMap + self._unit_value_map = JapaneseDateTime.DurationUnitValueMap + self._ambiguity_duration_filters_dict = DefinitionLoader.load_ambiguity_filters( + JapaneseDateTime.AmbiguityDurationFiltersDict + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/duration_parser_config.py new file mode 100644 index 0000000000..7ef48c5d44 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/duration_parser_config.py @@ -0,0 +1,77 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.CJK import ( + BaseCJKDurationExtractor, + CJKCommonDateTimeParserConfiguration, + CJKDurationParserConfiguration, +) +from recognizers_date_time.date_time.japanese.duration_extractor_config import JapaneseDurationExtractorConfiguration +from recognizers_date_time.date_time.utilities import DateTimeExtractor +from recognizers_number.culture import Culture, CultureInfo +from recognizers_number_with_unit import JapaneseNumberWithUnitParserConfiguration, NumberWithUnitParser +from recognizers_text import Parser + + +class JapaneseDurationParserConfiguration(CJKDurationParserConfiguration): + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def internal_parser(self) -> Parser: + return self._internal_parser + + @property + def year_regex(self) -> Pattern: + return self._year_regex + + @property + def some_regex(self) -> Pattern: + return self._some_regex + + @property + def more_or_less_regex(self) -> Pattern: + return self._more_or_less_regex + + @property + def duration_unit_regex(self) -> Pattern: + return self._duration_unit_regex + + @property + def an_unit_regex(self) -> Pattern: + return self._an_unit_regex + + @property + def duration_connector_regex(self) -> Pattern: + return self._duration_connector_regex + + @property + def unit_map(self) -> Dict[str, str]: + return self._unit_map + + @property + def unit_value_map(self) -> Dict[str, float]: + return self._unit_value_map + + class DurationParserConfiguration(JapaneseNumberWithUnitParserConfiguration): + def __init__(self, culture_info: CultureInfo = CultureInfo(Culture.Japanese)): + super().__init__(culture_info) + self.bind_dictionary = ( + JapaneseDurationExtractorConfiguration.DurationExtractorConfiguration.duration_suffix_list + ) + + def __init__(self, config: CJKCommonDateTimeParserConfiguration): + super().__init__() + self._internal_parser = NumberWithUnitParser(self.DurationParserConfiguration()) + + self._duration_extractor = BaseCJKDurationExtractor(JapaneseDurationExtractorConfiguration(), False) + + self._year_regex = JapaneseDurationExtractorConfiguration().year_regex + self._some_regex = JapaneseDurationExtractorConfiguration().some_regex + self._more_or_less_regex = JapaneseDurationExtractorConfiguration().more_or_less_regex + self._duration_unit_regex = JapaneseDurationExtractorConfiguration().duration_unit_regex + self._an_unit_regex = JapaneseDurationExtractorConfiguration().an_unit_regex + self._duration_connector_regex = JapaneseDurationExtractorConfiguration().duration_connector_regex + + self._unit_map = config.unit_map + self._unit_value_map = config.unit_value_map diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/holiday_extractor_config.py new file mode 100644 index 0000000000..b0653d0511 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/holiday_extractor_config.py @@ -0,0 +1,29 @@ +from typing import List, Pattern + +from recognizers_date_time.date_time.CJK import CJKHolidayExtractorConfiguration +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_text.utilities import RegExpUtility + + +class JapaneseHolidayExtractorConfiguration(CJKHolidayExtractorConfiguration): + @property + def holiday_regexes(self) -> List[Pattern]: + return self._holiday_regexes + + @property + def lunar_holiday_regex(self) -> Pattern: + return self._lunar_holiday_regex + + @property + def holiday_regex_list(self) -> List[Pattern]: + return self._holiday_regexes + + def __init__(self): + super().__init__() + self._lunar_holiday_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.LunarHolidayRegex) + self._holiday_regex_list = [ + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.HolidayRegexList1), + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.HolidayRegexList2), + self._lunar_holiday_regex, + ] + self._holiday_regexes = self._holiday_regex_list diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/holiday_parser_config.py new file mode 100644 index 0000000000..b06cec831a --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/holiday_parser_config.py @@ -0,0 +1,150 @@ +from datetime import datetime +from typing import Callable, Dict, List, Pattern + +from recognizers_date_time.date_time.CJK import CJKCommonDateTimeParserConfiguration, CJKHolidayParserConfiguration +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + + +class JapaneseHolidayParserConfiguration(CJKHolidayParserConfiguration): + + @property + def fixed_holidays_dict(self) -> Dict[str, Callable[[int], datetime]]: + return self._fixed_holidays_dict + + @property + def holiday_func_dict(self) -> Dict[str, Callable[[int], datetime]]: + return self._holiday_func_dictionary + + @property + def no_fixed_timex(self) -> Dict[str, str]: + return self._no_fixed_timex + + @property + def integer_extractor(self) -> BaseNumberExtractor: + return self._integer_extractor + + @property + def number_parser(self) -> BaseNumberParser: + return self._number_parser + + @property + def holiday_regex_list(self) -> List[Pattern]: + return self._holiday_regex_list + + @property + def lunar_holiday_regex(self) -> Pattern: + return self._lunar_holiday_regex + + def __init__(self, config: CJKCommonDateTimeParserConfiguration): + super().__init__() + self._no_fixed_timex = JapaneseDateTime.HolidayNoFixedTimex + self._integer_extractor = config.integer_extractor + self._number_parser = config.number_parser + + self._lunar_holiday_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.LunarHolidayRegex) + self._holiday_regex_list = self._holiday_regex_list = [ + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.HolidayRegexList1), + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.HolidayRegexList2), + self.lunar_holiday_regex, + ] + + self._holiday_func_dictionary = self._init_holiday_funcs() + self._fixed_holidays_dict = self._init_fixed_holiday_funcs() + + def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: + return dict( + [ + ('父亲节', CJKHolidayParserConfiguration.fathers_day), + ('父の日', CJKHolidayParserConfiguration.fathers_day), + ('母亲节', CJKHolidayParserConfiguration.mothers_day), + ('母の日', CJKHolidayParserConfiguration.mothers_day), + ('感恩节', CJKHolidayParserConfiguration.thanksgiving_day), + ('感謝祭の日', CJKHolidayParserConfiguration.thanksgiving_day), + ('感謝祭', CJKHolidayParserConfiguration.thanksgiving_day), + ('キング牧師記念日', CJKHolidayParserConfiguration.martin_luther_king_day), + ] + ) + + def _init_fixed_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: + return dict( + [ + ("元旦", CJKHolidayParserConfiguration.new_year), + ("旧正月", CJKHolidayParserConfiguration.new_year), + ("元旦节", CJKHolidayParserConfiguration.new_year), + ("お正月", CJKHolidayParserConfiguration.new_year), + ("独立記念日", CJKHolidayParserConfiguration.usa_independence_day), + ("旧暦の正月初一", CJKHolidayParserConfiguration.spring_day), + ("教师节", CJKHolidayParserConfiguration.teacher_day), + ("教師の日", CJKHolidayParserConfiguration.teacher_day), + ("青年节", CJKHolidayParserConfiguration.youth_day), + ("青年の日", CJKHolidayParserConfiguration.youth_day), + ("儿童节", CJKHolidayParserConfiguration.children_day), + ("子供の日", CJKHolidayParserConfiguration.children_day), + ("妇女节", CJKHolidayParserConfiguration.female_day), + ("国際婦人デー", CJKHolidayParserConfiguration.female_day), + ("植树节", CJKHolidayParserConfiguration.tree_plant_day), + ("植樹祭", CJKHolidayParserConfiguration.tree_plant_day), + ("情人节", CJKHolidayParserConfiguration.lover_day), + ("バレンタインデー", CJKHolidayParserConfiguration.lover_day), + ("圣诞节", CJKHolidayParserConfiguration.christmas_day), + ("クリスマスの日", CJKHolidayParserConfiguration.christmas_day), + ("クリスマス", CJKHolidayParserConfiguration.christmas_day), + ("クリスマスイブ", CJKHolidayParserConfiguration.christmas_eve), + ("新年", CJKHolidayParserConfiguration.new_year), + ("復活祭", CJKHolidayParserConfiguration.easter_day), + ("愚人节", CJKHolidayParserConfiguration.fool_day), + ("エイプリルフール", CJKHolidayParserConfiguration.fool_day), + ("五一", CJKHolidayParserConfiguration.labor_day), + ("劳动节", CJKHolidayParserConfiguration.labor_day), + ("メーデー", CJKHolidayParserConfiguration.labor_day), + ("国際的な労働者の日", CJKHolidayParserConfiguration.labor_day), + ("万圣节", CJKHolidayParserConfiguration.halloween_day), + ("ハロウィン", CJKHolidayParserConfiguration.halloween_day), + ("中秋节", CJKHolidayParserConfiguration.mid_autumn_day), + ("中秋", CJKHolidayParserConfiguration.mid_autumn_day), + ("中秋節", CJKHolidayParserConfiguration.mid_autumn_day), + ("春节", CJKHolidayParserConfiguration.spring_day), + ("除夕", CJKHolidayParserConfiguration.new_year_eve), + ("大晦日", CJKHolidayParserConfiguration.new_year_eve), + ("元宵节", CJKHolidayParserConfiguration.lantern_day), + ("元宵節", CJKHolidayParserConfiguration.lantern_day), + ("清明节", CJKHolidayParserConfiguration.qing_ming_day), + ("清明節", CJKHolidayParserConfiguration.qing_ming_day), + ("清明", CJKHolidayParserConfiguration.qing_ming_day), + ("端午节", CJKHolidayParserConfiguration.dragon_boat_day), + ("端午の節句", CJKHolidayParserConfiguration.boys_festival), + ("端午", CJKHolidayParserConfiguration.dragon_boat_day), + ("国庆节", CJKHolidayParserConfiguration.jap_national_day), + ("国慶節", CJKHolidayParserConfiguration.jap_national_day), + ("建军节", CJKHolidayParserConfiguration.jap_mil_build_day), + ("建軍節", CJKHolidayParserConfiguration.jap_mil_build_day), + ("女生节", CJKHolidayParserConfiguration.girls_day), + ("ガールズデー", CJKHolidayParserConfiguration.girls_day), + ("光棍节", CJKHolidayParserConfiguration.singles_day), + ("双十一", CJKHolidayParserConfiguration.singles_day), + ("ダブル十一", CJKHolidayParserConfiguration.singles_day), + ("シングルデー", CJKHolidayParserConfiguration.singles_day), + ("重阳节", CJKHolidayParserConfiguration.chong_yang_day), + ("重陽節", CJKHolidayParserConfiguration.chong_yang_day), + ] + ) + + def get_swift_year(self, source: str) -> int: + # TODO move hardcoded values to resource file + trimmed_text = source.strip().lower() + swift = -10 + + if trimmed_text.endswith('前年') or trimmed_text.endswith('先年'): + swift = -1 + if trimmed_text.endswith('来年'): + swift = +1 + + return swift + + def sanitize_year_token(self, source: str) -> str: + # TODO move hardcoded values to resource file + if source.endswith('年'): + return source[0:-1] + return source diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/merged_extractor_config.py new file mode 100644 index 0000000000..235229df6b --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/merged_extractor_config.py @@ -0,0 +1,149 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.CJK import ( + BaseCJKDateTimeExtractor, + BaseCJKDateTimePeriodExtractor, + BaseCJKDurationExtractor, + BaseCJKHolidayExtractor, + BaseCJKTimeExtractor, + BaseCJKTimePeriodExtractor, + CJKMergedExtractorConfiguration, +) +from recognizers_date_time.date_time.CJK.base_date import BaseCJKDateExtractor +from recognizers_date_time.date_time.CJK.base_dateperiod import BaseCJKDatePeriodExtractor +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.date_extractor_config import JapaneseDateExtractorConfiguration +from recognizers_date_time.date_time.japanese.dateperiod_extractor_config import ( + JapaneseDatePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.japanese.datetime_extractor_config import JapaneseDateTimeExtractorConfiguration +from recognizers_date_time.date_time.japanese.datetimeperiod_extractor_config import ( + JapaneseDateTimePeriodExtractorConfiguration, +) +from recognizers_date_time.date_time.japanese.duration_extractor_config import JapaneseDurationExtractorConfiguration +from recognizers_date_time.date_time.japanese.holiday_extractor_config import JapaneseHolidayExtractorConfiguration +from recognizers_date_time.date_time.japanese.time_extractor_config import JapaneseTimeExtractorConfiguration +from recognizers_date_time.date_time.japanese.timeperiod_extractor_config import ( + JapaneseTimePeriodExtractorConfiguration, +) +from recognizers_date_time.resources.base_date_time import BaseDateTime +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class JapaneseMergedExtractorConfiguration(CJKMergedExtractorConfiguration): + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def unspecified_date_period_regex(self) -> Pattern: + return self._unspecified_date_period_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def until_regex(self) -> Pattern: + return self._until_regex + + @property + def since_prefix_regex(self) -> Pattern: + return self._since_prefix_regex + + @property + def since_suffix_regex(self) -> Pattern: + return self._since_suffix_regex + + @property + def around_prefix_regex(self) -> Pattern: + return self._around_prefix_regex + + @property + def around_suffix_regex(self) -> Pattern: + return self._around_suffix_regex + + @property + def equal_regex(self) -> Pattern: + return self._equal_regex + + @property + def potential_ambiguous_range_regex(self) -> Pattern: + return self._potential_ambiguous_range_regex + + @property + def ambiguous_range_modifier_prefix(self) -> Pattern: + return self._ambiguous_range_modifier_prefix + + @property + def date_extractor(self) -> DateTimeExtractor: + return self._date_extractor + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def date_time_extractor(self) -> DateTimeExtractor: + return self._date_time_extractor + + @property + def date_period_extractor(self) -> DateTimeExtractor: + return self._date_period_extractor + + @property + def time_period_extractor(self) -> DateTimeExtractor: + return self._time_period_extractor + + @property + def date_time_period_extractor(self) -> DateTimeExtractor: + return self._date_time_period_extractor + + @property + def duration_extractor(self) -> DateTimeExtractor: + return self._duration_extractor + + @property + def holiday_extractor(self) -> DateTimeExtractor: + return self._holiday_extractor + + @property + def ambiguous_range_modifier_regex(self) -> Pattern: + return self._ambiguous_range_modifier_regex + + @property + def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: + return self._ambiguity_filters_dict + + def __init__(self): + super().__init__() + self._ambiguity_filters_dict = DefinitionLoader.load_ambiguity_filters(JapaneseDateTime.AmbiguityFiltersDict) + self._potential_ambiguous_range_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.FromToRegex) + self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) + self._around_prefix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationAroundPrefix) + self._since_suffix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationSinceSuffix) + self._since_prefix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationSincePrefix) + self._until_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationUntil) + self._after_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationAfter) + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.UnspecificDatePeriodRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationBefore) + self._around_suffix_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.ParserConfigurationAroundSuffix) + self._ambiguous_range_modifier_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.AmbiguousRangeModifierPrefix + ) + self._ambiguity_filters_dict = DefinitionLoader.load_ambiguity_filters( + JapaneseDateTime.AmbiguityTimeFiltersDict + ) + + self._time_period_extractor = BaseCJKTimePeriodExtractor(JapaneseTimePeriodExtractorConfiguration()) + self._time_extractor = BaseCJKTimeExtractor(JapaneseTimeExtractorConfiguration()) + self._holiday_extractor = BaseCJKHolidayExtractor(JapaneseHolidayExtractorConfiguration()) + self._duration_extractor = BaseCJKDurationExtractor(JapaneseDurationExtractorConfiguration()) + self._date_time_period_extractor = BaseCJKDateTimePeriodExtractor( + JapaneseDateTimePeriodExtractorConfiguration() + ) + self._date_period_extractor = BaseCJKDatePeriodExtractor(JapaneseDatePeriodExtractorConfiguration()) + self._date_time_extractor = BaseCJKDateTimeExtractor(JapaneseDateTimeExtractorConfiguration()) + self._date_extractor = BaseCJKDateExtractor(JapaneseDateExtractorConfiguration()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/merged_parser_config.py new file mode 100644 index 0000000000..7638084688 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/merged_parser_config.py @@ -0,0 +1,52 @@ +from typing import Pattern + +from recognizers_date_time.date_time.CJK.base_merged import CJKMergedParserConfiguration +from recognizers_date_time.date_time.japanese import JapaneseMergedExtractorConfiguration + +from .common_configs import JapaneseCommonDateTimeParserConfiguration + + +class JapaneseMergedParserConfiguration(JapaneseCommonDateTimeParserConfiguration, CJKMergedParserConfiguration): + + @property + def before_regex(self) -> Pattern: + return self._before_regex + + @property + def after_regex(self) -> Pattern: + return self._after_regex + + @property + def since_prefix_regex(self) -> Pattern: + return self._since_prefix_regex + + @property + def since_suffix_regex(self) -> Pattern: + return self._since_suffix_regex + + @property + def around_prefix_regex(self) -> Pattern: + return self._around_prefix_regex + + @property + def around_suffix_regex(self) -> Pattern: + return self._around_suffix_regex + + @property + def equal_regex(self) -> Pattern: + return self._equal_regex + + @property + def until_regex(self) -> Pattern: + return self._until_regex + + def __init__(self, config): + JapaneseCommonDateTimeParserConfiguration.__init__(self) + self._before_regex = JapaneseMergedExtractorConfiguration().before_regex + self._after_regex = JapaneseMergedExtractorConfiguration().after_regex + self._since_prefix_regex = JapaneseMergedExtractorConfiguration().since_prefix_regex + self._since_suffix_regex = JapaneseMergedExtractorConfiguration().since_suffix_regex + self._around_prefix_regex = JapaneseMergedExtractorConfiguration().around_prefix_regex + self._around_suffix_regex = JapaneseMergedExtractorConfiguration().around_suffix_regex + self._equal_regex = JapaneseMergedExtractorConfiguration().equal_regex + self._until_regex = JapaneseMergedExtractorConfiguration().until_regex diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/time_extractor_config.py new file mode 100644 index 0000000000..1e8cc192de --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/time_extractor_config.py @@ -0,0 +1,142 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.CJK.base_time import CJKTimeExtractorConfiguration +from recognizers_date_time.date_time.data_structures import TimeType +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class JapaneseTimeExtractorConfiguration(CJKTimeExtractorConfiguration): + + @property + def ambiguity_time_filters_dict(self) -> Dict[Pattern, Pattern]: + return self._ambiguity_time_filters_dict + + @property + def regexes(self) -> Dict[Pattern, TimeType]: + return self._regexes + + @property + def hour_num_regex(self) -> Pattern: + return self._hour_num_regex + + @property + def minute_num_regex(self) -> Pattern: + return self._minute_num_regex + + @property + def second_num_regex(self) -> Pattern: + return self._second_num_regex + + @property + def hour_CJK_regex(self) -> Pattern: + return self._hour_CJK_regex + + @property + def minute_CJK_regex(self) -> Pattern: + return self._minute_CJK_regex + + @property + def second_CJK_regex(self) -> Pattern: + return self._second_CJK_regex + + @property + def clock_desc_regex(self) -> Pattern: + return self._clock_desc_regex + + @property + def minute_desc_regex(self) -> Pattern: + return self._minute_desc_regex + + @property + def second_desc_regex(self) -> Pattern: + return self._second_desc_regex + + @property + def ban_hour_prefix_range(self) -> Pattern: + return self._ban_hour_prefix_range + + # e.g: 12時 + @property + def hour_regex(self) -> Pattern: + return self._hour_regex + + @property + def minute_regex(self) -> Pattern: + return self._minute_regex + + @property + def second_regex(self) -> Pattern: + return self._second_regex + + @property + def half_regex(self) -> Pattern: + return self._half_regex + + @property + def quarter_regex(self) -> Pattern: + return self._quarter_regex + + # e.g: 十二五十から八|半分|瞬間 + @property + def CJK_time_regex(self) -> Pattern: + return self._CJK_time_regex + + # e.g: 12:23 + @property + def digit_time_regex(self) -> Pattern: + return self._digit_time_regex + + # e.g: 朝の9時 + @property + def day_desc_regex(self) -> Pattern: + return self._day_desc_regex + + @property + def approximate_desc_prefix_regex(self) -> Pattern: + return self._approximate_desc_prefix_regex + + @property + def approximate_desc_suffix_regex(self) -> Pattern: + return self._approximate_desc_suffix_regex + + def __init__(self): + super().__init__() + self._hour_CJK_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeHourCJKRegex) + self._minute_CJK_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeMinuteCJKRegex) + self._second_CJK_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeSecondCJKRegex) + + self._second_num_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeSecondNumRegex) + self._minute_num_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeMinuteNumRegex) + self._hour_num_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeHourNumRegex) + + self._clock_desc_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeClockDescRegex) + self._minute_desc_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeMinuteDescRegex) + self._second_desc_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeSecondDescRegex) + + self._ban_hour_prefix_range = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeBanHourPrefixRegex) + self._hour_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeHourRegex) + self._minute_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeMinuteRegex) + self._second_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeSecondRegex) + + self._approximate_desc_suffix_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.TimeApproximateDescSuffixRegex + ) + self._approximate_desc_prefix_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.TimeApproximateDescPreffixRegex + ) + + self._day_desc_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeDayDescRegex) + self._digit_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeDigitTimeRegex) + self._CJK_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeCJKTimeRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeQuarterRegex) + self._half_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeHalfRegex) + + self._regexes: Dict[Pattern, TimeType] = { + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeRegexes1): TimeType.CJKTime, + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeRegexes2): TimeType.DigitTime, + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeRegexes3): TimeType.LessTime, + } + self._ambiguity_time_filters_dict = DefinitionLoader.load_ambiguity_filters( + JapaneseDateTime.AmbiguityTimeFiltersDict + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/time_parser_config.py new file mode 100644 index 0000000000..7890dd5003 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/time_parser_config.py @@ -0,0 +1,36 @@ +from recognizers_date_time.date_time.CJK.base_configs import CJKCommonDateTimeParserConfiguration +from recognizers_date_time.date_time.CJK.base_time import CJKTimeParserConfiguration +from recognizers_date_time.date_time.data_structures import TimeType +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.time_extractor_config import JapaneseTimeExtractorConfiguration +from recognizers_date_time.date_time.utilities import TimeFunctions +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime + + +class JapaneseTimeParserConfiguration(CJKTimeParserConfiguration): + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def time_func(self) -> TimeFunctions: + return self._time_func + + @property + def function_map(self): + return self._function_map + + def __init__(self, config: CJKCommonDateTimeParserConfiguration): + super().__init__() + self._time_func = TimeFunctions( + number_dictionary=JapaneseDateTime.TimeNumberDictionary, + low_bound_desc=JapaneseDateTime.TimeLowBoundDesc, + day_desc_regex=JapaneseTimeExtractorConfiguration().day_desc_regex, + ) + self._function_map = { + TimeType.DigitTime: self.time_func.handle_digit, + TimeType.CJKTime: self.time_func.handle_kanji, + TimeType.LessTime: self.time_func.handle_less, + } + + self._time_extractor = config.time_extractor diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/timeperiod_extractor_config.py new file mode 100644 index 0000000000..69e72229e1 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/timeperiod_extractor_config.py @@ -0,0 +1,80 @@ +from typing import Dict, Pattern + +from recognizers_date_time.date_time.CJK.base_timeperiod import CJKTimePeriodExtractorConfiguration +from recognizers_date_time.date_time.data_structures import PeriodType +from recognizers_date_time.date_time.japanese.time_extractor_config import JapaneseTimeExtractorConfiguration +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class JapaneseTimePeriodExtractorConfiguration(CJKTimePeriodExtractorConfiguration): + + @property + def regexes(self) -> Dict[Pattern, PeriodType]: + return self._regexes + + @property + def ambiguity_time_period_filters_dict(self) -> Dict[Pattern, Pattern]: + return self._ambiguity_time_period_filters_dict + + @property + def time_period_connect_words(self) -> Pattern: + return self._time_period_connect_words + + @property + def CJK_time_regex(self) -> Pattern: + return self._CJK_time_regex + + @property + def left_CJK_time_regex(self) -> Pattern: + return self._left_CJK_time_regex + + @property + def right_CJK_time_regex(self) -> Pattern: + return self._right_CJK_time_regex + + @property + def digit_time_regex(self) -> Pattern: + return self._digit_time_regex + + @property + def left_digit_time_regex(self) -> Pattern: + return self._left_digit_time_regex + + @property + def right_digit_time_regex(self) -> Pattern: + return self._right_digit_time_regex + + @property + def short_left_CJK_time_regex(self) -> Pattern: + return self._short_left_CJK_time_regex + + @property + def short_left_digit_time_regex(self) -> Pattern: + return self._short_left_digit_time_regex + + def __init__(self): + super().__init__() + self._short_left_digit_time_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.TimePeriodShortLeftDigitTimeRegex + ) + self._short_left_CJK_time_regex = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.TimePeriodShortLeftCJKTimeRegex + ) + self._right_digit_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimePeriodRightDigitTimeRegex) + self._left_digit_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimePeriodLeftDigitTimeRegex) + self._digit_time_regex = JapaneseTimeExtractorConfiguration.digit_time_regex + self._right_CJK_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimePeriodRightCJKTimeRegex) + self._left_CJK_time_regex = RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimePeriodShortLeftCJKTimeRegex) + self._CJK_time_regex = JapaneseTimeExtractorConfiguration.CJK_time_regex + self._time_period_connect_words = RegExpUtility.get_safe_reg_exp( + JapaneseDateTime.TimePeriodTimePeriodConnectWords + ) + self._ambiguity_time_period_filters_dict = DefinitionLoader.load_ambiguity_filters( + JapaneseDateTime.AmbiguityTimePeriodFiltersDict + ) + self._regexes: Dict[Pattern, PeriodType] = { + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimePeriodRegexes1): PeriodType.FullTime, + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimePeriodRegexes2): PeriodType.ShortTime, + RegExpUtility.get_safe_reg_exp(JapaneseDateTime.TimeOfDayRegex): PeriodType.ShortTime, + } diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/timeperiod_parser_config.py new file mode 100644 index 0000000000..e558427517 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/japanese/timeperiod_parser_config.py @@ -0,0 +1,84 @@ +from recognizers_date_time.date_time.CJK.base_configs import CJKCommonDateTimeParserConfiguration +from recognizers_date_time.date_time.CJK.base_timeperiod import CJKTimePeriodParserConfiguration +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.japanese.time_extractor_config import JapaneseTimeExtractorConfiguration +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities import TimeFunctions, TimexUtil +from recognizers_date_time.resources.japanese_date_time import JapaneseDateTime + + +class JapaneseTimePeriodParserConfiguration(CJKTimePeriodParserConfiguration): + + @property + def time_extractor(self) -> DateTimeExtractor: + return self._time_extractor + + @property + def time_parser(self) -> DateTimeParser: + return self._time_parser + + @property + def time_func(self) -> TimeFunctions: + return self._time_func + + def __init__(self, config: CJKCommonDateTimeParserConfiguration): + super().__init__() + self._time_parser = config.time_parser + self._time_extractor = config.time_extractor + self._time_func = TimeFunctions( + number_dictionary=JapaneseDateTime.TimeNumberDictionary, + low_bound_desc=JapaneseDateTime.TimeLowBoundDesc, + day_desc_regex=JapaneseTimeExtractorConfiguration().day_desc_regex, + ) + + def get_matched_timex_range(self, text: str) -> dict: + trimmed_text = text.strip() + begin_hour = 0 + end_hour = 0 + end_min = 0 + + if any(trimmed_text.endswith(o) for o in JapaneseDateTime.MorningTermList): + time_of_day = Constants.MORNING + elif any(trimmed_text.endswith(o) for o in JapaneseDateTime.MidDayTermList): + time_of_day = Constants.MID_DAY + elif any(trimmed_text.endswith(o) for o in JapaneseDateTime.AfternoonTermList): + time_of_day = Constants.AFTERNOON + elif any(trimmed_text.endswith(o) for o in JapaneseDateTime.EveningTermList): + time_of_day = Constants.EVENING + elif any(trimmed_text == o for o in JapaneseDateTime.DaytimeTermList): + time_of_day = Constants.DAYTIME + elif any(trimmed_text.endswith(o) for o in JapaneseDateTime.NightTermList): + time_of_day = Constants.NIGHT + elif any(trimmed_text.endswith(o) for o in JapaneseDateTime.BusinessHourTermList): + time_of_day = Constants.BUSINESS_HOUR + else: + timex = None + matched = False + + return { + 'matched': matched, + 'timex': timex, + 'begin_hour': begin_hour, + 'end_hour': end_hour, + 'end_min': end_min, + } + + parse_result = TimexUtil.parse_time_of_day(time_of_day) + timex = parse_result.timex + begin_hour = parse_result.begin_hour + end_hour = parse_result.end_hour + end_min = parse_result.end_min + + # Modify time period if "early"/"late" is present + if any(trimmed_text.endswith(o) for o in JapaneseDateTime.EarlyHourTermList): + end_hour = begin_hour + Constants.HALF_MID_DAY_DURATION_HOUR_COUNT + # Handling special case: night ends with 23:59. + if end_min == 59: + end_min = 0 + + if any(trimmed_text.endswith(o) for o in JapaneseDateTime.LateHourTermList): + begin_hour = begin_hour + Constants.HALF_MID_DAY_DURATION_HOUR_COUNT + + matched = True + return {'matched': matched, 'timex': timex, 'begin_hour': begin_hour, 'end_hour': end_hour, 'end_min': end_min} diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/models.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/models.py index ffbf8f0e04..d2fa637f0e 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/models.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/models.py @@ -1,15 +1,21 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List +import logging from datetime import datetime +from typing import List from recognizers_text.model import Model, ModelResult from recognizers_text.utilities import QueryProcessor + from .extractors import DateTimeExtractor from .parsers import DateTimeParser +logger = logging.getLogger(__name__) +logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') + + class DateTimeModelResult(ModelResult): def __init__(self): super().__init__() @@ -38,7 +44,7 @@ def parse(self, query: str, reference: datetime = None) -> List[ModelResult]: # else: parser_dates.append(parse_result) except Exception: - pass + logger.exception("Failed to extract or parse datetime") return [self.__to_model_result(x) for x in parser_dates] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/parsers.py index 56219977a2..8aefb95a38 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/parsers.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/parsers.py @@ -2,8 +2,8 @@ # Licensed under the MIT License. from abc import abstractmethod -from typing import Optional from datetime import datetime +from typing import Optional from recognizers_text.extractor import ExtractResult from recognizers_text.parser import Parser, ParseResult @@ -24,4 +24,5 @@ def parser_type_name(self) -> str: @abstractmethod def parse(self, source: ExtractResult, reference: datetime = None) -> Optional[DateTimeParseResult]: raise NotImplementedError + # pylint: disable = W0221 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/base_configs.py index f3b6f877cd..a999ed5264 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/base_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/base_configs.py @@ -1,90 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_date_time.date_time.base_date import DateTimeUtilityConfiguration +from recognizers_date_time.date_time.utilities import DateTimeUtilityConfiguration from recognizers_date_time.resources.portuguese_date_time import PortugueseDateTime class PortugueseDateTimeUtilityConfiguration(DateTimeUtilityConfiguration): - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def range_prefix_regex(self) -> Pattern: - return self._range_prefix_regex - - @property - def check_both_before_after(self) -> Pattern: - return self._check_both_before_after - - @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 def __init__(self): - self._later_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AgoRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RangeUnitRegex) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AmDescRegex) - self._pm_desc__regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PmDescRegex) - self._am_pm_desc_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AmPmDescRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WithinNextPrefixRegex) - self._common_date_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.CommonDatePrefixRegex) - self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter - self._range_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RangePrefixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DateUnitRegex - ) + super().__init__(PortugueseDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/common_configs.py index 417143930c..b90c91784a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/common_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/common_configs.py @@ -4,38 +4,40 @@ from typing import Dict, Pattern from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_number.number.portuguese.extractors import ( + PortugueseCardinalExtractor, + PortugueseIntegerExtractor, + PortugueseOrdinalExtractor, +) from recognizers_number.number.portuguese.parsers import PortugueseNumberParserConfiguration -from recognizers_number.number.portuguese.extractors import PortugueseCardinalExtractor, PortugueseIntegerExtractor, PortugueseOrdinalExtractor -from ...resources.portuguese_date_time import BaseDateTime, PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser +from ...resources.portuguese_date_time import PortugueseDateTime from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration from ..base_date import BaseDateExtractor, BaseDateParser -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor, BaseDurationParser from ..base_dateperiod import BaseDatePeriodExtractor, BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser from ..base_datetime import BaseDateTimeExtractor, BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodExtractor, BaseDateTimePeriodParser - +from ..base_duration import BaseDurationExtractor, BaseDurationParser +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from .base_configs import PortugueseDateTimeUtilityConfiguration from .date_extractor_config import PortugueseDateExtractorConfiguration from .date_parser_config import PortugueseDateParserConfiguration -from .time_extractor_config import PortugueseTimeExtractorConfiguration -from .time_parser_config import PortugueseTimeParserConfiguration -from .parsers import PortugueseTimeParser -from .duration_extractor_config import PortugueseDurationExtractorConfiguration -from .duration_parser_config import PortugueseDurationParserConfiguration from .dateperiod_extractor_config import PortugueseDatePeriodExtractorConfiguration from .dateperiod_parser_config import PortugueseDatePeriodParserConfiguration -from .timeperiod_extractor_config import PortugueseTimePeriodExtractorConfiguration -from .timeperiod_parser_config import PortugueseTimePeriodParserConfiguration from .datetime_extractor_config import PortugueseDateTimeExtractorConfiguration from .datetime_parser_config import PortugueseDateTimeParserConfiguration from .datetimeperiod_extractor_config import PortugueseDateTimePeriodExtractorConfiguration from .datetimeperiod_parser_config import PortugueseDateTimePeriodParserConfiguration -from ..base_timezone import BaseTimeZoneParser +from .duration_extractor_config import PortugueseDurationExtractorConfiguration +from .duration_parser_config import PortugueseDurationParserConfiguration +from .parsers import PortugueseTimeParser +from .time_extractor_config import PortugueseTimeExtractorConfiguration +from .time_parser_config import PortugueseTimeParserConfiguration +from .timeperiod_extractor_config import PortugueseTimePeriodExtractorConfiguration +from .timeperiod_parser_config import PortugueseTimePeriodParserConfiguration class PortugueseCommonDateTimeParserConfiguration(BaseDateParserConfiguration): @@ -55,10 +57,6 @@ def integer_extractor(self) -> BaseNumberExtractor: def ordinal_extractor(self) -> BaseNumberExtractor: return self._ordinal_extractor - @property - def time_zone_parser(self) -> BaseTimeZoneParser: - return self._time_zone_parser - @property def number_parser(self) -> BaseNumberParser: return self._number_parser @@ -175,34 +173,18 @@ def __init__(self): self._integer_extractor = PortugueseIntegerExtractor() self._ordinal_extractor = PortugueseOrdinalExtractor() self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter - self._time_zone_parser = BaseTimeZoneParser() - self._number_parser = BaseNumberParser( - PortugueseNumberParserConfiguration()) - self._date_extractor = BaseDateExtractor( - PortugueseDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - PortugueseTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - PortugueseDurationExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - PortugueseDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - PortugueseTimePeriodExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - PortugueseDateTimeExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - PortugueseDateTimePeriodExtractorConfiguration()) - self._duration_parser = BaseDurationParser( - PortugueseDurationParserConfiguration(self)) - self._date_parser = BaseDateParser( - PortugueseDateParserConfiguration(self)) - self._time_parser = PortugueseTimeParser( - PortugueseTimeParserConfiguration(self)) - self._date_period_parser = BaseDatePeriodParser( - PortugueseDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - PortugueseTimePeriodParserConfiguration(self)) - self._date_time_parser = BaseDateTimeParser( - PortugueseDateTimeParserConfiguration(self)) - self._date_time_period_parser = BaseDateTimePeriodParser( - PortugueseDateTimePeriodParserConfiguration(self)) + self._number_parser = BaseNumberParser(PortugueseNumberParserConfiguration()) + self._date_extractor = BaseDateExtractor(PortugueseDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(PortugueseTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(PortugueseDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(PortugueseDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(PortugueseTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(PortugueseDateTimeExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(PortugueseDateTimePeriodExtractorConfiguration()) + self._duration_parser = BaseDurationParser(PortugueseDurationParserConfiguration(self)) + self._date_parser = BaseDateParser(PortugueseDateParserConfiguration(self)) + self._time_parser = PortugueseTimeParser(PortugueseTimeParserConfiguration(self)) + self._date_period_parser = BaseDatePeriodParser(PortugueseDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(PortugueseTimePeriodParserConfiguration(self)) + self._date_time_parser = BaseDateTimeParser(PortugueseDateTimeParserConfiguration(self)) + self._date_time_period_parser = BaseDateTimePeriodParser(PortugueseDateTimePeriodParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_extractor_config.py index af0173766e..a97cdce8ec 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_extractor_config.py @@ -1,140 +1,51 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict -from recognizers_number import (BaseNumberExtractor, BaseNumberParser, - PortugueseOrdinalExtractor, PortugueseIntegerExtractor, PortugueseNumberParserConfiguration) +from typing import List, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + PortugueseIntegerExtractor, + PortugueseNumberParserConfiguration, + PortugueseOrdinalExtractor, +) from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import DateExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..constants import Constants from ..utilities import DateTimeUtilityConfiguration -from .duration_extractor_config import PortugueseDurationExtractorConfiguration from .base_configs import PortugueseDateTimeUtilityConfiguration -from ..constants import Constants -from ...resources.base_date_time import BaseDateTime +from .duration_extractor_config import PortugueseDurationExtractorConfiguration class PortugueseDateExtractorConfiguration(DateExtractorConfiguration): - @property - def week_day_start(self) -> Pattern: - return self._week_day_start - @property - def check_both_before_after(self) -> bool: - return self._check_both_before_after + def __init__(self): + super().__init__(PortugueseDateTime()) + self.ordinal_extractor: BaseNumberExtractor = PortugueseOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = PortugueseIntegerExtractor() + self.number_parser: BaseNumberParser = BaseNumberParser(PortugueseNumberParserConfiguration()) + self.duration_extractor: BaseDurationExtractor = BaseDurationExtractor( + PortugueseDurationExtractorConfiguration() + ) + self.utility_configuration: DateTimeUtilityConfiguration = PortugueseDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ThisRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LastDateRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekDayRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecialDateRegex), + ] @property def date_regex_list(self) -> List[Pattern]: - return self._date_regex_list - - @property - def implicit_date_list(self) -> List[Pattern]: - return self._implicit_date_list - - @property - def month_end(self) -> Pattern: - return self._month_end - - @property - def week_day_end(self) -> Pattern: - return self._week_day_end - - @property - def of_month(self) -> Pattern: - return self._of_month - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def for_the_regex(self) -> Pattern: - return self._for_the_regex - - @property - def week_day_and_day_of_month_regex(self) -> Pattern: - return self._week_day_and_day_of_month_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def prefix_article_regex(self) -> Pattern: - return self._prefix_article_regex - - @property - def day_of_week(self) -> Dict[str, int]: - return self._day_of_week - - @property - def month_of_year(self) -> Dict[str, int]: - return self._month_of_year - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def strict_relative_regex(self) -> Pattern: - return self._strict_relative_regex - - @property - def range_connector_symbol_regex(self) -> Pattern: - return self._range_connector_symbol_regex - - @property - def utility_configuration(self) -> DateTimeUtilityConfiguration: - return self._utility_configuration - - @property - def year_suffix(self) -> Pattern: - return self._year_suffix - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_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 since_year_suffix_regex(self) -> Pattern: - return self._since_year_suffix_regex - - @property - def week_day_and_day_regex(self) -> Pattern: - return self._week_day_and_day_regex - - def __init__(self): - self._check_both_before_after = False if PortugueseDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: date_extractor_4 = PortugueseDateTime.DateExtractor5 date_extractor_5 = PortugueseDateTime.DateExtractor4 @@ -150,7 +61,7 @@ def __init__(self): date_extractor_7 = PortugueseDateTime.DateExtractor7 date_extractor_9 = PortugueseDateTime.DateExtractor9 - self._date_regex_list = [ + return [ RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateExtractor1), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateExtractor2), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateExtractor3), @@ -162,76 +73,3 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(date_extractor_9), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateExtractor10), ] - - self._implicit_date_list = [ - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.OnRegex), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelaxedOnRegex), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecialDayRegex), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ThisRegex), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LastDateRegex), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextDateRegex), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekDayRegex), - RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecialDateRegex), - ] - self._month_end = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthEndRegex) - self._of_month = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.OfMonthRegex) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DateUnitRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ForTheRegex) - self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayAndDayOfMonthRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayRegex) - self._day_of_week = PortugueseDateTime.DayOfWeek - self._ordinal_extractor = PortugueseOrdinalExtractor() - self._integer_extractor = PortugueseIntegerExtractor() - self._number_parser = BaseNumberParser( - PortugueseNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - PortugueseDurationExtractorConfiguration()) - self._utility_configuration = PortugueseDateTimeUtilityConfiguration() - self._range_connector_symbol_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.RangeConnectorSymbolRegex - ) - self._strict_relative_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.StrictRelativeRegex - ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.YearSuffix - ) - self._month_of_year = PortugueseDateTime.MonthOfYear - self._prefix_article_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PrefixArticleRegex - ) - self._week_day_end = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayEnd - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LessThanRegex - ) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.InConnectorRegex - ) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RangeUnitRegex - ) - self._since_year_suffix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SinceYearSuffixRegex - ) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayAndDayRegex - ) - self._week_day_start = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayStart - ) - self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_parser_config.py index 2a678c6b55..956e1c35d1 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_parser_config.py @@ -1,17 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict +from typing import Dict, List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_date import DateParserConfiguration from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_date import DateParserConfiguration -from ..base_configs import BaseDateParserConfiguration from .date_extractor_config import PortugueseDateExtractorConfiguration @@ -143,12 +145,9 @@ def date_token_prefix(self) -> str: # The following three regexes only used in this configuration # They are not used in the base parser, therefore they are not extracted # If the spanish date parser need the same regexes, they should be extracted - _relative_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RelativeDayRegex) - _next_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextPrefixRegex) - _past_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) + _relative_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeDayRegex) + _next_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextPrefixRegex) + _past_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PreviousPrefixRegex) def __init__(self, config: BaseDateParserConfiguration): self._ordinal_extractor = config.ordinal_extractor @@ -163,38 +162,24 @@ def __init__(self, config: BaseDateParserConfiguration): self._day_of_week = config.day_of_week self._unit_map = config.unit_map self._cardinal_map = config.cardinal_map - self._date_regex = ( - PortugueseDateExtractorConfiguration()).date_regex_list - self._on_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.OnRegex) - self._special_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecialDayRegex) - self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecialDayWithNumRegex) - self._next_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextDateRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DateUnitRegex) - self._month_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayRegex) - self._last_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LastDateRegex) - self._this_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ThisRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayOfMonthRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ForTheRegex) + self._date_regex = (PortugueseDateExtractorConfiguration()).date_regex_list + self._on_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.OnRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextDateRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateUnitRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekDayRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LastDateRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ThisRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekDayOfMonthRegex) + self._for_the_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ForTheRegex) self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayAndDayOfMonthRegex) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayAndDayRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RelativeMonthRegex) - self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RelativeWeekDayRegex) + PortugueseDateTime.WeekDayAndDayOfMonthRegex + ) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeMonthRegex) + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeWeekDayRegex) self._utility_configuration = config.utility_configuration self._date_token_prefix = PortugueseDateTime.DateTokenPrefix self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter @@ -206,8 +191,13 @@ def get_swift_day(self, source: str) -> int: # TODO: add the relative day logic if needed. If yes, the whole method should be abstracted. if trimmed_text == 'hoje' or trimmed_text == 'este dia': swift = 0 - elif trimmed_text == 'amanha' or trimmed_text == 'de amanha' or trimmed_text.endswith('dia seguinte') \ - or trimmed_text.endswith('o dia de amanha') or trimmed_text.endswith('proximo dia'): + elif ( + trimmed_text == 'amanha' + or trimmed_text == 'de amanha' + or trimmed_text.endswith('dia seguinte') + or trimmed_text.endswith('o dia de amanha') + or trimmed_text.endswith('proximo dia') + ): swift = 1 elif trimmed_text == 'ontem': swift = -1 @@ -226,10 +216,8 @@ def get_swift_month(self, source: str) -> int: def get_swift(self, source: str) -> int: trimmed_text = source.strip().lower() swift = 0 - next_prefix_matches = regex.search( - PortugueseDateParserConfiguration._next_prefix_regex, trimmed_text) - past_prefix_matches = regex.search( - PortugueseDateParserConfiguration._past_prefix_regex, trimmed_text) + next_prefix_matches = regex.search(PortugueseDateParserConfiguration._next_prefix_regex, trimmed_text) + past_prefix_matches = regex.search(PortugueseDateParserConfiguration._past_prefix_regex, trimmed_text) if next_prefix_matches: swift = 1 elif past_prefix_matches: @@ -242,5 +230,16 @@ def is_cardinal_last(self, source: str) -> bool: return trimmed_text == 'last' def __normalize(self, source: str) -> str: - return source.replace('á', 'a').replace('é', 'e').replace('í', 'i').replace('ó', 'o').replace('ú', 'u')\ - .replace('ê', 'e').replace('ô', 'o').replace('ü', 'u').replace('ã', 'a').replace('õ', 'o').replace('ç', 'c') + return ( + source.replace('á', 'a') + .replace('é', 'e') + .replace('í', 'i') + .replace('ó', 'o') + .replace('ú', 'u') + .replace('ê', 'e') + .replace('ô', 'o') + .replace('ü', 'u') + .replace('ã', 'a') + .replace('õ', 'o') + .replace('ç', 'c') + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_extractor_config.py index 80357c063f..ea9bad5302 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_extractor_config.py @@ -1,174 +1,33 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number import BaseNumberParser, BaseNumberExtractor +from recognizers_number.number import BaseNumberParser from recognizers_number.number.portuguese.extractors import PortugueseIntegerExtractor from recognizers_number.number.portuguese.parsers import PortugueseNumberParserConfiguration -from ...resources.base_date_time import BaseDateTime +from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import BaseDateExtractor from ..base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex -from .duration_extractor_config import PortugueseDurationExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from .common_configs import PortugueseCardinalExtractor, PortugueseOrdinalExtractor from .date_extractor_config import PortugueseDateExtractorConfiguration -from .common_configs import PortugueseOrdinalExtractor, PortugueseCardinalExtractor +from .duration_extractor_config import PortugueseDurationExtractorConfiguration class PortugueseDatePeriodExtractorConfiguration(DatePeriodExtractorConfiguration): - @property - def previous_prefix_regex(self) -> Pattern: - return self._previous_prefix_regex - - @property - def check_both_before_after(self) -> bool: - return self._check_both_before_after - - @property - def simple_cases_regexes(self) -> List[Pattern]: - return self._simple_cases_regexes - - @property - def illegal_year_regex(self) -> Pattern: - return self._illegal_year_regex - - @property - def year_regex(self) -> Pattern: - return self._year_regex - - @property - def till_regex(self) -> Pattern: - return self._till_regex - - @property - def followed_unit(self) -> Pattern: - return self._followed_unit - - @property - def number_combined_with_unit(self) -> Pattern: - return self._number_combined_with_unit - - @property - def past_regex(self) -> Pattern: - return self._past_regex - - @property - def decade_with_century_regex(self) -> Pattern: - return self._decade_with_century_regex - - @property - def future_regex(self) -> Pattern: - return self._future_regex - - @property - def week_of_regex(self) -> Pattern: - return self._week_of_regex - - @property - def month_of_regex(self) -> Pattern: - return self._month_of_regex - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def time_unit_regex(self) -> Pattern: - return self._time_unit_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 date_point_extractor(self) -> DateTimeExtractor: - return self._date_point_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def range_connector_regex(self) -> Pattern: - return self._range_connector_regex - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def cardinal_extractor(self) -> Extractor: - return self._cardinal_extractor - - @property - def now_regex(self) -> Pattern: - return self._now_regex - - @property - def within_next_prefix_regex(self) -> Pattern: - return self._within_next_prefix_regex - - @property - def future_suffix_regex(self) -> Pattern: - return self._future_suffix_regex - - @property - def ago_regex(self) -> Pattern: - return self._ago_regex - - @property - def later_regex(self) -> Pattern: - return self._later_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_regex - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def duration_date_restrictions(self) -> [str]: - return self._duration_date_restrictions - - @property - def year_period_regex(self) -> Pattern: - return self._year_period_regex - - @property - def decade_with_century_regex(self) -> Pattern: - return self._decade_with_century_regex - - @property - def month_num_regex(self) -> Pattern: - return self._month_num_regex - - @property - def century_suffix_regex(self) -> Pattern: - return self._century_suffix_regex def __init__(self): - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) - self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter - self._simple_cases_regexes = [ + super().__init__(PortugueseDateTime()) + self.ordinal_extractor = PortugueseOrdinalExtractor() + self.cardinal_extractor = PortugueseCardinalExtractor() + self.cardinal_extractor = PortugueseCardinalExtractor() + self.date_point_extractor = BaseDateExtractor(PortugueseDateExtractorConfiguration()) + self.number_parser = BaseNumberParser(PortugueseNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(PortugueseDurationExtractorConfiguration()) + self.integer_extractor = PortugueseIntegerExtractor() + self.simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BetweenRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.OneWordPeriodRegex), @@ -178,102 +37,21 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DecadeWithCenturyRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekOfMonthRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekOfYearRegex), - RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthFrontBetweenRegex), - RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthFrontSimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthFrontBetweenRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthFrontSimpleCasesRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.QuarterRegex), - RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.QuarterRegexYearFront), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.QuarterRegexYearFront), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AllHalfYearRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SeasonRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WhichWeekRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RestOfDateRegex), - RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LaterEarlyPeriodRegex), - RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekWithWeekDayRangeRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LaterEarlyPeriodRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekWithWeekDayRangeRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.YearPlusNumberRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DecadeWithCenturyRegex), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeDecadeRegex), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ReferenceDatePeriodRegex) + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ReferenceDatePeriodRegex), ] - self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter - self._illegal_year_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.IllegalYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.YearRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TillRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.FollowedDateUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NumberCombinedWithDateUnit) - self._past_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextPrefixRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthOfRegex) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DateUnitRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RangeUnitRegex) - self._date_point_extractor = BaseDateExtractor( - PortugueseDateExtractorConfiguration()) - self._integer_extractor = PortugueseIntegerExtractor() - self._number_parser = BaseNumberParser( - PortugueseNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - PortugueseDurationExtractorConfiguration()) - self._range_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RangeConnectorRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NowRegex - ) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WithinNextPrefixRegex - ) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeUnitRegex - ) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.FutureSuffixRegex - ) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AgoRegex - ) - self._later_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LaterRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LessThanRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MoreThanRegex - ) - self._duration_date_restrictions = PortugueseDateTime.DurationDateRestrictions - self._year_period_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.YearPeriodRegex - ) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DecadeWithCenturyRegex - ) - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthNumRegex - ) - self._century_suffix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.CenturySuffixRegex - ) - self._ordinal_extractor = PortugueseOrdinalExtractor() - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex - ) - self._cardinal_extractor = PortugueseCardinalExtractor() def get_from_token_index(self, source: str) -> MatchedIndex: return MatchedIndex(True, source.rfind('from')) if source.endswith('from') else MatchedIndex(False, -1) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_parser_config.py index bde6041fb2..00ad981b11 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration from ..base_dateperiod import DatePeriodParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser class PortugueseDatePeriodParserConfiguration(DatePeriodParserConfiguration): @@ -202,91 +203,58 @@ def check_both_before_after(self) -> bool: def __init__(self, config: BaseDateParserConfiguration): self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter - self._later_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AgoRegex) + self._later_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LaterRegex) + self._ago_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AgoRegex) self._date_extractor = config.date_extractor self._date_parser = config.date_parser self._duration_extractor = config.duration_extractor self._duration_parser = config.duration_parser - self._month_front_between_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthFrontBetweenRegex) - self._between_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.BetweenRegex) + self._month_front_between_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthFrontBetweenRegex) + self._between_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BetweenRegex) self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthFrontSimpleCasesRegex) - self._simple_cases_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SimpleCasesRegex) - self._one_word_period_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.OneWordPeriodRegex) - self._month_with_year = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthWithYearRegex) - self._month_num_with_year = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthNumWithYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.YearRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextPrefixRegex) + PortugueseDateTime.MonthFrontSimpleCasesRegex + ) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.OneWordPeriodRegex) + self._month_with_year = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthWithYearRegex) + self._month_num_with_year = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthNumWithYearRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PreviousPrefixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextPrefixRegex) self._in_connector_regex = config.utility_configuration.in_connector_regex - self._week_of_month_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekOfMonthRegex) - self._week_of_year_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekOfYearRegex) - self._quarter_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.QuarterRegex) - self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.QuarterRegexYearFront) - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AllHalfYearRegex) - self._season_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SeasonRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MonthOfRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WhichWeekRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextPrefixRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ThisPrefixRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RestOfDateRegex) - self._later_early_period_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LaterEarlyPeriodRegex) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekOfYearRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.QuarterRegex) + self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.QuarterRegexYearFront) + self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AllHalfYearRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SeasonRegex) + self._week_of_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekOfRegex) + self._month_of_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthOfRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WhichWeekRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextPrefixRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PreviousPrefixRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ThisPrefixRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RestOfDateRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LaterEarlyPeriodRegex) self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekWithWeekDayRangeRegex) + PortugueseDateTime.WeekWithWeekDayRangeRegex + ) self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.UnspecificEndOfRangeRegex) + PortugueseDateTime.UnspecificEndOfRangeRegex + ) self._token_before_date = PortugueseDateTime.TokenBeforeDate self._day_of_month = config.day_of_month self._month_of_year = config.month_of_year self._cardinal_map = config.cardinal_map self._season_map = config.season_map self._unit_map = config.unit_map - self._now_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NowRegex) - self._relative_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RelativeRegex) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DecadeWithCenturyRegex) - self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ComplexDatePeriodRegex - ) - self._relative_decade_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RelativeDecadeRegex - ) - self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ReferenceDatePeriodRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LessThanRegex - ) + self._now_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NowRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeRegex) + self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DecadeWithCenturyRegex) + self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ComplexDatePeriodRegex) + self._relative_decade_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeDecadeRegex) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ReferenceDatePeriodRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LessThanRegex) def get_swift_day_or_month(self, source: str) -> int: trimmed_source = source.strip().lower() @@ -338,7 +306,7 @@ def is_month_only(self, source: str) -> bool: def is_last_cardinal(self, source: str) -> bool: trimmed_source = source.strip().lower() - return not self.previous_prefix_regex.search(trimmed_source) is None + return self.previous_prefix_regex.search(trimmed_source) is not None def is_year_only(self, source: str) -> bool: trimmed_source = source.strip().lower() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_extractor_config.py index cc15ec9825..2c4f33b1ea 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_extractor_config.py @@ -2,19 +2,21 @@ # Licensed under the MIT License. from typing import Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_datetime import DateTimeExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor +from ..extractors import DateTimeExtractor from .base_configs import PortugueseDateTimeUtilityConfiguration from .date_extractor_config import PortugueseDateExtractorConfiguration -from .time_extractor_config import PortugueseTimeExtractorConfiguration from .duration_extractor_config import PortugueseDurationExtractorConfiguration +from .time_extractor_config import PortugueseTimeExtractorConfiguration class PortugueseDateTimeExtractorConfiguration(DateTimeExtractorConfiguration): @@ -108,56 +110,37 @@ def prefix_day_regex(self) -> Pattern: def __init__(self): super().__init__() - self._date_point_extractor = BaseDateExtractor( - PortugueseDateExtractorConfiguration()) - self._time_point_extractor = BaseTimeExtractor( - PortugueseTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - PortugueseDurationExtractorConfiguration()) + self._date_point_extractor = BaseDateExtractor(PortugueseDateExtractorConfiguration()) + self._time_point_extractor = BaseTimeExtractor(PortugueseTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(PortugueseDurationExtractorConfiguration()) self._utility_configuration = PortugueseDateTimeUtilityConfiguration() - self.preposition_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PrepositionRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NowRegex) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SuffixRegex) - self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeOfTodayAfterRegex) + self.preposition_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NowRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SuffixRegex) + self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeOfTodayAfterRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SimpleTimeOfTodayAfterRegex) - self._night_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeOfDayRegex) - self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeOfTodayBeforeRegex) - self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeUnitRegex) - self.connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ConnectorRegex) - self._number_as_time_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NumberAsTimeRegex) - self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DateNumberConnectorRegex - ) - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SuffixAfterRegex + PortugueseDateTime.SimpleTimeOfTodayAfterRegex ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.YearSuffix - ) - self._year_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.YearRegex - ) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecificTimeOfDayRegex + self._night_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeOfDayRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeOfTodayBeforeRegex) + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + PortugueseDateTime.SimpleTimeOfTodayBeforeRegex ) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PrefixDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeUnitRegex) + self.connector_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ConnectorRegex) + self._number_as_time_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NumberAsTimeRegex) + self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateNumberConnectorRegex) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SuffixAfterRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.YearSuffix) + self._year_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.YearRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificTimeOfDayRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PrefixDayRegex) def is_connector_token(self, source: str) -> bool: - return source.strip() == '' or regex.search(self.connector_regex, source) is not None or regex.search(self.preposition_regex, source) is not None + return ( + source.strip() == '' + or regex.search(self.connector_regex, source) is not None + or regex.search(self.preposition_regex, source) is not None + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_parser_config.py index 64d47f9c10..7d58561651 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_parser_config.py @@ -1,17 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_datetime import DateTimeParserConfiguration, MatchedTimex from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_configs import BaseDateParserConfiguration -from ..base_datetime import DateTimeParserConfiguration, MatchedTimex class PortugueseDateTimeParserConfiguration(DateTimeParserConfiguration): @@ -110,24 +111,19 @@ def __init__(self, config: BaseDateParserConfiguration): self._time_extractor = config.time_extractor self._date_parser = config.date_parser self._time_parser = config.time_parser - self._now_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NowRegex) - self._am_time_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AmTimeRegex) - self._pm_time_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PmTimeRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NowRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AmTimeRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PmTimeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SimpleTimeOfTodayAfterRegex) + PortugueseDateTime.SimpleTimeOfTodayAfterRegex + ) self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecificTimeOfDayRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeUnitRegex) + PortugueseDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificTimeOfDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeUnitRegex) self._numbers = config.numbers self._cardinal_extractor = config.cardinal_extractor self._number_parser = config.number_parser @@ -135,10 +131,8 @@ def __init__(self, config: BaseDateParserConfiguration): self._duration_parser = config.duration_parser self._unit_map = config.unit_map self._utility_configuration = config.utility_configuration - self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PreviousPrefixRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextPrefixRegex) def have_ambiguous_token(self, source: str, matched_text: str) -> bool: return False @@ -149,9 +143,11 @@ def get_matched_now_timex(self, source: str) -> MatchedTimex: if source.endswith('agora') or source.endswith('mesmo') or source.endswith('momento'): return MatchedTimex(True, 'PRESENT_REF') elif ( - source.endswith('possivel') or source.endswith('possa') or - source.endswith('possas') or source.endswith('possamos') or - source.endswith('possam') + source.endswith('possivel') + or source.endswith('possa') + or source.endswith('possas') + or source.endswith('possamos') + or source.endswith('possam') ): timex = 'FUTURE_REF' elif source.endswith('mente'): diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_extractor_config.py index f8e52ba890..8bba797980 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_extractor_config.py @@ -2,26 +2,26 @@ # Licensed under the MIT License. from typing import List, Pattern + import regex from recognizers_number import BaseNumberExtractor, PortugueseCardinalExtractor from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor +from ..extractors import DateTimeExtractor +from ..utilities import DateTimeOptions from .date_extractor_config import PortugueseDateExtractorConfiguration -from .time_extractor_config import PortugueseTimeExtractorConfiguration +from .datetime_extractor_config import PortugueseDateTimeExtractorConfiguration from .duration_extractor_config import PortugueseDurationExtractorConfiguration +from .time_extractor_config import PortugueseTimeExtractorConfiguration from .timeperiod_extractor_config import PortugueseTimePeriodExtractorConfiguration -from .datetime_extractor_config import PortugueseDateTimeExtractorConfiguration -from .timezone_extractor_config import PortugueseTimeZoneExtractorConfiguration -from ..utilities import DateTimeOptions class PortugueseDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): @@ -73,10 +73,6 @@ def duration_extractor(self) -> DateTimeExtractor: def time_period_extractor(self) -> DateTimeExtractor: return self._time_period_extractor - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - @property def simple_cases_regexes(self) -> List[Pattern]: return self._simple_cases_regexes @@ -179,85 +175,45 @@ def after_regex(self) -> Pattern: def __init__(self): super().__init__() - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WeekDayRegex - ) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WeekDayRegex) self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter self._cardinal_extractor = PortugueseCardinalExtractor() - self._single_date_extractor = BaseDateExtractor( - PortugueseDateExtractorConfiguration()) - self._single_time_extractor = BaseTimeExtractor( - PortugueseTimeExtractorConfiguration()) - self._single_date_time_extractor = BaseDateTimeExtractor( - PortugueseDateTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - PortugueseDurationExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - PortugueseTimePeriodExtractorConfiguration()) - self._time_zone_extractor = BaseTimeZoneExtractor( - PortugueseTimeZoneExtractorConfiguration()) + self._single_date_extractor = BaseDateExtractor(PortugueseDateExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(PortugueseTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseDateTimeExtractor(PortugueseDateTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(PortugueseDurationExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(PortugueseTimePeriodExtractorConfiguration()) self._simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumFromTo), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumBetweenAnd) + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumBetweenAnd), ] - self._preposition_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PrepositionRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TillRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeOfDayRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeOfDayRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PeriodTimeOfDayWithDateRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeFollowedUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeNumberCombinedWithUnit) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeUnitRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextPrefixRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RestOfDateTimeRegex) - self._general_ending_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.GeneralEndingRegex) - self._middle_pause_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MiddlePauseRegex) - self.range_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RangeConnectorRegex) - self._token_before_date = PortugueseDateTime.TokenBeforeDate - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WithinNextPrefixRegex - ) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.FutureSuffixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DateUnitRegex - ) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AmDescRegex - ) - self._pm_desc_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PmDescRegex - ) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PrefixDayRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.BeforeRegex - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AfterRegex - ) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SuffixRegex + PortugueseDateTime.PeriodTimeOfDayWithDateRegex ) + self._followed_unit = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeFollowedUnit) + self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeNumberCombinedWithUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeUnitRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PreviousPrefixRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextPrefixRegex) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RestOfDateTimeRegex) + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.GeneralEndingRegex) + self._middle_pause_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MiddlePauseRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RangeConnectorRegex) + self._token_before_date = PortugueseDateTime.TokenBeforeDate + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WithinNextPrefixRegex) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.FutureSuffixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateUnitRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PmDescRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AfterRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SuffixRegex) self._options = DateTimeOptions.NONE self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_parser_config.py index bb93a92dba..6466bcacf2 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_parser_config.py @@ -1,16 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict -import regex +from typing import Dict, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime +from ..base_configs import BaseDateParserConfiguration from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange -from ..constants import Constants, TimeTypeConstants from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_configs import BaseDateParserConfiguration class PortugueseDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): @@ -38,22 +37,16 @@ def __init__(self, config: BaseDateParserConfiguration): self._token_before_date = PortugueseDateTime.TokenBeforeDate self._token_before_time = PortugueseDateTime.TokenBeforeTime self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PureNumBetweenAnd) + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumBetweenAnd) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PeriodTimeOfDayWithDateRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecificTimeOfDayRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextPrefixRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RestOfDateTimeRegex) + PortugueseDateTime.PeriodTimeOfDayWithDateRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificTimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PreviousPrefixRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextPrefixRegex) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RestOfDateTimeRegex) self._numbers = config.numbers self._unit_map = config.unit_map self._date_extractor = config.date_extractor @@ -66,13 +59,9 @@ def __init__(self, config: BaseDateParserConfiguration): self._date_time_parser = config.date_time_parser self._time_period_parser = config.time_period_parser self._duration_parser = config.duration_parser - self._time_zone_parser = config.time_zone_parser - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PrefixDayRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AfterRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.BeforeRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PrefixDayRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AfterRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BeforeRegex) @property def previous_prefix_regex(self): @@ -194,10 +183,6 @@ def time_period_parser(self) -> DateTimeParser: def duration_parser(self) -> DateTimeParser: return self._duration_parser - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def get_matched_time_range(self, source: str): trimmed_source = source.strip() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_extractor_config.py index 8780c8413c..05f6d26e4d 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_extractor_config.py @@ -3,9 +3,10 @@ from typing import Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.portuguese.extractors import PortugueseCardinalExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime from ..base_duration import DurationExtractorConfiguration @@ -95,47 +96,30 @@ def duration_connector_regex(self) -> Pattern: def __init__(self): super().__init__() self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter - self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AllRegex) - self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.HalfRegex) - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.FollowedUnit) + self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AllRegex) + self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HalfRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.FollowedUnit) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DurationNumberCombinedWithUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AnUnitRegex) + PortugueseDateTime.DurationNumberCombinedWithUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AnUnitRegex) self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.InexactNumberUnitRegex) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SuffixAndRegex) + PortugueseDateTime.InexactNumberUnitRegex + ) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SuffixAndRegex) self._relative_duration_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( PortugueseDateTime.RelativeDurationUnitRegex ) - self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DuringRegex - ) + self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DuringRegex) self._cardinal_extractor: BaseNumberExtractor = PortugueseCardinalExtractor() self._unit_map = PortugueseDateTime.UnitMap self._unit_value_map = PortugueseDateTime.UnitValueMap - self._duration_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DurationUnitRegex - ) - self._duration_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DurationConnectorRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LessThanRegex - ) - self._conjunction_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ConjunctionRegex - ) - self._inexact_number_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.InexactNumberRegex - ) + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DurationUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DurationConnectorRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MoreThanRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LessThanRegex) + self._conjunction_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ConjunctionRegex) + self._inexact_number_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.InexactNumberRegex) self._special_number_with_unit_regex = None self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter # TODO When the implementation for these properties is added, change the None values to their respective Regexps diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_parser_config.py index 9ac5d37063..c99bdf61fd 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_parser_config.py @@ -1,16 +1,17 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser from recognizers_number.number.portuguese.extractors import PortugueseCardinalExtractor from recognizers_number.number.portuguese.parsers import PortugueseNumberParserConfiguration +from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime +from ..base_duration import BaseDurationExtractor, DurationParserConfiguration from ..extractors import DateTimeExtractor -from ..base_duration import DurationParserConfiguration, BaseDurationExtractor from .duration_extractor_config import PortugueseDurationExtractorConfiguration @@ -72,25 +73,20 @@ def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor def __init__(self, config): - self._duration_extractor = BaseDurationExtractor( - PortugueseDurationExtractorConfiguration(), False) + self._duration_extractor = BaseDurationExtractor(PortugueseDurationExtractorConfiguration(), False) self._cardinal_extractor: BaseNumberExtractor = PortugueseCardinalExtractor() - self._number_parser: BaseNumberParser = BaseNumberParser( - PortugueseNumberParserConfiguration()) - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.FollowedUnit) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SuffixAndRegex) + self._number_parser: BaseNumberParser = BaseNumberParser(PortugueseNumberParserConfiguration()) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.FollowedUnit) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SuffixAndRegex) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DurationNumberCombinedWithUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AnUnitRegex) - self._all_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AllRegex) - self._half_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.HalfRegex) + PortugueseDateTime.DurationNumberCombinedWithUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AnUnitRegex) + self._all_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AllRegex) + self._half_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HalfRegex) self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.InexactNumberUnitRegex) + PortugueseDateTime.InexactNumberUnitRegex + ) self._unit_map: Dict[str, str] = PortugueseDateTime.UnitMap self._unit_value_map: Dict[str, int] = PortugueseDateTime.UnitValueMap self._double_numbers: Dict[str, float] = PortugueseDateTime.DoubleNumbers diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_extractor_config.py index dbb19ce6ce..ea296ad2d1 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_extractor_config.py @@ -2,10 +2,11 @@ # Licensed under the MIT License. from typing import List, Pattern + from recognizers_text.utilities import RegExpUtility -from ..base_holiday import HolidayExtractorConfiguration from ...resources.portuguese_date_time import PortugueseDateTime +from ..base_holiday import HolidayExtractorConfiguration class PortugueseHolidayExtractorConfiguration(HolidayExtractorConfiguration): @@ -18,5 +19,5 @@ def __init__(self): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex2), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex3) + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex3), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_parser_config.py index b75442244b..1f94361232 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Callable import re from datetime import datetime +from typing import Callable, Dict, List from recognizers_text.utilities import RegExpUtility -from ..utilities import DateUtils -from ..base_holiday import BaseHolidayParserConfiguration + from ...resources.portuguese_date_time import PortugueseDateTime +from ..base_holiday import BaseHolidayParserConfiguration +from ..utilities import DateUtils class PortugueseHolidayParserConfiguration(BaseHolidayParserConfiguration): @@ -32,35 +33,34 @@ def __init__(self, config): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex2), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex3) + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex3), ] self._holiday_names = PortugueseDateTime.HolidayNames self._variable_holidays_timex_dictionary = PortugueseDateTime.VariableHolidaysTimexDictionary - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NextPrefixRegex) - self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PreviousPrefixRegex) - self.this_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.ThisPrefixRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PreviousPrefixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ThisPrefixRegex) def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: - local = dict([ - ("pai", PortugueseHolidayParserConfiguration.fathers_day), - ("mae", PortugueseHolidayParserConfiguration.mothers_day), - ("acaodegracas", PortugueseHolidayParserConfiguration.thanksgiving_day), - ("trabalho", PortugueseHolidayParserConfiguration.international_workers_day), - ("pascoa", PortugueseHolidayParserConfiguration.easter_day), - ("natal", PortugueseHolidayParserConfiguration.christmas_day), - ("vesperadenatal", PortugueseHolidayParserConfiguration.christmas_eve), - ("anonovo", PortugueseHolidayParserConfiguration.new_year), - ("versperadeanonovo", PortugueseHolidayParserConfiguration.new_year_eve), - ("yuandan", PortugueseHolidayParserConfiguration.new_year), - ("professor", PortugueseHolidayParserConfiguration.teacher_day), - ("todosossantos", PortugueseHolidayParserConfiguration.halloween_day), - ("crianca", PortugueseHolidayParserConfiguration.children_day), - ("mulher", PortugueseHolidayParserConfiguration.female_day) - ]) + local = dict( + [ + ("pai", PortugueseHolidayParserConfiguration.fathers_day), + ("mae", PortugueseHolidayParserConfiguration.mothers_day), + ("acaodegracas", PortugueseHolidayParserConfiguration.thanksgiving_day), + ("trabalho", PortugueseHolidayParserConfiguration.international_workers_day), + ("pascoa", PortugueseHolidayParserConfiguration.easter_day), + ("natal", PortugueseHolidayParserConfiguration.christmas_day), + ("vesperadenatal", PortugueseHolidayParserConfiguration.christmas_eve), + ("anonovo", PortugueseHolidayParserConfiguration.new_year), + ("versperadeanonovo", PortugueseHolidayParserConfiguration.new_year_eve), + ("yuandan", PortugueseHolidayParserConfiguration.new_year), + ("professor", PortugueseHolidayParserConfiguration.teacher_day), + ("todosossantos", PortugueseHolidayParserConfiguration.halloween_day), + ("crianca", PortugueseHolidayParserConfiguration.children_day), + ("mulher", PortugueseHolidayParserConfiguration.female_day), + ] + ) return {**super()._init_holiday_funcs(), **local} diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_extractor_config.py index a06dbc7eec..20c787b386 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_extractor_config.py @@ -3,33 +3,30 @@ from typing import List, Pattern +from recognizers_number import PortugueseIntegerExtractor from recognizers_text.extractor import Extractor from recognizers_text.utilities import RegExpUtility -from recognizers_number import PortugueseIntegerExtractor + +from ...resources.base_date_time import BaseDateTime from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..base_merged import MergedExtractorConfiguration from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor from ..base_datetime import BaseDateTimeExtractor from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from ..base_set import BaseSetExtractor +from ..base_duration import BaseDurationExtractor from ..base_holiday import BaseHolidayExtractor +from ..base_merged import MergedExtractorConfiguration +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import PortugueseDateExtractorConfiguration -from .time_extractor_config import PortugueseTimeExtractorConfiguration -from .duration_extractor_config import PortugueseDurationExtractorConfiguration from .dateperiod_extractor_config import PortugueseDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import PortugueseTimePeriodExtractorConfiguration from .datetime_extractor_config import PortugueseDateTimeExtractorConfiguration from .datetimeperiod_extractor_config import PortugueseDateTimePeriodExtractorConfiguration -from .set_extractor_config import PortugueseSetExtractorConfiguration +from .duration_extractor_config import PortugueseDurationExtractorConfiguration from .holiday_extractor_config import PortugueseHolidayExtractorConfiguration -from ...resources.base_date_time import BaseDateTime -from ..base_timezone import BaseTimeZoneExtractor -from .timezone_extractor_config import PortugueseTimeZoneExtractorConfiguration +from .time_extractor_config import PortugueseTimeExtractorConfiguration +from .timeperiod_extractor_config import PortugueseTimePeriodExtractorConfiguration class PortugueseMergedExtractorConfiguration(MergedExtractorConfiguration): @@ -77,18 +74,10 @@ def date_time_period_extractor(self) -> DateTimeExtractor: def holiday_extractor(self) -> DateTimeExtractor: return self._holiday_extractor - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor - @property - def set_extractor(self) -> DateTimeExtractor: - return self._set_extractor - @property def integer_extractor(self) -> Extractor: return self._integer_extractor @@ -155,40 +144,26 @@ def term_filter_regexes(self) -> List[Pattern]: def __init__(self): self._integer_extractor = PortugueseIntegerExtractor() - self._date_extractor = BaseDateExtractor( - PortugueseDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - PortugueseTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - PortugueseDurationExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - PortugueseDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - PortugueseTimePeriodExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - PortugueseDateTimeExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - PortugueseDateTimePeriodExtractorConfiguration()) - self._set_extractor = BaseSetExtractor( - PortugueseSetExtractorConfiguration()) - self._holiday_extractor = BaseHolidayExtractor( - PortugueseHolidayExtractorConfiguration()) - self._after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AfterRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.BeforeRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SinceRegex) - self._from_to_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.FromToRegex) + self._date_extractor = BaseDateExtractor(PortugueseDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(PortugueseTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(PortugueseDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(PortugueseDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(PortugueseTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(PortugueseDateTimeExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(PortugueseDateTimePeriodExtractorConfiguration()) + self._holiday_extractor = BaseHolidayExtractor(PortugueseHolidayExtractorConfiguration()) + self._after_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AfterRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BeforeRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SinceRegex) + self._from_to_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.FromToRegex) self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SingleAmbiguousMonthRegex) - self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PrepositionSuffixRegex) + PortugueseDateTime.SingleAmbiguousMonthRegex + ) + self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PrepositionSuffixRegex) self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AmbiguousRangeModifierPrefix) - self._number_ending_pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NumberEndingPattern) + PortugueseDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NumberEndingPattern) self._term_filter_regexes = None self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp( PortugueseDateTime.UnspecificDatePeriodRegex @@ -196,13 +171,9 @@ def __init__(self): self._ambiguity_filters_dict = PortugueseDateTime.AmbiguityFiltersDict self._around_regex = PortugueseDateTime.AroundRegex self._equal_regex = BaseDateTime.EqualRegex - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SuffixAfterRegex - ) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SuffixAfterRegex) self._superfluous_word_matcher = None self._fail_fast_regex = None self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter - self._time_zone_extractor = BaseTimeZoneExtractor( - PortugueseTimeZoneExtractorConfiguration()) # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._datetime_alt_extractor = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_parser_config.py index 4dd3c52388..f9b58af515 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_parser_config.py @@ -3,22 +3,20 @@ from typing import Pattern -from ...resources.base_date_time import BaseDateTime from recognizers_text.utilities import RegExpUtility -from .holiday_parser_config import PortugueseHolidayParserConfiguration -from .set_parser_config import PortugueseSetParserConfiguration +from ...resources.base_date_time import BaseDateTime +from ...resources.portuguese_date_time import PortugueseDateTime from ..base_date import BaseDateParser -from ..base_time import BaseTimeParser -from ..base_datetime import BaseDateTimeParser -from ..base_holiday import BaseHolidayParser from ..base_dateperiod import BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodParser +from ..base_datetime import BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodParser from ..base_duration import BaseDurationParser -from ..base_set import BaseSetParser +from ..base_holiday import BaseHolidayParser from ..base_merged import MergedParserConfiguration -from ...resources.portuguese_date_time import PortugueseDateTime +from ..base_time import BaseTimeParser +from ..base_timeperiod import BaseTimePeriodParser +from .holiday_parser_config import PortugueseHolidayParserConfiguration class PortugueseMergedParserConfiguration(MergedParserConfiguration): @@ -82,27 +80,15 @@ def date_time_period_parser(self) -> BaseDateTimePeriodParser: def duration_parser(self) -> BaseDurationParser: return self.__duration_parser - @property - def set_parser(self) -> BaseSetParser: - return self.__set_parser - def __init__(self, config): - self._equal_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.EqualRegex) - self._suffix_after = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SuffixAfterRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.YearRegex) - self._around_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AroundRegex) - self.__before_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.BeforeRegex) - self.__after_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AfterRegex) - self.__since_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SinceRegex) - self.__holiday_parser = BaseHolidayParser( - PortugueseHolidayParserConfiguration(config)) + self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) + self._suffix_after = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SuffixAfterRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.YearRegex) + self._around_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AroundRegex) + self.__before_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BeforeRegex) + self.__after_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AfterRegex) + self.__since_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SinceRegex) + self.__holiday_parser = BaseHolidayParser(PortugueseHolidayParserConfiguration(config)) self.__date_parser = config.date_parser self.__time_parser = config.time_parser self.__date_time_parser = config.date_time_parser @@ -110,5 +96,3 @@ def __init__(self, config): self.__time_period_parser = config.time_period_parser self.__date_time_period_parser = config.date_time_period_parser self.__duration_parser = config.duration_parser - self.__set_parser = BaseSetParser( - PortugueseSetParserConfiguration(config)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/parsers.py index 1a92f73482..0c5886b600 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/parsers.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/parsers.py @@ -2,13 +2,13 @@ # Licensed under the MIT License. from datetime import datetime -import regex from recognizers_text.utilities import RegExpUtility -from ..utilities import DateTimeResolutionResult + +from ...resources import PortugueseDateTime from ..base_datetimeperiod import BaseDateTimePeriodParser from ..base_time import BaseTimeParser -from ...resources import PortugueseDateTime +from ..utilities import DateTimeResolutionResult from .datetimeperiod_parser_config import PortugueseDateTimePeriodParserConfiguration @@ -39,28 +39,28 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.timex = DateTimeFormatUtil.format_date(date) + values.time_str result.past_value = [ + DateUtils.safe_create_from_value(DateUtils.min_value, year, month, day, values.begin_hour, 0, 0), DateUtils.safe_create_from_value( - DateUtils.min_value, year, month, day, values.begin_hour, 0, 0), - DateUtils.safe_create_from_value( - DateUtils.min_value, year, month, day, values.end_hour, values.end_min, values.end_min) + DateUtils.min_value, year, month, day, values.end_hour, values.end_min, values.end_min + ), ] result.future_value = result.past_value result.success = True return result - start_index = len(PortugueseDateTime.Tomorrow) if trimmed_text.startswith( - PortugueseDateTime.Tomorrow) else 0 + start_index = len(PortugueseDateTime.Tomorrow) if trimmed_text.startswith(PortugueseDateTime.Tomorrow) else 0 # handle Date followed by morning, afternoon # Add handling code to handle morning, afternoon followed by Date # Add handling code to handle early/late morning, afternoon. # TODO: use regex from config: match = this.config.TimeOfDayRegex.Match(trimedText.Substring(startIndex)); - matches = list(RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeOfDayRegex).finditer(trimmed_text[start_index:])) + matches = list( + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeOfDayRegex).finditer(trimmed_text[start_index:]) + ) if matches: match = matches[0] - before_str = trimmed_text[0:match.start() + match.end()].strip() + before_str = trimmed_text[0 : match.start() + match.end()].strip() ers = self.config.date_extractor.extract(before_str, reference) if not ers: @@ -75,17 +75,31 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.future_value = [ DateUtils.safe_create_from_value( - DateUtils.min_value, future_date.year, future_date.month, future_date.day, values.begin_hour, 0, 0), + DateUtils.min_value, future_date.year, future_date.month, future_date.day, values.begin_hour, 0, 0 + ), DateUtils.safe_create_from_value( - DateUtils.min_value, future_date.year, future_date.month, future_date.day, values.end_hour, - values.end_min, values.end_min) + DateUtils.min_value, + future_date.year, + future_date.month, + future_date.day, + values.end_hour, + values.end_min, + values.end_min, + ), ] result.past_value = [ DateUtils.safe_create_from_value( - DateUtils.min_value, past_date.year, past_date.month, past_date.day, values.begin_hour, 0, 0), + DateUtils.min_value, past_date.year, past_date.month, past_date.day, values.begin_hour, 0, 0 + ), DateUtils.safe_create_from_value( - DateUtils.min_value, past_date.year, past_date.month, past_date.day, values.end_hour, - values.end_min, values.end_min) + DateUtils.min_value, + past_date.year, + past_date.month, + past_date.day, + values.end_hour, + values.end_min, + values.end_min, + ), ] result.success = True diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_extractor_config.py deleted file mode 100644 index a161edea0e..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_extractor_config.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern - -from recognizers_text.utilities import RegExpUtility -from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..base_set import SetExtractorConfiguration -from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor -from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from .date_extractor_config import PortugueseDateExtractorConfiguration -from .time_extractor_config import PortugueseTimeExtractorConfiguration -from .duration_extractor_config import PortugueseDurationExtractorConfiguration -from .dateperiod_extractor_config import PortugueseDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import PortugueseTimePeriodExtractorConfiguration -from .datetime_extractor_config import PortugueseDateTimeExtractorConfiguration -from .datetimeperiod_extractor_config import PortugueseDateTimePeriodExtractorConfiguration - - -class PortugueseSetExtractorConfiguration(SetExtractorConfiguration): - @property - def last_regex(self) -> Pattern: - return self._last_regex - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def before_each_day_regex(self) -> Pattern: - return self._before_each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def duration_unit_regex(self) -> Pattern: - return self._duration_unit_regex - - def __init__(self): - self._duration_extractor = BaseDurationExtractor( - PortugueseDurationExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - PortugueseTimeExtractorConfiguration()) - self._date_extractor = BaseDateExtractor( - PortugueseDateExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - PortugueseDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - PortugueseDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - PortugueseTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - PortugueseDateTimePeriodExtractorConfiguration()) - self._last_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LastDateRegex) - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.EachPrefixRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.EachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.EachDayRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SetWeekDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SetEachRegex) - self._duration_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DurationUnitRegex - ) - self._before_each_day_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_parser_config.py deleted file mode 100644 index a50db0d663..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_parser_config.py +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern, Dict - -from recognizers_text.utilities import RegExpUtility -from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser -from ..base_set import SetParserConfiguration, MatchedTimex -from ..base_configs import BaseDateParserConfiguration - - -class PortugueseSetParserConfiguration(SetParserConfiguration): - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def duration_parser(self) -> DateTimeParser: - return self._duration_parser - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def time_parser(self) -> DateTimeParser: - return self._time_parser - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_parser(self) -> DateTimeParser: - return self._date_parser - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_time_parser(self) -> DateTimeParser: - return self._date_time_parser - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def date_period_parser(self) -> DateTimeParser: - return self._date_period_parser - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def time_period_parser(self) -> DateTimeParser: - return self._time_period_parser - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def date_time_period_parser(self) -> DateTimeParser: - return self._date_time_period_parser - - @property - def unit_map(self) -> Dict[str, str]: - return self._unit_map - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - def __init__(self, config: BaseDateParserConfiguration): - self._duration_extractor = config.duration_extractor - self._duration_parser = config.duration_parser - self._time_extractor = config.time_extractor - self._time_parser = config.time_parser - self._date_extractor = config.date_extractor - self._date_parser = config.date_parser - self._date_time_extractor = config.date_time_extractor - self._date_time_parser = config.date_time_parser - self._date_period_extractor = config.date_period_extractor - self._date_period_parser = config.date_period_parser - self._time_period_extractor = config.time_period_extractor - self._time_period_parser = config.time_period_parser - self._date_time_period_extractor = config.date_time_period_extractor - self._date_time_period_parser = config.date_time_period_parser - self._unit_map = PortugueseDateTime.UnitMap - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.EachPrefixRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.EachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.EachDayRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SetWeekDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SetEachRegex) - - def get_matched_daily_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - if trimmed_text in ('diario', 'diaria', 'diariamente'): - timex = 'P1D' - elif trimmed_text == 'semanalmente': - timex = 'P1W' - elif trimmed_text == 'quinzenalmente': - timex = 'P2W' - elif trimmed_text == 'mensalmente': - timex = 'P1M' - elif trimmed_text == 'quarterly': - timex = 'P3M' - elif trimmed_text == 'anualmente': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) - - def get_matched_unit_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - if trimmed_text in ('diariamente', 'dias'): - timex = 'P1D' - elif trimmed_text in ('semana', 'semanas'): - timex = 'P1W' - elif trimmed_text in ('mes', 'meses'): - timex = 'P1M' - elif trimmed_text in ('ano', 'anos'): - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_extractor_config.py index 659807e7ec..65b04ea4d4 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_extractor_config.py @@ -4,18 +4,12 @@ from typing import List, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime from ..base_time import TimeExtractorConfiguration -from ..base_timezone import BaseTimeZoneExtractor -from ..extractors import DateTimeExtractor -from .timezone_extractor_config import PortugueseTimeZoneExtractorConfiguration class PortugueseTimeExtractorConfiguration(TimeExtractorConfiguration): - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def options(self): return self._options @@ -50,57 +44,23 @@ def am_regex(self) -> Pattern: def __init__(self): super().__init__() - self._desc_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.DescRegex - ) - self._hour_num_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.HourNumRegex - ) - self._minute_num_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MinuteNumRegex - ) - self._oclock_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.OclockRegex - ) - self._pm_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PmRegex - ) - self._am_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AmRegex - ) - self._less_than_one_hour = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LessThanOneHour - ) - self._written_time_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.WrittenTimeRegex - ) - self._time_prefix = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimePrefix - ) - self._time_suffix = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeSuffix - ) - self._basic_time = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.BasicTime - ) - self._midnight_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MidnightRegex - ) - self._midmorning_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MidmorningRegex - ) - self._midafternoon_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MidafternoonRegex - ) - self._midday_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MiddayRegex - ) - self._midtime_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.MidTimeRegex - ) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeUnitRegex - ) + self._desc_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DescRegex) + self._hour_num_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HourNumRegex) + self._minute_num_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MinuteNumRegex) + self._oclock_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.OclockRegex) + self._pm_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PmRegex) + self._am_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AmRegex) + self._less_than_one_hour = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LessThanOneHour) + self._written_time_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WrittenTimeRegex) + self._time_prefix = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimePrefix) + self._time_suffix = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeSuffix) + self._basic_time = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BasicTime) + self._midnight_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MidnightRegex) + self._midmorning_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MidmorningRegex) + self._midafternoon_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MidafternoonRegex) + self._midday_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MiddayRegex) + self._midtime_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MidTimeRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeUnitRegex) self._time_regex_list: List[Pattern] = [ RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex1), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex2), @@ -113,12 +73,8 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex9), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex11), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex12), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ConnectNumRegex) + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ConnectNumRegex), ] - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AtRegex) + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AtRegex) self._ish_regex: Pattern = None - self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeBeforeAfterRegex) - self._time_zone_extractor = BaseTimeZoneExtractor( - PortugueseTimeZoneExtractorConfiguration()) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeBeforeAfterRegex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_parser_config.py index 5db0457c9f..c00a6150c1 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern, Dict +from typing import Dict, List, Pattern + import regex -from ..parsers import DateTimeParser from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime -from ..base_time import TimeParserConfiguration, AdjustParams from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_time import AdjustParams, TimeParserConfiguration class PortugueseTimeParserConfiguration(TimeParserConfiguration): @@ -32,14 +33,9 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_token_prefix: str = PortugueseDateTime.TimeTokenPrefix - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.AtRegex) + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AtRegex) self._time_regexes: List[Pattern] = [ RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex1), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex2), @@ -52,25 +48,25 @@ def __init__(self, config: BaseDateParserConfiguration): RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex9), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex11), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex12), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ConnectNumRegex) + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.ConnectNumRegex), ] self._numbers: Dict[str, int] = PortugueseDateTime.Numbers - self._time_zone_parser = config.time_zone_parser self._utility_configuration = config.utility_configuration - self.less_than_one_hour = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.LessThanOneHour) - self.time_suffix_full = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeSuffix) - self.night_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.NightRegex) + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.LessThanOneHour) + self.time_suffix_full = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeSuffix) + self.night_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.NightRegex) def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): delta_min = 0 prefix = prefix.strip().lower() if prefix.startswith('meia') or prefix.startswith('e meia'): delta_min = 30 - elif prefix.startswith('quarto') or prefix.startswith('e um quarto') \ - or prefix.startswith('quinze') or prefix.startswith('e quinze'): + elif ( + prefix.startswith('quarto') + or prefix.startswith('e um quarto') + or prefix.startswith('quinze') + or prefix.startswith('e quinze') + ): delta_min = 15 elif prefix.startswith('menos um quarto'): delta_min = -15 @@ -82,8 +78,14 @@ def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): else: min_str = RegExpUtility.get_group(match, 'deltaminnum').lower() delta_min = self.numbers[min_str] - if prefix.endswith('para a') or prefix.endswith('para as') or prefix.endswith('pra') \ - or prefix.endswith('pras') or prefix.endswith('antes da') or prefix.endswith('antes das'): + if ( + prefix.endswith('para a') + or prefix.endswith('para as') + or prefix.endswith('pra') + or prefix.endswith('pras') + or prefix.endswith('antes da') + or prefix.endswith('antes das') + ): delta_min = delta_min * -1 adjust.minute += delta_min if adjust.minute < 0: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_extractor_config.py index b0f95972eb..5f3de8a0ed 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_extractor_config.py @@ -3,18 +3,17 @@ from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor from recognizers_number.number.portuguese.extractors import PortugueseIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime -from ..extractors import DateTimeExtractor -from ..base_timeperiod import TimePeriodExtractorConfiguration, MatchedIndex from ..base_time import BaseTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor +from ..base_timeperiod import MatchedIndex, TimePeriodExtractorConfiguration +from ..extractors import DateTimeExtractor +from ..utilities import DateTimeOptions from .base_configs import PortugueseDateTimeUtilityConfiguration from .time_extractor_config import PortugueseTimeExtractorConfiguration -from .timezone_extractor_config import PortugueseTimeZoneExtractorConfiguration -from ..utilities import DateTimeOptions class PortugueseTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): @@ -63,14 +62,9 @@ def token_before_date(self) -> str: def pure_number_regex(self) -> List[Pattern]: return self._pure_number_regex - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - def __init__(self): super().__init__() - self._single_time_extractor = BaseTimeExtractor( - PortugueseTimeExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(PortugueseTimeExtractorConfiguration()) self._integer_extractor = PortugueseIntegerExtractor() self.utility_configuration = PortugueseDateTimeUtilityConfiguration() @@ -78,27 +72,19 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumBetweenAnd), RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificTimeFromTo), - RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificTimeBetweenAnd) + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificTimeBetweenAnd), ] - self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TillRegex) - self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeOfDayRegex) - self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.GeneralEndingRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.FromRegex) - self.range_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.RangeConnectorRegex) - self.between_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.BetweenRegex) + self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TillRegex) + self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeOfDayRegex) + self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.GeneralEndingRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.FromRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RangeConnectorRegex) + self.between_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BetweenRegex) self._token_before_date = PortugueseDateTime.TokenBeforeDate self._pure_number_regex = [PortugueseDateTime.PureNumFromTo, PortugueseDateTime.PureNumFromTo] self._options = DateTimeOptions.NONE - self._time_zone_extractor = BaseTimeZoneExtractor( - PortugueseTimeZoneExtractorConfiguration()) self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter def get_from_token_index(self, source: str) -> MatchedIndex: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_parser_config.py index 8ab6d46d1a..b9feba6b4c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_parser_config.py @@ -1,18 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor from recognizers_number.number.portuguese.extractors import PortugueseIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.portuguese_date_time import PortugueseDateTime +from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_timeperiod import MatchedTimeRegex, TimePeriodParserConfiguration +from ..constants import Constants from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration -from ..base_timeperiod import TimePeriodParserConfiguration, MatchedTimeRegex from ..utilities import TimexUtil -from ..constants import Constants class PortugueseTimePeriodParserConfiguration(TimePeriodParserConfiguration): @@ -28,10 +29,6 @@ def time_parser(self) -> DateTimeParser: def integer_extractor(self) -> Extractor: return self._integer_extractor - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - @property def pure_number_from_to_regex(self) -> Pattern: return self._pure_number_from_to_regex @@ -67,20 +64,15 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self, config: BaseDateParserConfiguration): self._time_extractor = config.time_extractor self._time_parser = config.time_parser - self._time_zone_parser = config.time_zone_parser self._integer_extractor = PortugueseIntegerExtractor() - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.PureNumBetweenAnd) - self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecificTimeFromTo) + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumBetweenAnd) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SpecificTimeFromTo) self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.SpecificTimeBetweenAnd) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TimeOfDayRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - PortugueseDateTime.TillRegex) + PortugueseDateTime.SpecificTimeBetweenAnd + ) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeOfDayRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TillRegex) self._numbers = PortugueseDateTime.Numbers self._utility_configuration = config.utility_configuration @@ -106,13 +98,7 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: elif any(trimmed_text.endswith(o) for o in PortugueseDateTime.NightTermList): time_of_day = Constants.NIGHT else: - return MatchedTimeRegex( - matched=False, - timex='', - begin_hour=0, - end_hour=0, - end_min=0 - ) + return MatchedTimeRegex(matched=False, timex='', begin_hour=0, end_hour=0, end_min=0) parse_result = TimexUtil.parse_time_of_day(time_of_day) timex = parse_result.timex @@ -120,10 +106,4 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: end_hour = parse_result.end_hour end_min = parse_result.end_min - return MatchedTimeRegex( - matched=True, - timex=timex, - begin_hour=begin_hour, - end_hour=end_hour, - end_min=end_min - ) + return MatchedTimeRegex(matched=True, timex=timex, begin_hour=begin_hour, end_hour=end_hour, end_min=end_min) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timezone_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timezone_extractor_config.py deleted file mode 100644 index 6ec962d24e..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timezone_extractor_config.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import List, Pattern -from recognizers_text.matcher.string_matcher import StringMatcher -from ..base_timezone import TimeZoneExtractorConfiguration - - -class PortugueseTimeZoneExtractorConfiguration(TimeZoneExtractorConfiguration): - @property - def timezone_matcher(self): - return self._timezone_matcher - - @property - def direct_utc_regex(self) -> Pattern: - return self._direct_utc_regex - - @property - def location_time_suffix_regex(self) -> Pattern: - return self._location_time_suffix_regex - - @property - def location_matcher(self) -> StringMatcher: - return self._location_matcher - - @property - def ambiguous_timezone_list(self) -> List[str]: - return self._ambiguous_timezone_list diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/__init__.py index 1db9c35b94..cc7166985a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/__init__.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/__init__.py @@ -3,24 +3,22 @@ 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_extractor_config import * from .dateperiod_parser_config import * -from .timeperiod_parser_config import * +from .datetime_extractor_config import * +from .datetime_parser_config import * +from .datetimeperiod_extractor_config import * from .datetimeperiod_parser_config import * -from .set_parser_config import * +from .duration_extractor_config import * +from .duration_parser_config import * +from .holiday_extractor_config import * from .holiday_parser_config import * +from .merged_extractor_config import * from .merged_parser_config import * from .parsers import * +from .time_extractor_config import * +from .time_parser_config import * +from .timeperiod_extractor_config import * +from .timeperiod_parser_config import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/base_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/base_configs.py index 467ac186b8..af99bb090e 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/base_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/base_configs.py @@ -1,90 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_date_time.date_time.base_date import DateTimeUtilityConfiguration +from recognizers_date_time.date_time.utilities import DateTimeUtilityConfiguration from recognizers_date_time.resources.spanish_date_time import SpanishDateTime class SpanishDateTimeUtilityConfiguration(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 def __init__(self): - self._later_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AgoRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RangeUnitRegex) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AmDescRegex) - self._pm_desc__regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PmDescRegex) - self._am_pm_desc_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AmPmDescRegex) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WithinNextPrefixRegex) - self._common_date_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.CommonDatePrefixRegex) - self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter - self._range_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RangePrefixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DateUnitRegex - ) + super().__init__(SpanishDateTime()) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/common_configs.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/common_configs.py index 013fbdd81d..1f72d42bfc 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/common_configs.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/common_configs.py @@ -4,43 +4,42 @@ from typing import Dict, Pattern from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_number.number.spanish.extractors import ( + SpanishCardinalExtractor, + SpanishIntegerExtractor, + SpanishOrdinalExtractor, +) from recognizers_number.number.spanish.parsers import SpanishNumberParserConfiguration -from recognizers_number.number.spanish.extractors import SpanishCardinalExtractor, SpanishIntegerExtractor, SpanishOrdinalExtractor from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration from ..base_date import BaseDateExtractor, BaseDateParser -from ..base_time import BaseTimeExtractor, BaseTimeParser -from ..base_duration import BaseDurationExtractor, BaseDurationParser from ..base_dateperiod import BaseDatePeriodExtractor, BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser from ..base_datetime import BaseDateTimeExtractor, BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodExtractor, BaseDateTimePeriodParser -from ..base_timezone import BaseTimeZoneParser +from ..base_duration import BaseDurationExtractor, BaseDurationParser +from ..base_time import BaseTimeExtractor, BaseTimeParser +from ..base_timeperiod import BaseTimePeriodExtractor, BaseTimePeriodParser +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from .base_configs import SpanishDateTimeUtilityConfiguration from .date_extractor_config import SpanishDateExtractorConfiguration from .date_parser_config import SpanishDateParserConfiguration -from .time_extractor_config import SpanishTimeExtractorConfiguration -from .time_parser_config import SpanishTimeParserConfiguration -from .duration_extractor_config import SpanishDurationExtractorConfiguration -from .duration_parser_config import SpanishDurationParserConfiguration from .dateperiod_extractor_config import SpanishDatePeriodExtractorConfiguration from .dateperiod_parser_config import SpanishDatePeriodParserConfiguration -from .timeperiod_extractor_config import SpanishTimePeriodExtractorConfiguration -from .timeperiod_parser_config import SpanishTimePeriodParserConfiguration from .datetime_extractor_config import SpanishDateTimeExtractorConfiguration from .datetime_parser_config import SpanishDateTimeParserConfiguration from .datetimeperiod_extractor_config import SpanishDateTimePeriodExtractorConfiguration from .datetimeperiod_parser_config import SpanishDateTimePeriodParserConfiguration +from .duration_extractor_config import SpanishDurationExtractorConfiguration +from .duration_parser_config import SpanishDurationParserConfiguration +from .time_extractor_config import SpanishTimeExtractorConfiguration +from .time_parser_config import SpanishTimeParserConfiguration +from .timeperiod_extractor_config import SpanishTimePeriodExtractorConfiguration +from .timeperiod_parser_config import SpanishTimePeriodParserConfiguration class SpanishCommonDateTimeParserConfiguration(BaseDateParserConfiguration): - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - @property def check_both_before_after(self) -> Pattern: return self._check_both_before_after @@ -161,7 +160,6 @@ def __init__(self): BaseDateParserConfiguration.__init__(self) self._utility_configuration = SpanishDateTimeUtilityConfiguration() - self._time_zone_parser = BaseTimeZoneParser() self._unit_map = SpanishDateTime.UnitMap self._unit_value_map = SpanishDateTime.UnitValueMap self._season_map = SpanishDateTime.SeasonMap @@ -175,33 +173,18 @@ def __init__(self): self._integer_extractor = SpanishIntegerExtractor() self._ordinal_extractor = SpanishOrdinalExtractor() - self._number_parser = BaseNumberParser( - SpanishNumberParserConfiguration()) - self._date_extractor = BaseDateExtractor( - SpanishDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - SpanishTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - SpanishDurationExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - SpanishDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - SpanishTimePeriodExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - SpanishDateTimeExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - SpanishDateTimePeriodExtractorConfiguration()) - self._duration_parser = BaseDurationParser( - SpanishDurationParserConfiguration(self)) - self._date_parser = BaseDateParser( - SpanishDateParserConfiguration(self)) - self._time_parser = BaseTimeParser( - SpanishTimeParserConfiguration(self)) - self._date_period_parser = BaseDatePeriodParser( - SpanishDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - SpanishTimePeriodParserConfiguration(self)) - self._date_time_parser = BaseDateTimeParser( - SpanishDateTimeParserConfiguration(self)) - self._date_time_period_parser = BaseDateTimePeriodParser( - SpanishDateTimePeriodParserConfiguration(self)) + self._number_parser = BaseNumberParser(SpanishNumberParserConfiguration()) + self._date_extractor = BaseDateExtractor(SpanishDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(SpanishTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(SpanishDurationExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(SpanishDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(SpanishTimePeriodExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(SpanishDateTimeExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(SpanishDateTimePeriodExtractorConfiguration()) + self._duration_parser = BaseDurationParser(SpanishDurationParserConfiguration(self)) + self._date_parser = BaseDateParser(SpanishDateParserConfiguration(self)) + self._time_parser = BaseTimeParser(SpanishTimeParserConfiguration(self)) + self._date_period_parser = BaseDatePeriodParser(SpanishDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(SpanishTimePeriodParserConfiguration(self)) + self._date_time_parser = BaseDateTimeParser(SpanishDateTimeParserConfiguration(self)) + self._date_time_period_parser = BaseDateTimePeriodParser(SpanishDateTimePeriodParserConfiguration(self)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/date_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/date_extractor_config.py index 0316d02ef8..bb79b052ed 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/date_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/date_extractor_config.py @@ -1,156 +1,65 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict -from recognizers_number import (BaseNumberExtractor, BaseNumberParser, - SpanishOrdinalExtractor, SpanishIntegerExtractor, SpanishNumberParserConfiguration) +from typing import List, Pattern + +from recognizers_number import ( + BaseNumberExtractor, + BaseNumberParser, + SpanishIntegerExtractor, + SpanishNumberParserConfiguration, + SpanishOrdinalExtractor, +) from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import DateExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..constants import Constants from ..utilities import DateTimeUtilityConfiguration -from .duration_extractor_config import SpanishDurationExtractorConfiguration from .base_configs import SpanishDateTimeUtilityConfiguration -from ..constants import Constants -from ...resources.base_date_time import BaseDateTime +from .duration_extractor_config import SpanishDurationExtractorConfiguration class SpanishDateExtractorConfiguration(DateExtractorConfiguration): - @property - def week_day_start(self) -> Pattern: - return self._week_day_start - @property - def check_both_before_after(self) -> bool: - return self._check_both_before_after + def __init__(self): + super().__init__(SpanishDateTime()) + self.ordinal_extractor: BaseNumberExtractor = SpanishOrdinalExtractor() + self.integer_extractor: BaseNumberExtractor = SpanishIntegerExtractor() + self.number_parser: BaseNumberParser = BaseNumberParser(SpanishNumberParserConfiguration()) + self.duration_extractor: BaseDurationExtractor = BaseDurationExtractor(SpanishDurationExtractorConfiguration()) + self.utility_configuration: DateTimeUtilityConfiguration = SpanishDateTimeUtilityConfiguration() + self.implicit_date_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(SpanishDateTime.OnRegex), + RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelaxedOnRegex), + RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecialDayRegex), + RegExpUtility.get_safe_reg_exp(SpanishDateTime.ThisRegex), + RegExpUtility.get_safe_reg_exp(SpanishDateTime.LastDateRegex), + RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextDateRegex), + RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekDayRegex), + RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekDayOfMonthRegex), + RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecialDateRegex), + ] @property def date_regex_list(self) -> List[Pattern]: - return self._date_regex_list - - @property - def implicit_date_list(self) -> List[Pattern]: - return self._implicit_date_list - - @property - def month_end(self) -> Pattern: - return self._month_end - - @property - def week_day_end(self) -> Pattern: - return self._week_day_end - - @property - def of_month(self) -> Pattern: - return self._of_month - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_regex - - @property - def for_the_regex(self) -> Pattern: - return self._for_the_regex - - @property - def week_day_and_day_of_month_regex(self) -> Pattern: - return self._week_day_and_day_of_month_regex - - @property - def relative_month_regex(self) -> Pattern: - return self._relative_month_regex - - @property - def week_day_regex(self) -> Pattern: - return self._week_day_regex - - @property - def prefix_article_regex(self) -> Pattern: - return self._prefix_article_regex - - @property - def day_of_week(self) -> Dict[str, int]: - return self._day_of_week - - @property - def month_of_year(self) -> Dict[str, int]: - return self._month_of_year - - @property - def ordinal_extractor(self) -> BaseNumberExtractor: - return self._ordinal_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def strict_relative_regex(self) -> Pattern: - return self._strict_relative_regex - - @property - def range_connector_symbol_regex(self) -> Pattern: - return self._range_connector_symbol_regex - - @property - def utility_configuration(self) -> DateTimeUtilityConfiguration: - return self._utility_configuration - - @property - def year_suffix(self) -> Pattern: - return self._year_suffix - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_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 since_year_suffix_regex(self) -> Pattern: - return self._since_year_suffix_regex - - @property - def week_day_and_day_regex(self) -> Pattern: - return self._week_day_and_day_regex - - def __init__(self): - self._check_both_before_after = False if SpanishDateTime.DefaultLanguageFallback == Constants.DEFAULT_LANGUAGE_FALLBACK_DMY: date_extractor_4 = SpanishDateTime.DateExtractor5 - date_extractor_5 = SpanishDateTime.DateExtractor4 - date_extractor_6 = SpanishDateTime.DateExtractor8 - date_extractor_8 = SpanishDateTime.DateExtractor6 - date_extractor_7 = SpanishDateTime.DateExtractor9 + date_extractor_5 = SpanishDateTime.DateExtractor8 + date_extractor_6 = SpanishDateTime.DateExtractor9 + date_extractor_8 = SpanishDateTime.DateExtractor4 + date_extractor_7 = SpanishDateTime.DateExtractor6 date_extractor_9 = SpanishDateTime.DateExtractor7 else: date_extractor_4 = SpanishDateTime.DateExtractor4 - date_extractor_5 = SpanishDateTime.DateExtractor5 - date_extractor_6 = SpanishDateTime.DateExtractor6 - date_extractor_8 = SpanishDateTime.DateExtractor8 - date_extractor_7 = SpanishDateTime.DateExtractor7 + date_extractor_5 = SpanishDateTime.DateExtractor6 + date_extractor_6 = SpanishDateTime.DateExtractor7 + date_extractor_8 = SpanishDateTime.DateExtractor5 + date_extractor_7 = SpanishDateTime.DateExtractor8 date_extractor_9 = SpanishDateTime.DateExtractor9 - self._date_regex_list = [ + return [ RegExpUtility.get_safe_reg_exp(SpanishDateTime.DateExtractor1), RegExpUtility.get_safe_reg_exp(SpanishDateTime.DateExtractor2), RegExpUtility.get_safe_reg_exp(SpanishDateTime.DateExtractor3), @@ -162,76 +71,3 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(date_extractor_9), RegExpUtility.get_safe_reg_exp(SpanishDateTime.DateExtractor10), ] - - self._implicit_date_list = [ - RegExpUtility.get_safe_reg_exp(SpanishDateTime.OnRegex), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelaxedOnRegex), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecialDayRegex), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.ThisRegex), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.LastDateRegex), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextDateRegex), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekDayRegex), - RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayOfMonthRegex), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecialDateRegex), - ] - self._month_end = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthEndRegex) - self._of_month = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.OfMonthRegex) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DateUnitRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ForTheRegex) - self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayAndDayOfMonthRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeMonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayRegex) - self._day_of_week = SpanishDateTime.DayOfWeek - self._ordinal_extractor = SpanishOrdinalExtractor() - self._integer_extractor = SpanishIntegerExtractor() - self._number_parser = BaseNumberParser( - SpanishNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - SpanishDurationExtractorConfiguration()) - self._utility_configuration = SpanishDateTimeUtilityConfiguration() - self._range_connector_symbol_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.RangeConnectorSymbolRegex - ) - self._strict_relative_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.StrictRelativeRegex - ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.YearSuffix - ) - self._month_of_year = SpanishDateTime.MonthOfYear - self._prefix_article_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PrefixArticleRegex - ) - self._week_day_end = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayEnd - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LessThanRegex - ) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.InConnectorRegex - ) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RangeUnitRegex - ) - self._since_year_suffix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SinceYearSuffixRegex - ) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayAndDayRegex - ) - self._week_day_start = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayStart - ) - self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/date_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/date_parser_config.py index a567c07975..6a18288f1e 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/date_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/date_parser_config.py @@ -1,17 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, Dict +from typing import Dict, List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility from recognizers_number import BaseNumberExtractor, BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_date import DateParserConfiguration from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_date import DateParserConfiguration -from ..base_configs import BaseDateParserConfiguration from .date_extractor_config import SpanishDateExtractorConfiguration @@ -143,12 +145,9 @@ def date_token_prefix(self) -> str: # The following three regexes only used in this configuration # They are not used in the base parser, therefore they are not extracted # If the spanish date parser need the same regexes, they should be extracted - _relative_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeDayRegex) - _next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NextPrefixRegex) - _past_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PreviousPrefixRegex) + _relative_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelativeDayRegex) + _next_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextPrefixRegex) + _past_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PreviousPrefixRegex) def __init__(self, config: BaseDateParserConfiguration): self._ordinal_extractor = config.ordinal_extractor @@ -159,42 +158,28 @@ def __init__(self, config: BaseDateParserConfiguration): self._number_parser = config.number_parser self._duration_parser = config.duration_parser self._month_of_year = config.month_of_year - self._day_of_month = config.day_of_month + self._day_of_month = {**config.day_of_month, **SpanishDateTime.DayOfMonth} self._day_of_week = config.day_of_week self._unit_map = config.unit_map self._cardinal_map = config.cardinal_map - self._date_regex = ( - SpanishDateExtractorConfiguration()).date_regex_list - self._on_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.OnRegex) - self._special_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecialDayRegex) - self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecialDayWithNumRegex) - self._next_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NextDateRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DateUnitRegex) - self._month_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthRegex) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayRegex) - self._last_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LastDateRegex) - self._this_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ThisRegex) - self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayOfMonthRegex) - self._for_the_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ForTheRegex) + self._date_regex = (SpanishDateExtractorConfiguration()).date_regex_list + self._on_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.OnRegex) + self._special_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecialDayRegex) + self._special_day_with_num_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecialDayWithNumRegex) + self._next_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextDateRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DateUnitRegex) + self._month_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthRegex) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekDayRegex) + self._last_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.LastDateRegex) + self._this_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ThisRegex) + self._week_day_of_month_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekDayOfMonthRegex) + self._for_the_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ForTheRegex) self._week_day_and_day_of_month_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayAndDayOfMonthRegex) - self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayAndDayRegex) - self._relative_month_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeMonthRegex) - self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeWeekDayRegex) + SpanishDateTime.WeekDayAndDayOfMonthRegex + ) + self._week_day_and_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekDayAndDayRegex) + self._relative_month_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelativeMonthRegex) + self._relative_week_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelativeWeekDayRegex) self._utility_configuration = config.utility_configuration self._date_token_prefix = SpanishDateTime.DateTokenPrefix self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter @@ -206,7 +191,12 @@ def get_swift_day(self, source: str) -> int: # TODO: add the relative day logic if needed. If yes, the whole method should be abstracted. if trimmed_text == 'hoy' or trimmed_text == 'el dia': swift = 0 - elif trimmed_text == 'mañana' or trimmed_text.endswith('dia siguiente') or trimmed_text.endswith('el dia de mañana') or trimmed_text.endswith('proximo dia'): + elif ( + trimmed_text == 'mañana' + or trimmed_text.endswith('dia siguiente') + or trimmed_text.endswith('el dia de mañana') + or trimmed_text.endswith('proximo dia') + ): swift = 1 elif trimmed_text == 'ayer': swift = -1 @@ -233,7 +223,7 @@ def get_swift_month(self, source: str) -> int: def is_cardinal_last(self, source: str) -> bool: trimmed_text = source.strip().lower() - return not regex.search(SpanishDateParserConfiguration._past_prefix_regex, trimmed_text) is None + return regex.search(SpanishDateParserConfiguration._past_prefix_regex, trimmed_text) is not None def __normalize(self, source: str) -> str: return source.replace('á', 'a').replace('é', 'e').replace('í', 'i').replace('ó', 'o').replace('ú', 'u') diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/dateperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/dateperiod_extractor_config.py index 244bef2662..0208c44c83 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/dateperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/dateperiod_extractor_config.py @@ -1,178 +1,40 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern -from recognizers_text import Extractor -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number import BaseNumberParser, BaseNumberExtractor -from recognizers_number.number.spanish.extractors import SpanishIntegerExtractor,\ - SpanishCardinalExtractor, SpanishOrdinalExtractor +from recognizers_number.number import BaseNumberParser +from recognizers_number.number.spanish.extractors import ( + SpanishCardinalExtractor, + SpanishIntegerExtractor, + SpanishOrdinalExtractor, +) from recognizers_number.number.spanish.parsers import SpanishNumberParserConfiguration -from ...resources.base_date_time import BaseDateTime +from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_date import BaseDateExtractor from ..base_dateperiod import DatePeriodExtractorConfiguration, MatchedIndex -from .duration_extractor_config import SpanishDurationExtractorConfiguration +from ..base_duration import BaseDurationExtractor from .date_extractor_config import SpanishDateExtractorConfiguration +from .duration_extractor_config import SpanishDurationExtractorConfiguration class SpanishDatePeriodExtractorConfiguration(DatePeriodExtractorConfiguration): - @property - def year_period_regex(self) -> Pattern: - return self._year_period_regex - - @property - def all_half_year_regex(self): - return self._all_half_year_regex - - @property - def previous_prefix_regex(self) -> Pattern: - return self._previous_prefix_regex - - @property - def check_both_before_after(self) -> Pattern: - return self._check_both_before_after - - @property - def previous_prefix_regex(self) -> Pattern: - return self._previous_prefix_regex - - @property - def check_both_before_after(self) -> Pattern: - return self._check_both_before_after - - @property - def time_unit_regex(self) -> Pattern: - return self._time_unit_regex - - @property - def ordinal_extractor(self) -> Extractor: - return self._ordinal_extractor - - @property - def cardinal_extractor(self) -> Extractor: - return self._cardinal_extractor - - @property - def within_next_prefix_regex(self) -> Pattern: - return self._within_next_prefix_regex - - @property - def simple_cases_regexes(self) -> List[Pattern]: - return self._simple_cases_regexes - - @property - def illegal_year_regex(self) -> Pattern: - return self._illegal_year_regex - - @property - def year_regex(self) -> Pattern: - return self._year_regex - - @property - def decade_with_century_regex(self) -> Pattern: - return self._decade_with_century_regex - - @property - def till_regex(self) -> Pattern: - return self._till_regex - - @property - def followed_unit(self) -> Pattern: - return self._followed_unit - - @property - def number_combined_with_unit(self) -> Pattern: - return self._number_combined_with_unit - - @property - def past_regex(self) -> Pattern: - return self._past_regex - - @property - def future_regex(self) -> Pattern: - return self._future_regex - - @property - def week_of_regex(self) -> Pattern: - return self._week_of_regex - - @property - def month_of_regex(self) -> Pattern: - return self._month_of_regex - - @property - def date_unit_regex(self) -> Pattern: - return self._date_unit_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 date_point_extractor(self) -> DateTimeExtractor: - return self._date_point_extractor - - @property - def integer_extractor(self) -> BaseNumberExtractor: - return self._integer_extractor - - @property - def number_parser(self) -> BaseNumberParser: - return self._number_parser - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def now_regex(self) -> Pattern: - return self._now_regex - - @property - def future_suffix_regex(self) -> Pattern: - return self._future_suffix_regex - - @property - def ago_regex(self) -> Pattern: - return self._ago_regex - - @property - def later_regex(self) -> Pattern: - return self._later_regex - - @property - def less_than_regex(self) -> Pattern: - return self._less_than_regex - - @property - def more_than_regex(self) -> Pattern: - return self._more_than_regex - - @property - def duration_date_restrictions(self) -> [str]: - return self._duration_date_restrictions - - @property - def month_num_regex(self) -> Pattern: - return self._month_num_regex - - @property - def century_suffix_regex(self) -> Pattern: - return self._century_suffix_regex def __init__(self): - self._year_period_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearPeriodRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PastRegex) - self._simple_cases_regexes = [ - self._year_period_regex, + super().__init__(SpanishDateTime()) + self.ordinal_extractor = SpanishOrdinalExtractor() + self.cardinal_extractor = SpanishCardinalExtractor() + self.cardinal_extractor = SpanishCardinalExtractor() + self.date_point_extractor = BaseDateExtractor(SpanishDateExtractorConfiguration()) + self.number_parser = BaseNumberParser(SpanishNumberParserConfiguration()) + self.duration_extractor = BaseDurationExtractor(SpanishDurationExtractorConfiguration()) + self.integer_extractor = SpanishIntegerExtractor() + self.between_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.BetweenRegex) + self.year_period_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearPeriodRegex) + self.past_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PastRegex) + self.simple_cases_regexes = [ + self.year_period_regex, RegExpUtility.get_safe_reg_exp(SpanishDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.DayBetweenRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.OneWordPeriodRegex), @@ -193,84 +55,6 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(SpanishDateTime.WhichWeekRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.ReferenceDatePeriodRegex), ] - self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeUnitRegex) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WithinNextPrefixRegex - ) - self._illegal_year_regex = RegExpUtility.get_safe_reg_exp( - BaseDateTime.IllegalYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.YearRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TillRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FollowedDateUnit) - self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NumberCombinedWithDateUnit) - self._past_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PastRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FutureRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthOfRegex) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DateUnitRegex) - self._in_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.InConnectorRegex) - self._range_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RangeUnitRegex) - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AllHalfYearRegex) - self.from_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FromRegex) - self.range_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RangeConnectorRegex) - self.between_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.BetweenRegex) - - self._date_point_extractor = BaseDateExtractor( - SpanishDateExtractorConfiguration()) - self._integer_extractor = SpanishIntegerExtractor() - self._number_parser = BaseNumberParser( - SpanishNumberParserConfiguration()) - self._duration_extractor = BaseDurationExtractor( - SpanishDurationExtractorConfiguration()) - self._now_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NowRegex) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FutureSuffixRegex - ) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AgoRegex - ) - self._later_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LaterRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LessThanRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MoreThanRegex - ) - self._duration_date_restrictions = SpanishDateTime.DurationDateRestrictions - self._month_num_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthNumRegex - ) - self._century_suffix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.CenturySuffixRegex - ) - self._check_both_before_after = False - self._cardinal_extractor = SpanishCardinalExtractor() - self._ordinal_extractor = SpanishOrdinalExtractor() - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DecadeWithCenturyRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PreviousPrefixRegex - ) def get_from_token_index(self, source: str) -> MatchedIndex: match = self.from_regex.search(source) @@ -287,4 +71,4 @@ def get_between_token_index(self, source: str) -> MatchedIndex: return MatchedIndex(False, -1) def has_connector_token(self, source: str) -> bool: - return not self.range_connector_regex.search(source) is None + return self.range_connector_regex.search(source) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/dateperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/dateperiod_parser_config.py index b1a133a046..9867dc846a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/dateperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/dateperiod_parser_config.py @@ -1,14 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration from ..base_dateperiod import DatePeriodParserConfiguration +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser class SpanishDatePeriodParserConfiguration(DatePeriodParserConfiguration): @@ -201,12 +202,9 @@ def relative_decade_regex(self) -> Pattern: return self._relative_decade_regex def __init__(self, config: BaseDateParserConfiguration): - self._relative_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeRegex) - self._later_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LaterRegex) - self._ago_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AgoRegex) + self._relative_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelativeRegex) + self._later_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.LaterRegex) + self._ago_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AgoRegex) self._token_before_date = SpanishDateTime.TokenBeforeDate self.cardianal_extractor = config.cardinal_extractor self.number_parser = config.number_parser @@ -216,61 +214,36 @@ def __init__(self, config: BaseDateParserConfiguration): self._date_extractor = config.date_extractor - self._month_front_between_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthFrontBetweenRegex) - self._between_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DayBetweenRegex) + self._month_front_between_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthFrontBetweenRegex) + self._between_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DayBetweenRegex) self._month_front_simple_cases_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthFrontSimpleCasesRegex) - self._simple_cases_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SimpleCasesRegex) - self._one_word_period_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.OneWordPeriodRegex) - self._month_with_year = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthWithYearRegex) - self._month_num_with_year = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthNumWithYearRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.YearRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PastRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FutureRegex) - self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DurationNumberCombinedWithUnit) - self._week_of_month_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekOfMonthRegex) - self._week_of_year_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekOfYearRegex) - self._quarter_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.QuarterRegex) - self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.QuarterRegexYearFront) - self._all_half_year_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AllHalfYearRegex) - self._season_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SeasonRegex) - self._which_week_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WhichWeekRegex) - self._week_of_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekOfRegex) - self._month_of_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MonthOfRegex) - self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RestOfDateRegex) - self._later_early_period_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LaterEarlyPeriodRegex) - self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekWithWeekDayRangeRegex) - self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.UnspecificEndOfRangeRegex) - - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NextPrefixRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PreviousPrefixRegex) - self._this_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ThisPrefixRegex) + SpanishDateTime.MonthFrontSimpleCasesRegex + ) + self._simple_cases_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SimpleCasesRegex) + self._one_word_period_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.OneWordPeriodRegex) + self._month_with_year = RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthWithYearRegex) + self._month_num_with_year = RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthNumWithYearRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FutureRegex) + self.number_combined_with_unit = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DurationNumberCombinedWithUnit) + self._week_of_month_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekOfMonthRegex) + self._week_of_year_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekOfYearRegex) + self._quarter_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.QuarterRegex) + self._quarter_regex_year_front = RegExpUtility.get_safe_reg_exp(SpanishDateTime.QuarterRegexYearFront) + self._all_half_year_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AllHalfYearRegex) + self._season_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SeasonRegex) + self._which_week_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WhichWeekRegex) + self._week_of_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekOfRegex) + self._month_of_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthOfRegex) + self._rest_of_date_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RestOfDateRegex) + self._later_early_period_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.LaterEarlyPeriodRegex) + self._week_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekWithWeekDayRangeRegex) + self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.UnspecificEndOfRangeRegex) + + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextPrefixRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PreviousPrefixRegex) + self._this_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ThisPrefixRegex) self._in_connector_regex = config.utility_configuration.in_connector_regex self._unit_map = config.unit_map @@ -278,24 +251,14 @@ def __init__(self, config: BaseDateParserConfiguration): self._day_of_month = config.day_of_month self._month_of_year = config.month_of_year self._season_map = config.season_map - self._now_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NowRegex) - self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DecadeWithCenturyRegex) - self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ComplexDatePeriodRegex - ) - self._relative_decade_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeDecadeRegex - ) - self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ReferenceDatePeriodRegex - ) + self._now_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NowRegex) + self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DecadeWithCenturyRegex) + self._complex_dateperiod_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ComplexDatePeriodRegex) + self._relative_decade_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelativeDecadeRegex) + self._reference_date_period_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ReferenceDatePeriodRegex) self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LessThanRegex - ) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.LessThanRegex) def get_swift_day_or_month(self, source: str) -> int: trimmed_source = source.strip().lower() @@ -336,9 +299,9 @@ def is_month_to_date(self, source: str) -> bool: def is_week_only(self, source: str) -> bool: trimmed_source = source.strip().lower() - return any(trimmed_source.endswith(o) for o in SpanishDateTime.WeekTerms) and not\ - any(trimmed_source.endswith(o) - for o in SpanishDateTime.WeekendTerms) + return any(trimmed_source.endswith(o) for o in SpanishDateTime.WeekTerms) and not any( + trimmed_source.endswith(o) for o in SpanishDateTime.WeekendTerms + ) def is_weekend(self, source: str) -> bool: trimmed_source = source.strip().lower() @@ -354,4 +317,4 @@ def is_year_only(self, source: str) -> bool: def is_last_cardinal(self, source: str) -> bool: trimmed_source = source.strip().lower() - return not self.previous_prefix_regex.search(trimmed_source) is None + return self.previous_prefix_regex.search(trimmed_source) is not None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetime_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetime_extractor_config.py index 460b6406b3..5f8bcd2a52 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetime_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetime_extractor_config.py @@ -2,20 +2,22 @@ # Licensed under the MIT License. from typing import Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_datetime import DateTimeExtractorConfiguration +from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor +from ..extractors import DateTimeExtractor +from ..utilities import DateTimeOptions from .base_configs import SpanishDateTimeUtilityConfiguration from .date_extractor_config import SpanishDateExtractorConfiguration -from .time_extractor_config import SpanishTimeExtractorConfiguration from .duration_extractor_config import SpanishDurationExtractorConfiguration -from ..utilities import DateTimeOptions +from .time_extractor_config import SpanishTimeExtractorConfiguration class SpanishDateTimeExtractorConfiguration(DateTimeExtractorConfiguration): @@ -109,59 +111,40 @@ def year_regex(self) -> Pattern: def __init__(self): super().__init__() - self.preposition_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PrepositionRegex) - self._now_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NowRegex) - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SuffixRegex) - - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfDayRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecificTimeOfDayRegex) - self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfTodayAfterRegex) - self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfTodayBeforeRegex) + self.preposition_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PrepositionRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NowRegex) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SuffixRegex) + + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfDayRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeOfDayRegex) + self._time_of_today_after_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfTodayAfterRegex) + self._time_of_today_before_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfTodayBeforeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SimpleTimeOfTodayAfterRegex) - self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeUnitRegex) - self.connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ConnectorRegex) - self._night_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfDayRegex) - self._number_as_time_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NumberAsTimeRegex) - self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DateNumberConnectorRegex - ) - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SuffixAfterRegex + SpanishDateTime.SimpleTimeOfTodayAfterRegex ) - self._year_suffix = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.YearSuffix - ) - self._year_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.YearRegex + self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( + SpanishDateTime.SimpleTimeOfTodayBeforeRegex ) - - self._date_point_extractor = BaseDateExtractor( - SpanishDateExtractorConfiguration()) - self._time_point_extractor = BaseTimeExtractor( - SpanishTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - SpanishDurationExtractorConfiguration()) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeUnitRegex) + self.connector_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ConnectorRegex) + self._night_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfDayRegex) + self._number_as_time_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NumberAsTimeRegex) + self._date_number_connector_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DateNumberConnectorRegex) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SuffixAfterRegex) + self._year_suffix = RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearSuffix) + self._year_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearRegex) + + self._date_point_extractor = BaseDateExtractor(SpanishDateExtractorConfiguration()) + self._time_point_extractor = BaseTimeExtractor(SpanishTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(SpanishDurationExtractorConfiguration()) self._utility_configuration = SpanishDateTimeUtilityConfiguration() self._options = DateTimeOptions.NONE def is_connector_token(self, source: str) -> bool: - return source.strip() == '' or regex.search(self.connector_regex, source) is not None or regex.search( - self.preposition_regex, source) is not None + return ( + source.strip() == '' + or regex.search(self.connector_regex, source) is not None + or regex.search(self.preposition_regex, source) is not None + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetime_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetime_parser_config.py index c309e462ac..efd96c31da 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetime_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetime_parser_config.py @@ -1,17 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser +from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime +from ..base_configs import BaseDateParserConfiguration +from ..base_datetime import DateTimeParserConfiguration, MatchedTimex from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser from ..utilities import DateTimeUtilityConfiguration -from ..base_configs import BaseDateParserConfiguration -from ..base_datetime import DateTimeParserConfiguration, MatchedTimex class SpanishDateTimeParserConfiguration(DateTimeParserConfiguration): @@ -106,31 +107,23 @@ def utility_configuration(self) -> DateTimeUtilityConfiguration: def __init__(self, config: BaseDateParserConfiguration): self._token_before_date = SpanishDateTime.TokenBeforeDate self._token_before_time = SpanishDateTime.TokenBeforeTime - self._now_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NowRegex) - self._am_time_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AmTimeRegex) - self._pm_time_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PmTimeRegex) + self._now_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NowRegex) + self._am_time_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AmTimeRegex) + self._pm_time_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PmTimeRegex) self._simple_time_of_today_after_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SimpleTimeOfTodayAfterRegex) + SpanishDateTime.SimpleTimeOfTodayAfterRegex + ) self._simple_time_of_today_before_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SimpleTimeOfTodayBeforeRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecificTimeOfDayRegex) - self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecificEndOfRegex) - self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.UnspecificEndOfRegex) - self._unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.UnitRegex) - - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NextPrefixRegex) - self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PreviousPrefixRegex) - self.last_night_time_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LastNightTimeRegex) + SpanishDateTime.SimpleTimeOfTodayBeforeRegex + ) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeOfDayRegex) + self._specific_end_of_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificEndOfRegex) + self._unspecific_end_of_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.UnspecificEndOfRegex) + self._unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.UnitRegex) + + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PreviousPrefixRegex) + self.last_night_time_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.LastNightTimeRegex) self._date_extractor = config.date_extractor self._time_extractor = config.time_extractor @@ -154,9 +147,11 @@ def get_matched_now_timex(self, source: str) -> MatchedTimex: if source.endswith('ahora') or source.endswith('mismo') or source.endswith('momento'): timex = 'PRESENT_REF' elif ( - source.endswith('posible') or source.endswith('pueda') or - source.endswith('puedas') or source.endswith('podamos') or - source.endswith('puedan') + source.endswith('posible') + or source.endswith('pueda') + or source.endswith('puedas') + or source.endswith('podamos') + or source.endswith('puedan') ): timex = 'FUTURE_REF' elif source.endswith('mente'): diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetimeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetimeperiod_extractor_config.py index bfa8601222..db6957e230 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetimeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetimeperiod_extractor_config.py @@ -5,22 +5,21 @@ from recognizers_number import BaseNumberExtractor, SpanishCardinalExtractor from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_datetimeperiod import DateTimePeriodExtractorConfiguration, MatchedIndex from ..base_duration import BaseDurationExtractor +from ..base_time import BaseTimeExtractor from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor +from ..extractors import DateTimeExtractor +from ..utilities import DateTimeOptions from .date_extractor_config import SpanishDateExtractorConfiguration -from .time_extractor_config import SpanishTimeExtractorConfiguration +from .datetime_extractor_config import SpanishDateTimeExtractorConfiguration from .duration_extractor_config import SpanishDurationExtractorConfiguration +from .time_extractor_config import SpanishTimeExtractorConfiguration from .timeperiod_extractor_config import SpanishTimePeriodExtractorConfiguration -from .datetime_extractor_config import SpanishDateTimeExtractorConfiguration -from ..utilities import DateTimeOptions -from .timezone_extractor_config import SpanishTimeZoneExtractorConfiguration class SpanishDateTimePeriodExtractorConfiguration(DateTimePeriodExtractorConfiguration): @@ -72,10 +71,6 @@ def duration_extractor(self) -> DateTimeExtractor: def time_period_extractor(self) -> DateTimeExtractor: return self._time_period_extractor - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - @property def simple_cases_regexes(self) -> List[Pattern]: return self._simple_cases_regexes @@ -181,102 +176,55 @@ def __init__(self): self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter self._simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumFromTo), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumBetweenAnd) + RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumBetweenAnd), ] - self._preposition_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PrepositionRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TillRegex) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfDayRegex) - self._followed_unit = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FollowedUnit) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.UnitRegex) - self._past_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PastRegex) - self._next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NextPrefixRegex) + self._preposition_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PrepositionRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TillRegex) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfDayRegex) + self._followed_unit = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FollowedUnit) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.UnitRegex) + self._past_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PastRegex) + self._next_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextPrefixRegex) self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DateTimePeriodNumberCombinedWithUnit) - self._week_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WeekDayRegex) + SpanishDateTime.DateTimePeriodNumberCombinedWithUnit + ) + self._week_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekDayRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PeriodTimeOfDayWithDateRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RestOfDateTimeRegex) - self._general_ending_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.GeneralEndingRegex) - self._middle_pause_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MiddlePauseRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FromRegex) - self.range_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RangeConnectorRegex) - self.between_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.BetweenRegex) + SpanishDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RestOfDateTimeRegex) + self._general_ending_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.GeneralEndingRegex) + self._middle_pause_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.MiddlePauseRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FromRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RangeConnectorRegex) + self.between_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.BetweenRegex) self._cardinal_extractor = SpanishCardinalExtractor() - self._single_date_extractor = BaseDateExtractor( - SpanishDateExtractorConfiguration()) - self._single_time_extractor = BaseTimeExtractor( - SpanishTimeExtractorConfiguration()) - self._single_date_time_extractor = BaseDateTimeExtractor( - SpanishDateTimeExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - SpanishDurationExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - SpanishTimePeriodExtractorConfiguration()) - self._time_zone_extractor = BaseTimeZoneExtractor( - SpanishTimeZoneExtractorConfiguration()) - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WithinNextPrefixRegex - ) - self._time_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeUnitRegex - ) + self._single_date_extractor = BaseDateExtractor(SpanishDateExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(SpanishTimeExtractorConfiguration()) + self._single_date_time_extractor = BaseDateTimeExtractor(SpanishDateTimeExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(SpanishDurationExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(SpanishTimePeriodExtractorConfiguration()) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WithinNextPrefixRegex) + self._time_unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeUnitRegex) self._token_before_date = SpanishDateTime.TokenBeforeDate - self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.WithinNextPrefixRegex - ) - self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FutureSuffixRegex - ) - self._date_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DateUnitRegex - ) - self._am_desc_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AmDescRegex - ) - self._pm_desc_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PmDescRegex - ) - self._prefix_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PrefixDayRegex - ) - self._before_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.BeforeRegex - ) - self._after_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AfterRegex - ) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WithinNextPrefixRegex) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FutureSuffixRegex) + self._date_unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DateUnitRegex) + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PmDescRegex) + self._prefix_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PrefixDayRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AfterRegex) self._options = DateTimeOptions.NONE - self._suffix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SuffixRegex - ) + self._suffix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SuffixRegex) self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter - self._past_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PastRegex - ) - self._future_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FutureRegex - ) + self._past_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FutureRegex) def get_from_token_index(self, source: str) -> MatchedIndex: match = self.from_regex.search(source) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetimeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetimeperiod_parser_config.py index 9441e18a5b..fd439a9748 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetimeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/datetimeperiod_parser_config.py @@ -1,16 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime +from ..base_configs import BaseDateParserConfiguration from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange from ..constants import Constants from ..extractors import DateTimeExtractor from ..parsers import DateTimeParser -from ..base_configs import BaseDateParserConfiguration -from ..base_timezone import BaseTimeZoneParser class SpanishDateTimePeriodParserConfiguration(DateTimePeriodParserConfiguration): @@ -70,36 +70,25 @@ def __init__(self, config: BaseDateParserConfiguration): self._token_before_date = SpanishDateTime.TokenBeforeDate self._token_before_time = SpanishDateTime.TokenBeforeTime self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NextPrefixRegex) - self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PastRegex) - self.this_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ThisPrefixRegex) - - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PureNumBetweenAnd) - self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecificTimeOfDayRegex) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfDayRegex) - self._past_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PastRegex) - self._future_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FutureRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextPrefixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PastRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ThisPrefixRegex) + + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumBetweenAnd) + self._specific_time_of_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeOfDayRegex) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfDayRegex) + self._past_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PastRegex) + self._future_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FutureRegex) self.number_combined_with_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DateTimePeriodNumberCombinedWithUnit) - self.unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.UnitRegex) + SpanishDateTime.DateTimePeriodNumberCombinedWithUnit + ) + self.unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.UnitRegex) self._period_time_of_day_with_date_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PeriodTimeOfDayWithDateRegex) - self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeTimeUnitRegex) - self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RestOfDateTimeRegex) - self._time_zone_parser = config.time_zone_parser + SpanishDateTime.PeriodTimeOfDayWithDateRegex + ) + self._relative_time_unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RelativeTimeUnitRegex) + self._rest_of_date_time_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RestOfDateTimeRegex) @property def before_regex(self): @@ -201,10 +190,6 @@ def date_time_parser(self) -> DateTimeParser: def time_period_parser(self) -> DateTimeParser: return self._time_period_parser - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - @property def duration_parser(self) -> DateTimeParser: return self._duration_parser diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/duration_extractor_config.py index b247f59a43..2d3e47af87 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/duration_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/duration_extractor_config.py @@ -3,9 +3,10 @@ from typing import Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.spanish.extractors import SpanishCardinalExtractor +from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime from ..base_duration import DurationExtractorConfiguration @@ -94,40 +95,28 @@ def duration_connector_regex(self) -> Pattern: def __init__(self): super().__init__() - self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AllRegex) - self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.HalfRegex) - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FollowedUnit) + self._all_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AllRegex) + self._half_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.HalfRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FollowedUnit) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DurationNumberCombinedWithUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AnUnitRegex) + SpanishDateTime.DurationNumberCombinedWithUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AnUnitRegex) self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.InexactNumberUnitRegex) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SuffixAndRegex) + SpanishDateTime.InexactNumberUnitRegex + ) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SuffixAndRegex) self._relative_duration_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RelativeDurationUnitRegex) - self._cardinal_extractor: BaseNumberExtractor = SpanishCardinalExtractor() - self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DuringRegex + SpanishDateTime.RelativeDurationUnitRegex ) + self._cardinal_extractor: BaseNumberExtractor = SpanishCardinalExtractor() + self._during_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DuringRegex) self._unit_map = SpanishDateTime.UnitMap self._unit_value_map = SpanishDateTime.UnitValueMap - self._duration_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DurationUnitRegex - ) - self._duration_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DurationConnectorRegex - ) - self._more_than_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.MoreThanRegex - ) - self._less_than_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LessThanRegex - ) + self._duration_unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DurationUnitRegex) + self._duration_connector_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DurationConnectorRegex) + self._more_than_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.MoreThanRegex) + self._less_than_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.LessThanRegex) self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter # TODO When the implementation for these properties is added, change the None values to their respective Regexps self._special_number_unit_regex = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/duration_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/duration_parser_config.py index 6e9f6f3033..c3b29a2a23 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/duration_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/duration_parser_config.py @@ -1,15 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser -from ...resources.spanish_date_time import SpanishDateTime +from recognizers_text.utilities import RegExpUtility +from ...resources.spanish_date_time import SpanishDateTime +from ..base_duration import BaseDurationExtractor, DurationParserConfiguration from ..extractors import DateTimeExtractor -from ..base_duration import DurationParserConfiguration, BaseDurationExtractor from .duration_extractor_config import SpanishDurationExtractorConfiguration @@ -67,24 +67,20 @@ def duration_extractor(self) -> DateTimeExtractor: def __init__(self, config): self._duration_extractor = None - self.duration_extractor = BaseDurationExtractor( - SpanishDurationExtractorConfiguration(), False) + self.duration_extractor = BaseDurationExtractor(SpanishDurationExtractorConfiguration(), False) self._cardinal_extractor: BaseNumberExtractor = config.cardinal_extractor self._number_parser: BaseNumberParser = config.number_parser - self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FollowedUnit) - self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SuffixAndRegex) + self._followed_unit: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FollowedUnit) + self._suffix_and_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SuffixAndRegex) self._number_combined_with_unit: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.DurationNumberCombinedWithUnit) - self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AnUnitRegex) - self._all_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AllRegex) - self._half_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.HalfRegex) + SpanishDateTime.DurationNumberCombinedWithUnit + ) + self._an_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AnUnitRegex) + self._all_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AllRegex) + self._half_date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.HalfRegex) self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.InexactNumberUnitRegex) + SpanishDateTime.InexactNumberUnitRegex + ) self._unit_map: Dict[str, str] = SpanishDateTime.UnitMap self._unit_value_map: Dict[str, int] = SpanishDateTime.UnitValueMap self._double_numbers: Dict[str, float] = SpanishDateTime.DoubleNumbers diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_extractor_config.py index 7335b9dcb9..cfd5624f8c 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_extractor_config.py @@ -2,10 +2,11 @@ # Licensed under the MIT License. from typing import List, Pattern + from recognizers_text.utilities import RegExpUtility -from ..base_holiday import HolidayExtractorConfiguration from ...resources.spanish_date_time import SpanishDateTime +from ..base_holiday import HolidayExtractorConfiguration class SpanishHolidayExtractorConfiguration(HolidayExtractorConfiguration): @@ -17,5 +18,5 @@ def __init__(self): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(SpanishDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(SpanishDateTime.HolidayRegex2), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.HolidayRegex3) + RegExpUtility.get_safe_reg_exp(SpanishDateTime.HolidayRegex3), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_parser_config.py index 0c13489a2f..9edb9777a7 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_parser_config.py @@ -1,13 +1,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Callable from datetime import datetime +from typing import Callable, Dict, List from recognizers_text.utilities import RegExpUtility -from ..utilities import DateUtils, HolidayFunctions -from ..base_holiday import BaseHolidayParserConfiguration + from ...resources.spanish_date_time import SpanishDateTime +from ..base_holiday import BaseHolidayParserConfiguration +from ..utilities import HolidayFunctions class SpanishHolidayParserConfiguration(BaseHolidayParserConfiguration): @@ -28,37 +29,36 @@ def __init__(self, config): self._holiday_regexes = [ RegExpUtility.get_safe_reg_exp(SpanishDateTime.HolidayRegex1), RegExpUtility.get_safe_reg_exp(SpanishDateTime.HolidayRegex2), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.HolidayRegex3) + RegExpUtility.get_safe_reg_exp(SpanishDateTime.HolidayRegex3), ] self._holiday_names = SpanishDateTime.HolidayNames self._variable_holidays_timex_dictionary = SpanishDateTime.VariableHolidaysTimexDictionary - self.next_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NextPrefixRegex) - self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PreviousPrefixRegex) - self.this_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.ThisPrefixRegex) + self.next_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NextPrefixRegex) + self.previous_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PreviousPrefixRegex) + self.this_prefix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ThisPrefixRegex) def _init_holiday_funcs(self) -> Dict[str, Callable[[int], datetime]]: - local = dict([ - ('padres', SpanishHolidayParserConfiguration.fathers_day), - ('madres', SpanishHolidayParserConfiguration.mothers_day), - ('acciondegracias', SpanishHolidayParserConfiguration.thanksgiving_day), - ('trabajador', SpanishHolidayParserConfiguration.international_workers_day), - ('delaraza', SpanishHolidayParserConfiguration.columbus_day), - ('memoria', SpanishHolidayParserConfiguration.memorial_day), - ('pascuas', SpanishHolidayParserConfiguration.easter_day), - ('navidad', SpanishHolidayParserConfiguration.christmas_day), - ('nochebuena', SpanishHolidayParserConfiguration.christmas_eve), - ('añonuevo', SpanishHolidayParserConfiguration.new_year), - ('nochevieja', SpanishHolidayParserConfiguration.new_year_eve), - ('yuandan', SpanishHolidayParserConfiguration.new_year), - ('maestro', SpanishHolidayParserConfiguration.teacher_day), - ('todoslossantos', SpanishHolidayParserConfiguration.halloween_day), - ('niño', SpanishHolidayParserConfiguration.children_day), - ('mujer', SpanishHolidayParserConfiguration.female_day) - ]) + local = dict( + [ + ('padres', SpanishHolidayParserConfiguration.fathers_day), + ('madres', SpanishHolidayParserConfiguration.mothers_day), + ('acciondegracias', SpanishHolidayParserConfiguration.thanksgiving_day), + ('trabajador', SpanishHolidayParserConfiguration.international_workers_day), + ('delaraza', SpanishHolidayParserConfiguration.columbus_day), + ('memoria', SpanishHolidayParserConfiguration.memorial_day), + ('pascuas', SpanishHolidayParserConfiguration.easter_day), + ('navidad', SpanishHolidayParserConfiguration.christmas_day), + ('nochebuena', SpanishHolidayParserConfiguration.christmas_eve), + ('añonuevo', SpanishHolidayParserConfiguration.new_year), + ('nochevieja', SpanishHolidayParserConfiguration.new_year_eve), + ('yuandan', SpanishHolidayParserConfiguration.new_year), + ('maestro', SpanishHolidayParserConfiguration.teacher_day), + ('todoslossantos', SpanishHolidayParserConfiguration.halloween_day), + ('niño', SpanishHolidayParserConfiguration.children_day), + ('mujer', SpanishHolidayParserConfiguration.female_day), + ] + ) return {**super()._init_holiday_funcs(), **local} @@ -114,4 +114,11 @@ def get_swift_year(self, text: str) -> int: return swift def sanitize_holiday_token(self, holiday: str) -> str: - return holiday.replace(' ', '').replace('á', 'a').replace('é', 'e').replace('í', 'i').replace('ó', 'o').replace('ú', 'u') + return ( + holiday.replace(' ', '') + .replace('á', 'a') + .replace('é', 'e') + .replace('í', 'i') + .replace('ó', 'o') + .replace('ú', 'u') + ) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/merged_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/merged_extractor_config.py index 414fea6ce4..b0b8b24c0e 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/merged_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/merged_extractor_config.py @@ -3,31 +3,30 @@ from typing import List, Pattern -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility, DefinitionLoader from recognizers_number import SpanishIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + +from ...resources.base_date_time import BaseDateTime from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..base_merged import MergedExtractorConfiguration from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor from ..base_datetime import BaseDateTimeExtractor from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from ..base_set import BaseSetExtractor +from ..base_duration import BaseDurationExtractor from ..base_holiday import BaseHolidayExtractor +from ..base_merged import MergedExtractorConfiguration +from ..base_time import BaseTimeExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..extractors import DateTimeExtractor from .date_extractor_config import SpanishDateExtractorConfiguration -from .time_extractor_config import SpanishTimeExtractorConfiguration -from .duration_extractor_config import SpanishDurationExtractorConfiguration from .dateperiod_extractor_config import SpanishDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import SpanishTimePeriodExtractorConfiguration from .datetime_extractor_config import SpanishDateTimeExtractorConfiguration from .datetimeperiod_extractor_config import SpanishDateTimePeriodExtractorConfiguration -from .set_extractor_config import SpanishSetExtractorConfiguration +from .duration_extractor_config import SpanishDurationExtractorConfiguration from .holiday_extractor_config import SpanishHolidayExtractorConfiguration -from ...resources.base_date_time import BaseDateTime +from .time_extractor_config import SpanishTimeExtractorConfiguration +from .timeperiod_extractor_config import SpanishTimePeriodExtractorConfiguration class SpanishMergedExtractorConfiguration(MergedExtractorConfiguration): @@ -35,10 +34,6 @@ class SpanishMergedExtractorConfiguration(MergedExtractorConfiguration): def check_both_before_after(self): return self._check_both_before_after - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def datetime_alt_extractor(self): return self._datetime_alt_extractor @@ -95,10 +90,6 @@ def holiday_extractor(self) -> DateTimeExtractor: def duration_extractor(self) -> DateTimeExtractor: return self._duration_extractor - @property - def set_extractor(self) -> DateTimeExtractor: - return self._set_extractor - @property def integer_extractor(self) -> Extractor: return self._integer_extractor @@ -161,51 +152,30 @@ def __init__(self): self._fail_fast_regex = None self._term_filter_regexes = None self._datetime_alt_extractor = None - self._time_zone_extractor = None - self._before_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SinceRegex) - self._from_to_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FromToRegex) - self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SingleAmbiguousMonthRegex) - self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PrepositionSuffixRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SinceRegex) + self._from_to_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FromToRegex) + self._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SingleAmbiguousMonthRegex) + self._preposition_suffix_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PrepositionSuffixRegex) self._ambiguous_range_modifier_prefix = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AmbiguousRangeModifierPrefix) - self._number_ending_pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.NumberEndingPattern) - - self._date_extractor = BaseDateExtractor( - SpanishDateExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - SpanishTimeExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - SpanishDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - SpanishDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - SpanishTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - SpanishDateTimePeriodExtractorConfiguration()) - self._duration_extractor = BaseDurationExtractor( - SpanishDurationExtractorConfiguration()) - self._set_extractor = BaseSetExtractor( - SpanishSetExtractorConfiguration()) - self._holiday_extractor = BaseHolidayExtractor( - SpanishHolidayExtractorConfiguration()) + SpanishDateTime.AmbiguousRangeModifierPrefix + ) + self._number_ending_pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NumberEndingPattern) + + self._date_extractor = BaseDateExtractor(SpanishDateExtractorConfiguration()) + self._time_extractor = BaseTimeExtractor(SpanishTimeExtractorConfiguration()) + self._date_time_extractor = BaseDateTimeExtractor(SpanishDateTimeExtractorConfiguration()) + self._date_period_extractor = BaseDatePeriodExtractor(SpanishDatePeriodExtractorConfiguration()) + self._time_period_extractor = BaseTimePeriodExtractor(SpanishTimePeriodExtractorConfiguration()) + self._date_time_period_extractor = BaseDateTimePeriodExtractor(SpanishDateTimePeriodExtractorConfiguration()) + self._duration_extractor = BaseDurationExtractor(SpanishDurationExtractorConfiguration()) + self._holiday_extractor = BaseHolidayExtractor(SpanishHolidayExtractorConfiguration()) self._integer_extractor = SpanishIntegerExtractor() self._filter_word_regex_list = [] - self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.UnspecificDatePeriodRegex - ) + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.UnspecificDatePeriodRegex) self._around_regex = SpanishDateTime.AroundRegex self._equal_regex = BaseDateTime.EqualRegex - self._suffix_after_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SuffixAfterRegex - ) + self._suffix_after_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SuffixAfterRegex) self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter self._ambiguity_filters_dict = DefinitionLoader.load_ambiguity_filters(SpanishDateTime.AmbiguityFiltersDict) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/merged_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/merged_parser_config.py index 6f665762c8..fbad545144 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/merged_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/merged_parser_config.py @@ -4,25 +4,23 @@ from typing import Pattern from recognizers_text.utilities import RegExpUtility -from .holiday_parser_config import SpanishHolidayParserConfiguration -from .set_parser_config import SpanishSetParserConfiguration -from .dateperiod_parser_config import SpanishDatePeriodParserConfiguration -from .timeperiod_parser_config import SpanishTimePeriodParserConfiguration -from .datetimeperiod_parser_config import SpanishDateTimePeriodParserConfiguration -from .common_configs import SpanishCommonDateTimeParserConfiguration -from .parsers import SpanishDateTimePeriodParser + +from ...resources.spanish_date_time import BaseDateTime, SpanishDateTime from ..base_date import BaseDateParser -from ..base_time import BaseTimeParser -from ..base_datetime import BaseDateTimeParser -from ..base_holiday import BaseHolidayParser from ..base_dateperiod import BaseDatePeriodParser -from ..base_timeperiod import BaseTimePeriodParser +from ..base_datetime import BaseDateTimeParser from ..base_datetimeperiod import BaseDateTimePeriodParser from ..base_duration import BaseDurationParser -from ..base_set import BaseSetParser +from ..base_holiday import BaseHolidayParser from ..base_merged import MergedParserConfiguration -from ...resources.spanish_date_time import SpanishDateTime, BaseDateTime -from ..parsers import DateTimeParser +from ..base_time import BaseTimeParser +from ..base_timeperiod import BaseTimePeriodParser +from .common_configs import SpanishCommonDateTimeParserConfiguration +from .dateperiod_parser_config import SpanishDatePeriodParserConfiguration +from .datetimeperiod_parser_config import SpanishDateTimePeriodParserConfiguration +from .holiday_parser_config import SpanishHolidayParserConfiguration +from .parsers import SpanishDateTimePeriodParser +from .timeperiod_parser_config import SpanishTimePeriodParserConfiguration class SpanishMergedParserConfiguration(SpanishCommonDateTimeParserConfiguration, MergedParserConfiguration): @@ -66,10 +64,6 @@ def holiday_parser(self) -> BaseHolidayParser: def time_parser(self) -> BaseTimeParser: return self._time_parser - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - @property def date_time_parser(self) -> BaseDateTimeParser: return self._date_time_parser @@ -90,33 +84,17 @@ def date_time_period_parser(self) -> BaseDateTimePeriodParser: def duration_parser(self) -> BaseDurationParser: return self._duration_parser - @property - def set_parser(self) -> BaseSetParser: - return self._set_parser - def __init__(self, config): SpanishCommonDateTimeParserConfiguration.__init__(self) - self._time_zone_parser = config.time_zone_parser self._equal_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.EqualRegex) - self._suffix_after = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SuffixAfterRegex) - self._year_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.YearRegex) - self._around_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AroundRegex) - self._before_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.BeforeRegex) - self._after_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AfterRegex) - self._since_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SinceRegex) - - self._date_period_parser = BaseDatePeriodParser( - SpanishDatePeriodParserConfiguration(self)) - self._time_period_parser = BaseTimePeriodParser( - SpanishTimePeriodParserConfiguration(self)) - self._date_time_period_parser = SpanishDateTimePeriodParser( - SpanishDateTimePeriodParserConfiguration(self)) - self._set_parser = BaseSetParser(SpanishSetParserConfiguration(config)) - self._holiday_parser = BaseHolidayParser( - SpanishHolidayParserConfiguration(config)) + self._suffix_after = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SuffixAfterRegex) + self._year_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearRegex) + self._around_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AroundRegex) + self._before_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.BeforeRegex) + self._after_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AfterRegex) + self._since_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SinceRegex) + + self._date_period_parser = BaseDatePeriodParser(SpanishDatePeriodParserConfiguration(self)) + self._time_period_parser = BaseTimePeriodParser(SpanishTimePeriodParserConfiguration(self)) + self._date_time_period_parser = SpanishDateTimePeriodParser(SpanishDateTimePeriodParserConfiguration(self)) + self._holiday_parser = BaseHolidayParser(SpanishHolidayParserConfiguration(config)) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/parsers.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/parsers.py index d6da929eb5..4146959d24 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/parsers.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/parsers.py @@ -4,9 +4,10 @@ from datetime import datetime, timedelta from recognizers_text.utilities import RegExpUtility -from ..utilities import DateTimeResolutionResult, DateTimeFormatUtil, DateUtils -from ..base_datetimeperiod import BaseDateTimePeriodParser + from ...resources import SpanishDateTime +from ..base_datetimeperiod import BaseDateTimePeriodParser +from ..utilities import DateTimeFormatUtil, DateTimeResolutionResult, DateUtils from .datetimeperiod_parser_config import SpanishDateTimePeriodParserConfiguration @@ -37,28 +38,28 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.timex = DateTimeFormatUtil.format_date(date) + values.time_str result.past_value = [ + DateUtils.safe_create_from_value(DateUtils.min_value, year, month, day, values.begin_hour, 0, 0), DateUtils.safe_create_from_value( - DateUtils.min_value, year, month, day, values.begin_hour, 0, 0), - DateUtils.safe_create_from_value( - DateUtils.min_value, year, month, day, values.end_hour, values.end_min, values.end_min) + DateUtils.min_value, year, month, day, values.end_hour, values.end_min, values.end_min + ), ] result.future_value = result.past_value result.success = True return result - start_index = len(SpanishDateTime.Tomorrow) if trimmed_text.startswith( - SpanishDateTime.Tomorrow) else 0 + start_index = len(SpanishDateTime.Tomorrow) if trimmed_text.startswith(SpanishDateTime.Tomorrow) else 0 # handle Date followed by morning, afternoon # Add handling code to handle morning, afternoon followed by Date # Add handling code to handle early/late morning, afternoon # TODO: use regex from config: match = this.config.TimeOfDayRegex.Match(trimedText.Substring(startIndex)); - matches = list(RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfDayRegex).finditer(trimmed_text[start_index:])) + matches = list( + RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfDayRegex).finditer(trimmed_text[start_index:]) + ) if matches: match = matches[0] - before_str = trimmed_text[0:match.start() + match.end()].strip() + before_str = trimmed_text[0 : match.start() + match.end()].strip() ers = self.config.date_extractor.extract(before_str, reference) if not ers: @@ -73,15 +74,31 @@ def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTi result.future_value = [ DateUtils.safe_create_from_value( - DateUtils.min_value, future_date.year, future_date.month, future_date.day, values.begin_hour, 0, 0), + DateUtils.min_value, future_date.year, future_date.month, future_date.day, values.begin_hour, 0, 0 + ), DateUtils.safe_create_from_value( - DateUtils.min_value, future_date.year, future_date.month, future_date.day, values.end_hour, values.end_min, values.end_min) + DateUtils.min_value, + future_date.year, + future_date.month, + future_date.day, + values.end_hour, + values.end_min, + values.end_min, + ), ] result.past_value = [ DateUtils.safe_create_from_value( - DateUtils.min_value, past_date.year, past_date.month, past_date.day, values.begin_hour, 0, 0), + DateUtils.min_value, past_date.year, past_date.month, past_date.day, values.begin_hour, 0, 0 + ), DateUtils.safe_create_from_value( - DateUtils.min_value, past_date.year, past_date.month, past_date.day, values.end_hour, values.end_min, values.end_min) + DateUtils.min_value, + past_date.year, + past_date.month, + past_date.day, + values.end_hour, + values.end_min, + values.end_min, + ), ] result.success = True diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_extractor_config.py deleted file mode 100644 index d9d44c15f4..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_extractor_config.py +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern - -from recognizers_text.utilities import RegExpUtility -from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..base_set import SetExtractorConfiguration -from ..base_date import BaseDateExtractor -from ..base_time import BaseTimeExtractor -from ..base_duration import BaseDurationExtractor -from ..base_dateperiod import BaseDatePeriodExtractor -from ..base_timeperiod import BaseTimePeriodExtractor -from ..base_datetime import BaseDateTimeExtractor -from ..base_datetimeperiod import BaseDateTimePeriodExtractor -from .date_extractor_config import SpanishDateExtractorConfiguration -from .time_extractor_config import SpanishTimeExtractorConfiguration -from .duration_extractor_config import SpanishDurationExtractorConfiguration -from .dateperiod_extractor_config import SpanishDatePeriodExtractorConfiguration -from .timeperiod_extractor_config import SpanishTimePeriodExtractorConfiguration -from .datetime_extractor_config import SpanishDateTimeExtractorConfiguration -from .datetimeperiod_extractor_config import SpanishDateTimePeriodExtractorConfiguration -from recognizers_number import BaseNumberExtractor -from recognizers_number.number.spanish.extractors import SpanishCardinalExtractor - - -class SpanishSetExtractorConfiguration(SetExtractorConfiguration): - @property - def last_regex(self) -> Pattern: - return self._last_regex - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def before_each_day_regex(self) -> Pattern: - return self._before_each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def cardinal_extractor(self) -> BaseNumberExtractor: - return self._cardinal_extractor - - def __init__(self): - self._last_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LastDateRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.EachUnitRegex) - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.EachPrefixRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.EachDayRegex) - self._before_each_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.BeforeEachDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SetEachRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SetWeekDayRegex) - - self._duration_extractor = BaseDurationExtractor( - SpanishDurationExtractorConfiguration()) - self._time_extractor = BaseTimeExtractor( - SpanishTimeExtractorConfiguration()) - self._date_extractor = BaseDateExtractor( - SpanishDateExtractorConfiguration()) - self._date_time_extractor = BaseDateTimeExtractor( - SpanishDateTimeExtractorConfiguration()) - self._date_period_extractor = BaseDatePeriodExtractor( - SpanishDatePeriodExtractorConfiguration()) - self._time_period_extractor = BaseTimePeriodExtractor( - SpanishTimePeriodExtractorConfiguration()) - self._date_time_period_extractor = BaseDateTimePeriodExtractor( - SpanishDateTimePeriodExtractorConfiguration()) - self._cardinal_extractor = SpanishCardinalExtractor() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_parser_config.py deleted file mode 100644 index e918535124..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_parser_config.py +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Pattern, Dict - -from recognizers_text.utilities import RegExpUtility -from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser -from ..base_set import SetParserConfiguration, MatchedTimex -from ..base_configs import BaseDateParserConfiguration - - -class SpanishSetParserConfiguration(SetParserConfiguration): - @property - def duration_extractor(self) -> DateTimeExtractor: - return self._duration_extractor - - @property - def duration_parser(self) -> DateTimeParser: - return self._duration_parser - - @property - def time_extractor(self) -> DateTimeExtractor: - return self._time_extractor - - @property - def time_parser(self) -> DateTimeParser: - return self._time_parser - - @property - def date_extractor(self) -> DateTimeExtractor: - return self._date_extractor - - @property - def date_parser(self) -> DateTimeParser: - return self._date_parser - - @property - def date_time_extractor(self) -> DateTimeExtractor: - return self._date_time_extractor - - @property - def date_time_parser(self) -> DateTimeParser: - return self._date_time_parser - - @property - def date_period_extractor(self) -> DateTimeExtractor: - return self._date_period_extractor - - @property - def date_period_parser(self) -> DateTimeParser: - return self._date_period_parser - - @property - def time_period_extractor(self) -> DateTimeExtractor: - return self._time_period_extractor - - @property - def time_period_parser(self) -> DateTimeParser: - return self._time_period_parser - - @property - def date_time_period_extractor(self) -> DateTimeExtractor: - return self._date_time_period_extractor - - @property - def date_time_period_parser(self) -> DateTimeParser: - return self._date_time_period_parser - - @property - def unit_map(self) -> Dict[str, str]: - return self._unit_map - - @property - def each_prefix_regex(self) -> Pattern: - return self._each_prefix_regex - - @property - def periodic_regex(self) -> Pattern: - return self._periodic_regex - - @property - def each_unit_regex(self) -> Pattern: - return self._each_unit_regex - - @property - def each_day_regex(self) -> Pattern: - return self._each_day_regex - - @property - def set_week_day_regex(self) -> Pattern: - return self._set_week_day_regex - - @property - def set_each_regex(self) -> Pattern: - return self._set_each_regex - - def __init__(self, config: BaseDateParserConfiguration): - self._duration_extractor = config.duration_extractor - self._time_extractor = config.time_extractor - self._date_extractor = config.date_extractor - self._date_time_extractor = config.date_time_extractor - self._date_period_extractor = config.date_period_extractor - self._time_period_extractor = config.time_period_extractor - self._date_time_period_extractor = config.date_time_period_extractor - self._duration_parser = config.duration_parser - self._time_parser = config.time_parser - self._date_parser = config.date_parser - self._date_time_parser = config.date_time_parser - self._date_period_parser = config.date_period_parser - self._time_period_parser = config.time_period_parser - self._date_time_period_parser = config.date_time_period_parser - self._unit_map = SpanishDateTime.UnitMap - - self._each_prefix_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.EachPrefixRegex) - self._periodic_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PeriodicRegex) - self._each_unit_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.EachUnitRegex) - self._each_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.EachDayRegex) - self._set_week_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SetWeekDayRegex) - self._set_each_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SetEachRegex) - - def get_matched_daily_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - timex = '' - - if trimmed_text.endswith('diario') or trimmed_text.endswith('diariamente'): - timex = 'P1D' - elif trimmed_text == 'semanalmente': - timex = 'P1W' - elif trimmed_text == 'quincenalmente': - timex = 'P2W' - elif trimmed_text == 'mensualmente': - timex = 'P1M' - elif trimmed_text == 'anualmente': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) - - def get_matched_unit_timex(self, text: str) -> MatchedTimex: - trimmed_text = text.strip().lower() - timex = '' - - if ( - trimmed_text == 'día' or trimmed_text == 'dia' or - trimmed_text == 'días' or trimmed_text == 'dias' - ): - timex = 'P1D' - elif trimmed_text == 'semana' or trimmed_text == 'semanas': - timex = 'P1W' - elif trimmed_text == 'mes' or trimmed_text == 'meses': - timex = 'P1M' - elif trimmed_text == 'año' or trimmed_text == 'años': - timex = 'P1Y' - else: - return MatchedTimex(False, None) - - return MatchedTimex(True, timex) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/time_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/time_extractor_config.py index f1af46b736..8450693f98 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/time_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/time_extractor_config.py @@ -2,18 +2,14 @@ # Licensed under the MIT License. from typing import List, Pattern + from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime from ..base_time import TimeExtractorConfiguration -from ..base_timezone import BaseTimeZoneExtractor -from .timezone_extractor_config import SpanishTimeZoneExtractorConfiguration class SpanishTimeExtractorConfiguration(TimeExtractorConfiguration): - @property - def time_zone_extractor(self): - return self._time_zone_extractor - @property def options(self): return self._options @@ -40,14 +36,9 @@ def time_before_after_regex(self) -> Pattern: def __init__(self): super().__init__() - self._time_regex_list: List[Pattern] = SpanishTimeExtractorConfiguration.get_time_regex_list( - ) - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AtRegex) - self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeBeforeAfterRegex) - self._time_zone_extractor = self._timezone_extractor = BaseTimeZoneExtractor( - SpanishTimeZoneExtractorConfiguration()) + self._time_regex_list: List[Pattern] = SpanishTimeExtractorConfiguration.get_time_regex_list() + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AtRegex) + self._time_before_after_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeBeforeAfterRegex) # TODO When the implementation for these properties is added, change the None values to the respective Regexps self._ish_regex: Pattern = None @@ -65,5 +56,5 @@ def get_time_regex_list() -> List[Pattern]: RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeRegex9), RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeRegex11), RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeRegex12), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.ConnectNumRegex) + RegExpUtility.get_safe_reg_exp(SpanishDateTime.ConnectNumRegex), ] diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/time_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/time_parser_config.py index aa90ecbd9a..0c193ff074 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/time_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/time_parser_config.py @@ -1,15 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Pattern, Dict +from typing import Dict, List, Pattern + import regex from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime -from ..base_time import TimeParserConfiguration, AdjustParams from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration +from ..base_time import AdjustParams, TimeParserConfiguration from .time_extractor_config import SpanishTimeExtractorConfiguration -from ..parsers import DateTimeParser class SpanishTimeParserConfiguration(TimeParserConfiguration): @@ -33,24 +34,15 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_token_prefix: str = SpanishDateTime.TimeTokenPrefix - self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.AtRegex) - self._time_regexes: List[Pattern] = SpanishTimeExtractorConfiguration.get_time_regex_list( - ) - self.less_than_one_hour = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.LessThanOneHour) - self.time_suffix = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeSuffix) + self._at_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.AtRegex) + self._time_regexes: List[Pattern] = SpanishTimeExtractorConfiguration.get_time_regex_list() + self.less_than_one_hour = RegExpUtility.get_safe_reg_exp(SpanishDateTime.LessThanOneHour) + self.time_suffix = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeSuffix) self._utility_configuration = config.utility_configuration self._numbers: Dict[str, int] = config.numbers - self._time_zone_parser = config.time_zone_parser def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): delta_min = 0 @@ -71,21 +63,24 @@ def adjust_by_prefix(self, prefix: str, adjust: AdjustParams): if min_str: delta_min = int(min_str) else: - min_str = RegExpUtility.get_group( - match, 'deltaminnum').lower() + min_str = RegExpUtility.get_group(match, 'deltaminnum').lower() delta_min = self.numbers.get(min_str) if ( - prefix.endswith('pasadas') or prefix.endswith('pasados') or - prefix.endswith('pasadas las') or prefix.endswith('pasados las') or - prefix.endswith('pasadas de las') or prefix.endswith( - 'pasados de las') + prefix.endswith('pasadas') + or prefix.endswith('pasados') + or prefix.endswith('pasadas las') + or prefix.endswith('pasados las') + or prefix.endswith('pasadas de las') + or prefix.endswith('pasados de las') ): # deltaMin it's positive pass elif ( - prefix.endswith('para la') or prefix.endswith('para las') or - prefix.endswith('antes de la') or prefix.endswith('antes de las') + prefix.endswith('para la') + or prefix.endswith('para las') + or prefix.endswith('antes de la') + or prefix.endswith('antes de las') ): delta_min = delta_min * -1 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timeperiod_extractor_config.py index 6a47f4762c..8b8120c8fa 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timeperiod_extractor_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timeperiod_extractor_config.py @@ -3,18 +3,17 @@ from typing import List, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor from recognizers_number.number.spanish.extractors import SpanishIntegerExtractor +from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..base_timeperiod import TimePeriodExtractorConfiguration, MatchedIndex from ..base_time import BaseTimeExtractor -from ..base_timezone import BaseTimeZoneExtractor -from .time_extractor_config import SpanishTimeExtractorConfiguration -from .base_configs import SpanishDateTimeUtilityConfiguration +from ..base_timeperiod import MatchedIndex, TimePeriodExtractorConfiguration +from ..extractors import DateTimeExtractor from ..utilities import DateTimeOptions -from .timezone_extractor_config import SpanishTimeZoneExtractorConfiguration +from .base_configs import SpanishDateTimeUtilityConfiguration +from .time_extractor_config import SpanishTimeExtractorConfiguration class SpanishTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): @@ -63,14 +62,9 @@ def token_before_date(self) -> str: def pure_number_regex(self) -> List[Pattern]: return self._pure_number_regex - @property - def time_zone_extractor(self) -> DateTimeExtractor: - return self._time_zone_extractor - def __init__(self): super().__init__() - self._single_time_extractor = BaseTimeExtractor( - SpanishTimeExtractorConfiguration()) + self._single_time_extractor = BaseTimeExtractor(SpanishTimeExtractorConfiguration()) self._integer_extractor = SpanishIntegerExtractor() self.utility_configuration = SpanishDateTimeUtilityConfiguration() @@ -78,27 +72,19 @@ def __init__(self): RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumBetweenAnd), RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeFromTo), - RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeBetweenAnd) + RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeBetweenAnd), ] - self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TillRegex) - self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfDayRegex) - self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.GeneralEndingRegex) - - self.from_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.FromRegex) - self.range_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.RangeConnectorRegex) - self.between_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.BetweenRegex) + self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TillRegex) + self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfDayRegex) + self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishDateTime.GeneralEndingRegex) + + self.from_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FromRegex) + self.range_connector_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RangeConnectorRegex) + self.between_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.BetweenRegex) self._token_before_date = SpanishDateTime.TokenBeforeDate self._pure_number_regex = [SpanishDateTime.PureNumFromTo, SpanishDateTime.PureNumFromTo] self._options = DateTimeOptions.NONE - self._time_zone_extractor = BaseTimeZoneExtractor( - SpanishTimeZoneExtractorConfiguration()) self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter def get_from_token_index(self, source: str) -> MatchedIndex: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timeperiod_parser_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timeperiod_parser_config.py index 29cceb8e8d..fe51d86e1f 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timeperiod_parser_config.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timeperiod_parser_config.py @@ -1,18 +1,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, Dict +from typing import Dict, Pattern -from recognizers_text.utilities import RegExpUtility from recognizers_text.extractor import Extractor +from recognizers_text.utilities import RegExpUtility + from ...resources.spanish_date_time import SpanishDateTime -from ..extractors import DateTimeExtractor -from ..parsers import DateTimeParser from ..base_configs import BaseDateParserConfiguration, DateTimeUtilityConfiguration -from ..base_timeperiod import TimePeriodParserConfiguration, MatchedTimeRegex +from ..base_timeperiod import MatchedTimeRegex, TimePeriodParserConfiguration from ..constants import Constants +from ..extractors import DateTimeExtractor +from ..parsers import DateTimeParser from ..utilities import TimexUtil -from ..base_timezone import BaseTimeZoneParser class SpanishTimePeriodParserConfiguration(TimePeriodParserConfiguration): @@ -60,29 +60,18 @@ def numbers(self) -> Dict[str, int]: def utility_configuration(self) -> DateTimeUtilityConfiguration: return self._utility_configuration - @property - def time_zone_parser(self) -> DateTimeParser: - return self._time_zone_parser - def __init__(self, config: BaseDateParserConfiguration): self._time_extractor = config.time_extractor self._time_parser = config.time_parser self._integer_extractor = config.integer_extractor self._numbers = config.numbers self._utility_configuration = config.utility_configuration - self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PureNumFromTo) - self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.PureNumBetweenAnd) - self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecificTimeFromTo) - self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.SpecificTimeBetweenAnd) - self._time_of_day_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TimeOfDayRegex) - self._till_regex = RegExpUtility.get_safe_reg_exp( - SpanishDateTime.TillRegex) - self._time_zone_parser = config.time_zone_parser + self._pure_number_from_to_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumFromTo) + self._pure_number_between_and_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumBetweenAnd) + self._specific_time_from_to_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeFromTo) + self._specific_time_between_and_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeBetweenAnd) + self._time_of_day_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TimeOfDayRegex) + self._till_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TillRegex) def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: trimmed_text = source.strip().lower() @@ -106,13 +95,7 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: elif any(trimmed_text.endswith(o) for o in SpanishDateTime.NightTermList): time_of_day = Constants.NIGHT else: - return MatchedTimeRegex( - matched=False, - timex='', - begin_hour=0, - end_hour=0, - end_min=0 - ) + return MatchedTimeRegex(matched=False, timex='', begin_hour=0, end_hour=0, end_min=0) parse_result = TimexUtil.parse_time_of_day(time_of_day) timex = parse_result.timex @@ -120,10 +103,4 @@ def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: end_hour = parse_result.end_hour end_min = parse_result.end_min - return MatchedTimeRegex( - matched=True, - timex=timex, - begin_hour=begin_hour, - end_hour=end_hour, - end_min=end_min - ) + return MatchedTimeRegex(matched=True, timex=timex, begin_hour=begin_hour, end_hour=end_hour, end_min=end_min) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timezone_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timezone_extractor_config.py deleted file mode 100644 index 322dd53009..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/timezone_extractor_config.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import List, Pattern -from recognizers_text.matcher.string_matcher import StringMatcher -from ..base_timezone import TimeZoneExtractorConfiguration - - -class SpanishTimeZoneExtractorConfiguration(TimeZoneExtractorConfiguration): - @property - def direct_utc_regex(self) -> Pattern: - return self._direct_utc_regex - - @property - def location_time_suffix_regex(self) -> Pattern: - return self._location_time_suffix_regex - - @property - def location_matcher(self) -> StringMatcher: - return self._location_matcher - - @property - def timezone_matcher(self) -> StringMatcher: - return self._timezone_matcher - - @property - def ambiguous_timezone_list(self) -> List[str]: - return self._ambiguous_timezone_list diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities.py deleted file mode 100644 index e93d620357..0000000000 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities.py +++ /dev/null @@ -1,1195 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from enum import Enum, IntEnum, IntFlag -from abc import ABC, abstractmethod -from typing import List, Dict, Pattern, Union, Match -from datetime import datetime, timedelta -import calendar - -from datedelta import datedelta -import regex - -from recognizers_text.matcher.number_with_unit_tokenizer import NumberWithUnitTokenizer -from recognizers_text.matcher.match_strategy import MatchStrategy -from recognizers_text.extractor import ExtractResult, Metadata -from recognizers_text.utilities import RegExpUtility -from recognizers_date_time.date_time.constants import TimeTypeConstants, Constants -from recognizers_date_time.date_time.extractors import DateTimeExtractor -from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult -from recognizers_text.matcher.string_matcher import StringMatcher, MatchResult -from ..resources.base_date_time import BaseDateTime - - -class TimeZoneUtility: - - @staticmethod - def merge_time_zones(original_extract_results: [ExtractResult], time_zone_ers: [ExtractResult], text: str): - - for extract_result in original_extract_results: - for time_zone_er in time_zone_ers: - - begin = extract_result.start + extract_result.length - end = time_zone_er.start - - if begin < end: - gap_text = text[begin: begin + (end - begin)] - - if gap_text.isspace() or gap_text is None: - new_length = time_zone_er.start + time_zone_er.length - extract_result.start - - extract_result.text = text[extract_result.start:new_length] - extract_result.length = new_length - extract_result.data = {Constants.SYS_DATETIME_TIMEZONE, time_zone_er} - - if extract_result.overlap(time_zone_er): - extract_result.data = {Constants.SYS_DATETIME_TIMEZONE, time_zone_er} - - return original_extract_results - - @staticmethod - def should_resolve_time_zone(extract_result: ExtractResult, options): - enable_preview = (options & DateTimeOptions.ENABLE_PREVIEW) != 0 - - if not enable_preview: - return False - - has_time_zone_data = False - - if isinstance(extract_result.data, {}): - meta_data = extract_result.data - if meta_data is not None and Constants.SYS_DATETIME_TIMEZONE in meta_data.keys(): - has_time_zone_data = True - - return has_time_zone_data - - @staticmethod - def build_matcher_from_lists(*collections: List[str]) -> StringMatcher: - matcher = StringMatcher(MatchStrategy.TrieTree, NumberWithUnitTokenizer()) - - matcher_list = [] - for collection in collections: - list(map(lambda x: matcher_list.append(x.strip().lower()), collection)) - - matcher_list = TimeZoneUtility.distinct(matcher_list) - - matcher.init(matcher_list) - - return matcher - - @staticmethod - def distinct(list1): - - unique_list = [] - for x in list1: - - if x not in unique_list: - unique_list.append(x) - - return unique_list - - -class DateTimeOptions(IntFlag): - NONE = 0 - SKIP_FROM_TO_MERGE = 1 - SPLIT_DATE_AND_TIME = 2 - CALENDAR = 4 - EXTENDED_TYPES = 8 - FAIL_FAST = 2097152 - EXPERIMENTAL_MODE = 4194304 - ENABLE_PREVIEW = 8388608 - - -class DateTimeOptionsConfiguration: - @property - def options(self): - return self._options - - @property - def dmy_date_format(self) -> bool: - return self._dmy_date_format - - def __init__(self, options=DateTimeOptions.NONE, dmy_date_format=False): - self._options = options - self._dmy_date_format = dmy_date_format - - -class DurationParsingUtil: - - @staticmethod - def is_time_duration_unit(uni_str: str): - - if uni_str == Constants.UNIT_H: - result = True - elif uni_str == Constants.UNIT_M: - result = True - elif uni_str == Constants.UNIT_S: - result = True - else: - result = False - - return result - - -class Token: - def __init__(self, start: int, end: int, metadata: Metadata = None): - self._start: int = start - self._end: int = end - self._metadata = metadata - - @property - def length(self) -> int: - if self._start > self._end: - return 0 - return self._end - self._start - - @property - def start(self) -> int: - return self._start - - @start.setter - def start(self, value) -> int: - self._start = value - - @property - def end(self) -> int: - return self._end - - @end.setter - def end(self, value) -> int: - self._end = value - - @property - def metadata(self): - return self._metadata - - @metadata.setter - def metadata(self, value): - self._metadata = value - - -def merge_all_tokens(tokens: List[Token], source: str, extractor_name: str) -> List[ExtractResult]: - result = [] - - merged_tokens: List[Token] = list() - tokens_ = sorted(filter(None, tokens), key=lambda x: x.start) - - for token in tokens_: - add = True - - for index, m_token in enumerate(merged_tokens): - if not add: - break - - if token.start >= m_token.start and token.end <= m_token.end: - add = False - - if m_token.start < token.start < m_token.end: - add = False - - if token.start <= m_token.start and token.end >= m_token.end: - add = False - merged_tokens[index] = token - - if add: - merged_tokens.append(token) - - for token in merged_tokens: - start = token.start - length = token.length - sub_str = source[start: start + length] - - extracted_result = ExtractResult() - extracted_result.start = start - extracted_result.length = length - extracted_result.text = sub_str - extracted_result.type = extractor_name - extracted_result.data = None - extracted_result.meta_data = token.metadata - - result.append(extracted_result) - - return result - - -def __token_to_result(token: Token, source: str, name: str) -> ExtractResult: - result: ExtractResult = ExtractResult() - result.start = token.start - result.length = token.length - result.text = source[token.start:token.end] - result.type = name - return result - - -def get_tokens_from_regex(pattern: Pattern, source: str) -> List[Token]: - return list(map(lambda x: Token(x.start(), x.end()), regex.finditer(pattern, source))) - - -class ResolutionStartEnd: - def __init__(self, _start=None, _end=None): - self.start = _start - self.end = _end - - @property - def _start(self): - return self.start - - @property - def _end(self): - return self.end - - -class DateTimeResolutionResult: - def __init__(self): - self.success: bool = False - self.timex: str = '' - self.is_lunar: bool = False - self.mod: str = '' - self.has_range_changing_mod: bool = False - self.comment: str = '' - self.future_resolution: Dict[str, str] = dict() - self.past_resolution: Dict[str, str] = dict() - self.future_value: object = None - self.past_value: object = None - self.sub_date_time_entities: List[object] = list() - self.timezone_resolution: TimeZoneResolutionResult() - self.list: List[object] = list() - - -class TimeOfDayResolution: - def __init__(self): - self.timex: str = None - self.begin_hour: int = 0 - self.end_hour: int = 0 - self.end_min: int = 0 - - -class DateTimeFormatUtil: - HourTimeRegex = RegExpUtility.get_safe_reg_exp(r'(? str: - format_ = f'{{0:0{size}d}}' - return str.format(format_, num) - - @staticmethod - def luis_date(year: int, month: int, day: int) -> str: - if year == -1: - if month == -1: - return f'XXXX-XX-{day:02d}' - return f'XXXX-{month:02d}-{day:02d}' - return f'{year:04d}-{month:02d}-{day:02d}' - - @staticmethod - def luis_date_from_datetime(date: datetime) -> str: - return DateTimeFormatUtil.luis_date(date.year, date.month, date.day) - - @staticmethod - def luis_time(hour: int, minute: int, second: int = Constants.INVALID_SECOND) -> str: - if second == Constants.INVALID_SECOND: - return f'{hour:02d}:{minute:02d}' - else: - return f'{hour:02d}:{minute:02d}:{second:02d}' - - @staticmethod - def luis_time_from_datetime(time: datetime) -> str: - return DateTimeFormatUtil.luis_time(time.hour, time.minute, time.second) - - @staticmethod - def luis_date_time(time: datetime) -> str: - return DateTimeFormatUtil.luis_date_from_datetime(time) + 'T' + DateTimeFormatUtil.luis_time_from_datetime(time) - - @staticmethod - def luis_date_short_time(time: datetime, timex: str = None) -> str: - has_min = False if timex is None else Constants.TIME_TIMEX_CONNECTOR in timex - has_sec = False if timex is None else len(timex.split(Constants.TIME_TIMEX_CONNECTOR)) > 2 - - return DateTimeFormatUtil.luis_date_from_datetime(time) + DateTimeFormatUtil.format_short_time(time, has_min, has_sec) - - @staticmethod - def format_short_time(time: datetime, has_min: bool = False, has_sec: bool = False) -> str: - hour = time.hour - min = time.minute if has_min or time.minute > 0 else Constants.INVALID_MINUTE - sec = time.second if has_sec or time.second > 0 else Constants.INVALID_SECOND - return DateTimeFormatUtil.short_time(hour, min, sec) - - @staticmethod - def short_time(hour: int, minute: int = Constants.INVALID_MINUTE, second: int = Constants.INVALID_SECOND) -> str: - if minute == Constants.INVALID_MINUTE and second == Constants.INVALID_SECOND: - return f'{Constants.TIME_TIMEX_PREFIX}{hour:02d}' - else: - return f'{Constants.TIME_TIMEX_PREFIX}{DateTimeFormatUtil.luis_time(hour, minute, second)}' - - @staticmethod - def luis_time_span(begin_time: datetime, end_time: datetime) -> str: - timex_builder = f'{Constants.GENERAL_PERIOD_PREFIX}{Constants.TIME_TIMEX_PREFIX}' - span = end_time - begin_time - total_days = span.days - total_seconds = span.seconds - total_hours, total_seconds = divmod(total_seconds, Constants.HOUR_SECOND_COUNT) - total_minutes, total_seconds = divmod(total_seconds, Constants.MINUTE_SECOND_COUNT) - - if total_days > 0 or total_hours > 0: - timex_builder += f'{total_days * Constants.DAY_HOUR_COUNT + total_hours}H' - if total_minutes > 0: - timex_builder += f'{total_minutes}M' - if total_seconds > 0: - timex_builder += f'{total_seconds}S' - - return str(timex_builder) - - @staticmethod - def format_date(date: datetime) -> str: - return f'{date.year:04d}-{date.month:02d}-{date.day:02d}' - - @staticmethod - def format_time(time: datetime) -> str: - return f'{time.hour:02d}:{time.minute:02d}:{time.second:02d}' - - @staticmethod - def format_date_time(date_time: datetime) -> str: - return DateTimeFormatUtil.format_date(date_time) + ' ' + DateTimeFormatUtil.format_time(date_time) - - @staticmethod - def all_str_to_pm(source: str) -> str: - matches = list(regex.finditer( - DateTimeFormatUtil.HourTimeRegex, source)) - split: List[str] = list() - last_position = 0 - - for match in matches: - if last_position != match.start(): - split.append(source[last_position:match.start()]) - - split.append(source[match.start():match.end()]) - last_position = match.end() - - if source[:last_position]: - split.append(source[last_position:]) - - for index, value in enumerate(split): - if regex.search(DateTimeFormatUtil.HourTimeRegex, value): - split[index] = DateTimeFormatUtil.to_pm(value) - - return ''.join(split) - - @staticmethod - def to_pm(source: str) -> str: - result = '' - - if source.startswith(Constants.UNIT_T): - result = Constants.UNIT_T - source = source[1:] - - split = source.split(':') - hour = int(split[0]) - hour = 0 if hour == 12 else hour + 12 - split[0] = f'{hour:02d}' - return result + ':'.join(split) - -# ISO weekday - - -class DayOfWeek(IntEnum): - MONDAY = 1 - TUESDAY = 2 - WEDNESDAY = 3 - THURSDAY = 4 - FRIDAY = 5 - SATURDAY = 6 - SUNDAY = 7 - - -class DateUtils: - min_value = datetime(1, 1, 1, 0, 0, 0, 0) - - # Generate future/past date for cases without specific year like "Feb 29th" - @staticmethod - def generate_dates(no_year: bool, reference: datetime, year: int, month: int, day: int) -> list: - future_date = DateUtils.safe_create_from_min_value(year, month, day) - past_date = DateUtils.safe_create_from_min_value(year, month, day) - future_year = year - past_year = year - if no_year: - if DateUtils.is_Feb_29th(year, month, day): - if DateUtils.is_leap_year(year): - if future_date < reference: - future_date = DateUtils.safe_create_from_min_value(future_year + 4, month, day) - else: - past_date = DateUtils.safe_create_from_min_value(past_year - 4, month, day) - else: - past_year = past_year >> 2 << 2 - if not DateUtils.is_leap_year(past_year): - past_year -= 4 - - future_year = past_year + 4 - if not DateUtils.is_leap_year(future_year): - future_year += 4 - - future_date = DateUtils.safe_create_from_min_value(future_year, month, day) - past_date = DateUtils.safe_create_from_min_value(past_year, month, day) - else: - if future_date < reference and DateUtils.is_valid_date(year, month, day): - future_date = DateUtils.safe_create_from_min_value(year + 1, month, day) - - if past_date >= reference and DateUtils.is_valid_date(year, month, day): - past_date = DateUtils.safe_create_from_min_value(year - 1, month, day) - return future_date, past_date - - @staticmethod - def int_try_parse(value): - try: - return int(value), True - except ValueError: - return value, False - - @staticmethod - def safe_create_from_value(seed: datetime, year: int, month: int, day: int, - hour: int = 0, minute: int = 0, second: int = 0) -> datetime: - if DateUtils.is_valid_date(year, month, day) and DateUtils.is_valid_time(hour, minute, second): - return datetime(year, month, day, hour, minute, second) - - return seed - - @staticmethod - def safe_create_from_min_value(year: int, month: int, day: int, - hour: int = 0, minute: int = 0, second: int = 0) -> datetime: - return DateUtils.safe_create_from_value(DateUtils.min_value, year, month, day, hour, minute, second) - - @staticmethod - def safe_create_from_min_value_date_time(date: datetime, time: datetime = None) -> datetime: - return DateUtils.safe_create_from_value(DateUtils.min_value, date.year, date.month, date.day, - time.hour if time else 0, time.minute if time else 0, - time.second if time else 0) - - @staticmethod - def is_valid_date(year: int, month: int, day: int) -> bool: - try: - datetime(year, month, day) - return True - except ValueError: - return False - - @staticmethod - def is_valid_datetime(date: datetime) -> bool: - return date != DateUtils.min_value - - @staticmethod - def is_valid_time(hour: int, minute: int, second: int) -> bool: - return 0 <= hour < 24 and 0 <= minute < 60 and second >= 0 and minute < 60 - - @staticmethod - def this(from_date: datetime, day_of_week: DayOfWeek) -> datetime: - start = from_date.isoweekday() - target = day_of_week if day_of_week >= int( - DayOfWeek.MONDAY) else int(DayOfWeek.SUNDAY) - result = from_date + timedelta(days=target-start) - return result - - @staticmethod - def next(from_date: datetime, day_of_week: DayOfWeek) -> datetime: - return DateUtils.this(from_date, day_of_week) + timedelta(weeks=1) - - @staticmethod - def last(from_date: datetime, day_of_week: DayOfWeek) -> datetime: - return DateUtils.this(from_date, day_of_week) - timedelta(weeks=1) - - @staticmethod - def safe_create_date_resolve_overflow(year: int, month: int, day: int) -> datetime: - if month > 12: - year = year + month // 12 - month = month % 12 - return DateUtils.safe_create_from_min_value(year, month, day) - - @staticmethod - def total_hours(from_date: datetime, to_date: datetime) -> int: - return round((to_date - from_date).total_seconds() / 3600) - - @staticmethod - def day_of_year(seed: datetime) -> int: - return seed.timetuple().tm_yday - - @staticmethod - def last_day_of_month(year: int, month: int) -> int: - return calendar.monthrange(year, month)[1] - - @staticmethod - def week_of_year(date: datetime) -> int: - return date.isocalendar()[1] - - @staticmethod - def is_leap_year(year) -> bool: - return (year % 4 == 0) and (year % 100 != 0) or (year % 400 == 0) - - @staticmethod - def is_Feb_29th(year, month, day): - return month == 2 and day == 29 - - @staticmethod - def is_Feb_29th_datetime(date: datetime): - return date.month == 2 and date.day == 29 - - @staticmethod - def day_of_week(day): - dayOfWeek = { - 'sunday': 0, - 'monday': 1, - 'tuesday': 2, - 'wednesday': 3, - 'thursday': 4, - 'friday': 5, - 'saturday': 6, - } - return dayOfWeek.get(day) - - -class HolidayFunctions: - - @staticmethod - def calculate_holiday_by_easter(year: int, days: int = 0) -> datetime: - - day = 0 - month = 3 - - g = year % 19 - c = year / 100 - - h = (c - int(c / 4) - int(((8 * c) + 13) / 25) + (19 * g) + 15) % 30 - i = h - (int(h / 28) * (1 - (int(h / 28) * int(29 / (h + 1)) * int((21 - g) / 11)))) - day = i - ((year + int(year / 4) + i + 2 - c + int(c / 4)) % 7) + 28 - - if day > 31: - month += 1 - day -= 31 - - return DateUtils.safe_create_from_min_value(year, month, int(day)) + timedelta(days=days) - - -class DateTimeUtilityConfiguration(ABC): - @property - @abstractmethod - def since_year_suffix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def date_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def range_prefix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def ago_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def later_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def in_connector_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def range_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def am_desc_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def pm_desc__regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def am_pm_desc_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def time_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def within_next_prefix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def common_date_prefix_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def check_both_before_after(self) -> Pattern: - raise NotImplementedError - - -class MatchedIndex: - def __init__(self, matched: bool, index: int): - self.matched = matched - self.index = index - - -class MatchingUtil: - - invalid_day_number_prefix = RegExpUtility.get_safe_reg_exp( - BaseDateTime.InvalidDayNumberPrefix) - - @staticmethod - def is_invalid_day_number_prefix(prefix: str) -> bool: - return MatchingUtil.invalid_day_number_prefix.search(prefix) - - @staticmethod - def pre_process_text_remove_superfluous_words(text: str, matcher: Pattern): - superfluous_word_matches = MatchingUtil.remove_sub_matches(matcher.find(text)) - - bias = 0[0] - - for match in superfluous_word_matches: - text = text[match.start - bias: match.length] - - bias += match.length - - return text, superfluous_word_matches - - @staticmethod - def post_process_recover_superfluous_words(extract_results: List[ExtractResult], superfluous_word_matches, - origin_text: str): - for match in superfluous_word_matches: - for extract_result in extract_results: - - extract_result_end = extract_result.start + extract_result.length - if extract_result.start < match.start <= extract_result_end: - extract_result.length += len(match) - - if match.start <= extract_result.start: - extract_result.start += len(match) - - for extract_result in extract_results: - extract_result.text = origin_text[extract_result.start: extract_result.start + extract_result.length] - - return extract_results - - @staticmethod - def remove_sub_matches(match_results: List[MatchResult]): - match_list = list(match_results) - - match_list = (list(filter(lambda item: not any(list(filter( - lambda ritem: (ritem.start < item.start and ritem.end >= item.end) or ( - ritem.start <= item.start and ritem.end > item.end), match_list))), match_list))) - - return match_list - - @staticmethod - def get_ago_later_index(source: str, regexp: Pattern, in_suffix) -> MatchedIndex: - result = MatchedIndex(matched=False, index=-1) - trimmed_source = source.strip().lower() - match = RegExpUtility.match_begin(regexp, trimmed_source, True) if in_suffix else\ - RegExpUtility.match_end(regexp, trimmed_source, True) - - if match and match.success: - result.index = source.lower().find(match.group()) + (match.length if in_suffix else 0) - result.matched = True - - return result - - @staticmethod - def contains_ago_later_index(source: str, regexp: Pattern, in_suffix) -> bool: - return MatchingUtil.get_ago_later_index(source, regexp, in_suffix).matched - - @staticmethod - def get_term_index(source: str, regexp: Pattern) -> MatchedIndex: - result = MatchedIndex(matched=False, index=-1) - referenced_match = regex.search( - regexp, source.strip().lower().split(' ').pop()) - - if referenced_match: - result = MatchedIndex(matched=True, index=len( - source) - source.lower().rfind(referenced_match.group())) - - return result - - @staticmethod - def contains_term_index(source: str, regexp: Pattern) -> bool: - return MatchingUtil.get_term_index(source, regexp).matched - - -class AgoLaterMode(Enum): - DATE = 0 - DATETIME = 1 - - -class AgoLaterUtil: - @staticmethod - def extractor_duration_with_before_and_after(source: str, extract_result: ExtractResult, - ret: List[Token], config: DateTimeUtilityConfiguration) -> List[Token]: - pos = extract_result.start + extract_result.length - index = 0 - if pos <= len(source): - after_string = source[pos:] - before_string = source[0: extract_result.start] - is_time_duration = config.time_unit_regex.search(extract_result.text) - ago_later_regexes = [config.ago_regex, config.later_regex] - is_match = False - - for regexp in ago_later_regexes: - token_after = token_before = None - is_day_match = False - # Check after_string - if MatchingUtil.get_ago_later_index(after_string, regexp, True).matched: - # We don't support cases like "5 minutes from today" for now - # Cases like "5 minutes ago" or "5 minutes from now" are supported - # Cases like "2 days before today" or "2 weeks from today" are also supported - - is_day_match = RegExpUtility.get_group( - regexp.match(after_string), Constants.DAY_GROUP_NAME) - - index = MatchingUtil.get_ago_later_index( - after_string, regexp, True).index - - if not(is_time_duration and is_day_match): - token_after = Token(extract_result.start, extract_result.start + - extract_result.length + index) - is_match = True - - if config.check_both_before_after: - before_after_str = before_string + after_string - is_range_match = RegExpUtility.match_begin(config.range_prefix_regex, after_string[:index], True) - index_start = MatchingUtil.get_ago_later_index(before_after_str, regexp, False) - if not is_range_match and index_start.matched: - is_day_match = regexp.match(before_after_str) - - if is_day_match and not (is_time_duration and is_day_match): - ret.append(Token(index_start.index, (extract_result.start + extract_result.length or 0) + index)) - is_match = True - index = MatchingUtil.get_ago_later_index(before_string, regexp, False).index - if MatchingUtil.get_ago_later_index(before_string, regexp, False).matched: - is_day_match = RegExpUtility.get_group(regexp.match(before_string), 'day') - - if not (is_day_match and is_time_duration): - token_before = Token(index, extract_result.start + extract_result.length or 0) - is_match = True - - if token_after is not None and token_before is not None and token_before.start + token_before.length > token_after.start: - ret.append(Token(token_before.start, token_after.start + token_after.length - token_before.start)) - elif token_after is not None: - ret.append(token_after) - elif token_before is not None: - ret.append(token_before) - if is_match: - break - - if not is_match: - in_within_regex_tuples = [ - (config.in_connector_regex, [config.range_unit_regex]), - (config.within_next_prefix_regex, [config.date_unit_regex, config.time_unit_regex]) - ] - - for regexp in in_within_regex_tuples: - is_match_after = False - index = MatchingUtil.get_term_index(before_string, regexp[0]).index - if index > 0: - is_match = True - elif config.check_both_before_after and\ - MatchingUtil.get_ago_later_index(after_string, regexp[0], True).matched: - is_match = is_match_after = True - - if is_match: - is_unit_match = False - for unit_regex in regexp[1]: - is_unit_match = is_unit_match or unit_regex.match(extract_result.text) - - if not is_unit_match: - if extract_result.start is not None and extract_result.length is not None and\ - extract_result.start >= index or is_match_after: - start = extract_result.start - (index if not is_match_after else 0) - end = extract_result.start + extract_result.length + (index if is_match_after else 0) - ret.append(Token(start, end)) - break - return ret - - @staticmethod - def parse_duration_with_ago_and_later(source: str, reference: datetime, - duration_extractor: DateTimeExtractor, - duration_parser: DateTimeParser, - unit_map: Dict[str, str], - unit_regex: Pattern, - utility_configuration: DateTimeUtilityConfiguration)\ - -> DateTimeResolutionResult: - result = DateTimeResolutionResult() - - if duration_extractor: - duration_extract = duration_extractor.extract(source, reference) - else: - return result - - if not duration_extract: - return result - - duration = next(iter(duration_extract)) - pr = duration_parser.parse(duration, reference) - - if not pr: - return result - - match = regex.search(unit_regex, source) - if not match: - return result - - after_str = source[duration.start + duration.length:] - before_str = source[0:duration.start] - src_unit = match.group(Constants.UNIT) - duration_result: DateTimeResolutionResult = pr.value - num_str = duration_result.timex[0:len( - duration_result.timex) - 1].replace(Constants.UNIT_P, '').replace(Constants.UNIT_T, '') - num = int(num_str) - - mode = AgoLaterMode.DATE - if pr.timex_str.__contains__("T"): - mode = AgoLaterMode.DATETIME - - if pr.value: - return AgoLaterUtil.get_ago_later_result( - pr, num, unit_map, src_unit, after_str, before_str, reference, - utility_configuration, mode) - - return result - - @staticmethod - def __matched_string(regexp, string): - is_match = True - match = regexp.match(string) - day_str = match.group('day') - - return is_match, match, day_str - - @staticmethod - def get_ago_later_result( - duration_parse_result: DateTimeParseResult, num: int, - unit_map: Dict[str, str], src_unit: str, after_str: str, - before_str: str, reference: datetime, - utility_configuration: DateTimeUtilityConfiguration, mode: AgoLaterMode): - - result = DateTimeResolutionResult() - unit_str = unit_map.get(src_unit) - - if not unit_str: - return result - - contains_ago = MatchingUtil.contains_ago_later_index( - after_str, utility_configuration.ago_regex, True) - contains_later_or_in = MatchingUtil.contains_ago_later_index( - after_str, utility_configuration.later_regex, False) or\ - MatchingUtil.contains_term_index(before_str, utility_configuration.in_connector_regex) - - if contains_ago: - result = AgoLaterUtil.get_date_result( - unit_str, num, reference, False, mode) - duration_parse_result.value.mod = TimeTypeConstants.BEFORE_MOD - result.sub_date_time_entities = [duration_parse_result] - return result - - if contains_later_or_in: - result = AgoLaterUtil.get_date_result( - unit_str, num, reference, True, mode) - duration_parse_result.value.mod = TimeTypeConstants.AFTER_MOD - result.sub_date_time_entities = [duration_parse_result] - return result - - return result - - @staticmethod - def get_date_result( - unit_str: str, num: int, reference: datetime, is_future: bool, - mode: AgoLaterMode) -> DateTimeResolutionResult: - value = reference - result = DateTimeResolutionResult() - swift = 1 if is_future else -1 - - if unit_str == Constants.UNIT_D: - value += timedelta(days=num * swift) - elif unit_str == Constants.UNIT_W: - value += timedelta(days=num * swift * 7) - elif unit_str == Constants.UNIT_MON: - value += datedelta(months=num * swift) - elif unit_str == Constants.UNIT_Y: - value += datedelta(years=num * swift) - elif unit_str == Constants.UNIT_H: - value += timedelta(hours=num * swift) - elif unit_str == Constants.UNIT_M: - value += timedelta(minutes=num * swift) - elif unit_str == Constants.UNIT_S: - value += timedelta(seconds=num * swift) - else: - return result - - result.timex = DateTimeFormatUtil.luis_date_from_datetime( - value) if mode == AgoLaterMode.DATE else DateTimeFormatUtil.luis_date_time(value) - result.future_value = value - result.past_value = value - result.success = True - return result - - -class DateContext: - year: int = Constants.INVALID_YEAR - - # This method is to ensure the begin date is less than the end date. As DateContext only supports common Year as - # context, so it subtracts one year from beginDate. - # @TODO problematic in other usages. - @staticmethod - def swift_date_object(begin_date: datetime, end_date: datetime) -> datetime: - if begin_date > end_date: - begin_date = begin_date - datedelta(years=1) - return begin_date - - def process_date_entity_parsing_result(self, original_result: DateTimeParseResult) -> DateTimeParseResult: - if not self.is_empty(): - original_result.timex_str = TimexUtil.set_timex_with_context(original_result.timex_str, self) - original_result.value = self.process_date_entity_resolution(original_result.value) - - return original_result - - def process_date_entity_resolution(self, resolution_result: DateTimeResolutionResult) -> DateTimeResolutionResult: - if not self.is_empty(): - resolution_result.timex = TimexUtil.set_timex_with_context(resolution_result.timex, self) - resolution_result.future_value = self.__set_date_with_context(resolution_result.future_value) - resolution_result.past_value = self.__set_date_with_context(resolution_result.past_value) - return resolution_result - - def process_date_period_entity_resolution(self, resolution_result: DateTimeResolutionResult) -> DateTimeResolutionResult: - if not self.is_empty(): - resolution_result.timex = TimexUtil.set_timex_with_context(resolution_result.timex, self) - resolution_result.future_value = self.__set_date_range_with_context(resolution_result.future_value) - resolution_result.past_value = self.__set_date_range_with_context(resolution_result.past_value) - return resolution_result - - def is_empty(self) -> bool: - return self.year == Constants.INVALID_YEAR - - def __set_date_with_context(self, original_date, year=-1) -> datetime: - if not DateUtils.is_valid_datetime(original_date): - return original_date - value = DateUtils.safe_create_from_min_value(year=self.year if year == -1 else year, month=original_date.month, day=original_date.day) - return value - - def __set_date_range_with_context(self, original_date_range): - start_date = self.__set_date_with_context(original_date_range[0]) - end_date = self.__set_date_with_context(original_date_range[1]) - result = { - TimeTypeConstants.START_DATE: start_date, - TimeTypeConstants.END_DATE: end_date - } - - return result - - # This method is to ensure the year of begin date is same with the end date in no year situation. - def sync_year(self, pr1, pr2): - if self.is_empty(): - if DateUtils.is_Feb_29th_datetime(pr1.value.future_value): - future_year = pr1.value.future_value.year - past_year = pr1.value.past_value.year - pr2.value = self.sync_year_resolution(pr2.value, future_year, past_year) - elif DateUtils.is_Feb_29th_datetime(pr2.value.future_value): - future_year = pr2.value.future_value.year - past_year = pr2.value.past_value.year - pr1.value = self.sync_year_resolution(pr1.value, future_year, past_year) - return pr1, pr2 - - def sync_year_resolution(self, resolution_result, future_year, past_year): - resolution_result.future_value = self.__set_date_with_context(resolution_result.future_value, future_year) - resolution_result.past_value = self.__set_date_with_context(resolution_result.past_value, past_year) - return resolution_result - - -date_period_timex_type_to_suffix = { - 0: Constants.TIMEX_DAY, - 1: Constants.TIMEX_WEEK, - 2: Constants.TIMEX_MONTH, - 3: Constants.TIMEX_YEAR, -} - - -class RangeTimexComponents: - def __init__(self): - self.begin_timex = '' - self.end_timex = '' - self.duration_timex = '' - self.is_valid = False - - -class TimexUtil: - - @staticmethod - def merge_timex_alternatives(timex1: str, timex2: str) -> str: - if timex1 == timex2: - return timex1 - return f"{timex1}{Constants.COMPOSTIE_TIMEX_DELIMITER}{timex2}" - - @staticmethod - def parse_time_of_day(tod: str) -> TimeOfDayResolution: - result = TimeOfDayResolution() - - if tod == Constants.EARLY_MORNING: - result.timex = Constants.EARLY_MORNING - result.begin_hour = 4 - result.end_hour = 8 - elif tod == Constants.MORNING: - result.timex = Constants.MORNING - result.begin_hour = 8 - result.end_hour = 12 - elif tod == Constants.MID_DAY: - result.timex = Constants.MID_DAY - result.begin_hour = 11 - result.end_hour = 13 - elif tod == Constants.AFTERNOON: - result.timex = Constants.AFTERNOON - result.begin_hour = 12 - result.end_hour = 16 - elif tod == Constants.EVENING: - result.timex = Constants.EVENING - result.begin_hour = 16 - result.end_hour = 20 - elif tod == Constants.DAYTIME: - result.timex = Constants.DAYTIME - result.begin_hour = 8 - result.end_hour = 18 - elif tod == Constants.BUSINESS_HOUR: - result.timex = Constants.BUSINESS_HOUR - result.begin_hour = 8 - result.end_hour = 18 - elif tod == Constants.NIGHT: - result.timex = Constants.NIGHT - result.begin_hour = 20 - result.end_hour = 23 - result.end_min = 59 - elif tod == Constants.MEALTIME_BREAKFAST: - result.timex = Constants.MEALTIME_BREAKFAST - result.begin_hour = 8 - result.end_hour = 12 - elif tod == Constants.MEALTIME_BRUNCH: - result.timex = Constants.MEALTIME_BRUNCH - result.begin_hour = 8 - result.end_hour = 12 - elif tod == Constants.MEALTIME_LUNCH: - result.timex = Constants.MEALTIME_LUNCH - result.begin_hour = 11 - result.end_hour = 13 - elif tod == Constants.MEALTIME_DINNER: - result.timex = Constants.MEALTIME_DINNER - result.begin_hour = 16 - result.end_hour = 20 - - return result - - @staticmethod - def set_timex_with_context(timex: str, context: DateContext) -> str: - result = timex.replace(Constants.TIMEX_FUZZY_YEAR, str(context.year)) - return result - - @staticmethod - def generate_date_period_timex_unit_count(begin, end, timex_type, equal_duration_length=True): - unit_count = 'XX' - - if equal_duration_length: - if timex_type == 0: - unit_count = (end - begin).days - - if timex_type == 1: - unit_count = (end - begin).days/7 - if timex_type == 2: - unit_count = ((end.year - begin.year) * 12) + (end.month - begin.month) - if timex_type == 3: - unit_count = (end.year - begin.year) + ((end.mont - begin.month) / 12.0) - return unit_count - - @staticmethod - def generate_date_period_timex_str(begin, end, timex_type, timex1, timex2): - boundary_valid = DateUtils.is_valid_datetime(begin) and DateUtils.is_valid_datetime(end) - unit_count = TimexUtil.generate_date_period_timex_unit_count(begin, end, timex_type) if boundary_valid else "X" - return f"({timex1},{timex2},P{unit_count}{date_period_timex_type_to_suffix[timex_type]})" - - @staticmethod - def generate_date_period_timex(begin, end, timex_type, alternative_begin=datetime.now(), alternative_end=datetime.now()): - equal_duration_length = (end - begin).days == (alternative_end - alternative_begin).days or datetime.now() == alternative_end == alternative_begin - unit_count = TimexUtil.generate_date_period_timex_unit_count(begin, end, timex_type, equal_duration_length) - date_period_timex = f'P{unit_count}{date_period_timex_type_to_suffix[timex_type]}' - - return f'({DateTimeFormatUtil.luis_date(begin.year, begin.month, begin.day)},' \ - f'{DateTimeFormatUtil.luis_date(end.year, end.month, end.day)},{date_period_timex})' - - @staticmethod - def _process_double_timex(resolution_dic: Dict[str, object], future_key: str, past_key: str, origin_timex: str): - timexes = origin_timex.split(Constants.COMPOSTIE_TIMEX_DELIMITER) - if not future_key in resolution_dic or not past_key in resolution_dic or len(timexes) != 2: - return - future_resolution = resolution_dic[future_key] - past_resolution = resolution_dic[past_key] - future_resolution[Constants.TIMEX_KEY] = timexes[0] - past_resolution[Constants.TIMEX_KEY] = timexes[1] - - @staticmethod - def _has_double_timex(comment: str): - return comment == Constants.COMMENT_DOUBLETIMEX - - @staticmethod - def is_range_timex(timex: str) -> bool: - return timex and timex.startswith("(") - - @staticmethod - def get_range_timex_components(range_timex: str) -> RangeTimexComponents: - range_timex = range_timex.replace('(', '').replace(')', '') - components = range_timex.split(',') - result = RangeTimexComponents() - if len(components) == 3: - result.begin_timex = components[0] - result.end_timex = components[1] - result.duration_timex = components[2] - result.is_valid = True - - return result - - @staticmethod - def combine_date_and_time_timex(date_timex: str, time_timex: str): - return f'{date_timex}{time_timex}' - - @staticmethod - def generate_date_time_period_timex(begin_timex: str, end_timex: str, duration_timex: str): - return f'({begin_timex},{end_timex},{duration_timex})' - - -class TimeZoneResolutionResult: - def __init__(self): - self.value: str = '' - self.utc_offset_mins: int = 0 - self.time_zone_text: str = '' - - -def parse_chinese_dynasty_year(year_str: str, dynasty_year_regex: Pattern, dynasty_start_year: str, dynasty_year_map: dict, integer_extractor, number_parser): - dynasty_year_match = regex.search(dynasty_year_regex, year_str) - if dynasty_year_match and dynasty_year_match.start() == 0 and len(dynasty_year_match.group()) == len(year_str): - # handle "康熙元年" refer to https://zh.wikipedia.org/wiki/%E5%B9%B4%E5%8F%B7 - dynasty_str = RegExpUtility.get_group(dynasty_year_match, "dynasty") - bias_year_str = RegExpUtility.get_group(dynasty_year_match, "biasYear") - basic_year = dynasty_year_map[dynasty_str] - if bias_year_str == dynasty_start_year: - bias_year = 1 - else: - er = next(iter(integer_extractor.extract(bias_year_str)), None) - bias_year = int(number_parser.parse(er).value) - year = int(basic_year + bias_year - 1) - return year - return None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/__init__.py new file mode 100644 index 0000000000..ac554f20b3 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/__init__.py @@ -0,0 +1,24 @@ +from .token_utils import * +from .datetime_utility_config import * +from .matching_util import * +from .datetime_resolution_result import * +from .datetime_format_utils import * +from .ago_later_util import * +from .time_of_day_resolution import * +from .date_utils import * +from .range_timex_components import * +from .datetime_resolution_key import * +from .timex_utility import * +from .date_context import * +from .datetime_options import * +from .datetime_utility_config import * +from .duration_parsing_util import * +from .holiday_functions import * +from .resolution_start_end import * +from .extract_results_extension import * +from .datetime_extra import * +from .time_result import * +from .time_functions import * +from .time_period_functions import * +from .merged_parser_util import * +from .mod_and_date_result import * diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/ago_later_util.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/ago_later_util.py new file mode 100644 index 0000000000..c3d8044e60 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/ago_later_util.py @@ -0,0 +1,257 @@ +from datetime import datetime, timedelta +from enum import Enum +from typing import Dict, List, Pattern + +import regex +from datedelta import datedelta + +from recognizers_date_time.date_time.constants import Constants, TimeTypeConstants +from recognizers_date_time.date_time.extractors import DateTimeExtractor +from recognizers_date_time.date_time.parsers import DateTimeParser, DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeFormatUtil, + DateTimeResolutionResult, + DateTimeUtilityConfiguration, + MatchingUtil, + Token, +) +from recognizers_text.extractor import ExtractResult +from recognizers_text.utilities import RegExpUtility + + +class AgoLaterMode(Enum): + DATE = 0 + DATETIME = 1 + + +class AgoLaterUtil: + @staticmethod + def extractor_duration_with_before_and_after( + source: str, extract_result: ExtractResult, ret: List[Token], config: DateTimeUtilityConfiguration + ) -> List[Token]: + pos = extract_result.start + extract_result.length + index = 0 + if pos <= len(source): + after_string = source[pos:] + before_string = source[0 : extract_result.start] + is_time_duration = config.time_unit_regex.search(extract_result.text) + ago_later_regexes = [config.ago_regex, config.later_regex] + is_match = False + + for regexp in ago_later_regexes: + token_after = token_before = None + is_day_match = False + # Check after_string + if MatchingUtil.get_ago_later_index(after_string, regexp, True).matched: + # We don't support cases like "5 minutes from today" for now + # Cases like "5 minutes ago" or "5 minutes from now" are supported + # Cases like "2 days before today" or "2 weeks from today" are also supported + + is_day_match = RegExpUtility.get_group(regexp.match(after_string), Constants.DAY_GROUP_NAME) + + index = MatchingUtil.get_ago_later_index(after_string, regexp, True).index + + if not (is_time_duration and is_day_match): + token_after = Token(extract_result.start, extract_result.start + extract_result.length + index) + is_match = True + + if config.check_both_before_after: + before_after_str = before_string + after_string + is_range_match = RegExpUtility.match_begin(config.range_prefix_regex, after_string[:index], True) + index_start = MatchingUtil.get_ago_later_index(before_after_str, regexp, False) + if not is_range_match and index_start.matched: + is_day_match = regexp.match(before_after_str) + + if is_day_match and not (is_time_duration and is_day_match): + ret.append( + Token(index_start.index, (extract_result.start + extract_result.length or 0) + index) + ) + is_match = True + index = MatchingUtil.get_ago_later_index(before_string, regexp, False).index + if MatchingUtil.get_ago_later_index(before_string, regexp, False).matched: + is_day_match = RegExpUtility.get_group(regexp.match(before_string), 'day') + + if not (is_day_match and is_time_duration): + token_before = Token(index, extract_result.start + extract_result.length or 0) + is_match = True + + if ( + token_after is not None + and token_before is not None + and token_before.start + token_before.length > token_after.start + ): + ret.append(Token(token_before.start, token_after.start + token_after.length - token_before.start)) + elif token_after is not None: + ret.append(token_after) + elif token_before is not None: + ret.append(token_before) + if is_match: + break + + if not is_match: + in_within_regex_tuples = [ + (config.in_connector_regex, [config.range_unit_regex]), + (config.within_next_prefix_regex, [config.date_unit_regex, config.time_unit_regex]), + ] + + for regexp in in_within_regex_tuples: + is_match_after = False + index = MatchingUtil.get_term_index(before_string, regexp[0]).index + if index > 0: + is_match = True + elif ( + config.check_both_before_after + and MatchingUtil.get_ago_later_index(after_string, regexp[0], True).matched + ): + is_match = is_match_after = True + + if is_match: + is_unit_match = False + for unit_regex in regexp[1]: + is_unit_match = is_unit_match or unit_regex.match(extract_result.text) + + if not is_unit_match: + if ( + extract_result.start is not None + and extract_result.length is not None + and extract_result.start >= index + or is_match_after + ): + start = extract_result.start - (index if not is_match_after else 0) + end = extract_result.start + extract_result.length + (index if is_match_after else 0) + ret.append(Token(start, end)) + break + return ret + + @staticmethod + def parse_duration_with_ago_and_later( + source: str, + reference: datetime, + duration_extractor: DateTimeExtractor, + duration_parser: DateTimeParser, + unit_map: Dict[str, str], + unit_regex: Pattern, + utility_configuration: DateTimeUtilityConfiguration, + ) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + + if duration_extractor: + duration_extract = duration_extractor.extract(source, reference) + else: + return result + + if not duration_extract: + return result + + duration = next(iter(duration_extract)) + pr = duration_parser.parse(duration, reference) + + if not pr: + return result + + match = regex.search(unit_regex, source) + if not match: + return result + + after_str = source[duration.start + duration.length :] + before_str = source[0 : duration.start] + src_unit = match.group(Constants.UNIT) + duration_result: DateTimeResolutionResult = pr.value + num_str = ( + duration_result.timex[0 : len(duration_result.timex) - 1] + .replace(Constants.UNIT_P, '') + .replace(Constants.UNIT_T, '') + ) + num = int(num_str) + + mode = AgoLaterMode.DATE + if pr.timex_str.__contains__("T"): + mode = AgoLaterMode.DATETIME + + if pr.value: + return AgoLaterUtil.get_ago_later_result( + pr, num, unit_map, src_unit, after_str, before_str, reference, utility_configuration, mode + ) + + return result + + @staticmethod + def __matched_string(regexp, string): + is_match = True + match = regexp.match(string) + day_str = match.group('day') + + return is_match, match, day_str + + @staticmethod + def get_ago_later_result( + duration_parse_result: DateTimeParseResult, + num: int, + unit_map: Dict[str, str], + src_unit: str, + after_str: str, + before_str: str, + reference: datetime, + utility_configuration: DateTimeUtilityConfiguration, + mode: AgoLaterMode, + ): + + result = DateTimeResolutionResult() + unit_str = unit_map.get(src_unit) + + if not unit_str: + return result + + contains_ago = MatchingUtil.contains_ago_later_index(after_str, utility_configuration.ago_regex, True) + contains_later_or_in = MatchingUtil.contains_ago_later_index( + after_str, utility_configuration.later_regex, False + ) or MatchingUtil.contains_term_index(before_str, utility_configuration.in_connector_regex) + + if contains_ago: + result = AgoLaterUtil.get_date_result(unit_str, num, reference, False, mode) + duration_parse_result.value.mod = TimeTypeConstants.BEFORE_MOD + result.sub_date_time_entities = [duration_parse_result] + return result + + if contains_later_or_in: + result = AgoLaterUtil.get_date_result(unit_str, num, reference, True, mode) + duration_parse_result.value.mod = TimeTypeConstants.AFTER_MOD + result.sub_date_time_entities = [duration_parse_result] + return result + + return result + + @staticmethod + def get_date_result( + unit_str: str, num: int, reference: datetime, is_future: bool, mode: AgoLaterMode + ) -> DateTimeResolutionResult: + value = reference + result = DateTimeResolutionResult() + swift = 1 if is_future else -1 + + if unit_str == Constants.UNIT_D: + value += timedelta(days=num * swift) + elif unit_str == Constants.UNIT_W: + value += timedelta(days=num * swift * 7) + elif unit_str == Constants.UNIT_MON: + value += datedelta(months=num * swift) + elif unit_str == Constants.UNIT_Y: + value += datedelta(years=num * swift) + elif unit_str == Constants.UNIT_H: + value += timedelta(hours=num * swift) + elif unit_str == Constants.UNIT_M: + value += timedelta(minutes=num * swift) + elif unit_str == Constants.UNIT_S: + value += timedelta(seconds=num * swift) + else: + return result + + result.timex = ( + DateTimeFormatUtil.luis_date_from_datetime(value) + if mode == AgoLaterMode.DATE + else DateTimeFormatUtil.luis_date_time(value) + ) + result.future_value = value + result.past_value = value + result.success = True + return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/date_context.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/date_context.py new file mode 100644 index 0000000000..576115db70 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/date_context.py @@ -0,0 +1,79 @@ +from datetime import datetime + +from datedelta import datedelta + +from recognizers_date_time.date_time.constants import Constants, TimeTypeConstants +from recognizers_date_time.date_time.parsers import DateTimeParseResult +from recognizers_date_time.date_time.utilities import DateTimeResolutionResult, DateUtils, TimexUtil + + +class DateContext: + year: int = Constants.INVALID_YEAR + + # This method is to ensure the begin date is less than the end date. As DateContext only supports common Year as + # context, so it subtracts one year from beginDate. + # @TODO problematic in other usages. + @staticmethod + def swift_date_object(begin_date: datetime, end_date: datetime) -> datetime: + if begin_date > end_date: + begin_date = begin_date - datedelta(years=1) + return begin_date + + def process_date_entity_parsing_result(self, original_result: DateTimeParseResult) -> DateTimeParseResult: + if not self.is_empty(): + original_result.timex_str = TimexUtil.set_timex_with_context(original_result.timex_str, self) + original_result.value = self.process_date_entity_resolution(original_result.value) + + return original_result + + def process_date_entity_resolution(self, resolution_result: DateTimeResolutionResult) -> DateTimeResolutionResult: + if not self.is_empty(): + resolution_result.timex = TimexUtil.set_timex_with_context(resolution_result.timex, self) + resolution_result.future_value = self.__set_date_with_context(resolution_result.future_value) + resolution_result.past_value = self.__set_date_with_context(resolution_result.past_value) + return resolution_result + + def process_date_period_entity_resolution( + self, resolution_result: DateTimeResolutionResult + ) -> DateTimeResolutionResult: + if not self.is_empty(): + resolution_result.timex = TimexUtil.set_timex_with_context(resolution_result.timex, self) + resolution_result.future_value = self.__set_date_range_with_context(resolution_result.future_value) + resolution_result.past_value = self.__set_date_range_with_context(resolution_result.past_value) + return resolution_result + + def is_empty(self) -> bool: + return self.year == Constants.INVALID_YEAR + + def __set_date_with_context(self, original_date, year=-1) -> datetime: + if not DateUtils.is_valid_datetime(original_date): + return original_date + value = DateUtils.safe_create_from_min_value( + year=self.year if year == -1 else year, month=original_date.month, day=original_date.day + ) + return value + + def __set_date_range_with_context(self, original_date_range): + start_date = self.__set_date_with_context(original_date_range[0]) + end_date = self.__set_date_with_context(original_date_range[1]) + result = {TimeTypeConstants.START_DATE: start_date, TimeTypeConstants.END_DATE: end_date} + + return result + + # This method is to ensure the year of begin date is same with the end date in no year situation. + def sync_year(self, pr1, pr2): + if self.is_empty(): + if DateUtils.is_Feb_29th_datetime(pr1.value.future_value): + future_year = pr1.value.future_value.year + past_year = pr1.value.past_value.year + pr2.value = self.sync_year_resolution(pr2.value, future_year, past_year) + elif DateUtils.is_Feb_29th_datetime(pr2.value.future_value): + future_year = pr2.value.future_value.year + past_year = pr2.value.past_value.year + pr1.value = self.sync_year_resolution(pr1.value, future_year, past_year) + return pr1, pr2 + + def sync_year_resolution(self, resolution_result, future_year, past_year): + resolution_result.future_value = self.__set_date_with_context(resolution_result.future_value, future_year) + resolution_result.past_value = self.__set_date_with_context(resolution_result.past_value, past_year) + return resolution_result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/date_utils.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/date_utils.py new file mode 100644 index 0000000000..ea0f520f83 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/date_utils.py @@ -0,0 +1,210 @@ +import calendar +from datetime import datetime, timedelta +from enum import IntEnum + +from datedelta import datedelta + +from recognizers_date_time.date_time.constants import Constants + + +class DayOfWeek(IntEnum): + MONDAY = 1 + TUESDAY = 2 + WEDNESDAY = 3 + THURSDAY = 4 + FRIDAY = 5 + SATURDAY = 6 + SUNDAY = 7 + + +class DateUtils: + min_value = datetime(1, 1, 1, 0, 0, 0, 0) + + # Generate future/past date for cases without specific year like "Feb 29th" + @staticmethod + def generate_dates(no_year: bool, reference: datetime, year: int, month: int, day: int) -> list: + future_date = DateUtils.safe_create_from_min_value(year, month, day) + past_date = DateUtils.safe_create_from_min_value(year, month, day) + future_year = year + past_year = year + if no_year: + if DateUtils.is_Feb_29th(year, month, day): + if DateUtils.is_leap_year(year): + if future_date < reference: + future_date = DateUtils.safe_create_from_min_value(future_year + 4, month, day) + else: + past_date = DateUtils.safe_create_from_min_value(past_year - 4, month, day) + else: + past_year = past_year >> 2 << 2 + if not DateUtils.is_leap_year(past_year): + past_year -= 4 + + future_year = past_year + 4 + if not DateUtils.is_leap_year(future_year): + future_year += 4 + + future_date = DateUtils.safe_create_from_min_value(future_year, month, day) + past_date = DateUtils.safe_create_from_min_value(past_year, month, day) + else: + if future_date < reference and DateUtils.is_valid_date(year, month, day): + future_date = DateUtils.safe_create_from_min_value(year + 1, month, day) + + if past_date >= reference and DateUtils.is_valid_date(year, month, day): + past_date = DateUtils.safe_create_from_min_value(year - 1, month, day) + return [future_date, past_date] + + @staticmethod + def int_try_parse(value): + try: + return int(value), True + except ValueError: + return value, False + + @staticmethod + def safe_create_from_value( + seed: datetime, year: int, month: int, day: int, hour: int = 0, minute: int = 0, second: int = 0 + ) -> datetime: + if DateUtils.is_valid_date(year, month, day) and DateUtils.is_valid_time(hour, minute, second): + return datetime(year, month, day, hour, minute, second) + + return seed + + @staticmethod + def safe_create_from_min_value( + year: int, month: int, day: int, hour: int = 0, minute: int = 0, second: int = 0 + ) -> datetime: + return DateUtils.safe_create_from_value(DateUtils.min_value, year, month, day, hour, minute, second) + + @staticmethod + def safe_create_from_min_value_date_time(date: datetime, time: datetime = None) -> datetime: + return DateUtils.safe_create_from_value( + DateUtils.min_value, + date.year, + date.month, + date.day, + time.hour if time else 0, + time.minute if time else 0, + time.second if time else 0, + ) + + @staticmethod + def is_valid_date(year: int, month: int, day: int) -> bool: + try: + datetime(year, month, day) + return True + except ValueError: + return False + + @staticmethod + def is_valid_datetime(date: datetime) -> bool: + return date != DateUtils.min_value + + @staticmethod + def is_valid_time(hour: int, minute: int, second: int) -> bool: + return 0 <= hour < 24 and 0 <= minute < 60 and second >= 0 and minute < 60 + + @staticmethod + def this(from_date: datetime, day_of_week: DayOfWeek) -> datetime: + start = from_date.isoweekday() + target = day_of_week if day_of_week >= int(DayOfWeek.MONDAY) else int(DayOfWeek.SUNDAY) + result = from_date + timedelta(days=target - start) + return result + + @staticmethod + def next(from_date: datetime, day_of_week: DayOfWeek) -> datetime: + return DateUtils.this(from_date, day_of_week) + timedelta(weeks=1) + + @staticmethod + def last(from_date: datetime, day_of_week: DayOfWeek) -> datetime: + return DateUtils.this(from_date, day_of_week) - timedelta(weeks=1) + + @staticmethod + def safe_create_date_resolve_overflow(year: int, month: int, day: int) -> datetime: + if month > 12: + year = year + month // 12 + month = month % 12 + return DateUtils.safe_create_from_min_value(year, month, day) + + @staticmethod + def total_hours(from_date: datetime, to_date: datetime) -> int: + return round((to_date - from_date).total_seconds() / 3600) + + @staticmethod + def day_of_year(seed: datetime) -> int: + return seed.timetuple().tm_yday + + @staticmethod + def last_day_of_month(year: int, month: int) -> int: + return calendar.monthrange(year, month)[1] + + @staticmethod + def week_of_year(date: datetime) -> int: + return date.isocalendar()[1] + + @staticmethod + def is_leap_year(year) -> bool: + return (year % 4 == 0) and (year % 100 != 0) or (year % 400 == 0) + + @staticmethod + def is_Feb_29th(year, month, day): + return month == 2 and day == 29 + + @staticmethod + def is_Feb_29th_datetime(date: datetime): + return date.month == 2 and date.day == 29 + + @staticmethod + def get_last_day(year: int, month: int) -> datetime: + month += 1 + + if month == 13: + year += 1 + month = 1 + first_day_of_next_month = DateUtils.safe_create_from_min_value(year, month, 1) + + return first_day_of_next_month - datedelta(days=1) + + @staticmethod + def day_of_week(day): + dayOfWeek = { + 'sunday': 0, + 'monday': 1, + 'tuesday': 2, + 'wednesday': 3, + 'thursday': 4, + 'friday': 5, + 'saturday': 6, + } + return dayOfWeek.get(day) + + @staticmethod + def get_first_thursday(year: int, month: int = Constants.INVALID_MONTH) -> datetime: + target_month = month + + if month == Constants.INVALID_MONTH: + target_month = 1 + + first_day = DateUtils.safe_create_from_min_value(year, target_month, 1) + first_thursday = DateUtils.this(first_day, DayOfWeek.THURSDAY) + + # Thursday falls into previous year or previous month + if first_thursday.month != target_month: + first_thursday = first_day + datedelta(days=Constants.WEEK_DAY_COUNT) + + return first_thursday + + @staticmethod + def get_last_thursday(year: int, month: int = Constants.INVALID_MONTH) -> datetime: + target_month = month + + if month == Constants.INVALID_MONTH: + target_month = 12 + + last_day = DateUtils.get_last_day(year, target_month) + last_thursday = DateUtils.this(last_day, DayOfWeek.THURSDAY) + + # Thursday falls into next year or next month + if last_thursday.month != target_month: + last_thursday = last_thursday - datedelta(days=Constants.WEEK_DAY_COUNT) + + return last_thursday diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_extra.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_extra.py new file mode 100644 index 0000000000..3ddb3cf3a8 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_extra.py @@ -0,0 +1,8 @@ +from typing import Dict, List, Match + + +class DateTimeExtra: + def __init__(self): + self.data_type: any = None + self.named_entity: Dict[str, List[str]] = dict() + self.match: Match = None diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_format_utils.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_format_utils.py new file mode 100644 index 0000000000..63904118aa --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_format_utils.py @@ -0,0 +1,187 @@ +from datetime import datetime +from typing import List, Pattern, Union + +import regex + +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.utilities import DateTimeResolutionResult +from recognizers_text.utilities import RegExpUtility + + +class DateTimeFormatUtil: + HourTimeRegex = RegExpUtility.get_safe_reg_exp(r'(? str: + format_ = f'{{0:0{size}d}}' + return str.format(format_, num) + + @staticmethod + def luis_date(year: int, month: int, day: int) -> str: + if year == -1: + if month == -1: + return f'XXXX-XX-{day:02d}' + return f'XXXX-{month:02d}-{day:02d}' + return f'{year:04d}-{month:02d}-{day:02d}' + + @staticmethod + def luis_date_from_datetime(date: datetime) -> str: + return DateTimeFormatUtil.luis_date(date.year, date.month, date.day) + + @staticmethod + def luis_date_from_datetime_with_alternative(date: datetime, alternative_date: datetime = None) -> str: + year = date.year + month = date.month + day = date.day + + if alternative_date: + if alternative_date.year != year: + year = -1 + if alternative_date.month != month: + month = -1 + if alternative_date.day != day: + day = -1 + + return DateTimeFormatUtil.luis_date(year, month, day) + + @staticmethod + def luis_time(hour: int, minute: int, second: int = Constants.INVALID_SECOND) -> str: + if second == Constants.INVALID_SECOND: + return f'{hour:02d}:{minute:02d}' + else: + return f'{hour:02d}:{minute:02d}:{second:02d}' + + @staticmethod + def luis_time_from_datetime(time: datetime) -> str: + return DateTimeFormatUtil.luis_time(time.hour, time.minute, time.second) + + @staticmethod + def luis_date_time(time: datetime) -> str: + return DateTimeFormatUtil.luis_date_from_datetime(time) + 'T' + DateTimeFormatUtil.luis_time_from_datetime(time) + + @staticmethod + def luis_date_short_time(time: datetime, timex: str = None) -> str: + has_min = False if timex is None else Constants.TIME_TIMEX_CONNECTOR in timex + has_sec = False if timex is None else len(timex.split(Constants.TIME_TIMEX_CONNECTOR)) > 2 + + return DateTimeFormatUtil.luis_date_from_datetime(time) + DateTimeFormatUtil.format_short_time( + time, has_min, has_sec + ) + + @staticmethod + def format_short_time(time: datetime, has_min: bool = False, has_sec: bool = False) -> str: + hour = time.hour + min = time.minute if has_min or time.minute > 0 else Constants.INVALID_MINUTE + sec = time.second if has_sec or time.second > 0 else Constants.INVALID_SECOND + return DateTimeFormatUtil.short_time(hour, min, sec) + + @staticmethod + def short_time(hour: int, minute: int = Constants.INVALID_MINUTE, second: int = Constants.INVALID_SECOND) -> str: + if minute == Constants.INVALID_MINUTE and second == Constants.INVALID_SECOND: + return f'{Constants.TIME_TIMEX_PREFIX}{hour:02d}' + else: + return f'{Constants.TIME_TIMEX_PREFIX}{DateTimeFormatUtil.luis_time(hour, minute, second)}' + + @staticmethod + def luis_time_span(begin_time: datetime, end_time: datetime) -> str: + timex_builder = f'{Constants.GENERAL_PERIOD_PREFIX}{Constants.TIME_TIMEX_PREFIX}' + span = end_time - begin_time + total_days = span.days + total_seconds = span.seconds + total_hours, total_seconds = divmod(total_seconds, Constants.HOUR_SECOND_COUNT) + total_minutes, total_seconds = divmod(total_seconds, Constants.MINUTE_SECOND_COUNT) + + if total_days > 0 or total_hours > 0: + timex_builder += f'{total_days * Constants.DAY_HOUR_COUNT + total_hours}H' + if total_minutes > 0: + timex_builder += f'{total_minutes}M' + if total_seconds > 0: + timex_builder += f'{total_seconds}S' + + return str(timex_builder) + + @staticmethod + def format_date(date: datetime) -> str: + return f'{date.year:04d}-{date.month:02d}-{date.day:02d}' + + @staticmethod + def format_time(time: datetime) -> str: + return f'{time.hour:02d}:{time.minute:02d}:{time.second:02d}' + + @staticmethod + def format_date_time(date_time: datetime) -> str: + return DateTimeFormatUtil.format_date(date_time) + ' ' + DateTimeFormatUtil.format_time(date_time) + + @staticmethod + def all_str_to_pm(source: str) -> str: + matches = list(regex.finditer(DateTimeFormatUtil.HourTimeRegex, source)) + split: List[str] = list() + last_position = 0 + + for match in matches: + if last_position != match.start(): + split.append(source[last_position : match.start()]) + + split.append(source[match.start() : match.end()]) + last_position = match.end() + + if source[:last_position]: + split.append(source[last_position:]) + + for index, value in enumerate(split): + if regex.search(DateTimeFormatUtil.HourTimeRegex, value): + split[index] = DateTimeFormatUtil.to_pm(value) + + return ''.join(split) + + @staticmethod + def to_pm(source: str) -> str: + result = '' + + if source.startswith(Constants.UNIT_T): + result = Constants.UNIT_T + source = source[1:] + + split = source.split(':') + hour = int(split[0]) + hour = 0 if hour == 12 else hour + 12 + split[0] = f'{hour:02d}' + return result + ':'.join(split) + + @staticmethod + def parse_dynasty_year( + year_str: str, + dynasty_year_regex: Pattern, + dynasty_start_year: str, + dynasty_year_map: dict, + integer_extractor, + number_parser, + ): + dynasty_year_match = regex.search(dynasty_year_regex, year_str) + if dynasty_year_match and dynasty_year_match.start() == 0 and len(dynasty_year_match.group()) == len(year_str): + # handle "康熙元年" refer to https://zh.wikipedia.org/wiki/%E5%B9%B4%E5%8F%B7 + dynasty_str = RegExpUtility.get_group(dynasty_year_match, "dynasty") + bias_year_str = RegExpUtility.get_group(dynasty_year_match, "biasYear") + basic_year = dynasty_year_map[dynasty_str] + if bias_year_str == dynasty_start_year: + bias_year = 1 + else: + er = next(iter(integer_extractor.extract(bias_year_str)), None) + bias_year = int(number_parser.parse(er).value) + year = int(basic_year + bias_year - 1) + return year + return None + + @staticmethod + def resolve_end_of_day(timex_prefix: str, future_date: datetime, past_date: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + result.timex = timex_prefix + "T23:59:59" + result.future_value = future_date + result.past_value = past_date + + return result + + @staticmethod + def to_iso_week_timex(date: datetime) -> str: + year, week_num = date.isocalendar()[:2] + return f"{year}-W{week_num:02}" diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_options.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_options.py new file mode 100644 index 0000000000..21dbed3593 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_options.py @@ -0,0 +1,26 @@ +from enum import IntFlag + + +class DateTimeOptions(IntFlag): + NONE = 0 + SKIP_FROM_TO_MERGE = 1 + SPLIT_DATE_AND_TIME = 2 + CALENDAR = 4 + EXTENDED_TYPES = 8 + FAIL_FAST = 2097152 + EXPERIMENTAL_MODE = 4194304 + ENABLE_PREVIEW = 8388608 + + +class DateTimeOptionsConfiguration: + @property + def options(self): + return self._options + + @property + def dmy_date_format(self) -> bool: + return self._dmy_date_format + + def __init__(self, options=DateTimeOptions.NONE, dmy_date_format=False): + self._options = options + self._dmy_date_format = dmy_date_format diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_resolution_key.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_resolution_key.py new file mode 100644 index 0000000000..863d761f87 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_resolution_key.py @@ -0,0 +1,9 @@ +class DateTimeResolutionKey: + timex: str = "timex" + mod: str = 'Mod' + is_lunar: str = 'isLunar' + value: str = 'value' + start: str = 'start' + end: str = 'end' + list: str = 'list' + source_entity: str = 'sourceEntity' diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_resolution_result.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_resolution_result.py new file mode 100644 index 0000000000..b0f3b55eca --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_resolution_result.py @@ -0,0 +1,17 @@ +from typing import Dict, List + + +class DateTimeResolutionResult: + def __init__(self): + self.success: bool = False + self.timex: str = '' + self.is_lunar: bool = False + self.mod: str = '' + self.has_range_changing_mod: bool = False + self.comment: str = '' + self.future_resolution: Dict[str, str] = dict() + self.past_resolution: Dict[str, str] = dict() + self.future_value: object = None + self.past_value: object = None + self.sub_date_time_entities: List[object] = list() + self.list: List[object] = list() diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_utility_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_utility_config.py new file mode 100644 index 0000000000..edeb942594 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/datetime_utility_config.py @@ -0,0 +1,23 @@ +from typing import Pattern + +from recognizers_date_time.resources import BaseDateTimeResource +from recognizers_text.utilities import RegExpUtility + + +class DateTimeUtilityConfiguration: + + def __init__(self, resource: BaseDateTimeResource): + self.later_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.LaterRegex) + self.ago_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.AgoRegex) + self.in_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.InConnectorRegex) + self.since_year_suffix_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.SinceYearSuffixRegex) + self.within_next_prefix_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.WithinNextPrefixRegex) + self.am_desc_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.AmDescRegex) + self.pm_desc__regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.PmDescRegex) + self.am_pm_desc_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.AmPmDescRegex) + self.range_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.RangeUnitRegex) + self.time_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.TimeUnitRegex) + self.date_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.DateUnitRegex) + self.common_date_prefix_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.CommonDatePrefixRegex) + self.range_prefix_regex: Pattern = RegExpUtility.get_safe_reg_exp(resource.RangePrefixRegex) + self.check_both_before_after: bool = resource.CheckBothBeforeAfter diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/duration_parsing_util.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/duration_parsing_util.py new file mode 100644 index 0000000000..a41806cd6f --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/duration_parsing_util.py @@ -0,0 +1,174 @@ +from datetime import datetime, timedelta +from typing import Dict, List, Pattern + +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.utilities import DateTimeResolutionResult, RegExpUtility, TimexUtil + + +class DurationParsingUtil: + + @staticmethod + def is_time_duration_unit(uni_str: str): + + if uni_str == Constants.UNIT_H: + result = True + elif uni_str == Constants.UNIT_M: + result = True + elif uni_str == Constants.UNIT_S: + result = True + else: + result = False + + return result + + @staticmethod + def shift_date_time(timex: str, reference: datetime, future: bool) -> datetime: + + timex_unit_map = DurationParsingUtil.resolve_duration_timex(timex) + result = DurationParsingUtil.get_shift_result(timex_unit_map, reference, future) + + return result + + @staticmethod + def resolve_duration_timex(timex_str: str) -> Dict[str, float]: + result = {} + + # Resolve duration timex, such as P21DT2H (21 days 2 hours) + duration_str = timex_str.replace(Constants.GENERAL_PERIOD_PREFIX, "") + number_start = 0 + is_time = False + + # Resolve business days + if duration_str.endswith(Constants.TIMEX_BUSINESS_DAY): + try: + num_val = float(duration_str[0:-2]) + result[Constants.TIMEX_BUSINESS_DAY] = num_val + return result + except ValueError: + pass + + for idx, char in enumerate(duration_str): + if char.isalpha(): + if char == Constants.TIME_TIMEX_PREFIX: + is_time = True + else: + num_str = duration_str[number_start:idx] + try: + number = float(num_str) + src_timex_unit = duration_str[idx : idx + 1] + if not is_time and src_timex_unit == Constants.TIMEX_MONTH: + src_timex_unit = Constants.TIMEX_MONTH_FULL + result[src_timex_unit] = number + except ValueError: + return {} + number_start = idx + 1 + return result + + @staticmethod + def get_shift_result(timex_unit_map: Dict[str, float], reference: datetime, future: bool) -> datetime: + result = reference + future_or_past = 1 if future else -1 + + # timexUnitMap needs to be an ordered collection because the result depends on the order of the shifts. + # For example "1 month 21 days later" produces different results depending on whether the day or month shift is applied first + # (when the reference month and the following month have different numbers of days). + for unit_str, number in timex_unit_map.items(): + if unit_str == "H": + result += timedelta(hours=number * future_or_past) + elif unit_str == "M": + result += timedelta(minutes=number * future_or_past) + elif unit_str == "S": + result += timedelta(seconds=number * future_or_past) + elif unit_str == "H": + result += timedelta(hours=number * future_or_past) + elif unit_str == Constants.TIMEX_DAY: + result += timedelta(days=number * future_or_past) + elif unit_str == Constants.TIMEX_WEEK: + result += timedelta(days=7 * number * future_or_past) + elif unit_str == Constants.TIMEX_MONTH_FULL: + result.replace(month=int(number * future_or_past)) + elif unit_str == Constants.TIMEX_YEAR: + result.replace(year=int(number * future_or_past)) + elif unit_str == Constants.TIMEX_BUSINESS_DAY: + result = DurationParsingUtil.get_nth_business_day(result, int(number), future) + return result + + @staticmethod + def get_nth_business_day(start_date: datetime, n: int, is_future: bool) -> List[datetime]: + date_list = [] + date = start_date + for i in range(n): + date = DurationParsingUtil.get_next_business_day(date, is_future) + date_list.append(date) + + if not is_future: + date_list.reverse() + return date_list + + @staticmethod + def get_next_business_day(start_date: datetime, is_future: bool) -> datetime: + date_increment = 1 if is_future else -1 + date = start_date + timedelta(days=date_increment) + + # if Saturday or Sunday + while date.weekday() == 5 or date.weekday() == 6: + date += timedelta(days=date_increment) + return date + + @staticmethod + def is_date_duration(timex: str) -> bool: + resolved_timex = DurationParsingUtil.resolve_duration_timex(timex) + return len(resolved_timex) > 1 + + @staticmethod + def parse_inexact_number_with_unit( + text: str, + inexact_number_unit_regex: Pattern, + unit_map: Dict[str, str], + unit_value_map: Dict[str, float], + is_cjk: bool = False, + ) -> DateTimeResolutionResult: + ret = DateTimeResolutionResult() + match = RegExpUtility.get_matches(inexact_number_unit_regex, text) + if match: + # set the inexact number "few", "some" to 3 for now + if RegExpUtility.get_group(match, "NumTwoTerm"): + num_val = 2 + else: + num_val = 3 + src_unit = RegExpUtility.get_group(match, "unit") + if src_unit in unit_map: + unit_str = unit_map[src_unit] + + if num_val > 1000 and ( + unit_str == Constants.TIMEX_YEAR + or unit_str == Constants.TIMEX_MONTH_FULL + or unit_str == Constants.TIMEX_WEEK + ): + return ret + + ret.timex = TimexUtil.generate_duration_timex( + num_val, unit_str, DurationParsingUtil.is_less_than_day(unit_str) + ) + + # In CJK implementation unitValueMap uses the unitMap values as keys while + # in standard implementation unitMap and unitValueMap have the same keys. + if is_cjk: + unit_value = unit_value_map[unit_str] + else: + unit_value = unit_value_map[src_unit] + ret.future_value = ret.past_value = num_val * unit_value + ret.success = True + + elif RegExpUtility.get_group(match, Constants.BUSINESS_DAY_GROUP_NAME): + ret.timex = TimexUtil.generate_duration_timex(num_val, Constants.TIMEX_BUSINESS_DAY, False) + + # TODO figure out this line + ret.future_value = ret.past_value = num_val * unit_value_map[src_unit.split()] + ret.success = True + + return ret + + @staticmethod + def is_less_than_day(unit: str) -> bool: + return unit == "S" or unit == "M" or unit == "H" diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/extract_results_extension.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/extract_results_extension.py new file mode 100644 index 0000000000..3f65d67310 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/extract_results_extension.py @@ -0,0 +1,66 @@ +from typing import Dict, List, Pattern + +from regex import regex + +from recognizers_text.extractor import ExtractResult +from recognizers_text.utilities import RegExpUtility + + +class ExtractResultExtension: + @staticmethod + def is_overlap(er1: ExtractResult, er2: ExtractResult) -> bool: + return not (er1.start >= er2.start + er2.length) and not (er2.start >= er1.start + er1.length) + + @staticmethod + def is_cover(er1: ExtractResult, er2: ExtractResult) -> bool: + return (er2.start < er1.start and er2.start + er2.length >= er1.start + er1.length) or ( + er2.start <= er1.start and er2.start + er2.length > er1.start + er1.length + ) + + @staticmethod + def merge_all_tokens(results: List[ExtractResult]) -> List[ExtractResult]: + + results = sorted(filter(None, results), key=lambda x: x.start) + merged_results: List[ExtractResult] = list() + for result in results: + should_add = True + + for index, m_token in enumerate(merged_results): + if not should_add: + break + + # It is included in one of the current results + if result.start >= m_token.start and result.end <= m_token.end: + should_add = False + + # If it contains overlaps + if m_token.start < result.start < m_token.end: + should_add = False + + # It includes one of the results and should replace the included one + if result.start <= m_token.start and result.end >= m_token.end: + should_add = False + merged_results[index] = result + + if should_add: + merged_results.append(result) + + return merged_results + + @staticmethod + def filter_ambiguity( + extract_results: List[ExtractResult], text: str, ambiguity_filters_dict: Dict[Pattern, Pattern] + ) -> List[ExtractResult]: + if ambiguity_filters_dict: + for key, value in ambiguity_filters_dict.items(): + for er in reversed(extract_results): + + if regex.match(key, er.text): + matches = RegExpUtility.get_matches(value, text) + + if any( + text.index(m) < er.start + er.length and text.index(m) + len(m) > er.start for m in matches + ): + extract_results.remove(er) + + return extract_results diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/holiday_functions.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/holiday_functions.py new file mode 100644 index 0000000000..9525fb2cfa --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/holiday_functions.py @@ -0,0 +1,24 @@ +from datetime import datetime, timedelta + +from recognizers_date_time.date_time.utilities import DateUtils + + +class HolidayFunctions: + + @staticmethod + def calculate_holiday_by_easter(year: int, days: int = 0) -> datetime: + + month = 3 + + g = year % 19 + c = year / 100 + + h = (c - int(c / 4) - int(((8 * c) + 13) / 25) + (19 * g) + 15) % 30 + i = h - (int(h / 28) * (1 - (int(h / 28) * int(29 / (h + 1)) * int((21 - g) / 11)))) + day = i - ((year + int(year / 4) + i + 2 - c + int(c / 4)) % 7) + 28 + + if day > 31: + month += 1 + day -= 31 + + return DateUtils.safe_create_from_min_value(year, month, int(day)) + timedelta(days=days) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/matching_util.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/matching_util.py new file mode 100644 index 0000000000..f015256568 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/matching_util.py @@ -0,0 +1,110 @@ +from typing import List, Pattern + +import regex + +from recognizers_date_time.resources.base_date_time import BaseDateTime +from recognizers_text.extractor import ExtractResult +from recognizers_text.matcher.string_matcher import MatchResult +from recognizers_text.utilities import RegExpUtility + + +class MatchedIndex: + def __init__(self, matched: bool, index: int): + self.matched = matched + self.index = index + + +class MatchingUtil: + + invalid_day_number_prefix = RegExpUtility.get_safe_reg_exp(BaseDateTime.InvalidDayNumberPrefix) + + @staticmethod + def is_invalid_day_number_prefix(prefix: str) -> bool: + return MatchingUtil.invalid_day_number_prefix.search(prefix) + + @staticmethod + def pre_process_text_remove_superfluous_words(text: str, matcher: Pattern): + superfluous_word_matches = MatchingUtil.remove_sub_matches(matcher.find(text)) + + bias = 0 + + for match in superfluous_word_matches: + text = text[match.start - bias : match.length] + + bias += match.length + + return text, superfluous_word_matches + + @staticmethod + def post_process_recover_superfluous_words( + extract_results: List[ExtractResult], superfluous_word_matches, origin_text: str + ): + for match in superfluous_word_matches: + for extract_result in extract_results: + + extract_result_end = extract_result.start + extract_result.length + if extract_result.start < match.start <= extract_result_end: + extract_result.length += len(match) + + if match.start <= extract_result.start: + extract_result.start += len(match) + + for extract_result in extract_results: + extract_result.text = origin_text[extract_result.start : extract_result.start + extract_result.length] + + return extract_results + + @staticmethod + def remove_sub_matches(match_results: List[MatchResult]): + match_list = list(match_results) + + match_list = list( + filter( + lambda item: not any( + list( + filter( + lambda ritem: (ritem.start < item.start and ritem.end >= item.end) + or (ritem.start <= item.start and ritem.end > item.end), + match_list, + ) + ) + ), + match_list, + ) + ) + + return match_list + + @staticmethod + def get_ago_later_index(source: str, regexp: Pattern, in_suffix) -> MatchedIndex: + result = MatchedIndex(matched=False, index=-1) + trimmed_source = source.strip().lower() + match = ( + RegExpUtility.match_begin(regexp, trimmed_source, True) + if in_suffix + else RegExpUtility.match_end(regexp, trimmed_source, True) + ) + + if match and match.success: + result.index = source.lower().find(match.group()) + (match.length if in_suffix else 0) + result.matched = True + + return result + + @staticmethod + def contains_ago_later_index(source: str, regexp: Pattern, in_suffix) -> bool: + return MatchingUtil.get_ago_later_index(source, regexp, in_suffix).matched + + @staticmethod + def get_term_index(source: str, regexp: Pattern) -> MatchedIndex: + result = MatchedIndex(matched=False, index=-1) + referenced_match = regex.search(regexp, source.strip().lower().split(' ').pop()) + + if referenced_match: + result = MatchedIndex(matched=True, index=len(source) - source.lower().rfind(referenced_match.group())) + + return result + + @staticmethod + def contains_term_index(source: str, regexp: Pattern) -> bool: + return MatchingUtil.get_term_index(source, regexp).matched diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/merged_parser_util.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/merged_parser_util.py new file mode 100644 index 0000000000..3217f7263c --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/merged_parser_util.py @@ -0,0 +1,423 @@ +import datetime +from typing import Dict, List, Optional + +from recognizers_date_time.date_time import Constants +from recognizers_date_time.date_time.parsers import DateTimeParseResult +from recognizers_date_time.date_time.utilities import ( + DateTimeFormatUtil, + DateTimeOptions, + DateTimeOptionsConfiguration, + DateTimeResolutionKey, + DateTimeResolutionResult, + TimeTypeConstants, + TimexUtil, +) +from recognizers_text import ExtractResult, ResolutionKey + + +class MergedParserUtil: + parser_type_name = "datetimeV2" + + @staticmethod + def is_duration_with_ago_and_later(er: ExtractResult) -> bool: + return er.meta_data and er.meta_data.is_duration_with_ago_and_later + + @staticmethod + def combined_mod(original_mod: str, new_mod: str) -> str: + combined_mod = new_mod + if original_mod and original_mod == new_mod: + combined_mod = f'{new_mod}-{original_mod}' + return combined_mod + + @staticmethod + def set_parse_result(slot: DateTimeParseResult, has_mod: bool, config: DateTimeOptionsConfiguration): + slot.value = MergedParserUtil.date_time_resolution(slot, config) + + # Change the type at last for the after or before modes + slot.type = ( + f"{MergedParserUtil.parser_type_name}." + f"{MergedParserUtil.determine_datetime_type(slot.type, has_mod, config)}" + ) + return slot + + @staticmethod + def date_time_resolution( + slot: DateTimeParseResult, config: DateTimeOptionsConfiguration + ) -> Optional[Dict[str, object]]: + if not slot: + return None + + resolutions: List[Dict[str, str]] = list() + res: Dict[str, object] = dict() + + slot_type = slot.type + timex = slot.timex_str + val: DateTimeResolutionResult = slot.value + + val_success = getattr(val, 'success', None) + + if not val or not val_success: + return None + + is_lunar = val.is_lunar + mod = val.mod + lst = [] + + # Resolve dates list for date periods + if slot.type == Constants.SYS_DATETIME_DATEPERIOD and val.list: + for o in val.list: + lst.append(DateTimeFormatUtil.luis_date_from_datetime(o)) + lst = ",".join(lst) + + # With modifier, output Type might not be the same with type in resolution result + # For example, if the resolution type is "date", with modifier the output type should be "daterange" + type_output = MergedParserUtil.determine_datetime_type(slot_type, True if mod else False, config) + source_entity = MergedParserUtil.determine_source_entity(slot_type, type_output, val.has_range_changing_mod) + comment = val.comment + + # The following should be added to res first, since ResolveAmPm requires these fields. + res[DateTimeResolutionKey.timex] = timex + res[Constants.COMMENT_KEY] = comment + res[DateTimeResolutionKey.mod] = mod + res[ResolutionKey.type] = type_output + res[DateTimeResolutionKey.is_lunar] = is_lunar + + past_resolution_str = slot.value.past_resolution + future_resolution_str = slot.value.future_resolution + + if type_output == Constants.SYS_DATETIME_DATETIMEALT and len(past_resolution_str) > 0: + type_output = MergedParserUtil.determine_resolution_datetime_type(past_resolution_str) + + resolution_past = MergedParserUtil.generate_resolution(slot_type, past_resolution_str, mod) + resolution_future = MergedParserUtil.generate_resolution(slot_type, future_resolution_str, mod) + + # If past and future are same, keep only one + if resolution_future == resolution_past: + if len(resolution_past) > 0: + res[Constants.RESOLVE_KEY] = resolution_past + else: + if len(resolution_past) > 0: + res[Constants.RESOLVE_TO_PAST_KEY] = resolution_past + if len(resolution_future) > 0: + res[Constants.RESOLVE_TO_FUTURE_KEY] = resolution_future + + # If 'ampm', double our resolution accordingly + if comment and comment == Constants.COMMENT_AMPM: + if res[Constants.RESOLVE_KEY]: + res = MergedParserUtil.resolve_ampm(res, Constants.RESOLVE_KEY) + else: + res = MergedParserUtil.resolve_ampm(res, Constants.RESOLVE_TO_PAST_KEY) + res = MergedParserUtil.resolve_ampm(res, Constants.RESOLVE_TO_FUTURE_KEY) + + # If WeekOf and in CalendarMode, modify the past part of our resolution + if (config.options and DateTimeOptions.CALENDAR) != 0 and comment and comment == Constants.COMMENT_WEEK_OF: + res = MergedParserUtil.resolve_week_of(res, Constants.RESOLVE_TO_PAST_KEY) + + if comment and TimexUtil.has_double_timex(comment): + res = TimexUtil.process_double_timex( + res, Constants.RESOLVE_TO_FUTURE_KEY, Constants.RESOLVE_TO_PAST_KEY, timex + ) + + for p in res.values(): + if isinstance(p, dict): + value = {} + value[DateTimeResolutionKey.timex] = timex + value[DateTimeResolutionKey.mod] = mod + value[ResolutionKey.type] = type_output + value[DateTimeResolutionKey.is_lunar] = is_lunar + value[DateTimeResolutionKey.list] = lst + value[DateTimeResolutionKey.source_entity] = source_entity + + value.update(p) + resolutions.append(value) + + if resolution_past and resolution_future and len(resolution_past) == 0 and len(resolution_future) == 0: + not_resolved = { + DateTimeResolutionKey.timex: timex, + ResolutionKey.type: type_output, + ResolutionKey.value: "not resolved", + } + resolutions.append(not_resolved) + return {ResolutionKey.value_set: resolutions} + + @staticmethod + def determine_datetime_type(dt_type: str, has_mod: bool, config: DateTimeOptionsConfiguration) -> str: + if (config.options and DateTimeOptions.SPLIT_DATE_AND_TIME) != 0: + if dt_type == Constants.SYS_DATETIME_DATETIME: + return Constants.SYS_DATETIME_TIME + else: + if has_mod: + if dt_type == Constants.SYS_DATETIME_DATE: + return Constants.SYS_DATETIME_DATEPERIOD + if dt_type == Constants.SYS_DATETIME_TIME: + return Constants.SYS_DATETIME_TIMEPERIOD + if dt_type == Constants.SYS_DATETIME_DATETIME: + return Constants.SYS_DATETIME_DATETIMEPERIOD + return dt_type + + @staticmethod + def determine_source_entity(source_type: str, new_type: str, has_mod: bool) -> Optional[str]: + if not has_mod: + return None + if new_type != source_type: + return Constants.SYS_DATETIME_DATETIMEPOINT + if new_type == Constants.SYS_DATETIME_DATEPERIOD: + return Constants.SYS_DATETIME_DATEPERIOD + return None + + @staticmethod + def determine_resolution_datetime_type(past_resolutions: Dict[str, str]) -> str: + if list(past_resolutions.keys())[0] == TimeTypeConstants.START_DATE: + return Constants.SYS_DATETIME_DATEPERIOD + elif list(past_resolutions.keys())[0] == TimeTypeConstants.START_DATETIME: + return Constants.SYS_DATETIME_DATETIMEPERIOD + elif list(past_resolutions.keys())[0] == TimeTypeConstants.START_TIME: + return Constants.SYS_DATETIME_TIMEPERIOD + else: + return list(past_resolutions.keys())[0].lower() + + @staticmethod + def generate_resolution(dt_type: str, resolution_dict: Dict[str, str], mod: str) -> Dict[str, str]: + res: Dict[str, str] = {} + if dt_type == Constants.SYS_DATETIME_DATETIME: + res = MergedParserUtil.add_single_datetime_to_resolution( + resolution_dict, TimeTypeConstants.DATETIME, mod, res + ) + elif dt_type == Constants.SYS_DATETIME_TIME: + res = MergedParserUtil.add_single_datetime_to_resolution(resolution_dict, TimeTypeConstants.TIME, mod, res) + elif dt_type == Constants.SYS_DATETIME_DATE: + res = MergedParserUtil.add_single_datetime_to_resolution(resolution_dict, TimeTypeConstants.DATE, mod, res) + elif dt_type == Constants.SYS_DATETIME_DURATION: + if TimeTypeConstants.DURATION in resolution_dict: + res[ResolutionKey.value] = resolution_dict[TimeTypeConstants.DURATION] + elif dt_type == Constants.SYS_DATETIME_TIMEPERIOD: + res = MergedParserUtil.add_period_to_resolution( + resolution_dict, TimeTypeConstants.START_TIME, TimeTypeConstants.END_TIME, mod, res + ) + elif dt_type == Constants.SYS_DATETIME_DATEPERIOD: + res = MergedParserUtil.add_period_to_resolution( + resolution_dict, TimeTypeConstants.START_DATE, TimeTypeConstants.END_DATE, mod, res + ) + elif dt_type == Constants.SYS_DATETIME_DATETIMEPERIOD: + res = MergedParserUtil.add_period_to_resolution( + resolution_dict, TimeTypeConstants.START_TIME, TimeTypeConstants.END_TIME, mod, res + ) + elif dt_type == Constants.SYS_DATETIME_DATETIMEALT: + # for a period + if len(resolution_dict) > 2 or mod: + res = MergedParserUtil.add_alt_period_to_resolution(resolution_dict, mod, res) + else: + # Fot a datetime point + res = MergedParserUtil.add_alt_single_datetime_to_resolution(resolution_dict, mod, res) + return res + + @staticmethod + def add_single_datetime_to_resolution( + resolution_dict: Dict[str, str], dt_type: str, mod: str, res: Dict[str, str] + ) -> Dict[str, str]: + # If an "invalid" Date or DateTime is extracted, it should not have an assigned resolution. + # Only valid entities should pass this condition. + if dt_type in resolution_dict: + if mod: + if mod.startswith(Constants.BEFORE_MOD): + res[DateTimeResolutionKey.end] = resolution_dict[dt_type] + return res + if mod.startswith(Constants.AFTER_MOD): + res[DateTimeResolutionKey.start] = resolution_dict[dt_type] + return res + if mod.startswith(Constants.SINCE_MOD): + res[DateTimeResolutionKey.start] = resolution_dict[dt_type] + return res + if mod.startswith(Constants.UNTIL_MOD): + res[DateTimeResolutionKey.end] = resolution_dict[dt_type] + return res + res[ResolutionKey.value] = resolution_dict[dt_type] + return res + + @staticmethod + def add_period_to_resolution( + resolution_dict: Dict[str, str], start_type: str, end_type: str, mod: str, res: Dict[str, str] + ): + start = "" + end = "" + if start_type in resolution_dict: + start = resolution_dict[start_type] + if start == Constants.INVALID_DATE_STRING: + return res + if end_type in resolution_dict: + end = resolution_dict[end_type] + if end == Constants.INVALID_DATE_STRING: + return res + if mod: + # For the 'before' mod + # 1. Cases like "Before December", the start of the period should be the end of the new period, not the start + # (but not for cases like "Before the end of December") + # 2. Cases like "More than 3 days before today", the date point should be the end of the new period + if mod.startswith(Constants.BEFORE_MOD): + if start and end and mod.endswith(TimeTypeConstants.LATE_MOD): + res[DateTimeResolutionKey.end] = start + else: + res[DateTimeResolutionKey.end] = end + return res + # For the 'after' mod + # 1. Cases like "After January", the end of the period should be the start of the new period, not the end + # (but not for cases like "After the beginning of January") + # 2. Cases like "More than 3 days after today", the date point should be the start of the new period + if mod.startswith(Constants.AFTER_MOD): + if start and end and mod.endswith(TimeTypeConstants.EARLY_MOD): + res[DateTimeResolutionKey.start] = end + else: + res[DateTimeResolutionKey.start] = start + return res + # For the 'since' mod, the start of the period should be the start of the new period, not the end + if mod.startswith(Constants.SINCE_MOD): + res[DateTimeResolutionKey.start] = start + return res + # For the 'until' mod, the end of the period should be the end of the new period, not the start + if mod.startswith(Constants.UNTIL_MOD): + res[DateTimeResolutionKey.end] = end + return res + + return res + + if not MergedParserUtil.are_unresolved_dates(start, end): + res[DateTimeResolutionKey.start] = start + res[DateTimeResolutionKey.end] = end + # Preserving any present timex values. Useful for Holiday weekend where the timex is known during parsing. + if DateTimeResolutionKey.timex in resolution_dict: + res[DateTimeResolutionKey.timex] = resolution_dict[DateTimeResolutionKey.timex] + + return res + + @staticmethod + def are_unresolved_dates(start_date: str, end_date: str) -> bool: + if not start_date or not end_date: + return True + return False + + @staticmethod + def add_alt_period_to_resolution(resolution_dict: Dict[str, str], mod: str, res: Dict[str, str]) -> Dict[str, str]: + if TimeTypeConstants.START_DATETIME in resolution_dict or TimeTypeConstants.END_DATETIME in resolution_dict: + return MergedParserUtil.add_period_to_resolution( + resolution_dict, TimeTypeConstants.START_DATETIME, TimeTypeConstants.END_DATETIME, mod, res + ) + elif TimeTypeConstants.START_DATE in resolution_dict or TimeTypeConstants.END_DATE in resolution_dict: + return MergedParserUtil.add_period_to_resolution( + resolution_dict, TimeTypeConstants.START_DATE, TimeTypeConstants.END_DATE, mod, res + ) + elif TimeTypeConstants.START_TIME in resolution_dict or TimeTypeConstants.END_TIME in resolution_dict: + return MergedParserUtil.add_period_to_resolution( + resolution_dict, TimeTypeConstants.START_TIME, TimeTypeConstants.END_TIME, mod, res + ) + return res + + @staticmethod + def add_alt_single_datetime_to_resolution( + resolution_dict: Dict[str, str], mod: str, res: Dict[str, str] + ) -> Dict[str, str]: + if TimeTypeConstants.DATE in resolution_dict: + return MergedParserUtil.add_single_datetime_to_resolution(resolution_dict, TimeTypeConstants.DATE, mod, res) + elif TimeTypeConstants.DATETIME in resolution_dict: + return MergedParserUtil.add_single_datetime_to_resolution( + resolution_dict, TimeTypeConstants.DATETIME, mod, res + ) + elif TimeTypeConstants.TIME in resolution_dict: + return MergedParserUtil.add_single_datetime_to_resolution(resolution_dict, TimeTypeConstants.TIME, mod, res) + return res + + @staticmethod + def resolve_ampm(resolution_dict: Dict, key_name: str) -> Dict: + if key_name in resolution_dict: + resolution: Dict[str, str] = resolution_dict[key_name] + resolution_pm: Dict[str, str] = dict() + + if DateTimeResolutionKey.timex not in resolution_dict: + return resolution_dict + timex = resolution_dict[DateTimeResolutionKey.timex] + resolution_dict.pop(key_name) + resolution_dict[key_name + 'Am'] = resolution + + if resolution_dict[ResolutionKey.type] == Constants.SYS_DATETIME_TIME: + + resolution_pm[ResolutionKey.value] = DateTimeFormatUtil.to_pm(resolution[ResolutionKey.value]) + resolution_pm[DateTimeResolutionKey.timex] = DateTimeFormatUtil.to_pm(timex) + + elif resolution_dict[ResolutionKey.type] == Constants.SYS_DATETIME_DATETIME: + split = resolution[ResolutionKey.value].split(' ') + resolution_pm[ResolutionKey.value] = split[0] + ' ' + DateTimeFormatUtil.to_pm((split[1])) + resolution_pm[DateTimeResolutionKey.timex] = DateTimeFormatUtil.all_str_to_pm(timex) + + elif resolution_dict[ResolutionKey.type] == Constants.SYS_DATETIME_TIMEPERIOD: + if DateTimeResolutionKey.start in resolution: + resolution_pm[DateTimeResolutionKey.start] = DateTimeFormatUtil.to_pm( + resolution[DateTimeResolutionKey.start] + ) + if DateTimeResolutionKey.end in resolution: + resolution_pm[DateTimeResolutionKey.end] = DateTimeFormatUtil.to_pm( + resolution[DateTimeResolutionKey.end] + ) + if DateTimeResolutionKey.value in resolution: + resolution_pm[ResolutionKey.value] = DateTimeFormatUtil.to_pm(resolution[ResolutionKey.value]) + resolution_pm[DateTimeResolutionKey.timex] = DateTimeFormatUtil.all_str_to_pm(timex) + + elif resolution_dict[ResolutionKey.type] == Constants.SYS_DATETIME_DATETIMEPERIOD: + if DateTimeResolutionKey.start in resolution: + if datetime.datetime.strptime( + resolution[DateTimeResolutionKey.start], "%Y-%m-%d %H:%M:%S" + ).strftime('%Y-%m-%d %H:%M:%S'): + start = datetime.datetime.strptime( + resolution[DateTimeResolutionKey.start], "%Y-%m-%d %H:%M:%S" + ).time() + else: + start = datetime.datetime.strptime(resolution[DateTimeResolutionKey.start], '%H') + + if start.hour == Constants.HALF_DAY_HOUR_COUNT: + start = ( + datetime.datetime.combine(datetime.datetime.now().date(), start) + - datetime.timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) + ).time() + else: + start = ( + datetime.datetime.combine(datetime.datetime.now().date(), start) + + datetime.timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) + ).time() + + resolution_pm[DateTimeResolutionKey.start] = DateTimeFormatUtil.format_time(start) + + if DateTimeResolutionKey.end in resolution: + if datetime.datetime.strptime(resolution[DateTimeResolutionKey.end], "%Y-%m-%d %H:%M:%S").strftime( + '%Y-%m-%d %H:%M:%S' + ): + end = datetime.datetime.strptime( + resolution[DateTimeResolutionKey.end], "%Y-%m-%d %H:%M:%S" + ).time() + else: + end = datetime.datetime.strptime(resolution[DateTimeResolutionKey.end], '%H') + + if end.hour == Constants.HALF_DAY_HOUR_COUNT: + end = ( + datetime.datetime.combine(datetime.datetime.now().date(), end) + - datetime.timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) + ).time() + else: + end = ( + datetime.datetime.combine(datetime.datetime.now().date(), end) + + datetime.timedelta(hours=Constants.HALF_DAY_HOUR_COUNT) + ).time() + + resolution_pm[DateTimeResolutionKey.end] = DateTimeFormatUtil.format_time(end) + + resolution_dict[key_name + "Pm"] = resolution_pm + return resolution_dict + + @staticmethod + def resolve_week_of(resolution_dict: Dict, key_name: str) -> Dict: + if key_name in resolution_dict: + resolution: Dict[str, str] = resolution_dict[key_name] + + monday = datetime.datetime.strptime(resolution[DateTimeResolutionKey.start], '%A') + resolution[DateTimeResolutionKey.timex] = DateTimeFormatUtil.to_iso_week_timex(monday) + + resolution_dict.pop(key_name) + resolution_dict[key_name] = resolution + return resolution_dict diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/mod_and_date_result.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/mod_and_date_result.py new file mode 100644 index 0000000000..76138bb4ae --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/mod_and_date_result.py @@ -0,0 +1,64 @@ +import datetime +from typing import List + +from datedelta import datedelta + +from recognizers_date_time.date_time import Constants +from recognizers_date_time.date_time.utilities import DurationParsingUtil + + +class ModAndDateResult: + + def __init__(self): + self.date_list = None + self.end_date = None + self.begin_date = None + self.mod = None + + def mod_and_date_result( + self, begin_date: datetime, end_date: datetime, mod: str = '', date_list: [datetime] = None + ): + self.begin_date = begin_date + self.end_date = end_date + self.mod = mod + self.date_list = date_list + + def get_mod_and_date(self, begin_date: datetime, end_date: datetime, reference: datetime, timex: str, future: bool): + begin_date_result = begin_date + end_date_result = end_date + + is_business_day = timex.endswith(Constants.TIMEX_BUSINESS_DAY) + business_day_count = 0 + date_list: List[datetime] = None + + if is_business_day: + business_day_count = timex[1 : len(timex) - 3] + + if future: + mod = Constants.AFTER_MOD + + # For future the beginDate should add 1 first + if is_business_day: + begin_date_result = DurationParsingUtil.get_next_business_day(reference, future) + end_date_result = DurationParsingUtil.get_nth_business_day( + begin_date_result, business_day_count - 1, future + ) + end_date_result = end_date_result + datedelta(days=1) + return self.mod_and_date_result(begin_date_result, end_date_result, mod, date_list) + else: + begin_date_result = reference + datedelta(days=1) + end_date_result = DurationParsingUtil.shift_date_time(timex, begin_date_result, future) + return self.mod_and_date_result(begin_date_result, end_date_result, mod, None) + else: + mod = Constants.BEFORE_MOD + + if is_business_day: + begin_date_result = DurationParsingUtil.get_nth_business_day( + end_date_result, business_day_count - 1, future + ) + end_date_result = DurationParsingUtil.get_next_business_day(end_date_result, future) + end_date_result = end_date_result + datedelta(days=1) + return self.mod_and_date_result(begin_date_result, end_date_result, mod, date_list) + else: + begin_date_result = DurationParsingUtil.shift_date_time(timex, end_date_result, future) + return self.mod_and_date_result(begin_date_result, end_date_result, mod, None) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/range_timex_components.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/range_timex_components.py new file mode 100644 index 0000000000..eeb8bd4b7d --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/range_timex_components.py @@ -0,0 +1,6 @@ +class RangeTimexComponents: + def __init__(self): + self.begin_timex = '' + self.end_timex = '' + self.duration_timex = '' + self.is_valid = False diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/resolution_start_end.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/resolution_start_end.py new file mode 100644 index 0000000000..3cc92f6650 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/resolution_start_end.py @@ -0,0 +1,12 @@ +class ResolutionStartEnd: + def __init__(self, _start=None, _end=None): + self.start = _start + self.end = _end + + @property + def _start(self): + return self.start + + @property + def _end(self): + return self.end diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_functions.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_functions.py new file mode 100644 index 0000000000..53b4a25436 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_functions.py @@ -0,0 +1,167 @@ +from datetime import datetime +from typing import Dict, Pattern + +import regex + +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.utilities import DateTimeExtra, DateTimeResolutionResult, DateUtils, TimeResult +from recognizers_text import RegExpUtility + + +class TimeFunctions: + def __init__(self, number_dictionary: Dict[str, int], low_bound_desc: Dict[str, int], day_desc_regex: Pattern): + self.number_dictionary = number_dictionary + self.low_bound_desc = low_bound_desc + self.day_desc_regex = day_desc_regex + self.only_digit_match = RegExpUtility.get_safe_reg_exp('\\d+') + + def handle_less(self, extra: DateTimeExtra) -> TimeResult: + hour = self.match_to_value(next(iter(extra.named_entity['hour']), '')) + quarter = self.match_to_value(next(iter(extra.named_entity['quarter']), '')) + has_half = next(iter(extra.named_entity['half']), '') == '' + minute = 30 if not has_half else quarter * 15 if quarter != -1 else 0 + second = self.match_to_value(next(iter(extra.named_entity['sec']), '')) + less = self.match_to_value(next(iter(extra.named_entity['min']), '')) + + _all = hour * 60 + minute - less + if _all < 0: + _all = _all + 1440 + + return TimeResult(int(_all / 60), _all % 60, second) + + def handle_kanji(self, extra: DateTimeExtra) -> TimeResult: + hour = self.match_to_value(next(iter(extra.named_entity['hour']), '')) + quarter = self.match_to_value(next(iter(extra.named_entity['quarter']), '')) + has_half = next(iter(extra.named_entity['half']), '') == '' + minute = ( + 30 + if not has_half + else quarter * 15 if quarter != -1 else self.match_to_value(next(iter(extra.named_entity['min']), '')) + ) + second = self.match_to_value(next(iter(extra.named_entity['sec']), '')) + + return TimeResult(hour, minute, second) + + def handle_digit(self, extra: DateTimeExtra) -> TimeResult: + hour = self.match_to_value(next(iter(extra.named_entity['hour']), '')) + minute = self.match_to_value(next(iter(extra.named_entity['min']), '')) + second = self.match_to_value(next(iter(extra.named_entity['sec']), '')) + + return TimeResult(hour, minute, second) + + def pack_time_result( + self, extra: DateTimeExtra, time_result: TimeResult, reference: datetime + ) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + + # Find if there is a description + day_desc = next(iter(extra.named_entity['daydesc']), '') + no_desc = True + + if day_desc: + self.add_desc(time_result, day_desc) + no_desc = False + + # Hours > 24 (e.g. 25時 which resolves to the next day) are kept unnormalized in the timex + # to avoid ambiguity in other entities. For example, "on the 30th at 25" is resolved to + # "XXXX-XX-30T25" because with "XXXX-XX-30+1T01" it is not known if the day should be "31" or "01". + hour = self._min_with_floor(time_result.hour) + if hour == Constants.DAY_HOUR_COUNT: + hour = 0 + + minute = self._min_with_floor(time_result.minute) + second = self._min_with_floor(time_result.second) + + day = reference.day + month = reference.month + year = reference.year + + timex = 'T' + if time_result.hour >= 0: + timex = f'{timex}{hour:02d}' + if time_result.minute >= 0: + timex = f'{timex}:{minute:02d}' + if time_result.second >= 0: + if time_result.minute < 0: + timex = f'{timex}:{minute:02d}' + timex = f'{timex}:{second:02d}' + + # handle cases with time like 25時 (the hour is normalized in the past/future values) + if hour > Constants.DAY_HOUR_COUNT: + hour = time_result.hour - Constants.DAY_HOUR_COUNT + if no_desc: + result.comment = Constants.COMMENT_AM + no_desc = False + + if no_desc and hour <= Constants.HALF_DAY_HOUR_COUNT and hour > Constants.DAY_HOUR_START: + result.comment = Constants.COMMENT_AMPM + + result.future_value = DateUtils.safe_create_from_min_value(year, month, day, hour, minute, second) + result.past_value = DateUtils.safe_create_from_min_value(year, month, day, hour, minute, second) + result.timex = timex + result.success = True + + return result + + # Handle am/pm modifiers (e.g. "1 in the afternoon") and time of day (e.g. "mid-morning") + def add_desc(self, result: TimeResult, day_desc: str): + if not day_desc: + return + day_desc = self.normalise_day_desc(day_desc) + + if result.hour >= 0 and day_desc in self.low_bound_desc: + if result.hour < self.low_bound_desc[day_desc] or ( + result.hour == Constants.HALF_DAY_HOUR_COUNT + and self.low_bound_desc[day_desc] == Constants.DAY_HOUR_START + ): + # cases like "1 in the afternoon", "12 midnight" + result.hour += Constants.HALF_DAY_HOUR_COUNT + result.low_bound = self.low_bound_desc[day_desc] + + elif result.hour < 0 and day_desc in self.low_bound_desc: + # cases like "mid-morning", "mid-afternoon" + result.low_bound = self.low_bound_desc[day_desc] + result.hour = result.low_bound + else: + result.low_bound = 0 + + def get_short_left(self, text: str) -> TimeResult: + des = "" + if regex.match(self.day_desc_regex, text): + des = text[:-1] + if text: + hour = self.match_to_value(text[-1]) + else: + hour = self.match_to_value(text) + time_result = TimeResult(hour, -1, -1) + self.add_desc(time_result, des) + + return time_result + + # Normalize cases like "p.m.", "p m" to canonical form "pm" + def normalise_day_desc(self, day_desc: str): + return day_desc.replace(" ", "").replace(".", "") + + def _min_with_floor(self, source: int) -> int: + return source if source > 0 else 0 + + def match_to_value(self, text: str) -> int: + if not text.strip(): + return -1 + + if regex.match(self.only_digit_match, text): + return int(text) + + if len(text) == 1: + return self.number_dictionary[text] + + value = 1 + for index, char in enumerate(text): + if char == '十': + value = value * 10 + elif index == 0: + value = value * self.number_dictionary[char] + else: + value = value + self.number_dictionary[char] + + return value diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_of_day_resolution.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_of_day_resolution.py new file mode 100644 index 0000000000..46255d4da0 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_of_day_resolution.py @@ -0,0 +1,6 @@ +class TimeOfDayResolution: + def __init__(self): + self.timex: str = None + self.begin_hour: int = 0 + self.end_hour: int = 0 + self.end_min: int = 0 diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_period_functions.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_period_functions.py new file mode 100644 index 0000000000..7682424dc1 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_period_functions.py @@ -0,0 +1,189 @@ +from datetime import datetime, timedelta +from typing import Match + +from recognizers_date_time.date_time.data_structures import PeriodType +from recognizers_date_time.date_time.parsers import DateTimeParser +from recognizers_date_time.date_time.utilities import ( + DateTimeExtra, + DateTimeResolutionResult, + DateUtils, + TimeFunctions, + TimeResult, +) +from recognizers_text import ExtractResult + +from ..constants import Constants + + +class TimePeriodFunctions: + + @staticmethod + def handle( + time_parser: DateTimeParser, extra: DateTimeExtra, reference: datetime, time_func: TimeFunctions + ) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + + # Left is a time + left_entity = next(iter(extra.named_entity.get('left', [])), '') + + # 下午四点十分到五点十分 + if extra.data_type == PeriodType.FullTime: + left_result = TimePeriodFunctions.get_parse_time_result(left_entity, extra.match, reference, time_parser) + else: + # 下午四到五点 + left_result = time_func.get_short_left(left_entity) + + # Right is a time + right_entity = next(iter(extra.named_entity.get('right', [])), '') + right_result = TimePeriodFunctions.get_parse_time_result(right_entity, extra.match, reference, time_parser) + + span_hour = right_result.hour - left_result.hour + if span_hour < 0 or (span_hour == 0 and left_result.minute > right_result.minute): + span_hour += Constants.DAY_HOUR_COUNT + + # the right side doesn't contain desc while the left side does + if ( + right_result.low_bound == -1 + and left_result.low_bound != -1 + and right_result.hour <= Constants.HALF_DAY_HOUR_COUNT + and span_hour > Constants.HALF_DAY_HOUR_COUNT + ): + right_result.hour += Constants.HALF_DAY_HOUR_COUNT + + # the left side doesn't contain desc while the right side does + if ( + left_result.low_bound == -1 + and right_result.low_bound != -1 + and left_result.hour <= Constants.HALF_DAY_HOUR_COUNT + and span_hour > Constants.HALF_DAY_HOUR_COUNT + ): + left_result.hour += Constants.HALF_DAY_HOUR_COUNT + + # No 'am' or 'pm' indicator + if ( + left_result.low_bound == right_result.low_bound == -1 + and left_result.hour <= Constants.HALF_DAY_HOUR_COUNT + and right_result.hour <= Constants.HALF_DAY_HOUR_COUNT + ): + + if span_hour > Constants.HALF_DAY_HOUR_COUNT: + if left_result.hour > right_result.hour: + if left_result.hour == Constants.HALF_DAY_HOUR_COUNT: + left_result.hour -= Constants.HALF_DAY_HOUR_COUNT + else: + right_result.hour += Constants.HALF_DAY_HOUR_COUNT + result.comment = Constants.COMMENT_AMPM + + day = reference.day + month = reference.month + year = reference.year + right_swift_day = 0 + left_swift_day = 0 + + # determine if the left side time is smaller than the right side, if yes, add one day + hour = left_result.hour if left_result.hour > 0 else 0 + minute = left_result.minute if left_result.minute > 0 else 0 + second = left_result.second if left_result.second > 0 else 0 + + # handle cases with time like 25時 which resolve to the next day + if hour > Constants.DAY_HOUR_COUNT: + hour -= Constants.DAY_HOUR_COUNT + left_swift_day += 1 + + left_time = DateUtils.safe_create_from_min_value(year, month, day, hour, minute, second) + + hour = right_result.hour if right_result.hour > 0 else 0 + minute = right_result.minute if right_result.minute > 0 else 0 + second = right_result.second if right_result.second > 0 else 0 + + # handle cases with time like 25時 which resolve to the next day + if hour > Constants.DAY_HOUR_COUNT: + hour -= Constants.DAY_HOUR_COUNT + right_swift_day += 1 + + right_time = DateUtils.safe_create_from_min_value( + reference.year, reference.month, reference.day, hour, minute, second + ) + + if right_result.hour < left_result.hour: + right_time += timedelta(days=1) + + left_timex = TimePeriodFunctions.build_timex(left_result) + right_timex = TimePeriodFunctions.build_timex(right_result) + span_timex = TimePeriodFunctions.build_span(left_result, right_result) + + result.timex = f'({left_timex},{right_timex},{span_timex})' + + right_time += timedelta(days=right_swift_day) + left_time += timedelta(days=left_swift_day) + + result.future_value = [left_time, right_time] + result.past_value = [left_time, right_time] + result.success = True + + return result + + @staticmethod + def build_timex(time_result: TimeResult) -> str: + timex = 'T' + if time_result.hour >= 0: + timex = f'{timex}{time_result.hour:02d}' + if time_result.minute >= 0: + timex = f'{timex}:{time_result.minute:02d}' + if time_result.second >= 0: + timex = f'{timex}:{time_result.second:02d}' + + return timex + + @staticmethod + def build_span(left: TimeResult, right: TimeResult) -> str: + left = TimePeriodFunctions.sanitize_time_result(left) + right = TimePeriodFunctions.sanitize_time_result(right) + + span_hour = right.hour - left.hour + span_min = right.minute - left.minute + span_sec = right.second - left.second + + if span_sec < 0: + span_sec += 60 + span_min -= 1 + + if span_min < 0: + span_min += 60 + span_hour -= 1 + + if span_hour < 0: + span_hour += 24 + + span_timex = 'PT' + if span_hour > 0: + span_timex += f'{span_hour}H' + if span_min > 0: + span_timex += f'{span_min}M' + if span_sec > 0: + span_timex += f'{span_sec}S' + + return span_timex + + @staticmethod + def sanitize_time_result(source: TimeResult) -> TimeResult: + return TimeResult( + source.hour, 0 if source.minute == -1 else source.minute, 0 if source.second == -1 else source.second + ) + + @staticmethod + def get_parse_time_result( + entity: str, match: Match, reference: datetime, time_parser: DateTimeParser + ) -> TimeResult: + match_str: str = match.group() + + extract_result = ExtractResult() + extract_result.start = match.start() + match_str.find(entity) + extract_result.length = len(entity) + extract_result.text = entity + extract_result.type = Constants.SYS_DATETIME_TIME + + result = time_parser.parse(extract_result, reference) + if not result: + return TimeResult(-1, -1, -1) + return result.data diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_result.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_result.py new file mode 100644 index 0000000000..ab6f859e0f --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/time_result.py @@ -0,0 +1,6 @@ +class TimeResult: + def __init__(self, hour: int, minute: int, second: int, low_bound: int = -1): + self.hour = hour + self.minute = minute + self.second = second + self.low_bound = low_bound diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/timex_utility.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/timex_utility.py new file mode 100644 index 0000000000..eee4942cf6 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/timex_utility.py @@ -0,0 +1,521 @@ +from datetime import datetime, timedelta +from enum import IntEnum +from typing import Dict, List, Tuple + +from datedelta import datedelta + +from datatypes_timex_expression.timex_helpers import TimexHelpers +from recognizers_date_time.date_time.constants import Constants +from recognizers_date_time.date_time.data_structures import DatePeriodTimexType +from recognizers_date_time.date_time.utilities import ( + DateTimeFormatUtil, + DateTimeResolutionKey, + DateUtils, + RangeTimexComponents, + TimeOfDayResolution, +) + + +date_period_timex_type_to_suffix = { + 0: Constants.TIMEX_DAY, + 1: Constants.TIMEX_WEEK, + 2: Constants.TIMEX_MONTH, + 3: Constants.TIMEX_YEAR, +} + + +class UnspecificDateTimeTerms(IntEnum): + NONE = (0,) + NonSpecificYear = 1 + NonSpecificMonth = 2 + NonSpecificDay = 3 + + +class TimexUtil: + + @staticmethod + def merge_timex_alternatives(timex1: str, timex2: str) -> str: + if timex1 == timex2: + return timex1 + return f"{timex1}{Constants.COMPOSTIE_TIMEX_DELIMITER}{timex2}" + + @staticmethod + def parse_time_of_day(tod: str) -> TimeOfDayResolution: + result = TimeOfDayResolution() + + if tod == Constants.EARLY_MORNING: + result.timex = Constants.EARLY_MORNING + result.begin_hour = 4 + result.end_hour = 8 + elif tod == Constants.MORNING: + result.timex = Constants.MORNING + result.begin_hour = 8 + result.end_hour = 12 + elif tod == Constants.MID_DAY: + result.timex = Constants.MID_DAY + result.begin_hour = 11 + result.end_hour = 13 + elif tod == Constants.AFTERNOON: + result.timex = Constants.AFTERNOON + result.begin_hour = 12 + result.end_hour = 16 + elif tod == Constants.EVENING: + result.timex = Constants.EVENING + result.begin_hour = 16 + result.end_hour = 20 + elif tod == Constants.DAYTIME: + result.timex = Constants.DAYTIME + result.begin_hour = 8 + result.end_hour = 18 + elif tod == Constants.BUSINESS_HOUR: + result.timex = Constants.BUSINESS_HOUR + result.begin_hour = 8 + result.end_hour = 18 + elif tod == Constants.NIGHT: + result.timex = Constants.NIGHT + result.begin_hour = 20 + result.end_hour = 23 + result.end_min = 59 + elif tod == Constants.MEALTIME_BREAKFAST: + result.timex = Constants.MEALTIME_BREAKFAST + result.begin_hour = 8 + result.end_hour = 12 + elif tod == Constants.MEALTIME_BRUNCH: + result.timex = Constants.MEALTIME_BRUNCH + result.begin_hour = 8 + result.end_hour = 12 + elif tod == Constants.MEALTIME_LUNCH: + result.timex = Constants.MEALTIME_LUNCH + result.begin_hour = 11 + result.end_hour = 13 + elif tod == Constants.MEALTIME_DINNER: + result.timex = Constants.MEALTIME_DINNER + result.begin_hour = 16 + result.end_hour = 20 + + return result + + @staticmethod + def set_timex_with_context(timex: str, context) -> str: + result = timex.replace(Constants.TIMEX_FUZZY_YEAR, str(context.year)) + return result + + @staticmethod + def generate_date_period_timex_unit_count(begin, end, timex_type, equal_duration_length=True) -> str: + unit_count = 'XX' + + if equal_duration_length: + if timex_type == 0: + unit_count = int((end - begin).days) + + if timex_type == 1: + unit_count = int((end - begin).days / 7) + if timex_type == 2: + unit_count = int(((end.year - begin.year) * 12) + (end.month - begin.month)) + if timex_type == 3: + unit_count = int((end.year - begin.year) + ((end.month - begin.month) / 12.0)) + return str(unit_count) + + @staticmethod + def generate_date_period_timex_str(begin, end, timex_type, timex1, timex2): + boundary_valid = DateUtils.is_valid_datetime(begin) and DateUtils.is_valid_datetime(end) + unit_count = TimexUtil.generate_date_period_timex_unit_count(begin, end, timex_type) if boundary_valid else "X" + return f"({timex1},{timex2},P{unit_count}{date_period_timex_type_to_suffix[timex_type]})" + + @staticmethod + def generate_date_period_timex_with_diff(begin: datetime, end_date: datetime, duration_unit): + + diff = 0 + if duration_unit == Constants.TIMEX_WEEK: + diff = Constants.WEEK_DAY_COUNT - (Constants.WEEK_DAY_COUNT if begin.day == 0 else begin.isoweekday()) + end_date = begin + datedelta(days=diff) + + if duration_unit == Constants.TIMEX_MONTH_FULL: + end_date = DateUtils.safe_create_from_min_value(begin.year, begin.month, 1) + end_date = end_date + datedelta(months=1) - datedelta(days=1) + diff - end_date.day - begin.day + 1 + + if duration_unit == Constants.TIMEX_YEAR: + end_date = DateUtils.safe_create_from_min_value(begin.year, 12, 1) + end_date = end_date + datedelta(months=1) - datedelta(days=1) + diff = DateUtils.day_of_year(end_date) - DateUtils.day_of_year(begin) + 1 + + duration_timex = Constants.GENERAL_PERIOD_PREFIX + diff + Constants.TIMEX_DAY + + return ( + f'({DateTimeFormatUtil.luis_date(begin.year, begin.month, begin.day)},' + f'{DateTimeFormatUtil.luis_date(end_date.year, end_date.month, end_date.day)},{duration_timex})' + ) + + @staticmethod + def generate_date_period_timex( + begin: datetime, + end: datetime, + timex_type: DatePeriodTimexType, + alternative_begin: datetime = None, + alternative_end: datetime = None, + has_year: bool = True, + has_month: bool = True, + ): + begin_month = begin.month + end_month = end.month + begin_day = begin.day + end_day = end.day + begin_year = begin.year + end_year = end.year + + # If the year is not specified, the combined range timex will use fuzzy years. + + if not has_year: + begin_year = -1 + end_year = -1 + + if not has_month: + begin_month = -1 + end_month = -1 + + if not has_month or not has_year: + unit_count = TimexUtil.generate_date_period_timex_unit_count(begin, end, timex_type) + + date_period_timex = f"P{unit_count}{date_period_timex_type_to_suffix[timex_type]}" + return ( + f'({DateTimeFormatUtil.luis_date(begin_year, begin_month, begin_day)},' + f'{DateTimeFormatUtil.luis_date(end_year, end_month, end_day)},{date_period_timex})' + ) + + alternative = False + if alternative_begin is None and alternative_end is None: + alternative_begin = datetime.now() + alternative_end = datetime.now() + else: + alternative = True + + equal_duration_length = (end - begin).days == (alternative_end - alternative_begin).days or alternative == False + + unit_count = TimexUtil.generate_date_period_timex_unit_count(begin, end, timex_type, equal_duration_length) + date_period_timex = f'P{unit_count}{date_period_timex_type_to_suffix[timex_type]}' + + if alternative: + return ( + f'({DateTimeFormatUtil.luis_date_from_datetime_with_alternative(begin, alternative_begin)},' + f'{DateTimeFormatUtil.luis_date_from_datetime_with_alternative(end, alternative_end)},' + f'{date_period_timex})' + ) + else: + return ( + f'({DateTimeFormatUtil.luis_date(begin.year, begin.month, begin.day)},' + f'{DateTimeFormatUtil.luis_date(end.year, end.month, end.day)},{date_period_timex})' + ) + + @staticmethod + def generate_date_period_timex_with_duration(begin_date: datetime, end_date: datetime, duration_timex: str): + return ( + f'({DateTimeFormatUtil.luis_date(begin_date.year, begin_date.month, begin_date.day)},' + f'{DateTimeFormatUtil.luis_date(end_date.year, end_date.month, end_date.day)},{duration_timex})' + ) + + @staticmethod + def generate_split_date_time_period_timex(date_timex: str, time_range_timex: str): + split = time_range_timex.split(Constants.TIME_TIMEX_PREFIX[0]) + timex: str = None + if len(split) == 4: + timex = ( + split[0] + + date_timex + + Constants.TIME_TIMEX_PREFIX + + split[1] + + date_timex + + Constants.TIME_TIMEX_PREFIX + + split[2] + + Constants.TIME_TIMEX_PREFIX + + split[3] + ) + elif len(split) == 2: + timex = date_timex + time_range_timex + + return timex + + @staticmethod + def generate_relative_unit_date_time_period_timex( + begin_date_time: datetime, end_date_time: datetime, reference_time: datetime, unit_str: str, swift: int + ): + prefix: str = Constants.GENERAL_PERIOD_PREFIX + Constants.TIME_TIMEX_PREFIX + duration_timex = '' + if unit_str == Constants.TIMEX_DAY: + end_date_time = DateUtils.safe_create_from_value( + begin_date_time.year, begin_date_time.month, begin_date_time.day + ) + end_date_time = end_date_time + timedelta(days=1, seconds=-1) + duration_timex = prefix + (end_date_time - begin_date_time).total_seconds() + Constants.TIMEX_SECOND + + elif unit_str == Constants.TIMEX_HOUR: + begin_date_time = begin_date_time if swift > 0 else reference_time + timedelta(hours=swift) + end_date_time = reference_time + timedelta(hours=swift) if swift > 0 else end_date_time + duration_timex = prefix + "1" + Constants.TIMEX_HOUR + + elif unit_str == Constants.TIMEX_MINUTE: + begin_date_time = begin_date_time if swift > 0 else reference_time + timedelta(hours=swift) + end_date_time = reference_time + timedelta(hours=swift) if swift > 0 else end_date_time + duration_timex = prefix + "1" + Constants.TIMEX_MINUTE + + elif unit_str == Constants.TIMEX_SECOND: + begin_date_time = begin_date_time if swift > 0 else reference_time + timedelta(hours=swift) + end_date_time = reference_time + timedelta(hours=swift) if swift > 0 else end_date_time + duration_timex = prefix + "1" + Constants.TIMEX_SECOND + else: + return '' + + return TimexUtil.generate_date_time_period_timex(begin_date_time, end_date_time, duration_timex) + + @staticmethod + def _process_double_timex(resolution_dic: Dict[str, object], future_key: str, past_key: str, origin_timex: str): + timexes = origin_timex.split(Constants.COMPOSTIE_TIMEX_DELIMITER) + if future_key not in resolution_dic or past_key not in resolution_dic or len(timexes) != 2: + return + future_resolution = resolution_dic[future_key] + past_resolution = resolution_dic[past_key] + future_resolution[Constants.TIMEX_KEY] = timexes[0] + past_resolution[Constants.TIMEX_KEY] = timexes[1] + + @staticmethod + def _has_double_timex(comment: str): + return comment == Constants.COMMENT_DOUBLETIMEX + + @staticmethod + def is_range_timex(timex: str) -> bool: + return timex and timex.startswith("(") + + @staticmethod + def get_range_timex_components(range_timex: str) -> RangeTimexComponents: + range_timex = range_timex.replace('(', '').replace(')', '') + components = range_timex.split(',') + result = RangeTimexComponents() + if len(components) == 3: + result.begin_timex = components[0] + result.end_timex = components[1] + result.duration_timex = components[2] + result.is_valid = True + + return result + + @staticmethod + def combine_date_and_time_timex(date_timex: str, time_timex: str): + return f'{date_timex}{time_timex}' + + @staticmethod + def generate_date_time_period_timex(begin_timex: str, end_timex: str, duration_timex: str): + return f'({begin_timex},{end_timex},{duration_timex})' + + @staticmethod + def parse_number_from_duration_timex(timex: str): + number_str = timex[ + timex.index(Constants.GENERAL_PERIOD_PREFIX) + 1 : timex.index(Constants.DURATION_UNIT_CHAR - 1) + ] + + return float(number_str) + + @staticmethod + def generate_year_timex(date: any = None, special_year_prefixes=None): + if not date: + year_timex = Constants.TIMEX_FUZZY_YEAR + else: + if type(date) == datetime: + year_timex = f'{date.year}' + elif type(date) == int: + # For when the year is used directly + year_timex = DateTimeFormatUtil.luis_date(date, 1, 1) + + if not special_year_prefixes: + return year_timex + else: + return special_year_prefixes + year_timex + + @staticmethod + def parse_hour_from_time_timex(timex: str) -> int: + start = timex.index(Constants.TIME_TIMEX_PREFIX) + 1 + try: + end = timex.index(Constants.TIME_TIMEX_CONNECTOR) + except ValueError: + end = len(timex) + hour = int(timex[start : end - start]) + return hour + + @staticmethod + def parse_hours_from_time_period_timex(timex: str) -> Tuple[int, int]: + hour1 = 0 + hour2 = 0 + time_list = timex.split(Constants.TIMEX_SEPARATOR[0]) + if len(time_list) > 2: + hour1 = TimexUtil.parse_hour_from_time_timex(time_list[0]) + hour2 = TimexUtil.parse_hour_from_time_timex(time_list[1]) + return hour1, hour2 + + @staticmethod + def generate_date_time_timex(date_time: datetime) -> str: + return DateTimeFormatUtil.luis_date_time(date_time) + + @staticmethod + def has_double_timex(comment: str) -> bool: + return comment == Constants.COMMENT_DOUBLETIMEX + + @staticmethod + def process_double_timex(resolution_dict: Dict, future_key: str, past_key: str, origin_timex: str) -> Dict: + timexes = origin_timex.split(Constants.COMPOSTIE_TIMEX_DELIMITER) + if future_key not in resolution_dict or past_key not in resolution_dict or len(timexes) != 2: + return resolution_dict + + future_resolution = resolution_dict[future_key] + past_resolution = resolution_dict[past_key] + future_resolution[DateTimeResolutionKey.timex] = timexes[0] + past_resolution[DateTimeResolutionKey.timex] = timexes[1] + + @staticmethod + def generate_week_timex(monday=None): + if monday is None: + return f'{Constants.TIMEX_FUZZY_YEAR}{Constants.DATE_TIMEX_CONNECTOR}{Constants.TIMEX_FUZZY_WEEK}' + else: + return DateTimeFormatUtil.to_iso_week_timex(monday) + + @staticmethod + def generate_weekday_timex(weekday: int): + return ( + f'{Constants.TIMEX_FUZZY_YEAR}{Constants.DATE_TIMEX_CONNECTOR}{Constants.TIMEX_FUZZY_WEEK}' + f'{Constants.DATE_TIMEX_CONNECTOR}{weekday}' + ) + + @staticmethod + def generate_decade_timex(begin_year, total_last_year, decade, input_century) -> str: + + if input_century: + begin_str = DateTimeFormatUtil.luis_date(begin_year, 1, 1) + end_str = DateTimeFormatUtil.luis_date(begin_year + total_last_year, 1, 1) + + else: + begin_year_str = f'{Constants.TIMEX_FUZZY_TWO_DIGIT_YEAR}{decade}' + begin_str = DateTimeFormatUtil.luis_date(-1, 1, 1) + begin_str = begin_str.replace(Constants.TIMEX_FUZZY_YEAR, begin_year_str) + + end_year_str = f'{Constants.TIMEX_FUZZY_TWO_DIGIT_YEAR}{((decade + total_last_year) % 100):02d}' + end_str = DateTimeFormatUtil.luis_date(-1, 1, 1) + end_str = end_str.replace(Constants.TIMEX_FUZZY_YEAR, end_year_str) + + return f'({begin_str},{end_str},{Constants.GENERAL_PERIOD_PREFIX}{total_last_year}{Constants.TIMEX_YEAR})' + + @staticmethod + def generate_week_of_month_timex(year: int, month: int, week_num: int) -> str: + week_timex = TimexUtil.generate_week_timex(week_num) + month_timex = DateTimeFormatUtil.luis_date(year, month, 1) + + return f'{month_timex}-{week_timex}' + + @staticmethod + def generate_week_of_year_timex(year: int, week_num: int) -> str: + week_timex = TimexUtil.generate_week_timex(week_num) + year_timex = DateTimeFormatUtil.luis_date(year, 1, 1) + + return f'{year_timex}-{week_timex}' + + @staticmethod + def generate_weekend_timex(date: datetime = None): + if date is None: + return ( + f'{Constants.TIMEX_FUZZY_YEAR}{Constants.DATE_TIMEX_CONNECTOR}{Constants.TIMEX_FUZZY_WEEK}' + f'{Constants.DATE_TIMEX_CONNECTOR}{Constants.TIMEX_WEEKEND}' + ) + else: + return ( + f'{DateTimeFormatUtil.to_iso_week_timex(date)}{Constants.DATE_TIMEX_CONNECTOR}' + f'{Constants.TIMEX_WEEKEND}' + ) + + @staticmethod + def generate_month_timex(date: datetime = None): + if date is None: + return f'{Constants.TIMEX_FUZZY_YEAR}{Constants.DATE_TIMEX_CONNECTOR}{Constants.TIMEX_FUZZY_MONTH}' + else: + return f'{date.year:D4}{Constants.DATE_TIMEX_CONNECTOR}{date.month:D2}' + + @staticmethod + def generate_duration_timex(number: float, unit_str: str, is_less_than_day: bool) -> str: + if Constants.TIMEX_BUSINESS_DAY != unit_str: + if unit_str == Constants.DECADE_UNIT: + number = number * 10 + unit_str = Constants.TIMEX_YEAR + elif unit_str == Constants.FORTNIGHT_UNIT: + number = number * 2 + unit_str = Constants.TIMEX_WEEK + elif unit_str == Constants.WEEKEND_UNIT: + unit_str = Constants.TIMEX_WEEKEND + else: + unit_str = unit_str[0:1] + + if is_less_than_day: + return Constants.GENERAL_PERIOD_PREFIX + Constants.TIME_TIMEX_PREFIX + str(number) + unit_str + else: + return Constants.GENERAL_PERIOD_PREFIX + str(number) + unit_str + + @staticmethod + def generate_compound_duration_timex( + unit_to_timex_components: Dict[str, str], unit_value_map: Dict[str, str] + ) -> str: + unit_list: List[str] = list(unit_to_timex_components.keys()) + unit_list.sort(key=lambda x: unit_value_map[x]) + + return TimexHelpers.generate_compound_duration_timex(unit_list) + + @staticmethod + def resolve_time_of_day(tod: str) -> TimeOfDayResolution: + result = TimeOfDayResolution() + if tod == Constants.EARLY_MORNING: + result.timex = Constants.EARLY_MORNING + result.begin_hour = Constants.EARLY_MORNING_BEGIN_HOUR + result.end_hour = Constants.EARLY_MORNING_END_HOUR + elif tod == Constants.MORNING: + result.timex = Constants.MORNING + result.begin_hour = Constants.MORNING_BEGIN_HOUR + result.end_hour = Constants.MORNING_END_HOUR + elif tod == Constants.MID_DAY: + result.timex = Constants.MID_DAY + result.begin_hour = Constants.MID_DAY_BEGIN_HOUR + result.end_hour = Constants.MID_DAY_END_HOUR + elif tod == Constants.AFTERNOON: + result.timex = Constants.AFTERNOON + result.begin_hour = Constants.AFTERNOON_BEGIN_HOUR + result.end_hour = Constants.AFTERNOON_END_HOUR + elif tod == Constants.EVENING: + result.timex = Constants.EVENING + result.begin_hour = Constants.EVENING_BEGIN_HOUR + result.end_hour = Constants.EVENING_END_HOUR + elif tod == Constants.DAYTIME: + result.timex = Constants.DAYTIME + result.begin_hour = Constants.DAYTIME_BEGIN_HOUR + result.end_hour = Constants.DAYTIME_END_HOUR + elif tod == Constants.NIGHT: + result.timex = Constants.NIGHTTIME + result.begin_hour = Constants.NIGHTTIME_BEGIN_HOUR + result.end_hour = Constants.NIGHTTIME_END_HOUR + elif tod == Constants.BUSINESS_HOUR: + result.timex = Constants.BUSINESS_HOUR + result.begin_hour = Constants.BUSINESS_BEGIN_HOUR + result.end_hour = Constants.BUSINESS_END_HOUR + elif tod == Constants.NIGHT: + result.timex = Constants.NIGHT + result.begin_hour = Constants.NIGHT_BEGIN_HOUR + result.end_hour = Constants.NIGHT_END_HOUR + elif tod == Constants.MEALTIME_BREAKFAST: + result.timex = Constants.MEALTIME_BREAKFAST + result.begin_hour = Constants.MEAL_TIME_BREAKFAST_BEGIN_HOUR + result.end_hour = Constants.MEAL_TIME_BREAKFAST_END_HOUR + elif tod == Constants.MEALTIME_BRUNCH: + result.timex = Constants.MEALTIME_BRUNCH + result.begin_hour = Constants.MEAL_TIME_BRUNCH_BEGIN_HOUR + result.end_hour = Constants.MEAL_TIME_BRUNCH_END_HOUR + elif tod == Constants.MEALTIME_LUNCH: + result.timex = Constants.MEALTIME_LUNCH + result.begin_hour = Constants.MEAL_TIME_LUNCH_BEGIN_HOUR + result.end_hour = Constants.MEAL_TIME_LUNCH_END_HOUR + elif tod == Constants.MEALTIME_DINNER: + result.timex = Constants.MEALTIME_DINNER + result.begin_hour = Constants.MEAL_TIME_DINNER_BEGIN_HOUR + result.end_hour = Constants.MEAL_TIME_DINNER_END_HOUR + return result diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/token_utils.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/token_utils.py new file mode 100644 index 0000000000..05abe6e8d2 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/utilities/token_utils.py @@ -0,0 +1,90 @@ +from typing import List, Pattern + +import regex + +from recognizers_text.extractor import ExtractResult, Metadata + + +class Token: + def __init__(self, start: int, end: int, metadata: Metadata = None): + self._start: int = start + self._end: int = end + self._metadata = metadata + + @property + def length(self) -> int: + if self._start > self._end: + return 0 + return self._end - self._start + + @property + def start(self) -> int: + return self._start + + @start.setter + def start(self, value) -> int: + self._start = value + + @property + def end(self) -> int: + return self._end + + @end.setter + def end(self, value) -> int: + self._end = value + + @property + def metadata(self): + return self._metadata + + @metadata.setter + def metadata(self, value): + self._metadata = value + + +def merge_all_tokens(tokens: List[Token], source: str, extractor_name: str) -> List[ExtractResult]: + result = [] + + merged_tokens: List[Token] = list() + tokens_ = sorted(filter(None, tokens), key=lambda x: x.start) + + for token in tokens_: + add = True + + for index, m_token in enumerate(merged_tokens): + if not add: + break + + if token.start >= m_token.start and token.end <= m_token.end: + add = False + + if m_token.start < token.start < m_token.end: + add = False + + if token.start <= m_token.start and token.end >= m_token.end: + add = False + merged_tokens[index] = token + + if add: + merged_tokens.append(token) + + for token in merged_tokens: + start = token.start + length = token.length + sub_str = source[start : start + length] + + extracted_result = ExtractResult() + extracted_result.start = start + extracted_result.length = length + extracted_result.text = sub_str + extracted_result.type = extractor_name + extracted_result.data = None + extracted_result.meta_data = token.metadata + + result.append(extracted_result) + + return result + + +def get_tokens_from_regex(pattern: Pattern, source: str) -> List[Token]: + return list(map(lambda x: Token(x.start(), x.end()), regex.finditer(pattern, source))) diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/__init__.py index ebc1a9e158..f15412c265 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/__init__.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/__init__.py @@ -1,12 +1,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from .base_date_time import BaseDateTime +from .arabic_date_time import ArabicDateTime +from .base_date_time import BaseDateTime, BaseDateTimeResource +from .catalan_date_time import CatalanDateTime from .chinese_date_time import ChineseDateTime +from .dutch_date_time import DutchDateTime from .english_date_time import EnglishDateTime from .french_date_time import FrenchDateTime +from .german_date_time import GermanDateTime +from .italian_date_time import ItalianDateTime +from .japanese_date_time import JapaneseDateTime from .portuguese_date_time import PortugueseDateTime from .spanish_date_time import SpanishDateTime -from .italian_date_time import ItalianDateTime -from .german_date_time import GermanDateTime -from .english_time_zone import TimeZoneDefinitions diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/arabic_date_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/arabic_date_time.py new file mode 100644 index 0000000000..12e343f71d --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/arabic_date_time.py @@ -0,0 +1,954 @@ +from .base_date_time import BaseDateTime, BaseDateTimeResource + + +# pylint: disable=line-too-long + + +class ArabicDateTime(BaseDateTimeResource): + LangMarker = 'Ara' + CheckBothBeforeAfter = False + TillRegex = f'(?\\b(إلى|حتى يوم|حتى|خلال|عبر)\\b|{BaseDateTime.RangeConnectorSymbolRegex})' + RangeConnectorRegex = f'(?و|خلال|عبر|{BaseDateTime.RangeConnectorSymbolRegex})' + LastNegPrefix = '(?القادم|التالي|الآتي|الحالي|الماضي|المقبل|الحاضر|السابق|الأخيرالقادم|التالي|الآتي|الحالي|الماضي|المقبل|الحاضر|السابق|الأخير)\\b' + StrictRelativeRegex = '\\b(?القادم|التالي|الآتي|هذا|الحالي|الماضي|السابق|الأخير)\\b' + UpcomingPrefixRegex = '((هذه\\s+)?(المقبل(ة)?))' + NextPrefixRegex = f'\\b(بعد|القادم(ة)?|{UpcomingPrefixRegex})\\b' + AfterNextSuffixRegex = '\\b(after\\s+(the\\s+)?next)\\b' + PastPrefixRegex = '((this\\s+)?past)\\b' + PreviousPrefixRegex = '(الماضي(ة)?|السابق(ة)?)\\b' + ThisPrefixRegex = '(هذه|الحالي(ة)?)\\b' + RangePrefixRegex = '(من|بين)' + CenturySuffixRegex = '(^century)\\b' + ReferencePrefixRegex = '(ذلك|نفس|هذا)\\b' + FutureSuffixRegex = '\\b(الحالي(ة)|القادم(ة)|في المستقبل|التالي(ة)|الآتي(ة)|المقبلين|المقبل(ة))\\b' + PastSuffixRegex = '^\\b$' + DayRegex = '(?(?:3[0-1]|[1-2]\\d|0?[1-9]))' + ImplicitDayRegex = '(the\\s*)?(?(?:3[0-1]|[0-2]?\\d)(?:th|nd|rd|st))\\b' + MonthNumRegex = '(?1[0-2]|(0)?[1-9])\\b' + WrittenOneToNineRegex = '(?:واحد|اثنان|ثلاثة|أربعة|خمسة|ستة|سبعة|ثمانية|تسعة)' + WrittenElevenToNineteenRegex = ( + '(إحدى عشر|إثنى عشر|ثلاثة عشر|أربعة عشر|خمسة عشر|ستة عشر|سبعة عشر|ثمانية عشر|تسعة عشر)' + ) + WrittenTensRegex = '(عشر[وي]ن|ثلاث[وي]ن|أربع[وي]ن|خمس[وي]ن|ست[وي]ن|سبع[وي]ن|ثمان[وي]ن|تسع[وي]ن)' + WrittenNumRegex = ( + f'(?:{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}(\\s+{WrittenOneToNineRegex})?)' + ) + WrittenCenturyFullYearRegex = f'(?(واحد|اثنان\\s*)?((,\\s+|،\\s+)?(الألفين|ألفين|ألفان|ألف))(\\s+و)?(\\s*(ثلاث|أربع|خمس|ست|سبع|ثمان|تسع)\\s*(مائة|مئتان)(\\s+و)?)?)(?({WrittenElevenToNineteenRegex})|(({WrittenOneToNineRegex})?(\\s+و\\s*)?)({WrittenTensRegex})?)?' + WrittenCenturyOrdinalYearRegex = f'(?({WrittenElevenToNineteenRegex}|مائة|مائتين)\\s+((و)\\s*)?({WrittenOneToNineRegex})\\s+(و)\\s*{WrittenTensRegex})' + CenturyRegex = ( + f'\\b(?{WrittenCenturyFullYearRegex}|{WrittenCenturyOrdinalYearRegex}(\\s*مائة)?(\\s*و)?)\\b' + ) + LastTwoYearNumRegex = f'(?:zero\\s+{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}(\\s+{WrittenOneToNineRegex})?)' + FullTextYearRegex = f'(?{CenturyRegex})\\s*(?{LastTwoYearNumRegex})|{WrittenCenturyFullYearRegex}|{WrittenCenturyOrdinalYearRegex}' + OclockRegex = '(?(ال)?ساعة|(ال)?ساعات)' + SpecialDescRegex = '((?)p\\b)' + AmDescRegex = f'(في\\s)?(صباح(ا)?|صباحًا|ص|الصباح|{BaseDateTime.BaseAmDescRegex})' + PmDescRegex = f'(في\\s)?((ال)?مساءً?|ليلًا|ليلا|(ال)?ليل(ة)?|بعد الظهر|الظهر|ظهرا|{BaseDateTime.BasePmDescRegex})' + AmPmDescRegex = f'({BaseDateTime.BaseAmPmDescRegex})' + DescRegex = f'(?:(?:({OclockRegex}\\s+)?(?({AmPmDescRegex}|{AmDescRegex}|{PmDescRegex}|{SpecialDescRegex})|{OclockRegex})))' + OfPrepositionRegex = '(\\bof\\b)' + TwoDigitYearRegex = f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d)))\\b' + YearRegex = f'(?:{BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' + WeekDayRegex = '(?(?=يوم\\s+)?(الأحد|الإثنين|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت|أحد|إثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت))' + SingleWeekDayRegex = '(?(?=يوم\\s+)?(الأحد|الإثنين|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت|أحد|إثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت))' + NextRegex = '(?الآتي|الأخير|التالي|القادم|من الآن|الحالي|المقبل|الحاضر)' + RelativeMonthRegex = f'(?(من\\s+)?(هذا\\s+)?(الشهر|شهر)(\\s+)?({NextRegex})?)' + WrittenMonthRegex = '(((the\\s+)?month of\\s+)?(?apr(il)?|aug(ust)?|dec(ember)?|feb(ruary)?|jan(uary)?|july?|june?|mar(ch)?|may|nov(ember)?|oct(ober)?|sept(ember)?|sept?))' + MonthSuffixRegex = f'(?(?:(in|of|on)\\s+)?({RelativeMonthRegex}|{WrittenMonthRegex}))' + DateUnitRegex = '((?(((ال)?(يوم(ا)?|أسبوع(ا)?|شهر(ا)?|سنة|عام(ا)?|قرن|حقبة))|نهاية الأسبوع))|(?((ال)?(يومان|أسبوعان|شهران|سنتان|عامان|قرنان|حقبتان|يومين|أسبوعين|شهرين|سنتين|عامين|قرنين|حقبتين|يومان|أسبوعان|شهران|سنتان|عامان|قرنان|حقبتان|أيام|أسابيع|أشهر|سنوات|أعوام|حقبات|قرون|سنين|شهور)))|((?<=\\s+\\d{1,4})[ymwd]))\\b' + DateTokenPrefix = 'في ' + TimeTokenPrefix = 'عند ' + TokenBeforeDate = 'في ' + TokenBeforeTime = 'عند ' + HalfTokenRegex = '^(النصف|نصف|والنصف|ونصف)' + QuarterTokenRegex = '^(إلا الربع|إلا ربع|الرُبع|ربع|الربع|وربع|والربع)' + ThreeQuarterTokenRegex = '^(وثلاثة أرباع|ثلاثة أرباع)' + ToTokenRegex = '\\b(إلا|الا)' + ToHalfTokenRegex = '\\b(إلا\\s+(النصف|نصف))$' + ForHalfTokenRegex = '\\b(ل(s+)?(نصف))$' + FromRegex = '\\b(from(\\s+the)?)$' + BetweenTokenRegex = '\\b(between(\\s+the)?)$' + OrdinalNumberRegex = '((ال)?حادي عشر|ل(ال)?ثاني عشر|(ال)?ثالث عشر|(ال)?رابع عشر|(ال)?خامس عشر|(ال)?خمسة عشر|(ال)?سادس عشر|(ال)?سابع عشر|(ال)?ثامن عشر|(ال)?تاسع عشر|(ال)?عشرون|(ال)?عشرين|(ال)?حادي والعشرون|(ال)?حادية والعشرين|(ال)?حادي والعشرين|(ال)?ثاني والعشرون|(ال)?ثانية والعشرين|(ال)?ثالث والعشرون|(ال)?رابع والعشرون|(ال)?خامس والعشرون|(ال)?سادس والعشرون|(ال)?تاسع والعشرون|(ال)?سابع والعشرون|(ال)?رابع والعشرون|الثامن|الأول|الثالث|الرابع|الخامس|السادس|الثاني|العاشر|السابع)' + SolarMonthRegex = '(?يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)' + LunarMonthRegex = ( + '(?محرم|صفر|ربيع الأول|ربيع الثاني|جمادى الأول|جمادى الثاني|رجب|شعبان|رمضان|شوال|ذو القعدة|ذو الحجة)' + ) + ArabicMonthRegex = '(?كانون الثاني|شباط|آذار|نيسان|حزيران|تموز|آب|أيلول|تشرين الأول|تشرين الثاني|شهر فبراير|كانون الأول|أيار|إبريل|اكتوبر)' + SimpleCasePreMonthRegex = f'((بين|من)\\s+)(({DayRegex}-{DayRegex})\\s+)((من|في)\\s+)?((الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})\\s+)({RelativeRegex})?({YearRegex})?' + SimpleCasesRegex = f'(((من)\\s+)?(({DayRegex}|{OrdinalNumberRegex})\\s+)((الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})\\s+)?((حتى|إلى)\\s*)(({DayRegex}|{OrdinalNumberRegex})\\s+)((من هذا|من|هذا|في)\\s+)?(الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})?(\\s+({RelativeRegex}))?(\\s+{YearRegex})?)|({SimpleCasePreMonthRegex})' + MonthFrontSimpleCasesRegex = f'(((شهر\\s+)?{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})\\s+(بين|من)\\s+({DayRegex}|{OrdinalNumberRegex})\\s+[و]\\s*({DayRegex}|{OrdinalNumberRegex}))|({DayRegex}\\s*[-\\./]\\s*{DayRegex}\\s+{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})' + MonthFrontBetweenRegex = f'\\b{MonthSuffixRegex}\\s+(between\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' + BetweenRegex = f'((بين|من)\\s+)(({DayRegex}|{OrdinalNumberRegex})\\s*)((الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})\\s+)?((حتى|إلى|و|-)\\s*)(({DayRegex}|{OrdinalNumberRegex})\\s+)((من هذا|من|هذا|في)\\s+)?(الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})?(\\s*([,،-])\\s*)?(\\s*({RelativeRegex}))?(\\s+{YearRegex})?' + MonthWithYear = f'((هذا\\s+)?(شهر\\s+)?({SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})[\\.]?(\\s*)[/\\\\\\-\\.,]?(\\s*(من عام|من|في|عام))?(\\s*)({YearRegex}))|(({SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})\\s+(هذا\\s+)?((عام|العام)\\s+)?({RelativeRegex})?)' + SpecialYearPrefixes = '(التقويمي(ة)?|(?المالي(ة)?|الدراسي(ة)?))' + ArabicWeekRegex = '(?الأسبوعين|الاسبوعين|أسابيع|الاسبوع|الأسبوع|الإسبوع|أسبوعين|أسبوعي|اسبوعين|اسبوعي|أسبوع|الاسابيع|الأسابيع)' + OneWordPeriodRegex = f'((بعد|في|آخر)\\s+(\\d+\\s+)?((ال)?سنوات|(ال)?أعوام|(ال)?سنين|(ال)?أسابيع|(ال)?أشهر|(ال)?أيام))(\\s+\\d+)?(\\s+{FutureSuffixRegex})?|((هذا\\s+)?(شهر\\s+)?(الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})(\\s+{RelativeRegex})?)|((هذا\\s+)?((عطلة|خلال)\\s+)?((نهاية\\s+)?({ArabicWeekRegex}|العام)\\s*)((بعد\\s+)?{RelativeRegex})?)' + MonthNumWithYear = f'\\b(({BaseDateTime.FourDigitYearRegex}(\\s*)[/\\-\\.](\\s*){MonthNumRegex})|({MonthNumRegex}(\\s*)[/\\-](\\s*){BaseDateTime.FourDigitYearRegex}))\\b' + WeekOfMonthRegex = f'(\\b(?(الأسبوع)\\s+((?الأول|الثاني|الثالث|الرابع|الخامس|الأخير)\\s+)((من هذا|هذا|من)\\s+)?(شهر\\s+)?(الشهر|{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})[,]?(\\s+{YearRegex})?)\\b)|(((الأسبوع|أسبوع)\\s+)(في\\s+)?{DayRegex}\\s+({SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex}))' + WeekOfYearRegex = f'(?(الأسبوع)\\s+(?الأول|الثاني|الثالث|الرابع|الخامس|الأخير)\\s+((من هذا|هذا|من)\\s+)?(العام|من عام|عام)\\s*({YearRegex}|{RelativeRegex})?)' + OfYearRegex = f'\\b((of|in)\\s+({YearRegex}|{StrictRelativeRegex}\\s+year))\\b' + FirstLastRegex = '\\b(the\\s+)?((?first)|(?last))\\b' + FollowedDateUnit = f'^\\s*{DateUnitRegex}' + NumberCombinedWithDateUnit = f'\\b(?\\d+(\\.\\d*)?)(\\s)?(-)?{DateUnitRegex}' + QuarterTermRegex = '(الربع[- ]+(?الأول|الثاني|الثالث|الرابع))' + RelativeQuarterTermRegex = f'\\b(الربع)\\s+(?{StrictRelativeRegex})\\b' + QuarterRegex = ( + f'({YearRegex}\\s+)?({QuarterTermRegex})(((\\s+(من عام|من))?\\s+({YearRegex}))|(\\s+(هذا|من هذا|)\\s+العام))?' + ) + QuarterRegexYearFront = ( + f'(?:{YearRegex}|{RelativeRegex}\\s+year)(\'s)?(?:\\s*-\\s*|\\s+(the\\s+)?)?{QuarterTermRegex}' + ) + HalfYearTermRegex = '(?first|1st|second|2nd)\\s+half' + HalfYearFrontRegex = '(?((1[5-9]|20)\\d{2})|2100)(\\s*-\\s*|\\s+(the\\s+)?)?h(?[1-2])' + HalfYearBackRegex = f'(the\\s+)?(h(?[1-2])|({HalfYearTermRegex}))(\\s+of|\\s*,\\s*)?\\s+({YearRegex})' + HalfYearRelativeRegex = f'(the\\s+)?{HalfYearTermRegex}(\\s+of|\\s*,\\s*)?\\s+({RelativeRegex}\\s+year)' + AllHalfYearRegex = f'({HalfYearFrontRegex})|({HalfYearBackRegex})|({HalfYearRelativeRegex})' + EarlyPrefixRegex = '\\b(?بداية|مطلع|وقت مبكر|(?قبل))\\b' + MidPrefixRegex = '\\b(?في منتصف|منتصف)\\b' + LaterPrefixRegex = '\\b(?نهاية|باقي|بقية|أواخر|(?في وقت لاحق|لاحقا في|بعد))\\b' + PrefixPeriodRegex = f'({EarlyPrefixRegex}|{MidPrefixRegex}|{LaterPrefixRegex}|{RelativeRegex})' + PrefixDayRegex = ( + '\\b((?early)|(?mid(dle)?)|(?later?))(\\s+in)?(\\s+the\\s+day)?$' + ) + SeasonDescRegex = '(?(ال)?ربيع|(ال)?صيف|(ال)?خريف|(ال)?شتاء)' + SeasonRegex = f'\\b(?(هذا\\s+)?(منتصف\\s+)?(({SeasonDescRegex})(\\s+{PrefixPeriodRegex})?(\\s*عام\\s*)?(\\s*{YearRegex})?))\\b' + WhichWeekRegex = '\\b(week)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])\\b' + WeekOfRegex = '(the\\s+)?((week)(\\s+(of|(commencing|starting|beginning)(\\s+on)?))|w/c)(\\s+the)?' + MonthOfRegex = '(من)(\\s*)(شهر)' + MonthRegex = f'(?{SolarMonthRegex}|{LunarMonthRegex}|{ArabicMonthRegex})' + DateYearRegex = f'(?{BaseDateTime.FourDigitYearRegex}|(?{WrittenNumRegex})\\s+days?\\s+from\\s+(?yesterday|tomorrow|tmr|today))\\b' + ) + RelativeDayRegex = f'\\b(((the\\s+)?{RelativeRegex}\\s+day)|{ArabicRelativeDateRegex})\\b' + WeekDayOfMonthRegex = f'(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+(week\\s+{MonthSuffixRegex}[\\.]?\\s+(on\\s+)?{WeekDayRegex}|{WeekDayRegex}\\s+{MonthSuffixRegex}))' + RelativeWeekDayRegex = f'\\b({WrittenNumRegex}\\s+{WeekDayRegex}\\s+(from\\s+now|later))\\b' + SpecialDate = f'(?=\\b(on|at)\\s+the\\s+){DayRegex}\\b' + DatePreposition = '\\b(في|عند|من)' + DateExtractorYearTermRegex = f'(\\s+|\\s*,\\s*|\\s+من\\s+){DateYearRegex}' + CardinalDayRegex = '(?=يوم\\s+)?((ال|لل|ل)?عاشر|(ال|لل|ل)?حادي(ة)? و(ال)?عشر[يو]ن|واحد و(ال)?عشر[يو]ن|(ال|لل|ل)?ثاني(ة)? و(ال)?عشر[يو]ن|(ال|لل|ل)?ثالث(ة)? و(ال)?عشر[يو]ن|(ال|لل|ل)?رابع(ة)? و(ال)?عشر[يو]ن|(ال|لل|ل)?خامس(ة)? و(ال)?عشر[يو]ن|(ال|لل|ل)?سادس(ة)? و(ال)?عشر[يو]ن|(ال|لل|ل)?سابع(ة)? و(ال)?عشر[يو]ن|(ال|لل|ل)?ثامن(ة)? و(ال)?عشر[يو]ن|(ال|لل|ل)?تاسع(ة)? و(ال)?عشر[يو]ن|(ال|لل|ل)?ثلاثين|(ال|لل|ل)?حادي(ة)? والثلاثين|(ال|لل|ل)?أول|(ال|لل|ل)?ثاني|(ال|لل|ل)?ثالث|(ال|لل|ل)?رابع|(ال|لل|ل)?خامس|(ال|لل|ل)?سادس|(ال|لل|ل)?سابع|(ال|لل|ل)?ثامن|(ال|لل|ل)?تاسع)' + DateExtractor1 = f'({CardinalDayRegex})(\\s+يوم\\s+)({WeekDayRegex})(\\s+)(في|من)(\\s+)(هذا|هذه)?(\\s+)?(الشهر|{MonthRegex})({DateExtractorYearTermRegex}\\b)?' + DateExtractor3 = f'\\b(يوم\\s+)?({WeekDayRegex}(\\s+|\\s*,\\s*|\\s*،\\s*))?({DayRegex}|{CardinalDayRegex})[\\.]?(\\s+|\\s*,\\s*|\\s+من\\s+|\\s*-\\s*)?{MonthRegex}[\\.]?((\\s+(في|عند|عام|سنة|من عام|من سنة))?{DateExtractorYearTermRegex})?\\b' + DateExtractor4 = f'\\b{MonthNumRegex}\\s*[/\\\\\\-]\\s*{DayRegex}[\\.]?\\s*[/\\\\\\-]\\s*{DateYearRegex}' + DateExtractor5 = f'\\b{DayRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DateYearRegex}(?!\\s*[/\\\\\\-\\.]\\s*\\d+)' + DateExtractor6 = f'(?<={DatePreposition}\\s+)({StrictRelativeRegex}\\s+)?({WeekDayRegex}\\s+)?{MonthNumRegex}[\\-\\.]{DayRegex}(?![%])\\b' + DateExtractor7L = ( + f'\\b({WeekDayRegex}\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}{DateExtractorYearTermRegex}(?![%])\\b' + ) + DateExtractor7S = f'({MonthRegex}\\s*[-\\./]\\s*{DayRegex})|(\\b({WeekDayRegex}\\s+)?{MonthNumRegex}\\s*[/\\.]\\s*{DayRegex}(?![%])\\b)' + DateExtractor8 = f'(?<={DatePreposition}\\s+)({StrictRelativeRegex}\\s+)?({WeekDayRegex}\\s+)?{DayRegex}[\\\\\\-]{MonthNumRegex}(?![%])\\b' + DateExtractor9L = ( + f'\\b({WeekDayRegex}\\s+)?{DayRegex}\\s*/\\s*{MonthNumRegex}{DateExtractorYearTermRegex}(?![%])\\b' + ) + DateExtractor9S = f'\\b({WeekDayRegex}\\s+)?{DayRegex}\\s*[/-]\\s*{MonthNumRegex}(?![%])\\b' + DateExtractorA = f'\\b({WeekDayRegex}\\s+)?{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DayRegex}' + DateExtractorB = f'(?:(?<=إلى|لل|يوم)\\s*)({DayRegex})(?![\\./-]\\d|\\d)' + OfMonth = f'^\\s*(يوم\\s+)?من\\s*{MonthRegex}' + MonthEnd = f'{MonthRegex}\\s*(في)?\\s*$' + WeekDayEnd = f'(هذا\\s+)?{WeekDayRegex}\\s*[,،]?\\s*$' + WeekDayStart = '^[\\.]' + RangeUnitRegex = '\\b(?years?|months?|weeks?)\\b' + HourNumRegex = '\\b(?الأولى|ثمانية|الثانيه|خمسة|الخمسة|ستة|الستة|السبعة|سبعة|أربعة|الحاديه عشر|(ال)?واحدة|(ال)?ثالثة|(ال)?رابعة|(ال)?خامسة|(ال)?سادسة|(ال)?سابعة|(ال)?ثامنة|(ال)?تاسعة|(ال)?عاشرة|(ال)?حادية عشر(ة)?|الثانية(?!\\s*عشر)|(ال)?ثانية عشر(ة)?|خمسة عشر|اثنين|أحد عشر|تسعة|الوَاحِدَة)\\b' + MinuteNumRegex = '\\b(?(واحد|اثنان|ثلاثة|أربعة|خمسة|ستة|سبعة|ثمانية|تسعة|إحدى|اثنين|الثالثة|الرابعة|أربع|خمس|الخامسة|ست|السادسة|سبع|تسع|الثامنة|السابعة|ثلاث|دقيقتين)\\b((\\s*و?\\s*)(عشرون|ثلاثون|أربعون|خمسون|خَمْسُونَ|عشرين|ثلاثين|عشر|عشرة|العشرون|أربعين|خمسين|وثلاثون))?\\b|(أَحَدَ عَشَرَ|اِثْنَا عَشَرَ|ثَلَاثَةَ عَشَرَ|أَرْبَعَةَ عَشَرَ|خَمْسَةَ عَشَرَ|سِتَّةَ عَشَرَ|سَبْعَةَ عَشَرَ|ثَمَانِيَةَ عَشَرَ|تِسْعَةَ عَشَرَ|عشرون|ثلاثون|أربعون|خمسون|خَمْسُونَ|عشرين|ثلاثين|عشر|عشرة|خمس عشرة|أربعين|خمسين|وثلاثون|دقيقتان|واحدة))\\b' + DeltaMinuteNumRegex = '(?(واحد|اثنان|ثلاثة|أربعة|خمسة|ستة|سبعة|ثمانية|تسعة|إحدى|اثنين|الثالثة|الرابعة|أربع|خمس|الخامسة|ست|السادسة|سبع|تسع|الثامنة|السابعة|ثلاث|دقيقتين)\\b((\\s*و?\\s*)(عشرون|ثلاثون|أربعون|خمسون|خَمْسُونَ|عشرين|ثلاثين|عشر|عشرة|العشرون|أربعين|خمسين|وثلاثون))?\\b|(أَحَدَ عَشَرَ|اِثْنَا عَشَرَ|ثَلَاثَةَ عَشَرَ|أَرْبَعَةَ عَشَرَ|خَمْسَةَ عَشَرَ|سِتَّةَ عَشَرَ|سَبْعَةَ عَشَرَ|ثَمَانِيَةَ عَشَرَ|تِسْعَةَ عَشَرَ|عشرون|ثلاثون|أربعون|خمسون|خَمْسُونَ|عشرين|ثلاثين|عشر|عشرة|خمس عشرة|أربعين|خمسين|وثلاثون|دقيقتان|واحدة))' + PmRegex = '(?(?:(في|حول)\\s|ل)?(وقت\\s)?(بعد الظهر|بعد الظهيرة|(ال)?مساءً?|منتصف(\\s|-)الليل|الغداء|الليل|ليلا))' + PmRegexFull = ( + '(?(?:(في|حول)\\s|ل)?(وقت\\s)?(بعد الظهر|بعد الظهيرة|(ال)?مساءً?|منتصف(\\s|-)الليل|الغداء|الليل|ليلا))' + ) + AmRegex = '(?(?:(في|حول)\\s|ل)?(وقت\\s)?((ال)?صباح|صباحا|صباحًا))' + LunchRegex = '\\b(موعد الغذاء|وقت الغذاء)\\b' + NightRegex = '\\bمنتصف(\\s|-)الليل\\b' + CommonDatePrefixRegex = '^[\\.]' + LessThanOneHour = f'(?((ال)?ربع|ثلاثة أرباع|(ال)?نصف|الرُبع)|({BaseDateTime.DeltaMinuteRegex}(\\s(دقيقة|دقائق))?)|((و)?{DeltaMinuteNumRegex}(\\s(دقيقة|دقائق))?))' + WrittenTimeRegex = f'(?((ال)?ساعة\\s)?{HourNumRegex}\\s+(و(\\s)?)?({MinuteNumRegex}|({MinuteNumRegex}\\s+(و(\\s)?)?(?عشرون|ثلاثون|أربعون|خمسون|عشرين|ثلاثين|أربعين|خمسين))))' + TimePrefix = f'(?(إلا|الا|حتى|و|قبل)?(\\s)?{LessThanOneHour})' + TimeSuffix = f'(?{AmRegex}|{PmRegex}|{OclockRegex})' + TimeSuffixFull = f'(?{AmRegex}|{PmRegexFull}|{OclockRegex})' + BasicTime = f'\\b(?{HourNumRegex}|({MinuteNumRegex}(\\s(دقيقة|دقائق))?)|{BaseDateTime.HourRegex}:{BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|{BaseDateTime.HourRegex}(?![%\\d])|{WrittenTimeRegex})' + MidnightRegex = '(?منتصف(\\s|(\\s?-\\s?))الليل)' + MidmorningRegex = '(?منتصف(\\s|(\\s?-\\s?))الصباح)' + MidafternoonRegex = '(?منتصف(\\s|(\\s?-\\s?))بعد الظهر)' + MiddayRegex = '(?(وقت الغداء\\s)?(منتصف(\\s|(\\s?-\\s?)))?(النهار|(الساعة\\s)?((?:12\\s)?(الظهر|ظهرًا|الظهيرة|ظهرا)))(\\sوقت الغداء)?)' + MidTimeRegex = f'(?({MidnightRegex}|{MidmorningRegex}|{MidafternoonRegex}|{MiddayRegex}))' + AtRegex = f'\\b(?:(?:(?<=\\bفي\\s+)?(?:{WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}(?!\\.\\d)|{MidTimeRegex}))|{MidTimeRegex})\\b' + IshRegex = f'\\b((({BaseDateTime.HourRegex}|{WrittenTimeRegex})(\\s|-))?(وقت\\s)?((الظهيرة|الظهر|ظهر(ا|اً))))\\b' + TimeUnitRegex = '([^A-Za-z]{1,}|\\b)((?((ال)?(ساعة|دقيقة|ثانية)))|(?((ال)?(ساعات|دقائق|ثوان|ساعتين|دقيقتين|ثانيتين|ساعتان|دقيقتان|ثانيتان))))\\b' + RestrictedTimeUnitRegex = '(?(ال)?ساعة|(ال)?دقيقة)\\b' + FivesRegex = '(?(?:fifteen|(?:twen|thir|fou?r|fif)ty(\\s*five)?|ten|five))\\b' + HourRegex = f'\\b{BaseDateTime.HourRegex}' + PeriodHourNumRegex = '(?((واحد|اثنان|اثنين|إثنين|ثلاثة|أربعة|إثنان)?(و(\\s+)?(عشرون|عشرين)))|أحد عشر|إثني عشر|((ثلاثة|خمسة|ثمانية|أربعة|ستة|سبعة|تسعة)(عشر)?)|صفر|واحد|اثنان|إثنان|ثنان|اثنين|عشرة|الأولى|(ال)?واحدة|(ال)?ثانية|(ال)?ثالثة|(ال)?رابعة|(ال)?خامسة|(ال)?سادسة|(ال)?سابعة|(ال)?ثامنة|(ال)?تاسعة|(ال)?عاشرة|(ال)?حادية عشر(ة)?|(ال)?ثانية عشر(ة)?|خمسة عشر)' + ConnectNumRegex = f'\\b{BaseDateTime.HourRegex}(?[0-5][0-9])\\s*{DescRegex}' + TimeRegexWithDotConnector = f'({BaseDateTime.HourRegex}(\\s*\\.\\s*){BaseDateTime.MinuteRegex})' + TimeRegex1 = f'\\b({TimePrefix}\\s+)?({HourNumRegex}|{BaseDateTime.HourRegex})(\\s*|[.]){DescRegex}|{WrittenTimeRegex}(\\s{TimePrefix})?' + TimeRegex2 = f'(\\b{TimePrefix}\\s+)?(t)?{BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?{BaseDateTime.SecondRegex})?(?a)?((\\s*{DescRegex})|\\b)' + TimeRegex3 = f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}\\.{BaseDateTime.MinuteRegex}(\\s*{DescRegex})' + TimeRegex4 = f'\\b({TimePrefix}\\s+)?{BasicTime}(\\s*{DescRegex})?(\\s+{TimeSuffix})?(\\s*{DescRegex})?\\b' + TimeRegex5 = f'\\b({DescRegex}\\s)?{BasicTime}((\\s*{DescRegex})((\\s+{TimePrefix})?)|(\\s+{TimePrefix}(\\s+{TimePrefix})?))(\\s{DescRegex})?' + TimeRegex6 = f'{BasicTime}(\\s*{DescRegex})?\\s+{TimeSuffix}\\b' + TimeRegex7 = f'\\b({DescRegex}\\s)?(وقت الغداء\\s)?{TimeSuffixFull}\\s+(في\\s+)?{BasicTime}(\\s{DescRegex})?(\\sوقت الغداء)?(\\s{TimePrefix})?((\\s*{DescRegex})|\\b)?' + TimeRegex8 = '.^' + TimeRegex9 = f'\\b{PeriodHourNumRegex}(\\s+|-){FivesRegex}((\\s*{DescRegex})|\\b)' + TimeRegex10 = ( + f'\\b({TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' + ) + TimeRegex11 = f'\\b((?:({TimeTokenPrefix})?{TimeRegexWithDotConnector}(\\s*{DescRegex}))|(?:(?:{TimeTokenPrefix}{TimeRegexWithDotConnector})(?!\\s*per\\s*cent|%)))' + FirstTimeRegexInTimeRange = f'\\b{TimeRegexWithDotConnector}(\\s*{DescRegex})?' + PureNumFromTo = f'({RangePrefixRegex}\\s+)?(الساعة\\s+)?(({BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex})|{HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?\\s*{TillRegex}\\s*(\\s+الساعة\\s+)?(({BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex})|{HourRegex}|{PeriodHourNumRegex})(\\s+{TimePrefix})?(?\\s*({PmRegex}|{AmRegex}|{DescRegex}))?(\\s+اليوم)?' + PureNumBetweenAnd = f'(بين\\s+)(الساعة\\s+)?(({BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex})|{HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?\\s*{RangeConnectorRegex}(\\s*)?(\\s+الساعة\\s+)?(({BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex})|{HourRegex}|{PeriodHourNumRegex})(\\s+{TimePrefix})?(?\\s*({PmRegex}|{AmRegex}|{DescRegex}))?(\\s+اليوم)?' + SpecificTimeFromTo = f'({RangePrefixRegex}\\s+)?(الساعة\\s+)?(?(({BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex})|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{TillRegex}\\s*(\\s+الساعة\\s+)?(?(({TimeRegexWithDotConnector}(?\\s*{DescRegex}))|({BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex})|({HourRegex}|{PeriodHourNumRegex})(\\s+{TimePrefix})?(\\s*(?{DescRegex}))?))(\\s+اليوم)?' + SpecificTimeBetweenAnd = f'(بين\\s+)(الساعة\\s+)?(?(({BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex})|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{RangeConnectorRegex}(\\s*)?(\\s+الساعة\\s+)?(?(({TimeRegexWithDotConnector}(?\\s*{DescRegex}))|(({BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex})|{HourRegex}|{PeriodHourNumRegex})(\\s+{TimePrefix})?(\\s*(?{DescRegex}))?))(\\s+اليوم)?' + SuffixAfterRegex = '\\b(((at)\\s)?(or|and)\\s+(above|after|later|greater)(?!\\s+than))\\b' + PrepositionRegex = '(?^(at|on|of)(\\s+the)?$)' + LaterEarlyRegex = ( + '((?(\\s+|-)الباكر)|(?وقت متأخر(\\s+|-))|أواخر(\\s+|-)|وقت مبكر(\\s+|-)|أول(\\s+|-)|آخر(\\s+|-))' + ) + MealTimeRegex = '\\b((في|عند)\\s+)?(وقت\\s)?(?(ال)?إفطار|(ال)?فطور|(ال)?عشاء|(ال)?غذاء)\\b' + UnspecificTimePeriodRegex = f'({MealTimeRegex})' + TimeOfDayRegex = f'\\b(?((((في|عند)\\s+)?{LaterEarlyRegex}?(من\\s+)?(الصباح|بعد الظهر|الليل|المساء|الأمسيات){LaterEarlyRegex}?)|{MealTimeRegex}|(((في|عند|خلال)\\s+)?(النهار|((ساعة|ساعات)(\\s)?العمل)))))\\b' + SpecificTimeOfDayRegex = f'\\b(({StrictRelativeRegex}\\s+{TimeOfDayRegex})\\b|\\btoni(ght|te))s?\\b' + TimeFollowedUnit = f'^\\s*{TimeUnitRegex}' + TimeNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?)(\\s)?(-)?{TimeUnitRegex}' + BusinessHourSplitStrings = [r'business', r'hour'] + NowRegex = '\\b(?الآن|حالا|في هذه اللحظة|توا|على التو)\\b' + NowParseRegex = f'\\b({NowRegex}|^(date)$)\\b' + SuffixRegex = '^\\s*(in the\\s+)?(morning|afternoon|evening|night)\\b' + NonTimeContextTokens = '(building)' + DateTimeTimeOfDayRegex = '\\b(?morning|(?afternoon|night|evening))\\b' + DateTimeSpecificTimeOfDayRegex = f'\\b(({RelativeRegex}\\s+{DateTimeTimeOfDayRegex})\\b|\\btoni(ght|te))\\b' + TimeOfTodayAfterRegex = f'^\\s*(,\\s*)?(in\\s+)?{DateTimeSpecificTimeOfDayRegex}' + TimeOfTodayBeforeRegex = f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(at|around|in|on))?\\s*$' + SimpleTimeOfTodayAfterRegex = f'(?{DateUnitRegex}|(ال)?ساعة|(ال)?ساعات|(ال)?دقيقة|(ال)?دقائق|(ال)?ثانية|(ال)?ثوان|(ال)?ليلة|(ال)?ليال)|ساعت(ين)?(ان)?|دقيقت(ين)?(ان)?|ثانيت(ين)?(ان)?|ليلت(ين)?(ان)?\\b' + SuffixAndRegex = '(?\\s*(و)\\s+(?نصف|ربع))' + DurationFollowedUnit = ( + f'(^\\s*{DurationUnitRegex}\\s+{SuffixAndRegex})|(^\\s*{SuffixAndRegex}?\\s+?{DurationUnitRegex})' + ) + NumberCombinedWithDurationUnit = f'((?\\d+(\\.\\d*)?(\\s)?)?({DurationUnitRegex})(\\s{WrittenOneToNineRegex})?(\\sو)?(\\s)?(?\\d+(\\.\\d*)?(\\s)?)?(({DurationUnitRegex})?(\\s{WrittenOneToNineRegex})?)(\\sو)?(\\s)?(?\\d+(\\.\\d*)?(\\s)?)?({DurationUnitRegex})(\\s{WrittenOneToNineRegex})?)' + AnUnitRegex = f'\\b((?(1/2|½|نصف)))\\s+{DurationUnitRegex}(\\s(أخرى))?' + DuringRegex = '\\b((((خلال|على مدى|مدة)\\s)|ل)+)(?(ال)?عام(ين)?|(ال)?سنتين|(ال)?سنة|(ال)?شهر(ين)?|الأشهر|(ال)?أسبوع(ين)?|(ال)?يوم(ين)?)\\b' + AllRegex = '(?(طوال\\s+))?(?(ال)?عام|(ال)?سنة|(ال)?شهر|(ال)?أسبوع|(ال)?أسابيع|(ال)?أيام|(ال)?يوم)(?(\\s+كامل(ة)?))?' + HalfRegex = '\\b((نصف)\\s+)?(?(ال)?ساعة|ساعتين|دقيقة|دقيقتين|ثانية|ثانيتين|(ال)?عام(ين)?|(ال)?سنة|(ال)?شهر(ين)?|(ال)?أسبوع(ين)?|(ال)?يوم(ين)?)(?(\\s+)?(و)?نصف)?\\b' + ConjunctionRegex = '\\b((و(\\s+ل)?)|مع)\\b' + ArabicThisYearRegex = '(\\s*)?(هذا|هذه)?(لعام|عام|العام|سنة)?(\\s*)?' + ArabicEidDay = '?(يوم |عيد |ليلة | ليل)?(?=\\s*)' + HolidayList1 = f'((?=\\s*){ArabicEidDay}(إثنين الرماد|رأس السنة الهجرية|الحج|يواندان|الفطر|رأس السنة الجديدة|الأضحى|الأب|الشكر|عيد الميلاد|المولد النبوي|الفصح)(){ArabicThisYearRegex}(العام|السنة)?({YearRegex})?({RelativeRegex})?)' + HolidayList2 = f'((?=\\s*){ArabicEidDay}(الشباب|الأطفال|الفتيات|العشاق|الأرض|الافتتاح|جرذ الأرض|الحب|الذكرى|الخريف|القمر|الربيع|الفانوس)(){ArabicThisYearRegex}(العام|السنة)?({YearRegex})?({RelativeRegex})?)' + HolidayList3 = f'((?=\\s*){ArabicEidDay}(حقوق الإنسان|العالمي للأعمال الخيرية|يوم التحرير الأفريقي|حرية الصحافة العالمية|الاستقلال|الرؤساء|كل الأرواح|الشجرة|مارتن لوثر كينج| هالوين|العمال العالمي|الأم)(){ArabicThisYearRegex}(العام|السنة)?({YearRegex})?({RelativeRegex})?)' + HolidayRegex = f'({HolidayList1})|({HolidayList2})|({HolidayList3})' + AMTimeRegex = '(?morning)' + PMTimeRegex = '\\b(?afternoon|evening|night)\\b' + NightTimeRegex = '(night)' + NowTimeRegex = '(الآن|حالا|في هذه اللحظة|توا|على التو)' + RecentlyTimeRegex = '(مؤخرًا|سابقًا)' + AsapTimeRegex = '(في أسرع وقت ممكن)' + InclusiveModPrepositions = '(?((on|in|at)\\s+or\\s+)|(\\s+or\\s+(on|in|at)))' + AroundRegex = '(?:\\b(?:around|circa)\\s*?\\b)(\\s+the)?' + BeforeRegex = f'((\\b{InclusiveModPrepositions}?(?:before|in\\s+advance\\s+of|prior\\s+to|(no\\s+later|earlier|sooner)\\s+than|ending\\s+(with|on)|by|(un)?till?|(?as\\s+late\\s+as)){InclusiveModPrepositions}?\\b\\s*?)|(?)((?<\\s*=)|<))(\\s+the)?' + AfterRegex = f'((\\b{InclusiveModPrepositions}?((after|(starting|beginning)(\\s+on)?(?!\\sfrom)|(?>\\s*=)|>))(\\s+the)?' + SinceRegex = '(?:(?:\\b(?:since|after\\s+or\\s+equal\\s+to|starting\\s+(?:from|on|with)|as\\s+early\\s+as|(any\\s+time\\s+)from)\\b\\s*?)|(?=))(\\s+the)?' + SinceRegexExp = f'({SinceRegex}|\\bfrom(\\s+the)?\\b)' + AgoRegex = '\\b(ago|before\\s+(?yesterday|today))\\b' + LaterRegex = f'\\b(?:later(?!((\\s+in)?\\s*{OneWordPeriodRegex})|(\\s+{TimeOfDayRegex})|\\s+than\\b)|من الآن|من الان|(from|after)\\s+(?tomorrow|tmr|today))\\b' + BeforeAfterRegex = '\\b((?before)|(?from|after))\\b' + ModPrefixRegex = f'\\b({RelativeRegex}|{AroundRegex}|{BeforeRegex}|{AfterRegex}|{SinceRegex})\\b' + ModSuffixRegex = f'\\b({AgoRegex}|{LaterRegex}|{BeforeAfterRegex}|{FutureSuffixRegex}|{PastSuffixRegex})\\b' + InConnectorRegex = '\\b(in)\\b' + SinceYearSuffixRegex = f'(^\\s*{SinceRegex}(\\s*(the\\s+)?year\\s*)?{YearSuffix})' + WithinNextPrefixRegex = f'\\b(within(\\s+the)?(\\s+(?{NextPrefixRegex}))?)\\b' + TodayNowRegex = '\\b(today|now)\\b' + MorningStartEndRegex = f'(^(morning|{AmDescRegex}))|((morning|{AmDescRegex})$)' + AfternoonStartEndRegex = f'(^(afternoon|{PmDescRegex}))|((afternoon|{PmDescRegex})$)' + EveningStartEndRegex = '(^(evening))|((evening)$)' + NightStartEndRegex = '(^(over|to)?ni(ght|te))|((over|to)?ni(ght|te)$)' + InexactNumberRegex = 'بضع(ة)?|عدة|(?((ل))?عدد(\\s+من)?)' + InexactNumberUnitRegex = f'({InexactNumberRegex})\\s+({DurationUnitRegex})|(في\\s+)?((ال)?يومين|(ال)?أيام|(ال)?أسابيع|(ال)?أشهر|(ال)?سنوات|(ال)?أعوام|(ال)?سنين)\\s+(العديدة|القليلة|الثلاثة|الأربعة|الخمسة|الستة|السبعة|الثمانية|التسعة|العشرة)' + RelativeTimeUnitRegex = f'(?:(?:(?:{NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+({TimeUnitRegex}))|((the|my))\\s+({RestrictedTimeUnitRegex}))' + RelativeDurationUnitRegex = f'(?:(?:(?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+)({DurationUnitRegex}))|((the|my))\\s+({RestrictedTimeUnitRegex}))' + ReferenceDatePeriodRegex = f'\\b{ReferencePrefixRegex}\\s+(?week|month|year|decade|weekend)\\b' + ConnectorRegex = '^(-|,|for|t|around|@)$' + FromToRegex = '(\\b(from).+(to|and|or)\\b.+)' + SingleAmbiguousMonthRegex = '^(the\\s+)?(may|march)$' + SingleAmbiguousTermsRegex = '^(the\\s+)?(day|week|month|year)$' + UnspecificDatePeriodRegex = '^(week|month|year)$' + PrepositionSuffixRegex = '\\b(on|in|at|around|from|to)$' + FlexibleDayRegex = '(?([A-Za-z]+\\s)?[A-Za-z\\d]+)' + ForTheRegex = f'\\b((((?<=for\\s+)the\\s+{FlexibleDayRegex})|((?<=on\\s+)(the\\s+)?{FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.(?!\\d)|!|\\?|$)))' + WeekDayAndDayOfMonthRegex = f'\\b{WeekDayRegex}\\s+(the\\s+{FlexibleDayRegex})\\b' + WeekDayAndDayRegex = ( + f'\\b{WeekDayRegex}\\s+(?!(the)){DayRegex}(?!([-:]|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' + ) + RestOfDateRegex = '\\b(باقي|بقية)\\s+(?الشهر|العام|الأسبوع|العقد)\\b' + RestOfDateTimeRegex = '\\b(rest|remaining)\\s+(of\\s+)?((the|my|this|current)\\s+)?(?day)\\b' + AmbiguousRangeModifierPrefix = '(from)' + NumberEndingPattern = f'^(?:\\s+(?meeting|appointment|conference|((skype|teams|zoom|facetime)\\s+)?call)\\s+to\\s+(?{PeriodHourNumRegex}|{HourRegex})([\\.]?$|(\\.,|,|!|\\?)))' + OneOnOneRegex = '\\b(1\\s*:\\s*1(?!\\d))|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b' + LaterEarlyPeriodRegex = f'(\\b(({PrefixPeriodRegex})\\s*\\b\\s*(?{OneWordPeriodRegex}|(?{BaseDateTime.FourDigitYearRegex}))|({UnspecificEndOfRangeRegex}))\\b)|({PrefixPeriodRegex}\\s+(من هذا|من|هذا)\\s+(الشهر|الأسبوع|العام|الاسبوع)(\\s+{PrefixPeriodRegex})?)' + WeekWithWeekDayRangeRegex = f'\\b(?(هذا\\s+)?(الأسبوع)\\s+(({NextPrefixRegex}|{PreviousPrefixRegex})\\s+)?)(((بين)\\s+{WeekDayRegex}\\s+(و)\\s*{WeekDayRegex})|(من)\\s+{WeekDayRegex}\\s+(إلى)\\s+{WeekDayRegex})\\b' + GeneralEndingRegex = '^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$' + MiddlePauseRegex = '\\s*(,)\\s*' + DurationConnectorRegex = '^\\s*(?\\s+|و|،|,)\\s*$' + PrefixArticleRegex = '\\bإلى\\s+' + OrRegex = '\\s*((\\b|,\\s*)(or|and)\\b|,)\\s*' + SpecialYearTermsRegex = f'\\b(((ال)?سنة|(ال)?عام)(\\s+{SpecialYearPrefixes})?)' + YearPlusNumberRegex = f'\\b({SpecialYearTermsRegex}\\s*((?(\\d{{2,4}}))|{FullTextYearRegex}))\\b' + NumberAsTimeRegex = f'\\b({WrittenTimeRegex}|{PeriodHourNumRegex}|{BaseDateTime.HourRegex})\\b' + TimeBeforeAfterRegex = f'\\b(((?<=\\b(ب|((قبل|في موعد لا يتجاوز| بعد)\\s))(وقت\\s+)?)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}|{MidTimeRegex}))|{MidTimeRegex})\\b' + DateNumberConnectorRegex = '^\\s*(?\\s+at)\\s*$' + DecadeRegex = '(?(ال)?عشرات|(ال)?عشرينيات|(ال)?عشرينات|(ال)?ثلاثينات|(ال)?أربعينيات|(ال)?أربعينات|(ال)?خمسينيات|(ال)?خمسينات|(ال)?ستينات|(ال)?سبعينيات|(ال)?سبعينات|(ال)?ثمانينات|(ال)?تسعينات|الألفين|ألفين)' + DecadeWithCenturyRegex = f'({DecadeRegex})((\\s+القرن(\\s+(الثماني عشر|التاسع عشر)))|(\\s+(و{DecadeRegex})))?' + RelativeDecadeRegex = '\\b(?(الثلاثة|الأربعة|الخمسة|الستة|السبعة|الثمانية|التسعة|العشر|\\d+)\\s+)?((ال)?عقدين|(ال)?عقد|(ال)?عقود)\\s+(الماضيين|الماضية|الماضي|القادمين|القادمة|القادم)\\b' + YearPeriodRegex = f'(((من|بين)\\s+)?{YearRegex}\\s*({TillRegex}|{RangeConnectorRegex})\\s*{YearRegex})' + StrictTillRegex = f'(?\\b(to|(un)?till?|thru|through)\\b|{BaseDateTime.RangeConnectorSymbolRegex}(?!\\s*(h[1-2]|q[1-4])(?!(\\s+of|\\s*,\\s*))))' + StrictRangeConnectorRegex = f'(?\\b(and|through|to)\\b|{BaseDateTime.RangeConnectorSymbolRegex}(?!\\s*(h[1-2]|q[1-4])(?!(\\s+of|\\s*,\\s*))))' + StartMiddleEndRegex = '\\b((?((the\\s+)?(start|beginning)\\s+of\\s+)?)(?((the\\s+)?middle\\s+of\\s+)?)(?((the\\s+)?end\\s+of\\s+)?))' + ComplexDatePeriodRegex = f'(?:((from|during|in)\\s+)?{StartMiddleEndRegex}(?.+)\\s*({StrictTillRegex})\\s*{StartMiddleEndRegex}(?.+)|((between)\\s+){StartMiddleEndRegex}(?.+)\\s*({StrictRangeConnectorRegex})\\s*{StartMiddleEndRegex}(?.+))' + FailFastRegex = f'{BaseDateTime.DeltaMinuteRegex}|\\b(?:{BaseDateTime.BaseAmDescRegex}|{BaseDateTime.BasePmDescRegex})|{BaseDateTime.BaseAmPmDescRegex}|\\b(?:zero|{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}|{WrittenMonthRegex}|{SeasonDescRegex}|{DecadeRegex}|centur(y|ies)|weekends?|quarters?|hal(f|ves)|yesterday|to(morrow|day|night)|tmr|noonish|\\d(-|——)?ish|((the\\s+\\w*)|\\d)(th|rd|nd|st)|(mid\\s*(-\\s*)?)?(night|morning|afternoon|day)s?|evenings?||noon|lunch(time)?|dinner(time)?|(day|night)time|overnight|dawn|dusk|sunset|hours?|hrs?|h|minutes?|mins?|seconds?|secs?|eo[dmy]|mardi[ -]?gras|birthday|eve|christmas|xmas|thanksgiving|halloween|yuandan|easter|yuan dan|april fools|cinco de mayo|all (hallow|souls)|guy fawkes|(st )?patrick|hundreds?|noughties|aughts|thousands?)\\b|{WeekDayRegex}|{NowRegex}|\\b({DateUnitRegex}|{ImplicitDayRegex})' + UnitMap = dict( + [ + ("قرن", "10Y"), + ("حقبة", "10Y"), + ("قرون", "10Y"), + ("حقبات", "10Y"), + ("قرنين", "20Y"), + ("قرنان", "20Y"), + ("حقبتان", "20Y"), + ("حقبتين", "20Y"), + ("سنة", "Y"), + ("العام", "Y"), + ("عام", "Y"), + ("سنوات", "Y"), + ("أعوام", "Y"), + ("عامان", "2Y"), + ("سنتان", "2Y"), + ("سنتين", "2Y"), + ("عامين", "2Y"), + ("الشهر", "MON"), + ("شهر", "MON"), + ("أشهر", "MON"), + ("شهور", "MON"), + ("شهرا", "MON"), + ("شهرين", "2MON"), + ("شهران", "2MON"), + ("quarters", "3MON"), + ("quarter", "3MON"), + ("semesters", "6MON"), + ("semestres", "6MON"), + ("semester", "6MON"), + ("semestre", "6MON"), + ("أسبوع", "W"), + ("أسابيع", "W"), + ("أسبوعا", "W"), + ("أسبوعان", "2W"), + ("أسبوعين", "2W"), + ("نهاية الأسبوع", "WE"), + ("يوم", "D"), + ("أيام", "D"), + ("يوما", "D"), + ("يومان", "2D"), + ("يومين", "2D"), + ("ليال", "D"), + ("ليلة", "D"), + ("ساعة", "H"), + ("ساعات", "H"), + ("ساعتان", "2H"), + ("ساعتين", "2H"), + ("دقيقة", "M"), + ("دقائق", "M"), + ("دقيقتان", "2M"), + ("دقيقتين", "2M"), + ("ثانية", "S"), + ("ثوان", "S"), + ("ثانيتان", "2S"), + ("ثانيتين", "2S"), + ] + ) + UnitValueMap = dict( + [ + ("قرن", 315360000), + ("حقبة", 315360000), + ("قرون", 315360000), + ("حقبات", 315360000), + ("قرنين", 630720000), + ("حقبتين", 630720000), + ("قرنان", 630720000), + ("حقبتان", 630720000), + ("سنة", 31536000), + ("العام", 31536000), + ("عام", 31536000), + ("سنوات", 31536000), + ("أعوام", 31536000), + ("عامان", 63072000), + ("سنتان", 63072000), + ("سنتين", 63072000), + ("عامين", 63072000), + ("الشهر", 2592000), + ("شهر", 2592000), + ("أشهر", 2592000), + ("شهور", 2592000), + ("شهرا", 2592000), + ("شهرين", 5184000), + ("شهران", 5184000), + ("نهاية الأسبوع", 172800), + ("أسبوع", 604800), + ("أسابيع", 604800), + ("أسبوعا", 604800), + ("أسبوعان", 1209600), + ("أسبوعين", 1209600), + ("يوم", 86400), + ("أيام", 86400), + ("يوما", 86400), + ("يومان", 172800), + ("يومين", 172800), + ("ليلة", 86400), + ("ليال", 86400), + ("ساعة", 3600), + ("ساعات", 3600), + ("ساعتان", 7200), + ("ساعتين", 7200), + ("دقيقة", 60), + ("دقائق", 60), + ("دقيقتان", 120), + ("دقيقتين", 120), + ("ثانية", 1), + ("ثوان", 1), + ("ثانيتان", 2), + ("ثانيتين", 2), + ] + ) + SpecialYearPrefixesMap = dict([("fiscal", "FY"), ("school", "SY"), ("fy", "FY"), ("sy", "SY")]) + SeasonMap = dict( + [ + ("الربيع", "SP"), + ("ربيع", "SP"), + ("الصيف", "SU"), + ("صيف", "SU"), + ("الخريف", "FA"), + ("خريف", "FA"), + ("الشتاء", "WI"), + ("شتاء", "WI"), + ] + ) + SeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + CardinalMap = dict([("الأول", 1), ("الثاني", 2), ("الثالث", 3), ("الرابع", 4), ("الخامس", 5)]) + DayOfWeek = dict( + [ + ("الاثنين", 1), + ("الإثنين", 1), + ("monday", 1), + ("الثلاثاء", 2), + ("tuesday", 2), + ("الأربعاء", 3), + ("wednesday", 3), + ("الخميس", 4), + ("thursday", 4), + ("الجمعة", 5), + ("friday", 5), + ("السبت", 6), + ("saturday", 6), + ("الأحد", 0), + ("sunday", 0), + ("إثنين", 1), + ("ثلاثاء", 2), + ("أربعاء", 3), + ("خميس", 4), + ("جمعة", 5), + ("سبت", 6), + ("أحد", 0), + ] + ) + MonthOfYear = dict( + [ + ("يناير", 1), + ("فبراير", 2), + ("مارس", 3), + ("أبريل", 4), + ("إبريل", 4), + ("مايو", 5), + ("يونيو", 6), + ("يوليو", 7), + ("أغسطس", 8), + ("سبتمبر", 9), + ("أكتوبر", 10), + ("نوفمبر", 11), + ("ديسمبر", 12), + ("محرم", 1), + ("صفر", 2), + ("ربيع الأول", 3), + ("ربيع الثاني", 4), + ("جمادى الأول", 5), + ("جمادى الثاني", 6), + ("رجب", 7), + ("شعبان", 8), + ("رمضان", 9), + ("شوال", 10), + ("اكتوبر", 10), + ("ذو القعدة", 11), + ("ذو الحجة", 12), + ("كانون الثاني", 1), + ("شباط", 2), + ("آذار", 3), + ("نيسان", 4), + ("أيار", 5), + ("حزيران", 6), + ("تموز", 7), + ("آب", 8), + ("أيلول", 9), + ("تشرين الأول", 10), + ("تشرين الثاني", 11), + ("كانون الأول", 12), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ] + ) + Numbers = dict( + [ + ("صفر", 0), + ("واحد", 1), + ("واحدة", 1), + ("الواحدة", 1), + ("الوَاحِدَة", 1), + ("اثنان", 2), + ("دقيقتان", 2), + ("دقيقتين", 2), + ("الثانية", 2), + ("الثانيه", 2), + ("اثنين", 2), + ("ثلاثة", 3), + ("ثلاث", 3), + ("الثالثة", 3), + ("أربعة", 4), + ("أربع", 4), + ("الرابعة", 4), + ("ربع", 4), + ("خمسة", 5), + ("الخامسة", 5), + ("خمس", 5), + ("الخمسة", 5), + ("ستة", 6), + ("ست", 6), + ("السادسة", 6), + ("سبعة", 7), + ("سبع", 7), + ("السابعة", 7), + ("السبعة", 7), + ("ثمانية", 8), + ("الثامنة", 8), + ("تسعة", 9), + ("تسع", 9), + ("التاسعة", 9), + ("عشرة", 10), + ("العاشرة", 10), + ("عشر", 10), + ("أحد عشر", 11), + ("الحادية عشر", 11), + ("الحاديه عشر", 11), + ("الحادية عشرة", 11), + ("اثنا عشر", 12), + ("اثنتي عشرة", 12), + ("الثانية عشرة", 12), + ("الثانية عشر", 12), + ("ثلاثة عشر", 13), + ("ثلاث عشرة", 13), + ("أربعة عشر", 14), + ("الرابعة عشرة", 14), + ("الرابعة عشر", 14), + ("خمسة عشر", 15), + ("خمس عشرة", 15), + ("خمس عشر", 15), + ("ستة عشر", 16), + ("السادسة عشرة", 16), + ("سبعة عشر", 17), + ("سبع عشرة", 17), + ("السابعة عشرة", 17), + ("ثمانية عشر", 18), + ("الثمانية عشر", 18), + ("تسعة عشر", 19), + ("تسع عشرة", 19), + ("عشرون", 20), + ("عشرين", 20), + ("واحد وعشرون", 21), + ("الحادية والعشرون", 21), + ("اثنان وعشرون", 22), + ("اثنين وعشرين", 22), + ("ثلاثة وعشرون", 23), + ("ثلاثة وعشرين", 23), + ("ثلاث وعشرون", 23), + ("أربعة وعشرون", 24), + ("أربعة وعشرين", 24), + ("أربع وعشرون", 24), + ("خمسة وعشرون", 25), + ("خمسة وعشرين", 25), + ("خمس وعشرون", 25), + ("ستة وعشرون", 26), + ("ستة وعشرين", 26), + ("سبعة وعشرون", 27), + ("سبع وعشرون", 27), + ("سبعة وعشرين", 27), + ("سبع وعشرين", 27), + ("ثمانية وعشرون", 28), + ("ثمانية وعشرين", 28), + ("تسعة وعشرون", 29), + ("تسع وعشرين", 29), + ("تسع وعشرون", 29), + ("الثلاثين", 30), + ("ثلاثين", 30), + ("ثلاثون", 30), + ("وثلاثون", 30), + ("واحد وثلاثون", 31), + ("واحد وثلاثين", 31), + ("إحدى وثلاثين", 31), + ("اثنان وثلاثون", 32), + ("اثنتين وثلاثين", 32), + ("دقيقتين وثلاثين", 32), + ("ثلاثة وثلاثون", 33), + ("ثلاث وثلاثين", 33), + ("أربعة وثلاثون", 34), + ("أربعة وثلاثين", 34), + ("أربع وثلاثون", 34), + ("خمسة وثلاثون", 35), + ("خمس وثلاثون", 35), + ("خمسة وثلاثين", 35), + ("خمس وثلاثين", 35), + ("ستة وثلاثون", 36), + ("ستة وثلاثين", 36), + ("سبعة وثلاثون", 37), + ("وسبع وثلاثين", 37), + ("ثمانية وثلاثون", 38), + ("ثماني وثلاثين", 38), + ("تسعة وثلاثون", 39), + ("تسع وثلاثين", 39), + ("أربعون", 40), + ("أربعين", 40), + ("واحد وأربعون", 41), + ("إحدى وأربعين", 41), + ("اثنان وأربعون", 42), + ("اثنتين وأربعين", 42), + ("ثلاثة وأربعون", 43), + ("ثلاث وأربعين", 43), + ("أربعة وأربعون", 44), + ("أربع وأربعين", 44), + ("خمسة وأربعون", 45), + ("خمس وأربعون", 45), + ("خمس وأربعين", 45), + ("ستة وأربعون", 46), + ("ست وأربعين", 46), + ("سبعة وأربعون", 47), + ("سبع وأربعين", 47), + ("ثمانية وأربعون", 48), + ("ثماني وأربعين", 48), + ("تسعة وأربعون", 49), + ("تسع وأربعين", 49), + ("خمسون", 50), + ("خمسين", 50), + ("واحد وخمسون", 51), + ("إحدى وخمسين", 51), + ("اثنان وخمسون", 52), + ("اثنتين وخمسين", 52), + ("ثلاثة وخمسون", 53), + ("ثلاث وخمسين", 53), + ("أربعة وخمسون", 54), + ("أربعة وخمسين", 54), + ("خمسة وخمسون", 55), + ("خمس وخمسين", 55), + ("ستة وخمسون", 56), + ("ست وخمسون", 56), + ("ستة وخمسين", 56), + ("سبعة وخمسون", 57), + ("سبع وخمسين", 57), + ("ثمانية وخمسون", 58), + ("ثماني وخمسين", 58), + ("تسعة وخمسون", 59), + ("تسع وخمسين", 59), + ("ستين", 60), + ("ستون", 60), + ("واحد وستون", 61), + ("اثنان وستون", 62), + ("ثلاثة وستون", 63), + ("أربعة وستون", 64), + ("خمسة وستون", 65), + ("ستة وستون", 66), + ("سبعة وستون", 67), + ("ثمانية وستون", 68), + ("تسعة وستون", 69), + ("السبعون", 70), + ("واحد وسبعون", 71), + ("اثنان وسبعون", 72), + ("ثلاثة وسبعون", 73), + ("أربعة وسبعون", 74), + ("خمسة وسبعون", 75), + ("ستة وسبعون", 76), + ("سبعة وسبعون", 77), + ("ثمانية وسبعون", 78), + ("تسعة وسبعون", 79), + ("ثمانون", 80), + ("واحد وثمانون", 81), + ("اثنان وثمانون", 82), + ("ثلاثة وثمانون", 83), + ("أربعة وثمانون", 84), + ("خمسة وثمانون", 85), + ("ستة وثمانون", 86), + ("سبعة وثمانون", 87), + ("ثمانية وثمانين", 88), + ("تسعة وثمانون", 89), + ("تسعون", 90), + ("واحد وتسعون", 91), + ("اثنان وتسعون", 92), + ("ثلاثة وتسعون", 93), + ("أربعة وتسعون", 94), + ("خمسة وتسعون", 95), + ("ستة وتسعون", 96), + ("سبعة وتسعون", 97), + ("ثمانية وتسعون", 98), + ("تسعة وتسعون", 99), + ("مائة", 100), + ] + ) + DayOfMonth = dict( + [ + ("1st", 1), + ("1th", 1), + ("2nd", 2), + ("2th", 2), + ("3rd", 3), + ("3th", 3), + ("4th", 4), + ("5th", 5), + ("6th", 6), + ("7th", 7), + ("8th", 8), + ("9th", 9), + ("10th", 10), + ("11th", 11), + ("11st", 11), + ("12th", 12), + ("12nd", 12), + ("13th", 13), + ("13rd", 13), + ("14th", 14), + ("15th", 15), + ("16th", 16), + ("17th", 17), + ("18th", 18), + ("19th", 19), + ("20th", 20), + ("21st", 21), + ("21th", 21), + ("22nd", 22), + ("22th", 22), + ("23rd", 23), + ("23th", 23), + ("24th", 24), + ("25th", 25), + ("26th", 26), + ("27th", 27), + ("28th", 28), + ("29th", 29), + ("30th", 30), + ("31st", 31), + ("01st", 1), + ("01th", 1), + ("02nd", 2), + ("02th", 2), + ("03rd", 3), + ("03th", 3), + ("04th", 4), + ("05th", 5), + ("06th", 6), + ("07th", 7), + ("08th", 8), + ("09th", 9), + ] + ) + DoubleNumbers = dict([("half", 0.5), ("quarter", 0.25)]) + HolidayNames = dict( + [ + ("easterday", ["easterday", "easter", "eastersunday"]), + ("ashwednesday", ["ashwednesday"]), + ("palmsunday", ["palmsunday"]), + ("maundythursday", ["maundythursday"]), + ("goodfriday", ["goodfriday"]), + ("eastersaturday", ["eastersaturday"]), + ("eastermonday", ["eastermonday"]), + ("ascensionday", ["ascensionday"]), + ("whitesunday", ["whitesunday", "pentecost", "pentecostday"]), + ("whitemonday", ["whitemonday"]), + ("trinitysunday", ["trinitysunday"]), + ("corpuschristi", ["corpuschristi"]), + ("earthday", ["earthday"]), + ("fathers", ["fatherday", "fathersday"]), + ("mothers", ["motherday", "mothersday"]), + ("thanksgiving", ["thanksgivingday", "thanksgiving"]), + ("blackfriday", ["blackfriday"]), + ("cybermonday", ["cybermonday"]), + ("martinlutherking", ["mlkday", "martinlutherkingday", "martinlutherkingjrday"]), + ("washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday", "presidentsday"]), + ("canberra", ["canberraday"]), + ("labour", ["labourday", "laborday"]), + ("columbus", ["columbusday"]), + ("memorial", ["memorialday"]), + ("yuandan", ["yuandan"]), + ("maosbirthday", ["maosbirthday"]), + ("teachersday", ["teachersday", "teacherday"]), + ("singleday", ["singleday"]), + ("allsaintsday", ["allsaintsday"]), + ("youthday", ["youthday"]), + ("childrenday", ["childrenday", "childday"]), + ("femaleday", ["femaleday"]), + ("treeplantingday", ["treeplantingday"]), + ("arborday", ["arborday"]), + ("girlsday", ["girlsday"]), + ("whiteloverday", ["whiteloverday"]), + ("loverday", ["loverday", "loversday"]), + ("christmas", ["christmasday", "christmas"]), + ("xmas", ["xmasday", "xmas"]), + ("newyear", ["newyear"]), + ("newyearday", ["newyearday"]), + ("newyearsday", ["newyearsday"]), + ("inaugurationday", ["inaugurationday"]), + ("groundhougday", ["groundhougday"]), + ("valentinesday", ["valentinesday"]), + ("stpatrickday", ["stpatrickday", "stpatricksday", "stpatrick"]), + ("aprilfools", ["aprilfools"]), + ("stgeorgeday", ["stgeorgeday"]), + ("mayday", ["mayday", "intlworkersday", "internationalworkersday", "workersday"]), + ("cincodemayoday", ["cincodemayoday"]), + ("baptisteday", ["baptisteday"]), + ("usindependenceday", ["usindependenceday"]), + ("independenceday", ["independenceday"]), + ("bastilleday", ["bastilleday"]), + ("halloweenday", ["halloweenday", "halloween"]), + ("allhallowday", ["allhallowday"]), + ("allsoulsday", ["allsoulsday"]), + ("guyfawkesday", ["guyfawkesday"]), + ("veteransday", ["veteransday"]), + ("christmaseve", ["christmaseve"]), + ("newyeareve", ["newyearseve", "newyeareve"]), + ("juneteenth", ["juneteenth", "freedomday", "jubileeday"]), + ] + ) + WrittenDecades = dict( + [ + ("hundreds", 0), + ("tens", 10), + ("twenties", 20), + ("thirties", 30), + ("forties", 40), + ("fifties", 50), + ("sixties", 60), + ("seventies", 70), + ("eighties", 80), + ("nineties", 90), + ] + ) + SpecialDecadeCases = dict([("noughties", 2000), ("aughts", 2000), ("two thousands", 2000)]) + DefaultLanguageFallback = 'DMY' + SuperfluousWordList = [r'preferably', r'how about', r'maybe', r'perhaps', r'say', r'like'] + DurationDateRestrictions = [r'today', r'now'] + AmbiguityFiltersDict = dict( + [ + ( + "^(morning|afternoon|evening|night|day)\\b", + "\\b(good\\s+(morning|afternoon|evening|night|day))|(nighty\\s+night)\\b", + ), + ("\\bnow\\b", "\\b(^now,)|\\b((is|are)\\s+now\\s+for|for\\s+now)\\b"), + ( + "\\bmay\\b", + "\\b((((!|\\.|\\?|,|;|)\\s+|^)may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|ask|contain|constitute|e-?mail|take|have|result|involve|get|work|reply|differ))|(or may not))))\\b", + ), + ("\\b(a|one) second\\b", "\\b(?2[0-4]|[0-1]?\\d)(h)?' - TwoDigitHourRegex = f'(?[0-1]\\d|2[0-4])(h)?' - MinuteRegex = f'(?[0-5]\\d)(?!\\d)' - TwoDigitMinuteRegex = f'(?[0-5]\\d)(?!\\d)' - DeltaMinuteRegex = f'(?[0-5]?\\d)' - SecondRegex = f'(?[0-5]?\\d)' - FourDigitYearRegex = f'\\b(?((1\\d|20)\\d{{2}})|2100)(?!\\.0\\b)\\b' - HyphenDateRegex = f'((?[0-9]{{4}})-?(?1[0-2]|0[1-9])-?(?3[01]|0[1-9]|[12][0-9]))|((?1[0-2]|0[1-9])-?(?3[01]|0[1-9]|[12][0-9])-?(?[0-9]{{4}}))|((?3[01]|0[1-9]|[12][0-9])-?(?1[0-2]|0[1-9])-?(?[0-9]{{4}}))' + HourRegex = '(?2[0-4]|[0-1]?\\d)(h)?' + TwoDigitHourRegex = '(?[0-1]\\d|2[0-4])(h)?' + MinuteRegex = '(?[0-5]\\d)(?!\\d)' + TwoDigitMinuteRegex = '(?[0-5]\\d)(?!\\d)' + DeltaMinuteRegex = '(?[0-5]?\\d)' + SecondRegex = '(?[0-5]?\\d)' + FourDigitYearRegex = '\\b(?((1\\d|20)\\d{2})|2100)(?!\\.0\\b)\\b' + HyphenDateRegex = '((?[0-9]{4})-?(?1[0-2]|0[1-9])-?(?3[01]|0[1-9]|[12][0-9]))|((?1[0-2]|0[1-9])-?(?3[01]|0[1-9]|[12][0-9])-?(?[0-9]{4}))|((?3[01]|0[1-9]|[12][0-9])-?(?1[0-2]|0[1-9])-?(?[0-9]{4}))' IllegalYearRegex = f'([-])({FourDigitYearRegex})([-])' - InvalidDayNumberPrefix = f'(\\d[.,:]|[$£€]\\s*)$' - CheckDecimalRegex = f'(?![,.]\\d)' - RangeConnectorSymbolRegex = f'(--|-|—|——|~|–)' - BaseAmDescRegex = f'(am\\b|a\\s*\\.\\s*m\\s*\\.|a[\\.]?\\s*m\\b)' - BasePmDescRegex = f'(pm\\b|p\\s*\\.\\s*m\\s*\\.|p[\\.]?\\s*m\\b)' - BaseAmPmDescRegex = f'(ampm)' - EqualRegex = f'(?)=' - BracketRegex = f'^\\s*[\\)\\]]|[\\[\\(]\\s*$' + InvalidDayNumberPrefix = '(\\d[.,:]|[$£€]\\s*)$' + CheckDecimalRegex = '(?![,.]\\d)' + RangeConnectorSymbolRegex = '(--|-|—|——|~|–)' + BaseAmDescRegex = '(am\\b|a\\s*\\.\\s*m\\s*\\.|a[\\.]?\\s*m\\b)' + BasePmDescRegex = '(pm\\b|p\\s*\\.\\s*m\\s*\\.|p[\\.]?\\s*m\\b)' + BaseAmPmDescRegex = '(ampm)' + EqualRegex = '(?)=' + BracketRegex = '^\\s*[\\)\\]]|[\\[\\(]\\s*$' MinYearNum = '1500' MaxYearNum = '2100' - MaxTwoDigitYearFutureNum = '30' + MaxTwoDigitYearFutureNum = '40' MinTwoDigitYearPastNum = '40' - DayOfMonthDictionary = dict([("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("13", 13), - ("14", 14), - ("15", 15), - ("16", 16), - ("17", 17), - ("18", 18), - ("19", 19), - ("20", 20), - ("21", 21), - ("22", 22), - ("23", 23), - ("24", 24), - ("25", 25), - ("26", 26), - ("27", 27), - ("28", 28), - ("29", 29), - ("30", 30), - ("31", 31)]) - VariableHolidaysTimexDictionary = dict([("fathers", "-06-WXX-7-3"), - ("mothers", "-05-WXX-7-2"), - ("thanksgiving", "-11-WXX-4-4"), - ("martinlutherking", "-01-WXX-1-3"), - ("washingtonsbirthday", "-02-WXX-1-3"), - ("canberra", "-03-WXX-1-1"), - ("labour", "-09-WXX-1-1"), - ("columbus", "-10-WXX-1-2"), - ("memorial", "-05-WXX-1-4")]) + DayOfMonthDictionary = dict( + [ + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("13", 13), + ("14", 14), + ("15", 15), + ("16", 16), + ("17", 17), + ("18", 18), + ("19", 19), + ("20", 20), + ("21", 21), + ("22", 22), + ("23", 23), + ("24", 24), + ("25", 25), + ("26", 26), + ("27", 27), + ("28", 28), + ("29", 29), + ("30", 30), + ("31", 31), + ] + ) + VariableHolidaysTimexDictionary = dict( + [ + ("fathers", "-06-WXX-7-3"), + ("mothers", "-05-WXX-7-2"), + ("thanksgiving", "-11-WXX-4-4"), + ("martinlutherking", "-01-WXX-1-3"), + ("washingtonsbirthday", "-02-WXX-1-3"), + ("canberra", "-03-WXX-1-1"), + ("labour", "-09-WXX-1-1"), + ("columbus", "-10-WXX-1-2"), + ("memorial", "-05-WXX-1-4"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/catalan_date_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/catalan_date_time.py new file mode 100644 index 0000000000..e91da61e5a --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/catalan_date_time.py @@ -0,0 +1,296 @@ +from .base_date_time import BaseDateTime, BaseDateTimeResource + + +# pylint: disable=line-too-long + + +class CatalanDateTime(BaseDateTimeResource): + LangMarker = 'Cat' + CheckBothBeforeAfter = False + TillRegex = f'(?\\bfins\\sa|{BaseDateTime.RangeConnectorSymbolRegex})' + RangeConnectorRegex = f'(?\\b(i)\\b|{BaseDateTime.RangeConnectorSymbolRegex})' + ThisPrefixRegex = '(aix[òo]|aquesta)\\b' + RangePrefixRegex = '(des de|entre)' + DayRegex = '\\b(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?:\\.[º°])?(?=\\b|t)' + MonthNumRegex = '(?1[0-2]|(0)?[1-9])\\b' + WrittenDayRegex = '(?un?|dos|tres|quatre|cinc|sis|set|vuit|nou|deu|onze|dotze|tretze|catorze|quinze|setze|disset|divuit|dinou|vint|vint-i-un?|vint-i-dos|vint-i-tres|vint-i-quatre|vint-i-cinc|vint-i-sis|vint-i-set|vint-i-vuit|vint-i-nou|trenta|trenta-un?)' + OclockRegex = '(?en\\s+punt(o)?)' + AmDescRegex = f'({BaseDateTime.BaseAmDescRegex})' + PmDescRegex = f'({BaseDateTime.BasePmDescRegex})' + AmPmDescRegex = f'({BaseDateTime.BaseAmPmDescRegex})' + DescRegex = f'(?({AmDescRegex}|{PmDescRegex}))' + OfPrepositionRegex = '(\\bde\\b)' + TwoDigitYearRegex = ( + f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d))|\\.?[º°ª])\\b' + ) + WrittenOneToNineRegex = '(?:u(n)?|dos|tres|quatre|cinc|sis|set|vuit|nou)' + WrittenOneToTwelveRegex = '(?un?|dos|tres|quatre|cinc|sis|set|vuit|nou|deu|onze|dotze)' + TwoToNineIntegerRegex = '(?:tres|set|vuit|quatre|cinc|nou|dos|sis)' + WrittenElevenToNineteenRegex = '(?:onze|dotze|tretze|catorze|quinze|setze|disset|divuit|dinou)' + WrittenTensRegex = '(?:setanta|vint|trenta|vuitanta|noranta|quaranta|cinquanta|seixanta)' + WrittenTwentiesRegex = f'(vint(\\s?-\\s?|\\s)i(\\s?-\\s?|\\s)({WrittenOneToNineRegex}))' + WrittenOneHundredToNineHundredRegex = f'(({TwoToNineIntegerRegex}(\\s?-\\s?|\\s))?cent(s?))' + WrittenOneToNinetyNineRegex = f'(({WrittenElevenToNineteenRegex}|{WrittenTwentiesRegex}|({WrittenTensRegex}((\\s?-\\s?|\\s)({WrittenOneToNineRegex}))?)|deu|{WrittenOneToNineRegex}))' + FullTextYearRegex = f'\\b(?((dos\\s+)?mil)(\\s+{WrittenOneHundredToNineHundredRegex})?(\\s+{WrittenOneToNinetyNineRegex})?)' + YearRegex = f'({BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' + MonthRegex = '\\b(?gener|febrer|mar[çc]|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)' + MonthSuffixRegex = f'(?((a|de)\\s+)?({MonthRegex}))' + YearSuffix = f'((\\s?(a|del?|(de\\sl\'|del\\s)any)\\s+)?({YearRegex}|{FullTextYearRegex}))' + SimpleCasesRegex = f'\\b({RangePrefixRegex}\\s+)?({DayRegex}|{WrittenDayRegex})\\s*{TillRegex}\\s*({DayRegex}|{WrittenDayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*){YearRegex})?\\b' + MonthFrontSimpleCasesRegex = f'\\b{MonthSuffixRegex}\\s+({RangePrefixRegex}?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' + MonthFrontBetweenRegex = f'\\b{MonthSuffixRegex}\\s+({RangePrefixRegex}({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' + MonthNumWithYearRegex = f'\\b(({YearRegex}(\\s*?)[/\\-\\.~](\\s*?){MonthNumRegex})|({MonthNumRegex}(\\s*?)[/\\-\\.~](\\s*?){YearRegex}))\\b' + OfYearRegex = f'\\b(((de?)\\s+(({YearRegex}\\s+any)))|(de(\\s+l\'|l\\s)any\\s+{YearRegex}))\\b' + CenturySuffixRegex = '(^segle)\\b' + RangeUnitRegex = '\\b(?anys?|mesos?|setmanes?)\\b' + BeforeAfterRegex = '^[.]' + LaterRegex = '^[.]' + AgoRegex = '^[.]' + WithinNextPrefixRegex = '^[.]' + CommonDatePrefixRegex = '^[.]' + DateUnitRegex = '^[.]' + TimeUnitRegex = '^[.]' + ForTheRegex = '^[.]' + RelativeMonthRegex = '^[.]' + StrictRelativeRegex = '^[.]' + SinceYearSuffixRegex = '^[.]' + PrefixArticleRegex = '^[.]' + MoreThanRegex = '^[.]' + LessThanRegex = '^[.]' + MonthEnd = '^[.]' + OfMonth = '^[.]' + InConnectorRegex = '\\b(en)(?=\\s*$)\\b' + TodayNowRegex = '\\b(avui|ara)\\b' + FromRegex = '((\\bde(s|l)?)(\\s*al?)?)$' + BetweenRegex = '(\\bentre\\s*)' + WeekDayRegex = '\\b(?(dilluns|dimarts|dimecres|dijous|divendres|dissabte|diumenge))\\b' + OnRegex = f'(?<=\\bel(\\s+d[ií]a)?\\s+)({DayRegex}s?)(?![.,]\\d)\\b' + RelaxedOnRegex = '(?<=\\bel(\\s+d[ií]a)?\\s+)((?10|11|12|13|14|15|16|17|18|19|1st|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)s?)(?![.,]\\d)\\b' + SpecialDayRegex = '\\b(avui|dem[àa]|ahir)\\b' + SpecialDayWithNumRegex = '^[.]' + FlexibleDayRegex = f'(?([a-z]+\\s)?({WrittenDayRegex}|{DayRegex}))' + WeekDayAndDayOfMonthRegex = f'\\b{WeekDayRegex}\\s+((el\\s+(d[ií]a\\s+)?){FlexibleDayRegex})\\b' + WeekDayAndDayRegex = f'\\b{WeekDayRegex}\\s+({DayRegex}|{WrittenDayRegex})(?!([-:/]|\\.\\d|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' + RelativeWeekDayRegex = '^[.]' + AmbiguousRangeModifierPrefix = '^[.]' + NumberEndingPattern = '^[.]' + DateTokenPrefix = 'el ' + TimeTokenPrefix = 'a les ' + TokenBeforeDate = 'el ' + TokenBeforeTime = 'a les ' + HalfTokenRegex = '^((i\\s+)?mitja(na)?)' + QuarterTokenRegex = '^((i\\s+)?quart|(?menys\\s+quart))' + PastTokenRegex = '\\b((passades|passats)(\\s+(de\\s+)?les)?)$' + ToTokenRegex = '\\b((per|abans)(\\s+(de\\s+)?les?)|(?^menys))$' + SpecialDateRegex = f'(?<=\\b(a)\\s+el\\s+){DayRegex}\\b' + OfMonthRegex = f'^\\s*((d[ií]a\\s+)?d[e\']\\s?)?{MonthSuffixRegex}' + MonthEndRegex = f'({MonthRegex}\\s*(el)?\\s*$)' + WeekDayEnd = f'{WeekDayRegex}\\s*,?\\s*$' + WeekDayStart = '^\\b$' + DateYearRegex = f'(?{YearRegex}|(?2[0-4]|[0-1]?\\d)' + HourNumRegex = '\\b(?zero|una|dues|tres|quatre|cinc|sis|set|vuit|nou|deu|deu|onze|dotze)\\b' + MinuteNumRegex = '(?u(n)?|dos|tres|quatre|cinc|sis|set|vuit|nou|deu|onze|dotze|tretze|catorze|quinze|setze|disset|divuit|dinou|vint|trenta|quaranta|cinquanta)' + DeltaMinuteNumRegex = '(?u(n)?|dos|tres|quatre|cinc|sis|set|vuit|nou|deu|onze|dotze|tretze|catorze|quinze|setze|disset|divuit|dinou|vint|trenta|quaranta|cinquanta)' + PmRegex = '(?((de|a)\\s+la)\\s+(tarda|nit))' + AmRegex = '(?(((de|a)\\s+la)|al|del)\\s+(matí|matinada))' + AmTimeRegex = '(?(aquesta|(de|a)\\s+la)|(aquest)\\s+(matí|matinada))' + PmTimeRegex = '(?(aquesta|(de|a)\\s+la)\\s+(tarda|nit))' + NightTimeRegex = '(nit)' + LastNightTimeRegex = '(ahir a la nit)' + NowTimeRegex = '(ara|mateix|moment)' + RecentlyTimeRegex = '(ment)' + LessThanOneHour = f'(?((\\s)?(dos|tres)\\squart(s)|((\\s)?(i|un)\\s+)?quart(s)?|(\\s*)menys quart(s)?|(\\s+i\\s+)mitja(na)?|{BaseDateTime.DeltaMinuteRegex}(\\s+(minuts?|mins?))|{DeltaMinuteNumRegex}(\\s+(minuts?|mins?))|([1-3])/(2|4)))' + TensTimeRegex = '(?deu|vint|trenta|quaranta|cinquanta)' + WrittenTimeRegex = ( + f'(?{HourNumRegex}\\s*((i|(?menys))\\s+)?(({TensTimeRegex}(\\s*i\\s+)?)?{MinuteNumRegex}))' + ) + TimePrefix = f'(?{LessThanOneHour}(\\s+(passades|de)\\s+(de\\s+les|les)?|\\s+(per\\s+a|abans\\s+de)?\\s+(les?)|\\s+(d\')|\\s+(menys))?)' + TimeSuffix = f'(?({LessThanOneHour}\\s+)?({AmRegex}|{PmRegex}|{OclockRegex}))' + GeneralDescRegex = f'({DescRegex}|(?{AmRegex}|{PmRegex}))' + BasicTime = f'(?{WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}:{BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|{BaseDateTime.HourRegex})' + MidTimeRegex = '(?((?mitja\\s*nit)|(?mitja\\s*matinada)|(?mig\\s*matí)|(?mitja\\s*tarda)|(?mig\\s*dia)))' + AtRegex = f'\\b((?<=\\b((a)\\s+les?|al)\\s+)(({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})\\b?(DescRegex)?|{MidTimeRegex})|{MidTimeRegex})' + ConnectNumRegex = f'({BaseDateTime.HourRegex}(?[0-5][0-9])\\s*{DescRegex})' + TimeRegexWithDotConnector = f'({BaseDateTime.HourRegex}\\.{BaseDateTime.MinuteRegex})' + TimeRegex1 = f'(\\b{TimePrefix}\\s+)?({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})\\s*({DescRegex})' + TimeRegex2 = f'(\\b{TimePrefix}\\s+)?(t)?{BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?{BaseDateTime.SecondRegex})?(\\s*({DescRegex})|\\b)' + TimeRegex3 = f'\\b(({TimePrefix}\\s+)?{TimeRegexWithDotConnector}(\\s*({DescRegex}|{TimeSuffix}))|((les\\s+{TimeRegexWithDotConnector})(?!\\s*(per\\s+cent?|%))(\\s*({DescRegex}|{TimeSuffix})|\\b)))' + TimeRegex4 = f'\\b(({DescRegex}?)|({BasicTime}\\s*)?({GeneralDescRegex}?)){TimePrefix}(\\s*({HourNumRegex}|{BaseDateTime.HourRegex}))?(\\s+{TensTimeRegex}(\\s*(i\\s+)?{MinuteNumRegex})?)?(\\s*({OclockRegex}|{DescRegex})|\\b)' + TimeRegex5 = f'\\b({TimePrefix}|{BasicTime}{TimePrefix})\\s+(\\s*{DescRegex})?{BasicTime}?\\s*{TimeSuffix}\\b' + TimeRegex6 = f'({BasicTime}(\\s*{DescRegex})?\\s+{TimeSuffix}\\b)' + TimeRegex7 = f'\\b{TimeSuffix}\\s+a\\s+les\\s+{BasicTime}((\\s*{DescRegex})|\\b)' + TimeRegex8 = f'\\b{TimeSuffix}\\s+{BasicTime}((\\s*{DescRegex})|\\b)' + TimeRegex9 = f'\\b(?{HourNumRegex}\\s+({TensTimeRegex}\\s*)(i\\s+)?{MinuteNumRegex}?)\\b' + TimeRegex11 = f'\\b({WrittenTimeRegex})(\\s+{DescRegex})?\\b' + TimeRegex12 = f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' + NowRegex = '\\b(?(just\\s+)?ara(\\s+mateix)?|en\\s+aquest\\s+moment|tan\\s+aviat\\s +com\\s+sigui\\s+possible|tan\\s+aviat\\s+com\\s+(pugui|podes|podem|poden)|el\\s+m[aà]s\\s +aviat\\s+possible|recentment|prèviament|aquest llavors)\\b' + Tomorrow = 'matí' + DayOfWeek = dict( + [ + ("dilluns", 1), + ("dimarts", 2), + ("dimecres", 3), + ("dijous", 4), + ("divendres", 5), + ("dissabte", 6), + ("diumenge", 0), + ("sa", 6), + ] + ) + MonthOfYear = dict( + [ + ("gener", 1), + ("febrer", 2), + ("març", 3), + ("marc", 3), + ("abril", 4), + ("maig", 5), + ("juny", 6), + ("juliol", 7), + ("agost", 8), + ("setembre", 9), + ("octubre", 10), + ("novembre", 11), + ("desembre", 12), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ("u", 1), + ("un", 1), + ("una", 1), + ("dos", 2), + ("tres", 3), + ("trés", 3), + ("quatre", 4), + ("cinc", 5), + ("sis", 6), + ("set", 7), + ("vuit", 8), + ("nou", 9), + ("deu", 10), + ("onze", 11), + ("dotze", 12), + ("docena", 12), + ("dotzenes", 12), + ] + ) + Numbers = dict( + [ + ("zero", 0), + ("u", 1), + ("un", 1), + ("una", 1), + ("dos", 2), + ("dues", 2), + ("tres", 3), + ("trés", 3), + ("quatre", 4), + ("cinc", 5), + ("sis", 6), + ("set", 7), + ("vuit", 8), + ("nou", 9), + ("deu", 10), + ("onze", 11), + ("dotze", 12), + ("docena", 12), + ("dotzenes", 12), + ("tretze", 13), + ("catorze", 14), + ("quinze", 15), + ("setze", 16), + ("disset", 17), + ("divuit", 18), + ("dinou", 19), + ("vint", 20), + ("veinti", 20), + ("ventiuna", 21), + ("ventiuno", 21), + ("vint-i-un", 21), + ("vint-i-una", 21), + ("vint-i-dos", 22), + ("vint-i-tres", 23), + ("vint-i-quatre", 24), + ("vint-i-cinc", 25), + ("vint-i-sis", 26), + ("vint-sis", 26), + ("vint-i-set", 27), + ("vint-i-vuit", 28), + ("vint-i-nou", 29), + ("treinta", 30), + ("quaranta", 40), + ("cinquanta", 50), + ] + ) + DayOfMonth = dict( + [ + ("u", 1), + ("un", 1), + ("dos", 2), + ("tres", 3), + ("quatre", 4), + ("cinc", 5), + ("sis", 6), + ("set", 7), + ("vuit", 8), + ("nou", 9), + ("deu", 10), + ("onze", 11), + ("dotze", 12), + ("tretze", 13), + ("catorze", 14), + ("quinze", 15), + ("setze", 16), + ("disset", 17), + ("divuit", 18), + ("dinou", 19), + ("vint", 20), + ("vint-i-un", 21), + ("vint-i-dos", 22), + ("vint-i-tres", 23), + ("vint-i-quatre", 24), + ("vint-i-cinc", 25), + ("vint-i-sis", 26), + ("vint-i-set", 27), + ("vint-i-vuit", 28), + ("vint-i-nou", 29), + ("trenta", 30), + ("trenta-un", 31), + ] + ) + DefaultLanguageFallback = 'DMY' + + +# pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/chinese_date_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/chinese_date_time.py index d2287ecda5..6c64db354a 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/chinese_date_time.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/chinese_date_time.py @@ -9,52 +9,55 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_date_time import BaseDateTime +from .base_date_time import BaseDateTime, BaseDateTimeResource + + # pylint: disable=line-too-long -class ChineseDateTime: +class ChineseDateTime(BaseDateTimeResource): LangMarker = 'Chi' - MonthRegex = f'(?正月|一月|二月|三月|四月|五月|六月|七月|八月|九月|十月|十一月|十二月|01月|02月|03月|04月|05月|06月|07月|08月|09月|10月|11月|12月|1月|2月|3月|4月|5月|6月|7月|8月|9月|大年(?!龄|纪|级))' - DayRegex = f'(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|1|2|3|4|5|6|7|8|9)' - OneToNineIntegerRegex = f'[一二三四五六七八九壹贰叁肆伍陆柒捌玖]' + CheckBothBeforeAfter = None + MonthRegex = '(?正月|一月|二月|三月|四月|五月|六月|七月|八月|九月|十月|十一月|十二月|01月|02月|03月|04月|05月|06月|07月|08月|09月|10月|11月|12月|1月|2月|3月|4月|5月|6月|7月|8月|9月|大年(?!龄|纪|级))' + DayRegex = '(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|1|2|3|4|5|6|7|8|9)' + OneToNineIntegerRegex = '[一二三四五六七八九壹贰叁肆伍陆柒捌玖]' DateDayRegexInCJK = f'(?(([12][0-9]|3[01]|[1-9]|[三叁][十拾][一壹]?|[二贰貳]?[十拾]({OneToNineIntegerRegex})?|{OneToNineIntegerRegex})[日号]|初一|三十))' DayRegexNumInCJK = f'(?[12][0-9]|3[01]|[1-9]|[三叁][十拾][一壹]?|[二贰貳]?[十拾]({OneToNineIntegerRegex})?|{OneToNineIntegerRegex}|廿|卅)' - MonthNumRegex = f'(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)' + MonthNumRegex = '(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)' TwoNumYear = '50' - YearNumRegex = f'(?((1[5-9]|20)\\d{{2}})|2100)' - SimpleYearRegex = f'(?(\\d{{2,4}}))' - ZeroToNineIntegerRegexCJK = f'[一二三四五六七八九零壹贰叁肆伍陆柒捌玖〇两千俩倆仨]' + YearNumRegex = '(?((1[5-9]|20)\\d{2})|2100)' + SimpleYearRegex = '(?(\\d{2,4}))' + ZeroToNineIntegerRegexCJK = '[一二三四五六七八九零壹贰叁肆伍陆柒捌玖〇两千俩倆仨]' DynastyStartYear = '元' - RegionTitleRegex = f'(贞观|开元|神龙|洪武|建文|永乐|景泰|天顺|成化|嘉靖|万历|崇祯|顺治|康熙|雍正|乾隆|嘉庆|道光|咸丰|同治|光绪|宣统|民国)' + RegionTitleRegex = '(贞观|开元|神龙|洪武|建文|永乐|景泰|天顺|成化|嘉靖|万历|崇祯|顺治|康熙|雍正|乾隆|嘉庆|道光|咸丰|同治|光绪|宣统|民国)' DynastyYearRegex = f'(?{RegionTitleRegex})(?({DynastyStartYear}|\\d{{1,3}}|[十拾]?({ZeroToNineIntegerRegexCJK}[十百拾佰]?){{0,3}}))' DateYearInCJKRegex = f'(?({ZeroToNineIntegerRegexCJK}{ZeroToNineIntegerRegexCJK}{ZeroToNineIntegerRegexCJK}{ZeroToNineIntegerRegexCJK}|{ZeroToNineIntegerRegexCJK}{ZeroToNineIntegerRegexCJK}|{ZeroToNineIntegerRegexCJK}{ZeroToNineIntegerRegexCJK}{ZeroToNineIntegerRegexCJK}|{DynastyYearRegex}))' - WeekDayRegex = f'(?周日|周天|周一|周二|周三|周四|周五|周六|星期一|星期二|星期三|星期四|星期五|星期六|星期日|星期天|礼拜一|礼拜二|礼拜三|礼拜四|礼拜五|礼拜六|礼拜日|礼拜天|禮拜一|禮拜二|禮拜三|禮拜四|禮拜五|禮拜六|禮拜日|禮拜天|週日|週天|週一|週二|週三|週四|週五|週六)' - WeekDayStartEnd = f'^[.]' - LunarRegex = f'(农历|初一|正月|大年(?!龄|纪|级))' + WeekDayRegex = '(?周日|周天|周一|周二|周三|周四|周五|周六|星期一|星期二|星期三|星期四|星期五|星期六|星期日|星期天|礼拜一|礼拜二|礼拜三|礼拜四|礼拜五|礼拜六|礼拜日|礼拜天|禮拜一|禮拜二|禮拜三|禮拜四|禮拜五|禮拜六|禮拜日|禮拜天|週日|週天|週一|週二|週三|週四|週五|週六)' + WeekDayStartEnd = '^[.]' + LunarRegex = '(农历|初一|正月|大年(?!龄|纪|级))' DateThisRegex = f'(这个|这一个|这|这一|本){WeekDayRegex}' DateLastRegex = f'(上一个|上个|上一|上|最后一个|最后)(的)?{WeekDayRegex}' DateNextRegex = f'(下一个|下个|下一|下)(的)?{WeekDayRegex}' - WeekWithWeekDayRangeRegex = f'^[.]' - WoMLastRegex = f'最后一' - WoMPreviousRegex = f'上个' - WoMNextRegex = f'下个' - SpecialMonthRegex = f'^[.]' - SpecialYearRegex = f'^[.]' - MonthDayRange = f'^[.]' - SpecialDayRegex = f'(最近|前天|后天|昨天|明天|今天|今日|明日|昨日|大后天|大前天|後天|大後天)' - SpecialDayWithNumRegex = f'^[.]' + WeekWithWeekDayRangeRegex = '^[.]' + WoMLastRegex = '最后一' + WoMPreviousRegex = '上个' + WoMNextRegex = '下个' + SpecialMonthRegex = '^[.]' + SpecialYearRegex = '^[.]' + MonthDayRange = '^[.]' + SpecialDayRegex = '(最近|前天|后天|昨天|明天|今天|今日|明日|昨日|大后天|大前天|後天|大後天)' + SpecialDayWithNumRegex = '^[.]' WeekDayOfMonthRegex = f'((({MonthRegex}|{MonthNumRegex})的\\s*)(?第一个|第二个|第三个|第四个|第五个|最后一个)\\s*{WeekDayRegex})' - WeekDayAndDayRegex = f'^[.]' - ThisPrefixRegex = f'这个|这一个|这|这一|本|今' - LastPrefixRegex = f'上个|上一个|上|上一|去' - NextPrefixRegex = f'下个|下一个|下|下一|明' + WeekDayAndDayRegex = '^[.]' + ThisPrefixRegex = '这个|这一个|这|这一|本|今' + LastPrefixRegex = '上个|上一个|上|上一|去' + NextPrefixRegex = '下个|下一个|下|下一|明' RelativeRegex = f'(?({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex}))' SpecialDate = f'(?({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex})年)?(?({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex})月)?{DateDayRegexInCJK}' - DateUnitRegex = f'(?年|个月|周|週|日|天)' - BeforeRegex = f'以前|之前|前' - AfterRegex = f'以后|以後|之后|之後|后|後|还剩' - TimePeriodLeftRegex = f'还剩' + DateUnitRegex = '(?年|个月|周|週|日|天)' + BeforeRegex = '以前|之前|前' + AfterRegex = '以后|以後|之后|之後|后|後|还剩' + TimePeriodLeftRegex = '还剩' DateRegexList1 = f'({LunarRegex}(\\s*))?((({SimpleYearRegex}|{DateYearInCJKRegex})年)(\\s*))?{MonthRegex}(\\s*){DateDayRegexInCJK}((\\s*|,|,){WeekDayRegex})?' DateRegexList2 = f'((({SimpleYearRegex}|{DateYearInCJKRegex})年)(\\s*))?({LunarRegex}(\\s*))?{MonthRegex}(\\s*){DateDayRegexInCJK}((\\s*|,|,){WeekDayRegex})?' DateRegexList3 = f'((({SimpleYearRegex}|{DateYearInCJKRegex})年)(\\s*))?({LunarRegex}(\\s*))?{MonthRegex}(\\s*)({DayRegexNumInCJK}|{DayRegex})((\\s*|,|,){WeekDayRegex})?' @@ -63,191 +66,246 @@ class ChineseDateTime: DateRegexList6 = f'{MonthNumRegex}\\s*[/\\\\\\-]\\s*{DayRegex}\\s*[/\\\\\\-]\\s*{SimpleYearRegex}' DateRegexList7 = f'{DayRegex}\\s*[/\\\\\\-\\.]\\s*{MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*{SimpleYearRegex}' DateRegexList8 = f'{SimpleYearRegex}\\s*[/\\\\\\-\\. ]\\s*{MonthNumRegex}\\s*[/\\\\\\-\\. ]\\s*{DayRegex}' - DatePeriodTillRegex = f'(?到|至|--|-|—|——|~|–)' - DatePeriodRangeSuffixRegex = f'^\\b$' - DatePeriodRangePrefixRegex = f'从' - DatePeriodTillSuffixRequiredRegex = f'(?与|和)' - DatePeriodDayRegexInCJK = f'(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号|一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|三十|廿|卅)' - DatePeriodThisRegex = f'这个|这一个|这|这一|本' - DatePeriodLastRegex = f'上个|上一个|上|上一' - DatePeriodNextRegex = f'下个|下一个|下|下一' + DatePeriodTillRegex = '(?到|至|--|-|—|——|~|–)' + DatePeriodRangeSuffixRegex = '^\\b$' + DatePeriodRangePrefixRegex = '从' + DatePeriodTillSuffixRequiredRegex = '(?与|和)' + DatePeriodDayRegexInCJK = '(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号|一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|三十|廿|卅)' + DatePeriodThisRegex = '这个|这一个|这|这一|本' + DatePeriodLastRegex = '上个|上一个|上|上一' + DatePeriodNextRegex = '下个|下一个|下|下一' + DatePeriodNextNextRegex = '下下' RelativeMonthRegex = f'(?({DatePeriodThisRegex}|{DatePeriodLastRegex}|{DatePeriodNextRegex})\\s*月)' - HalfYearRegex = f'((?(上|前)半年)|(?(下|后)半年))' + HalfYearRegex = '((?(上|前)半年)|(?(下|后)半年))' YearRegex = f'(({YearNumRegex})(\\s*年)?|({SimpleYearRegex})\\s*年){HalfYearRegex}?' StrictYearRegex = f'({YearRegex}(?=[\\u4E00-\\u9FFF]|\\s|$|\\W))' - YearRegexInNumber = f'(?(\\d{{4}}))' + YearRegexInNumber = '(?(\\d{4}))' DatePeriodYearInCJKRegex = f'{DateYearInCJKRegex}年{HalfYearRegex}?' MonthSuffixRegex = f'(?({RelativeMonthRegex}|{MonthRegex}))' SimpleCasesRegex = f'((从)\\s*)?(({YearRegex}|{DatePeriodYearInCJKRegex})\\s*)?{MonthSuffixRegex}({DatePeriodDayRegexInCJK}|{DayRegex})\\s*{DatePeriodTillRegex}\\s*({DatePeriodDayRegexInCJK}|{DayRegex})((\\s+|\\s*,\\s*){YearRegex})?' YearAndMonth = f'({DatePeriodYearInCJKRegex}|{YearRegex}|(?明年|今年|去年))\\s*({MonthRegex}|的?(?第一|第二|第三|第四|第五|第六|第七|第八|第九|第十|第十一|第十二|最后一)\\s*个月\\s*)' SimpleYearAndMonth = f'({YearNumRegex}[/\\\\\\-]{MonthNumRegex}\\b$)' - PureNumYearAndMonth = f'({YearRegexInNumber}\\s*[-\\.\\/]\\s*{MonthNumRegex})|({MonthNumRegex}\\s*\\/\\s*{YearRegexInNumber})' - OneWordPeriodRegex = f'(((?(明|今|去)年)\\s*)?{MonthRegex}|({DatePeriodThisRegex}|{DatePeriodLastRegex}|{DatePeriodNextRegex})(?半)?\\s*(周末|周|月|年)|周末|(今|明|去|前|后)年(\\s*{HalfYearRegex})?)' - LaterEarlyPeriodRegex = f'^[.]' - DatePointWithAgoAndLater = f'^[.]' + PureNumYearAndMonth = ( + f'({YearRegexInNumber}\\s*[-\\.\\/]\\s*{MonthNumRegex})|({MonthNumRegex}\\s*\\/\\s*{YearRegexInNumber})' + ) + OneWordPeriodRegex = f'(((?(明|今|去)年)\\s*)?{MonthRegex}|({DatePeriodThisRegex}|{DatePeriodLastRegex}|{DatePeriodNextNextRegex}|{DatePeriodNextRegex})(?半)?\\s*(周末|周|月|年)|周末|(今|明|去|前|后)年(\\s*{HalfYearRegex})?)' + LaterEarlyPeriodRegex = '^[.]' + DatePointWithAgoAndLater = '^[.]' WeekOfMonthRegex = f'(?{MonthSuffixRegex}的(?第一|第二|第三|第四|第五|最后一)\\s*周\\s*)' WeekOfYearRegex = f'(?({YearRegex}|{RelativeRegex}年)的(?第一|第二|第三|第四|第五|最后一)\\s*周\\s*)' - WeekOfDateRegex = f'^[.]' - MonthOfDateRegex = f'^[.]' - RestOfDateRegex = f'^[.]' - UnitRegex = f'(?年|(?(个)?月|周|週|日|天))' + WeekOfDateRegex = '^[.]' + MonthOfDateRegex = '^[.]' + RestOfDateRegex = '^[.]' + UnitRegex = '(?年|(?(个)?月|周|週|日|天))' FollowedUnit = f'^\\s*{UnitRegex}' NumberCombinedWithUnit = f'(?\\d+(\\.\\d*)?){UnitRegex}' - DateRangePrepositions = f'((从|在|自)\\s*)?' + DateRangePrepositions = '((从|在|自)\\s*)?' YearToYear = f'({DateRangePrepositions})({DatePeriodYearInCJKRegex}|{YearRegex})\\s*({DatePeriodTillRegex}|后|後|之后|之後)\\s*({DatePeriodYearInCJKRegex}|{YearRegex})(\\s*((之间|之内|期间|中间|间)|前|之前))?' YearToYearSuffixRequired = f'({DateRangePrepositions})({DatePeriodYearInCJKRegex}|{YearRegex})\\s*({DatePeriodTillSuffixRequiredRegex})\\s*({DatePeriodYearInCJKRegex}|{YearRegex})\\s*(之间|之内|期间|中间|间)' MonthToMonth = f'({DateRangePrepositions})({MonthRegex}){DatePeriodTillRegex}({MonthRegex})' MonthToMonthSuffixRequired = f'({DateRangePrepositions})({MonthRegex}){DatePeriodTillSuffixRequiredRegex}({MonthRegex})\\s*(之间|之内|期间|中间|间)' - DayToDay = f'^[.]' - DayRegexForPeriod = f'^[.]' - FirstLastOfYearRegex = f'(({DatePeriodYearInCJKRegex}|{YearRegex}|(?明年|今年|去年))的?)((?前)|(?(最后|最後)))' - ComplexDatePeriodRegex = f'^[.]' - PastRegex = f'(?(之前|前|上|近|过去))' - FutureRegex = f'(?(之后|之後|后|後|(?春|夏|秋|冬)(天|季)?' - WhichWeekRegex = f'^[.]' + DayToDay = '^[.]' + DayRegexForPeriod = '^[.]' + FirstLastOfYearRegex = ( + f'(({DatePeriodYearInCJKRegex}|{YearRegex}|(?明年|今年|去年))的?)((?前)|(?(最后|最後)))' + ) + ComplexDatePeriodRegex = '^[.]' + PastRegex = '(?(之前|前|上|近|过去))' + FutureRegex = '(?(之后|之後|后|後|(?春|夏|秋|冬)(天|季)?' + WhichWeekRegex = '^[.]' SeasonWithYear = f'(({YearRegex}|{DatePeriodYearInCJKRegex}|(?明年|今年|去年))(的)?)?{SeasonRegex}' QuarterRegex = f'(({YearRegex}|{DatePeriodYearInCJKRegex}|(?明年|今年|去年))(的)?)?(第(?1|2|3|4|一|二|三|四)季度)' - CenturyNumRegex = f'^[.]' - CenturyRegex = f'(?\\d|1\\d|2\\d)世纪' - CenturyRegexInCJK = f'(?一|二|三|四|五|六|七|八|九|十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|二十一|二十二)世纪' + CenturyNumRegex = '^[.]' + CenturyRegex = '(?\\d|1\\d|2\\d)世纪' + CenturyRegexInCJK = ( + '(?一|二|三|四|五|六|七|八|九|十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|二十一|二十二)世纪' + ) RelativeCenturyRegex = f'(?({DatePeriodLastRegex}|{DatePeriodThisRegex}|{DatePeriodNextRegex}))世纪' - DecadeRegexInCJK = f'(?十|一十|二十|三十|四十|五十|六十|七十|八十|九十)' + DecadeRegexInCJK = '(?十|一十|二十|三十|四十|五十|六十|七十|八十|九十)' DecadeRegex = f'(?({CenturyRegex}|{CenturyRegexInCJK}|{RelativeCenturyRegex}))?(?(\\d0|{DecadeRegexInCJK}))年代' - PrepositionRegex = f'(?^的|在$)' - NowRegex = f'(?现在|马上|立刻|刚刚才|刚刚|刚才|这会儿|当下|此刻)' - NightRegex = f'(?早|晚)' - TimeOfSpecialDayRegex = f'(今晚|今早|今晨|明晚|明早|明晨|昨晚)(的|在)?' - DateTimePeriodTillRegex = f'(?到|直到|--|-|—|——)' - DateTimePeriodPrepositionRegex = f'(?^\\s*的|在\\s*$)' - BeforeAfterRegex = f'^\\b$' + PrepositionRegex = '(?^的|在$)' + NowRegex = '(?现在|马上|立刻|刚刚才|刚刚|刚才|这会儿|当下|此刻)' + NightRegex = '(?早|晚)' + TimeOfSpecialDayRegex = '(今晚|今早|今晨|明晚|明早|明晨|昨晚)(的|在)?' + DateTimePeriodTillRegex = '(?到|直到|--|-|—|——)' + DateTimePeriodPrepositionRegex = '(?^\\s*的|在\\s*$)' + BeforeAfterRegex = '^\\b$' HourRegex = f'\\b{BaseDateTime.HourRegex}' - HourNumRegex = f'(?[零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)' - ZhijianRegex = f'^\\s*(之间|之内|期间|中间|间)' - DateTimePeriodThisRegex = f'这个|这一个|这|这一' - DateTimePeriodLastRegex = f'上个|上一个|上|上一' - DateTimePeriodNextRegex = f'下个|下一个|下|下一' - AmPmDescRegex = f'(?(am|a\\.m\\.|a m|a\\. m\\.|a\\.m|a\\. m|a m|pm|p\\.m\\.|p m|p\\. m\\.|p\\.m|p\\. m|p m|上午|中午|下午|午后|晚上|夜里|夜晚|夜间|深夜|傍晚|晚|早间?))' - TimeOfDayRegex = f'(?凌晨|清晨|早上|早间|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|夜间|深夜|傍晚|晚)' + HourNumRegex = '(?[零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)' + ZhijianRegex = '^\\s*(之间|之内|期间|中间|间)' + DateTimePeriodThisRegex = '这个|这一个|这|这一' + DateTimePeriodLastRegex = '上个|上一个|上|上一' + DateTimePeriodNextRegex = '下个|下一个|下|下一' + AmPmDescRegex = '(?(am|a\\.m\\.|a m|a\\. m\\.|a\\.m|a\\. m|a m|pm|p\\.m\\.|p m|p\\. m\\.|p\\.m|p\\. m|p m|上午|中午|下午|午后|晚上|夜里|夜晚|夜间|深夜|傍晚|晚|早间?))' + TimeOfDayRegex = '(?凌晨|清晨|早上|早间|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|夜间|深夜|傍晚|晚)' SpecificTimeOfDayRegex = f'((({DateTimePeriodThisRegex}|{DateTimePeriodNextRegex}|{DateTimePeriodLastRegex})\\s+{TimeOfDayRegex})|(今晚|今早|今晨|明晚|明早|明晨|昨晚))' - DateTimePeriodUnitRegex = f'(个)?(?(小时|钟头|分钟|秒钟|时|分|秒))' + DateTimePeriodUnitRegex = '(个)?(?(小时|钟头|分钟|秒钟|时|分|秒))' DateTimePeriodFollowedUnit = f'^\\s*{DateTimePeriodUnitRegex}' DateTimePeriodNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?){DateTimePeriodUnitRegex}' - DurationAllRegex = f'^[.]' - DurationHalfRegex = f'^[.]' - DurationRelativeDurationUnitRegex = f'^[.]' - AgoLaterRegex = f'^[.]' - DurationDuringRegex = f'^[.]' - DurationSomeRegex = f'^[.]' - DurationMoreOrLessRegex = f'^[.]' - DurationYearRegex = f'((\\d{{3,4}})|0\\d|两千)\\s*年' - DurationHalfSuffixRegex = f'半' - DurationSuffixList = dict([("M", "分钟"), - ("S", "秒钟|秒"), - ("H", "个小时|小时|个钟头|钟头|时"), - ("D", "天"), - ("W", "星期|个星期|周|週"), - ("Mon", "个月"), - ("Y", "年")]) - DurationAmbiguousUnits = [r'分钟', r'秒钟', r'秒', r'个小时', r'小时', r'天', r'星期', r'个星期', r'周', r'週', r'个月', r'年', r'时'] + DurationAllRegex = '^[.]' + DurationHalfRegex = '^[.]' + DurationRelativeDurationUnitRegex = '^[.]' + AgoLaterRegex = '^[.]' + DurationDuringRegex = '^[.]' + DurationSomeRegex = '^[.]' + DurationMoreOrLessRegex = '^[.]' + YearSuffix = '^[.]' + MonthEnd = '^[.]' + OfMonth = '^[.]' + WeekDayStart = '^[.]' + WeekDayEnd = '^[.]' + ForTheRegex = '^[.]' + WeekDayAndDayOfMonthRegex = '^[.]' + RelativeMonthNumRegex = '^[.]' + SinceYearSuffixRegex = '^[.]' + RangeUnitRegex = '^[.]' + InConnectorRegex = '^[.]' + LessThanRegex = '^[.]' + MoreThanRegex = '^[.]' + PrefixArticleRegex = '^[.]' + StrictRelativeRegex = '^[.]' + DurationYearRegex = '((\\d{3,4})|0\\d|两千)\\s*年' + DurationHalfSuffixRegex = '半' + DurationSuffixList = dict( + [ + ("M", "分钟"), + ("S", "秒钟|秒"), + ("H", "个小时|小时|个钟头|钟头|时"), + ("D", "天"), + ("W", "星期|个星期|周|週"), + ("Mon", "个月"), + ("Y", "年"), + ] + ) + DurationAmbiguousUnits = [ + r'分钟', + r'秒钟', + r'秒', + r'个小时', + r'小时', + r'天', + r'星期', + r'个星期', + r'周', + r'週', + r'个月', + r'年', + r'时', + ] DurationUnitRegex = f'(?{DateUnitRegex}|分钟?|秒钟?|个?小时|时|个?钟头|天|个?星期|周|週|个?月|年)' - AnUnitRegex = f'^[.]' - DurationConnectorRegex = f'^\\s*(?[多又余零]?)\\s*$' - ConnectorRegex = f'^\\s*,\\s*$' + AnUnitRegex = '^[.]' + DurationConnectorRegex = '^\\s*(?[多又余零]?)\\s*$' + ConnectorRegex = '^\\s*,\\s*$' LunarHolidayRegex = f'(({YearRegex}|{DatePeriodYearInCJKRegex}|(?明年|今年|去年))(的)?)?(?除夕|春节|中秋节|中秋|元宵节|端午节|端午|重阳节)' HolidayRegexList1 = f'(({YearRegex}|{DatePeriodYearInCJKRegex}|(?明年|今年|去年))(的)?)?(?新年|五一|劳动节|元旦节|元旦|愚人节|平安夜|圣诞节|植树节|国庆节|情人节|教师节|儿童节|妇女节|青年节|建军节|女生节|光棍节|双十一|清明节|清明)' HolidayRegexList2 = f'(({YearRegex}|{DatePeriodYearInCJKRegex}|(?明年|今年|去年))(的)?)?(?母亲节|父亲节|感恩节|万圣节)' - SetUnitRegex = f'(?年|月|周|星期|日|天|小时|时|分钟|分|秒钟|秒)' - SetEachUnitRegex = f'(?(每个|每一|每)\\s*{SetUnitRegex})' - SetEachPrefixRegex = f'(?(每)\\s*$)' - SetEachSuffixRegex = f'^[.]' - SetLastRegex = f'(?last|this|next)' - SetEachDayRegex = f'(每|每一)(天|日)\\s*$' - SetEachDateUnitRegex = f'^[.]' - TimeHourNumRegex = f'(00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)' - TimeMinuteNumRegex = f'(00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|0|1|2|3|4|5|6|7|8|9)' - TimeSecondNumRegex = f'(00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|0|1|2|3|4|5|6|7|8|9)' - TimeHourCJKRegex = f'([零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)' - TimeMinuteCJKRegex = f'([二三四五]?十[一二三四五六七八九]?|六十|[零〇一二三四五六七八九])' + TimeHourNumRegex = ( + '(00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)' + ) + TimeMinuteNumRegex = '(00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|0|1|2|3|4|5|6|7|8|9)' + TimeSecondNumRegex = '(00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|0|1|2|3|4|5|6|7|8|9)' + TimeHourCJKRegex = '([零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)' + TimeMinuteCJKRegex = '([二三四五]?十[一二三四五六七八九]?|六十|[零〇一二三四五六七八九])' TimeSecondCJKRegex = f'{TimeMinuteCJKRegex}' - TimeClockDescRegex = f'(点\\s*整|点\\s*钟|点|时)' - TimeMinuteDescRegex = f'(分钟|分|)' - TimeSecondDescRegex = f'(秒钟|秒)' - TimeBanHourPrefixRegex = f'(第)' + TimeClockDescRegex = '(点\\s*整|点\\s*钟|点|时)' + TimeMinuteDescRegex = '(分钟|分|)' + TimeSecondDescRegex = '(秒钟|秒)' + TimeBanHourPrefixRegex = '(第)' TimeHourRegex = f'(?{TimeHourCJKRegex}|{TimeHourNumRegex}){TimeClockDescRegex}' TimeMinuteRegex = f'(?{TimeMinuteCJKRegex}|{TimeMinuteNumRegex}){TimeMinuteDescRegex}' TimeSecondRegex = f'(?{TimeSecondCJKRegex}|{TimeSecondNumRegex}){TimeSecondDescRegex}' - TimeHalfRegex = f'(?过半|半)' - TimeQuarterRegex = f'(?[一两二三四1-4])\\s*(刻钟|刻)' - TimeCJKTimeRegex = f'{TimeHourRegex}({TimeQuarterRegex}|{TimeHalfRegex}|((过|又)?{TimeMinuteRegex})({TimeSecondRegex})?)?' + TimeHalfRegex = '(?过半|半)' + TimeQuarterRegex = '(?[一两二三四1-4])\\s*(刻钟|刻)' + TimeCJKTimeRegex = ( + f'{TimeHourRegex}({TimeQuarterRegex}|{TimeHalfRegex}|((过|又)?{TimeMinuteRegex})({TimeSecondRegex})?)?' + ) TimeDigitTimeRegex = f'(?{TimeHourNumRegex}):(?{TimeMinuteNumRegex})(:(?{TimeSecondNumRegex}))?' - TimeDayDescRegex = f'(?凌晨|清晨|早上|早间|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|午夜|夜间|深夜|傍晚|晚)' - TimeApproximateDescPreffixRegex = f'(大[约概]|差不多|可能|也许|约|不超过|不多[于过]|最[多长少]|少于|[超短长多]过|几乎要|将近|差点|快要|接近|至少|起码|超出|不到)' - TimeApproximateDescSuffixRegex = f'(左右)' - TimeRegexes1 = f'{TimeApproximateDescPreffixRegex}?{TimeDayDescRegex}?{TimeCJKTimeRegex}{TimeApproximateDescSuffixRegex}?' + TimeDayDescRegex = ( + '(?凌晨|清晨|早上|早间|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|午夜|夜间|深夜|傍晚|晚)' + ) + TimeApproximateDescPreffixRegex = '(大[约概]|差不多|可能|也许|约|不超过|不多[于过]|最[多长少]|少于|[超短长多]过|几乎要|将近|差点|快要|接近|至少|起码|超出|不到)' + TimeApproximateDescSuffixRegex = '(左右)' + TimeRegexes1 = ( + f'{TimeApproximateDescPreffixRegex}?{TimeDayDescRegex}?{TimeCJKTimeRegex}{TimeApproximateDescSuffixRegex}?' + ) TimeRegexes2 = f'{TimeApproximateDescPreffixRegex}?{TimeDayDescRegex}?{TimeDigitTimeRegex}{TimeApproximateDescSuffixRegex}?(\\s*{AmPmDescRegex}?)' TimeRegexes3 = f'差{TimeMinuteRegex}{TimeCJKTimeRegex}' - TimePeriodTimePeriodConnectWords = f'(起|至|到|–|-|—|~|~)' + TimePeriodTimePeriodConnectWords = '(起|至|到|–|-|—|~|~)' TimePeriodLeftCJKTimeRegex = f'(从)?(?{TimeDayDescRegex}?({TimeCJKTimeRegex}))' - TimePeriodRightCJKTimeRegex = f'{TimePeriodTimePeriodConnectWords}(?{TimeDayDescRegex}?{TimeCJKTimeRegex})(之间)?' + TimePeriodRightCJKTimeRegex = ( + f'{TimePeriodTimePeriodConnectWords}(?{TimeDayDescRegex}?{TimeCJKTimeRegex})(之间)?' + ) TimePeriodLeftDigitTimeRegex = f'(从)?(?{TimeDayDescRegex}?({TimeDigitTimeRegex}))' - TimePeriodRightDigitTimeRegex = f'{TimePeriodTimePeriodConnectWords}(?{TimeDayDescRegex}?{TimeDigitTimeRegex})(之间)?' + TimePeriodRightDigitTimeRegex = ( + f'{TimePeriodTimePeriodConnectWords}(?{TimeDayDescRegex}?{TimeDigitTimeRegex})(之间)?' + ) TimePeriodShortLeftCJKTimeRegex = f'(从)?(?{TimeDayDescRegex}?({TimeHourCJKRegex}))' TimePeriodShortLeftDigitTimeRegex = f'(从)?(?{TimeDayDescRegex}?({TimeHourNumRegex}))' TimePeriodRegexes1 = f'({TimePeriodLeftDigitTimeRegex}{TimePeriodRightDigitTimeRegex}|{TimePeriodLeftCJKTimeRegex}{TimePeriodRightCJKTimeRegex})' TimePeriodRegexes2 = f'({TimePeriodShortLeftDigitTimeRegex}{TimePeriodRightDigitTimeRegex}|{TimePeriodShortLeftCJKTimeRegex}{TimePeriodRightCJKTimeRegex})' - FromToRegex = f'(从|自).+([至到]).+' - AmbiguousRangeModifierPrefix = f'(从|自)' - ReferenceDatePeriodRegex = f'^[.]' - UnspecificDatePeriodRegex = f'^[.]' - ParserConfigurationBefore = f'((?和|或|及)?(之前|以前)|前)' - ParserConfigurationAfter = f'((?和|或|及)?(之后|之後|以后|以後)|后|後)' - ParserConfigurationUntil = f'(直到|直至|截至|截止(到)?)' - ParserConfigurationSincePrefix = f'(自从|自|自打|打|从)' - ParserConfigurationSinceSuffix = f'(以来|开始|起)' - ParserConfigurationAroundPrefix = f'^[.]' - ParserConfigurationAroundSuffix = f'^[.]' + FromToRegex = '(从|自).+([至到]).+' + AmbiguousRangeModifierPrefix = '(从|自)' + ReferenceDatePeriodRegex = '^[.]' + UnspecificDatePeriodRegex = '^[.]' + ParserConfigurationBefore = '((?和|或|及)?(之前|以前)|前)' + ParserConfigurationAfter = '((?和|或|及)?(之后|之後|以后|以後)|后|後)' + ParserConfigurationUntil = '(直到|直至|截至|截止(到)?)' + ParserConfigurationSincePrefix = '(自从|自|自打|打|从)' + ParserConfigurationSinceSuffix = '(以来|开始|起)' + ParserConfigurationAroundPrefix = '^[.]' + ParserConfigurationAroundSuffix = '^[.]' ParserConfigurationLastWeekDayRegex = '最后一个' ParserConfigurationNextMonthRegex = '下一个' ParserConfigurationLastMonthRegex = '上一个' ParserConfigurationDatePrefix = ' ' - ParserConfigurationUnitMap = dict([("年", "Y"), - ("月", "MON"), - ("个月", "MON"), - ("日", "D"), - ("周", "W"), - ("週", "W"), - ("天", "D"), - ("小时", "H"), - ("个小时", "H"), - ("时", "H"), - ("分钟", "M"), - ("分", "M"), - ("秒钟", "S"), - ("秒", "S"), - ("星期", "W"), - ("个星期", "W")]) - ParserConfigurationUnitValueMap = dict([("years", 31536000), - ("year", 31536000), - ("months", 2592000), - ("month", 2592000), - ("weeks", 604800), - ("week", 604800), - ("days", 86400), - ("day", 86400), - ("hours", 3600), - ("hour", 3600), - ("hrs", 3600), - ("hr", 3600), - ("h", 3600), - ("minutes", 60), - ("minute", 60), - ("mins", 60), - ("min", 60), - ("seconds", 1), - ("second", 1), - ("secs", 1), - ("sec", 1)]) + DayOfWeek = {} + MonthOfYear = {} + ParserConfigurationUnitMap = dict( + [ + ("年", "Y"), + ("月", "MON"), + ("个月", "MON"), + ("日", "D"), + ("周", "W"), + ("週", "W"), + ("天", "D"), + ("小时", "H"), + ("个小时", "H"), + ("时", "H"), + ("分钟", "M"), + ("分", "M"), + ("秒钟", "S"), + ("秒", "S"), + ("星期", "W"), + ("个星期", "W"), + ] + ) + ParserConfigurationUnitValueMap = dict( + [ + ("years", 31536000), + ("year", 31536000), + ("months", 2592000), + ("month", 2592000), + ("weeks", 604800), + ("week", 604800), + ("days", 86400), + ("day", 86400), + ("hours", 3600), + ("hour", 3600), + ("hrs", 3600), + ("hr", 3600), + ("h", 3600), + ("minutes", 60), + ("minute", 60), + ("mins", 60), + ("min", 60), + ("seconds", 1), + ("second", 1), + ("secs", 1), + ("sec", 1), + ] + ) MonthTerms = [r'月'] WeekendTerms = [r'周末'] WeekTerms = [r'周', r'週', r'星期'] @@ -258,387 +316,403 @@ class ChineseDateTime: NextYearTerms = [r'明年'] YearAfterNextTerms = [r'后年'] YearBeforeLastTerms = [r'前年'] - ParserConfigurationSeasonMap = dict([("春", "SP"), - ("夏", "SU"), - ("秋", "FA"), - ("冬", "WI")]) - ParserConfigurationSeasonValueMap = dict([("SP", 3), - ("SU", 6), - ("FA", 9), - ("WI", 12)]) - ParserConfigurationCardinalMap = dict([("一", 1), - ("二", 2), - ("三", 3), - ("四", 4), - ("五", 5), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("第一个", 1), - ("第二个", 2), - ("第三个", 3), - ("第四个", 4), - ("第五个", 5), - ("第一", 1), - ("第二", 2), - ("第三", 3), - ("第四", 4), - ("第五", 5), - ("第六", 6), - ("第七", 7), - ("第八", 8), - ("第九", 9), - ("第十", 10), - ("第十一", 11), - ("第十二", 12)]) - ParserConfigurationDayOfMonth = dict([("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("13", 13), - ("14", 14), - ("15", 15), - ("16", 16), - ("17", 17), - ("18", 18), - ("19", 19), - ("20", 20), - ("21", 21), - ("22", 22), - ("23", 23), - ("24", 24), - ("25", 25), - ("26", 26), - ("27", 27), - ("28", 28), - ("29", 29), - ("30", 30), - ("31", 31), - ("1日", 1), - ("2日", 2), - ("3日", 3), - ("4日", 4), - ("5日", 5), - ("6日", 6), - ("7日", 7), - ("8日", 8), - ("9日", 9), - ("10日", 10), - ("11日", 11), - ("12日", 12), - ("13日", 13), - ("14日", 14), - ("15日", 15), - ("16日", 16), - ("17日", 17), - ("18日", 18), - ("19日", 19), - ("20日", 20), - ("21日", 21), - ("22日", 22), - ("23日", 23), - ("24日", 24), - ("25日", 25), - ("26日", 26), - ("27日", 27), - ("28日", 28), - ("29日", 29), - ("30日", 30), - ("31日", 31), - ("一日", 1), - ("十一日", 11), - ("二十日", 20), - ("十日", 10), - ("二十一日", 21), - ("三十一日", 31), - ("二日", 2), - ("三日", 3), - ("四日", 4), - ("五日", 5), - ("六日", 6), - ("七日", 7), - ("八日", 8), - ("九日", 9), - ("十二日", 12), - ("十三日", 13), - ("十四日", 14), - ("十五日", 15), - ("十六日", 16), - ("十七日", 17), - ("十八日", 18), - ("十九日", 19), - ("二十二日", 22), - ("二十三日", 23), - ("二十四日", 24), - ("二十五日", 25), - ("二十六日", 26), - ("二十七日", 27), - ("二十八日", 28), - ("二十九日", 29), - ("三十日", 30), - ("1号", 1), - ("2号", 2), - ("3号", 3), - ("4号", 4), - ("5号", 5), - ("6号", 6), - ("7号", 7), - ("8号", 8), - ("9号", 9), - ("10号", 10), - ("11号", 11), - ("12号", 12), - ("13号", 13), - ("14号", 14), - ("15号", 15), - ("16号", 16), - ("17号", 17), - ("18号", 18), - ("19号", 19), - ("20号", 20), - ("21号", 21), - ("22号", 22), - ("23号", 23), - ("24号", 24), - ("25号", 25), - ("26号", 26), - ("27号", 27), - ("28号", 28), - ("29号", 29), - ("30号", 30), - ("31号", 31), - ("一号", 1), - ("十一号", 11), - ("二十号", 20), - ("十号", 10), - ("二十一号", 21), - ("三十一号", 31), - ("二号", 2), - ("三号", 3), - ("四号", 4), - ("五号", 5), - ("六号", 6), - ("七号", 7), - ("八号", 8), - ("九号", 9), - ("十二号", 12), - ("十三号", 13), - ("十四号", 14), - ("十五号", 15), - ("十六号", 16), - ("十七号", 17), - ("十八号", 18), - ("十九号", 19), - ("二十二号", 22), - ("二十三号", 23), - ("二十四号", 24), - ("二十五号", 25), - ("二十六号", 26), - ("二十七号", 27), - ("二十八号", 28), - ("二十九号", 29), - ("三十号", 30), - ("初一", 32), - ("三十", 30), - ("一", 1), - ("十一", 11), - ("二十", 20), - ("十", 10), - ("二十一", 21), - ("三十一", 31), - ("二", 2), - ("三", 3), - ("四", 4), - ("五", 5), - ("六", 6), - ("七", 7), - ("八", 8), - ("九", 9), - ("十二", 12), - ("十三", 13), - ("十四", 14), - ("十五", 15), - ("十六", 16), - ("十七", 17), - ("十八", 18), - ("十九", 19), - ("二十二", 22), - ("二十三", 23), - ("二十四", 24), - ("二十五", 25), - ("二十六", 26), - ("二十七", 27), - ("二十八", 28), - ("二十九", 29)]) - ParserConfigurationDayOfWeek = dict([("星期一", 1), - ("星期二", 2), - ("星期三", 3), - ("星期四", 4), - ("星期五", 5), - ("星期六", 6), - ("星期天", 0), - ("星期日", 0), - ("礼拜一", 1), - ("礼拜二", 2), - ("礼拜三", 3), - ("礼拜四", 4), - ("礼拜五", 5), - ("礼拜六", 6), - ("礼拜天", 0), - ("礼拜日", 0), - ("周一", 1), - ("周二", 2), - ("周三", 3), - ("周四", 4), - ("周五", 5), - ("周六", 6), - ("周日", 0), - ("周天", 0), - ("禮拜一", 1), - ("禮拜二", 2), - ("禮拜三", 3), - ("禮拜四", 4), - ("禮拜五", 5), - ("禮拜六", 6), - ("禮拜天", 0), - ("禮拜日", 0), - ("週一", 1), - ("週二", 2), - ("週三", 3), - ("週四", 4), - ("週五", 5), - ("週六", 6), - ("週日", 0), - ("週天", 0)]) - ParserConfigurationMonthOfYear = dict([("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9), - ("一月", 1), - ("二月", 2), - ("三月", 3), - ("四月", 4), - ("五月", 5), - ("六月", 6), - ("七月", 7), - ("八月", 8), - ("九月", 9), - ("十月", 10), - ("十一月", 11), - ("十二月", 12), - ("1月", 1), - ("2月", 2), - ("3月", 3), - ("4月", 4), - ("5月", 5), - ("6月", 6), - ("7月", 7), - ("8月", 8), - ("9月", 9), - ("10月", 10), - ("11月", 11), - ("12月", 12), - ("01月", 1), - ("02月", 2), - ("03月", 3), - ("04月", 4), - ("05月", 5), - ("06月", 6), - ("07月", 7), - ("08月", 8), - ("09月", 9), - ("正月", 13), - ("大年", 13)]) - DateTimeSimpleAmRegex = f'(?早|晨)' - DateTimeSimplePmRegex = f'(?晚)' - DateTimePeriodMORegex = f'(凌晨|清晨|早上|早间|早|上午)' - DateTimePeriodMIRegex = f'(中午)' - DateTimePeriodAFRegex = f'(下午|午后|傍晚)' - DateTimePeriodEVRegex = f'(晚上|夜里|夜晚|晚)' - DateTimePeriodNIRegex = f'(半夜|夜间|深夜)' + ParserConfigurationSeasonMap = dict([("春", "SP"), ("夏", "SU"), ("秋", "FA"), ("冬", "WI")]) + ParserConfigurationSeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + ParserConfigurationCardinalMap = dict( + [ + ("一", 1), + ("二", 2), + ("三", 3), + ("四", 4), + ("五", 5), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("第一个", 1), + ("第二个", 2), + ("第三个", 3), + ("第四个", 4), + ("第五个", 5), + ("第一", 1), + ("第二", 2), + ("第三", 3), + ("第四", 4), + ("第五", 5), + ("第六", 6), + ("第七", 7), + ("第八", 8), + ("第九", 9), + ("第十", 10), + ("第十一", 11), + ("第十二", 12), + ] + ) + ParserConfigurationDayOfMonth = dict( + [ + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("13", 13), + ("14", 14), + ("15", 15), + ("16", 16), + ("17", 17), + ("18", 18), + ("19", 19), + ("20", 20), + ("21", 21), + ("22", 22), + ("23", 23), + ("24", 24), + ("25", 25), + ("26", 26), + ("27", 27), + ("28", 28), + ("29", 29), + ("30", 30), + ("31", 31), + ("1日", 1), + ("2日", 2), + ("3日", 3), + ("4日", 4), + ("5日", 5), + ("6日", 6), + ("7日", 7), + ("8日", 8), + ("9日", 9), + ("10日", 10), + ("11日", 11), + ("12日", 12), + ("13日", 13), + ("14日", 14), + ("15日", 15), + ("16日", 16), + ("17日", 17), + ("18日", 18), + ("19日", 19), + ("20日", 20), + ("21日", 21), + ("22日", 22), + ("23日", 23), + ("24日", 24), + ("25日", 25), + ("26日", 26), + ("27日", 27), + ("28日", 28), + ("29日", 29), + ("30日", 30), + ("31日", 31), + ("一日", 1), + ("十一日", 11), + ("二十日", 20), + ("十日", 10), + ("二十一日", 21), + ("三十一日", 31), + ("二日", 2), + ("三日", 3), + ("四日", 4), + ("五日", 5), + ("六日", 6), + ("七日", 7), + ("八日", 8), + ("九日", 9), + ("十二日", 12), + ("十三日", 13), + ("十四日", 14), + ("十五日", 15), + ("十六日", 16), + ("十七日", 17), + ("十八日", 18), + ("十九日", 19), + ("二十二日", 22), + ("二十三日", 23), + ("二十四日", 24), + ("二十五日", 25), + ("二十六日", 26), + ("二十七日", 27), + ("二十八日", 28), + ("二十九日", 29), + ("三十日", 30), + ("1号", 1), + ("2号", 2), + ("3号", 3), + ("4号", 4), + ("5号", 5), + ("6号", 6), + ("7号", 7), + ("8号", 8), + ("9号", 9), + ("10号", 10), + ("11号", 11), + ("12号", 12), + ("13号", 13), + ("14号", 14), + ("15号", 15), + ("16号", 16), + ("17号", 17), + ("18号", 18), + ("19号", 19), + ("20号", 20), + ("21号", 21), + ("22号", 22), + ("23号", 23), + ("24号", 24), + ("25号", 25), + ("26号", 26), + ("27号", 27), + ("28号", 28), + ("29号", 29), + ("30号", 30), + ("31号", 31), + ("一号", 1), + ("十一号", 11), + ("二十号", 20), + ("十号", 10), + ("二十一号", 21), + ("三十一号", 31), + ("二号", 2), + ("三号", 3), + ("四号", 4), + ("五号", 5), + ("六号", 6), + ("七号", 7), + ("八号", 8), + ("九号", 9), + ("十二号", 12), + ("十三号", 13), + ("十四号", 14), + ("十五号", 15), + ("十六号", 16), + ("十七号", 17), + ("十八号", 18), + ("十九号", 19), + ("二十二号", 22), + ("二十三号", 23), + ("二十四号", 24), + ("二十五号", 25), + ("二十六号", 26), + ("二十七号", 27), + ("二十八号", 28), + ("二十九号", 29), + ("三十号", 30), + ("初一", 32), + ("三十", 30), + ("一", 1), + ("十一", 11), + ("二十", 20), + ("十", 10), + ("二十一", 21), + ("三十一", 31), + ("二", 2), + ("三", 3), + ("四", 4), + ("五", 5), + ("六", 6), + ("七", 7), + ("八", 8), + ("九", 9), + ("十二", 12), + ("十三", 13), + ("十四", 14), + ("十五", 15), + ("十六", 16), + ("十七", 17), + ("十八", 18), + ("十九", 19), + ("二十二", 22), + ("二十三", 23), + ("二十四", 24), + ("二十五", 25), + ("二十六", 26), + ("二十七", 27), + ("二十八", 28), + ("二十九", 29), + ] + ) + ParserConfigurationDayOfWeek = dict( + [ + ("星期一", 1), + ("星期二", 2), + ("星期三", 3), + ("星期四", 4), + ("星期五", 5), + ("星期六", 6), + ("星期天", 0), + ("星期日", 0), + ("礼拜一", 1), + ("礼拜二", 2), + ("礼拜三", 3), + ("礼拜四", 4), + ("礼拜五", 5), + ("礼拜六", 6), + ("礼拜天", 0), + ("礼拜日", 0), + ("周一", 1), + ("周二", 2), + ("周三", 3), + ("周四", 4), + ("周五", 5), + ("周六", 6), + ("周日", 0), + ("周天", 0), + ("禮拜一", 1), + ("禮拜二", 2), + ("禮拜三", 3), + ("禮拜四", 4), + ("禮拜五", 5), + ("禮拜六", 6), + ("禮拜天", 0), + ("禮拜日", 0), + ("週一", 1), + ("週二", 2), + ("週三", 3), + ("週四", 4), + ("週五", 5), + ("週六", 6), + ("週日", 0), + ("週天", 0), + ] + ) + ParserConfigurationMonthOfYear = dict( + [ + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ("一月", 1), + ("二月", 2), + ("三月", 3), + ("四月", 4), + ("五月", 5), + ("六月", 6), + ("七月", 7), + ("八月", 8), + ("九月", 9), + ("十月", 10), + ("十一月", 11), + ("十二月", 12), + ("1月", 1), + ("2月", 2), + ("3月", 3), + ("4月", 4), + ("5月", 5), + ("6月", 6), + ("7月", 7), + ("8月", 8), + ("9月", 9), + ("10月", 10), + ("11月", 11), + ("12月", 12), + ("01月", 1), + ("02月", 2), + ("03月", 3), + ("04月", 4), + ("05月", 5), + ("06月", 6), + ("07月", 7), + ("08月", 8), + ("09月", 9), + ("正月", 13), + ("大年", 13), + ] + ) + DateTimeSimpleAmRegex = '(?早|晨)' + DateTimeSimplePmRegex = '(?晚)' + DateTimePeriodMORegex = '(凌晨|清晨|早上|早间|早|上午)' + DateTimePeriodMIRegex = '(中午)' + DateTimePeriodAFRegex = '(下午|午后|傍晚)' + DateTimePeriodEVRegex = '(晚上|夜里|夜晚|晚)' + DateTimePeriodNIRegex = '(半夜|夜间|深夜)' AmbiguityTimeFiltersDict = dict([("^[.]", "^[.]")]) AmbiguityTimePeriodFiltersDict = dict([("^[.]", "^[.]")]) AmbiguityDateFiltersDict = dict([("^[.]", "^[.]")]) AmbiguityDateTimeFiltersDict = dict([("^[.]", "^[.]")]) - AmbiguityFiltersDict = dict([("早", "(? +# This code was generated by a tool. +# Changes to this file may cause incorrect behavior and will be lost if +# the code is regenerated. +# +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +# ------------------------------------------------------------------------------ + +from .base_date_time import BaseDateTime, BaseDateTimeResource + + +# pylint: disable=line-too-long + + +class DutchDateTime(BaseDateTimeResource): + LangMarker = 'Dut' + CheckBothBeforeAfter = False + TillRegex = f'(?\\b(tot(dat|\\s+en\\s+met)?|en|gedurende|tijdens|ten tijde van)\\b|{BaseDateTime.RangeConnectorSymbolRegex})' + RangeConnectorRegex = f'(?\\b(en|t/m|tot(\\s+(aan|en\\s+met))?)\\b|{BaseDateTime.RangeConnectorSymbolRegex})' + ArticleRegex = '\\b(de|het|een)\\b' + ApostrofRegex = '(’|‘|\'|ʼ)' + ApostrofsRegex = f'({ApostrofRegex}\\s*s)' + RelativeRegex = '\\b(?((dit|deze|(erop)?volgende?|(aan)?komende?|aanstaande?|huidige?|vorige?|verleden|voorgaande?|laatste|afgelopen|(op\\s+)?de|het)\\b)|gister(en)?)' + StrictRelativeRegex = '\\b(?((dit|deze|(erop)?volgende?|(aan)?komende?|aanstaande?|huidige?|vorige?|verleden|voorgaande?|laatste|afgelopen)\\b)|gister(en)?)' + UpcomingPrefixRegex = '((deze\\s+)?((aan)?komende?|aanstaande?))' + NextPrefixRegex = f'\\b((erop)?volgende?|eerstvolgende|{UpcomingPrefixRegex})\\b' + AfterNextSuffixRegex = '\\b((na\\s+(afloop\\s+van\\s+)?((de|het)\\s+)?volgende?)|over)\\b' + PastPrefixRegex = '((deze\\s+)?(verleden|afgelopen))\\b' + PreviousPrefixRegex = f'((voorgaand[e]|vorige?|verleden|laatste|{PastPrefixRegex})\\b|gister(en)?)' + ThisPrefixRegex = '(dit|deze|huidige?)\\b' + RangePrefixRegex = '(van|tussen)' + CenturySuffixRegex = '(^eeuw|^centennium)\\b' + ReferencePrefixRegex = '(dezelfde|hetzelfde|dat(zelfde)?|die|overeenkomstige)\\b' + FutureSuffixRegex = '\\b(((in\\s+de\\s+)?toekomst)|daarna|over|na)\\b' + PastSuffixRegex = '^\\b$' + DayRegex = '(de\\s*)?(?(?:3[0-1]|[1-2]\\d|0?[1-9]))(?:\\s*(ste|de|e))?(?=\\b|t)' + WrittenOneToNineRegex = '(één|een|twee|drie|vier|vijf|zes|zeven|acht|negen)' + WrittenElevenToNineteenRegex = '(elf|elven|twaalf|dertien|veertien|vijftien|zestien|zeventien|achttien|negentien)' + WrittenDayRegex = f'(?({WrittenOneToNineRegex})|({WrittenElevenToNineteenRegex})|(({WrittenOneToNineRegex}(en|ën))?twintig)|(((één|een)(en|ën))?dertig))' + WrittenCardinalDayRegex = f'(?<=((de\\s+)|\\b))(?(éérste|eerste|tweede|derde|vierde|vijfde|zesde|zevende|achtste|negende|tiende|{WrittenElevenToNineteenRegex}de|({WrittenOneToNineRegex}(en|ën))?twintigste|((één|een)(en|ën))?dertigste))' + ImplicitDayRegex = '(de\\s*)?(?(3[0-1]|[0-2]?\\d)(\\s*(ste|de|e)))\\b' + MonthNumRegex = '\\b(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b' + WrittenTensRegex = '(tien|twintig|dertig|veertig|vijftig|zestig|zeventig|tachtig|negentig)' + WrittenNumRegex = ( + f'({WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}(\\s+{WrittenOneToNineRegex})?)' + ) + WrittenCenturyFullYearRegex = f'((twee)\\s*duizend(\\s+en)?(\\s*{WrittenOneToNineRegex}\\s*honderd)?)' + WrittenCenturyOrdinalYearRegex = '((ee|éé)nentwintig|tweeëntwintig|tien|elf|elven|twaalf|dertien|veertien|vijftien|zestien|zeventien|achttien|negentien|twintig|een|twee|drie|vier|vijf|zes|zeven|acht|negen)' + CenturyRegex = ( + f'\\b(?{WrittenCenturyFullYearRegex}|{WrittenCenturyOrdinalYearRegex}(\\s*honderd)?(\\s+en)?)' + ) + LastTwoYearNumRegex = f'((zero|nul|en)\\s+{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|({WrittenOneToNineRegex}[eë]n)?{WrittenTensRegex})' + FullTextYearRegex = f'\\b((?{CenturyRegex})\\s*(?{LastTwoYearNumRegex})\\b|\\b(?{WrittenCenturyFullYearRegex}|{WrittenCenturyOrdinalYearRegex}\\s+hundred(\\s+and)?))\\b' + OclockRegex = '(?u(ur)?)\\b' + SpecialDescRegex = '((?)p\\b)' + AmDescRegex = f'(:?{BaseDateTime.BaseAmDescRegex})' + PmDescRegex = f'(:?{BaseDateTime.BasePmDescRegex})' + AmPmDescRegex = f'(:?{BaseDateTime.BaseAmPmDescRegex})' + DescRegex = f'(:?(:?({OclockRegex}\\s+)?(?({AmPmDescRegex}|{AmDescRegex}|{PmDescRegex}|{SpecialDescRegex}))\\.?)|{OclockRegex})' + PmRegex = f'(?({ApostrofsRegex}|des)\\s+(\\bmiddags|avonds|nachts)|((in|tegen|op|om|met)\\s+(de\\s+)?)(((na)?middag|avond|(midder)?nacht|lunchtijd))|\\s+dag)' + PmRegexFull = f'(?(({ApostrofsRegex}|des)\\s+(\\bmiddags|avonds|nachts)|((in|tegen|op|om|met)\\s+(de\\s+)?)?(((na)?middag|(?(({ApostrofsRegex}|des)\\s+(ochtends|morgens)|((in|tegen|op)\\s+de)(\\s+(ochtend|morgen))|(?<=gisteren|morgen|vandaag|(maan|dins|woens|donder|vrij|zater|zon)dag)(ochtend|morgen)|^?ochtend))' + FullDescRegex = f'({DescRegex}|{AmRegex}|{PmRegexFull})' + TwoDigitYearRegex = ( + f'\\b(?([0-24-9]\\d))(?!(\\s*(([:\\.]\\d)|keer|uurs?|{AmDescRegex}|{PmDescRegex})))\\b' + ) + YearRegex = f'({BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' + WeekDayRegex = '\\b(?((ma|di(ns)?|wo(e(ns)?)?|do|vr(ij)?|zat?|zo)(\\.|\\b))|((?:maan|dins|woens|donder|vrij|zater|zon)(dag(en)?)?(middag)?)\\b)' + SingleWeekDayRegex = '\\b(?(((ma|di(ns)?|wo(e(ns)?)?|do|vr|za)\\b(\\.)?)|(vrij|zat|zon?)\\.(?!$)|(((?((van\\s+)?(de\\s+)?)?{RelativeRegex}\\s+maand)\\b' + WrittenMonthRegex = '(((de\\s+)?maand\\s+)?(?januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december|jan|feb|mar|mrt|apr|jun|jul|aug|sep|sept|oct|okt|nov|dec))' + MonthSuffixRegex = f'(?((in|van|tijdens|sinds|tot|op)\\s+)?({RelativeMonthRegex}|{WrittenMonthRegex}))' + DateUnitRegex = '(?(eeuw|maand|weekend)(?en)?|jaar|(?jaren|weken)|jr|decennia|mnd|week|(?we[er]k)?dag(?en)?|dgn)\\b' + DateTokenPrefix = 'op ' + TimeTokenPrefix = 'om ' + TokenBeforeDate = 'op ' + TokenBeforeTime = 'om ' + HalfTokenRegex = '^(half)' + QuarterTokenRegex = '^(een\\s+kwart(\\s+jaar)?|kwart|een\\s+kwartier|kwartier)' + ThreeQuarterTokenRegex = '^(drie\\s+kwart|drie\\s+kwartier)' + ToTokenRegex = '\\b(voor)$' + ToHalfTokenRegex = '\\b(over\\s+half)$' + ForHalfTokenRegex = '\\b(voor\\s+half)$' + FromRegex = '\\b(van(af)?)$' + BetweenTokenRegex = '\\b(tussen)$' + SimpleCasesRegex = f'\\b({RangePrefixRegex}\\s+)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex}(\\s*),?(\\s*){MonthSuffixRegex}|{MonthSuffixRegex}\\s+{DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' + MonthFrontSimpleCasesRegex = f'\\b({RangePrefixRegex}\\s+)?(({MonthSuffixRegex}\\s+((van)\\s+)?({DayRegex})|({DayRegex})\\s+((van)\\s+)?{MonthSuffixRegex})\\s*{TillRegex}\\s*({DayRegex})|(op\\s+)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})\\s+{MonthSuffixRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' + MonthFrontBetweenRegex = f'\\b{MonthSuffixRegex}\\s+(tussen\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' + BetweenRegex = f'\\b(tussen\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*){YearRegex})?\\b' + RelativeYearRegex = f'({YearRegex}|\\\'?{TwoDigitYearRegex}|(?volgende?|komende?|aanstaande?|aankomende?|huidige?|vorige?|afgelopen|dit)\\s+jaar)' + MonthWithYear = f'\\b(({WrittenMonthRegex}(\\.)?(\\s*)[/\\\\\\-\\.,]?(\\s+(van|over|in))?(\\s*){RelativeYearRegex})|({RelativeYearRegex}(\\s*),?(\\s*){WrittenMonthRegex}))\\b' + OneWordPeriodRegex = f'\\b((((de\\s+)?maand\\s+(van\\s+)?)?({StrictRelativeRegex}\\s+)?(?januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december|jan\\.?|feb\\.?|mar\\.?|mrt\\.?|apr\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|sept\\.?|oct\\.?|okt\\.?|nov\\.?|dec\\.?))|(maand|jaar)\\s+tot(\\s+op)?\\s+heden|(({RelativeRegex}\\s+)(mijn\\s+)?(weekend|(?werkweek)|week|maand|jaar(?!\\s+hoger dan))|({RelativeRegex}\\s+)?(mijn\\s+)(weekend|(?werkweek)|week|maand|jaar))(?!((\\s+van)?\\s+\\d+|\\s+tot(\\s+op)?\\s+heden|nu))(\\s+{AfterNextSuffixRegex})?)\\b' + MonthNumWithYear = f'\\b(({BaseDateTime.FourDigitYearRegex}(\\s*)[/\\-\\.](\\s*){MonthNumRegex})|({MonthNumRegex}(\\s*)[/\\-](\\s*){BaseDateTime.FourDigitYearRegex}))\\b' + WeekOfMonthRegex = f'\\b(?(de\\s+)?(?eerste|tweede|derde|vierde|vijfde|1e|1ste|2e|2de|3e|3de|4e|4de|5e|5de|laatste)\\s+week\\s+{MonthSuffixRegex}(\\s+{BaseDateTime.FourDigitYearRegex}|{RelativeRegex}\\s+year)?)\\b' + WeekOfYearRegex = f'(\\b(?(de\\s+)?(?eerste|tweede|derde|vierde|vijfde|1e|1ste|2e|2de|3e|3de|4e|4de|5e|5de|laatste)\\s+week(\\s+van)?\\s+({YearRegex}|{RelativeRegex}\\s+jaar))\\b)|(\\b({YearRegex}|{RelativeRegex}\\s+jaar)\\s(?(de\\s+)?(?eerste|tweede|derde|vierde|vijfde|1e|1ste|2e|2de|3e|3de|4e|4de|5e|5de|laatste)\\s+week)\\b)' + OfYearRegex = f'\\b((of|in)\\s+({YearRegex}|{StrictRelativeRegex}\\s+year))\\b' + FirstLastRegex = '\\b(the\\s+)?((?first)|(?last))\\b' + FollowedDateUnit = f'^\\s*{DateUnitRegex}' + NumberCombinedWithDateUnit = f'\\b(?\\d+(\\.\\d*)?){DateUnitRegex}' + QuarterTermRegex = '\\b(((?eerste|1e|1ste|tweede|2e|2de|derde|3e|3de|vierde|4e|4de)[ -]+kwartaal)|(k(?[1-4])))\\b' + QuarterRegex = f'(het\\s+)?{QuarterTermRegex}((\\s+van|\\s*,\\s*)?\\s+({YearRegex}|{RelativeRegex}\\s+jaar))?' + QuarterRegexYearFront = ( + f'({YearRegex}|({RelativeRegex}\\s+jaar))({ApostrofsRegex})?\\s+((het|de)\\s+)?{QuarterTermRegex}' + ) + HalfYearTermRegex = '(?eerste|1e|1ste|tweede|2e|2de)\\s+(helft)' + HalfYearFrontRegex = f'(?(de\\s+){HalfYearTermRegex}(\\s+helft van\\s+)((1[5-9]|2[0-1]])\\d{{2}}))' + HalfYearBackRegex = f'(het\\s+)?(H(?[1-2])|({HalfYearTermRegex}))(\\s+van|\\s*,\\s*)?\\s+({YearRegex})' + HalfYearRelativeRegex = f'(het\\s+)?{HalfYearTermRegex}(\\s+van|\\s*,\\s*)?\\s+({RelativeRegex}\\s+jaar)' + AllHalfYearRegex = f'({HalfYearFrontRegex})|({HalfYearBackRegex})|({HalfYearRelativeRegex})' + EarlyPrefixRegex = '\\b(?((?eerder)|vroeg(er)?|((de|het)\\s+)?(begin(nend)?|start(end)?))(\\s+(in|op|van)(\\s+de)?)?)\\b' + MidPrefixRegex = ( + '\\b(?(het\\s+)?(mid(den|-)?|halverwege|op\\s+de\\s+helft|half)(\\s+(in|op|van)(\\s+de)?)?)' + ) + LaterPrefixRegex = '\\b(?(laat|(?later)|(aan\\s+)?het\\s+einde?(\\s+van(\\s+de)?)?|eind(e|igend)?|afsluitend)(\\s+(in|op|van)(\\s+de)?)?)\\b' + PrefixPeriodRegex = f'({EarlyPrefixRegex}|{MidPrefixRegex}|{LaterPrefixRegex})' + PrefixDayRegex = f'\\b(((?eerder|vroeg(er)?|begin|start)|(?midden|halverwege|op\\s+de\\s+helft)|(?laat|later))(\\s+(in|op|van))?(\\s+de\\s+dag)?$)|^\\s*(((?eerder|vroeg(er)?|begin|start)|(?midden|halverwege|op\\s+de\\s+helft)|in\\s+de|(?laat|later))(\\s+(in|op|van))(\\s+de\\s+dag))\\b' + SeasonDescRegex = '(?lente|voorjaar|zomer|herfst|najaar|winter)' + SeasonRegex = f'\\b(?({PrefixPeriodRegex}(\\s+)?)?({ArticleRegex}\\s+)?({RelativeRegex}\\s+)?{SeasonDescRegex}((\\s+(in|van)|\\s*,\\s*)?\\s+({YearRegex}|({ArticleRegex}\\s+)?({RelativeRegex}\\s+)?jaar))?)\\b' + WhichWeekRegex = '\\b(week)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])\\b' + WeekOfRegex = '(de\\s+)?(week)\\s+(van(\\s+(de|het))?|(beginnend|die\\s+begint|startend|aanvangend)(\\s+op)?)' + MonthOfRegex = '(maand)(\\s*)(van)' + MonthRegex = '\\b(?(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)\\b|(jan|feb|mar|mrt|apr|jun|jul|aug|sept|sep|oct|okt|nov|dec)(?:\\.|\\b))' + DateYearRegex = f'(?{BaseDateTime.FourDigitYearRegex}|{TwoDigitYearRegex})' + YearSuffix = f'((,|\\s*van)?\\s*({DateYearRegex}|{FullTextYearRegex}))' + OnRegex = f'(?<=\\bop\\s+)({DayRegex})\\b(?!(\\.|:)\\d+)' + RelaxedOnRegex = '\\b(?<=op\\s+)(?:de\\s+)?(?(?:3[0-1]|[1-2]\\d|0?[1-9]))(?:\\s*(ste|de|e))?\\b(?!(\\.|:)\\d+)' + PrefixWeekDayRegex = '(\\s*((,?\\s*op)|[-—–]))' + ThisRegex = ( + f'\\b((deze(\\s+week{PrefixWeekDayRegex}?)?\\s*){WeekDayRegex})|({WeekDayRegex}((\\s+van)?\\s*deze\\s+week))\\b' + ) + LastDateRegex = f'\\b({PreviousPrefixRegex}(\\s*week{PrefixWeekDayRegex}?)?\\s+{WeekDayRegex})|({WeekDayRegex}(\\s+van)?(\\s+vorige\\s+week))\\b' + WeekDayForNextDateRegex = '\\b(?((ma|di(ns)?|wo(e(ns)?)?|do|vr(ij)?|za(t)?|zo)(\\.|\\b))|((?:maan(?!den)|dins|woens|donder|vrij|zater|zon)(dag)?))' + NextDateRegex1 = f'\\b({NextPrefixRegex}(\\s*week{PrefixWeekDayRegex}?)?\\s+{WeekDayForNextDateRegex}|(op\\s+)?{WeekDayForNextDateRegex}\\s+((van\\s+)?(de\\s+)?{NextPrefixRegex})\\s*week|(op\\s+)?{NextPrefixRegex}\\s*week\\s+{WeekDayForNextDateRegex})' + NextDateRegex2 = f'\\b({NextPrefixRegex}(\\s*week(\\s*,?\\s*op)?)?\\s+{WeekDayRegex}|(op\\s+)?{WeekDayRegex}\\s+((van\\s+)?(de\\s+)?{NextPrefixRegex})\\s*week|(op\\s+)?{NextPrefixRegex}\\s*week\\s+{WeekDayRegex})' + NextDateRegex = f'({NextDateRegex1}|{NextDateRegex2})' + SpecialDayRegex = f'\\b(eergisteren|overmorgen|(de\\s+)?dag\\s+na\\s+morgen|(de\\s+)?dag\\s+(ervoor|erna)|((de\\s+)?({StrictRelativeRegex}|mijn)\\s+dag)\\b|(de\\s+dag(?!\\s+van))|gisteren|(deze\\s+)?morgen|vandaag|morgen(middag))(?!s\\b)' + SpecialDayWithNumRegex = ( + f'\\b((?{WrittenNumRegex})\\s+dag(en)?\\s+(gerekend\\s+)?(vanaf\\s+)(?gisteren|morgen|vandaag))\\b' + ) + RelativeDayRegex = f'\\b(((de\\s+)?{RelativeRegex}\\s+dag))\\b' + WeekDayOfMonthRegex = f'(?((de\\s+|\\b))?(?eerste|tweede|derde|vierde|vijfde|zesde|tiende|1e|1ste|2e|2de|3e|3de|4e|4de|5e|5de|laatste)\\s+{WeekDayRegex}(\\s+{MonthSuffixRegex}))' + RelativeWeekDayRegex = f'\\b({WrittenNumRegex}\\s+{WeekDayRegex}\\s+(vanaf\\s+nu|later))\\b' + SpecialDate = f'(?=\\b(op\\s+)(de\\s+)?){DayRegex}\\b' + DatePreposition = '\\b(op(\\s+de)?)' + DateExtractorYearTermRegex = f'(\\s+(van\\s+)?|\\s*[,./-]\\s*){DateYearRegex}' + DateExtractor1 = f'\\b({WeekDayRegex}\\s*[,-]?\\s*)?(({MonthRegex}(\\.)?\\s*[/\\\\.,-]?\\s*{DayRegex}(?!\\s*({MonthRegex}|\\-\\s*\\d{{2}}\\b)))|(\\({MonthRegex}\\s*[-.]\\s*{DayRegex}\\))|({DayRegex}(\\.)?\\s*[/\\\\.,-]?\\s*{MonthRegex}))(\\s*\\(\\s*{WeekDayRegex}\\s*\\))?({DateExtractorYearTermRegex}(?!\\s*{MonthRegex})\\b)?' + DateExtractor3 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*)?(de\\s+)?)?(({DayRegex}(\\s*dag|\\.)?)((\\s+|\\s*[,/-]\\s*|\\s+van\\s+)?{MonthRegex})((\\.)?(\\s+|\\s*[,/-]\\s*|\\s+in\\s+)?{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\\s*[,./-]?\\s*(de\\s*)?(?(?:3[0-1]|[1-2]\\d|0?[1-9]))(?:\\s*(ste|de|e))?(\\s*dag|\\.)?\\s*[,./-]?\\s*{MonthRegex})\\b' + DateExtractor4 = ( + f'\\b{MonthNumRegex}\\s*[/\\\\\\-]\\s*{DayRegex}[\\.]?\\s*[/\\\\\\-]\\s*{ApostrofRegex}?{DateYearRegex}' + ) + DateExtractor5 = f'\\b{DayRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DateYearRegex}(?!\\s*[/\\\\\\-\\.]\\s*\\d+)' + DateExtractor6 = f'(?<={DatePreposition}\\s+)({StrictRelativeRegex}\\s+)?({WeekDayRegex}\\s+)?{MonthNumRegex}[\\.]{DayRegex}(?!([%]|\\s*{FullDescRegex}))\\b|(?<={DatePreposition}\\s+){MonthNumRegex}[\\-\\.]{DayRegex}(?!([%]|\\s*{FullDescRegex}))\\b' + DateExtractor7L = ( + f'\\b({WeekDayRegex}\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}{DateExtractorYearTermRegex}(?![%])\\b' + ) + DateExtractor7S = f'\\b((?<=(^|{DatePreposition}\\s+)){WeekDayRegex}\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}{BaseDateTime.CheckDecimalRegex}(?!([%]|\\s*{FullDescRegex}))\\b' + DateExtractor8 = f'\\b((?<=(^|{DatePreposition}\\s+)){WeekDayRegex}\\s+)?(?(?:3[0-1]|[1-2]\\d|0?[1-9]))(?:\\s*(ste|de|e))?|{DayRegex}\\s*[/\\\\\\-\\.]\\s*{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*{MonthRegex})' + OfMonth = f'(^\\s*((van|in)\\s+)?)({MonthRegex})' + MonthEnd = f'{MonthRegex}(\\s+de\\s*)?$' + WeekDayEnd = f'(deze\\s+)?{WeekDayRegex}\\s*,?\\s*$' + WeekDayStart = f'^\\s+(op\\s+)?{WeekDayRegex}\\b' + RangeUnitRegex = '\\b(?ja(ren|ar)|maand(en)?|we(ken|ek)|dag(en)?)\\b' + HourNumRegex = '\\b(?nul|een|één|twee|drie|vier|vijf|zes|zeven|acht|negen|tien|elf|elven|twaalf|dertien|veertien|vijftien|zestien|zeventien|achttien|negentien|twintig|eenentwintig|éénentwintig|tweeentwintig|tweeëntwintig|drieëntwintig|vierentwintig)\\b' + MinuteNumRegex = '(?nul|een(?=\\s+min(uut)?)|één|twee|drie|vier|vijf|zes|zeven|acht|negen|tien|elf|elven|twaalf|dertien|veertien|vijftien|zestien|zeventien|achttien|negentien|twintig|eenentwintig|éénentwintig|tweeentwintig|tweeëntwintig|drieëntwintig|vierentwintig|vij[fv]entwintig|ze(s|ven)entwintig|achtentwintig|negenentwintig|dertig|eenendertig|tweeëndertig|drieëndertig|vierendertig|vijfendertig|ze(s|ven)endertig|achtendertig|negenendertig|veertig|eenenveertig|tweeënveertig|drieënveertig|vierenveertig|vijfenveertig|ze(s|ven)enveertig|achtenveertig|negenenveertig|eenenvijftig|vijftig|tweeënvijftig|drieënvijftig|vierenvijftig|vijfenvijftig|ze(s|ven)envijftig|achtenvijftig|negenenvijftig)' + DeltaMinuteNumRegex = '(?nul|een(?=\\s+min(uut)?)|één|twee|drie|vier|vijf|zes|zeven|acht|negen|tien|elf|elven|twaalf|dertien|veertien|vijftien|zestien|zeventien|achttien|negentien|twintig|eenentwintig|éénentwintig|tweeentwintig|tweeëntwintig|drieëntwintig|vierentwintig|vijfentwintig|vijventwintig|zesentwintig|zevenentwintig|achtentwintig|negenentwintig|dertig|eenendertig|tweeëndertig|drieëndertig|vierendertig|vijfendertig|zesendertig|zevenendertig|achtendertig|negenendertig|veertig|eenenveertig|tweeënveertig|drieënveertig|vierenveertig|vijfenveertig|zesenveertig|zevenenveertig|achtenveertig|negenenveertig|eenenvijftig|vijftig|tweeënvijftig|drieënvijftig|vierenvijftig|vijfenvijftig|zesenvijftig|zevenenvijftig|achtenvijftig|negenenvijftig)(?=\\b)' + LunchRegex = '\\b(lunchtijd)\\b' + NightRegex = f'\\b((({ApostrofsRegex}|des)\\s+)?nachts|(midder)?nacht)\\b' + CommonDatePrefixRegex = '^[\\.]' + LessThanOneHour = f'(?((een\\s+)?((drie\\s+)?kwart(ier)?|half(uur)?))|{BaseDateTime.DeltaMinuteRegex}(\\s+(minuten|mins|min\\.?))?|({DeltaMinuteNumRegex}(\\s+(minuten|mins|min\\.?))?))' + WrittenTimeRegex = f'(?({HourNumRegex}\\s+{MinuteNumRegex}|(?half)\\s+({HourNumRegex})))' + TimePrefix = f'(?(half|{LessThanOneHour}\\s+(over|voor|na)(\\s+half)?)|(uur\\s+{LessThanOneHour}))' + TimeSuffix = f'(?(({OclockRegex}\\s+)?({AmRegex}|{PmRegex}))|{OclockRegex})' + TimeSuffixFull = f'(?(({OclockRegex}\\s+)?({AmRegex}|{PmRegexFull}))|{OclockRegex})' + HourDTRegEx = f'({BaseDateTime.HourRegex})' + MinuteDTRegEx = f'({BaseDateTime.MinuteRegex})' + SecondDTRegEx = f'({BaseDateTime.SecondRegex})' + BasicTime = f'\\b(?{WrittenTimeRegex}|{HourNumRegex}|{HourDTRegEx}(:|\\.){MinuteDTRegEx}(:{SecondDTRegEx})?|((?half)\\s+)?{HourDTRegEx}(?![.,:]?[%\\d]))' + MidnightRegex = ( + f'(?mid\\s*(-\\s*)?nacht|middernacht|(in\\s+)?de nacht(\\s+van)?|({ApostrofsRegex}|des)\\s*nachts)' + ) + MidmorningRegex = '(?mid\\s*(-\\s*)?(morgen|ochtend)|halverwege de ochtend|het midden van de ochtend)' + MidafternoonRegex = '(?mid\\s*(-\\s*)?middag|halverwege de middag|het midden van de middag)' + MiddayRegex = f'(?(?({MidnightRegex}|{MidmorningRegex}|{MidafternoonRegex}|{MiddayRegex}))' + AtRegex = f'(((?<=\\bom\\s+)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}(?!\\.\\d)(\\s*((?a)|(?p)))?|{MidTimeRegex}))|{MidTimeRegex})\\b' + IshRegex = f'\\b(tegen\\s+{BaseDateTime.HourRegex}(-|——|\\s*{ApostrofRegex}\\s*)?en|middagloos)\\b' + TimeUnitRegex = '([^A-Za-z]{1,}|\\b)(?(min\\.|sec\\.)|(u(ur)?|minuut|seconde|(?uren|minuten|seconde[ns])|(min|sec)(?s)?)\\b)' + RestrictedTimeUnitRegex = '(?uur|minuut)\\b' + FivesRegex = '(?(vijf|tien|vijftien|twintig|vijfentwintig|vijventwintig|dertig|vijfendertig|veertig|vijfenveertig|vijftig|vijfenvijftig))\\b' + HourRegex = f'\\b{BaseDateTime.HourRegex}' + PeriodHourNumRegex = '\\b(?nul|een|één|twee|drie|vier|vijf(en)?|zes|zeven|acht|negen|tien|elf|elven|twaalf|dertien|veertien|vijftien|zestien|zeventien|achttien|negentien|twintig|eenentwintig|éénentwintig|tweeentwintig|tweeëntwintig|drieëntwintig|vierentwintig)\\b?' + ConnectNumRegex = f'\\b{BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59)\\s*{DescRegex}' + AroundRegex = '(\\b(rond(om)?|ongeveer(\\s+om)?)\\s*\\b)' + TimeRegexWithDotConnector = f'({BaseDateTime.HourRegex}(\\s*\\.\\s*){BaseDateTime.MinuteRegex}(\\s*:\\s*{BaseDateTime.SecondRegex})?(\\s*u\\s*)?)' + TimeRegexFilter = f'\\b((iedere|elke|op)(\\s+andere)?\\s+)?(week|dag|{SingleWeekDayRegex}|vandaag)\\b' + TimeRegex1 = f'\\b(({TimePrefix}|{AroundRegex})\\s+)?(({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})(\\s*{DescRegex})|(({AroundRegex})\\s+){HourNumRegex}(?!\\s+{SingleWeekDayRegex})\\b)' + TimeRegex2 = f'(\\b{TimePrefix}\\s+)?(t)?{BaseDateTime.HourRegex}(\\s*)?(:|\\.)(\\s*)?(?[0-5]\\d)(?!(\\d|\\s*(per|pro)\\s*cent|%))((\\s*)?:(\\s*)?{BaseDateTime.SecondRegex})?(\\s*u)?((\\s*{DescRegex})|\\b)' + TimeRegex3 = f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}\\.{BaseDateTime.MinuteRegex}(\\s*{DescRegex})' + TimeRegex4 = f'\\b{TimePrefix}\\s+{BasicTime}(\\s*{DescRegex})?\\s+{TimeSuffix}\\b' + TimeRegex5 = f'\\b({TimePrefix}\\s+{BasicTime}|{BasicTime}\\s+{TimePrefix})((\\s*({DescRegex}|{TimeSuffix}))|\\b)' + TimeRegex6 = f'{BasicTime}(\\s*u\\s*)?(\\s*{DescRegex})?\\s+{TimeSuffix}\\b' + TimeRegex7 = f'({TimeSuffixFull}\\s+(om\\s+)?({TimePrefix}\\s+)?(?({PmRegex}|{AmRegex}|{DescRegex})))?\\s*{TillRegex}\\s*({HourDTRegEx}|{PeriodHourNumRegex})(?\\s*({PmRegex}|{AmRegex}|{DescRegex}))?' + PureNumFromToPrefix = f'(({PmRegexFull}|{AmRegex})\\s+)?({RangePrefixRegex}\\s+)({HourDTRegEx}|{PeriodHourNumRegex})(\\s+uur)?(\\s*(?({PmRegex}|{AmRegex}|{DescRegex})))?\\s*{RangeConnectorRegex}\\s*({HourDTRegEx}|{PeriodHourNumRegex})(\\s+uur)?(?\\s*({PmRegex}|{AmRegex}|{DescRegex}))?' + PureNumFromToWithDateBefore = f'({RangePrefixRegex}\\s+)({HourDTRegEx})(\\s+(vandaag|morgen)\\s+)?(\\s*{RangeConnectorRegex}\\s*)({HourDTRegEx})' + PureNumFromToWithDateAfter = ( + f'({RangePrefixRegex}\\s+)({HourDTRegEx})(\\s*{RangeConnectorRegex}\\s*)({HourDTRegEx}(\\s+(vandaag|morgen))?)' + ) + PureNumFromTo = f'({PureNumFromToPrefix}|{PureNumFromToPrefixExcluded})' + TimeDateFromTo = f'({PureNumFromToWithDateAfter}|{PureNumFromToWithDateBefore})' + PureNumBetweenAnd = f'(tussen\\s+)({HourDTRegEx}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?\\s*{RangeConnectorRegex}\\s*({HourDTRegEx}|{PeriodHourNumRegex})(?\\s*({PmRegex}|{AmRegex}|{DescRegex}))?' + SpecificTimeFromTo = f'(({PmRegexFull}|{AmRegex})\\s+)?({RangePrefixRegex}\\s+)?(?({TimeRegex2}|({HourDTRegEx}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{TillRegex}\\s*(?({TimeRegex2}|({HourDTRegEx}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))' + SpecificTimeBetweenAnd = f'(({PmRegexFull}|{AmRegex})\\s+)?(tussen\\s+)(?({TimeRegex2}|({HourDTRegEx}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{RangeConnectorRegex}\\s*(?({TimeRegex2}|({HourDTRegEx}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?(\\s+{TimeSuffix})?))' + PrepositionRegex = '(?^(om|rond|tegen|op|van|deze)(\\s+de)?$)' + MealTimeRegex = '\\b((((tijdens\\s+)?de|het)\\s+)?(?ontbijt|lunch|avondeten)|((om|tegen|tijdens)\\s+)?(?lunchtijd))\\b' + EarlyLateRegex = '\\b(((?vroege?|(in\\s+het\\s+)?(begin))|(?laat|later|late|aan\\s+het\\s+einde?))((\\s+|-)(in\\s+de|op\\s+de|van\\s+de|deze|in|op|van|de))?)' + TimeOfDayRegex = f'(?(({EarlyLateRegex}\\s+)(aanstaande\\s+)?(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)\\s*(ochtend|morgen|(na)?middag|avond|nacht))|(((van\\s+deze\\s+)|\\b(in\\s+(de)?\\s+)|de\\s+)?({EarlyLateRegex}\\s+)?({ApostrofsRegex}\\s+)?(ochtend(en)?|morgen|middag(en)?|avond(en)?|nacht(\\s+van)?)s?((\\s+|-)({EarlyLateRegex}))?)|{MealTimeRegex}|((tijdens\\s+(de\\s+)?)?(kantoor|werk)uren))\\b' + SpecificTimeOfDayRegex = ( + f'\\b((({StrictRelativeRegex}\\s+{TimeOfDayRegex})\\b|\\bvan(ochtend|morgen|middag|avond|nacht)))s?\\b' + ) + TimeFollowedUnit = f'^\\s*{TimeUnitRegex}' + TimeNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?){TimeUnitRegex}' + BusinessHourSplitStrings = [r'werk', r'uren'] + BusinessHourSplitStrings2 = [r'kantoor', r'uren'] + NowRegex = ( + '(?nu(\\s+meteen)?|zo snel mogelijk|zo spoedig mogelijk|asap|recent|onlangs|zojuist)\\b' + ) + SuffixRegex = '^\\s*(in de\\s+)?(vroege\\s+|late\\s+)?(ochtend|(na)?middag|avond|nacht)\\b' + DateTimeTimeOfDayRegex = '\\b(?morgen|ochtend|(na)?middag|avond|nacht)\\b' + DateTimeSpecificTimeOfDayRegex = ( + f'\\b(({RelativeRegex}\\s+{DateTimeTimeOfDayRegex})|van(nacht|avond|middag|ochtend|morgen))\\b' + ) + TimeOfTodayAfterRegex = f'^\\s*(,\\s*)?((in\\s+de)|(op\\s+de))?{DateTimeSpecificTimeOfDayRegex}' + TimeOfTodayBeforeRegex = f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(om|rond|tegen|op\\s+de|op))?\\s*$' + NonTimeContextTokens = '\\b(gebouw)' + SimpleTimeOfTodayAfterRegex = f'(?ochtend|(na)?middag|avond|nacht))\\b' + PeriodSpecificTimeOfDayRegex = ( + f'\\b(({StrictRelativeRegex}(\\s+)?{PeriodTimeOfDayRegex})\\b|\\bvan(nacht|avond|(na)?middag|ochtend))\\b' + ) + PeriodTimeOfDayWithDateRegex = f'(({TimeOfDayRegex}(\\s+(om|rond|van|tegen|op(\\s+de)?))?))\\b' + PeriodTimeOfDayWithDateRegexWithAnchors = f'((({TimeOfDayRegex}(\\s+(om|rond|van|tegen|op(\\s+de)?))?))(?=({MiddlePauseRegex})?\\s*$)|(?<=^\\s*({MiddlePauseRegex})?)(?!{MealTimeRegex}){TimeOfDayRegex})' + LessThanRegex = '\\b((binnen\\s+)?minder\\s+dan)\\b' + MoreThanRegex = '\\b((meer|langer)\\s+dan|ruim)\\b' + DurationUnitRegex = f'(?{DateUnitRegex}|(min\\.|sec\\.)|((?halfuur)|(?kwartier\\s+uur)|(?kwartier)|uur|uren|u|minuten|minuut|m(ins?)?|seconde[ns]?|s(ecs?)?|nacht(en)?)\\b)(\\s+lang\\b)?' + SuffixAndRegex = ( + '(?\\s+(en|ën)(\\s*een)?\\s*(?hal(f|ve)|kwart|kwartier)|(?(een\\s+)?kwartier))' + ) + BeforeEachDayRegex = '(iedere|elke)\\s*dag\\s*' + DurationFollowedUnit = ( + f'^\\s*((?(?(?(een\\s+)?kwartier)))|{SuffixAndRegex}?(\\s+|-)?{DurationUnitRegex})' + ) + NumberCombinedWithDurationUnit = f'\\b(?\\d+([.,:]\\d*)?)(-)?{DurationUnitRegex}' + AnUnitRegex = ( + f'\\b((((nog een|een|nog)\\s+(?anderhalf|anderhalve|half|halve)?))|andere)\\s*{DurationUnitRegex}' + ) + DuringRegex = '\\b(voor\\s+een|gedurende\\s+(het|de))\\s+(?jaar|maand|week|dag)\\b' + AllRegex = '\\b(?((de|het|een)\\s+)?((ge)?hele|volledige|ganse|heel|volledig|volle)(\\s+|-)(?jaar|maand|week|dag))\\b' + HalfRegex = '(((een)\\s*)|\\b)(?(half|halve)\\s+(?jaar|maand|week|dag|uur|halfuur)|(?halfuur))\\b' + ConjunctionRegex = '\\b((en(\\s+voor)?)|plus)\\b' + HolidayList1 = '(?goede vrijdag|pasen|((eerste|tweede)\\s+)?paasdag|paas(zondag|maandag)|kerst(avond|mis)?|thanksgiving|halloween|(islamitisch\\s+)?nieuwjaar|oud en nieuw|oud & nieuw|pinksteren|oude?jaar|oude?jaarsavond|silvester|silvesteravond|sinterklaas|sinterklaasfeest|sinterklaasavond|pakjesavond|eid al(-|\\s+)fitr|eid al(-|\\s+)adha|juneteenth|vrijheidsdag|jubilee\\s+day)' + HolidayList2 = '(?black friday|cyber monday|nationale dodenherdenking|nationale herdenking|dodenherdenking|dag\\s+van\\s+de\\s+(leraar|leerkracht(en)?|arbeid|aarde)|feest\\s+van\\s+de\\s+arbeid|yuandan|valentijn|sint-maartensfeest|sint-maarten|driekoningen|keti(\\s+|-)?koti|ramadan|suikerfeest|offerfeest|allerheiligen|allerheiligenavond|franse nationale feestdag|bestorming van de bastille)' + HolidayList3 = '(?(martin luther king|mlk|dankzeggings|valentijns|nieuwjaars|(eerste|1e|tweede|2e)\\s+paas|prinsjes|konings|koninginne|bevrijdings|hemelvaarts|(eerste|1e|tweede|2e)\\s+kerst|vader|moeder|meisjes|(amerikaanse|us\\s+)?onafhankelijk(heid)?s|(nederlandse\\s+)?veteranen|boomplant|(nationale\\s+)?boomfeest)dag)' + HolidayRegex = f'\\b(({StrictRelativeRegex}\\s+({HolidayList1}|{HolidayList2}|{HolidayList3}))|(({HolidayList1}|{HolidayList2}|{HolidayList3})(\\s+(van\\s+)?({YearRegex}|{RelativeRegex}\\s+jaar))?))\\b' + AMTimeRegex = f'(?{ApostrofsRegex}\\s*(morgens|ochtends)|in\\s+de\\s+(morgen|ochtend))' + PMTimeRegex = ( + f'(?{ApostrofsRegex}\\s*(middags|avonds|nachts)|(in\\s+de\\s+)?(deze\\s+)?((na)?middag|avond|nacht))\\b' + ) + MorningTimeRegex = '(morgens?|ochtends?)' + NightTimeRegex = '(nacht)' + NowTimeRegex = '\\b(nu)\\b' + RecentlyTimeRegex = '\\b(kort\\s+geleden|eerder)\\b' + AsapTimeRegex = '\\b(zo\\s+snel\\s+mogelijk|zsm)\\b' + InclusiveModPrepositions = '(?((in|tegen|tijdens|op|om)\\s+of\\s+)|(\\s+of\\s+(in|tegen|tijdens|op)))' + AfterRegex = f'(\\b{InclusiveModPrepositions}?((na(\\s+afloop\\s+van)?|(?>=)|>)' + BeforeRegex = f'(\\b(?(al\\s+)?zo\\s+laat\\s+als)){InclusiveModPrepositions}?\\b\\s*)|(?)((?<=)|<)' + SinceRegex = '(\\b(sinds|na\\s+of\\s+gelijk\\s+aan|(startend|beginnend)\\s+(vanaf|op|met)|(al\\s+)?zo\\s+vroeg\\s+als|(elk|ieder)\\s+moment\\s+vanaf|een\\s+tijdstip\\s+vanaf)\\b\\s*)|(?=)' + AgoRegex = '\\b(geleden|(voor|eerder\\s+dan)\\s+(?gisteren|vandaag))\\b' + LaterRegex = '\\b(later|vanaf\\s+nu|(vanaf|na|sedert)\\s+(?morgen|vandaag))\\b' + BeforeAfterRegex = '\\b(gerekend\\s+)?((?voor(dat)?)|(?van(af)?|na))\\b' + ModPrefixRegex = f'\\b({RelativeRegex}|{AroundRegex}|{BeforeRegex}|{AfterRegex}|{SinceRegex})\\b' + ModSuffixRegex = f'\\b({AgoRegex}|{LaterRegex}|{BeforeAfterRegex}|{FutureSuffixRegex}|{PastSuffixRegex})\\b' + InConnectorRegex = '\\b(in|over|na)(\\s+de)?\\b' + SinceYearSuffixRegex = f'(^\\s*{SinceRegex}((vanaf|sedert|sinds)\\s+(het\\s+)?jaar\\s+)?{YearSuffix})' + WithinNextPrefixRegex = f'\\b((binnen)(\\s+de|het)?(\\s+(?{NextPrefixRegex}))?)\\b' + TodayNowRegex = '\\b(vandaag|nu)\\b' + MorningStartEndRegex = f'(^(({ApostrofsRegex}|des)\\s+(morgens|ochtends)|in\\s+de\\s+(na)?(morgen|ochtend)|deze\\s+(morgen|ochtend)|(morgen|ochtend)\\s+in\\s+het\\s+begin|aan\\s+het\\s+einde?(\\s+van(\\s+de)?)?\\s+(morgen|ochtend)|{AmDescRegex}|(morgen|ochtend)))|((({ApostrofsRegex}|des)\\s+(morgens|ochtends)|deze\\s+(morgen|ochtend)|in\\s+de\\s+(na)?(morgen|ochtend)|(morgen|ochtend)\\s+in\\s+het\\s+begin|(morgen|ochtend)\\s+aan\\s+het\\s+einde?|{AmDescRegex}|(morgen|ochtend))$)' + AfternoonStartEndRegex = f'(^(({ApostrofsRegex}|des)\\s+middags|in\\s+de\\s+(na)?middag|deze\\s+middag|aan\\s+het\\s+einde?(\\s+van(\\s+de)?)?\\s+middag|{PmDescRegex}))|((({ApostrofsRegex}|des)?\\s+middags|in\\s+de\\s+(na)?middag|deze\\s+middag|middag\\s+in\\s+het\\s+begin|middag\\s+aan\\s+het\\s+einde?|{PmDescRegex}|middag)$)' + EveningStartEndRegex = f'(^(({ApostrofsRegex}|des)\\s+avonds|in\\s+de\\s+(na)?avond|deze\\s+avond|avond\\s+in\\s+het\\s+begin|aan\\s+het\\s+einde?(\\s+van(\\s+de)?)?\\s+avond|{PmDescRegex}|avond))|((({ApostrofsRegex}|des)?\\s+avonds|deze\\s+avond|in\\s+de\\s+(na)?avond|avond\\s+in\\s+het\\s+begin|avond\\s+aan\\s+het\\s+einde?|{PmDescRegex}|avond)$)' + NightStartEndRegex = f'(^(gedurende de nacht|vannacht|nacht|({ApostrofsRegex}|des)?\\s+nachts))|((gedurende\\s+de\\s+nacht|vannacht|({ApostrofsRegex}|des)?\\s+nachts|nacht\\s+in\\s+het\\s+begin|nacht)$)' + InexactNumberRegex = '\\b((een\\s+)?aantal|meerdere|enkele|verscheidene|wat|enige|(?(een\\s+)?paar))\\b' + InexactNumberUnitRegex = f'({InexactNumberRegex})\\s+({DurationUnitRegex})' + RelativeTimeUnitRegex = f'((({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+({TimeUnitRegex}))|((de|het|mijn))\\s+({RestrictedTimeUnitRegex}))' + RelativeDurationUnitRegex = f'(((?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+)({DurationUnitRegex}))|((the|my))\\s+({RestrictedTimeUnitRegex}))' + ReferenceDatePeriodRegex = f'\\b{ReferencePrefixRegex}\\s+(?week|maand|jaar|decennium|weekend)\\b' + ConnectorRegex = '^(-|,|voor|t|rond(om)?|@)$' + FromToRegex = '\\b(van(af)?).+(tot)\\b.+' + SingleAmbiguousMonthRegex = '^(de\\s+)?(mei)$' + SingleAmbiguousTermsRegex = '^(de\\s+)?(dag|week|maand|jaar)$' + UnspecificDatePeriodRegex = '^(week|weekend|maand|jaar)$' + PrepositionSuffixRegex = '\\b((op|in)(\\s+de)?|om|rond(om)?|van|tot)$' + FlexibleDayRegex = '(?([A-Za-zë]+\\s+)?[A-Za-zë\\d]+?\\s*(ste|de|e))' + ForTheRegex = f'\\b((((?<=voor\\s+)de\\s+{FlexibleDayRegex})|((?<=op\\s+)de\\s+{FlexibleDayRegex}(?<=(ste|de|e))))(?(\\s+(tussen|binnen|terug|tegen|aan|uit|mee|bij|vol|uit|aan|op|in|na|af)\\s*)?(\\s+(ge\\w\\w\\w+|\\w\\w\\w+en)\\s*)?(,|\\.|!|\\?|$)))' + WeekDayAndDayOfMonthRegex = f'\\b{WeekDayRegex}\\s+(de\\s+{FlexibleDayRegex})\\b' + WeekDayAndDayRegex = ( + f'\\b{WeekDayRegex}\\s+{DayRegex}(?!([-]|:\\d+|\\.\\d+|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' + ) + RestOfDateRegex = ( + '\\brest\\s+(van\\s+)?((de|het|mijn|dit|deze|(de\\s+)?huidige)\\s+)?(?week|maand|jaar|decennium)\\b' + ) + RestOfDateTimeRegex = '\\brest\\s+(van\\s+)?((de|het|mijn|dit|deze|(de\\s+)?huidige)\\s+)?(?vandaag|dag)\\b' + AmbiguousRangeModifierPrefix = '(voor)' + PotentialAmbiguousRangeRegex = f'\\b{AmbiguousRangeModifierPrefix}(?!\\s+het\\s+(einde?|begin(nen)?))(.+\\b(boven|later|groter|erna|daarna|hoger|(?{BaseDateTime.RangeConnectorSymbolRegex}))\\b)' + NumberEndingPattern = f'^(\\s+((?vergadering|afspraak|conferentie|telefoontje|skype-gesprek)\\s+)?(om|naar)\\s+(?{PeriodHourNumRegex}|{HourRegex})((\\.)?$|(\\.,|,|!|\\?)))' + OneOnOneRegex = '\\b(1\\s*:\\s*1)|(één\\s+(op\\s)één|één\\s*-\\s*één|één\\s*:\\s*één)\\b' + LaterEarlyPeriodRegex = f'\\b({PrefixPeriodRegex})\\s*\\b\\s*(?{OneWordPeriodRegex}|(?{BaseDateTime.FourDigitYearRegex}))\\b' + WeekWithWeekDayRangeRegex = f'\\b((?({NextPrefixRegex}|{PreviousPrefixRegex}|deze)\\s+week)((\\s+tussen\\s+{WeekDayRegex}\\s+en\\s+{WeekDayRegex})|(\\s+van\\s+{WeekDayRegex}\\s+tot\\s+{WeekDayRegex})))\\b' + GeneralEndingRegex = '^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$' + DurationConnectorRegex = '^\\s*(?\\s+|en|,)\\s*$' + PrefixArticleRegex = '\\bde\\s+' + OrRegex = '\\s*((\\b|,\\s*)(of|en)\\b|,)\\s*' + YearPlusNumberRegex = f'\\b(jaar\\s+((?(\\d{{3,4}}))|{FullTextYearRegex}))\\b' + NumberAsTimeRegex = f'\\b({WrittenTimeRegex}|{PeriodHourNumRegex}|{BaseDateTime.HourRegex})\\b' + TimeBeforeAfterRegex = f'\\b(((?<=\\b(voor|niet later dan|na|door)\\s+)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}|{MidTimeRegex}))|{MidTimeRegex})\\b' + DateNumberConnectorRegex = '^\\s*(?\\s+om)\\s*$' + DecadeRegex = '(?(nul|tien|twintig|dertig|veertig|vijftig|zestig|zeventig|tachtig|negentig)|(fifties|sixties|seventies|eighties|nineties|zeroes|tens|tweeduizend|(ee|éé)nentwintigste\\s+eeuw))' + DecadeWithCenturyRegex = f'\\b(de\\s+)?(jaren\\s+)?((?1\\d|2\\d|\\d)?({ApostrofRegex})?(?\\d0)({ApostrofRegex})?s?)(?!%)\\b|(({CenturyRegex}(\\s+|-)?(en\\s+)?|(?<=\\b(de|jaren)\\s+)){DecadeRegex})|({CenturyRegex}(\\s+|-)?(en\\s+)?(?tien|honderd)))' + RelativeDecadeRegex = f'\\b(((de|het)\\s+)?{RelativeRegex}\\s+((?[\\w,]+)\\s+)?decenni(a|um)?)\\b' + SuffixAfterRegex = '\\b(((bij)\\s)?(of|en)\\s+(boven|later|groter|erna|daarna|hoger)(?!\\s+dan))\\b' + DateAfterRegex = '\\b((of|en)\\s+(hoger|later|groter)(?!\\s+dan))\\b' + YearPeriodRegex = f'((((van(af)?|tijdens|gedurende|in)\\s+)?{YearRegex}\\s*({TillRegex})\\s*{YearRegex})|(((tussen)\\s+){YearRegex}\\s*({RangeConnectorRegex})\\s*{YearRegex}))' + StartMiddleEndRegex = '\\b((?(((de|het)\\s+)?(start|begin)\\s+van\\s+)?)(?((het\\s+)?midden\\s+van\\s+)?)(?((het\\s+)?einde?\\s+van\\s+)?))' + ComplexDatePeriodRegex = f'(((van(af)?|tijdens|gedurende|in(\\s+de)?)\\s+)?{StartMiddleEndRegex}(?.+)\\s*({TillRegex})\\s*{StartMiddleEndRegex}(?.+)|((tussen)\\s+){StartMiddleEndRegex}(?.+)\\s*({RangeConnectorRegex})\\s*{StartMiddleEndRegex}(?.+)|(?{WrittenMonthRegex})\\s+(?{WrittenMonthRegex}(\\s+|\\s*,\\s*){YearRegex}))' + ComplexTillRegex = f'({TillRegex}|{WrittenMonthRegex})' + UnitMap = dict( + [ + ("millennium", "1000Y"), + ("eeuw", "100Y"), + ("centennium", "100Y"), + ("decennium", "10Y"), + ("decennia", "10Y"), + ("jaren", "Y"), + ("jaar", "Y"), + ("jr", "Y"), + ("maanden", "MON"), + ("maand", "MON"), + ("mnd", "MON"), + ("weken", "W"), + ("week", "W"), + ("weekend", "WE"), + ("weekenden", "WE"), + ("dagen", "D"), + ("dag", "D"), + ("werkdagen", "D"), + ("werkdag", "D"), + ("weekdagen", "D"), + ("weekdag", "D"), + ("vandaag", "D"), + ("dgn", "D"), + ("nachten", "D"), + ("nacht", "D"), + ("uren", "H"), + ("uur", "H"), + ("u", "H"), + ("minuten", "M"), + ("minuut", "M"), + ("min", "M"), + ("min.", "M"), + ("secondes", "S"), + ("seconden", "S"), + ("seconde", "S"), + ("secs", "S"), + ("sec", "S"), + ("kwartier", "H"), + ("kwartier uur", "H"), + ("halfuur", "H"), + ] + ) + UnitValueMap = dict( + [ + ("decennium", 315360000), + ("decennia", 315360000), + ("decenniën", 315360000), + ("jaren", 31536000), + ("jaar", 31536000), + ("jr", 31536000), + ("maanden", 2592000), + ("maand", 2592000), + ("mnd", 2592000), + ("weken", 604800), + ("week", 604800), + ("weekenden", 172800), + ("weekend", 172800), + ("dagen", 86400), + ("dag", 86400), + ("vandaag", 86400), + ("dgn", 86400), + ("nachten", 86400), + ("nacht", 86400), + ("werkdagen", 86400), + ("werkdag", 86400), + ("weekdagen", 86400), + ("weekdag", 86400), + ("uren", 3600), + ("uur", 3600), + ("u", 3600), + ("minuten", 60), + ("minuut", 60), + ("min", 60), + ("min.", 60), + ("secondes", 1), + ("seconden", 1), + ("seconde", 1), + ("secs", 1), + ("sec", 1), + ("kwartier", 3600), + ("kwartier uur", 3600), + ("halfuur", 3600), + ] + ) + SpecialYearPrefixesMap = dict([("", "")]) + SeasonMap = dict([("lente", "SP"), ("zomer", "SU"), ("herfst", "FA"), ("winter", "WI")]) + SeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + CardinalMap = dict( + [ + ("eerste", 1), + ("1e", 1), + ("1ste", 1), + ("tweede", 2), + ("2e", 2), + ("2de", 2), + ("derde", 3), + ("3e", 3), + ("3de", 3), + ("vierde", 4), + ("4e", 4), + ("4de", 4), + ("vijfde", 5), + ("5e", 5), + ("5de", 5), + ] + ) + DayOfWeek = dict( + [ + ("maandag", 1), + ("dinsdag", 2), + ("woensdag", 3), + ("donderdag", 4), + ("vrijdag", 5), + ("zaterdag", 6), + ("zondag", 0), + ("zondagmiddag", 0), + ("maandagen", 1), + ("dinsdagen", 2), + ("woensdagen", 3), + ("donderdagen", 4), + ("vrijdagen", 5), + ("zaterdagen", 6), + ("zondagen", 0), + ("ma", 1), + ("ma.", 1), + ("dins", 2), + ("dins.", 2), + ("woens", 3), + ("woens.", 3), + ("di", 2), + ("di.", 2), + ("wo", 3), + ("wo.", 3), + ("woe", 3), + ("woe.", 3), + ("do", 4), + ("do.", 4), + ("vr", 5), + ("vr.", 5), + ("vrij", 5), + ("vrij.", 5), + ("za", 6), + ("za.", 6), + ("zat", 6), + ("zat.", 6), + ("zo", 0), + ("zo.", 0), + ("zon", 0), + ("zon.", 0), + ("monday", 1), + ("tuesday", 2), + ("wednesday", 3), + ("thursday", 4), + ("friday", 5), + ("saturday", 6), + ("sunday", 0), + ("mon", 1), + ("tue", 2), + ("tues", 2), + ("wed", 3), + ("wedn", 3), + ("weds", 3), + ("thu", 4), + ("thur", 4), + ("thurs", 4), + ("fri", 5), + ("sat", 6), + ("sun", 0), + ] + ) + MonthOfYear = dict( + [ + ("januari", 1), + ("februari", 2), + ("maart", 3), + ("april", 4), + ("mei", 5), + ("juni", 6), + ("juli", 7), + ("augustus", 8), + ("september", 9), + ("oktober", 10), + ("november", 11), + ("december", 12), + ("jan", 1), + ("feb", 2), + ("mar", 3), + ("mrt", 3), + ("apr", 4), + ("jun", 6), + ("jul", 7), + ("aug", 8), + ("sep", 9), + ("sept", 9), + ("oct", 10), + ("okt", 10), + ("nov", 11), + ("dec", 12), + ("jan.", 1), + ("feb.", 2), + ("mar.", 3), + ("mrt.", 3), + ("apr.", 4), + ("jun.", 6), + ("jul.", 7), + ("aug.", 8), + ("sep.", 9), + ("sept.", 9), + ("oct.", 10), + ("okt.", 10), + ("nov.", 11), + ("dec.", 12), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ] + ) + Numbers = dict( + [ + ("nul", 0), + ("een", 1), + ("één", 1), + ("twee", 2), + ("drie", 3), + ("vier", 4), + ("vijf", 5), + ("zes", 6), + ("zeven", 7), + ("acht", 8), + ("negen", 9), + ("tien", 10), + ("elf", 11), + ("elven", 11), + ("twaalf", 12), + ("dertien", 13), + ("veertien", 14), + ("vijftien", 15), + ("zestien", 16), + ("zeventien", 17), + ("achttien", 18), + ("negentien", 19), + ("twintig", 20), + ("eenentwintig", 21), + ("éénentwintig", 21), + ("tweeentwintig", 22), + ("tweeëntwintig", 22), + ("drieëntwintig", 23), + ("vierentwintig", 24), + ("vijfentwintig", 25), + ("vijventwintig", 25), + ("zesentwintig", 26), + ("zevenentwintig", 27), + ("achtentwintig", 28), + ("negenentwintig", 29), + ("dertig", 30), + ("eenendertig", 31), + ("tweeëndertig", 32), + ("drieëndertig", 33), + ("vierendertig", 34), + ("vijfendertig", 35), + ("zesendertig", 36), + ("zevenendertig", 37), + ("achtendertig", 38), + ("negenendertig", 39), + ("veertig", 40), + ("eenenveertig", 41), + ("tweeënveertig", 42), + ("drieënveertig", 43), + ("vierenveertig", 44), + ("vijfenveertig", 45), + ("zesenveertig", 46), + ("zevenenveertig", 47), + ("achtenveertig", 48), + ("negenenveertig", 49), + ("eenenvijftig", 50), + ("vijftig", 51), + ("tweeënvijftig", 52), + ("drieënvijftig", 53), + ("vierenvijftig", 54), + ("vijfenvijftig", 55), + ("zesenvijftig", 56), + ("zevenenvijftig", 57), + ("achtenvijftig", 58), + ("negenenvijftig", 59), + ("zestig", 60), + ("eenenzestig", 61), + ("tweeënzestig", 62), + ("drieënzestig", 63), + ("vierenzestig", 64), + ("vijfenzestig", 65), + ("zesenzestig", 66), + ("zevenenzestig", 67), + ("achtenzestig", 68), + ("negenenzestig", 69), + ("zeventig", 70), + ("eenenzeventig", 71), + ("tweeënzeventig", 72), + ("drieënzeventig", 73), + ("vierenzeventig", 74), + ("vijfenzeventig", 75), + ("zesenzeventig", 76), + ("zevenenzeventig", 77), + ("achtenzeventig", 78), + ("negenenzeventig", 79), + ("tachtig", 80), + ("eenentachtig", 81), + ("tweeëntachtig", 82), + ("drieëntachtig", 83), + ("vierentachtig", 84), + ("vijfentachtig", 85), + ("zesentachtig", 86), + ("zevenentachtig", 87), + ("achtentachtig", 88), + ("negenentachtig", 89), + ("negentig", 90), + ("eenennegentig", 91), + ("tweeënnegentig", 92), + ("drieënnegentig", 93), + ("vierennegentig", 94), + ("vijfennegentig", 95), + ("zesennegentig", 96), + ("zevenennegentig", 97), + ("achtennegentig", 98), + ("negenennegentig", 99), + ("honderd", 100), + ] + ) + DayOfMonth = dict( + [ + ("1e", 1), + ("1ste", 1), + ("2e", 2), + ("2de", 2), + ("3e", 3), + ("3de", 3), + ("4e", 4), + ("4de", 4), + ("5e", 5), + ("5de", 5), + ("6e", 6), + ("6de", 6), + ("7e", 7), + ("7de", 7), + ("8e", 8), + ("8de", 8), + ("9e", 9), + ("9de", 9), + ("10e", 10), + ("10de", 10), + ("11e", 11), + ("11de", 11), + ("12e", 12), + ("12de", 12), + ("13e", 13), + ("13de", 13), + ("14e", 14), + ("14de", 14), + ("15e", 15), + ("15de", 15), + ("16e", 16), + ("16de", 16), + ("17e", 17), + ("17de", 17), + ("18e", 18), + ("19e", 19), + ("20e", 20), + ("21e", 21), + ("22e", 22), + ("23e", 23), + ("24e", 24), + ("25e", 25), + ("26e", 26), + ("27e", 27), + ("28e", 28), + ("29e", 29), + ("30e", 30), + ("31e", 31), + ] + ) + DoubleNumbers = dict( + [ + ("half", 0.5), + ("anderhalf", 1.5), + ("anderhalve", 1.5), + ("halve", 0.5), + ("een kwartier", 0.25), + ("kwartier", 0.25), + ("kwart", 0.25), + ("driekwart", 0.75), + ("drie kwart", 0.75), + ("kwartaal", 0.25), + ] + ) + HolidayNames = dict( + [ + ("kingsday", ["koningsdag"]), + ("queensday", ["koninginnedag"]), + ("prinsjesdag", ["prinsjesdag"]), + ("dodenherdenking", ["nationaledodenherdenking", "nationaleherdenking", "dodenherdenking"]), + ("bevrijdingsdag", ["bevrijdingsdag"]), + ("teachersday", ["dagvandeleraar", "dagvandeleerkracht", "dagvandeleerkrachten"]), + ("veteransday", ["nederlandseveteranendag", "veteranendag"]), + ("eerstekerstdag", ["eerstekerstdag", "1ekerstdag"]), + ("tweedekerstdag", ["tweedekerstdag", "2ekerstdag"]), + ("dagvandearbeid", ["dagvandearbeid", "feestvandearbeid"]), + ("treeplantingday", ["nationaleboomfeestdag", "boomfeestdag", "boomplantdag"]), + ("sinterklaas", ["sinterklaas", "sinterklaasavond", "sinterklaasfeest", "pakjesavond"]), + ("driekoningen", ["driekoningen"]), + ("ketikoti", ["ketikoti", "keti-koti"]), + ("stmartinsday", ["sint-maartensfeest", "sint-maarten"]), + ("ascensionday", ["hemelvaartsdag"]), + ("whitesunday", ["pinksteren"]), + ("christmas", ["kerstfeest", "kerstmis", "kerst", "xmas"]), + ("easterday", ["pasen", "eerstepaasdag", "paasdag", "paaszondag"]), + ("eastermonday", ["tweedepaasdag", "paasmaandag"]), + ("fathers", ["vaderdag"]), + ("goodfriday", ["goedevrijdag"]), + ("mothers", ["moederdag"]), + ("newyear", ["nieuwjaar"]), + ("newyearday", ["nieuwjaarsdag"]), + ("newyearsday", ["nieuwjaarsdag"]), + ( + "newyeareve", + [ + "oudjaar", + "oudejaar", + "oudejaarsavond", + "oudjaarsavond", + "silvester", + "silvesteravond", + "oudennieuw", + "oud&nieuw", + ], + ), + ("valentinesday", ["valentijnsdag", "valetijnsdag"]), + ("independenceday", ["onafhankelijkheidsdag", "onafhankelijksdag"]), + ("bastilleday", ["fransenationalefeestdag", "bestormingvandebastille"]), + ("halloweenday", ["halloween", "allerheiligenavond"]), + ("allhallowday", ["allerheiligen"]), + ("allsoulsday", ["allerzielen"]), + ("christmaseve", ["kerstavond"]), + ("yuandan", ["yuandan"]), + ("chinesenewyear", ["chineesnieuwjaar", "lentefestival", "lentefeest"]), + ("ramadan", ["ramadan"]), + ("eidalfitr", ["eidalfitr", "suikerfeest"]), + ("sacrifice", ["eidaladha", "offerfeest"]), + ("islamicnewyear", ["islamitischnieuwjaar"]), + ("thanksgiving", ["thanksgivingday", "thanksgiving", "dankzeggingsdag"]), + ("martinlutherking", ["martinlutherkingday", "martinlutherkingjrday", "martinlutherkingdag", "mlkdag"]), + ("usindependenceday", ["amerikaanseonafhankelijkheidsdag", "usonafhankelijkheidsdag"]), + ("blackfriday", ["blackfriday"]), + ("cybermonday", ["cybermonday"]), + ("earthday", ["dagvandeaarde"]), + ("juneteenth", ["jubileeday", "juneteenth", "vrijheidsdag"]), + ] + ) + WrittenDecades = dict( + [ + ("jaren 0", 0), + ("jaren nul", 0), + ("jaren 10", 10), + ("jaren tien", 10), + ("jaren 20", 20), + ("jaren twintig", 20), + ("twintiger jaren", 20), + ("jaren 30", 30), + ("jaren dertig", 30), + ("dertiger jaren", 30), + ("jaren 40", 40), + ("jaren veertig", 40), + ("veertiger jaren", 40), + ("jaren 50", 50), + ("jaren vijftig", 50), + ("vijftiger jaren", 50), + ("jaren 60", 60), + ("jaren zestig", 60), + ("zestiger jaren", 60), + ("jaren 70", 70), + ("jaren zeventig", 70), + ("zeventiger jaren", 70), + ("jaren 80", 80), + ("jaren tachtig", 80), + ("tachtiger jaren", 80), + ("jaren 90", 90), + ("jaren negentig", 90), + ("nul", 0), + ("tien", 10), + ("twintig", 20), + ("twintiger", 20), + ("dertig", 30), + ("dertiger", 30), + ("veertig", 40), + ("veertiger", 40), + ("vijftig", 50), + ("vijftiger", 50), + ("zestig", 60), + ("zestiger", 60), + ("zeventig", 70), + ("zeventiger", 70), + ("tachtig", 80), + ("tachtiger", 80), + ("negentig", 90), + ("negentiger", 90), + ("honderd", 0), + ] + ) + SpecialDecadeCases = dict( + [("21e eeuw", 2000), ("eenentwintigste eeuw", 2000), ("tweeduizend", 2000), ("jaren nul", 0), ("nul", 0)] + ) + DefaultLanguageFallback = 'DMY' + SuperfluousWordList = [r'preferably', r'how about', r'maybe', r'say', r'like'] + DurationDateRestrictions = [r'vandaag', r'nu'] + AmbiguityFiltersDict = dict( + [ + ("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), + ( + "\\b(ontbijt|lunch|avondeten)$", + "(?(?\\b(to|(un)?till?|thru|through)\\b(\\s+the\\b)?|{BaseDateTime.RangeConnectorSymbolRegex})' RangeConnectorRegex = f'(?\\b(and|through|to)\\b(\\s+the\\b)?|{BaseDateTime.RangeConnectorSymbolRegex})' - LastNegPrefix = f'(?following|next|(up)?coming|this|{LastNegPrefix}last|past|previous|current|the)\\b' StrictRelativeRegex = f'\\b(?following|next|(up)?coming|this|{LastNegPrefix}last|past|previous|current)\\b' - UpcomingPrefixRegex = f'((this\\s+)?((up)?coming))' + UpcomingPrefixRegex = '((this\\s+)?((up)?coming))' NextPrefixRegex = f'\\b(following|next|{UpcomingPrefixRegex})\\b' - AfterNextSuffixRegex = f'\\b(after\\s+(the\\s+)?next)\\b' - PastPrefixRegex = f'((this\\s+)?past)\\b' + AfterNextSuffixRegex = '\\b(after\\s+(the\\s+)?next)\\b' + PastPrefixRegex = '((this\\s+)?past)\\b' PreviousPrefixRegex = f'({LastNegPrefix}last|previous|{PastPrefixRegex})\\b' - ThisPrefixRegex = f'(this|current)\\b' - RangePrefixRegex = f'(from|between)' - CenturySuffixRegex = f'(^century)\\b' - ReferencePrefixRegex = f'(that|same)\\b' - FutureSuffixRegex = f'\\b((in\\s+the\\s+)?future|hence)\\b' - PastSuffixRegex = f'\\b((in\\s+the\\s+)past)\\b' - DayRegex = f'(the\\s*)?(?(?:3[0-1]|[1-2]\\d|0?[1-9])(?:th|nd|rd|st)?)(?=\\b|t)' - ImplicitDayRegex = f'(the\\s*)?(?(?:3[0-1]|[0-2]?\\d)(?:th|nd|rd|st))\\b' - MonthNumRegex = f'(?1[0-2]|(0)?[1-9])\\b' - WrittenOneToNineRegex = f'(?:one|two|three|four|five|six|seven|eight|nine)' - WrittenElevenToNineteenRegex = f'(?:eleven|twelve|(?:thir|four|fif|six|seven|eigh|nine)teen)' - WrittenTensRegex = f'(?:ten|twenty|thirty|fou?rty|fifty|sixty|seventy|eighty|ninety)' - WrittenNumRegex = f'(?:{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}(\\s+{WrittenOneToNineRegex})?)' - WrittenOneToNineOrdinalRegex = f'(?:first|second|third|fourth|fifth|sixth|seventh|eighth|nine?th)' - WrittenTensOrdinalRegex = f'(?:tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|thirtieth|fortieth|fiftieth|sixtieth|seventieth|eightieth|ninetieth)' + ThisPrefixRegex = '(this|current)\\b' + RangePrefixRegex = '(from|between)' + CenturySuffixRegex = '(^century)\\b' + ReferencePrefixRegex = '(that|same)\\b' + FutureSuffixRegex = '\\b((in\\s+the\\s+)?future|hence)\\b' + PastSuffixRegex = '\\b((in\\s+the\\s+)past)\\b' + DayRegex = '(the\\s*)?(?(?:3[0-1]|[1-2]\\d|0?[1-9])(?:th|nd|rd|st)?)(?=\\b|t)' + ImplicitDayRegex = '(the\\s*)?(?(?:3[0-1]|[0-2]?\\d)(?:th|nd|rd|st))\\b' + MonthNumRegex = '(?1[0-2]|(0)?[1-9])\\b' + WrittenOneToNineRegex = '(?:one|two|three|four|five|six|seven|eight|nine)' + WrittenElevenToNineteenRegex = '(?:eleven|twelve|(?:thir|four|fif|six|seven|eigh|nine)teen)' + WrittenTensRegex = '(?:ten|twenty|thirty|fou?rty|fifty|sixty|seventy|eighty|ninety)' + WrittenNumRegex = ( + f'(?:{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}(\\s+{WrittenOneToNineRegex})?)' + ) + WrittenOneToNineOrdinalRegex = '(?:first|second|third|fourth|fifth|sixth|seventh|eighth|nine?th)' + WrittenTensOrdinalRegex = '(?:tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|thirtieth|fortieth|fiftieth|sixtieth|seventieth|eightieth|ninetieth)' WrittenOrdinalRegex = f'(?:{WrittenOneToNineOrdinalRegex}|{WrittenTensOrdinalRegex}|{WrittenTensRegex}\\s+{WrittenOneToNineOrdinalRegex})' WrittenOrdinalDayRegex = f'\\b(the\\s+)?(?(?{WrittenOneToNineOrdinalRegex}|(?:tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|thirtieth)|(?:ten|twenty)\\s+{WrittenOneToNineOrdinalRegex}|thirty\\s+first))\\b' WrittenCenturyFullYearRegex = f'(?:(one|two)\\s+thousand((\\s+and)?\\s+{WrittenOneToNineRegex}\\s+hundred)?)' - WrittenCenturyOrdinalYearRegex = f'(?:twenty(\\s+(one|two))?|ten|eleven|twelve|thirteen|fifteen|eighteen|(?:four|six|seven|nine)(teen)?|one|two|three|five|eight)' + WrittenCenturyOrdinalYearRegex = '(?:twenty(\\s+(one|two))?|ten|eleven|twelve|thirteen|fifteen|eighteen|(?:four|six|seven|nine)(teen)?|one|two|three|five|eight)' CenturyRegex = f'\\b(?{WrittenCenturyFullYearRegex}|{WrittenCenturyOrdinalYearRegex}(\\s+hundred)?)\\b' - LastTwoYearNumRegex = f'(?:(zero\\s+)?{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}(\\s+{WrittenOneToNineRegex})?)' + LastTwoYearNumRegex = f'(?:(zero\\s+)?{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}((\\s+|-){WrittenOneToNineRegex})?)' FullTextYearRegex = f'\\b((?{CenturyRegex})(\\s+and)?\\s+(?{LastTwoYearNumRegex})\\b|\\b(?{WrittenCenturyFullYearRegex}|{WrittenCenturyOrdinalYearRegex}\\s+hundred))\\b' - OclockRegex = f'(?o\\s*((’|‘|\')\\s*)?clock|sharp)' - SpecialDescRegex = f'((?)p\\b)' - TasksModeSpecialDescRegex = f'([0-9]+((?)p\\b))' + OclockRegex = '(?o\\s*((’|‘|\')\\s*)?clock|sharp)' + SpecialDescRegex = '((?)p\\b)' + TasksModeSpecialDescRegex = '([0-9]+((?)p\\b))' AmDescRegex = f'(?:{BaseDateTime.BaseAmDescRegex})' PmDescRegex = f'(:?{BaseDateTime.BasePmDescRegex})' AmPmDescRegex = f'(:?{BaseDateTime.BaseAmPmDescRegex})' DescRegex = f'(:?(:?({OclockRegex}\\s+)?(?({AmPmDescRegex}|{AmDescRegex}|{PmDescRegex}|{SpecialDescRegex})))|{OclockRegex})' - OfPrepositionRegex = f'(\\bof\\b)' + OfPrepositionRegex = '(\\bof\\b)' TwoDigitYearRegex = f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d)))\\b' YearRegex = f'(?:{BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' - WeekDayRegex = f'\\b(?(?:sun|mon|tues?|thurs?|fri)(day)?|thu|wedn(esday)?|weds?|sat(urday)?)s?\\b' - SingleWeekDayRegex = f'\\b(?(?(?:sun|mon|tues?|thurs?|fri)(day)?|thu|wedn(esday)?|weds?|sat(urday)?)s?\\b' + SingleWeekDayRegex = '\\b(?(?((day\\s+)?of\\s+)?{RelativeRegex}\\s+month)\\b' - MonthRegexNoWordBoundary = f'(?apr(il)?|aug(ust)?|dec(ember)?|feb(ruary)?|jan(uary)?|july?|june?|mar(ch)?|may|nov(ember)?|oct(ober)?|sept(ember)?|sep)(?!\\p{{L}})' + MonthRegexNoWordBoundary = '(?apr(il)?|aug(ust)?|dec(ember)?|feb(ruary)?|jan(uary)?|july?|june?|mar(ch)?|may|nov(ember)?|oct(ober)?|sept(ember)?|sep)(?!\\p{L})' MonthRegex = f'\\b{MonthRegexNoWordBoundary}' WrittenMonthRegex = f'(((the\\s+)?month of\\s+)?{MonthRegex})' MonthSuffixRegex = f'(?(?:(in|of|on)\\s+)?({RelativeMonthRegex}|{WrittenMonthRegex}))' - DateUnitRegex = f'(?(decade|year|(?month|week)|(?(business\\s+|week\\s*))?(?day)|fortnight|weekend)(?s)?|(?<=(^|\\s)\\d{{1,4}})[ymwd])\\b' + DateUnitRegex = '(?(decade|year|(?month|week)|(?(business\\s+|week\\s*))?(?day)|fortnight|weekend)(?s)?|(?<=(^|\\s)\\d{1,4})[ymwd])\\b' DateTokenPrefix = 'on ' TimeTokenPrefix = 'at ' TokenBeforeDate = 'on ' TokenBeforeTime = 'at ' - HalfTokenRegex = f'^(half)' - QuarterTokenRegex = f'^((a\\s+)?quarter)' - ThreeQuarterTokenRegex = f'^(three\\s+quarters?)' - ToTokenRegex = f'\\b(to)$' - FromRegex = f'\\b(from(\\s+the)?)$' - BetweenTokenRegex = f'\\b(between(\\s+the)?)$' + HalfTokenRegex = '^(half)' + QuarterTokenRegex = '^((a\\s+)?quarter)' + ThreeQuarterTokenRegex = '^(three\\s+quarters?)' + ToTokenRegex = '\\b(to)$' + FromRegex = '\\b(from(\\s+the)?)$' + BetweenTokenRegex = '\\b(between(\\s+the)?)$' SimpleCasesRegex = f'\\b({RangePrefixRegex}\\s+)?({DayRegex}|{WrittenOrdinalDayRegex})\\s*{TillRegex}\\s*(({DayRegex}|{WrittenOrdinalDayRegex})\\s+{MonthSuffixRegex}|{MonthSuffixRegex}\\s+({DayRegex}|{WrittenOrdinalDayRegex}))((\\s+|\\s*,\\s*){YearRegex})?\\b' MonthFrontSimpleCasesRegex = f'\\b({RangePrefixRegex}\\s+)?{MonthSuffixRegex}\\s+((from)\\s+)?({DayRegex}|{WrittenOrdinalDayRegex})\\s*{TillRegex}\\s*({DayRegex}|{WrittenOrdinalDayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' MonthFrontBetweenRegex = f'\\b{MonthSuffixRegex}\\s+(between\\s+)({DayRegex}|{WrittenOrdinalDayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex}|{WrittenOrdinalDayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' BetweenRegex = f'\\b(between\\s+)({DayRegex}|{WrittenOrdinalDayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex}|{WrittenOrdinalDayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*){YearRegex})?\\b' - MonthWithYear = f'\\b((({WrittenMonthRegex}[\\.]?|((the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|sixth|6th|seventh|7th|eighth|8th|ninth|9th|tenth|10th|eleventh|11th|twelfth|12th|last)\\s+month(?=\\s+(of|in))))((\\s*)[/\\\\\\-\\.,]?(\\s+(of|in))?(\\s*)({YearRegex}|(?following|next|last|this)\\s+year)|\\s+(of|in)\\s+{TwoDigitYearRegex}))|(({YearRegex}|(?following|next|last|this)\\s+year)(\\s*),?(\\s*){WrittenMonthRegex}))\\b' - SpecialYearPrefixes = f'(calendar|(?fiscal|school))' + MonthWithYear = f'\\b((({WrittenMonthRegex}[\\.]?|((the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|sixth|6th|seventh|7th|eighth|8th|ninth|9th|tenth|10th|eleventh|11th|twelfth|12th|last)\\s+month(?=\\s+(of|in))))((\\s*)[/\\\\\\-\\.,]?(\\s+(of|in))?(\\s*)({YearRegex}|\\\'?{TwoDigitYearRegex}|(?following|next|last|this)\\s+year)|\\s+(of|in)\\s+{TwoDigitYearRegex}))|(({YearRegex}|(?following|next|last|this)\\s+year)(\\s*),?(\\s*){WrittenMonthRegex}))\\b' + SpecialYearPrefixes = '(calendar|(?fiscal|school))' OneWordPeriodRegex = f'\\b((((the\\s+)?month of\\s+)?({StrictRelativeRegex}\\s+)?{MonthRegex})|(month|year) to date|(?((un)?till?|to)\\s+date)|({RelativeRegex}\\s+)?(my\\s+)?((?working\\s+week|workweek)|week(end)?|month|fortnight|(({SpecialYearPrefixes}\\s+)?year))(?!((\\s+of)?\\s+\\d+(?!({BaseDateTime.BaseAmDescRegex}|{BaseDateTime.BasePmDescRegex}))|\\s+to\\s+date))(\\s+{AfterNextSuffixRegex})?)\\b' MonthNumWithYear = f'\\b(({BaseDateTime.FourDigitYearRegex}(\\s*)[/\\-\\.](\\s*){MonthNumRegex})|({MonthNumRegex}(\\s*)[/\\-](\\s*){BaseDateTime.FourDigitYearRegex}))\\b' WeekOfMonthRegex = f'\\b(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+week\\s+{MonthSuffixRegex}(\\s+{BaseDateTime.FourDigitYearRegex}|{RelativeRegex}\\s+year)?)\\b' WeekOfYearRegex = f'\\b(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+week(\\s+of)?\\s+({YearRegex}|{RelativeRegex}\\s+year))\\b' OfYearRegex = f'\\b((of|in)\\s+({YearRegex}|{StrictRelativeRegex}\\s+year))\\b' - FirstLastRegex = f'\\b(the\\s+)?((?first)|(?last))\\b' + FirstLastRegex = '\\b(the\\s+)?((?first)|(?last))\\b' FollowedDateUnit = f'^\\s*{DateUnitRegex}' NumberCombinedWithDateUnit = f'\\b(?\\d+(\\.\\d*)?){DateUnitRegex}' - QuarterTermRegex = f'\\b(((?first|1st|second|2nd|third|3rd|fourth|4th)[ -]+quarter)|(q(?[1-4])))\\b' + QuarterTermRegex = ( + '\\b(((?first|1st|second|2nd|third|3rd|fourth|4th)[ -]+quarter)|(q(?[1-4])))\\b' + ) RelativeQuarterTermRegex = f'\\b(?{StrictRelativeRegex})\\s+((?[\\w,]+)\\s+)?quarters?\\b' QuarterRegex = f'((the\\s+)?{QuarterTermRegex}(?:((\\s+of)?\\s+|\\s*[,-]\\s*)({YearRegex}|{RelativeRegex}\\s+year))?)|{RelativeQuarterTermRegex}' - QuarterRegexYearFront = f'(?:{YearRegex}|{RelativeRegex}\\s+year)(\'s)?(?:\\s*-\\s*|\\s+(the\\s+)?)?{QuarterTermRegex}' - HalfYearTermRegex = f'(?first|1st|second|2nd)\\s+half' - HalfYearFrontRegex = f'(?((1[5-9]|20)\\d{{2}})|2100)(\\s*-\\s*|\\s+(the\\s+)?)?h(?[1-2])' + QuarterRegexYearFront = ( + f'(?:{YearRegex}|{RelativeRegex}\\s+year)(\'s)?(?:\\s*-\\s*|\\s+(the\\s+)?)?{QuarterTermRegex}' + ) + HalfYearTermRegex = '(?first|1st|second|2nd)\\s+half' + HalfYearFrontRegex = '(?((1[5-9]|20)\\d{2})|2100)(\\s*-\\s*|\\s+(the\\s+)?)?h(?[1-2])' HalfYearBackRegex = f'(the\\s+)?(h(?[1-2])|({HalfYearTermRegex}))(\\s+of|\\s*,\\s*)?\\s+({YearRegex})' HalfYearRelativeRegex = f'(the\\s+)?{HalfYearTermRegex}(\\s+of|\\s*,\\s*)?\\s+({RelativeRegex}\\s+year)' AllHalfYearRegex = f'({HalfYearFrontRegex})|({HalfYearBackRegex})|({HalfYearRelativeRegex})' - EarlyPrefixRegex = f'\\b(?early|beginning of|start of|(?earlier(\\s+in)?))\\b' - MidPrefixRegex = f'\\b(?mid-?|middle of)\\b' - LaterPrefixRegex = f'\\b(?late|end of|(?later(\\s+in)?))\\b' + EarlyPrefixRegex = '\\b(?early|beginning of|start of|(?earlier(\\s+in)?))\\b' + MidPrefixRegex = '\\b(?mid-?|middle of)\\b' + LaterPrefixRegex = '\\b(?late|end of|(?later(\\s+in)?))\\b' PrefixPeriodRegex = f'({EarlyPrefixRegex}|{MidPrefixRegex}|{LaterPrefixRegex})' - PrefixDayRegex = f'\\b((?earl(y|ier))|(?mid(dle)?)|(?later?))(\\s+in)?(\\s+the\\s+day)?$' - SeasonDescRegex = f'(?spring|summer|fall|autumn|winter)' + PrefixDayRegex = ( + '\\b((?earl(y|ier))|(?mid(dle)?)|(?later?))(\\s+in)?(\\s+the\\s+day)?$' + ) + SeasonDescRegex = '(?spring|summer|fall|autumn|winter)' SeasonRegex = f'\\b(?({PrefixPeriodRegex}\\s+)?({RelativeRegex}\\s+)?{SeasonDescRegex}((\\s+of|\\s*,\\s*)?\\s+({YearRegex}|{RelativeRegex}\\s+year))?)\\b' - WhichWeekRegex = f'\\b(week)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])(\\s+of\\s+({YearRegex}|{RelativeRegex}\\s+year))?\\b' - WeekOfRegex = f'(the\\s+)?((week)(\\s+(of|(commencing|starting|beginning)(\\s+on)?))|w/c)(\\s+the)?' - MonthOfRegex = f'(month)(\\s*)(of)' - DateYearRegex = f'(?{BaseDateTime.FourDigitYearRegex}|(?5[0-3]|[1-4]\\d|0?[1-9])(\\s+of\\s+({YearRegex}|{RelativeRegex}\\s+year))?\\b' + ) + WeekOfRegex = '(the\\s+)?((week)(\\s+(of|(commencing|starting|beginning)(\\s+on)?))|w/c)(\\s+the)?' + MonthOfRegex = '(month)(\\s*)(of)' + DateYearRegex = f'(?{BaseDateTime.FourDigitYearRegex}|(?(3[0-1]|[0-2]?\\d)(?:th|nd|rd|st))s?)\\b' - PrefixWeekDayRegex = f'(\\s*((,?\\s*on)|[-—–]))' - ThisRegex = f'\\b(this(\\s*week{PrefixWeekDayRegex}?)?\\s*{WeekDayRegex})|({WeekDayRegex}((\\s+of)?\\s+this\\s*week))\\b' + RelaxedOnRegex = '(?<=\\b(on|at|in)\\s+)((?(3[0-1]|[0-2]?\\d)(?:th|nd|rd|st))s?)\\b' + PrefixWeekDayRegex = '(\\s*((,?\\s*on)|[-—–]))' + ThisRegex = ( + f'\\b(this(\\s*week{PrefixWeekDayRegex}?)?\\s*{WeekDayRegex})|({WeekDayRegex}((\\s+of)?\\s+this\\s*week))\\b' + ) LastDateRegex = f'\\b({PreviousPrefixRegex}(\\s*week{PrefixWeekDayRegex}?)?\\s*{WeekDayRegex})|({WeekDayRegex}(\\s+(of\\s+)?last\\s*week))\\b' NextDateRegex = f'\\b({NextPrefixRegex}(\\s*week{PrefixWeekDayRegex}?)?\\s*{WeekDayRegex})|((on\\s+)?{WeekDayRegex}((\\s+of)?\\s+(the\\s+following|(the\\s+)?next)\\s*week))\\b' SpecialDayRegex = f'\\b((the\\s+)?day before yesterday|(the\\s+)?day after (tomorrow|tmrw?)|the\\s+day\\s+(before|after)(?!=\\s+day)|((the\\s+)?({RelativeRegex}|my)\\s+day)|yesterday|tomorrow|tmrw?|today|otd|current date)\\b' - SpecialDayWithNumRegex = f'\\b((?{WrittenNumRegex})\\s+days?\\s+from\\s+(?yesterday|tomorrow|tmrw?|today|current date))\\b' + SpecialDayWithNumRegex = ( + f'\\b((?{WrittenNumRegex})\\s+days?\\s+from\\s+(?yesterday|tomorrow|tmrw?|today|current date))\\b' + ) RelativeDayRegex = f'\\b(((the\\s+)?{RelativeRegex}\\s+day))\\b' - SetWeekDayRegex = f'\\b(?on\\s+)?(?morning|afternoon|evening|night|(sun|mon|tues|wednes|thurs|fri|satur)day)s\\b' WeekDayOfMonthRegex = f'(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+(week\\s+{MonthSuffixRegex}[\\.]?\\s+(on\\s+)?{WeekDayRegex}|{WeekDayRegex}\\s+{MonthSuffixRegex}))' RelativeWeekDayRegex = f'\\b({WrittenNumRegex}\\s+{WeekDayRegex}\\s+(from\\s+now|later))\\b' SpecialDate = f'(?=\\b(on|at)\\s+the\\s+){DayRegex}\\b' - DatePreposition = f'\\b(on|in)' + DatePreposition = '\\b(on|in)' DateExtractorYearTermRegex = f'(\\s+|\\s*[/\\\\.,-]\\s*|\\s+of\\s+){DateYearRegex}' DayPrefix = f'\\b({WeekDayRegex}|{SpecialDayRegex})\\b' DateExtractor1 = f'\\b({DayPrefix}\\s*[,-]?\\s*)?(({MonthRegex}[\\.]?\\s*[/\\\\.,-]?\\s*{DayRegex})|(\\({MonthRegex}\\s*[-./]\\s*{DayRegex}\\)))(?!\\s*\\-\\s*\\d{{2}}\\b)(\\s*\\(\\s*{DayPrefix}\\s*\\))?({DateExtractorYearTermRegex}\\b)?' @@ -132,608 +147,665 @@ class EnglishDateTime: DateExtractor4 = f'\\b{MonthNumRegex}\\s*[/\\\\\\-]\\s*{DayRegex}[\\.]?\\s*[/\\\\\\-]\\s*{DateYearRegex}' DateExtractor5 = f'\\b({DayPrefix}(\\s*,)?\\s+)?{DayRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DateYearRegex}(?!\\s*[/\\\\\\-\\.]\\s*\\d+)' DateExtractor6 = f'(?<={DatePreposition}\\s+)({StrictRelativeRegex}\\s+)?({DayPrefix}\\s+)?{MonthNumRegex}[\\-\\.]{DayRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\\b' - DateExtractor7L = f'\\b({DayPrefix}(\\s*,)?\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}{DateExtractorYearTermRegex}(?![%])\\b' - DateExtractor7S = f'\\b({DayPrefix}(\\s*,)?\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\\b' + DateExtractor7L = f'\\b({DayPrefix}(\\s*,)?\\s+)?(the\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}{DateExtractorYearTermRegex}(?![%])\\b' + DateExtractor7S = f'\\b({DayPrefix}(\\s*,)?\\s+)?(the\\s+)?{MonthNumRegex}\\s*/\\s*{DayRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\\b' DateExtractor8 = f'(?<={DatePreposition}\\s+)({StrictRelativeRegex}\\s+)?({DayPrefix}\\s+)?{DayRegex}[\\\\\\-]{MonthNumRegex}(?![%]){BaseDateTime.CheckDecimalRegex}\\b' - DateExtractor9L = f'\\b({DayPrefix}(\\s*,)?\\s+)?{DayRegex}\\s*/\\s*{MonthNumRegex}{DateExtractorYearTermRegex}(?![%])\\b' - DateExtractor9S = f'\\b({DayPrefix}(\\s*,)?\\s+)?{DayRegex}\\s*/\\s*{MonthNumRegex}{BaseDateTime.CheckDecimalRegex}(?![%])\\b' - DateExtractorNoSep = f'\\b((?((1\\d|20)\\d{{2}})|2100)(\\s+(?1[0-2]|(0)?[1-9])\\s+(?(?:3[0-1]|[1-2]\\d|0?[1-9]))|(?1[0-2]|(0)?[1-9])(?(?:3[0-1]|[1-2]\\d|0?[1-9])))\\b)' + DateExtractor9L = ( + f'\\b({DayPrefix}(\\s*,)?\\s+)?{DayRegex}\\s*/\\s*{MonthNumRegex}{DateExtractorYearTermRegex}(?![%])\\b' + ) + DateExtractor9S = ( + f'\\b({DayPrefix}(\\s*,)?\\s+)?{DayRegex}\\s*/\\s*{MonthNumRegex}{BaseDateTime.CheckDecimalRegex}(?![%])\\b' + ) + DateExtractorNoSep = '\\b((?((1\\d|20)\\d{2})|2100)(\\s+(?1[0-2]|(0)?[1-9])\\s+(?(?:3[0-1]|[1-2]\\d|0?[1-9]))|(?1[0-2]|(0)?[1-9])(?(?:3[0-1]|[1-2]\\d|0?[1-9])))\\b)' DateExtractorA = f'\\b({DayPrefix}(\\s*,)?\\s+)?(({BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DayRegex})|({MonthRegex}\\s*[/\\\\\\-\\.]\\s*{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*(the\\s+)?(?(?:3[0-1]|[1-2]\\d|0?[1-9])(?:th|nd|rd|st)?))|({DayRegex}\\s*[/\\\\\\-\\.]\\s*{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*{MonthRegex})|{DateExtractorNoSep})' OfMonth = f'^(\\s*(day\\s+)?of)?\\s*{MonthRegex}' MonthEnd = f'{MonthRegex}\\s*(the)?\\s*$' WeekDayEnd = f'(this\\s+)?{WeekDayRegex}\\s*,?\\s*$' WeekDayStart = f'^\\s+(on\\s+)?{WeekDayRegex}\\b' - RangeUnitRegex = f'\\b(?years?|months?|weeks?|fortnights?)\\b' - HourNumRegex = f'\\b(?zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b' - MinuteNumRegex = f'(((?twenty|thirty|fou?rty|fifty)(\\s*-?\\s*))?(?one|two|three|four|five|six|seven|eight|nine)|(?ten|eleven|twelve|thirteen|fifteen|eighteen|(four|six|seven|nine)(teen)|twenty|thirty|forty|fifty))' - DeltaMinuteNumRegex = f'(((?twenty|thirty|fou?rty|fifty)(\\s*-?\\s*))?(?one|two|three|four|five|six|seven|eight|nine)|(?ten|eleven|twelve|thirteen|fifteen|eighteen|(four|six|seven|nine)(teen)|twenty|thirty|forty|fifty))' - PmRegex = f'(?(((?:at|in|around|circa|on|for)\\s+(the\\s+)?)?(((early|late)\\s+)?(afternoon|evening)|midnight|lunchtime))|((at|in|around|on|for)\\s+(the\\s+)?night))' - PmRegexFull = f'(?((?:at|in|around|circa|on|for)\\s+(the\\s+)?)?(((early|late)\\s+)?(afternoon|evening)|(mid)?night|lunchtime))' - AmRegex = f'(?((?:at|in|around|circa|on|for)\\s+(the\\s+)?)?((early|late)\\s+)?(morning))' - LunchRegex = f'\\blunchtime\\b' - NightRegex = f'\\b(mid)?night\\b' - CommonDatePrefixRegex = f'^[\\.]' - LessThanOneHour = f'(?(a\\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\\s+(minutes?|mins?))|{DeltaMinuteNumRegex}(\\s+(minutes?|mins?)))' + RangeUnitRegex = '\\b(?years?|months?|weeks?|fortnights?)\\b' + HourNumRegex = '\\b(?zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b' + MinuteNumRegex = '(((?twenty|thirty|fou?rty|fifty)(\\s*-?\\s*))?(?one|two|three|four|five|six|seven|eight|nine)|(?ten|eleven|twelve|thirteen|fifteen|eighteen|(four|six|seven|nine)(teen)|twenty|thirty|forty|fifty))' + DeltaMinuteNumRegex = '(((?twenty|thirty|fou?rty|fifty)(\\s*-?\\s*))?(?one|two|three|four|five|six|seven|eight|nine)|(?ten|eleven|twelve|thirteen|fifteen|eighteen|(four|six|seven|nine)(teen)|twenty|thirty|forty|fifty))' + PmRegex = '(?(((?:at|in|around|circa|on|for)\\s+(the\\s+)?)?(((early|late)\\s+)?(afternoon|evening)|midnight|lunchtime))|((at|in|around|on|for)\\s+(the\\s+)?night))' + PmRegexFull = '(?((?:at|in|around|circa|on|for)\\s+(the\\s+)?)?(((early|late)\\s+)?(afternoon|evening)|(mid)?night|lunchtime))' + AmRegex = '(?((?:at|in|around|circa|on|for)\\s+(the\\s+)?)?((early|late)\\s+)?(morning))' + LunchRegex = '\\blunchtime\\b' + NightRegex = '\\b(mid)?night\\b' + CommonDatePrefixRegex = '^[\\.]' + LessThanOneHour = f'(?(a\\s+)?quarter|three quarter(s)?|half( an hour)?|{BaseDateTime.DeltaMinuteRegex}(\\s+(minutes?|mins?)|(?=\\s+past))|{DeltaMinuteNumRegex}(\\s+(minutes?|mins?)|(?=\\s+past)))' WrittenTimeRegex = f'(?{HourNumRegex}\\s+{MinuteNumRegex}(\\s+(minutes?|mins?))?)' TimePrefix = f'(?{LessThanOneHour}\\s+(past|to))' TimeSuffix = f'(?{AmRegex}|{PmRegex}|{OclockRegex})' TimeSuffixFull = f'(?{AmRegex}|{PmRegexFull}|{OclockRegex})' BasicTime = f'\\b(?{WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}:{BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|{BaseDateTime.HourRegex}(?![%\\d]))' - MidnightRegex = f'(?mid\\s*(-\\s*)?night)' - MidmorningRegex = f'(?mid\\s*(-\\s*)?morning)' - MidafternoonRegex = f'(?mid\\s*(-\\s*)?afternoon)' - MiddayRegex = f'(?mid\\s*(-\\s*)?day|((12\\s)?noon))' + MidnightRegex = '(?mid\\s*(-\\s*)?night)' + MidmorningRegex = '(?mid\\s*(-\\s*)?morning)' + MidafternoonRegex = '(?mid\\s*(-\\s*)?afternoon)' + MiddayRegex = '(?mid\\s*(-\\s*)?day|((12\\s)?noon))' MidTimeRegex = f'(?({MidnightRegex}|{MidmorningRegex}|{MidafternoonRegex}|{MiddayRegex}))' AtRegex = f'\\b(?:(?:(?<=\\b(at|(at)?\\s*around|circa)\\s+)(?:{WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}(?!\\.\\d)(\\s*((?a)|(?p)))?|{MidTimeRegex}))|{MidTimeRegex})\\b' IshRegex = f'\\b({BaseDateTime.HourRegex}(-|——)?ish|noon(ish)?)\\b' - TimeUnitRegex = f'([^a-z]{{1,}}|\\b)(?(h(ou)?r|min(ute)?|sec(ond)?)(?s)?|h)\\b' - RestrictedTimeUnitRegex = f'(?hour|minute)\\b' - FivesRegex = f'(?(?:fifteen|(?:twen|thir|fou?r|fif)ty(\\s*five)?|ten|five))\\b' + TimeUnitRegex = '([^a-z]{1,}|\\b)(?(h(ou)?r|min(ute)?|sec(ond)?)(?s)?|h)\\b' + RestrictedTimeUnitRegex = '(?hour|minute)\\b' + FivesRegex = '(?(?:fifteen|(?:twen|thir|fou?r|fif)ty(\\s*five)?|ten|five))\\b' HourRegex = f'\\b{BaseDateTime.HourRegex}' - PeriodHourNumRegex = f'\\b(?twenty(\\s+(one|two|three|four))?|eleven|twelve|thirteen|fifteen|eighteen|(four|six|seven|nine)(teen)?|zero|one|two|three|five|eight|ten)\\b' + PeriodHourNumRegex = '\\b(?twenty(\\s+(one|two|three|four))?|eleven|twelve|thirteen|fifteen|eighteen|(four|six|seven|nine)(teen)?|zero|one|two|three|five|eight|ten)\\b' ConnectNumRegex = f'\\b{BaseDateTime.HourRegex}(?[0-5][0-9])\\s*{DescRegex}' TimeRegexWithDotConnector = f'({BaseDateTime.HourRegex}(\\s*\\.\\s*){BaseDateTime.MinuteRegex})' - TimeRegex1 = f'\\b({TimePrefix}\\s+)?({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})(\\s*|[.]){DescRegex}' + TimeRegex1 = ( + f'\\b({TimePrefix}\\s+)?({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})(\\s*|[.]){DescRegex}' + ) TimeRegex2 = f'(\\b{TimePrefix}\\s+)?(t)?{BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?{BaseDateTime.SecondRegex})?(?a)?((\\s*{DescRegex})|\\b)' TimeRegex3 = f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}\\.{BaseDateTime.MinuteRegex}(\\s*{DescRegex})' TimeRegex4 = f'\\b{TimePrefix}\\s+{BasicTime}(\\s*{DescRegex})?\\s+{TimeSuffix}\\b' TimeRegex5 = f'\\b{TimePrefix}\\s+{BasicTime}((\\s*{DescRegex})|\\b)' TimeRegex6 = f'({BasicTime})(\\s*{DescRegex})?\\s+{TimeSuffix}\\b' TimeRegex7 = f'\\b{TimeSuffixFull}\\s+(at\\s+)?{BasicTime}((\\s*{DescRegex})|\\b)' - TimeRegex8 = f'.^' + TimeRegex8 = '.^' TimeRegex9 = f'\\b{PeriodHourNumRegex}(\\s+|-){FivesRegex}((\\s*{DescRegex})|\\b)' - TimeRegex10 = f'\\b({TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' + TimeRegex10 = ( + f'\\b({TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' + ) TimeRegex11 = f'\\b((?:({TimeTokenPrefix})?{TimeRegexWithDotConnector}(\\s*{DescRegex}))|(?:(?:{TimeTokenPrefix}{TimeRegexWithDotConnector})(?!\\s*per\\s*cent|%)))' FirstTimeRegexInTimeRange = f'\\b{TimeRegexWithDotConnector}(\\s*{DescRegex})?' PureNumFromTo = f'({RangePrefixRegex}\\s+)?({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?\\s*{TillRegex}\\s*({HourRegex}|{PeriodHourNumRegex})(?\\s*({PmRegex}|{AmRegex}|{DescRegex}))?' PureNumBetweenAnd = f'(between\\s+)(({BaseDateTime.TwoDigitHourRegex}{BaseDateTime.TwoDigitMinuteRegex})|{HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?\\s*{RangeConnectorRegex}\\s*(({BaseDateTime.TwoDigitHourRegex}{BaseDateTime.TwoDigitMinuteRegex})|{HourRegex}|{PeriodHourNumRegex})(?\\s*({PmRegex}|{AmRegex}|{DescRegex}))?' SpecificTimeFromTo = f'({RangePrefixRegex}\\s+)?(?(({TimeRegex2}|{FirstTimeRegexInTimeRange})|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{TillRegex}\\s*(?(({TimeRegex2}|{TimeRegexWithDotConnector}(?\\s*{DescRegex}))|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))' SpecificTimeBetweenAnd = f'(between\\s+)(?(({TimeRegex2}|{FirstTimeRegexInTimeRange})|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{RangeConnectorRegex}\\s*(?(({TimeRegex2}|{TimeRegexWithDotConnector}(?\\s*{DescRegex}))|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))' - SuffixAfterRegex = f'\\b(((at)\\s)?(or|and)\\s+(above|after|later|greater)(?!\\s+than))\\b' - PrepositionRegex = f'(?^(,\\s*)?(at|on|of)(\\s+the)?$)' - LaterEarlyRegex = f'((?earl(y|ier)(\\s+|-))|(?late(r?\\s+|-)))' - MealTimeRegex = f'\\b(at\\s+)?(?breakfast|brunch|lunch(\\s*time)?|dinner(\\s*time)?|supper)\\b' + SuffixAfterRegex = '\\b(((at)\\s)?(or|and)\\s+(above|after|later|greater)(?!\\s+than))\\b' + PrepositionRegex = '(?^(,\\s*)?(at|on|of)(\\s+the)?$)' + LaterEarlyRegex = '((?earl(y|ier)(\\s+|-))|(?late(r?\\s+|-)))' + MealTimeRegex = '\\b(at\\s+)?(?breakfast|brunch|lunch(\\s*time)?|dinner(\\s*time)?|supper)\\b' UnspecificTimePeriodRegex = f'({MealTimeRegex})' TimeOfDayRegex = f'\\b(?((((in\\s+the\\s+){LaterEarlyRegex}?(morning|afternoon|night(-?time)?|evening)s)|((in\\s+the\\s+)?{LaterEarlyRegex}?(in(\\s+the)?\\s+)?(morning|afternoon|night(-?time)?|evening)))|{MealTimeRegex}|(((in\\s+(the)?\\s+)?)(daytime|business\\s+hours?))))\\b' SpecificTimeOfDayRegex = f'\\b(({StrictRelativeRegex}\\s+{TimeOfDayRegex})\\b|\\b(?toni(ght|te)))s?\\b' TimeFollowedUnit = f'^\\s*{TimeUnitRegex}' TimeNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?){TimeUnitRegex}' BusinessHourSplitStrings = [r'business', r'hour'] - NowRegex = f'\\b(?(right\\s+)?now|as\\s+soon\\s+as\\s+possible|asap|recently|previously|at\\s+(present|this\\s+time|th(e|is)\\s+minute|the\\s+(moment|present\\s+time)))\\b' + NowRegex = '\\b(?(right\\s+)?now|as\\s+soon\\s+as\\s+possible|asap|recently|previously|at\\s+(present|this\\s+time|th(e|is)\\s+minute|the\\s+(moment|present\\s+time)))\\b' NowParseRegex = f'\\b({NowRegex}|^(date)$)\\b' - SuffixRegex = f'^\\s*(in the\\s+)?(morning|afternoon|evening|night)\\b' - NonTimeContextTokens = f'(building)' - DateTimeTimeOfDayRegex = f'\\b(?morning|(?afternoon|night|evening))\\b' + SuffixRegex = '^\\s*(in the\\s+)?(morning|afternoon|evening|night)\\b' + NonTimeContextTokens = '(building)' + DateTimeTimeOfDayRegex = '\\b(?morning|(?afternoon|night|evening))\\b' DateTimeSpecificTimeOfDayRegex = f'\\b(({RelativeRegex}\\s+{DateTimeTimeOfDayRegex})\\b|\\btoni(ght|te))\\b' TimeOfTodayAfterRegex = f'^\\s*(,\\s*)?(in\\s+)?{DateTimeSpecificTimeOfDayRegex}' TimeOfTodayBeforeRegex = f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(at|around|circa|in|on))?\\s*$' SimpleTimeOfTodayAfterRegex = f'(?(?tonight))))\\b' PeriodSpecificTimeOfDayRegex = f'\\b({LaterEarlyRegex}?this\\s+{DateTimeTimeOfDayRegex}|({StrictRelativeRegex}\\s+{PeriodTimeOfDayRegex})\\b|\\b(?toni(ght|te)))\\b' PeriodTimeOfDayWithDateRegex = f'\\b(({PeriodTimeOfDayRegex}(\\s+(on|of))?))\\b' - TasksmodeMealTimeofDayRegex = f'\\b((in\\s+(the)?\\s+)?((?earl(y|ier)(\\s+|-))|(?late(r?\\s+|-)))?((this\\s+)?\\b(?lunch(\\s*time)?|dinner(\\s*time)?|brunch|breakfast)\\b))\\b' - LessThanRegex = f'\\b(less\\s+than)\\b' - MoreThanRegex = f'\\b(more\\s+than)\\b' + TasksmodeMealTimeofDayRegex = '\\b((in\\s+(the)?\\s+)?((?earl(y|ier)(\\s+|-))|(?late(r?\\s+|-)))?((this\\s+)?\\b(?lunch(\\s*time)?|dinner(\\s*time)?|brunch|breakfast)\\b))\\b' + LessThanRegex = '\\b(less\\s+than)\\b' + MoreThanRegex = '\\b(more\\s+than)\\b' DurationUnitRegex = f'(?{DateUnitRegex}|h(ou)?rs?|h|min(ute)?s?|sec(ond)?s?|nights?)\\b' - SuffixAndRegex = f'(?\\s*(and)\\s+(an?\\s+)?(?half|quarter))' - PeriodicRegex = f'\\b(?((?semi|bi|tri)(\\s*|-))?(daily|monthly|weekly|quarterly|yearly|annual(ly)?))\\b' - EachUnitRegex = f'\\b(?(every|(each|any|once an|one a|once a)\\s?)(?\\s+(other|alternate|second))?\\s*({DurationUnitRegex}|(?quarters?|weekends?)|{WeekDayRegex})|(?weekends))' - EachPrefixRegex = f'\\b(?(each|every|once an?)\\s*$)' - SetEachRegex = f'\\b(?(each|every)(?\\s+(other|alternate))?\\s*)(?!the|that)\\b' - SetLastRegex = f'(?following|next|upcoming|this|{LastNegPrefix}last|past|previous|current)' - EachDayRegex = f'^\\s*(each|every)\\s*day\\b' - DurationFollowedUnit = f'(^\\s*{DurationUnitRegex}\\s+{SuffixAndRegex})|(^\\s*{SuffixAndRegex}?(\\s+|-)?{DurationUnitRegex})' + SuffixAndRegex = '(?\\s*(and)\\s+(an?\\s+)?(?half|quarter))' + DurationFollowedUnit = ( + f'(^\\s*{DurationUnitRegex}\\s+{SuffixAndRegex})|(^\\s*{SuffixAndRegex}?(\\s+|-)?{DurationUnitRegex})' + ) NumberCombinedWithDurationUnit = f'\\b(?\\d+(\\.\\d*)?)(-)?{DurationUnitRegex}' AnUnitRegex = f'(\\b((?(half)\\s+)?an?|another)|(?(1/2|½|half)))\\s+{DurationUnitRegex}' - DuringRegex = f'\\b(for|during)\\s+the\\s+(?year|month|week|day|fortnight)\\b' - AllRegex = f'\\b(?(all|full|whole)(\\s+|-)(?year|month|week|day|fortnight))\\b' - HalfRegex = f'((an?\\s*)|\\b)(?half\\s+(?year|month|week|fortnight|day|hour))\\b' - ConjunctionRegex = f'\\b((and(\\s+for)?)|with)\\b' - HolidayList1 = f'(?mardi gras|(washington|mao)\'s birthday|juneteenth|(jubilee|freedom)(\\s+day)|chinese new year|(new\\s+(years\'|year\\s*\'s|years?)\\s+eve)|(new\\s+(years\'|year\\s*\'s|years?)(\\s+day)?)|may\\s*day|yuan dan|christmas eve|(christmas|xmas)(\\s+day)?|black friday|yuandan|easter(\\s+(sunday|saturday|monday))?|clean monday|ash wednesday|palm sunday|maundy thursday|good friday|white\\s+(sunday|monday)|trinity sunday|pentecost|corpus christi|cyber monday)' - HolidayList2 = f'(?(thanks\\s*giving|all saint\'s|white lover|s(?:ain)?t?(\\.)?\\s+(?:patrick|george)(?:\')?(?:s)?|us independence|all hallow|all souls|guy fawkes|cinco de mayo|halloween|qingming|dragon boat|april fools|tomb\\s*sweeping)(\\s+day)?)' - HolidayList3 = f'(?(?:independence|presidents(?:\')?|mlk|martin luther king( jr)?|canberra|ascension|columbus|tree( planting)?|arbor|labou?r|((international|int\'?l)\\s+)?workers\'?|mother\'?s?|father\'?s?|female|women(\'s)?|single|teacher\'?s|youth|children|girls|lovers?|earth|inauguration|groundhog|valentine\'?s|baptiste|bastille|veterans(?:\')?|memorial|mid[ \\-]autumn|moon|spring|lantern)\\s+day)' - HolidayList4 = f'(?ramad(h)?an|ram(a)?zan|ramathan|eid al(-|\\s+)adha|eid al(-|\\s+)azha|eidul(-|\\s+)azha|feast of the sacrifice|(islamic|arabic|hijri) new year|eid al(-|\\s+)fitr|festival of breaking the fast)' + DuringRegex = '\\b(for|during)\\s+the\\s+(?year|month|week|day|fortnight)\\b' + AllRegex = '\\b(?(all|full|whole)(\\s+|-)(?year|month|week|day|fortnight))\\b' + HalfRegex = '((an?\\s*)|\\b)(?half\\s+(?year|month|week|fortnight|day|hour))\\b' + ConjunctionRegex = '\\b((and(\\s+for)?)|with)\\b' + HolidayList1 = '(?mardi gras|(washington|mao)\'s birthday|juneteenth|(jubilee|freedom)(\\s+day)|chinese new year|(new\\s+(years\'|year\\s*\'s|years?)\\s+eve)|(new\\s+(years\'|year\\s*\'s|years?)(\\s+day)?)|may\\s*day|yuan dan|christmas eve|(christmas|xmas)(\\s+day)?|black friday|yuandan|easter(\\s+(sunday|saturday|monday))?|clean monday|ash wednesday|palm sunday|maundy thursday|good friday|white\\s+(sunday|monday)|trinity sunday|pentecost|corpus christi|cyber monday)' + HolidayList2 = '(?(thanks\\s*giving|all saint\'s|white lover|s(?:ain)?t?(\\.)?\\s+(?:patrick|george)(?:\')?(?:s)?|us independence|all hallow|all souls|guy fawkes|cinco de mayo|halloween|qingming|dragon boat|april fools|tomb\\s*sweeping)(\\s+day)?)' + HolidayList3 = '(?(?:independence|presidents(?:\')?|mlk|martin luther king( jr)?|canberra|ascension|columbus|tree( planting)?|arbor|labou?r|((international|int\'?l)\\s+)?workers\'?|mother\'?s?|father\'?s?|female|women(\'s)?|single|teacher\'?s|youth|children|girls|lovers?|earth|inauguration|groundhog|valentine\'?s|baptiste|bastille|veterans(?:\')?|memorial|mid[ \\-]autumn|moon|spring|lantern)\\s+day)' + HolidayList4 = '(?ramad(h)?an|ram(a)?zan|ramathan|eid al(-|\\s+)adha|eid al(-|\\s+)azha|eidul(-|\\s+)azha|feast of the sacrifice|(islamic|arabic|hijri) new year|eid al(-|\\s+)fitr|festival of breaking the fast)' HolidayRegex = f'\\b(({StrictRelativeRegex}\\s+({HolidayList1}|{HolidayList2}|{HolidayList3}|{HolidayList4}))|(?((the\\s+)?weekend\\s+of\\s+)({HolidayList1}|{HolidayList2}|{HolidayList3}|{HolidayList4})(\\s+((of\\s+)?({YearRegex}|{RelativeRegex}\\s+year)))?)|(({HolidayList1}|{HolidayList2}|{HolidayList3}|{HolidayList4})((?(\\s+weekend)(\\s+((of\\s+)?({YearRegex}|{RelativeRegex}\\s+year)))?)|(\\s+(of\\s+)?({YearRegex}|{RelativeRegex}\\s+year)(?\\s+weekend)?))?))\\b' - TasksModeHolidayListSupression = f'(?(?:independence|teacher\'?s|youth|children|girls)\\s+day)|(?ramad(h)?an|ram(a)?zan|ramathan|eid al(-|\\s+)adha|eid al(-|\\s+)azha|eidul(-|\\s+)azha|feast of the sacrifice|(islamic|arabic|hijri) new year|eid al(-|\\s+)fitr|festival of breaking the fast)\\b' - AMTimeRegex = f'(?morning)' - PMTimeRegex = f'\\b(?afternoon|evening|night)\\b' - NightTimeRegex = f'(night)' - NowTimeRegex = f'(now|at\\s+(present|this\\s+time|th(e|is)\\s+minute|the\\s+(moment|(current|present)\\s+time)))' - RecentlyTimeRegex = f'(recently|previously)' - AsapTimeRegex = f'(as soon as possible|asap)' - InclusiveModPrepositions = f'(?((on|in|at)\\s+or\\s+)|(\\s+or\\s+(on|in|at)))' - AroundRegex = f'(?:\\b(?:around|circa)\\s*?\\b)(\\s+the)?' + TasksModeHolidayListSupression = '(?(?:independence|teacher\'?s|youth|children|girls)\\s+day)|(?ramad(h)?an|ram(a)?zan|ramathan|eid al(-|\\s+)adha|eid al(-|\\s+)azha|eidul(-|\\s+)azha|feast of the sacrifice|(islamic|arabic|hijri) new year|eid al(-|\\s+)fitr|festival of breaking the fast)\\b' + AMTimeRegex = '(?morning)' + PMTimeRegex = '\\b(?afternoon|evening|night)\\b' + NightTimeRegex = '(night)' + NowTimeRegex = '(now|at\\s+(present|this\\s+time|th(e|is)\\s+minute|the\\s+(moment|(current|present)\\s+time)))' + RecentlyTimeRegex = '(recently|previously)' + AsapTimeRegex = '(as soon as possible|asap)' + InclusiveModPrepositions = '(?((on|in|at)\\s+or\\s+)|(\\s+or\\s+(on|in|at)))' + AroundRegex = '(?:\\b(?:around|circa)\\s*?\\b)(\\s+the)?' BeforeRegex = f'((\\b{InclusiveModPrepositions}?(?:before|in\\s+advance\\s+of|prior\\s+to|(no\\s+later|earlier|sooner)\\s+than|ending\\s+(with|on)|by|(un)?till?|(?as\\s+late\\s+as)){InclusiveModPrepositions}?\\b\\s*?)|(?)((?<\\s*=)|<))(\\s+the)?' AfterRegex = f'((\\b{InclusiveModPrepositions}?((after(\\s+on)?(?!\\sfrom)|(?>\\s*=)|>))(\\s+the)?' - SinceRegex = f'(?:(?:\\b(?:since|after\\s+or\\s+equal\\s+to|(starting|beginning)(\\s)?(?:from|on|with)?|as\\s+early\\s+as|(any\\s+time\\s+)from)\\b\\s*?)|(?=))(\\s+the)?' + SinceRegex = '(?:(?:\\b(?:since|after\\s+or\\s+equal\\s+to|(starting|beginning)(\\s)?(?:from|on|with)?|as\\s+early\\s+as|(any\\s+time\\s+)from)\\b\\s*?)|(?=))(\\s+the)?' SinceRegexExp = f'({SinceRegex}|\\bfrom(\\s+the)?\\b)' - AgoRegex = f'\\b(ago|earlier|before\\s+(?yesterday|today))\\b' + AgoRegex = '\\b(ago|earlier|before\\s+(?yesterday|today))\\b' LaterRegex = f'\\b(?:later(?!((\\s+in)?\\s*{OneWordPeriodRegex})|(\\s+{TimeOfDayRegex})|\\s+than\\b)|from now|(from|after)\\s+(?tomorrow|tmrw?|today))\\b' - BeforeAfterRegex = f'\\b((?before)|(?from|after))\\b' + BeforeAfterRegex = '\\b((?before)|(?from|after))\\b' ModPrefixRegex = f'\\b({RelativeRegex}|{AroundRegex}|{BeforeRegex}|{AfterRegex}|{SinceRegex})\\b' ModSuffixRegex = f'\\b({AgoRegex}|{LaterRegex}|{BeforeAfterRegex}|{FutureSuffixRegex}|{PastSuffixRegex})\\b' - InConnectorRegex = f'\\b(in)\\b' + InConnectorRegex = '\\b(in)\\b' SinceYearSuffixRegex = f'(^\\s*{SinceRegex}(\\s*(the\\s+)?year\\s*)?{YearSuffix})' WithinNextPrefixRegex = f'\\b(within(\\s+the)?(\\s+(?{NextPrefixRegex}))?)\\b' - TodayNowRegex = f'\\b(today|now|current (date|time))\\b' + TodayNowRegex = '\\b(today|now|current (date|time))\\b' MorningStartEndRegex = f'(^(morning|{AmDescRegex}))|((morning|{AmDescRegex})$)' AfternoonStartEndRegex = f'(^(afternoon|{PmDescRegex}))|((afternoon|{PmDescRegex})$)' - EveningStartEndRegex = f'(^(evening))|((evening)$)' - NightStartEndRegex = f'(^(over|to)?ni(ght|te))|((over|to)?ni(ght|te)$)' - InexactNumberRegex = f'\\b((a\\s+)?few|some|several|(?(a\\s+)?couple(\\s+of)?))\\b' + EveningStartEndRegex = '(^(evening))|((evening)$)' + NightStartEndRegex = '(^(over|to)?ni(ght|te))|((over|to)?ni(ght|te)$)' + InexactNumberRegex = '\\b((a\\s+)?few|some|several|(?(a\\s+)?couple(\\s+of)?))\\b' InexactNumberUnitRegex = f'({InexactNumberRegex})\\s+({DurationUnitRegex})' RelativeTimeUnitRegex = f'(?:(?:(?:{NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+({TimeUnitRegex}))|((the|my))\\s+({RestrictedTimeUnitRegex}))' RelativeDurationUnitRegex = f'(?:(?:(?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+)({DurationUnitRegex}))|((the|my))\\s+({RestrictedTimeUnitRegex}))' ReferenceDatePeriodRegex = f'\\b{ReferencePrefixRegex}\\s+(?week(end)?|fortnight|month|year|decade)\\b' - ConnectorRegex = f'^(-|,|for|t|around|circa|@)$' - FromToRegex = f'(\\b(from).+(to|and|or)\\b.+)' - SingleAmbiguousMonthRegex = f'^(the\\s+)?(may|march)$' - SingleAmbiguousTermsRegex = f'^(the\\s+)?(day|week|month|year)$' - UnspecificDatePeriodRegex = f'^(week|fortnight|month|year)$' - PrepositionSuffixRegex = f'\\b(on|in|at|around|circa|from|to)$' - FlexibleDayRegex = f'(?([A-Za-z]+\\s)?[A-Za-z\\d]+)' + ConnectorRegex = '^(-|,|for|t|around|circa|@)$' + FromToRegex = '(\\b(from).+(to|and|or)\\b.+)' + SingleAmbiguousMonthRegex = '^(the\\s+)?(may|march)$' + SingleAmbiguousTermsRegex = '^(the\\s+)?(day|week|month|year)$' + UnspecificDatePeriodRegex = '^(week|fortnight|month|year)$' + PrepositionSuffixRegex = '\\b(on|in|at|around|circa|from|to)$' + FlexibleDayRegex = '(?([A-Za-z]+\\s)?[A-Za-z\\d]+)' ForTheRegex = f'\\b((((?<=\\bfor\\s+)the\\s+{FlexibleDayRegex})|((?<=\\bon\\s+)(the\\s+)?{FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.(?!\\d)|!|\\?|$)))' WeekDayAndDayOfMonthRegex = f'\\b{WeekDayRegex}\\s+(the\\s+{FlexibleDayRegex})\\b' - WeekDayAndDayRegex = f'\\b{WeekDayRegex}\\s+(?!(the)){DayRegex}(?!([-:]|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' - RestOfDateRegex = f'\\b(rest|remaining)\\s+(of\\s+)?((the|my|this|current)\\s+)?(?week|fortnight|month|year|decade)\\b' - RestOfDateTimeRegex = f'\\b(rest|remaining)\\s+(of\\s+)?((the|my|this|current)\\s+)?(?day)\\b' - AmbiguousRangeModifierPrefix = f'(from)' + WeekDayAndDayRegex = ( + f'\\b{WeekDayRegex}\\s+(?!(the)){DayRegex}(?!([-:]|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' + ) + RestOfDateRegex = ( + '\\b(rest|remaining)\\s+(of\\s+)?((the|my|this|current)\\s+)?(?week|fortnight|month|year|decade)\\b' + ) + RestOfDateTimeRegex = '\\b(rest|remaining)\\s+(of\\s+)?((the|my|this|current)\\s+)?(?day)\\b' + AmbiguousRangeModifierPrefix = '(from)' NumberEndingPattern = f'^(?:\\s+(?meeting|appointment|conference|((skype|teams|zoom|facetime)\\s+)?call)\\s+to\\s+(?{PeriodHourNumRegex}|{HourRegex})([\\.]?$|(\\.,|,|!|\\?)))' - OneOnOneRegex = f'\\b(1\\s*:\\s*1(?!\\d))|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b' + OneOnOneRegex = '\\b(1\\s*:\\s*1(?!\\d))|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b' LaterEarlyPeriodRegex = f'\\b(({PrefixPeriodRegex})\\s*\\b\\s*(?{OneWordPeriodRegex}|(?{BaseDateTime.FourDigitYearRegex}))|({UnspecificEndOfRangeRegex}))\\b' WeekWithWeekDayRangeRegex = f'\\b((?({NextPrefixRegex}|{PreviousPrefixRegex}|this)\\s+week)((\\s+between\\s+{WeekDayRegex}\\s+and\\s+{WeekDayRegex})|(\\s+from\\s+{WeekDayRegex}\\s+to\\s+{WeekDayRegex})))\\b' - GeneralEndingRegex = f'^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$' - MiddlePauseRegex = f'\\s*(,)\\s*' - DurationConnectorRegex = f'^\\s*(?\\s+|and|,)\\s*$' - PrefixArticleRegex = f'\\bthe\\s+' - OrRegex = f'\\s*((\\b|,\\s*)(or|and)\\b|,)\\s*' + GeneralEndingRegex = '^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$' + MiddlePauseRegex = '\\s*(,)\\s*' + DurationConnectorRegex = '^\\s*(?\\s+|and|,)\\s*$' + PrefixArticleRegex = '\\bthe\\s+' + OrRegex = '\\s*((\\b|,\\s*)(or|and)\\b|,)\\s*' SpecialYearTermsRegex = f'\\b((({SpecialYearPrefixes}\\s+)?year)|(cy|(?fy|sy)))' YearPlusNumberRegex = f'\\b({SpecialYearTermsRegex}\\s*((?(\\d{{2,4}}))|{FullTextYearRegex}))\\b' NumberAsTimeRegex = f'\\b({WrittenTimeRegex}|{PeriodHourNumRegex}|{BaseDateTime.HourRegex})\\b' TimeBeforeAfterRegex = f'\\b(((?<=\\b(before|no later than|by|after)\\s+)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}|{MidTimeRegex}))|{MidTimeRegex})\\b' - DateNumberConnectorRegex = f'^\\s*(?\\s+at)\\s*$' - DecadeRegex = f'(?(?:nough|twen|thir|fou?r|fif|six|seven|eigh|nine)ties|two\\s+thousands)' + DateNumberConnectorRegex = '^\\s*(?\\s+at)\\s*$' + DecadeRegex = '(?(?:nough|twen|thir|fou?r|fif|six|seven|eigh|nine)ties|two\\s+thousands)' DecadeWithCenturyRegex = f'(the\\s+)?(((?\\d|1\\d|2\\d)?(\')?(?\\d0)(\')?(\\s)?s\\b)|(({CenturyRegex}(\\s+|-)(and\\s+)?)?{DecadeRegex})|({CenturyRegex}(\\s+|-)(and\\s+)?(?tens|hundreds)))' RelativeDecadeRegex = f'\\b((the\\s+)?{RelativeRegex}\\s+((?[\\w,]+)\\s+)?decades?)\\b' YearPeriodRegex = f'((((from|during|in)\\s+)?{YearRegex}\\s*({TillRegex})\\s*{YearRegex})|(((between)\\s+){YearRegex}\\s*({RangeConnectorRegex})\\s*{YearRegex}))' StrictTillRegex = f'(?\\b(to|(un)?till?|thru|through)\\b|{BaseDateTime.RangeConnectorSymbolRegex}(?!\\s*(h[1-2]|q[1-4])(?!(\\s+of|\\s*,\\s*))))' StrictRangeConnectorRegex = f'(?\\b(and|through|to)\\b|{BaseDateTime.RangeConnectorSymbolRegex}(?!\\s*(h[1-2]|q[1-4])(?!(\\s+of|\\s*,\\s*))))' - StartMiddleEndRegex = f'\\b((?((the\\s+)?(start|beginning)\\s+of\\s+)?)(?((the\\s+)?middle\\s+of\\s+)?)(?((the\\s+)?end\\s+of\\s+)?))' + StartMiddleEndRegex = '\\b((?((the\\s+)?(start|beginning)\\s+of\\s+)?)(?((the\\s+)?middle\\s+of\\s+)?)(?((the\\s+)?end\\s+of\\s+)?))' ComplexDatePeriodRegex = f'(?:((from|during|in)\\s+)?{StartMiddleEndRegex}(?.+)\\s*({StrictTillRegex})\\s*{StartMiddleEndRegex}(?.+)|((between)\\s+){StartMiddleEndRegex}(?.+)\\s*({StrictRangeConnectorRegex})\\s*{StartMiddleEndRegex}(?.+))' - FailFastRegex = f'{BaseDateTime.DeltaMinuteRegex}|\\b(?:{BaseDateTime.BaseAmDescRegex}|{BaseDateTime.BasePmDescRegex})|{BaseDateTime.BaseAmPmDescRegex}|\\b(?:zero|{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}|{WrittenMonthRegex}|{SeasonDescRegex}|{DecadeRegex}|centur(y|ies)|weekends?|quarters?|hal(f|ves)|yesterday|to(morrow|day|night)|tmr|noonish|\\d(-|——)?ish|((the\\s+\\w*)|\\d)(th|rd|nd|st)|(mid\\s*(-\\s*)?)?(night|morning|afternoon|day)s?|evenings?|noon|lunch(time)?|dinner(time)?|(day|night)time|overnight|dawn|dusk|sunset|hours?|hrs?|h|minutes?|mins?|seconds?|secs?|eo[dmy]|mardi[ -]?gras|birthday|eve|christmas|xmas|thanksgiving|halloween|yuandan|easter|yuan dan|april fools|cinco de mayo|all (hallow|souls)|guy fawkes|(st )?patrick|hundreds?|noughties|aughts|thousands?)\\b|{WeekDayRegex}|{SetWeekDayRegex}|{NowRegex}|{PeriodicRegex}|\\b({DateUnitRegex}|{ImplicitDayRegex})' + FailFastRegex = f'{BaseDateTime.DeltaMinuteRegex}|\\b(?:{BaseDateTime.BaseAmDescRegex}|{BaseDateTime.BasePmDescRegex})|{BaseDateTime.BaseAmPmDescRegex}|\\b(?:zero|{WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}|{WrittenMonthRegex}|{SeasonDescRegex}|{DecadeRegex}|centur(y|ies)|weekends?|quarters?|hal(f|ves)|yesterday|to(morrow|day|night)|tmr|noonish|\\d(-|——)?ish|((the\\s+\\w*)|\\d)(th|rd|nd|st)|(mid\\s*(-\\s*)?)?(night|morning|afternoon|day)s?|evenings?|noon|lunch(time)?|dinner(time)?|(day|night)time|overnight|dawn|dusk|sunset|hours?|hrs?|h|minutes?|mins?|seconds?|secs?|eo[dmy]|mardi[ -]?gras|birthday|eve|christmas|xmas|thanksgiving|halloween|yuandan|easter|yuan dan|april fools|cinco de mayo|all (hallow|souls)|guy fawkes|(st )?patrick|hundreds?|noughties|aughts|thousands?)\\b|{WeekDayRegex}|{NowRegex}|\\b({DateUnitRegex}|{ImplicitDayRegex})' TasksModeSupressionRegexes = f'({AmPmDescRegex}|{TasksModeSpecialDescRegex}|{TasksModeHolidayListSupression}|{DecadeRegex}|{DecadeWithCenturyRegex}|{QuarterRegex}|{QuarterRegexYearFront}|{AllHalfYearRegex}|{SeasonRegex})' - TasksModeNextPrefix = f'(?next\\s+)' + TasksModeNextPrefix = '(?next\\s+)' TasksModeDurationToDatePatterns = f'\\b({TasksModeNextPrefix}((?week)|(?month)|(?year)))\\b' - UnitMap = dict([("decades", "10Y"), - ("decade", "10Y"), - ("years", "Y"), - ("year", "Y"), - ("y", "Y"), - ("months", "MON"), - ("month", "MON"), - ("m", "M"), - ("quarters", "3MON"), - ("quarter", "3MON"), - ("semesters", "6MON"), - ("semestres", "6MON"), - ("semester", "6MON"), - ("semestre", "6MON"), - ("weeks", "W"), - ("week", "W"), - ("w", "W"), - ("weekends", "WE"), - ("weekend", "WE"), - ("fortnights", "2W"), - ("fortnight", "2W"), - ("weekdays", "D"), - ("weekday", "D"), - ("days", "D"), - ("day", "D"), - ("d", "D"), - ("nights", "D"), - ("night", "D"), - ("hours", "H"), - ("hour", "H"), - ("hrs", "H"), - ("hr", "H"), - ("h", "H"), - ("minutes", "M"), - ("minute", "M"), - ("mins", "M"), - ("min", "M"), - ("seconds", "S"), - ("second", "S"), - ("secs", "S"), - ("sec", "S")]) - UnitValueMap = dict([("decades", 315360000), - ("decade", 315360000), - ("years", 31536000), - ("year", 31536000), - ("y", 31536000), - ("months", 2592000), - ("month", 2592000), - ("m", 2592000), - ("fortnights", 1209600), - ("fortnight", 1209600), - ("weekends", 172800), - ("weekend", 172800), - ("weeks", 604800), - ("week", 604800), - ("w", 604800), - ("days", 86400), - ("day", 86400), - ("d", 86400), - ("nights", 86400), - ("night", 86400), - ("hours", 3600), - ("hour", 3600), - ("hrs", 3600), - ("hr", 3600), - ("h", 3600), - ("minutes", 60), - ("minute", 60), - ("mins", 60), - ("min", 60), - ("seconds", 1), - ("second", 1), - ("secs", 1), - ("sec", 1)]) - SpecialYearPrefixesMap = dict([("fiscal", "FY"), - ("school", "SY"), - ("fy", "FY"), - ("sy", "SY")]) - SeasonMap = dict([("spring", "SP"), - ("summer", "SU"), - ("fall", "FA"), - ("autumn", "FA"), - ("winter", "WI")]) - SeasonValueMap = dict([("SP", 3), - ("SU", 6), - ("FA", 9), - ("WI", 12)]) - CardinalMap = dict([("first", 1), - ("1st", 1), - ("second", 2), - ("2nd", 2), - ("third", 3), - ("3rd", 3), - ("fourth", 4), - ("4th", 4), - ("fifth", 5), - ("5th", 5), - ("sixth", 6), - ("6th", 6), - ("seventh", 7), - ("7th", 7), - ("eighth", 8), - ("8th", 8), - ("ninth", 9), - ("9th", 9), - ("tenth", 10), - ("10th", 10), - ("eleventh", 11), - ("11th", 11), - ("twelfth", 12), - ("12th", 12)]) - DayOfWeek = dict([("monday", 1), - ("tuesday", 2), - ("wednesday", 3), - ("thursday", 4), - ("friday", 5), - ("saturday", 6), - ("sunday", 0), - ("mon", 1), - ("tue", 2), - ("tues", 2), - ("wed", 3), - ("wedn", 3), - ("weds", 3), - ("thu", 4), - ("thur", 4), - ("thurs", 4), - ("fri", 5), - ("sat", 6), - ("sun", 0)]) - MonthOfYear = dict([("january", 1), - ("february", 2), - ("march", 3), - ("april", 4), - ("may", 5), - ("june", 6), - ("july", 7), - ("august", 8), - ("september", 9), - ("october", 10), - ("november", 11), - ("december", 12), - ("jan", 1), - ("feb", 2), - ("mar", 3), - ("apr", 4), - ("jun", 6), - ("jul", 7), - ("aug", 8), - ("sep", 9), - ("sept", 9), - ("oct", 10), - ("nov", 11), - ("dec", 12), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9)]) - Numbers = dict([("zero", 0), - ("one", 1), - ("a", 1), - ("an", 1), - ("two", 2), - ("three", 3), - ("four", 4), - ("five", 5), - ("six", 6), - ("seven", 7), - ("eight", 8), - ("nine", 9), - ("ten", 10), - ("eleven", 11), - ("twelve", 12), - ("thirteen", 13), - ("fourteen", 14), - ("fifteen", 15), - ("sixteen", 16), - ("seventeen", 17), - ("eighteen", 18), - ("nineteen", 19), - ("twenty", 20), - ("twenty one", 21), - ("twenty two", 22), - ("twenty three", 23), - ("twenty four", 24), - ("twenty five", 25), - ("twenty six", 26), - ("twenty seven", 27), - ("twenty eight", 28), - ("twenty nine", 29), - ("thirty", 30), - ("thirty one", 31), - ("thirty two", 32), - ("thirty three", 33), - ("thirty four", 34), - ("thirty five", 35), - ("thirty six", 36), - ("thirty seven", 37), - ("thirty eight", 38), - ("thirty nine", 39), - ("forty", 40), - ("forty one", 41), - ("forty two", 42), - ("forty three", 43), - ("forty four", 44), - ("forty five", 45), - ("forty six", 46), - ("forty seven", 47), - ("forty eight", 48), - ("forty nine", 49), - ("fifty", 50), - ("fifty one", 51), - ("fifty two", 52), - ("fifty three", 53), - ("fifty four", 54), - ("fifty five", 55), - ("fifty six", 56), - ("fifty seven", 57), - ("fifty eight", 58), - ("fifty nine", 59), - ("sixty", 60), - ("sixty one", 61), - ("sixty two", 62), - ("sixty three", 63), - ("sixty four", 64), - ("sixty five", 65), - ("sixty six", 66), - ("sixty seven", 67), - ("sixty eight", 68), - ("sixty nine", 69), - ("seventy", 70), - ("seventy one", 71), - ("seventy two", 72), - ("seventy three", 73), - ("seventy four", 74), - ("seventy five", 75), - ("seventy six", 76), - ("seventy seven", 77), - ("seventy eight", 78), - ("seventy nine", 79), - ("eighty", 80), - ("eighty one", 81), - ("eighty two", 82), - ("eighty three", 83), - ("eighty four", 84), - ("eighty five", 85), - ("eighty six", 86), - ("eighty seven", 87), - ("eighty eight", 88), - ("eighty nine", 89), - ("ninety", 90), - ("ninety one", 91), - ("ninety two", 92), - ("ninety three", 93), - ("ninety four", 94), - ("ninety five", 95), - ("ninety six", 96), - ("ninety seven", 97), - ("ninety eight", 98), - ("ninety nine", 99), - ("one hundred", 100)]) - DayOfMonth = dict([("1st", 1), - ("1th", 1), - ("2nd", 2), - ("2th", 2), - ("3rd", 3), - ("3th", 3), - ("4th", 4), - ("5th", 5), - ("6th", 6), - ("7th", 7), - ("8th", 8), - ("9th", 9), - ("10th", 10), - ("11th", 11), - ("11st", 11), - ("12th", 12), - ("12nd", 12), - ("13th", 13), - ("13rd", 13), - ("14th", 14), - ("15th", 15), - ("16th", 16), - ("17th", 17), - ("18th", 18), - ("19th", 19), - ("20th", 20), - ("21st", 21), - ("21th", 21), - ("22nd", 22), - ("22th", 22), - ("23rd", 23), - ("23th", 23), - ("24th", 24), - ("25th", 25), - ("26th", 26), - ("27th", 27), - ("28th", 28), - ("29th", 29), - ("30th", 30), - ("31st", 31), - ("01st", 1), - ("01th", 1), - ("02nd", 2), - ("02th", 2), - ("03rd", 3), - ("03th", 3), - ("04th", 4), - ("05th", 5), - ("06th", 6), - ("07th", 7), - ("08th", 8), - ("09th", 9)]) - DoubleNumbers = dict([("half", 0.5), - ("quarter", 0.25)]) - HolidayNames = dict([("easterday", ["easterday", "easter", "eastersunday"]), - ("ashwednesday", ["ashwednesday"]), - ("palmsunday", ["palmsunday"]), - ("maundythursday", ["maundythursday"]), - ("goodfriday", ["goodfriday"]), - ("eastersaturday", ["eastersaturday"]), - ("eastermonday", ["eastermonday"]), - ("ascensionday", ["ascensionday"]), - ("whitesunday", ["whitesunday", "pentecost", "pentecostday"]), - ("whitemonday", ["whitemonday"]), - ("trinitysunday", ["trinitysunday"]), - ("corpuschristi", ["corpuschristi"]), - ("earthday", ["earthday"]), - ("fathers", ["fatherday", "fathersday"]), - ("mothers", ["motherday", "mothersday"]), - ("thanksgiving", ["thanksgivingday", "thanksgiving"]), - ("blackfriday", ["blackfriday"]), - ("cybermonday", ["cybermonday"]), - ("martinlutherking", ["mlkday", "martinlutherkingday", "martinlutherkingjrday"]), - ("washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday", "presidentsday"]), - ("canberra", ["canberraday"]), - ("labour", ["labourday", "laborday"]), - ("columbus", ["columbusday"]), - ("memorial", ["memorialday"]), - ("yuandan", ["yuandan"]), - ("maosbirthday", ["maosbirthday"]), - ("teachersday", ["teachersday", "teacherday"]), - ("singleday", ["singleday"]), - ("allsaintsday", ["allsaintsday"]), - ("youthday", ["youthday"]), - ("childrenday", ["childrenday", "childday"]), - ("femaleday", ["femaleday"]), - ("treeplantingday", ["treeplantingday"]), - ("arborday", ["arborday"]), - ("girlsday", ["girlsday"]), - ("whiteloverday", ["whiteloverday"]), - ("loverday", ["loverday", "loversday"]), - ("christmas", ["christmasday", "christmas"]), - ("xmas", ["xmasday", "xmas"]), - ("newyear", ["newyear"]), - ("newyearday", ["newyearday"]), - ("newyearsday", ["newyearsday"]), - ("inaugurationday", ["inaugurationday"]), - ("groundhougday", ["groundhougday"]), - ("valentinesday", ["valentinesday"]), - ("stpatrickday", ["stpatrickday", "stpatricksday", "stpatrick"]), - ("aprilfools", ["aprilfools"]), - ("stgeorgeday", ["stgeorgeday"]), - ("mayday", ["mayday", "intlworkersday", "internationalworkersday", "workersday"]), - ("cincodemayoday", ["cincodemayoday"]), - ("baptisteday", ["baptisteday"]), - ("usindependenceday", ["usindependenceday"]), - ("independenceday", ["independenceday"]), - ("bastilleday", ["bastilleday"]), - ("halloweenday", ["halloweenday", "halloween"]), - ("allhallowday", ["allhallowday"]), - ("allsoulsday", ["allsoulsday"]), - ("guyfawkesday", ["guyfawkesday"]), - ("veteransday", ["veteransday"]), - ("christmaseve", ["christmaseve"]), - ("newyeareve", ["newyearseve", "newyeareve"]), - ("juneteenth", ["juneteenth", "freedomday", "jubileeday"]), - ("ramadan", ["ramadan", "ramazan", "ramzan", "ramadhan", "ramathan"]), - ("sacrifice", ["eidaladha", "eidalazha", "eidulazha", "feastofthesacrifice"]), - ("islamicnewyear", ["islamicnewyear", "hijrinewyear", "arabicnewyear"]), - ("eidalfitr", ["eidalfitr", "festivalofbreakingthefast"])]) - WrittenDecades = dict([("hundreds", 0), - ("tens", 10), - ("twenties", 20), - ("thirties", 30), - ("forties", 40), - ("fifties", 50), - ("sixties", 60), - ("seventies", 70), - ("eighties", 80), - ("nineties", 90)]) - SpecialDecadeCases = dict([("noughties", 2000), - ("aughts", 2000), - ("two thousands", 2000)]) + UnitMap = dict( + [ + ("decades", "10Y"), + ("decade", "10Y"), + ("years", "Y"), + ("year", "Y"), + ("y", "Y"), + ("months", "MON"), + ("month", "MON"), + ("m", "M"), + ("quarters", "3MON"), + ("quarter", "3MON"), + ("semesters", "6MON"), + ("semestres", "6MON"), + ("semester", "6MON"), + ("semestre", "6MON"), + ("weeks", "W"), + ("week", "W"), + ("w", "W"), + ("weekends", "WE"), + ("weekend", "WE"), + ("fortnights", "2W"), + ("fortnight", "2W"), + ("weekdays", "D"), + ("weekday", "D"), + ("days", "D"), + ("day", "D"), + ("d", "D"), + ("nights", "D"), + ("night", "D"), + ("hours", "H"), + ("hour", "H"), + ("hrs", "H"), + ("hr", "H"), + ("h", "H"), + ("minutes", "M"), + ("minute", "M"), + ("mins", "M"), + ("min", "M"), + ("seconds", "S"), + ("second", "S"), + ("secs", "S"), + ("sec", "S"), + ] + ) + UnitValueMap = dict( + [ + ("decades", 315360000), + ("decade", 315360000), + ("years", 31536000), + ("year", 31536000), + ("y", 31536000), + ("months", 2592000), + ("month", 2592000), + ("m", 2592000), + ("fortnights", 1209600), + ("fortnight", 1209600), + ("weekends", 172800), + ("weekend", 172800), + ("weeks", 604800), + ("week", 604800), + ("w", 604800), + ("days", 86400), + ("day", 86400), + ("d", 86400), + ("nights", 86400), + ("night", 86400), + ("hours", 3600), + ("hour", 3600), + ("hrs", 3600), + ("hr", 3600), + ("h", 3600), + ("minutes", 60), + ("minute", 60), + ("mins", 60), + ("min", 60), + ("seconds", 1), + ("second", 1), + ("secs", 1), + ("sec", 1), + ] + ) + SpecialYearPrefixesMap = dict([("fiscal", "FY"), ("school", "SY"), ("fy", "FY"), ("sy", "SY")]) + SeasonMap = dict([("spring", "SP"), ("summer", "SU"), ("fall", "FA"), ("autumn", "FA"), ("winter", "WI")]) + SeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + CardinalMap = dict( + [ + ("first", 1), + ("1st", 1), + ("second", 2), + ("2nd", 2), + ("third", 3), + ("3rd", 3), + ("fourth", 4), + ("4th", 4), + ("fifth", 5), + ("5th", 5), + ("sixth", 6), + ("6th", 6), + ("seventh", 7), + ("7th", 7), + ("eighth", 8), + ("8th", 8), + ("ninth", 9), + ("9th", 9), + ("tenth", 10), + ("10th", 10), + ("eleventh", 11), + ("11th", 11), + ("twelfth", 12), + ("12th", 12), + ] + ) + DayOfWeek = dict( + [ + ("monday", 1), + ("tuesday", 2), + ("wednesday", 3), + ("thursday", 4), + ("friday", 5), + ("saturday", 6), + ("sunday", 0), + ("mon", 1), + ("tue", 2), + ("tues", 2), + ("wed", 3), + ("wedn", 3), + ("weds", 3), + ("thu", 4), + ("thur", 4), + ("thurs", 4), + ("fri", 5), + ("sat", 6), + ("sun", 0), + ] + ) + MonthOfYear = dict( + [ + ("january", 1), + ("february", 2), + ("march", 3), + ("april", 4), + ("may", 5), + ("june", 6), + ("july", 7), + ("august", 8), + ("september", 9), + ("october", 10), + ("november", 11), + ("december", 12), + ("jan", 1), + ("feb", 2), + ("mar", 3), + ("apr", 4), + ("jun", 6), + ("jul", 7), + ("aug", 8), + ("sep", 9), + ("sept", 9), + ("oct", 10), + ("nov", 11), + ("dec", 12), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ] + ) + Numbers = dict( + [ + ("zero", 0), + ("one", 1), + ("a", 1), + ("an", 1), + ("two", 2), + ("three", 3), + ("four", 4), + ("five", 5), + ("six", 6), + ("seven", 7), + ("eight", 8), + ("nine", 9), + ("ten", 10), + ("eleven", 11), + ("twelve", 12), + ("thirteen", 13), + ("fourteen", 14), + ("fifteen", 15), + ("sixteen", 16), + ("seventeen", 17), + ("eighteen", 18), + ("nineteen", 19), + ("twenty", 20), + ("twenty one", 21), + ("twenty two", 22), + ("twenty three", 23), + ("twenty four", 24), + ("twenty five", 25), + ("twenty six", 26), + ("twenty seven", 27), + ("twenty eight", 28), + ("twenty nine", 29), + ("thirty", 30), + ("thirty one", 31), + ("thirty two", 32), + ("thirty three", 33), + ("thirty four", 34), + ("thirty five", 35), + ("thirty six", 36), + ("thirty seven", 37), + ("thirty eight", 38), + ("thirty nine", 39), + ("forty", 40), + ("forty one", 41), + ("forty two", 42), + ("forty three", 43), + ("forty four", 44), + ("forty five", 45), + ("forty six", 46), + ("forty seven", 47), + ("forty eight", 48), + ("forty nine", 49), + ("fifty", 50), + ("fifty one", 51), + ("fifty two", 52), + ("fifty three", 53), + ("fifty four", 54), + ("fifty five", 55), + ("fifty six", 56), + ("fifty seven", 57), + ("fifty eight", 58), + ("fifty nine", 59), + ("sixty", 60), + ("sixty one", 61), + ("sixty two", 62), + ("sixty three", 63), + ("sixty four", 64), + ("sixty five", 65), + ("sixty six", 66), + ("sixty seven", 67), + ("sixty eight", 68), + ("sixty nine", 69), + ("seventy", 70), + ("seventy one", 71), + ("seventy two", 72), + ("seventy three", 73), + ("seventy four", 74), + ("seventy five", 75), + ("seventy six", 76), + ("seventy seven", 77), + ("seventy eight", 78), + ("seventy nine", 79), + ("eighty", 80), + ("eighty one", 81), + ("eighty two", 82), + ("eighty three", 83), + ("eighty four", 84), + ("eighty five", 85), + ("eighty six", 86), + ("eighty seven", 87), + ("eighty eight", 88), + ("eighty nine", 89), + ("ninety", 90), + ("ninety one", 91), + ("ninety two", 92), + ("ninety three", 93), + ("ninety four", 94), + ("ninety five", 95), + ("ninety six", 96), + ("ninety seven", 97), + ("ninety eight", 98), + ("ninety nine", 99), + ("one hundred", 100), + ] + ) + DayOfMonth = dict( + [ + ("1st", 1), + ("1th", 1), + ("2nd", 2), + ("2th", 2), + ("3rd", 3), + ("3th", 3), + ("4th", 4), + ("5th", 5), + ("6th", 6), + ("7th", 7), + ("8th", 8), + ("9th", 9), + ("10th", 10), + ("11th", 11), + ("11st", 11), + ("12th", 12), + ("12nd", 12), + ("13th", 13), + ("13rd", 13), + ("14th", 14), + ("15th", 15), + ("16th", 16), + ("17th", 17), + ("18th", 18), + ("19th", 19), + ("20th", 20), + ("21st", 21), + ("21th", 21), + ("22nd", 22), + ("22th", 22), + ("23rd", 23), + ("23th", 23), + ("24th", 24), + ("25th", 25), + ("26th", 26), + ("27th", 27), + ("28th", 28), + ("29th", 29), + ("30th", 30), + ("31st", 31), + ("01st", 1), + ("01th", 1), + ("02nd", 2), + ("02th", 2), + ("03rd", 3), + ("03th", 3), + ("04th", 4), + ("05th", 5), + ("06th", 6), + ("07th", 7), + ("08th", 8), + ("09th", 9), + ] + ) + DoubleNumbers = dict([("half", 0.5), ("quarter", 0.25)]) + HolidayNames = dict( + [ + ("easterday", ["easterday", "easter", "eastersunday"]), + ("ashwednesday", ["ashwednesday"]), + ("palmsunday", ["palmsunday"]), + ("maundythursday", ["maundythursday"]), + ("goodfriday", ["goodfriday"]), + ("eastersaturday", ["eastersaturday"]), + ("eastermonday", ["eastermonday"]), + ("ascensionday", ["ascensionday"]), + ("whitesunday", ["whitesunday", "pentecost", "pentecostday"]), + ("whitemonday", ["whitemonday"]), + ("trinitysunday", ["trinitysunday"]), + ("corpuschristi", ["corpuschristi"]), + ("earthday", ["earthday"]), + ("fathers", ["fatherday", "fathersday"]), + ("mothers", ["motherday", "mothersday"]), + ("thanksgiving", ["thanksgivingday", "thanksgiving"]), + ("blackfriday", ["blackfriday"]), + ("cybermonday", ["cybermonday"]), + ("martinlutherking", ["mlkday", "martinlutherkingday", "martinlutherkingjrday"]), + ("washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday", "presidentsday"]), + ("canberra", ["canberraday"]), + ("labour", ["labourday", "laborday"]), + ("columbus", ["columbusday"]), + ("memorial", ["memorialday"]), + ("yuandan", ["yuandan"]), + ("maosbirthday", ["maosbirthday"]), + ("teachersday", ["teachersday", "teacherday"]), + ("singleday", ["singleday"]), + ("allsaintsday", ["allsaintsday"]), + ("youthday", ["youthday"]), + ("childrenday", ["childrenday", "childday"]), + ("femaleday", ["femaleday"]), + ("treeplantingday", ["treeplantingday"]), + ("arborday", ["arborday"]), + ("girlsday", ["girlsday"]), + ("whiteloverday", ["whiteloverday"]), + ("loverday", ["loverday", "loversday"]), + ("christmas", ["christmasday", "christmas"]), + ("xmas", ["xmasday", "xmas"]), + ("newyear", ["newyear"]), + ("newyearday", ["newyearday"]), + ("newyearsday", ["newyearsday"]), + ("inaugurationday", ["inaugurationday"]), + ("groundhougday", ["groundhougday"]), + ("valentinesday", ["valentinesday"]), + ("stpatrickday", ["stpatrickday", "stpatricksday", "stpatrick"]), + ("aprilfools", ["aprilfools"]), + ("stgeorgeday", ["stgeorgeday"]), + ("mayday", ["mayday", "intlworkersday", "internationalworkersday", "workersday"]), + ("cincodemayoday", ["cincodemayoday"]), + ("baptisteday", ["baptisteday"]), + ("usindependenceday", ["usindependenceday"]), + ("independenceday", ["independenceday"]), + ("bastilleday", ["bastilleday"]), + ("halloweenday", ["halloweenday", "halloween"]), + ("allhallowday", ["allhallowday"]), + ("allsoulsday", ["allsoulsday"]), + ("guyfawkesday", ["guyfawkesday"]), + ("veteransday", ["veteransday"]), + ("christmaseve", ["christmaseve"]), + ("newyeareve", ["newyearseve", "newyeareve"]), + ("juneteenth", ["juneteenth", "freedomday", "jubileeday"]), + ("ramadan", ["ramadan", "ramazan", "ramzan", "ramadhan", "ramathan"]), + ("sacrifice", ["eidaladha", "eidalazha", "eidulazha", "feastofthesacrifice"]), + ("islamicnewyear", ["islamicnewyear", "hijrinewyear", "arabicnewyear"]), + ("eidalfitr", ["eidalfitr", "festivalofbreakingthefast"]), + ] + ) + WrittenDecades = dict( + [ + ("hundreds", 0), + ("tens", 10), + ("twenties", 20), + ("thirties", 30), + ("forties", 40), + ("fifties", 50), + ("sixties", 60), + ("seventies", 70), + ("eighties", 80), + ("nineties", 90), + ] + ) + SpecialDecadeCases = dict([("noughties", 2000), ("aughts", 2000), ("two thousands", 2000)]) DefaultLanguageFallback = 'MDY' SuperfluousWordList = [r'preferably', r'how about', r'maybe', r'perhaps', r'say', r'like'] DurationDateRestrictions = [r'today', r'now', r'current date'] - AmbiguityFiltersDict = dict([("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), - ("^(morning|afternoon|evening|night|day)\\b", "\\b(good\\s+(morning|afternoon|evening|night|day))|(nighty\\s+night)\\b"), - ("\\bnow\\b", "\\b(^now,)|\\b((is|are)\\s+now\\s+for|for\\s+now)\\b"), - ("\\bmay$", "\\b((((!|\\.|\\?|,|;|)\\s+|^)may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|ask|contain|constitute|e-?mail|take|have|result|involve|get|work|reply|differ))|(or may not)))|(? -# This code was generated by a tool. -# Changes to this file may cause incorrect behavior and will be lost if -# the code is regenerated. -# -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. -# ------------------------------------------------------------------------------ - -# pylint: disable=line-too-long - - -class TimeZoneDefinitions: - DirectUtcRegex = f'\\b(utc|gmt)(\\s*[+\\-\\u00B1]?\\s*[\\d]{{1,2}}h?(\\s*:\\s*[\\d]{{1,2}})?)?\\b' - AbbreviationsList = [r'ABST', r'ACDT', r'ACST', r'ACT', r'ADT', r'AEDT', r'AEST', r'AET', r'AFT', r'AKDT', r'AKST', r'AMST', r'AMT', r'AOE', r'AoE', r'ARBST', r'ARST', r'ART', r'AST', r'AWDT', r'AWST', r'AZOST', r'AZOT', r'AZST', r'AZT', r'BIT', r'BST', r'BTT', r'CADT', r'CAST', r'CBST', r'CBT', r'CCST', r'CDT', r'CDTM', r'CEST', r'CET', r'COT', r'CST', r'CSTM', r'CT', r'CVT', r'EAT', r'ECT', r'EDT', r'EDTM', r'EEST', r'EET', r'EGST', r'ESAST', r'ESAT', r'EST', r'ESTM', r'ET', r'FJST', r'FJT', r'GET', r'GMT', r'GNDT', r'GNST', r'GST', r'GTBST', r'HADT', r'HAST', r'HDT', r'HKT', r'HST', r'IRDT', r'IRKT', r'IRST', r'ISDT', r'ISST', r'IST', r'JDT', r'JST', r'KRAT', r'KST', r'LINT', r'MAGST', r'MAGT', r'MAT', r'MDT', r'MDTM', r'MEST', r'MOST', r'MSK', r'MSK+1', r'MSK+2', r'MSK+3', r'MSK+4', r'MSK+5', r'MSK+6', r'MSK+7', r'MSK+8', r'MSK+9', r'MSK-1', r'MST', r'MSTM', r'MUT', r'MVST', r'MYST', r'NCAST', r'NDT', r'NMDT', r'NMST', r'NPT', r'NST', r'NZDT', r'NZST', r'NZT', r'PDST', r'PDT', r'PDTM', r'PETT', r'PKT', r'PSAST', r'PSAT', r'PST', r'PSTM', r'PT', r'PYST', r'PYT', r'RST', r'SAEST', r'SAPST', r'SAST', r'SAWST', r'SBT', r'SGT', r'SLT', r'SMST', r'SNST', r'SST', r'TADT', r'TAST', r'THA', r'TIST', r'TOST', r'TOT', r'TRT', r'TST', r'ULAT', r'UTC', r'VET', r'VLAT', r'WAST', r'WAT', r'WEST', r'WET', r'WPST', r'YAKT', r'YEKT'] - FullNameList = [r'Acre Time', r'Afghanistan Standard Time', r'Alaskan Standard Time', r'Anywhere on Earth', r'Arab Standard Time', r'Arabian Standard Time', r'Arabic Standard Time', r'Argentina Standard Time', r'Atlantic Standard Time', r'AUS Central Standard Time', r'Australian Central Time', r'AUS Eastern Standard Time', r'Australian Eastern Time', r'Australian Eastern Standard Time', r'Australian Central Daylight Time', r'Australian Eastern Daylight Time', r'Azerbaijan Standard Time', r'Azores Standard Time', r'Bahia Standard Time', r'Bangladesh Standard Time', r'Belarus Standard Time', r'Canada Central Standard Time', r'Cape Verde Standard Time', r'Caucasus Standard Time', r'Cen. Australia Standard Time', r'Central America Standard Time', r'Central Asia Standard Time', r'Central Brazilian Standard Time', r'Central Daylight Time', r'Europe Central Time', r'European Central Time', r'Central Europe Standard Time', r'Central Europe Std Time', r'Central European Std Time', r'Central European Standard Time', r'Central Pacific Standard Time', r'Central Standard Time', r'Central Standard Time (Mexico)', r'China Standard Time', r'Dateline Standard Time', r'E. Africa Standard Time', r'E. Australia Standard Time', r'E. Europe Standard Time', r'E. South America Standard Time', r'Eastern Time', r'Eastern Daylight Time', r'Eastern Standard Time', r'Eastern Standard Time (Mexico)', r'Egypt Standard Time', r'Ekaterinburg Standard Time', r'Fiji Standard Time', r'FLE Standard Time', r'Georgian Standard Time', r'GMT Standard Time', r'Greenland Standard Time', r'Greenwich Standard Time', r'GTB Standard Time', r'Hawaiian Standard Time', r'India Standard Time', r'Iran Standard Time', r'Israel Standard Time', r'Jordan Standard Time', r'Kaliningrad Standard Time', r'Kamchatka Standard Time', r'Korea Standard Time', r'Libya Standard Time', r'Line Islands Standard Time', r'Magadan Standard Time', r'Mauritius Standard Time', r'Mid-Atlantic Standard Time', r'Middle East Standard Time', r'Montevideo Standard Time', r'Morocco Standard Time', r'Mountain Standard Time', r'Mountain Standard Time (Mexico)', r'Myanmar Standard Time', r'N. Central Asia Standard Time', r'Namibia Standard Time', r'Nepal Standard Time', r'New Zealand Standard Time', r'Newfoundland Standard Time', r'North Asia East Standard Time', r'North Asia Standard Time', r'North Korea Standard Time', r'Pacific SA Standard Time', r'Pacific Standard Time', r'Pacific Daylight Time', r'Pacific Time', r'Pacific Standard Time', r'Pacific Standard Time (Mexico)', r'Pakistan Standard Time', r'Paraguay Standard Time', r'Romance Standard Time', r'Russia Time Zone 1', r'Russia Time Zone 2', r'Russia Time Zone 3', r'Russia Time Zone 4', r'Russia Time Zone 5', r'Russia Time Zone 6', r'Russia Time Zone 7', r'Russia Time Zone 8', r'Russia Time Zone 9', r'Russia Time Zone 10', r'Russia Time Zone 11', r'Russian Standard Time', r'SA Eastern Standard Time', r'SA Pacific Standard Time', r'SA Western Standard Time', r'Samoa Standard Time', r'SE Asia Standard Time', r'Singapore Standard Time', r'Singapore Time', r'South Africa Standard Time', r'Sri Lanka Standard Time', r'Syria Standard Time', r'Taipei Standard Time', r'Tasmania Standard Time', r'Tokyo Standard Time', r'Tonga Standard Time', r'Turkey Standard Time', r'Ulaanbaatar Standard Time', r'US Eastern Standard Time', r'US Mountain Standard Time', r'Mountain', r'Venezuela Standard Time', r'Vladivostok Standard Time', r'W. Australia Standard Time', r'W. Central Africa Standard Time', r'W. Europe Standard Time', r'West Asia Standard Time', r'West Pacific Standard Time', r'Yakutsk Standard Time', r'Pacific Daylight Saving Time', r'Austrialian Western Daylight Time', r'Austrialian West Daylight Time', r'Australian Western Daylight Time', r'Australian West Daylight Time', r'Colombia Time', r'Hong Kong Time', r'Central Europe Time', r'Central European Time', r'Central Europe Summer Time', r'Central European Summer Time', r'Central Europe Standard Time', r'Central European Standard Time', r'Central Europe Std Time', r'Central European Std Time', r'West Coast Time', r'West Coast', r'Central Time', r'Central', r'Pacific', r'Eastern'] - BaseTimeZoneSuffixRegex = f'((\\s+|-)(friendly|compatible))?(\\s+|-)time(zone)?' - LocationTimeSuffixRegex = f'({BaseTimeZoneSuffixRegex})\\b' - TimeZoneEndRegex = f'({BaseTimeZoneSuffixRegex})$' - AmbiguousTimezoneList = [r'bit', r'get', r'art', r'cast', r'eat', r'lint', r'mat', r'most', r'west', r'vet', r'wet', r'cot', r'pt', r'et', r'eastern', r'pacific', r'central', r'mountain', r'west coast'] - AbbrToMinMapping = dict([("abst", 180), - ("acdt", 630), - ("acst", 570), - ("act", -10000), - ("adt", -10000), - ("aedt", 660), - ("aest", 600), - ("aet", 600), - ("aft", 270), - ("akdt", -480), - ("akst", -540), - ("amst", -10000), - ("amt", -10000), - ("aoe", -720), - ("arbst", 180), - ("arst", 180), - ("art", -180), - ("ast", -10000), - ("awdt", 540), - ("awst", 480), - ("azost", 0), - ("azot", -60), - ("azst", 300), - ("azt", 240), - ("bit", -720), - ("bst", -10000), - ("btt", 360), - ("cadt", -360), - ("cast", 480), - ("cbst", -240), - ("cbt", -240), - ("ccst", -360), - ("cdt", -10000), - ("cdtm", -360), - ("cest", 120), - ("cet", 60), - ("cot", -300), - ("cst", -10000), - ("cstm", -360), - ("ct", -360), - ("cvt", -60), - ("eat", 180), - ("ect", -10000), - ("edt", -240), - ("edtm", -300), - ("eest", 180), - ("eet", 120), - ("egst", 0), - ("esast", -180), - ("esat", -180), - ("est", -300), - ("estm", -300), - ("et", -300), - ("fjst", 780), - ("fjt", 720), - ("get", 240), - ("gmt", 0), - ("gndt", -180), - ("gnst", -180), - ("gst", -10000), - ("gtbst", 120), - ("hadt", -540), - ("hast", -600), - ("hdt", -540), - ("hkt", 480), - ("hst", -600), - ("irdt", 270), - ("irkt", 480), - ("irst", 210), - ("isdt", 120), - ("isst", 120), - ("ist", -10000), - ("jdt", 120), - ("jst", 540), - ("krat", 420), - ("kst", -10000), - ("lint", 840), - ("magst", 720), - ("magt", 660), - ("mat", -120), - ("mdt", -360), - ("mdtm", -420), - ("mest", 120), - ("most", 0), - ("msk+1", 240), - ("msk+2", 300), - ("msk+3", 360), - ("msk+4", 420), - ("msk+5", 480), - ("msk+6", 540), - ("msk+7", 600), - ("msk+8", 660), - ("msk+9", 720), - ("msk-1", 120), - ("msk", 180), - ("mst", -420), - ("mstm", -420), - ("mut", 240), - ("mvst", -180), - ("myst", 390), - ("ncast", 420), - ("ndt", -150), - ("nmdt", 60), - ("nmst", 60), - ("npt", 345), - ("nst", -210), - ("nzdt", 780), - ("nzst", 720), - ("nzt", 720), - ("pdst", -420), - ("pdt", -420), - ("pdtm", -480), - ("pett", 720), - ("pkt", 300), - ("psast", -240), - ("psat", -240), - ("pst", -480), - ("pstm", -480), - ("pt", -480), - ("pyst", -10000), - ("pyt", -10000), - ("rst", 60), - ("saest", -180), - ("sapst", -300), - ("sast", 120), - ("sawst", -240), - ("sbt", 660), - ("sgt", 480), - ("slt", 330), - ("smst", 780), - ("snst", 480), - ("sst", -10000), - ("tadt", 600), - ("tast", 600), - ("tha", 420), - ("tist", 480), - ("tost", 840), - ("tot", 780), - ("trt", 180), - ("tst", 540), - ("ulat", 480), - ("utc", 0), - ("vet", -240), - ("vlat", 600), - ("wast", 120), - ("wat", -10000), - ("west", 60), - ("wet", 0), - ("wpst", 600), - ("yakt", 540), - ("yekt", 300)]) - FullToMinMapping = dict([("beijing", 480), - ("shanghai", 480), - ("shenzhen", 480), - ("suzhou", 480), - ("tianjian", 480), - ("chengdu", 480), - ("guangzhou", 480), - ("wuxi", 480), - ("xiamen", 480), - ("chongqing", 480), - ("shenyang", 480), - ("china", 480), - ("redmond", -480), - ("seattle", -480), - ("bellevue", -480), - ("afghanistan standard", 270), - ("alaskan standard", -540), - ("anywhere on earth", -720), - ("arab standard", 180), - ("arabian standard", 180), - ("arabic standard", 180), - ("argentina standard", -180), - ("atlantic standard", -240), - ("aus central standard", 570), - ("aus eastern standard", 600), - ("australian eastern", 600), - ("australian eastern standard", 600), - ("australian central daylight", 630), - ("australian eastern daylight", 660), - ("azerbaijan standard", 240), - ("azores standard", -60), - ("bahia standard", -180), - ("bangladesh standard", 360), - ("belarus standard", 180), - ("canada central standard", -360), - ("cape verde standard", -60), - ("caucasus standard", 240), - ("cen. australia standard", 570), - ("central australia standard", 570), - ("central america standard", -360), - ("central asia standard", 360), - ("central brazilian standard", -240), - ("central", -360), - ("central daylight", -10000), - ("central daylight saving", -10000), - ("central europe", 60), - ("central european", 60), - ("central europe std", 60), - ("central european std", 60), - ("central europe standard", 60), - ("central european standard", 60), - ("central europe summer", 120), - ("central european summer", 120), - ("central pacific standard", 660), - ("central standard time (mexico)", -360), - ("central standard", -360), - ("china standard", 480), - ("dateline standard", -720), - ("e. africa standard", 180), - ("e. australia standard", 600), - ("e. europe standard", 120), - ("e. south america standard", -180), - ("europe central", 60), - ("european central", 60), - ("eastern", -300), - ("eastern daylight", -10000), - ("eastern daylight saving", -10000), - ("eastern standard time (mexico)", -300), - ("eastern standard", -300), - ("egypt standard", 120), - ("ekaterinburg standard", 300), - ("fiji standard", 720), - ("fle standard", 120), - ("georgian standard", 240), - ("gmt standard", 0), - ("greenland standard", -180), - ("greenwich standard", 0), - ("gtb standard", 120), - ("hawaiian standard", -600), - ("india standard", 330), - ("iran standard", 210), - ("israel standard", 120), - ("jordan standard", 120), - ("kaliningrad standard", 120), - ("kamchatka standard", 720), - ("korea standard", 540), - ("libya standard", 120), - ("line islands standard", 840), - ("magadan standard", 660), - ("mauritius standard", 240), - ("mid-atlantic standard", -120), - ("middle east standard", 120), - ("montevideo standard", -180), - ("morocco standard", 0), - ("mountain", -420), - ("mountain daylight", -360), - ("mountain daylight saving", -360), - ("mountain standard", -420), - ("mountain standard time (mexico)", -420), - ("myanmar standard", 390), - ("n. central asia standard", 420), - ("namibia standard", 60), - ("nepal standard", 345), - ("new zealand standard", 720), - ("newfoundland standard", -210), - ("north asia east standard", 480), - ("north asia standard", 420), - ("north korea standard", 510), - ("west coast", -420), - ("pacific", -480), - ("pacific daylight", -420), - ("pacific daylight saving", -420), - ("pacific standard", -480), - ("pacific standard time (mexico)", -480), - ("pacific sa standard", -240), - ("pakistan standard", 300), - ("paraguay standard", -240), - ("romance standard", 60), - ("russia time zone 1", 120), - ("russia time zone 2", 180), - ("russia time zone 3", 240), - ("russia time zone 4", 300), - ("russia time zone 5", 360), - ("russia time zone 6", 420), - ("russia time zone 7", 480), - ("russia time zone 8", 540), - ("russia time zone 9", 600), - ("russia time zone 10", 660), - ("russia time zone 11", 720), - ("russian standard", 180), - ("sa eastern standard", -180), - ("sa pacific standard", -300), - ("sa western standard", -240), - ("samoa standard", -660), - ("se asia standard", 420), - ("singapore standard", 480), - ("singapore", 480), - ("south africa standard", 120), - ("sri lanka standard", 330), - ("syria standard", 120), - ("taipei standard", 480), - ("tasmania standard", 600), - ("tokyo standard", 540), - ("tonga standard", 780), - ("turkey standard", 180), - ("ulaanbaatar standard", 480), - ("us eastern standard", -300), - ("us mountain standard", -420), - ("venezuela standard", -240), - ("vladivostok standard", 600), - ("w. australia standard", 480), - ("w. central africa standard", 60), - ("w. europe standard", 0), - ("western european", 0), - ("west europe standard", 0), - ("west europe std", 0), - ("western europe standard", 0), - ("western europe summer", 60), - ("w. europe summer", 60), - ("western european summer", 60), - ("west europe summer", 60), - ("west asia standard", 300), - ("west pacific standard", 600), - ("yakutsk standard", 540), - ("australian western daylight", 540), - ("australian west daylight", 540), - ("austrialian western daylight", 540), - ("austrialian west daylight", 540), - ("australian western daylight saving", 540), - ("australian west daylight saving", 540), - ("austrialian western daylight saving", 540), - ("austrialian west daylight saving", 540), - ("colombia", -300), - ("hong kong", 480), - ("madrid", 60), - ("bilbao", 60), - ("seville", 60), - ("valencia", 60), - ("malaga", 60), - ("las Palmas", 60), - ("zaragoza", 60), - ("alicante", 60), - ("alche", 60), - ("oviedo", 60), - ("gijón", 60), - ("avilés", 60)]) - MajorLocations = [r'Dominican Republic', r'Dominica', r'Guinea Bissau', r'Guinea-Bissau', r'Guinea', r'Equatorial Guinea', r'Papua New Guinea', r'New York City', r'New York', r'York', r'Mexico City', r'New Mexico', r'Mexico', r'Aberdeen', r'Adelaide', r'Anaheim', r'Atlanta', r'Auckland', r'Austin', r'Bangkok', r'Baltimore', r'Baton Rouge', r'Beijing', r'Belfast', r'Birmingham', r'Bolton', r'Boston', r'Bournemouth', r'Bradford', r'Brisbane', r'Bristol', r'Calgary', r'Canberra', r'Cardiff', r'Charlotte', r'Chicago', r'Christchurch', r'Colchester', r'Colorado Springs', r'Coventry', r'Dallas', r'Denver', r'Derby', r'Detroit', r'Dubai', r'Dublin', r'Dudley', r'Dunedin', r'Edinburgh', r'Edmonton', r'El Paso', r'Glasgow', r'Gold Coast', r'Hamilton', r'Hialeah', r'Houston', r'Ipswich', r'Jacksonville', r'Jersey City', r'Kansas City', r'Kingston-upon-Hull', r'Leeds', r'Leicester', r'Lexington', r'Lincoln', r'Liverpool', r'London', r'Long Beach', r'Los Angeles', r'Louisville', r'Lubbock', r'Luton', r'Madison', r'Manchester', r'Mansfield', r'Melbourne', r'Memphis', r'Mesa', r'Miami', r'Middlesbrough', r'Milan', r'Milton Keynes', r'Minneapolis', r'Montréal', r'Montreal', r'Nashville', r'New Orleans', r'Newark', r'Newcastle-upon-Tyne', r'Newcastle', r'Northampton', r'Norwich', r'Nottingham', r'Oklahoma City', r'Oldham', r'Omaha', r'Orlando', r'Ottawa', r'Perth', r'Peterborough', r'Philadelphia', r'Phoenix', r'Plymouth', r'Portland', r'Portsmouth', r'Preston', r'Québec City', r'Quebec City', r'Québec', r'Quebec', r'Raleigh', r'Reading', r'Redmond', r'Richmond', r'Rome', r'San Antonio', r'San Diego', r'San Francisco', r'San José', r'Santa Ana', r'Seattle', r'Sheffield', r'Southampton', r'Southend-on-Sea', r'Spokane', r'St Louis', r'St Paul', r'St Petersburg', r'St. Louis', r'St. Paul', r'St. Petersburg', r'Stockton-on-Tees', r'Stockton', r'Stoke-on-Trent', r'Sunderland', r'Swansea', r'Swindon', r'Sydney', r'Tampa', r'Tauranga', r'Telford', r'Toronto', r'Vancouver', r'Virginia Beach', r'Walsall', r'Warrington', r'Washington', r'Wellington', r'Wolverhampton', r'Abilene', r'Akron', r'Albuquerque', r'Alexandria', r'Allentown', r'Amarillo', r'Anchorage', r'Ann Arbor', r'Antioch', r'Arlington', r'Arvada', r'Athens', r'Augusta', r'Aurora', r'Bakersfield', r'Beaumont', r'Bellevue', r'Berkeley', r'Billings', r'Boise', r'Boulder', r'Bridgeport', r'Broken Arrow', r'Brownsville', r'Buffalo', r'Burbank', r'Cambridge', r'Cape Coral', r'Carlsbad', r'Carrollton', r'Cary', r'Cedar Rapids', r'Centennial', r'Chandler', r'Charleston', r'Chattanooga', r'Chengdu', r'Chesapeake', r'Chongqing', r'Chula Vista', r'Cincinnati', r'Clarksville', r'Clearwater', r'Cleveland', r'Clovis', r'College Station', r'Columbia', r'Columbus', r'Concord', r'Coral Springs', r'Corona', r'Costa Mesa', r'Daly City', r'Davenport', r'Dayton', r'Denton', r'Des Moines', r'Downey', r'Durham', r'Edison', r'El Cajon', r'El Monte', r'Elgin', r'Elizabeth', r'Elk Grove', r'Erie', r'Escondido', r'Eugene', r'Evansville', r'Everett', r'Fairfield', r'Fargo', r'Farmington Hills', r'Fayetteville', r'Fontana', r'Fort Collins', r'Fort Lauderdale', r'Fort Wayne', r'Fort Worth', r'Fremont', r'Fresno', r'Frisco', r'Fullerton', r'Gainesville', r'Garden Grove', r'Garland', r'Gilbert', r'Glendale', r'Grand Prairie', r'Grand Rapids', r'Green Bay', r'Greensboro', r'Gresham', r'Guangzhou', r'Hampton', r'Hartford', r'Hayward', r'Henderson', r'High Point', r'Hollywood', r'Honolulu', r'Huntington Beach', r'Huntsville', r'Independence', r'Indianapolis', r'Inglewood', r'Irvine', r'Irving', r'Jackson', r'Joliet', r'Kent', r'Killeen', r'Knoxville', r'Lafayette', r'Lakeland', r'Lakewood', r'Lancaster', r'Lansing', r'Laredo', r'Las Cruces', r'Las Vegas', r'Lewisville', r'Little Rock', r'Lowell', r'Macon', r'McAllen', r'McKinney', r'Mesquite', r'Miami Gardens', r'Midland', r'Milwaukee', r'Miramar', r'Mobile', r'Modesto', r'Montgomery', r'Moreno Valley', r'Murfreesboro', r'Murrieta', r'Naperville', r'New Haven', r'Newport News', r'Norfolk', r'Norman', r'North Charleston', r'North Las Vegas', r'Norwalk', r'Oakland', r'Oceanside', r'Odessa', r'Olathe', r'Ontario', r'Orange', r'Overland Park', r'Oxnard', r'Palm Bay', r'Palmdale', r'Pasadena', r'Paterson', r'Pearland', r'Pembroke Pines', r'Peoria', r'Pittsburgh', r'Plano', r'Pomona', r'Pompano Beach', r'Providence', r'Provo', r'Pueblo', r'Rancho Cucamonga', r'Reno', r'Rialto', r'Richardson', r'Riverside', r'Rochester', r'Rockford', r'Roseville', r'Round Rock', r'Sacramento', r'Saint Paul', r'Salem', r'Salinas', r'Salt Lake City', r'San Bernardino', r'San Jose', r'San Mateo', r'Sandy Springs', r'Santa Clara', r'Santa Clarita', r'Santa Maria', r'Santa Rosa', r'Savannah', r'Scottsdale', r'Shanghai', r'Shenyang', r'Shenzhen', r'Shreveport', r'Simi Valley', r'Sioux Falls', r'South Bend', r'Springfield', r'Stamford', r'Sterling Heights', r'Sunnyvale', r'Surprise', r'Suzhou', r'Syracuse', r'Tacoma', r'Tallahassee', r'Temecula', r'Tempe', r'Thornton', r'Thousand Oaks', r'Tianjing', r'Toledo', r'Topeka', r'Torrance', r'Tucson', r'Tulsa', r'Tyler', r'Vallejo', r'Ventura', r'Victorville', r'Visalia', r'Waco', r'Warren', r'Waterbury', r'West Covina', r'West Jordan', r'West Palm Beach', r'West Valley City', r'Westminster', r'Wichita', r'Wichita Falls', r'Wilmington', r'Winston-Salem', r'Worcester', r'Wuxi', r'Xiamen', r'Yonkers', r'Bentonville', r'Afghanistan', r'AK', r'AL', r'Alabama', r'Åland', r'Åland Islands', r'Alaska', r'Albania', r'Algeria', r'American Samoa', r'Andorra', r'Angola', r'Anguilla', r'Antarctica', r'Antigua and Barbuda', r'AR', r'Argentina', r'Arizona', r'Arkansas', r'Armenia', r'Aruba', r'Australia', r'Austria', r'AZ', r'Azerbaijan', r'Bahamas', r'Bahrain', r'Bangladesh', r'Barbados', r'Belarus', r'Belgium', r'Belize', r'Benin', r'Bermuda', r'Bhutan', r'Bolivia', r'Bonaire', r'Bosnia', r'Bosnia and Herzegovina', r'Botswana', r'Bouvet Island', r'Brazil', r'British Indian Ocean Territory', r'British Virgin Islands', r'Brunei', r'Bulgaria', r'Burkina Faso', r'Burundi', r'CA', r'Cabo Verde', r'California', r'Cambodia', r'Cameroon', r'Canada', r'Cayman Islands', r'Central African Republic', r'Chad', r'Chile', r'China', r'Christmas Island', r'CO', r'Cocos Islands', r'Colombia', r'Colorado', r'Comoros', r'Congo', r'Congo (DRC)', r'Connecticut', r'Cook Islands', r'Costa Rica', r'Côte d’Ivoire', r'Croatia', r'CT', r'Cuba', r'Curaçao', r'Cyprus', r'Czechia', r'DE', r'Delaware', r'Denmark', r'Djibouti', r'Ecuador', r'Egypt', r'El Salvador', r'Eritrea', r'Estonia', r'eSwatini', r'Ethiopia', r'Falkland Islands', r'Falklands', r'Faroe Islands', r'Fiji', r'Finland', r'FL', r'Florida', r'France', r'French Guiana', r'French Polynesia', r'French Southern Territories', r'FYROM', r'GA', r'Gabon', r'Gambia', r'Georgia', r'Georgia', r'Germany', r'Ghana', r'Gibraltar', r'Greece', r'Greenland', r'Grenada', r'Guadeloupe', r'Guam', r'Guatemala', r'Guernsey', r'Guyana', r'Haiti', r'Hawaii', r'Herzegovina', r'HI', r'Honduras', r'Hong Kong', r'Hungary', r'IA', r'Iceland', r'ID', r'Idaho', r'IL', r'Illinois', r'IN', r'India', r'Indiana', r'Indonesia', r'Iowa', r'Iran', r'Iraq', r'Ireland', r'Isle of Man', r'Israel', r'Italy', r'Ivory Coast', r'Jamaica', r'Jan Mayen', r'Japan', r'Jersey', r'Jordan', r'Kansas', r'Kazakhstan', r'Keeling Islands', r'Kentucky', r'Kenya', r'Kiribati', r'Korea', r'Kosovo', r'KS', r'Kuwait', r'KY', r'Kyrgyzstan', r'LA', r'Laos', r'Latvia', r'Lebanon', r'Lesotho', r'Liberia', r'Libya', r'Liechtenstein', r'Lithuania', r'Louisiana', r'Luxembourg', r'MA', r'Macao', r'Macedonia', r'Madagascar', r'Maine', r'Malawi', r'Malaysia', r'Maldives', r'Mali', r'Malta', r'Marshall Islands', r'Martinique', r'Maryland', r'Massachusetts', r'Mauritania', r'Mauritius', r'Mayotte', r'MD', r'ME', r'MI', r'Michigan', r'Micronesia', r'Minnesota', r'Mississippi', r'Missouri', r'MN', r'MO', r'Moldova', r'Monaco', r'Mongolia', r'Montana', r'Montenegro', r'Montserrat', r'Morocco', r'Mozambique', r'MS', r'MT', r'Myanmar', r'Namibia', r'Nauru', r'NC', r'ND', r'NE', r'Nebraska', r'Nepal', r'Netherlands', r'Nevada', r'New Caledonia', r'New Hampshire', r'New Jersey', r'New Zealand', r'NH', r'Nicaragua', r'Niger', r'Nigeria', r'Niue', r'NJ', r'NM', r'Norfolk Island', r'North Carolina', r'North Dakota', r'North Korea', r'Northern Mariana Islands', r'Norway', r'NV', r'NY', r'OH', r'Ohio', r'OK', r'Oklahoma', r'Oman', r'OR', r'Oregon', r'PA', r'Pakistan', r'Palau', r'Palestinian Authority', r'Panama', r'Paraguay', r'Pennsylvania', r'Peru', r'Philippines', r'Pitcairn Islands', r'Poland', r'Portugal', r'Puerto Rico', r'Qatar', r'Réunion', r'Rhode Island', r'RI', r'Romania', r'Russia', r'Rwanda', r'Saba', r'Saint Barthélemy', r'Saint Kitts and Nevis', r'Saint Lucia', r'Saint Martin', r'Saint Pierre and Miquelon', r'Saint Vincent and the Grenadines', r'Samoa', r'San Marino', r'São Tomé and Príncipe', r'Saudi Arabia', r'SC', r'SD', r'Senegal', r'Serbia', r'Seychelles', r'Sierra Leone', r'Singapore', r'Sint Eustatius', r'Sint Maarten', r'Slovakia', r'Slovenia', r'Solomon Islands', r'Somalia', r'South Africa', r'South Carolina', r'South Dakota', r'South Sudan', r'Spain', r'Sri Lanka', r'Sudan', r'Suriname', r'Svalbard', r'Swaziland', r'Sweden', r'Switzerland', r'Syria', r'Taiwan', r'Tajikistan', r'Tanzania', r'Tennessee', r'Texas', r'Thailand', r'Timor-Leste', r'TN', r'Togo', r'Tokelau', r'Tonga', r'Trinidad and Tobago', r'Tunisia', r'Turkey', r'Turkmenistan', r'Turks and Caicos Islands', r'Tuvalu', r'TX', r'U.S. Outlying Islands', r'US Outlying Islands', r'U.S. Virgin Islands', r'US Virgin Islands', r'Uganda', r'UK', r'Ukraine', r'United Arab Emirates', r'United Kingdom', r'United States', r'Uruguay', r'US', r'USA', r'UT', r'Utah', r'Uzbekistan', r'VA', r'Vanuatu', r'Vatican City', r'Venezuela', r'Vermont', r'Vietnam', r'Virginia', r'VT', r'WA', r'Wallis and Futuna', r'West Virginia', r'WI', r'Wisconsin', r'WV', r'WY', r'Wyoming', r'Yemen', r'Zambia', r'Zimbabwe', r'Paris', r'Tokyo', r'Shanghai', r'Sao Paulo', r'Rio de Janeiro', r'Rio', r'Brasília', r'Brasilia', r'Recife', r'Milan', r'Mumbai', r'Moscow', r'Frankfurt', r'Munich', r'Berlim', r'Madrid', r'Lisbon', r'Warsaw', r'Johannesburg', r'Seoul', r'Istanbul', r'Kuala Kumpur', r'Jakarta', r'Amsterdam', r'Brussels', r'Valencia', r'Seville', r'Bilbao', r'Malaga', r'Las Palmas', r'Zaragoza', r'Alicante', r'Elche', r'Oviedo', r'Gijón', r'Avilés', r'West Coast', r'Central', r'Pacific', r'Eastern', r'Mountain'] -# pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/french_date_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/french_date_time.py index f7ab2cf049..1e9084de23 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/french_date_time.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/french_date_time.py @@ -9,178 +9,205 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_date_time import BaseDateTime +from .base_date_time import BaseDateTime, BaseDateTimeResource + + # pylint: disable=line-too-long -class FrenchDateTime: +class FrenchDateTime(BaseDateTimeResource): LangMarker = 'Fre' CheckBothBeforeAfter = False - TillRegex = f'(?\\b(au|et|(jusqu\')?a|avant)\\b|(jusqu\')?à|--|-|—|——)' - RangeConnectorRegex = f'(?\\b(de\\s+la|au|(jusqu\')?a|et(\\s*la)?)\\b|(jusqu\')?à|--|-|—|——)' - RelativeRegex = f'(?prochaine?|de|du|ce(tte)?|l[ae]|derni[eè]re|hier|pr[eé]c[eé]dente|au\\s+cours+(de|du\\s*))' - StrictRelativeRegex = f'(?prochaine?|derni[eè]re|hier|pr[eé]c[eé]dente|au\\s+cours+(de|du\\s*))' - NextSuffixRegex = f'(?prochain(es?)?|suivante)\\b' - PastSuffixRegex = f'(?derni[eè]r(es?)?|pr[eé]c[eé]dente)\\b' - ThisPrefixRegex = f'(?ce(tte)?|au\\s+cours+(du|de))\\b' - RangePrefixRegex = f'(du|depuis|des?|entre)' - DayRegex = f'(?(?:3[0-1]|[1-2]\\d|0?[1-9])(e(r)?)?)(?=\\b|t)' - WrittenDayRegex = f'(?((vingt|trente)(\\s*-\\s*|\\s+)et(\\s*-\\s*|\\s+))?un|(vingt(\\s*-\\s*|\\s+))?(deux|trois|quatre|cinq|six|sept|huit|neuf)|dix|onze|douze|treize|quatorze|quinze|seize|dix-(sept|huit|neuf)|vingt|trente)' - MonthNumRegex = f'(?1[0-2]|(0)?[1-9])\\b' - SpecialDescRegex = f'(p\\b)' + TillRegex = '(?\\b(au|et|(jusqu\')?a|avant)\\b|(jusqu\')?à|--|-|—|——)' + RangeConnectorRegex = '(?\\b(de\\s+la|au|(jusqu\')?a|et(\\s*la)?)\\b|(jusqu\')?à|--|-|—|——)' + RelativeRegex = ( + '(?prochaine?|de|du|ce(tte)?|l[ae]|derni[eè]re|hier|pr[eé]c[eé]dente|au\\s+cours+(de|du\\s*))' + ) + StrictRelativeRegex = '(?prochaine?|derni[eè]re|hier|pr[eé]c[eé]dente|au\\s+cours+(de|du\\s*))' + NextSuffixRegex = '(?prochain(es?)?|suivante)\\b' + PastSuffixRegex = '(?derni[eè]r(es?)?|pr[eé]c[eé]dente)\\b' + ThisPrefixRegex = '(?ce(tte)?|au\\s+cours+(du|de))\\b' + RangePrefixRegex = '(du|depuis|des?|entre)' + DayRegex = '(?(?:3[0-1]|[1-2]\\d|0?[1-9])(e(r)?)?)(?=\\b|t)' + WrittenDayRegex = '(?((vingt|trente)(\\s*-\\s*|\\s+)et(\\s*-\\s*|\\s+))?un|(vingt(\\s*-\\s*|\\s+))?(deux|trois|quatre|cinq|six|sept|huit|neuf)|dix|onze|douze|treize|quatorze|quinze|seize|dix-(sept|huit|neuf)|vingt|trente)' + MonthNumRegex = '(?1[0-2]|(0)?[1-9])(e(r)?)?\\b' + SpecialDescRegex = '(p\\b)' AmDescRegex = f'(h\\b|{BaseDateTime.BaseAmDescRegex})' PmDescRegex = f'(h\\b|{BaseDateTime.BasePmDescRegex})' AmPmDescRegex = f'(h\\b|{BaseDateTime.BaseAmPmDescRegex})' DescRegex = f'(?{AmPmDescRegex}|{AmDescRegex}|{PmDescRegex}|{SpecialDescRegex})' TwoDigitYearRegex = f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d)))\\b' - WrittenOneToNineRegex = f'(?:une?|deux|trois|quatre|cinq|six|sept|huit|neuf)' - WrittenElevenToNineteenRegex = f'(?:(seize|quinze|quatorze|treize|douze|onze)|dix\\W(neuf|huit|sept))' - WrittenTensRegex = f'(?:quatre\\Wvingt(s|\\Wdix)?|soixante(\\Wdix)?|dix|vingt|trente|quarante|cinquante|septante|octante|huitante|nonante)' - WrittenCenturyFullYearRegex = f'(?:(deux\\s+)?mille((\\s+{WrittenOneToNineRegex})?\\s+cents?)?)' + WrittenOneToNineRegex = '(?:une?|deux|trois|quatre|cinq|six|sept|huit|neuf)' + WrittenElevenToNineteenRegex = '(?:(seize|quinze|quatorze|treize|douze|onze)|dix\\W(neuf|huit|sept))' + WrittenTensRegex = r'(?:quatre(?:[\s-]vingt(?:[\s-]dix)?)?|soixante([\s-]dix)?|dix|vingts?|trente|quarante|cinquante|septante|octante|huitante|nonante)' + WrittenCenturyFullYearRegex = f'(?:(deux\\s+)?(mille|mil)((\\s+{WrittenOneToNineRegex})?(\\s+cents?)?)?)' WrittenCenturyOrdinalYearRegex = f'({WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|dix)' CenturyRegex = f'\\b(?{WrittenCenturyFullYearRegex}|{WrittenCenturyOrdinalYearRegex}(\\s+cents?)?)\\b' - LastTwoYearNumRegex = f'(({WrittenTensRegex}(\\s+|-))?({WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex})|{WrittenTensRegex})' + LastTwoYearNumRegex = ( + f'(({WrittenTensRegex}(\\s+|-))({WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex})|{WrittenTensRegex})' + ) FullTextYearRegex = f'\\b(?(?{CenturyRegex})\\s+(?{LastTwoYearNumRegex})\\b|\\b(?{WrittenCenturyFullYearRegex}|{WrittenCenturyOrdinalYearRegex}\\s+cents))\\b' YearRegex = f'({BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' - WeekDayRegex = f'(?dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi|lun(\\.)?|mar(\\.)?|mer(\\.)?|jeu(\\.)?|ven(\\.)?|sam(\\.)?|dim(\\.)?)' - RelativeMonthRegex = f'(?({ThisPrefixRegex}\\s+mois)|(mois\\s+{PastSuffixRegex})|(mois\\s+{NextSuffixRegex}))\\b' - WrittenMonthRegex = f'(?avril|avr(\\.)?|ao[uû]t|d[eé]cembre|d[eé]c(\\.)?|f[eé]vrier|f[eé]vr?(\\.)?|janvier|janv?(\\.)?|juillet|jui?[ln](\\.)?|mars?(\\.)?|mai|novembre|nov(\\.)?|octobre|oct(\\.)?|septembre|sept?(\\.)?(?!\\s+heures))' + WeekDayRegex = '(?dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi|lun(\\.)?|mar(\\.)?|mer(\\.)?|jeu(\\.)?|ven(\\.)?|sam(\\.)?|dim(\\.)?)' + RelativeMonthRegex = ( + f'(?({ThisPrefixRegex}\\s+mois)|(mois\\s+{PastSuffixRegex})|(mois\\s+{NextSuffixRegex}))\\b' + ) + WrittenMonthRegex = '(?avril|avr(\\.)?|ao[uû]t|d[eé]cembre|d[eé]c(\\.)?|f[eé]vrier|f[eé]vr?(\\.)?|janvier|janv?(\\.)?|juillet|jui?[ln](\\.)?|mars?(\\.)?|mai|novembre|nov(\\.)?|octobre|oct(\\.)?|septembre|sept?(\\.)?(?!\\s+heures))' MonthSuffixRegex = f'(?(en\\s*|le\\s*|de\\s*|dans\\s*)?({RelativeMonthRegex}|{WrittenMonthRegex}))' - DateUnitRegex = f'(?an|mois|((l\')?ann[eé]e|semaine|journ[eé]e|jour)(?s)?)\\b' + DateUnitRegex = '(?an|mois|((l\')?ann[eé]e|semaine|journ[eé]e|jour)(?s)?)\\b' SimpleCasesRegex = f'\\b((d[ue])|entre\\s+)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*){YearRegex})?\\b' MonthFrontSimpleCasesRegex = f'\\b((d[ue]|entre)\\s+)?{MonthSuffixRegex}\\s+((d[ue]|entre)\\s+)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' MonthFrontBetweenRegex = f'\\b{MonthSuffixRegex}\\s+(entre|d[ue]\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' BetweenRegex = f'\\b(entre\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*){YearRegex})?\\b' - YearWordRegex = f'\\b(?l\'ann[ée]e)\\b' - MonthWithYear = f'\\b({WrittenMonthRegex}(\\s*),?(\\s+de)?(\\s*)({YearRegex}|{TwoDigitYearRegex}|(?cette)\\s*{YearWordRegex})|{YearWordRegex}\\s*({PastSuffixRegex}|{NextSuffixRegex}))' + YearWordRegex = '\\b(?l\'ann[ée]e)\\b' + MonthWithYear = f'\\b({WrittenMonthRegex}(\\s*),?(\\s+de)?(\\s*)({YearRegex}|\\\'?{TwoDigitYearRegex}|(?cette)\\s*{YearWordRegex})|{YearWordRegex}\\s*({PastSuffixRegex}|{NextSuffixRegex}))' OneWordPeriodRegex = f'\\b(({RelativeRegex}\\s+)?{WrittenMonthRegex}|(la\\s+)?(weekend|(fin de )?semaine|week-end|mois|ans?|l\'année)\\s+{StrictRelativeRegex}|{RelativeRegex}\\s+(weekend|(fin de )?semaine|week-end|mois|ans?|l\'année)|weekend|week-end|mois|l\'année|an)\\b' - MonthNumWithYear = f'({YearRegex}(\\s*)[/\\-\\.](\\s*){MonthNumRegex})|({MonthNumRegex}(\\s*)[/\\-](\\s*){YearRegex})' + MonthNumWithYear = ( + f'({YearRegex}(\\s*)[/\\-\\.](\\s*){MonthNumRegex})|({MonthNumRegex}(\\s*)[/\\-](\\s*){YearRegex})' + ) WeekOfMonthRegex = f'(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+semaine(\\s+de)?\\s+{MonthSuffixRegex})' WeekOfYearRegex = f'(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+semaine(\\s+de)?\\s+({YearRegex}|{RelativeRegex}\\s+ann[ée]e))' OfYearRegex = f'\\b((of|in)\\s+({YearRegex}|{StrictRelativeRegex}\\s+year))\\b' - FirstLastRegex = f'\\b(the\\s+)?((?first)|(?last))\\b' + FirstLastRegex = '\\b(the\\s+)?((?first)|(?last))\\b' FollowedDateUnit = f'^\\s*{DateUnitRegex}' NumberCombinedWithDateUnit = f'\\b(?\\d+(\\.\\d*)?){DateUnitRegex}' QuarterRegex = f'(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4)\\s+quart(\\s+de|\\s*,\\s*)?\\s+({YearRegex}|{RelativeRegex}\\s+l\'ann[eé]e)' QuarterRegexYearFront = f'({YearRegex}|l\'année\\s+({PastSuffixRegex}|{NextSuffixRegex})|{RelativeRegex}\\s+ann[eé]e)\\s+(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4)\\s+quarts' - AllHalfYearRegex = f'^\\b$' - PrefixDayRegex = f'\\b((?t[ôo]t\\sdans)|(?au\\smilieu\\sde)|(?tard\\sdans))(\\s+la\\s+journ[ée]e)?$' - CenturySuffixRegex = f'^\\b$' + AllHalfYearRegex = '^\\b$' + PrefixDayRegex = '\\b((?t[ôo]t\\sdans)|(?au\\smilieu\\sde)|(?tard\\sdans))(\\s+la\\s+journ[ée]e)?$' + CenturySuffixRegex = '^\\b$' SeasonRegex = f'\\b((printemps|été|automne|hiver)+\\s*({NextSuffixRegex}|{PastSuffixRegex}))|(?({RelativeRegex}\\s+)?(?printemps|[ée]t[ée]|automne|hiver)((\\s+de|\\s*,\\s*)?\\s+({YearRegex}|{RelativeRegex}\\s+l\'ann[eé]e))?)\\b' - WhichWeekRegex = f'\\b(semaine)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])\\b' - WeekOfRegex = f'(semaine)(\\s*)(de)' - MonthOfRegex = f'(mois)(\\s*)(de)' - MonthRegex = f'(?avril|avr(\\.)?|ao[uû]t|d[eé]cembre|d[eé]c(\\.)?|f[eé]vrier|f[eé]vr?(\\.)?|janvier|janv?(\\.)?|juillet|jui?[ln](\\.)?|mars?(\\.)?|mai|novembre|nov(\\.)?|octobre|oct(\\.)?|septembre|sept?(\\.)?(?!\\s+heures))' + WhichWeekRegex = '\\b(semaine)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])\\b' + WeekOfRegex = '(semaine)(\\s*)(de)' + MonthOfRegex = '(mois)(\\s*)(de)' + MonthRegex = '(?avril|avr(\\.)?|ao[uû]t|d[eé]cembre|d[eé]c(\\.)?|f[eé]vrier|f[eé]vr?(\\.)?|janvier|janv?(\\.)?|juillet|jui?[ln](\\.)?|mars?(\\.)?|mai|novembre|nov(\\.)?|octobre|oct(\\.)?|septembre|sept?(\\.)?(?!\\s+heures))' OnRegex = f'(?<=\\b(en|sur\\s*l[ea]|sur)\\s+)({DayRegex}s?)\\b' - RelaxedOnRegex = f'(?<=\\b(en|le|dans|sur\\s*l[ea]|du|sur)\\s+)((?10e|11e|12e|13e|14e|15e|16e|17e|18e|19e|1er|20e|21e|22e|23e|24e|25e|26e|27e|28e|29e|2e|30e|31e|3e|4e|5e|6e|7e|8e|9e)s?)\\b' + RelaxedOnRegex = '(?<=\\b(en|le|dans|sur\\s*l[ea]|du|sur)\\s+)((?10e|11e|12e|13e|14e|15e|16e|17e|18e|19e|1er|20e|21e|22e|23e|24e|25e|26e|27e|28e|29e|2e|30e|31e|3e|4e|5e|6e|7e|8e|9e)s?)\\b' ThisRegex = f'\\b((cette(\\s*semaine)?\\s+){WeekDayRegex})|({WeekDayRegex}(\\s+cette\\s*semaine))\\b' LastDateRegex = f'\\b(({WeekDayRegex}(\\s*(de)?\\s*la\\s*semaine\\s+{PastSuffixRegex}))|({WeekDayRegex}(\\s+{PastSuffixRegex})))\\b' NextDateRegex = f'\\b(({WeekDayRegex}(\\s+{NextSuffixRegex}))|({WeekDayRegex}(\\s*(de)?\\s*la\\s*semaine\\s+{NextSuffixRegex})))\\b' - SpecialDayRegex = f'\\b(avant[\\s|-]hier|apr[eè]s(-demain|\\s*demain)|(le\\s)?jour suivant|(le\\s+)?dernier jour|hier|lendemain|demain|(de\\s)?la journ[ée]e|aujourd\'hui)\\b' - SpecialDayWithNumRegex = f'^\\b$' - StrictWeekDay = f'\\b(?dim(anche)?|lun(di)?|mar(di)?|mer(credi)?|jeu(di)?|ven(dredi)?|sam(edi)?)s?\\b' - SetWeekDayRegex = f'\\b(?le\\s+)?(?matin([ée]e)?|apr[eè]s-midi|soir([ée]e)?|dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)s\\b' + SpecialDayRegex = '\\b(avant[\\s|-]hier|apr[eè]s(-demain|\\s*demain)|(le\\s)?jour suivant|(le\\s+)?dernier jour|hier|lendemain|demain|(de\\s)?la journ[ée]e|aujourd\'hui)\\b' + SpecialDayWithNumRegex = '^\\b$' + StrictWeekDay = '\\b(?dim(anche)?|lun(di)?|mar(di)?|mer(credi)?|jeu(di)?|ven(dredi)?|sam(edi)?)s?\\b' WeekDayOfMonthRegex = f'(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+{WeekDayRegex}\\s+{MonthSuffixRegex})' - RelativeWeekDayRegex = f'^\\b$' - AmbiguousRangeModifierPrefix = f'^\\b$' - NumberEndingPattern = f'^\\b$' + RelativeWeekDayRegex = '^\\b$' + AmbiguousRangeModifierPrefix = '^\\b$' + NumberEndingPattern = '^\\b$' SpecialDate = f'(?<=\\b(au|le)\\s+){DayRegex}(?!:)\\b' - DateYearRegex = f'(?{YearRegex}|{TwoDigitYearRegex})' + DateYearRegex = f'(?{YearRegex}|\\\'?{TwoDigitYearRegex})' DateExtractor1 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?{MonthRegex}\\s*[/\\\\\\.\\-]?\\s*{DayRegex}(\\s*([/\\\\\\.\\-]|\\bde\\b)?\\s*{BaseDateTime.FourDigitYearRegex})?\\b' DateExtractor2 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?{DayRegex}(\\s+|\\s*,\\s*|\\s+){MonthRegex}\\s*([\\.\\-]|\\bde\\b)?\\s*{DateYearRegex}\\b' DateExtractor3 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?((?(l\')?ann[eé]e(s)?|mois|semaines?)\\b' - HourNumRegex = f'\\b(?zero|une?(?=\\s+heure)|deux|trois|quatre|cinq|six|sept|huit|neuf|onze|douze|treize|quatorze|quinze|dix-six|seize|dix(-|\\s+)sept|dix(-|\\s+)huit|dix(-|\\s+)neuf|vingt|vingt(-|\\s+)et(-|\\s+)un|vingt(-|\\s+)deux|vingt(-|\\s+)trois|dix)\\b' - MinuteNumRegex = f'(?((vingt|trente|quarante|cinquante)(\\s*(et|-)?\\s*))?(un|deux|trois|quatre|cinq|six|sept|huit|neuf)|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante|dix)' - DeltaMinuteNumRegex = f'(?((vingt|trente|quarante|cinquante)(\\s*(et|-)?\\s*))?(un|deux|trois|quatre|cinq|six|sept|huit|neuf)|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante|dix)' - OclockRegex = f'(?heures?|h)' - PmRegex = f'(?(dans l\'\\s*)?apr[eè]s(\\s*|-)midi|(du|ce|de|le)\\s*(soir([ée]e)?)|(dans l[ea]\\s+)?(nuit|soir[eé]e))' - AmRegex = f'(?(du|de|ce|(du|de|dans)\\s*l[ea]|le)?\\s*matin[ée]e|(du|de|ce|dans l[ea]|le)?\\s*matin)' + WeekDayStart = '^\\b$' + RangeUnitRegex = '\\b(?(l\')?ann[eé]e(s)?|mois|semaines?)\\b' + HourNumRegex = "\\b(?zero|une(?=\\s+heure(?!\\s+d\'))|deux|trois|quatre|cinq|six|sept|huit|neuf|onze|douze|treize|quatorze|quinze|dix-six|seize|dix(-|\\s+)sept|dix(-|\\s+)huit|dix(-|\\s+)neuf|vingt|vingt(-|\\s+)et(-|\\s+)un|vingt(-|\\s+)deux|vingt(-|\\s+)trois|dix)\\b" + MinuteNumRegex = '(?((vingt|trente|quarante|cinquante)(\\s*(et|-)?\\s*))?(un|deux|trois|quatre|cinq|six|sept|huit|neuf)|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante|dix)' + DeltaMinuteNumRegex = '(?((vingt|trente|quarante|cinquante)(\\s*(et|-)?\\s*))?(un|deux|trois|quatre|cinq|six|sept|huit|neuf)|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante|dix)' + OclockRegex = "(?heures?(?!\\s+d\')|h)" + PmRegex = f'(?(dans l\'\\s*|de l\'\\s*)?apr[eè]s(\\s*|-)midi|(du|ce|de|le)\\s*(soir([ée]e)?)|(dans l[ea]\\s+)?(nuit|soir[eé]e))' + AmRegex = '(?(du|de|ce|(du|de|dans)\\s*l[ea]|le)?\\s*matin[ée]e|(du|de|ce|dans l[ea]|le)?\\s*matin)' LessThanOneHour = f'(?(une\\s+)?quart|trois quart(s)?|demie( heure)?|({BaseDateTime.DeltaMinuteRegex}|{DeltaMinuteNumRegex})(\\s+(minutes?|mins?))|(?<=heures?\\s+((et|moins)\\s+)?)({BaseDateTime.DeltaMinuteRegex}|{DeltaMinuteNumRegex}))' - WrittenTimeRegex = f'(?{HourNumRegex}\\s+(heures\\s+)?(et\\s+)?{MinuteNumRegex}(?!\\s+heures)(\\s+(minutes?|mins?))?)' + WrittenTimeRegex = ( + f'(?{HourNumRegex}\\s+(heures\\s+)?(et\\s+)?{MinuteNumRegex}(?!\\s+heures)(\\s+(minutes?|mins?))?)' + ) TimePrefix = f'(?(heures?\\s+((et|moins)\\s+)?{LessThanOneHour}|(et|moins)\\s+{LessThanOneHour}|{LessThanOneHour}\\s+[àa]))' TimeSuffix = f'(?{AmRegex}|{PmRegex}|{OclockRegex})' BasicTime = f'(?{WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}(:|\\s*h\\s*){BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|{BaseDateTime.HourRegex})' - MidnightRegex = f'(?minuit)' - CommonDatePrefixRegex = f'^[\\.]' - MorningRegex = f'(?matin([ée]e)?)' - AfternoonRegex = f'(?(d\'|l\')?apr[eè]s(-|\\s*)midi)' + MidnightRegex = '(?minuit)' + CommonDatePrefixRegex = '^[\\.]' + MorningRegex = '(?matin([ée]e)?)' + AfternoonRegex = '(?(d\'|l\')?apr[eè]s(-|\\s*)midi)' MidmorningRegex = f'(?milieu\\s*d[ue]\\s*{MorningRegex})' - MiddayRegex = f'(?milieu(\\s*|-)d[eu]\\s*(jour|midi)|apr[eè]s(-|\\s*)midi|(?<=\\bà\\s+)midi)' + MiddayRegex = '(?milieu(\\s*|-)d[eu]\\s*(jour|midi)|apr[eè]s(-|\\s*)midi|(?<=à\\s+)midi)' MidafternoonRegex = f'(?milieu\\s*d\'+{AfternoonRegex})' MidTimeRegex = f'(?({MidnightRegex}|{MidmorningRegex}|{MidafternoonRegex}|{MiddayRegex}))' AtRegex = f'\\b(((?<=\\b[àa]\\s+)({WrittenTimeRegex}|{HourNumRegex}(\\s+heures)?|{BaseDateTime.HourRegex}|{MidTimeRegex}))|{MidTimeRegex})\\b' IshRegex = f'\\b(peu\\s*pr[èe]s\\s*{BaseDateTime.HourRegex}|peu\\s*pr[èe]s\\s*{WrittenTimeRegex}|peu\\s*pr[èe]s\\s*[àa]\\s*{BaseDateTime.HourRegex}|peu pr[èe]s midi)\\b' - TimeUnitRegex = f'(?h|(heure|hr|minute|min|seconde|sec)(?s)?)\\b' - RestrictedTimeUnitRegex = f'(?huere|minute)\\b' + TimeUnitRegex = "(?h|(heure(?!\\s+d\')|hr|minute|min|seconde|sec)(?s)?)\\b" + RestrictedTimeUnitRegex = '(?huere|minute)\\b' ConnectNumRegex = f'{BaseDateTime.HourRegex}(?[0-5][0-9])\\s*{DescRegex}' - FivesRegex = f'(?(quinze|vingt(\\s*|-*(cinq))?|trente(\\s*|-*(cinq))?|quarante(\\s*|-*(cinq))??|cinquante(\\s*|-*(cinq))?|dix|cinq))\\b' - PeriodHourNumRegex = f'(?vingt-et-un|vingt-deux|vingt-trois|vingt-quatre|zero|une|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt)' + FivesRegex = '(?(quinze|vingt(\\s*|-*(cinq))?|trente(\\s*|-*(cinq))?|quarante(\\s*|-*(cinq))??|cinquante(\\s*|-*(cinq))?|dix|cinq))\\b' + PeriodHourNumRegex = '(?vingt-et-un|vingt-deux|vingt-trois|vingt-quatre|zero|une|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt)' TimeRegex1 = f'\\b({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})\\s*{DescRegex}(\\s+{TimePrefix})?\\b' TimeRegex2 = f'(\\b{TimePrefix}\\s+)?(t)?{BaseDateTime.HourRegex}(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?{BaseDateTime.SecondRegex})?((\\s*{DescRegex})|\\b)' TimeRegex3 = f'\\b{BaseDateTime.HourRegex}\\.{BaseDateTime.MinuteRegex}(\\s*{DescRegex})(\\s+{TimePrefix})?' TimeRegex4 = f'\\b{BasicTime}(\\s*{DescRegex})?(\\s+{TimePrefix})?\\s+{TimeSuffix}\\b' TimeRegex5 = f'\\b{BasicTime}((\\s*{DescRegex})(\\s+{TimePrefix})?|\\s+{TimePrefix})' - TimeRegex6 = f'{BasicTime}(\\s*{DescRegex})?\\s+{TimeSuffix}\\b' + TimeRegex6 = f'{BasicTime}(\\s*{DescRegex})?(\\s*heure(s)?)?\\s+{TimeSuffix}\\b' TimeRegex7 = f'\\b{TimeSuffix}\\s+[àa]\\s+{BasicTime}((\\s*{DescRegex})|\\b)' TimeRegex8 = f'\\b{TimeSuffix}\\s+{BasicTime}((\\s*{DescRegex})|\\b)' TimeRegex9 = f'\\b{PeriodHourNumRegex}\\s+{FivesRegex}((\\s*{DescRegex})|\\b)' - TimeRegex10 = f'\\b{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?(\\s+{TimePrefix})?' + TimeRegex10 = ( + f'\\b{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?(\\s+{TimePrefix})?' + ) HourRegex = f'\\b{BaseDateTime.HourRegex}' - PeriodDescRegex = f'(?pm|am|p\\.m\\.|a\\.m\\.|p)' - PeriodPmRegex = f'(?dans l\'apr[eè]s-midi|ce soir|d[eu] soir|dans l[ea] soir[eé]e|dans la nuit|d[eu] soir[ée]e)s?' - PeriodAmRegex = f'(?d[eu] matin|matin([ée]e)s?' + PeriodDescRegex = '(?pm|am|p\\.m\\.|a\\.m\\.|p)' + PeriodPmRegex = ( + '(?dans l\'apr[eè]s-midi|ce soir|d[eu] soir|dans l[ea] soir[eé]e|dans la nuit|d[eu] soir[ée]e)s?' + ) + PeriodAmRegex = '(?d[eu] matin|matin([ée]e)s?' PureNumFromTo = f'((du|depuis|des?)\\s+)?(?{PeriodDescRegex}))?\\s*{TillRegex}\\s*({HourRegex}|{PeriodHourNumRegex})\\s*(?{PmRegex}|{AmRegex}|{PeriodDescRegex})?' PureNumBetweenAnd = f'(entre\\s+)({HourRegex}|{PeriodHourNumRegex})(\\s*(?{PeriodDescRegex}))?\\s*{RangeConnectorRegex}\\s*({HourRegex}|{PeriodHourNumRegex})\\s*(?{PmRegex}|{AmRegex}|{PeriodDescRegex})?' - SpecificTimeFromTo = f'^\\b$' - SpecificTimeBetweenAnd = f'^\\b$' - PrepositionRegex = f'(?^([aà](\\s+?la)?|en|sur(\\s*l[ea])?|de)$)' - TimeOfDayRegex = f'\\b(?((((dans\\s+(l[ea])?\\s+)?((?d[eé]but(\\s+|-)|t[oô]t(\\s+|-)(l[ea]\\s*)?)|(?fin\\s*|fin de(\\s+(la)?)|tard\\s*))?(matin([ée]e)?|((d|l)?\'?)apr[eè]s[-|\\s*]midi|nuit|soir([eé]e)?)))|(((\\s+(l[ea])?\\s+)?)jour(n[eé]e)?))s?)\\b' - SpecificTimeOfDayRegex = f'\\b(({RelativeRegex}\\s+{TimeOfDayRegex})|({TimeOfDayRegex}\\s*({NextSuffixRegex}))\\b|\\b(du )?soir)s?\\b' + SpecificTimeFromTo = '^\\b$' + SpecificTimeBetweenAnd = '^\\b$' + PrepositionRegex = '(?^([aà](\\s+?la)?|en|sur(\\s*l[ea])?|de)$)' + TimeOfDayRegex = '\\b(?((((dans\\s+(l[ea])?\\s+)?((?d[eé]but(\\s+|-)|t[oô]t(\\s+|-)(l[ea]\\s*)?)|(?fin\\s*|fin de(\\s+(la)?)|tard\\s*))?(matin([ée]e)?|((d|l)?\'?)apr[eè]s[-|\\s*]midi|nuit|soir([eé]e)?)))|(((\\s+(l[ea])?\\s+)?)jour(n[eé]e)?))s?)\\b' + SpecificTimeOfDayRegex = ( + f'\\b(({RelativeRegex}\\s+{TimeOfDayRegex})|({TimeOfDayRegex}\\s*({NextSuffixRegex}))\\b|\\b(du )?soir)s?\\b' + ) TimeFollowedUnit = f'^\\s*{TimeUnitRegex}' TimeNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?){TimeUnitRegex}' - NowRegex = f'\\b(?(ce\\s+)?moment|maintenant|(d[eè]s|aussit[oô]t) que possible|dqp|r[eé]cemment|auparavant|le plus tôt( que)? possible)\\b' - SuffixRegex = f'^\\s*((dans\\s+l[ea]\\s+)|(en\\s+)|(d(u|\\\'))?(matin([eé]e)?|apr[eè]s-midi|soir[eé]e|nuit))\\b' - DateTimeTimeOfDayRegex = f'\\b(?matin([eé]e)?|apr[eè]s-midi|nuit|soir)\\b' - DateTimeSpecificTimeOfDayRegex = f'\\b(({RelativeRegex}\\s+{DateTimeTimeOfDayRegex})\\b|\\b(ce(tte)?\\s+)(soir|nuit))\\b' + NowRegex = '\\b(?(ce\\s+)?moment|maintenant|(d[eè]s|aussit[oô]t) que possible|dqp|r[eé]cemment|auparavant|le plus tôt( que)? possible)\\b' + SuffixRegex = '^\\s*((dans\\s+l[ea]\\s+)|(en\\s+)|(d(u|\\\'))?(matin([eé]e)?|apr[eè]s-midi|soir[eé]e|nuit))\\b' + DateTimeTimeOfDayRegex = '\\b(?matin([eé]e)?|apr[eè]s-midi|nuit|soir)\\b' + DateTimeSpecificTimeOfDayRegex = ( + f'\\b(({RelativeRegex}\\s+{DateTimeTimeOfDayRegex})\\b|\\b(ce(tte)?\\s+)(soir|nuit))\\b' + ) TimeOfTodayAfterRegex = f'^\\s*(,\\s*)?(en|dans|du\\s+)?{DateTimeSpecificTimeOfDayRegex}' TimeOfTodayBeforeRegex = f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|vers|pour))?\\s*$' - SimpleTimeOfTodayAfterRegex = f'({HourNumRegex}|{BaseDateTime.HourRegex})\\s*(,\\s*)?(en|[àa]\\s+)?{DateTimeSpecificTimeOfDayRegex}' - SimpleTimeOfTodayBeforeRegex = f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|vers|pour))?\\s*({HourNumRegex}|{BaseDateTime.HourRegex})' - SpecificEndOfRegex = f'(la\\s+)?fin(\\s+de\\s*|\\s*de*l[ea])?\\s*$' - UnspecificEndOfRegex = f'^\\b$' - UnspecificEndOfRangeRegex = f'^\\b$' - PeriodTimeOfDayRegex = f'\\b((dans\\s+(le)?\\s+)?((?d[eé]but(\\s+|-|d[ue]|de la)|t[oô]t)|(?tard\\s*|fin(\\s+|-|d[eu])?))?(?matin|((d|l)?\'?)apr[eè]s-midi|nuit|soir([eé]e)?))\\b' - PeriodSpecificTimeOfDayRegex = f'\\b(({RelativeRegex}\\s+{PeriodTimeOfDayRegex})\\b|\\b(ce(tte)?\\s+)(soir|nuit))\\b' + SimpleTimeOfTodayAfterRegex = ( + f'({HourNumRegex}|{BaseDateTime.HourRegex})\\s*(,\\s*)?(en|[àa]\\s+)?{DateTimeSpecificTimeOfDayRegex}' + ) + SimpleTimeOfTodayBeforeRegex = ( + f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|vers|pour))?\\s*({HourNumRegex}|{BaseDateTime.HourRegex})' + ) + SpecificEndOfRegex = '(la\\s+)?fin(\\s+de\\s*|\\s*de*l[ea])?\\s*$' + UnspecificEndOfRegex = '^\\b$' + UnspecificEndOfRangeRegex = '^\\b$' + PeriodTimeOfDayRegex = '\\b((dans\\s+(le)?\\s+)?((?d[eé]but(\\s+|-|d[ue]|de la)|t[oô]t)|(?tard\\s*|fin(\\s+|-|d[eu])?))?(?matin|((d|l)?\'?)apr[eè]s-midi|nuit|soir([eé]e)?))\\b' + PeriodSpecificTimeOfDayRegex = ( + f'\\b(({RelativeRegex}\\s+{PeriodTimeOfDayRegex})\\b|\\b(ce(tte)?\\s+)(soir|nuit))\\b' + ) PeriodTimeOfDayWithDateRegex = f'\\b(({TimeOfDayRegex}))\\b' - LessThanRegex = f'^\\b$' - MoreThanRegex = f'^\\b$' - DurationUnitRegex = f'(?ann[eé]es?|ans?|mois|semaines?|jours?|heures?|hrs?|h|minutes?|mins?|secondes?|secs?|journ[eé]e)\\b' - SuffixAndRegex = f'(?\\s*(et)\\s+(une?\\s+)?(?demi|quart))' - PeriodicRegex = f'\\b(?quotidien(ne)?|journellement|mensuel(le)?|jours?|hebdomadaire|bihebdomadaire|annuel(lement)?)\\b' - EachUnitRegex = f'(?(chaque|toutes les|tous les)(?\\s+autres)?\\s*{DurationUnitRegex})' - EachPrefixRegex = f'\\b(?(chaque|tous les|(toutes les))\\s*$)' - SetEachRegex = f'\\b(?(chaque|tous les|(toutes les))\\s*)' - SetLastRegex = f'(?prochain|dernier|derni[eè]re|pass[ée]s|pr[eé]c[eé]dent|courant|en\\s*cours)' - EachDayRegex = f'^\\s*(chaque|tous les)\\s*(jour|jours)\\b' + LessThanRegex = '^\\b$' + MoreThanRegex = '^\\b$' + DurationUnitRegex = ( + "(?ann[eé]es?|ans?|mois|semaines?|jours?|heures?(?!\\s+d\')|hrs?|h|minutes?|mins?|secondes?|secs?|journ[eé]e)\\b" + ) + SuffixAndRegex = '(?\\s*(et)\\s+(une?\\s+)?(?demi|quart))' DurationFollowedUnit = f'^\\s*{SuffixAndRegex}?(\\s+|-)?{DurationUnitRegex}' NumberCombinedWithDurationUnit = f'\\b(?\\d+(\\.\\d*)?)(-)?{DurationUnitRegex}' AnUnitRegex = f'\\b(((?demi\\s+)?(-)\\s+{DurationUnitRegex}))' - DuringRegex = f'^\\b$' - AllRegex = f'\\b(?toute\\s(l[\'ea])\\s?(?ann[eé]e|mois|semaines?|jours?|journ[eé]e))\\b' - HalfRegex = f'((une?\\s*)|\\b)(?demi?(\\s*|-)+(?ann[eé]e|ans?|mois|semaine|jour|heure))\\b' - ConjunctionRegex = f'\\b((et(\\s+de|pour)?)|avec)\\b' + DuringRegex = '^\\b$' + AllRegex = '\\b(?toute\\s(l[\'ea])\\s?(?ann[eé]e|mois|semaines?|jours?|journ[eé]e))\\b' + HalfRegex = '((une?\\s*)|\\b)(?demi?(\\s*|-)+(?ann[eé]e|ans?|mois|semaine|jour|heure))\\b' + ConjunctionRegex = '\\b((et(\\s+de|pour)?)|avec)\\b' HolidayRegex1 = f'\\b(?vendredi saint|mercredi des cendres|p[aâ]ques|l\'action de gr[âa]ce|mardi gras|la saint-sylvestre|la saint sylvestre|la saint-valentin|la saint valentin|nouvel an chinois|nouvel an|r[eé]veillon de nouvel an|jour de l\'an|premier-mai|ler-mai|1-mai|poisson d\'avril|r[eé]veillon de no[eë]l|veille de no[eë]l|noël|noel|thanksgiving|halloween|yuandan)(\\s+((d[ue]\\s+|d\'))?({YearRegex}|({ThisPrefixRegex}\\s+)ann[eé]e|ann[eé]e\\s+({PastSuffixRegex}|{NextSuffixRegex})))?\\b' HolidayRegex2 = f'\\b(?martin luther king|martin luther king jr|toussaint|st patrick|st george|cinco de mayo|l\'ind[eé]pendance(\\s+am[eé]ricaine)?|guy fawkes)(\\s+(de\\s+)?({YearRegex}|{ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+({PastSuffixRegex}|{NextSuffixRegex})))?\\b' HolidayRegex3 = f'(?(jour\\s*(d[eu]|des)\\s*(canberra|p[aâ]ques|colomb|bastille|la prise de la bastille|thanks\\s*giving|bapt[êe]me|nationale|d\'armistice|inaugueration|marmotte|assomption|femme|comm[ée]moratif)))(\\s+(de\\s+)?({YearRegex}|{ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+({PastSuffixRegex}|{NextSuffixRegex})))?' @@ -189,502 +216,541 @@ class FrenchDateTime: TimeTokenPrefix = 'à ' TokenBeforeDate = 'le ' TokenBeforeTime = 'à ' - HalfTokenRegex = f'\\b(demie)$' - QuarterTokenRegex = f'\\b((un\\s+)?quart)$' - ThreeQuarterTokenRegex = f'\\b(trois\\s+quarts)$' - ToTokenRegex = f'\\b(moins|[aà]$)\\b' - AMTimeRegex = f'(?matin([ée]e)?)' - PMTimeRegex = f'\\b(?(d\'|l\')?apr[eè]s-midi|nuit|((\\s*ce|du)\\s+)?soir)\\b' - AsapTimeRegex = f'((d[eè]s|le plus t[oô]t|aussit[oô]t)( que)? possible|dqp)' - BeforeRegex = f'\\b(avant)\\b' - BeforeRegex2 = f'\\b(entre\\s*(le|la(s)?)?)\\b' - AfterRegex = f'\\b(apres)\\b' - SinceRegex = f'\\b(depuis)\\b' - AroundRegex = f'\\b(vers|à\\s+peu\\s+près|environ)\\b' - AgoPrefixRegex = f'\\b(y a)\\b' - LaterRegex = f'\\b(plus\\s+tard|à\\s+partir\\s+(de\\s+(maintenant|demain)|d\'aujourd\'hui)|après\\s+(aujourd\'hui|demain))\\b' + HalfTokenRegex = '\\b(demie)$' + QuarterTokenRegex = '\\b((un\\s+)?quart)$' + ThreeQuarterTokenRegex = '\\b(trois\\s+quarts)$' + ToTokenRegex = '\\b(moins|[aà]$)\\b' + AMTimeRegex = '(?matin([ée]e)?)' + PMTimeRegex = '\\b(?(d\'|l\')?apr[eè]s-midi|nuit|((\\s*ce|du)\\s+)?soir)\\b' + AsapTimeRegex = '((d[eè]s|le plus t[oô]t|aussit[oô]t)( que)? possible|dqp)' + BeforeRegex = '\\b(avant)\\b' + BeforeRegex2 = '\\b(entre\\s*(le|la(s)?)?)\\b' + AfterRegex = '\\b(apres)\\b' + SinceRegex = '\\b(depuis)\\b' + AroundRegex = '\\b(vers|à\\s+peu\\s+près|environ)\\b' + AgoPrefixRegex = '\\b(y a)\\b' + LaterRegex = ( + '\\b(plus\\s+tard|à\\s+partir\\s+(de\\s+(maintenant|demain)|d\'aujourd\'hui)|après\\s+(aujourd\'hui|demain))\\b' + ) AgoRegex = f'\\b((depuis|il\\s+y\\s*a)(\\s+{AroundRegex})?|auparavant|avant\\s+(?hier|aujourd\'hui))\\b' - BeforeAfterRegex = f'^\\b$' - InConnectorRegex = f'\\b(dans|en|sur)\\b' - SinceYearSuffixRegex = f'^\\b$' - WithinNextPrefixRegex = f'\\b(dans\\s+les)\\b' - TodayNowRegex = f'\\b(aujourd\'hui|maintenant)\\b' - MorningStartEndRegex = f'(^(matin))|((matin)$)' - AfternoonStartEndRegex = f'(^((d\'|l\')?apr[eè]s-midi))|(((d\'|l\')?apr[eè]s-midi)$)' - EveningStartEndRegex = f'(^(soir[ée]e|soir))|((soir[ée]e|soir)$)' - NightStartEndRegex = f'(^(nuit))|((nuit)$)' - InexactNumberRegex = f'\\b(quel qu[ée]s|quelqu[ée]s?|plusieurs?|divers)\\b' + BeforeAfterRegex = '^\\b$' + InConnectorRegex = '\\b(dans|en|sur)\\b' + SinceYearSuffixRegex = '^\\b$' + WithinNextPrefixRegex = '\\b(dans\\s+les)\\b' + TodayNowRegex = '\\b(aujourd\'hui|maintenant)\\b' + MorningStartEndRegex = '(^(matin))|((matin)$)' + AfternoonStartEndRegex = '(^((d\'|l\')?apr[eè]s-midi))|(((d\'|l\')?apr[eè]s-midi)$)' + EveningStartEndRegex = '(^(soir[ée]e|soir))|((soir[ée]e|soir)$)' + NightStartEndRegex = '(^(nuit))|((nuit)$)' + InexactNumberRegex = '\\b(quel qu[ée]s|quelqu[ée]s?|plusieurs?|divers)\\b' InexactNumberUnitRegex = f'({InexactNumberRegex})\\s+({DurationUnitRegex})' RelativeTimeUnitRegex = f'(((({ThisPrefixRegex})?)\\s+({TimeUnitRegex}(\\s*{NextSuffixRegex}|{PastSuffixRegex})?))|((le))\\s+({RestrictedTimeUnitRegex}))' RelativeDurationUnitRegex = f'\\b(((?<=({NextSuffixRegex}|{PastSuffixRegex})\\s+)({DurationUnitRegex}))|(({DurationUnitRegex})(\\s+({NextSuffixRegex}|{PastSuffixRegex}))?)|((le|my))\\s+({RestrictedTimeUnitRegex}))\\b' - ReferenceDatePeriodRegex = f'^\\b$' - UpcomingPrefixRegex = f'.^' - NextPrefixRegex = f'.^' - PastPrefixRegex = f'.^' - PreviousPrefixRegex = f'.^' + ReferenceDatePeriodRegex = '^\\b$' + UpcomingPrefixRegex = '.^' + NextPrefixRegex = '.^' + PastPrefixRegex = '.^' + PreviousPrefixRegex = '.^' RelativeDayRegex = f'\\b(((la\\s+)?{RelativeRegex}\\s+journ[ée]e))\\b' - ConnectorRegex = f'^(,|pour|t|vers|le)$' - ConnectorAndRegex = f'\\b(et\\s*(le|las?)?)\\b' - FromRegex = f'((de|du)?)$' - FromRegex2 = f'((depuis|de)(\\s*las?)?)$' - FromToRegex = f'\\b(du|depuis|des?).+(au|à|a)\\b.+' - SingleAmbiguousMonthRegex = f'^(le\\s+)?(may|march)$' - UnspecificDatePeriodRegex = f'^(semaine|mois|an(n[eé]e)?)$' - PrepositionSuffixRegex = f'\\b(du|de|[àa]|vers|dans)$' - FlexibleDayRegex = f'(?([A-Za-z]+\\s)?[A-Za-z\\d]+)' + ConnectorRegex = '^(,|pour|t|vers|le)$' + ConnectorAndRegex = '\\b(et\\s*(le|las?)?)\\b' + FromRegex = '((de|du)?)$' + FromRegex2 = '((depuis|de)(\\s*las?)?)$' + FromToRegex = '\\b(du|depuis|des?).+(au|à|a)\\b.+' + SingleAmbiguousMonthRegex = '^(le\\s+)?(may|march)$' + UnspecificDatePeriodRegex = '^(semaine|mois|an(n[eé]e)?)$' + PrepositionSuffixRegex = '\\b(du|de|[àa]|vers|dans)$' + FlexibleDayRegex = '(?([A-Za-z]+\\s)?[A-Za-z\\d]+)' ForTheRegex = f'\\b(((pour le {FlexibleDayRegex})|(dans (le\\s+)?{FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.|!|\\?|$)))' WeekDayAndDayOfMonthRegex = f'\\b({WeekDayRegex}\\s+(le\\s+{FlexibleDayRegex})|le\\s+(?{DayRegex}|{WrittenDayRegex})\\s+{WeekDayRegex})\\b' - WeekDayAndDayRegex = f'\\b{WeekDayRegex}\\s+(?!(the)){DayRegex}(?!([-:]|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' - RestOfDateRegex = f'\\b(reste|fin)\\s+(d[eu]\\s+)?((le|ce(tte)?)\\s+)?(?semaine|mois|l\'ann[ée]e)\\b' - RestOfDateTimeRegex = f'\\b(reste|fin)\\s+(d[eu]\\s+)?((le|ce(tte)?)\\s+)?(?jour)\\b' - LaterEarlyPeriodRegex = f'^\\b$' - WeekWithWeekDayRangeRegex = f'^\\b$' - GeneralEndingRegex = f'^\\b$' - MiddlePauseRegex = f'^\\b$' - DurationConnectorRegex = f'^\\b$' - PrefixArticleRegex = f'^[\\.]' - OrRegex = f'^\\b$' - YearPlusNumberRegex = f'^\\b$' - NumberAsTimeRegex = f'^\\b$' - TimeBeforeAfterRegex = f'^\\b$' - DateNumberConnectorRegex = f'^\\s*(?\\s+[aà])\\s*$' - DecadeRegex = f'^\\b$' - DecadeWithCenturyRegex = f'^\\b$' - RelativeDecadeRegex = f'^\\b$' + WeekDayAndDayRegex = ( + f'\\b{WeekDayRegex}\\s+(?!(the)){DayRegex}(?!([-:]|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' + ) + RestOfDateRegex = '\\b(reste|fin)\\s+(d[eu]\\s+)?((le|ce(tte)?)\\s+)?(?semaine|mois|l\'ann[ée]e)\\b' + RestOfDateTimeRegex = '\\b(reste|fin)\\s+(d[eu]\\s+)?((le|ce(tte)?)\\s+)?(?jour)\\b' + LaterEarlyPeriodRegex = '^\\b$' + WeekWithWeekDayRangeRegex = '^\\b$' + GeneralEndingRegex = '^\\b$' + MiddlePauseRegex = '^\\b$' + DurationConnectorRegex = '^\\b$' + PrefixArticleRegex = '^[\\.]' + OrRegex = '^\\b$' + YearPlusNumberRegex = '^\\b$' + NumberAsTimeRegex = '^\\b$' + TimeBeforeAfterRegex = '^\\b$' + DateNumberConnectorRegex = '^\\s*(?\\s+[aà])\\s*$' + DecadeRegex = '^\\b$' + DecadeWithCenturyRegex = '^\\b$' + RelativeDecadeRegex = '^\\b$' YearSuffix = f'(,?(\\s*à)?\\s*({DateYearRegex}|{FullTextYearRegex}))' - SuffixAfterRegex = f'^\\b$' + SuffixAfterRegex = '^\\b$' YearPeriodRegex = f'((((du|depuis|des?)\\s+)?{YearRegex}\\s*({TillRegex})\\s*{YearRegex})|(((entre)\\s+){YearRegex}\\s*({RangeConnectorRegex})\\s*{YearRegex}))' - FutureSuffixRegex = f'\\b(dans\\s+le\\s+futur)\\b' + FutureSuffixRegex = '\\b(dans\\s+le\\s+futur)\\b' ModPrefixRegex = f'\\b({RelativeRegex}|{AroundRegex}|{BeforeRegex}|{AfterRegex}|{SinceRegex})\\b' ModSuffixRegex = f'\\b({AgoRegex}|{LaterRegex}|{BeforeAfterRegex}|{FutureSuffixRegex}|{PastSuffixRegex})\\b' - ComplexDatePeriodRegex = f'^\\b$' - AmbiguousPointRangeRegex = f'^(mar\\.?)$' - UnitMap = dict([("annees", "Y"), - ("annee", "Y"), - ("an", "Y"), - ("ans", "Y"), - ("mois", "MON"), - ("semaines", "W"), - ("semaine", "W"), - ("journees", "D"), - ("journee", "D"), - ("jour", "D"), - ("jours", "D"), - ("heures", "H"), - ("heure", "H"), - ("hrs", "H"), - ("hr", "H"), - ("h", "H"), - ("minutes", "M"), - ("minute", "M"), - ("mins", "M"), - ("min", "M"), - ("secondes", "S"), - ("seconde", "S"), - ("secs", "S"), - ("sec", "S")]) - UnitValueMap = dict([("annees", 31536000), - ("annee", 31536000), - ("l'annees", 31536000), - ("l'annee", 31536000), - ("an", 31536000), - ("ans", 31536000), - ("mois", 2592000), - ("semaines", 604800), - ("semaine", 604800), - ("journees", 86400), - ("journee", 86400), - ("jour", 86400), - ("jours", 86400), - ("heures", 3600), - ("heure", 3600), - ("hrs", 3600), - ("hr", 3600), - ("h", 3600), - ("minutes", 60), - ("minute", 60), - ("mins", 60), - ("min", 60), - ("secondes", 1), - ("seconde", 1), - ("secs", 1), - ("sec", 1)]) + ComplexDatePeriodRegex = '^\\b$' + AmbiguousPointRangeRegex = '^(mar\\.?)$' + UnitMap = dict( + [ + ("annees", "Y"), + ("annee", "Y"), + ("an", "Y"), + ("ans", "Y"), + ("mois", "MON"), + ("semaines", "W"), + ("semaine", "W"), + ("journees", "D"), + ("journee", "D"), + ("jour", "D"), + ("jours", "D"), + ("heures", "H"), + ("heure", "H"), + ("hrs", "H"), + ("hr", "H"), + ("h", "H"), + ("minutes", "M"), + ("minute", "M"), + ("mins", "M"), + ("min", "M"), + ("secondes", "S"), + ("seconde", "S"), + ("secs", "S"), + ("sec", "S"), + ] + ) + UnitValueMap = dict( + [ + ("annees", 31536000), + ("annee", 31536000), + ("l'annees", 31536000), + ("l'annee", 31536000), + ("an", 31536000), + ("ans", 31536000), + ("mois", 2592000), + ("semaines", 604800), + ("semaine", 604800), + ("journees", 86400), + ("journee", 86400), + ("jour", 86400), + ("jours", 86400), + ("heures", 3600), + ("heure", 3600), + ("hrs", 3600), + ("hr", 3600), + ("h", 3600), + ("minutes", 60), + ("minute", 60), + ("mins", 60), + ("min", 60), + ("secondes", 1), + ("seconde", 1), + ("secs", 1), + ("sec", 1), + ] + ) SpecialYearPrefixesMap = dict([("", "")]) - SeasonMap = dict([("printemps", "SP"), - ("été", "SU"), - ("automne", "FA"), - ("hiver", "WI")]) - SeasonValueMap = dict([("SP", 3), - ("SU", 6), - ("FA", 9), - ("WI", 12)]) - CardinalMap = dict([("premier", 1), - ("1er", 1), - ("deuxième", 2), - ("2e", 2), - ("troisième", 3), - ("troisieme", 3), - ("3e", 3), - ("quatrième", 4), - ("4e", 4), - ("cinqième", 5), - ("5e", 5)]) - DayOfWeek = dict([("lundi", 1), - ("mardi", 2), - ("mercredi", 3), - ("jeudi", 4), - ("vendredi", 5), - ("samedi", 6), - ("dimanche", 0), - ("lun", 1), - ("mar", 2), - ("mer", 3), - ("jeu", 4), - ("ven", 5), - ("sam", 6), - ("dim", 0), - ("lun.", 1), - ("mar.", 2), - ("mer.", 3), - ("jeu.", 4), - ("ven.", 5), - ("sam.", 6), - ("dim.", 0)]) - MonthOfYear = dict([("janvier", 1), - ("fevrier", 2), - ("février", 2), - ("mars", 3), - ("mar", 3), - ("mar.", 3), - ("avril", 4), - ("avr", 4), - ("avr.", 4), - ("mai", 5), - ("juin", 6), - ("jun", 6), - ("jun.", 6), - ("juillet", 7), - ("aout", 8), - ("août", 8), - ("septembre", 9), - ("octobre", 10), - ("novembre", 11), - ("decembre", 12), - ("décembre", 12), - ("janv", 1), - ("janv.", 1), - ("jan", 1), - ("jan.", 1), - ("fevr", 2), - ("fevr.", 2), - ("févr.", 2), - ("févr", 2), - ("fev", 2), - ("fev.", 2), - ("juil", 7), - ("jul", 7), - ("jul.", 7), - ("sep", 9), - ("sep.", 9), - ("sept.", 9), - ("sept", 9), - ("oct", 10), - ("oct.", 10), - ("nov", 11), - ("nov.", 11), - ("dec", 12), - ("dec.", 12), - ("déc.", 12), - ("déc", 12), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9)]) - Numbers = dict([("zero", 0), - ("un", 1), - ("une", 1), - ("a", 1), - ("deux", 2), - ("trois", 3), - ("quatre", 4), - ("cinq", 5), - ("six", 6), - ("sept", 7), - ("huit", 8), - ("neuf", 9), - ("dix", 10), - ("onze", 11), - ("douze", 12), - ("treize", 13), - ("quatorze", 14), - ("quinze", 15), - ("seize", 16), - ("dix-sept", 17), - ("dix-huit", 18), - ("dix-neuf", 19), - ("vingt-et-un", 21), - ("vingt et un", 21), - ("vingt", 20), - ("vingt deux", 22), - ("vingt-deux", 22), - ("vingt trois", 23), - ("vingt-trois", 23), - ("vingt quatre", 24), - ("vingt-quatre", 24), - ("vingt cinq", 25), - ("vingt-cinq", 25), - ("vingt six", 26), - ("vingt-six", 26), - ("vingt sept", 27), - ("vingt-sept", 27), - ("vingt huit", 28), - ("vingt-huit", 28), - ("vingt neuf", 29), - ("vingt-neuf", 29), - ("trente", 30), - ("trente et un", 31), - ("trente-et-un", 31), - ("trente deux", 32), - ("trente-deux", 32), - ("trente trois", 33), - ("trente-trois", 33), - ("trente quatre", 34), - ("trente-quatre", 34), - ("trente cinq", 35), - ("trente-cinq", 35), - ("trente six", 36), - ("trente-six", 36), - ("trente sept", 37), - ("trente-sept", 37), - ("trente huit", 38), - ("trente-huit", 38), - ("trente neuf", 39), - ("trente-neuf", 39), - ("quarante", 40), - ("quarante et un", 41), - ("quarante-et-un", 41), - ("quarante deux", 42), - ("quarante-duex", 42), - ("quarante trois", 43), - ("quarante-trois", 43), - ("quarante quatre", 44), - ("quarante-quatre", 44), - ("quarante cinq", 45), - ("quarante-cinq", 45), - ("quarante six", 46), - ("quarante-six", 46), - ("quarante sept", 47), - ("quarante-sept", 47), - ("quarante huit", 48), - ("quarante-huit", 48), - ("quarante neuf", 49), - ("quarante-neuf", 49), - ("cinquante", 50), - ("cinquante et un", 51), - ("cinquante-et-un", 51), - ("cinquante deux", 52), - ("cinquante-deux", 52), - ("cinquante trois", 53), - ("cinquante-trois", 53), - ("cinquante quatre", 54), - ("cinquante-quatre", 54), - ("cinquante cinq", 55), - ("cinquante-cinq", 55), - ("cinquante six", 56), - ("cinquante-six", 56), - ("cinquante sept", 57), - ("cinquante-sept", 57), - ("cinquante huit", 58), - ("cinquante-huit", 58), - ("cinquante neuf", 59), - ("cinquante-neuf", 59), - ("soixante", 60), - ("soixante et un", 61), - ("soixante-et-un", 61), - ("soixante deux", 62), - ("soixante-deux", 62), - ("soixante trois", 63), - ("soixante-trois", 63), - ("soixante quatre", 64), - ("soixante-quatre", 64), - ("soixante cinq", 65), - ("soixante-cinq", 65), - ("soixante six", 66), - ("soixante-six", 66), - ("soixante sept", 67), - ("soixante-sept", 67), - ("soixante huit", 68), - ("soixante-huit", 68), - ("soixante neuf", 69), - ("soixante-neuf", 69), - ("soixante dix", 70), - ("soixante-dix", 70), - ("soixante et onze", 71), - ("soixante-et-onze", 71), - ("soixante douze", 72), - ("soixante-douze", 72), - ("soixante treize", 73), - ("soixante-treize", 73), - ("soixante quatorze", 74), - ("soixante-quatorze", 74), - ("soixante quinze", 75), - ("soixante-quinze", 75), - ("soixante seize", 76), - ("soixante-seize", 76), - ("soixante dix sept", 77), - ("soixante-dix-sept", 77), - ("soixante dix huit", 78), - ("soixante-dix-huit", 78), - ("soixante dix neuf", 79), - ("soixante-dix-neuf", 79), - ("quatre vingt", 80), - ("quatre-vingt", 80), - ("quatre vingt un", 81), - ("quatre-vingt-un", 81), - ("quatre vingt deux", 82), - ("quatre-vingt-duex", 82), - ("quatre vingt trois", 83), - ("quatre-vingt-trois", 83), - ("quatre vingt quatre", 84), - ("quatre-vingt-quatre", 84), - ("quatre vingt cinq", 85), - ("quatre-vingt-cinq", 85), - ("quatre vingt six", 86), - ("quatre-vingt-six", 86), - ("quatre vingt sept", 87), - ("quatre-vingt-sept", 87), - ("quatre vingt huit", 88), - ("quatre-vingt-huit", 88), - ("quatre vingt neuf", 89), - ("quatre-vingt-neuf", 89), - ("quatre vingt dix", 90), - ("quatre-vingt-dix", 90), - ("quatre vingt onze", 91), - ("quatre-vingt-onze", 91), - ("quatre vingt douze", 92), - ("quatre-vingt-douze", 92), - ("quatre vingt treize", 93), - ("quatre-vingt-treize", 93), - ("quatre vingt quatorze", 94), - ("quatre-vingt-quatorze", 94), - ("quatre vingt quinze", 95), - ("quatre-vingt-quinze", 95), - ("quatre vingt seize", 96), - ("quatre-vingt-seize", 96), - ("quatre vingt dix sept", 97), - ("quatre-vingt-dix-sept", 97), - ("quatre vingt dix huit", 98), - ("quatre-vingt-dix-huit", 98), - ("quatre vingt dix neuf", 99), - ("quatre-vingt-dix-neuf", 99), - ("cent", 100)]) - DayOfMonth = dict([("1er", 1), - ("2e", 2), - ("3e", 3), - ("4e", 4), - ("5e", 5), - ("6e", 6), - ("7e", 7), - ("8e", 8), - ("9e", 9), - ("10e", 10), - ("11e", 11), - ("12e", 12), - ("13e", 13), - ("14e", 14), - ("15e", 15), - ("16e", 16), - ("17e", 17), - ("18e", 18), - ("19e", 19), - ("20e", 20), - ("21e", 21), - ("22e", 22), - ("23e", 23), - ("24e", 24), - ("25e", 25), - ("26e", 26), - ("27e", 27), - ("28e", 28), - ("29e", 29), - ("30e", 30), - ("31e", 31)]) - DoubleNumbers = dict([("demi", 0.5), - ("quart", 0.25)]) - HolidayNames = dict([("fathers", ["peres", "p\u00e8res", "f\u00eatedesp\u00e8res", "fetedesperes"]), - ("mothers", ["f\u00eatedesm\u00e8res", "fetedesmeres"]), - ("thanksgiving", ["lactiondegrace", "lactiondegr\u00e2ce", "jourdethanksgiving", "thanksgiving"]), - ("martinlutherking", ["journeemartinlutherking", "martinlutherkingjr"]), - ("washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]), - ("canberra", ["canberraday"]), - ("labour", ["fetedetravail", "travail", "fetedutravail"]), - ("columbus", ["columbusday"]), - ("memorial", ["jourcomm\u00e9moratif", "jourcommemoratif"]), - ("yuandan", ["yuandan", "nouvelanchinois"]), - ("maosbirthday", ["maosbirthday"]), - ("teachersday", ["teachersday", "teacherday"]), - ("singleday", ["singleday"]), - ("allsaintsday", ["allsaintsday"]), - ("youthday", ["youthday"]), - ("childrenday", ["childrenday", "childday"]), - ("femaleday", ["femaleday"]), - ("treeplantingday", ["treeplantingday"]), - ("arborday", ["arborday"]), - ("girlsday", ["girlsday"]), - ("whiteloverday", ["whiteloverday"]), - ("loverday", ["loverday"]), - ("christmas", ["noel", "no\u00ebl"]), - ("xmas", ["xmas"]), - ("newyear", ["nouvellesannees", "nouvelan"]), - ("newyearday", ["jourdunouvelan"]), - ("newyearsday", ["jourdel'an", "jourpremierdelannee", "jourpremierdelann\u00e9e"]), - ("inaugurationday", ["jourd'inaugueration", "inaugueration"]), - ("groundhougday", ["marmotte"]), - ("valentinesday", ["lasaint-valentin", "lasaintvalentin"]), - ("stpatrickday", ["stpatrickday"]), - ("aprilfools", ["poissond'avril"]), - ("stgeorgeday", ["stgeorgeday"]), - ("mayday", ["premier-mai", "ler-mai", "1-mai"]), - ("cincodemayoday", ["cincodemayo"]), - ("baptisteday", ["bapteme", "bapt\u00eame"]), - ("usindependenceday", ["l'independanceamericaine", "lind\u00e9pendanceam\u00e9ricaine"]), - ("independenceday", ["l'ind\u00e9pendance", "lindependance"]), - ("bastilleday", ["laprisedelabastille", "bastille"]), - ("halloweenday", ["halloween"]), - ("allhallowday", ["allhallowday"]), - ("allsoulsday", ["allsoulsday"]), - ("guyfawkesday", ["guyfawkesday"]), - ("veteransday", ["veteransday"]), - ("christmaseve", ["reveillondenoel", "r\u00e9veillondeno\u00ebl", "veilledenoel", "veilledeno\u00ebl"]), - ("newyeareve", ["r\u00e9veillondenouvelan", "reveillondenouvelan", "lasaint-sylvestre", "lasaintsylvestre"])]) - NightRegex = f'\\b(minuit|nuit)\\b' + SeasonMap = dict([("printemps", "SP"), ("été", "SU"), ("automne", "FA"), ("hiver", "WI")]) + SeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + CardinalMap = dict( + [ + ("premier", 1), + ("1er", 1), + ("deuxième", 2), + ("2e", 2), + ("troisième", 3), + ("troisieme", 3), + ("3e", 3), + ("quatrième", 4), + ("4e", 4), + ("cinqième", 5), + ("5e", 5), + ] + ) + DayOfWeek = dict( + [ + ("lundi", 1), + ("mardi", 2), + ("mercredi", 3), + ("jeudi", 4), + ("vendredi", 5), + ("samedi", 6), + ("dimanche", 0), + ("lun", 1), + ("mar", 2), + ("mer", 3), + ("jeu", 4), + ("ven", 5), + ("sam", 6), + ("dim", 0), + ("lun.", 1), + ("mar.", 2), + ("mer.", 3), + ("jeu.", 4), + ("ven.", 5), + ("sam.", 6), + ("dim.", 0), + ] + ) + MonthOfYear = dict( + [ + ("janvier", 1), + ("fevrier", 2), + ("février", 2), + ("mars", 3), + ("mar", 3), + ("mar.", 3), + ("avril", 4), + ("avr", 4), + ("avr.", 4), + ("mai", 5), + ("juin", 6), + ("jun", 6), + ("jun.", 6), + ("juillet", 7), + ("aout", 8), + ("août", 8), + ("septembre", 9), + ("octobre", 10), + ("novembre", 11), + ("decembre", 12), + ("décembre", 12), + ("janv", 1), + ("janv.", 1), + ("jan", 1), + ("jan.", 1), + ("fevr", 2), + ("fevr.", 2), + ("févr.", 2), + ("févr", 2), + ("fev", 2), + ("fev.", 2), + ("juil", 7), + ("jul", 7), + ("jul.", 7), + ("sep", 9), + ("sep.", 9), + ("sept.", 9), + ("sept", 9), + ("oct", 10), + ("oct.", 10), + ("nov", 11), + ("nov.", 11), + ("dec", 12), + ("dec.", 12), + ("déc.", 12), + ("déc", 12), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ] + ) + Numbers = dict( + [ + ("zero", 0), + ("un", 1), + ("une", 1), + ("a", 1), + ("deux", 2), + ("trois", 3), + ("quatre", 4), + ("cinq", 5), + ("six", 6), + ("sept", 7), + ("huit", 8), + ("neuf", 9), + ("dix", 10), + ("onze", 11), + ("douze", 12), + ("treize", 13), + ("quatorze", 14), + ("quinze", 15), + ("seize", 16), + ("dix-sept", 17), + ("dix-huit", 18), + ("dix-neuf", 19), + ("vingt-et-un", 21), + ("vingt et un", 21), + ("vingt", 20), + ("vingt deux", 22), + ("vingt-deux", 22), + ("vingt trois", 23), + ("vingt-trois", 23), + ("vingt quatre", 24), + ("vingt-quatre", 24), + ("vingt cinq", 25), + ("vingt-cinq", 25), + ("vingt six", 26), + ("vingt-six", 26), + ("vingt sept", 27), + ("vingt-sept", 27), + ("vingt huit", 28), + ("vingt-huit", 28), + ("vingt neuf", 29), + ("vingt-neuf", 29), + ("trente", 30), + ("trente et un", 31), + ("trente-et-un", 31), + ("trente deux", 32), + ("trente-deux", 32), + ("trente trois", 33), + ("trente-trois", 33), + ("trente quatre", 34), + ("trente-quatre", 34), + ("trente cinq", 35), + ("trente-cinq", 35), + ("trente six", 36), + ("trente-six", 36), + ("trente sept", 37), + ("trente-sept", 37), + ("trente huit", 38), + ("trente-huit", 38), + ("trente neuf", 39), + ("trente-neuf", 39), + ("quarante", 40), + ("quarante et un", 41), + ("quarante-et-un", 41), + ("quarante deux", 42), + ("quarante-duex", 42), + ("quarante trois", 43), + ("quarante-trois", 43), + ("quarante quatre", 44), + ("quarante-quatre", 44), + ("quarante cinq", 45), + ("quarante-cinq", 45), + ("quarante six", 46), + ("quarante-six", 46), + ("quarante sept", 47), + ("quarante-sept", 47), + ("quarante huit", 48), + ("quarante-huit", 48), + ("quarante neuf", 49), + ("quarante-neuf", 49), + ("cinquante", 50), + ("cinquante et un", 51), + ("cinquante-et-un", 51), + ("cinquante deux", 52), + ("cinquante-deux", 52), + ("cinquante trois", 53), + ("cinquante-trois", 53), + ("cinquante quatre", 54), + ("cinquante-quatre", 54), + ("cinquante cinq", 55), + ("cinquante-cinq", 55), + ("cinquante six", 56), + ("cinquante-six", 56), + ("cinquante sept", 57), + ("cinquante-sept", 57), + ("cinquante huit", 58), + ("cinquante-huit", 58), + ("cinquante neuf", 59), + ("cinquante-neuf", 59), + ("soixante", 60), + ("soixante et un", 61), + ("soixante-et-un", 61), + ("soixante deux", 62), + ("soixante-deux", 62), + ("soixante trois", 63), + ("soixante-trois", 63), + ("soixante quatre", 64), + ("soixante-quatre", 64), + ("soixante cinq", 65), + ("soixante-cinq", 65), + ("soixante six", 66), + ("soixante-six", 66), + ("soixante sept", 67), + ("soixante-sept", 67), + ("soixante huit", 68), + ("soixante-huit", 68), + ("soixante neuf", 69), + ("soixante-neuf", 69), + ("soixante dix", 70), + ("soixante-dix", 70), + ("soixante et onze", 71), + ("soixante-et-onze", 71), + ("soixante douze", 72), + ("soixante-douze", 72), + ("soixante treize", 73), + ("soixante-treize", 73), + ("soixante quatorze", 74), + ("soixante-quatorze", 74), + ("soixante quinze", 75), + ("soixante-quinze", 75), + ("soixante seize", 76), + ("soixante-seize", 76), + ("soixante dix sept", 77), + ("soixante-dix-sept", 77), + ("soixante dix huit", 78), + ("soixante-dix-huit", 78), + ("soixante dix neuf", 79), + ("soixante-dix-neuf", 79), + ("quatre vingt", 80), + ("quatre-vingt", 80), + ("quatre vingt un", 81), + ("quatre-vingt-un", 81), + ("quatre vingt deux", 82), + ("quatre-vingt-duex", 82), + ("quatre vingt trois", 83), + ("quatre-vingt-trois", 83), + ("quatre vingt quatre", 84), + ("quatre-vingt-quatre", 84), + ("quatre vingt cinq", 85), + ("quatre-vingt-cinq", 85), + ("quatre vingt six", 86), + ("quatre-vingt-six", 86), + ("quatre vingt sept", 87), + ("quatre-vingt-sept", 87), + ("quatre vingt huit", 88), + ("quatre-vingt-huit", 88), + ("quatre vingt neuf", 89), + ("quatre-vingt-neuf", 89), + ("quatre vingt dix", 90), + ("quatre-vingt-dix", 90), + ("quatre vingt onze", 91), + ("quatre-vingt-onze", 91), + ("quatre vingt douze", 92), + ("quatre-vingt-douze", 92), + ("quatre vingt treize", 93), + ("quatre-vingt-treize", 93), + ("quatre vingt quatorze", 94), + ("quatre-vingt-quatorze", 94), + ("quatre vingt quinze", 95), + ("quatre-vingt-quinze", 95), + ("quatre vingt seize", 96), + ("quatre-vingt-seize", 96), + ("quatre vingt dix sept", 97), + ("quatre-vingt-dix-sept", 97), + ("quatre vingt dix huit", 98), + ("quatre-vingt-dix-huit", 98), + ("quatre vingt dix neuf", 99), + ("quatre-vingt-dix-neuf", 99), + ("cent", 100), + ] + ) + DayOfMonth = dict( + [ + ("1er", 1), + ("2e", 2), + ("3e", 3), + ("4e", 4), + ("5e", 5), + ("6e", 6), + ("7e", 7), + ("8e", 8), + ("9e", 9), + ("10e", 10), + ("11e", 11), + ("12e", 12), + ("13e", 13), + ("14e", 14), + ("15e", 15), + ("16e", 16), + ("17e", 17), + ("18e", 18), + ("19e", 19), + ("20e", 20), + ("21e", 21), + ("22e", 22), + ("23e", 23), + ("24e", 24), + ("25e", 25), + ("26e", 26), + ("27e", 27), + ("28e", 28), + ("29e", 29), + ("30e", 30), + ("31e", 31), + ] + ) + DoubleNumbers = dict([("demi", 0.5), ("quart", 0.25)]) + HolidayNames = dict( + [ + ("fathers", ["peres", "p\u00e8res", "f\u00eatedesp\u00e8res", "fetedesperes"]), + ("mothers", ["f\u00eatedesm\u00e8res", "fetedesmeres"]), + ("thanksgiving", ["lactiondegrace", "lactiondegr\u00e2ce", "jourdethanksgiving", "thanksgiving"]), + ("martinlutherking", ["journeemartinlutherking", "martinlutherkingjr"]), + ("washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]), + ("canberra", ["canberraday"]), + ("labour", ["fetedetravail", "travail", "fetedutravail"]), + ("columbus", ["columbusday"]), + ("memorial", ["jourcomm\u00e9moratif", "jourcommemoratif"]), + ("yuandan", ["yuandan", "nouvelanchinois"]), + ("maosbirthday", ["maosbirthday"]), + ("teachersday", ["teachersday", "teacherday"]), + ("singleday", ["singleday"]), + ("allsaintsday", ["allsaintsday"]), + ("youthday", ["youthday"]), + ("childrenday", ["childrenday", "childday"]), + ("femaleday", ["femaleday"]), + ("treeplantingday", ["treeplantingday"]), + ("arborday", ["arborday"]), + ("girlsday", ["girlsday"]), + ("whiteloverday", ["whiteloverday"]), + ("loverday", ["loverday"]), + ("christmas", ["noel", "no\u00ebl"]), + ("xmas", ["xmas"]), + ("newyear", ["nouvellesannees", "nouvelan"]), + ("newyearday", ["jourdunouvelan"]), + ("newyearsday", ["jourdel'an", "jourpremierdelannee", "jourpremierdelann\u00e9e"]), + ("inaugurationday", ["jourd'inaugueration", "inaugueration"]), + ("groundhougday", ["marmotte"]), + ("valentinesday", ["lasaint-valentin", "lasaintvalentin"]), + ("stpatrickday", ["stpatrickday"]), + ("aprilfools", ["poissond'avril"]), + ("stgeorgeday", ["stgeorgeday"]), + ("mayday", ["premier-mai", "ler-mai", "1-mai"]), + ("cincodemayoday", ["cincodemayo"]), + ("baptisteday", ["bapteme", "bapt\u00eame"]), + ("usindependenceday", ["l'independanceamericaine", "lind\u00e9pendanceam\u00e9ricaine"]), + ("independenceday", ["l'ind\u00e9pendance", "lindependance"]), + ("bastilleday", ["laprisedelabastille", "bastille"]), + ("halloweenday", ["halloween"]), + ("allhallowday", ["allhallowday"]), + ("allsoulsday", ["allsoulsday"]), + ("guyfawkesday", ["guyfawkesday"]), + ("veteransday", ["veteransday"]), + ("christmaseve", ["reveillondenoel", "r\u00e9veillondeno\u00ebl", "veilledenoel", "veilledeno\u00ebl"]), + ( + "newyeareve", + ["r\u00e9veillondenouvelan", "reveillondenouvelan", "lasaint-sylvestre", "lasaintsylvestre"], + ), + ] + ) + NightRegex = '\\b(minuit|nuit)\\b' WrittenDecades = dict([("", 0)]) SpecialDecadeCases = dict([("", 0)]) DefaultLanguageFallback = 'DMY' DurationDateRestrictions = [] - AmbiguityFiltersDict = dict([("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), - ("^([eé]t[eé])$", "(?zu|bis\\s*zum|zum|bis|bis\\s*hin(\\s*zum)?|--|-|—|——)' - RangeConnectorRegex = f'(?und|--|-|—|——)' - RelativeRegex = f'\\b(?(über)?nächste[rmns]?|kommende[rns]?|diese[rmns]?|vorletzte[snm]?|letzte[rmns]?|vergangene[rns]?|vorherige[rns]?|vorige[rns]?|jetzige[rns]?|heutige[rns]?|aktuelle[rns]?|gestrige[rns]?|morgige[rns]?|de[rmsn]|das(?!\\s+tag)|am)' - StrictRelativeRegex = f'\\b(?(über)?nächste[rmns]?|kommende[rns]?|diese[rmns]?|letzte[rmns]?|vergangene[rns]?|vorherige[rns]?|vorige[rns]?|jetzige[rns]?|heutige[rns]?|aktuelle[rns]?|gestrige[rns]?|morgige[rns]?)' - UpcomingPrefixRegex = f'.^' + TillRegex = '(?zu|bis\\s*zum|zum|bis|bis\\s*hin(\\s*zum)?|--|-|—|——)' + RangeConnectorRegex = '(?und|--|-|—|——)' + RelativeRegex = '\\b(?(über)?nächste[rmns]?|kommende[rns]?|diese[rmns]?|vorletzte[snm]?|letzte[rmns]?|vergangene[rns]?|vorherige[rns]?|vorige[rns]?|jetzige[rns]?|heutige[rns]?|aktuelle[rns]?|gestrige[rns]?|morgige[rns]?|de[rmsn]|das(?!\\s+tag)|am)' + StrictRelativeRegex = '\\b(?(über)?nächste[rmns]?|kommende[rns]?|diese[rmns]?|letzte[rmns]?|vergangene[rns]?|vorherige[rns]?|vorige[rns]?|jetzige[rns]?|heutige[rns]?|aktuelle[rns]?|gestrige[rns]?|morgige[rns]?)' + UpcomingPrefixRegex = '.^' NextPrefixRegex = f'\\b((über)?nächste[rmns]?|kommende[rns]?|{UpcomingPrefixRegex})\\b' - AfterNextPrefixRegex = f'\\bübernächste[rmns]?\\b' - PastPrefixRegex = f'.^' + AfterNextPrefixRegex = '\\bübernächste[rmns]?\\b' + PastPrefixRegex = '.^' PreviousPrefixRegex = f'\\b(letzte[rmns]?|vergangene[rns]?|vorherige[rns]?|vor(ige[rns]?)?|{PastPrefixRegex})\\b' - ThisPrefixRegex = f'\\b(diese[rnms]?|jetzige[rns]?|heutige[rns]?|aktuelle[rns]?)\\b' - RangePrefixRegex = f'(vo[nm]|zwischen)' - PenultimatePrefixRegex = f'\\b(vorletzte[snm]?)\\b' - WrittenOneToNineRegex = f'(eins?|zw(een|ei|o)|drei|vier|fünf|fuenf|sechs|sieben|acht|neun)' - DayRegex = f'(de[rmsn]\\s*)?(?(01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(\\.|\\b))' + ThisPrefixRegex = '\\b(diese[rnms]?|jetzige[rns]?|heutige[rns]?|aktuelle[rns]?)\\b' + RangePrefixRegex = '(vo[nm]|zwischen)' + PenultimatePrefixRegex = '\\b(vorletzte[snm]?)\\b' + WrittenOneToNineRegex = '(eins?|zw(een|ei|o)|drei|vier|fünf|fuenf|sechs|sieben|acht|neun)' + DayRegex = '(de[rmsn]\\s*)?(?(01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(\\.|\\b))' WrittenDayNumRegex = f'\\b(de[rmsn]\\s+)?(?erst|zweit|dritt|viert|fünft|fuenft|sechst|siebt|acht|neunt|zehnt|elft|zwölft|zwoelft|dreizehnt|vierzehnt|fünfzehnt|fuenfzehnt|sechzehnt|siebzehnt|achtzehnt|neunzehnt|({WrittenOneToNineRegex}und)?zwanzigst|(einund)?dreißigst)e[nr]\\b' - MonthNumRegex = f'(?(01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)(\\.|\\b))' - WrittenMonthNumRegex = f'\\b(?erst|zweit|dritt|viert|fünft|fuenft|sechst|siebt|acht|neunt|zehnt|elft|zw(ö|oe)lft)e[nr]\\b' + MonthNumRegex = '(?(01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)(\\.|\\b))' + WrittenMonthNumRegex = ( + '\\b(?erst|zweit|dritt|viert|fünft|fuenft|sechst|siebt|acht|neunt|zehnt|elft|zw(ö|oe)lft)e[nr]\\b' + ) AmDescRegex = f'({BaseDateTime.BaseAmDescRegex})' PmDescRegex = f'({BaseDateTime.BasePmDescRegex})' AmPmDescRegex = f'({BaseDateTime.BaseAmPmDescRegex})' - OclockRegex = f'(?uhr)' + OclockRegex = '(?uhr)' DescRegex = f'({OclockRegex})' TwoDigitYearRegex = f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d)))\\b' - CenturyRegex = f'\\b(?((ein|zwei)?tausend(und)?)?((ein|zwei|drei|vier|fünf|sechs|sieben|acht|neun|zehn|elf|zwölf|dreizehn|vierzehn|fünfzehn|sechzehn|siebzehn|achtzehn|neunzehn)hundert))\\b' + CenturyRegex = '\\b(?((ein|zwei)?tausend(und)?)?((ein|zwei|drei|vier|fünf|sechs|sieben|acht|neun|zehn|elf|zwölf|dreizehn|vierzehn|fünfzehn|sechzehn|siebzehn|achtzehn|neunzehn)hundert))\\b' WrittenNumRegex = f'(zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|sechzehn|siebzehn|achtzehn|neunzehn|zwanzig|dreißig|vierzig|fünfzig|sechzig|siebzig|achtzig|neunzig|elf|zehn|{WrittenOneToNineRegex})' FullTextYearRegex = f'\\b((?{CenturyRegex})\\s+(?((zwanzig|dreißig|vierzig|fünfzig|sechzig|siebzig|achtzig|neunzig)\\s+{WrittenNumRegex})|{WrittenNumRegex}))\\b|\\b(?{CenturyRegex})\\b' YearRegex = f'({BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' - WeekDayRegex = f'(?sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonnabend|(mo|di|mi|do|fr|sa|so)(\\.|\\b))' - SingleWeekDayRegex = f'\\b(?sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonnabend|(mo|di|mi|do|fr|sa|so)(\\.|\\b))' + WeekDayRegex = '(?sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonnabend|(mo|di|mi|do|fr|sa|so)(\\.|\\b))' + SingleWeekDayRegex = '\\b(?sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonnabend|(mo|di|mi|do|fr|sa|so)(\\.|\\b))' RelativeMonthRegex = f'(?{RelativeRegex}\\s+monat(s)?)' - WrittenMonthRegex = f'((monat\\s*)?(?apr(il|\\.)|aug(ust|\\.)|dez(ember|\\.)|feb(ruar|ber|\\.)|j[äa]n(uar|ner|\\.)|jul(e?i|l\\.)|jun([io]|\\.)|märz|mai|nov(ember|\\.)|okt(ober|\\.)|sept?(ember|\\.)))' + WrittenMonthRegex = '((monat\\s*)?(?apr(il|\\.)|aug(ust|\\.)|dez(ember|\\.)|feb(ruar|ber|\\.)|j[äa]n(uar|ner|\\.)|jul(e?i|l\\.)|jun([io]|\\.)|märz|mai|nov(ember|\\.)|okt(ober|\\.)|sept?(ember|\\.)))' MonthSuffixRegex = f'(?(im\\s*|des\\s*)?({RelativeMonthRegex}|{WrittenMonthRegex}|{MonthNumRegex}))' - DateUnitRegex = f'(?tg|woche(?n)?|(jahr|monat|tag)(?e)?)(s)?' - HalfTokenRegex = f'^(halb)' - QuarterToTokenRegex = f'^(viertel\\s+vor|dreiviertel)\\s*$' - QuarterPastTokenRegex = f'^(viertel\\s+nach)\\s*$' - ThreeQuarterToTokenRegex = f'^(viertel|dreiviertel\\s+vor)\\s*$' - ThreeQuarterPastTokenRegex = f'^(dreiviertel\\s+nach)\\s*$' + DateUnitRegex = '(?tg|woche(?n)?|(jahr|monat|tag)(?e)?)(s)?' + HalfTokenRegex = '^(halb)' + QuarterToTokenRegex = '^(viertel\\s+vor|dreiviertel)\\s*$' + QuarterPastTokenRegex = '^(viertel\\s+nach)\\s*$' + ThreeQuarterToTokenRegex = '^(viertel|dreiviertel\\s+vor)\\s*$' + ThreeQuarterPastTokenRegex = '^(dreiviertel\\s+nach)\\s*$' SimpleCasesRegex = f'((vom|zwischen)\\s+)?({DayRegex})(\\s*{MonthSuffixRegex})?\\s*{TillRegex}\\s*({DayRegex})(\\s*{MonthSuffixRegex})?((\\s+|\\s*,\\s*){YearRegex})?' MonthFrontSimpleCasesRegex = f'((vom|zwischen)\\s*)?{MonthSuffixRegex}\\s*((vom|zwischen)\\s*)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?' MonthFrontBetweenRegex = f'({MonthSuffixRegex}\\s+(zwischen\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?)' BetweenRegex = f'((zwischen\\s+)({DayRegex})(\\s+{MonthSuffixRegex})?\\s*{RangeConnectorRegex}\\s*({DayRegex})(\\s+{MonthSuffixRegex})((\\s+|\\s*,\\s*){YearRegex})?|(zwischen\\s+)({DayRegex})(\\s+{MonthSuffixRegex})?\\s*{RangeConnectorRegex}\\s*({DayRegex})(\\s+{MonthSuffixRegex})?((\\s+|\\s*,\\s*){YearRegex})?)' - MonthWithYear = f'\\b((?apr(il|\\.)|aug(ust|\\.)|dez(ember|\\.)|feb(ruar|ber|\\.)|januar|j[äa]n(ner|\\.)|jul(e?i|l\\.)|jun([io]|\\.)|märz|mai|nov(ember|\\.)|okt(ober|\\.)|sept?(ember|\\.))(\\s*),?(\\s+des)?(\\s*)({YearRegex}|(?nächste[mn]|letzte[mn]|diese(s|n))\\s+jahres))' + MonthWithYear = f'\\b((?apr(il|\\.)|aug(ust|\\.)|dez(ember|\\.)|feb(ruar|ber|\\.)|januar|j[äa]n(ner|\\.)|jul(e?i|l\\.)|jun([io]|\\.)|märz|mai|nov(ember|\\.)|okt(ober|\\.)|sept?(ember|\\.))(\\s*),?(\\s+des)?(\\s*)({YearRegex}|\\\'?{TwoDigitYearRegex}|(?nächste[mn]|letzte[mn]|diese(s|n))\\s+jahres))' OneWordPeriodRegex = f'\\b((((im\\s+)?monat\\s+)?({RelativeRegex}\\s*(jahr\\s*(im\\s*)?)?)?(?apr(il|\\.)|aug(ust|\\.)|dez(ember|\\.)|feb(ruar|ber|\\.)|j[äa]n(uar|ner|\\.)|jul(e?i|l\\.)|jun([io]|\\.)|märz|mai|nov(ember|\\.)|okt(ober|\\.)|sept?(ember|\\.)))|(?unter\\s+der\\s+woche)|({RelativeRegex}\\s+)?((?werktags|arbeitswoche)|woche(nende)?|monat(s)?|jahr|jahres)(?!(\\s+\\d+(?!({BaseDateTime.BaseAmDescRegex}|{BaseDateTime.BasePmDescRegex}))|\\s+bis\\s+heute)))\\b' - MonthNumWithYear = f'({YearRegex}(\\s*)[/\\-\\.](\\s*){MonthNumRegex})|({MonthNumRegex}(\\s*)[/\\-\\.](\\s*){YearRegex})' + MonthNumWithYear = ( + f'({YearRegex}(\\s*)[/\\-\\.](\\s*){MonthNumRegex})|({MonthNumRegex}(\\s*)[/\\-\\.](\\s*){YearRegex})' + ) WeekOfMonthRegex = f'(?((die|der)\\s+)(?erste[rns]?|1\\.|zweite[rns]?|2\\.|dritte[rns]?|3\\.|vierte[rns]?|4\\.|fünfte[rns]?|5\\.|letzte[rmns]?)\\s+woche\\s+(des|diese(s|n)|im)\\s+({MonthSuffixRegex}|monat(s)?))' WeekOfYearRegex = f'(?((die|der)\\s+)?(?(erste[rns]?|1\\.|zweite[rns]?|2\\.|dritte[rns]?|3\\.|vierte[rns]?|4\\.|fünfte[rns]?|5\\.|letzte[rmns]?)\\s+woche\\s+(im|diese(s|n)|\\s+des)?\\s+({YearRegex}|{RelativeRegex}\\s+jahr(en|es|e)?)))' OfYearRegex = f'\\b((of|in)\\s+({YearRegex}|{StrictRelativeRegex}\\s+year))\\b' - FirstLastRegex = f'\\b(the\\s+)?((?first)|(?last))\\b' + FirstLastRegex = '\\b(the\\s+)?((?first)|(?last))\\b' FollowedDateUnit = f'^\\s*{DateUnitRegex}' NumberCombinedWithDateUnit = f'\\b(?\\d+(\\.\\d*)?){DateUnitRegex}' QuarterRegex = f'((das|im|in dem|dem)\\s+)?(?erste[rns]?|1\\.|zweite[rns]?|2\\.|dritte[rns]?|3\\.|vierte[rns]?|4\\.)\\s+quartal(\\s+(von|des jahres)?|\\s*,\\s*)?\\s+({YearRegex}|{RelativeRegex})' QuarterRegexYearFront = f'(?!)#({YearRegex}|{RelativeRegex}\\s+year)\\s+(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th)\\s+quarter' AllHalfYearRegex = f'((das|im|in dem|dem)\\s+)?(?erste[rns]?|1\\.|zweite[rns]?|2\\.)\\s+(halbjahr|hälfte)(\\s+(von|des jahres)?|\\s*,\\s*)?\\s+({YearRegex}|{RelativeRegex})' - PrefixDayRegex = f'((?früh)|(?mitten|in der mitte)|(?spät(er)?))(\\s+am\\s+tag)?(\\s+des\\s+tages)?$' - CenturySuffixRegex = f'(^jahrhundert)\\b' - ReferencePrefixRegex = f'((gleich(e|en))|(selb(e|en)))\\b' + PrefixDayRegex = '((?früh)|(?mitten|in der mitte)|(?spät(er)?))(\\s+am\\s+tag)?(\\s+des\\s+tages)?$' + CenturySuffixRegex = '(^jahrhundert)\\b' + ReferencePrefixRegex = '((gleich(e|en))|(selb(e|en)))\\b' SeasonRegex = f'\\b(?({RelativeRegex}\\s+)?(?frühling|sommer|herbst|winter)((\\s+(von|des jahres)?|\\s*,\\s*)?\\s+({YearRegex}|{RelativeRegex}\\s+jahr(e(s)?)?))?)\\b' - WhichWeekRegex = f'\\b(week)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])\\b' - WeekOfRegex = f'(die\\s+)?(woche)(\\s+des)' - MonthOfRegex = f'(monat)(\\s*)(des)' - MonthRegex = f'(?apr((il)?\\b|\\.)|aug((ust)?\\b|\\.)|dez((ember)?\\b|\\.)|feb((ruar|ber)?\\b|\\.)|januar|j[äa]n((ner)?\\b|\\.)|jul((e?i|l)?\\b|l\\.)|jun([io]?\\b|\\.)|märz|mai|nov((ember)?\\b|\\.)|okt((ober)?\\b|\\.)|sept?((ember)?\\b|\\.))' - DateYearRegex = f'(?{BaseDateTime.FourDigitYearRegex}|{TwoDigitYearRegex})' + WhichWeekRegex = '\\b(week)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])\\b' + WeekOfRegex = '(die\\s+)?(woche)(\\s+des)' + MonthOfRegex = '(monat)(\\s*)(des)' + MonthRegex = '(?apr((il)?\\b|\\.)|aug((ust)?\\b|\\.)|dez((ember)?\\b|\\.)|feb((ruar|ber)?\\b|\\.)|januar|j[äa]n((ner)?\\b|\\.)|jul((e?i|l)?\\b|l\\.)|jun([io]?\\b|\\.)|märz|mai|nov((ember)?\\b|\\.)|okt((ober)?\\b|\\.)|sept?((ember)?\\b|\\.))' + DateYearRegex = f'(?{BaseDateTime.FourDigitYearRegex}|\\\'?{TwoDigitYearRegex})' OnRegex = f'(?<=\\bam\\s+)({DayRegex}s?)\\b' - RelaxedOnRegex = f'(?<=\\b(am|an dem)\\s+)((?10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)([\\.]))' - ThisRegex = f'(((diese((n|m)|(\\s*woche))(\\s*am)?\\s+){WeekDayRegex})|diese(n|r)?\\s*(sommer|winter|frühling|herbst))' + RelaxedOnRegex = '(?<=\\b(am|an dem)\\s+)((?10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)([\\.]))' + ThisRegex = ( + f'(((diese((n|m)|(\\s*woche))(\\s*am)?\\s+){WeekDayRegex})|diese(n|r)?\\s*(sommer|winter|frühling|herbst))' + ) LastDateRegex = f'({PreviousPrefixRegex}(\\s*(woche|monat|jahr)?(\\s*(am|im))?)?\\s+({WeekDayRegex}|sommer|winter|frühling|herbst))|((am\\s+)?{WeekDayRegex}(\\s+{PreviousPrefixRegex}\\s*woche))' NextDateRegex = f'({NextPrefixRegex}(\\s*(woche|monat|jahr)?(\\s*(am|im))?)?\\s+({WeekDayRegex}|sommer|winter|frühling|herbst))|((am\\s+)?{WeekDayRegex}(\\s+{NextPrefixRegex}\\s*woche))' SpecialDayRegex = f'\\b(vorgestern|übermorgen|((der\\s+)?{RelativeRegex}\\s+(tag(s|es)?|(?{WrittenNumRegex})\\s+tage?\\s+(von|nach|ab)\\s+(?\\bgestern\\b|\\bmorgen\\b|heute|(heutige[rns]?|aktuelle[rns]?) (datum|tag(s|es)?)))\\b' RelativeDayRegex = f'\\b((((de[rmns])\\s+)?{RelativeRegex}\\s+tag(e(s)?)?))' - SetWeekDayRegex = f'\\b(?(an|immer)\\s+)?(?sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonnabend)(s|en)\\b' WeekDayOfMonthRegex = f'\\b(?((an( dem)?|de[rs]|am)\\s+)?(?erste[rns]?|1\\.|zweite[rns]?|2\\.|dritte[rns]?|3\\.|vierte[rns]?|4\\.|fünfte[rns]?|5\\.|letzte[rmns]?)\\s+{WeekDayRegex}\\s+{MonthSuffixRegex})\\b' RelativeWeekDayRegex = f'\\b({WrittenNumRegex}\\s+{WeekDayRegex}e\\s+(von\\s+jetzt|später))\\b' SpecialDate = f'(?=\\b(an( dem)?|am)\\s+){DayRegex}\\b' - DateExtractor1 = f'\\b(({WeekDayRegex})(\\s+|\\s*,\\s*))?({DayRegex}\\s*[/\\\\.,\\- ]\\s*{MonthRegex}(\\s*[/\\\\.,\\- ]\\s*{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\.,\\- ]\\s*{DayRegex}\\s*[/\\\\.,\\- ]\\s*{MonthRegex})\\b' + DateExtractor1 = f'\\b(({WeekDayRegex})(\\s+|\\s*,\\s*))?({DayRegex}\\s*[/\\\\.,\\- ]\\s*({MonthNumRegex}|{MonthRegex})(\\s*[/\\\\.,\\- ]\\s*{DateYearRegex})?|{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\.,\\- ]\\s*{DayRegex}\\s*[/\\\\.,\\- ]\\s*{MonthRegex})\\b' DateExtractor2 = f'\\b({MonthRegex}\\s*[/\\\\.,\\- ]\\s*{DayRegex}(?!\\s*\\-\\s*\\d{{2}}\\b)(\\s*[/\\\\.,\\- ]\\s*{DateYearRegex})?)\\b' DateExtractor3 = f'\\b({DayRegex}{MonthRegex})' 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}' + DateExtractor6 = '^[.]' + 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'^[.]' + DateExtractor9 = ( + f'\\b({DayRegex}\\s*/\\s*{MonthNumRegex}((\\s+|\\s*,\\s*){DateYearRegex})?){BaseDateTime.CheckDecimalRegex}\\b' + ) + DateExtractor10 = '^[.]' DateExtractor11 = f'\\b(({WeekDayRegex})(\\s+|\\s*,\\s*)|(?<=\\bam\\s+))({DayRegex}\\.|{WrittenDayNumRegex})\\s*[/\\\\.\\- ]\\s*({MonthNumRegex}\\.|{WrittenMonthNumRegex})(\\s*[/\\\\.\\- ]\\s*{DateYearRegex})?' DateExtractorA = f'({DateYearRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DayRegex}|{MonthRegex}\\s*[/\\\\\\-\\.]\\s*{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*{DayRegex}|{DayRegex}\\s*[/\\\\\\-\\.]\\s*{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*{MonthRegex})(?!\\s*[/\\\\\\-\\.:]\\s*\\d+)' OfMonth = f'^(\\s*des\\s*|\\s*)?{MonthRegex}' MonthEnd = f'{MonthRegex}\\s*(de[rmn])?\\s*$' WeekDayEnd = f'{WeekDayRegex}\\s*,?\\s*$' WeekDayStart = f'^\\s+(am\\s+)?{WeekDayRegex}\\b' - RangeUnitRegex = f'(?jahren?|jahr|monaten?|monat|wochen?|tagen?|tag)' - HourNumRegex = f'\\b(?einundzwanzig|zweiundzwanzig|dreiundzwanzig|vierundzwanzig|zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|sechzehn|siebzehn|achtzehn|neunzehn|zwanzig|\'null\'|eins?|zw(een|ei|o)|drei|vier|fünf|fuenf|sechs|sieben|acht|neun|zehn|elf)\\b' - MinuteNumRegex = f'(?zwanzig|dreißig|vierzig|fünfzig|zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|fuenfzehn|sechzehn|siebzehn|achtzehn|neunzehn|eins?|zw(een|ei|o)|drei|vier|fünf|fuenf|sechs|sieben|acht|neun|zehn|elf)' - DeltaMinuteNumRegex = f'(?zwanzig|dreißig|vierzig|fünfzig|zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|fuenfzehn|sechzehn|siebzehn|achtzehn|neunzehn|eins?|zw(een|ei|o)|drei|vier|fünf|fuenf|sechs|sieben|acht|neun|zehn|elf)' - PmRegex = f'\\b((am|gegen|in der)\\s+)?(?(((früh|spät)\\s*)?(nachmittags?|abends?)|mitternachts?|\\bmittags?|((in der )?nachts?)))' - PmRegexFull = f'\\b((am|gegen|in der)\\s+)?(?(((früh|spät)\\s*)?(nachmittags?|abends?)|mitternachts?|\\bmittags?|((in der )?nachts?)))' - AmRegex = f'(?(((früh|spät)\\s*)?morgens|((am|gegen)\\s+)?(früh|vormittags?)|(am|gegen)\\s+morgen))' - LunchRegex = f'\\b(mittag(essen|s)?)\\b' - NightRegex = f'\\b(mitternacht|(nachts?|primetime|abends?))\\b' - AmPmPrefixRegex = f'\\b((((um|gegen)\\s*)?(?(((?am morgen)|((früh|spät)\\s*)?morgens|früh|(vor|nach)mittags?)|(?((früh|spät)\\s*)?(nachmittags?|abends?)|mitternachts?))|(in der\\s*)?(?nachts?)))\\s*(um|gegen|von)\\s*)' - CommonDatePrefixRegex = f'^[\\.]' - LessThanOneHour = f'\\b(?(ein(er?)?\\s+)?((drei)?viertel|halb(en?)?)(\\s*stunden?)?)|{BaseDateTime.DeltaMinuteRegex}(\\s+(min(uten?)?))|{DeltaMinuteNumRegex}(\\s+(min(uten?)?))' + RangeUnitRegex = '(?jahren?|jahr|monaten?|monat|wochen?|tagen?|tag)' + HourNumRegex = '\\b(?einundzwanzig|zweiundzwanzig|dreiundzwanzig|vierundzwanzig|zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|sechzehn|siebzehn|achtzehn|neunzehn|zwanzig|\'null\'|eins?|zw(een|ei|o)|drei|vier|fünf|fuenf|sechs|sieben|acht|neun|zehn|elf)\\b' + MinuteNumRegex = '(?zwanzig|dreißig|vierzig|fünfzig|zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|fuenfzehn|sechzehn|siebzehn|achtzehn|neunzehn|eins?|zw(een|ei|o)|drei|vier|fünf|fuenf|sechs|sieben|acht|neun|zehn|elf)' + DeltaMinuteNumRegex = '(?zwanzig|dreißig|vierzig|fünfzig|zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|fuenfzehn|sechzehn|siebzehn|achtzehn|neunzehn|eins?|zw(een|ei|o)|drei|vier|fünf|fuenf|sechs|sieben|acht|neun|zehn|elf)' + PmRegex = '\\b((am|gegen|in der)\\s+)?(?(((früh|spät)\\s*)?(nachmittags?|abends?)|mitternachts?|\\bmittags?|((in der )?nachts?)))' + PmRegexFull = '\\b((am|gegen|in der)\\s+)?(?(((früh|spät)\\s*)?(nachmittags?|abends?)|mitternachts?|\\bmittags?|((in der )?nachts?)))' + AmRegex = '(?(((früh|spät)\\s*)?morgens|((am|gegen)\\s+)?(früh|vormittags?)|(am|gegen)\\s+morgen))' + LunchRegex = '\\b(mittag(essen|s)?)\\b' + NightRegex = '\\b(mitternacht|(nachts?|primetime|abends?))\\b' + AmPmPrefixRegex = '\\b((((um|gegen)\\s*)?(?(((?am morgen)|((früh|spät)\\s*)?morgens|früh|(vor|nach)mittags?)|(?((früh|spät)\\s*)?(nachmittags?|abends?)|mitternachts?))|(in der\\s*)?(?nachts?)))\\s*(um|gegen|von)\\s*)' + CommonDatePrefixRegex = '^[\\.]' + LessThanOneHour = f'\\b(?(ein(er?)?\\s+)?((drei)?viertel|halb(en?)?)(\\s*stunden?)?)|{BaseDateTime.DeltaMinuteRegex}(\\s+(min(uten?)?)|(?=\\s+(nach|vor)))|{DeltaMinuteNumRegex}(\\s+(min(uten?)?)|(?=\\s+(nach|vor)))' WrittenTimeRegex = f'(um\\s*)?(?{HourNumRegex}(\\s*{OclockRegex}\\s*)({MinuteNumRegex}|{MinuteNumRegex}und(?zwanzig|dreißig|vierzig|fünfzig)))' TimePrefix = f'(?({LessThanOneHour})(\\s*(vor(\\W)?|nach(\\W)?))?)' TimeSuffix = f'(?{AmRegex}|{PmRegex}|{OclockRegex})' TimeSuffixFull = f'(?{AmRegex}|{PmRegex}|{OclockRegex}|\\b(?nachmittag(s)?|nacht(s)?|abend(s)?))' BasicTime = f'(?{WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}(:|\\s+uhr(\\s+und)?\\s+){BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|\\b{BaseDateTime.HourRegex}(?![%\\d]))' - MidnightRegex = f'(?mitte(r|n in der )nachts?)' - MidmorningRegex = f'(?mitten am vormittag)' - MidafternoonRegex = f'(?mitten am nachmittag)' - MiddayRegex = f'((?(am\\s+)?mittag(s(zeit)?)?)|(?(?<=montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonnabend|sonntag)(mittags?)))' + MidnightRegex = '(?mitte(r|n in der )nachts?)' + MidmorningRegex = '(?mitten am vormittag)' + MidafternoonRegex = '(?mitten am nachmittag)' + MiddayRegex = '((?(am\\s+)?mittag(s(zeit)?)?)|(?(?<=montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonnabend|sonntag)(mittags?)))' MidTimeRegex = f'(?({MidnightRegex}|{MidmorningRegex}|{MidafternoonRegex}|{MiddayRegex}))' AtRegex = f'(((?<=\\b(um|gegen)\\s+)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}(?![%\\d])|{MidTimeRegex}))|{MidTimeRegex})\\b' - IshRegex = f'\\b(noonish)\\b' - TimeUnitRegex = f'(?(stunde|minute|sekunde)(?n)?|std?|min|sek|h|s)\\b' - RestrictedTimeUnitRegex = f'(?stunde|minute)\\b' - FivesRegex = f'(?(fünfzehn|(fünfund)?(zwanzig?|dreißig|vierzig|fünfzig)|zehn|fünf))\\b' + IshRegex = '\\b(noonish)\\b' + TimeUnitRegex = '(?(stunde|minute|sekunde)(?n)?|std?|min|sek|h|s)\\b' + RestrictedTimeUnitRegex = '(?stunde|minute)\\b' + FivesRegex = '(?(fünfzehn|(fünfund)?(zwanzig?|dreißig|vierzig|fünfzig)|zehn|fünf))\\b' HourRegex = f'\\b{BaseDateTime.HourRegex}' - PeriodHourNumRegex = f'(?einundzwanzig|zweiundzwanzig|dreiundzwanzig|vierundzwanzig|zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|sechzehn|siebzehn|achtzehn|neunzehn|zwanzig|\'null\'|eins?|zwei|drei|vier|fünf|sechs|sieben|acht|neun|zehn|elf)\\b' + PeriodHourNumRegex = '(?einundzwanzig|zweiundzwanzig|dreiundzwanzig|vierundzwanzig|zw(ö|oe)lf|dreizehn|vierzehn|fünfzehn|sechzehn|siebzehn|achtzehn|neunzehn|zwanzig|\'null\'|eins?|zwei|drei|vier|fünf|sechs|sieben|acht|neun|zehn|elf)\\b' ConnectNumRegex = f'{BaseDateTime.HourRegex}(?[0-5][0-9])\\s*{DescRegex}' TimeRegex1 = f'({TimePrefix}\\s+)?({WrittenTimeRegex}(\\s*{DescRegex})?|({HourNumRegex}|{BaseDateTime.HourRegex}\\b)\\s*{DescRegex})' TimeRegex2 = f'({TimePrefix}\\s+)?(t)?{BaseDateTime.HourRegex}(\\s*)?(:|\\s+uhr(\\s+und)?\\s+)(\\s*)?{BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?{BaseDateTime.SecondRegex})?((\\s*{DescRegex})|\\b)' @@ -151,44 +160,46 @@ class GermanDateTime: PureNumBetweenAnd = f'\\b(?({PmRegex}|{AmRegex})\\s+)?(zwischen\\s+)({HourRegex}|{PeriodHourNumRegex})(\\s*(?({PmRegex}|{AmRegex}|{DescRegex})))?\\s*{RangeConnectorRegex}\\s*({HourRegex}|{PeriodHourNumRegex})\\s*(?\\s*{PmRegex}|{AmRegex}|{DescRegex}){{0,2}}\\b' SpecificTimeFromTo = f'((?({PmRegex}|{AmRegex})\\s+)?(von)\\s+)?(?({TimeRegex2}|({HourRegex}|{PeriodHourNumRegex})(\\s*(?({PmRegex}|{AmRegex}|{DescRegex})))?))\\s*{TillRegex}\\s*(?({TimeRegex2}|({HourRegex}|{PeriodHourNumRegex})(\\s*(?({PmRegex}|{AmRegex}|{DescRegex})))?))' SpecificTimeBetweenAnd = f'(?({PmRegex}|{AmRegex})\\s+)?(zwischen\\s+)(?({TimeRegex2}|({HourRegex}|{PeriodHourNumRegex})(\\s*(?({PmRegex}|{AmRegex}|{DescRegex})))?))\\s*{RangeConnectorRegex}\\s*(?({TimeRegex2}|({HourRegex}|{PeriodHourNumRegex})(\\s*(?({PmRegex}|{AmRegex}|{DescRegex})))?))' - PrepositionRegex = f'(?^(um|am|in|zur)(\\s+(de[rmn]))?$)' - TimeOfDayRegex = f'(?((((?(früh(\\s+am|er)?|am frühen))|(?(spät(\\s+am|er)?|am späten)))(\\s*|-))?((am\\s+)?morgens?(?! (früh|vor|nach|abend|(nacht|primetime)|morgen))|(vor|nach)mittags?|(?^(um|am|in|zur)(\\s+(de[rmn]))?$)' + TimeOfDayRegex = '(?((((?(früh(\\s+am|er)?|am frühen))|(?(spät(\\s+am|er)?|am späten)))(\\s*|-))?((am\\s+)?morgens?(?! (früh|vor|nach|abend|(nacht|primetime)|morgen))|(vor|nach)mittags?|(?\\d+(\\,\\d*)?){TimeUnitRegex}' - NowRegex = f'\\b(?(genau\\s+)?jetzt|momentan|im moment|derzeit|in diesem moment|aktuelle?|gerade|so früh wie möglich|frühestmöglich|neulich|vorher)\\b' - SuffixRegex = f'^\\s*((am|zur|in der)\\s+)?(am morgen|morgens|frühe?|(vor|nach)mittags?|abends?|(nacht|primetime)s?)\\b' - DateTimeTimeOfDayRegex = f'\\b(?(vor|nach)?mittags?|abends?|(nachts?|primetime|morgen))\\b' + NowRegex = '\\b(?(genau\\s+)?jetzt|momentan|im moment|derzeit|in diesem moment|aktuelle?|gerade|so früh wie möglich|frühestmöglich|neulich|vorher)\\b' + SuffixRegex = ( + '^\\s*((am|zur|in der)\\s+)?(am morgen|morgens|frühe?|(vor|nach)mittags?|abends?|(nacht|primetime)s?)\\b' + ) + DateTimeTimeOfDayRegex = '\\b(?(vor|nach)?mittags?|abends?|(nachts?|primetime|morgen))\\b' DateTimeSpecificTimeOfDayRegex = f'\\b((({RelativeRegex}|heute)\\s+{DateTimeTimeOfDayRegex}))\\b' TimeOfTodayAfterRegex = f'^\\s*(,\\s*)?((zur|am|in der)\\s+)?{DateTimeSpecificTimeOfDayRegex}' TimeOfTodayBeforeRegex = f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(um|gegen|in|on))?\\s*$' - SimpleTimeOfTodayAfterRegex = f'({HourNumRegex}|{BaseDateTime.HourRegex})\\s*(,\\s*)?(am\\s+)?{DateTimeSpecificTimeOfDayRegex}' - SimpleTimeOfTodayBeforeRegex = f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+um)?\\s*({HourNumRegex}|{BaseDateTime.HourRegex})' - SpecificEndOfRegex = f'((das|am|an( dem)?)\\s+)?\\bende(\\s+(de[mnsr])?)\\s*$' - UnspecificEndOfRegex = f'^[.]' - UnspecificEndOfRangeRegex = f'^[.]' - PeriodTimeOfDayRegex = f'(((?(früh( am|er)?|am frühen)(\\s*|-))|(?(spät( am|er)|am späten)(\\s*|-)))?(?morgens?|früh|(vor|nach)mittags?|(nachts?|primetime)|abends?))' + SimpleTimeOfTodayAfterRegex = ( + f'({HourNumRegex}|{BaseDateTime.HourRegex})\\s*(,\\s*)?(am\\s+)?{DateTimeSpecificTimeOfDayRegex}' + ) + SimpleTimeOfTodayBeforeRegex = ( + f'{DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+um)?\\s*({HourNumRegex}|{BaseDateTime.HourRegex})' + ) + SpecificEndOfRegex = '((das|am|an( dem)?)\\s+)?\\bende(\\s+(de[mnsr])?)\\s*$' + UnspecificEndOfRegex = '^[.]' + UnspecificEndOfRangeRegex = '^[.]' + PeriodTimeOfDayRegex = '(((?(früh( am|er)?|am frühen)(\\s*|-))|(?(spät( am|er)|am späten)(\\s*|-)))?(?morgens?|früh|(vor|nach)mittags?|(nachts?|primetime)|abends?))' PeriodSpecificTimeOfDayRegex = f'(({StrictRelativeRegex}\\s+{PeriodTimeOfDayRegex})|heute)' PeriodTimeOfDayWithDateRegex = f'((((am|zur|von|in der)\\s+)?{TimeOfDayRegex}(\\s+am)?))|(?(?<=montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonnabend|sonntag)((vor|nach)?mittags?|abends?|(nachts?|primetime)|morgens?))\\b' - LessThanRegex = f'\\b(weniger\\s+als)\\b' - MoreThanRegex = f'\\b(mehr\\s+als)\\b' - DurationUnitRegex = f'(?jahr(e(n|s)?)?|monat(en?|s)?|wochen?|tag(e(n|s)?)?|tg|stunden?|std?|h|min(uten?)?|sek(unden?)?)\\b' - SpecialNumberUnitRegex = f'\\b(?beiden)\\b' - SuffixAndRegex = f'(?\\s*und\\s+(eine\\s+)?(?halbe|viertel))' - PeriodicRegex = f'(?(all)?täglich(e(r|n|s)?)?|(all)?monatlich(e[rns]?)?|(all)?wöchentlich(e[rns]?)?|(all)?jährlich(e[rns]?)?)\\b' - EachUnitRegex = f'(?(jede(s|r|n|m)?|alle)(?\\s+andere(n)?)?\\s*{DurationUnitRegex})' - EachPrefixRegex = f'\\b(?(jede(r|n|s|m)?|alle|immer)\\s*$)' - SetEachRegex = f'\\b(?(jede(r|n|s|m)?|alle|immer)\\s*)' - SetLastRegex = f'(?(über)?nächste[rmns]?|kommende[rns]?|diese[rnms]?|letzte[rmns]?|vorige[rns]?|vorherige[rns]?|jetzige[rns]?|derzeitige[rns]?)\\b' - EachDayRegex = f'\\s*(jeden)\\s*tag\\s*\\b' - BeforeEachDayRegex = f'(jeden)\\s*tag\\s*' + LessThanRegex = '\\b(weniger\\s+als)\\b' + MoreThanRegex = '\\b(mehr\\s+als)\\b' + DurationUnitRegex = ( + '(?jahr(e(n|s)?)?|monat(en?|s)?|wochen?|tag(e(n|s)?)?|tg|stunden?|std?|h|min(uten?)?|sek(unden?)?)\\b' + ) + SpecialNumberUnitRegex = '\\b(?beiden)\\b' + SuffixAndRegex = '(?\\s*und\\s+(eine\\s+)?(?halbe|viertel))' + BeforeEachDayRegex = '(jeden)\\s*tag\\s*' DurationFollowedUnit = f'(^\\s*{SuffixAndRegex}?(\\s+|-)?{DurationUnitRegex})' NumberCombinedWithDurationUnit = f'\\b(?\\d+(\\.\\d*)?)(-)?{DurationUnitRegex}' AnUnitRegex = f'\\b(((((ein(e[rsnm]?)?)(?\\s+halb(e[srn]?))?))\\s+{DurationUnitRegex})|((ein(e[rsnm]?)?)\\s+((?viertel)|(?dreiviertel))(?stunde)))' - DuringRegex = f'\\b(während|im\\slaufe)\\s+(de[sr])\\s+(?jahres|monats|woche|tages)\\b' - AllRegex = f'\\b(?ganz(e[nsr]?)\\s+(?jahr|monat|woche|tag))\\b' - HalfRegex = f'(((ein(e[nrs]?)?)\\s*)|\\b)(?halb(e[nrs]?)?\\s+(?jahr(e[rs]?)?|monat[se]?|woch(en?)?|tag(e[nrs]?)?|stund(en?)?))\\b' - ConjunctionRegex = f'\\b((und(\\s+für)?)|mit|für)\\b' + DuringRegex = '\\b(während|im\\slaufe)\\s+(de[sr])\\s+(?jahres|monats|woche|tages)\\b' + AllRegex = '\\b(?ganz(e[nsr]?)\\s+(?jahr|monat|woche|tag))\\b' + HalfRegex = '(((ein(e[nrs]?)?)\\s*)|\\b)(?halb(e[nrs]?)?\\s+(?jahr(e[rs]?)?|monat[se]?|woch(en?)?|tag(e[nrs]?)?|stund(en?)?))\\b' + ConjunctionRegex = '\\b((und(\\s+für)?)|mit|für)\\b' HolidayRegex1 = f'\\b((dieses jahr)\\s*)?(?reformations(tag|fest)|gedenktag der reformation|martinstag|st. martin|sankt martin|martinsfest|martini|nikolaustag|dreikönigstag|dreikönigsfest|walpurgisnacht|nationalfeiertag|mariä empfängnis|weihnachten|weihnachts(feier)?tag|erste(r|n)? weihnachtstag|1\\. weihnachtstag|erste(r|n)? weihnachtsfeiertag|1\\. weihnachtsfeiertag|zweite(r|n)? weihnachtstag|zweite(r|n)? weihnachtsfeiertag|2\\. weihnachtstag|zweite(r|n)? weihnachtsfeiertag|2\\. weihnachtsfeiertag|stefanitag|stafanstag|berchtoldstag|bechtelistag|bächtelistag|berchtelistag|bärzelistag|josefstag|joseftag|josefitag|pfingsten|ostermontag|ostersonntag|bundesfeiertag|bundesfeier|mariä himmelfahrt|tag der deutschen einheit|ostern|vatertag|muttertag|erntedank(fest)?|thanksgiving|martin luther king day|martin luther king jr day|washington\'s birthday|washington birthday|canberraday|tag der arbeit|columbus day|memorial day|yuandan|mao\'s birthday|teachersday|teacher day|single day|tag der jugend|kindertag|(Internationaler\\s+)?frauentag|treeplanting day|tag des baumes|girlsday|white lover day|loverday|weihnachten|weihnachtstag|xmas|neujahr|neujahrstag|neujahr|neujahrstag|neujahr|inauguration day|murmeltiertag|sommeranfang|winteranfang|frühlingsanfang|herbstanfang|valentinstag|st patrick day|erster april|april scherz|georgstag|mayday|maitag|maifeiertag|geburt johannes des täufers|us unabhängigkeitstag|unabhängigkeitstag|sturm auf die bastille|halloween|guy fawkes day|guy fawkes night|veterans day|heiligabend|silvester|pi-tag|pitag|pi (tag|day))(\\s+((diesen)\\s+)?(im jahr {YearRegex}|{YearRegex}|(im\\s+)?{RelativeRegex}\\s+jahr(es)?))?\\b' HolidayRegex2 = f'\\b((dieses jahr)\\s*)?(?martin luther king|martin luther king jr|allerheiligen|tree planting day|white lover|st patrick|st george|independence|us independence|allerseelen|guy fawkes|silvester|weiberfastnacht|karneval|aschermittwoch|palm(en)?sonntag|karsamstag|fastnachtssamstag|fastnachtssonntag|heilige drei könige|barbaratag|reformationstag|weltkindertag|augsburger friedensfest|johannistag|peter und paul|karfreitag|christi himmelfahrt|pfingstsonntag|pfingstmontag|fronleichnam|rosenmontag|fastnacht|gründonnerstag|himmelfahrt|volkstrauertag|buß und bettag|buß- und bettag|buss- und bettag|buss und bettag|toten(sonntag|fest)|ewigkeitssonntag|erste(r|n)? advent|1\\. advent|zweite(r|n)? advent|2\\. advent|dritte(r|n)? advent|3\\. advent|vierte(r|n)? advent|4\\. advent|schweizer buss- und bettag|schweizer buss und bettag|schweizer buß und bettag|schweizer buß- und bettag)(\\s+((diesen)\\s+)?(im jahr {YearRegex}|{YearRegex}|(im\\s+)?{RelativeRegex}\\s+jahr(es)?))?\\b' HolidayRegex3 = f'((dieses jahr)\\s*)?(?(canberra|columbus|thanks\\s*giving|groundhog|bastille|halloween|veterans|memorial|spring|lantern|qingming|dragon boat)\\s+(day))(\\s+((diesen)\\s+)?(im jahr {YearRegex}|{YearRegex}|(im\\s+)?{RelativeRegex}\\s+jahr(es)?))?' @@ -196,590 +207,697 @@ class GermanDateTime: TimeTokenPrefix = 'um ' TokenBeforeDate = 'am ' TokenBeforeTime = 'um ' - FromRegex = f'\\b(vo[mn](\\s+de[rmsn])?)$' - BetweenTokenRegex = f'\\b(zwischen(\\s+de[rmsn])?)$' - AMTimeRegex = f'(?morgens|vormittags?|früh)' - PMTimeRegex = f'\\b(?nachmittags?|abends?|nachts?)' - BeforeRegex = f'(vorher(ige(s|n|r)?)?|bevor|vor(\\W)?|vorige(s|n|r)?|bis)(\\s+de[rmsn]\\b)?' - AfterRegex = f'(nach(\\W)?)(\\s+de[rmsn]\\b)?' - SinceRegex = f'\\b(seit|ab)(\\s+de[rmsn])?\\b' - AgoRegex = f'\\b(danach)\\b' - AroundRegex = f'(\\b(ca\\.?|gegen|circa)\\s*\\b)' - LaterRegex = f'\\b(später|von jetzt|(ab|nach) (?morgen|heute))\\b' - BeforeAfterRegex = f'^[.]' - InConnectorRegex = f'\\b(in)\\b' - SinceYearSuffixRegex = f'^[.]' + FromRegex = '\\b(vo[mn](\\s+de[rmsn])?)$' + BetweenTokenRegex = '\\b(zwischen(\\s+de[rmsn])?)$' + AMTimeRegex = '(?morgens|vormittags?|früh)' + PMTimeRegex = '\\b(?nachmittags?|abends?|nachts?)' + BeforeRegex = '(vorher(ige(s|n|r)?)?|bevor|vor(\\W)?|vorige(s|n|r)?|bis)(\\s+de[rmsn]\\b)?' + AfterRegex = '(nach(\\W)?)(\\s+de[rmsn]\\b)?' + SinceRegex = '\\b(seit|ab)(\\s+de[rmsn])?\\b' + AgoRegex = '\\b(danach)\\b' + AroundRegex = '(\\b(ca\\.?|gegen|circa)\\s*\\b)' + LaterRegex = '\\b(später|von jetzt|(ab|nach) (?morgen|heute))\\b' + BeforeAfterRegex = '^[.]' + InConnectorRegex = '\\b(in)\\b' + SinceYearSuffixRegex = '^[.]' WithinNextPrefixRegex = f'\\b(innerhalb|während(\\s+der|de(s|m))?(\\s+(?{NextPrefixRegex}))?)\\b' - TodayNowRegex = f'\\b(heute|jetzt)\\b' - MorningStartEndRegex = f'(^(früh|vormittag(s)?)|(morgens?|früh|vormittags?)$)' - AfternoonStartEndRegex = f'(^(nachmittags?)|(nachmittags?)$)' - EveningStartEndRegex = f'(^(abends?)|(abends?)$)' - NightStartEndRegex = f'(^(über nacht|in der nacht|nachts?|nächtens|primetime))|((über nacht|nachts?|nächtens|primetime)$)' - InexactNumberRegex = f'\\b((ein )?paar|einige( wenige)?|wenige)\\b' + TodayNowRegex = '\\b(heute|jetzt)\\b' + MorningStartEndRegex = '(^(früh|vormittag(s)?)|(morgens?|früh|vormittags?)$)' + AfternoonStartEndRegex = '(^(nachmittags?)|(nachmittags?)$)' + EveningStartEndRegex = '(^(abends?)|(abends?)$)' + NightStartEndRegex = ( + '(^(über nacht|in der nacht|nachts?|nächtens|primetime))|((über nacht|nachts?|nächtens|primetime)$)' + ) + InexactNumberRegex = '\\b((ein )?paar|einige( wenige)?|wenige)\\b' InexactNumberUnitRegex = f'({InexactNumberRegex})\\s+({DurationUnitRegex})' RelativeTimeUnitRegex = f'((({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s*({TimeUnitRegex})))' - RelativeDurationUnitRegex = f'(((?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s*)({DurationUnitRegex})))' + RelativeDurationUnitRegex = ( + f'(((?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s*)({DurationUnitRegex})))' + ) ReferenceDatePeriodRegex = f'\\b{ReferencePrefixRegex}\\s+(?tag|monat|jahr(zehnt)?|wochen(ende|tag))\\b' - ConnectorRegex = f'^(-|,|für|t|gegen)$' - FromToRegex = f'\\b(vom|von).+(bis(\\s*zum)?)\\b.+' - SingleAmbiguousMonthRegex = f'^(the\\s+)?(may|march)$' - UnspecificDatePeriodRegex = f'^(woche(nende)?|monat|jahr)$' - PrepositionSuffixRegex = f'\\b(am|in|um|gegen|vo[mn]|zu(m|r))$' - FlexibleDayRegex = f'(?([A-Za-z]+\\s)?[A-Za-z\\d]+)' + ConnectorRegex = '^(-|,|für|t|gegen)$' + FromToRegex = '\\b(vom|von).+(bis(\\s*zum)?)\\b.+' + SingleAmbiguousMonthRegex = '^(the\\s+)?(may|march)$' + UnspecificDatePeriodRegex = '^(woche(nende)?|monat|jahr)$' + PrepositionSuffixRegex = '\\b(am|in|um|gegen|vo[mn]|zu(m|r))$' + FlexibleDayRegex = '(?([A-Za-z]+\\s)?[A-Za-z\\d]+)' ForTheRegex = f'\\b(für\\s+den\\s+{FlexibleDayRegex}(?\\s*(,|\\.(?!(\\d|\\s?{WrittenMonthRegex}))|!|\\?|$)))' WeekDayAndDayOfMonthRegex = f'\\b{WeekDayRegex}(\\s*,)?\\s+((de(r|n))\\s+{FlexibleDayRegex})\\b' - WeekDayAndDayRegex = f'\\b{WeekDayRegex}\\s+(?!de[nr]){DayRegex}(?!([-:]|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' - RestOfDateRegex = f'\\brest\\s+((de[rs]|dieser)\\s+)((aktuellen|jetzigen)\\s+)?(?woche|monats|jahres)\\b' - RestOfDateTimeRegex = f'\\brest\\s+((des|diesen)\\s+)((aktuellen|heutigen)\\s+)?(?tages)\\b' - MealTimeRegex = f'\\b((zu(m|r))\\s+)?(?(essenszeit|mittagessen|mittag))\\b' - AmbiguousRangeModifierPrefix = f'^[.]' + WeekDayAndDayRegex = ( + f'\\b{WeekDayRegex}\\s+(?!de[nr]){DayRegex}(?!([-:]|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' + ) + RestOfDateRegex = '\\brest\\s+((de[rs]|dieser)\\s+)((aktuellen|jetzigen)\\s+)?(?woche|monats|jahres)\\b' + RestOfDateTimeRegex = '\\brest\\s+((des|diesen)\\s+)((aktuellen|heutigen)\\s+)?(?tages)\\b' + MealTimeRegex = '\\b((zu(m|r))\\s+)?(?(essenszeit|mittagessen|mittag))\\b' + AmbiguousRangeModifierPrefix = '^[.]' NumberEndingPattern = f'^(\\s+(?meeting|termin|telefonkonferenz|conference|skype call|call)\\s+to\\s+(?{PeriodHourNumRegex}|{HourRegex})((\\.)?$|(\\.,|,|!|\\?)))' - OneOnOneRegex = f'\\b(1\\s*:\\s*1)|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b' + OneOnOneRegex = '\\b(1\\s*:\\s*1)|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b' LaterEarlyPeriodRegex = f'\\b(((?ende|spät(e(r|n)?)?)|(?früh(e(r|n)?)?))\\s+(?{OneWordPeriodRegex}|(?{BaseDateTime.FourDigitYearRegex}))|(?{OneWordPeriodRegex}|(?{BaseDateTime.FourDigitYearRegex}))\\s+((?ende|spät(e(r|n)?)?)|(?früh(e(r|n)?)?)))\\b' WeekWithWeekDayRangeRegex = f'\\b((?({NextPrefixRegex}|{PreviousPrefixRegex}|diese(r|n|m))\\s+woche)((\\s+zwischen\\s+{WeekDayRegex}\\s+und\\s+{WeekDayRegex})|(\\s+vo(n|m)\\s+{WeekDayRegex}\\s+(bis\\s+)?zum\\s+{WeekDayRegex})))\\b' - GeneralEndingRegex = f'\\s*((\\.,)|\\.|,|!|\\?)?\\s*' - MiddlePauseRegex = f'\\s*(,)\\s*' - DurationConnectorRegex = f'^\\s*(?\\s+|und|für|,)\\s*$' - PrefixArticleRegex = f'\\b(der|dem|des)?\\s+' - OrRegex = f'\\s*((\\b|,\\s*)(oder|und)\\b|,)\\s*' + GeneralEndingRegex = '\\s*((\\.,)|\\.|,|!|\\?)?\\s*' + MiddlePauseRegex = '\\s*(,)\\s*' + DurationConnectorRegex = '^\\s*(?\\s+|und|für|,)\\s*$' + PrefixArticleRegex = '\\b(der|dem|des)?\\s+' + OrRegex = '\\s*((\\b|,\\s*)(oder|und)\\b|,)\\s*' YearPlusNumberRegex = f'\\b(jahr\\s+((?(\\d{{2,4}}))|{FullTextYearRegex}))\\b' NumberAsTimeRegex = f'\\b({WrittenTimeRegex}|{PeriodHourNumRegex}|{BaseDateTime.HourRegex})\\b' TimeBeforeAfterRegex = f'\\b(((?<=\\b(vor|nach)\\s+)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}|{MidTimeRegex}))|{MidTimeRegex})\\b' - DateNumberConnectorRegex = f'\\s*(?am)\\s*' - DecadeRegex = f'(?zwanziger|dreißiger|vierziger|fünfziger|sechziger|siebziger|achtziger|neunziger|zweitausender)(n)?' + DateNumberConnectorRegex = '\\s*(?am)\\s*' + DecadeRegex = ( + '(?zwanziger|dreißiger|vierziger|fünfziger|sechziger|siebziger|achtziger|neunziger|zweitausender)(n)?' + ) DecadeWithCenturyRegex = f'(die\\s+)?(((?\\d|1\\d|2\\d)?(\')?(?\\d0)(\')?s)|(({CenturyRegex}(\\s+|-)(und\\s+)?)?{DecadeRegex})|({CenturyRegex}(\\s+|-)(und\\s+)?(?zehner|hunderter)))' RelativeDecadeRegex = f'\\b((das|die\\s+)?{RelativeRegex}\\s+((?[\\w,]+)\\s+)?jahrzehnte?)\\b' YearSuffix = f'(,?\\s*({DateYearRegex}|{FullTextYearRegex}))' - SuffixAfterRegex = f'\\b(o\\s+(nach|in der Vergangenheit))\\b' + SuffixAfterRegex = '\\b(o\\s+(nach|in der Vergangenheit))\\b' YearPeriodRegex = f'((((von|während|zwischen)\\s+)?{YearRegex}\\s*({TillRegex})\\s*{YearRegex})|(((zwischen)\\s+){YearRegex}\\s*({RangeConnectorRegex})\\s*{YearRegex}))' - FutureSuffixRegex = f'\\b(in\\s+der\\s+)?(zukunft|zukünftig)\\b' - PastSuffixRegex = f'^\\b$' + FutureSuffixRegex = '\\b(in\\s+der\\s+)?(zukunft|zukünftig)\\b' + PastSuffixRegex = '^\\b$' ModPrefixRegex = f'\\b({RelativeRegex}|{AroundRegex}|{BeforeRegex}|{AfterRegex}|{SinceRegex})\\b' ModSuffixRegex = f'\\b({AgoRegex}|{LaterRegex}|{BeforeAfterRegex}|{FutureSuffixRegex}|{PastSuffixRegex})\\b' ComplexDatePeriodRegex = f'(((von|während|in)\\s+)?(?.+)\\s*({TillRegex})\\s*(?.+)|((zwischen)\\s+)(?.+)\\s*({RangeConnectorRegex})\\s*(?.+))' - UnitMap = dict([("jahren", "Y"), - ("jahres", "Y"), - ("jahre", "Y"), - ("jahr", "Y"), - ("monaten", "MON"), - ("monate", "MON"), - ("monat", "MON"), - ("monats", "MON"), - ("wochen", "W"), - ("woche", "W"), - ("tagen", "D"), - ("tages", "D"), - ("tage", "D"), - ("tag", "D"), - ("tg", "D"), - ("stunden", "H"), - ("stunde", "H"), - ("h", "H"), - ("minuten", "M"), - ("minute", "M"), - ("min", "M"), - ("sekunden", "S"), - ("sekunde", "S"), - ("sek", "S"), - ("H", "H")]) - UnitValueMap = dict([("jahren", 31536000), - ("jahre", 31536000), - ("jahr", 31536000), - ("monaten", 2592000), - ("monate", 2592000), - ("monat", 2592000), - ("wochen", 604800), - ("woche", 604800), - ("tagen", 86400), - ("tage", 86400), - ("tag", 86400), - ("tg", 86400), - ("stunden", 3600), - ("stunde", 3600), - ("std", 3600), - ("h", 3600), - ("minuten", 60), - ("minute", 60), - ("min", 60), - ("sekunden", 1), - ("sekunde", 1), - ("sek", 1)]) + UnitMap = dict( + [ + ("jahren", "Y"), + ("jahres", "Y"), + ("jahre", "Y"), + ("jahr", "Y"), + ("monaten", "MON"), + ("monate", "MON"), + ("monat", "MON"), + ("monats", "MON"), + ("wochen", "W"), + ("woche", "W"), + ("tagen", "D"), + ("tages", "D"), + ("tage", "D"), + ("tag", "D"), + ("tg", "D"), + ("stunden", "H"), + ("stunde", "H"), + ("h", "H"), + ("minuten", "M"), + ("minute", "M"), + ("min", "M"), + ("sekunden", "S"), + ("sekunde", "S"), + ("sek", "S"), + ("H", "H"), + ] + ) + UnitValueMap = dict( + [ + ("jahren", 31536000), + ("jahre", 31536000), + ("jahr", 31536000), + ("monaten", 2592000), + ("monate", 2592000), + ("monat", 2592000), + ("wochen", 604800), + ("woche", 604800), + ("tagen", 86400), + ("tage", 86400), + ("tag", 86400), + ("tg", 86400), + ("stunden", 3600), + ("stunde", 3600), + ("std", 3600), + ("h", 3600), + ("minuten", 60), + ("minute", 60), + ("min", 60), + ("sekunden", 1), + ("sekunde", 1), + ("sek", 1), + ] + ) SpecialYearPrefixesMap = dict([("", "")]) - SeasonMap = dict([("spring", "SP"), - ("summer", "SU"), - ("fall", "FA"), - ("autumn", "FA"), - ("winter", "WI")]) - SeasonValueMap = dict([("SP", 3), - ("SU", 6), - ("FA", 9), - ("WI", 12)]) - CardinalMap = dict([("erster", 1), - ("ersten", 1), - ("erstes", 1), - ("erste", 1), - ("1", 1), - ("zweiter", 2), - ("zweiten", 2), - ("zweites", 2), - ("zweite", 2), - ("zwoter", 2), - ("2", 2), - ("dritter", 3), - ("dritten", 3), - ("drittes", 3), - ("dritte", 3), - ("3", 3), - ("vierter", 4), - ("vierten", 4), - ("viertes", 4), - ("vierte", 4), - ("4", 4), - ("fünfter", 5), - ("fünften", 5), - ("fünftes", 5), - ("fünfte", 5), - ("5", 5)]) - DayOfWeek = dict([("montag", 1), - ("dienstag", 2), - ("mittwoch", 3), - ("donnerstag", 4), - ("freitag", 5), - ("samstag", 6), - ("sonnabend", 6), - ("sonntag", 0), - ("mo.", 1), - ("di.", 2), - ("mi.", 3), - ("do.", 4), - ("fr.", 5), - ("sa.", 6), - ("so.", 0)]) - MonthOfYear = dict([("januar", 1), - ("janner", 1), - ("jänner", 1), - ("februar", 2), - ("feber", 2), - ("märz", 3), - ("april", 4), - ("mai", 5), - ("juni", 6), - ("juno", 6), - ("juli", 7), - ("julei", 7), - ("august", 8), - ("september", 9), - ("oktober", 10), - ("november", 11), - ("dezember", 12), - ("jan", 1), - ("jän", 1), - ("feb", 2), - ("mar", 3), - ("apr", 4), - ("jun", 6), - ("jul", 7), - ("aug", 8), - ("sep", 9), - ("sept", 9), - ("okt", 10), - ("nov", 11), - ("dez", 12), - ("1.", 1), - ("2.", 2), - ("3.", 3), - ("4.", 4), - ("5.", 5), - ("6.", 6), - ("7.", 7), - ("8.", 8), - ("9.", 9), - ("10.", 10), - ("11.", 11), - ("12.", 12), - ("01.", 1), - ("02.", 2), - ("03.", 3), - ("04.", 4), - ("05.", 5), - ("06.", 6), - ("07.", 7), - ("08.", 8), - ("09.", 9), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9), - ("erst", 1), - ("zweit", 2), - ("dritt", 3), - ("viert", 4), - ("fünft", 5), - ("fuenft", 5), - ("sechst", 6), - ("siebt", 7), - ("acht", 8), - ("neunt", 9), - ("zehnt", 10), - ("elft", 11), - ("zwölft", 12), - ("zwoelft", 12)]) - Numbers = dict([("null", 0), - ("eins", 1), - ("ein", 1), - ("eine", 1), - ("zween", 2), - ("zwei", 2), - ("zwo", 2), - ("drei", 3), - ("vier", 4), - ("fünf", 5), - ("fuenf", 5), - ("sechs", 6), - ("sieben", 7), - ("acht", 8), - ("neun", 9), - ("zehn", 10), - ("elf", 11), - ("zwölf", 12), - ("dreizehn", 13), - ("vierzehn", 14), - ("fünfzehn", 15), - ("sechzehn", 16), - ("siebzehn", 17), - ("achtzehn", 18), - ("neunzehn", 19), - ("zwanzig", 20), - ("einundzwanzig", 21), - ("zweiundzwanzig", 22), - ("dreiundzwanzig", 23), - ("vierundzwanzig", 24), - ("fünfundzwanzig", 25), - ("sechsundzwanzig", 26), - ("siebenundzwanzig", 27), - ("achtundzwanzig", 28), - ("neunundzwanzig", 29), - ("dreißig", 30), - ("einunddreißig", 31), - ("zweiunddreißig", 32), - ("dreiunddreißig", 33), - ("vierunddreißig", 34), - ("fünfunddreißig", 35), - ("sechsunddreißig", 36), - ("siebenunddreißig", 37), - ("achtunddreißig", 38), - ("neununddreißig", 39), - ("vierzig", 40), - ("einundvierzig", 41), - ("zweiundvierzig", 42), - ("dreiundvierzig", 43), - ("vierundvierzig", 44), - ("fünfundvierzig", 45), - ("sechsundvierzig", 46), - ("siebenundvierzig", 47), - ("achtundvierzig", 48), - ("neunundvierzig", 49), - ("fünfzig", 50), - ("einundfünfzig", 51), - ("zweiundfünfzig", 52), - ("dreiundfünfzig", 53), - ("vierundfünfzig", 54), - ("fünfundfünfzig", 55), - ("sechsundfünfzig", 56), - ("siebenundfünfzig", 57), - ("achtundfünfzig", 58), - ("neunundfünfzig", 59), - ("sechzig", 60), - ("einundsechzig", 61), - ("zweiundsechzig", 62), - ("dreiundsechzig", 63), - ("vierundsechzig", 64), - ("fünfundsechzig", 65), - ("sechsundsechzig", 66), - ("siebenundsechzig", 67), - ("achtundsechzig", 68), - ("neunundsechzig", 69), - ("siebzig", 70), - ("einundsiebzig", 71), - ("zweiundsiebzig", 72), - ("dreiundsiebzig", 73), - ("vierundsiebzig", 74), - ("fünfundsiebzig", 75), - ("sechsundsiebzig", 76), - ("siebenundsiebzig", 77), - ("achtundsiebzig", 78), - ("neunundsiebzig", 79), - ("achtzig", 80), - ("einundachtzig", 81), - ("zweiundachtzig", 82), - ("dreiundachtzig", 83), - ("vierundachtzig", 84), - ("fünfundachtzig", 85), - ("sechsundachtzig", 86), - ("siebenundachtzig", 87), - ("achtundachtzig", 88), - ("neunundachtzig", 89), - ("neunzig", 90), - ("einundneunzig", 91), - ("zweiundneunzig", 92), - ("dreiundneunzig", 93), - ("vierundneunzig", 94), - ("fünfundneunzig", 95), - ("sechsundneunzig", 96), - ("siebenundneunzig", 97), - ("achtundneunzig", 98), - ("neunundneunzig", 99), - ("einhundert", 100)]) - DayOfMonth = dict([("1.", 1), - ("2.", 2), - ("3.", 3), - ("4.", 4), - ("5.", 5), - ("6.", 6), - ("7.", 7), - ("8.", 8), - ("9.", 9), - ("10.", 10), - ("11.", 11), - ("12.", 12), - ("13.", 13), - ("14.", 14), - ("15.", 15), - ("16.", 16), - ("17.", 17), - ("18.", 18), - ("19.", 19), - ("20.", 20), - ("21.", 21), - ("22.", 22), - ("23.", 23), - ("24.", 24), - ("25.", 25), - ("26.", 26), - ("27.", 27), - ("28.", 28), - ("29.", 29), - ("30.", 30), - ("31.", 31), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("13", 13), - ("14", 14), - ("15", 15), - ("16", 16), - ("17", 17), - ("18", 18), - ("19", 19), - ("20", 20), - ("21", 21), - ("22", 22), - ("23", 23), - ("24", 24), - ("25", 25), - ("26", 26), - ("27", 27), - ("28", 28), - ("29", 29), - ("30", 30), - ("31", 31), - ("erst", 1), - ("zweit", 2), - ("dritt", 3), - ("viert", 4), - ("fünft", 5), - ("fuenft", 5), - ("sechst", 6), - ("siebt", 7), - ("acht", 8), - ("neunt", 9), - ("zehnt", 10), - ("elft", 11), - ("zwölft", 12), - ("zwoelft", 12), - ("dreizehnt", 13), - ("vierzehnt", 14), - ("fünfzehnt", 15), - ("fuenfzehnt", 15), - ("sechzehnt", 16), - ("siebzehnt", 17), - ("achtzehnt", 18), - ("neunzehnt", 19), - ("zwanzigst", 20), - ("einundzwanzigst", 21), - ("zweiundzwanzigst", 22), - ("dreiundzwanzigst", 23), - ("vierundzwanzigst", 24), - ("fünfundzwanzigst", 25), - ("fuenfundzwanzigst", 25), - ("sechsundzwanzigst", 26), - ("siebenundzwanzigst", 27), - ("achtundzwanzigst", 28), - ("neunundzwanzigst", 29), - ("dreißigst", 30), - ("einunddreißigst", 31)]) - DoubleNumbers = dict([("halb", 0.5), - ("viertel", 0.25)]) - HolidayNames = dict([("reformationday", ["reformationstag", "reformationsfest", "gedenktagderreformation"]), - ("stmartinsday", ["martinstag", "st.martin", "sanktmartin", "martinsfest", "martini"]), - ("saintnicholasday", ["nikolaustag"]), - ("biblicalmagiday", ["dreik\u00f6nigstag", "dreik\u00f6nigsfest"]), - ("walpurgisnight", ["walpurgisnacht"]), - ("austriannationalday", ["nationalfeiertag"]), - ("immaculateconception", ["mari\u00e4empf\u00e4ngnis"]), - ("firstchristmasday", ["weihnachten", "weihnachtstag", "weihnachtsfeiertag", "erstenweihnachtstag", "erstenweihnachtsfeiertag", "ersterweihnachtstag", "ersterweihnachtsfeiertag", "erstenweihnachtstag", "erstenweihnachtsfeiertag", "1.weihnachtstag", "1.weihnachtsfeiertag"]), - ("secondchristmasday", ["zweiterweihnachtstag", "zweiterweihnachtsfeiertag", "zweiteweihnachtstag", "zweiteweihnachtsfeiertag", "zweitenweihnachtstag", "zweitenweihnachtsfeiertag", "2.weihnachtstag", "2.weihnachtsfeiertag", "stefanitag", "stafanstag"]), - ("berchtoldsday", ["berchtoldstag", "bechtelistag", "b\u00e4chtelistag", "berchtelistag", "b\u00e4rzelistag"]), - ("saintjosephsday", ["josefstag", "joseftag", "josefitag"]), - ("easterday", ["ostern"]), - ("eastermonday", ["ostermontag"]), - ("eastersunday", ["ostersonntag"]), - ("swissnationalday", ["bundesfeiertag", "bundesfeier"]), - ("assumptionofmary", ["mari\u00e4himmelfahrt"]), - ("germanunityday", ["tagderdeutscheneinheit"]), - ("fathers", ["vatertag", "m\u00e4nnertag"]), - ("mothers", ["muttertag"]), - ("thanksgiving", ["erntedankfest", "erntedank", "thanksgiving"]), - ("martinlutherking", ["martinlutherkingday", "martinlutherkingjrday"]), - ("washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]), - ("canberra", ["canberraday"]), - ("labour", ["tagderarbeit"]), - ("columbus", ["columbusday"]), - ("memorial", ["memorialday"]), - ("yuandan", ["yuandan"]), - ("maosbirthday", ["maosbirthday"]), - ("teachersday", ["teachersday", "teacherday"]), - ("singleday", ["singleday"]), - ("allsaintsday", ["allerheiligen"]), - ("youthday", ["tag der jugend"]), - ("childrenday", ["kindertag", "weltkindertag"]), - ("femaleday", ["frauentag"]), - ("treeplantingday", ["treeplantingday"]), - ("arborday", ["tag des baumes"]), - ("girlsday", ["girlsday"]), - ("whiteloverday", ["whiteloverday"]), - ("loverday", ["loverday"]), - ("xmas", ["xmas"]), - ("newyear", ["neujahr"]), - ("newyearday", ["neujahrstag", "neujahr"]), - ("newyearsday", ["neujahrstag", "neujahr"]), - ("inaugurationday", ["inaugurationday"]), - ("groundhougday", ["murmeltiertag"]), - ("valentinesday", ["valentinstag"]), - ("stpatrickday", ["stpatrickday"]), - ("aprilfools", ["erster april", "aprilscherz"]), - ("stgeorgeday", ["georgstag"]), - ("mayday", ["mayday", "maitag", "tagderarbeit", "maifeiertag"]), - ("laborday", ["mayday", "maitag", "tagderarbeit", "maifeiertag"]), - ("cincodemayoday", ["cincodemayo"]), - ("baptisteday", ["geburtjohannesdest\u00e4ufers"]), - ("usindependenceday", ["usunabh\u00e4ngigkeitstag"]), - ("independenceday", ["unabh\u00e4ngigkeitstag"]), - ("bastilleday", ["sturmaufdiebastille"]), - ("halloweenday", ["halloween"]), - ("allhallowday", ["allerheiligen"]), - ("allsoulsday", ["allerseelen"]), - ("guyfawkesday", ["guyfawkesday", "guyfawkesnight"]), - ("veteransday", ["veteransday"]), - ("piday", ["piday", "pitag", "pi-tag"]), - ("christmaseve", ["heiligabend"]), - ("newyeareve", ["silvester"]), - ("weiberfastnacht", ["weiberfastnacht"]), - ("carnival", ["karneval"]), - ("ashwednesday", ["aschermittwoch"]), - ("palmsunday", ["palmensonntag", "palmsonntag"]), - ("goodfriday", ["karfreitag"]), - ("ascensionofchrist", ["christihimmelfahrt"]), - ("whitesunday", ["pfingstsonntag", "pfingsten"]), - ("whitemonday", ["pfingstmontag"]), - ("corpuschristi", ["fronleichnam"]), - ("rosenmontag", ["rosenmontag"]), - ("fastnacht", ["fastnacht"]), - ("holythursday", ["gr\u00fcndonnerstag", "himmelfahrt"]), - ("memorialdaygermany", ["volkstrauertag"]), - ("dayofrepentance", ["bu\u00dfundbettag", "bu\u00df-undbettag", "bussundbettag"]), - ("totensonntag", ["totensonntag", "totenfest", "ewigkeitssonntag"]), - ("firstadvent", ["ersteadvent", "erstenadvent", "ersteradvent", "1.advent"]), - ("secondadvent", ["zweiteadvent", "zweitenadvent", "zweiteradvent", "2.advent"]), - ("thirdadvent", ["dritteadvent", "drittenadvent", "dritteradvent", "3.advent"]), - ("fourthadvent", ["vierteadvent", "viertenadvent", "vierteradvent", "4.advent"]), - ("chedayofrepentance", ["schweizerbu\u00dfundbettag", "schweizerbu\u00df-undbettag", "schweizerbussundbettag"]), - ("beginningofsummer", ["sommeranfang"]), - ("beginningofwinter", ["winteranfang"]), - ("beginningofspring", ["fr\u00fchlingsanfang"]), - ("beginningoffall", ["herbstanfang"]), - ("eastersaturday", ["karsamstag"]), - ("fastnachtssamstag", ["fastnachtssamstag"]), - ("fastnachtssonntag", ["fastnachtssonntag"]), - ("heiligedreikönige", ["heiligedreik\u00f6nige"]), - ("barbaratag", ["barbaratag"]), - ("augsburgerfriedensfest", ["augsburgerfriedensfest"]), - ("johannistag", ["johannistag"]), - ("peterundpaul", ["peterundpaul"])]) - WrittenDecades = dict([("hundert", 0), - ("zehn", 10), - ("zwanziger", 20), - ("dreißiger", 30), - ("vierziger", 40), - ("fünfziger", 50), - ("sechziger", 60), - ("siebziger", 70), - ("achtziger", 80), - ("neunziger", 90), - ("zwanzigern", 20), - ("dreißigern", 30), - ("vierzigern", 40), - ("fünfzigern", 50), - ("sechzigern", 60), - ("siebzigern", 70), - ("achtzigern", 80), - ("neunzigern", 90)]) + SeasonMap = dict([("spring", "SP"), ("summer", "SU"), ("fall", "FA"), ("autumn", "FA"), ("winter", "WI")]) + SeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + CardinalMap = dict( + [ + ("erster", 1), + ("ersten", 1), + ("erstes", 1), + ("erste", 1), + ("1", 1), + ("zweiter", 2), + ("zweiten", 2), + ("zweites", 2), + ("zweite", 2), + ("zwoter", 2), + ("2", 2), + ("dritter", 3), + ("dritten", 3), + ("drittes", 3), + ("dritte", 3), + ("3", 3), + ("vierter", 4), + ("vierten", 4), + ("viertes", 4), + ("vierte", 4), + ("4", 4), + ("fünfter", 5), + ("fünften", 5), + ("fünftes", 5), + ("fünfte", 5), + ("5", 5), + ] + ) + DayOfWeek = dict( + [ + ("montag", 1), + ("dienstag", 2), + ("mittwoch", 3), + ("donnerstag", 4), + ("freitag", 5), + ("samstag", 6), + ("sonnabend", 6), + ("sonntag", 0), + ("mo.", 1), + ("di.", 2), + ("mi.", 3), + ("do.", 4), + ("fr.", 5), + ("sa.", 6), + ("so.", 0), + ] + ) + MonthOfYear = dict( + [ + ("januar", 1), + ("janner", 1), + ("jänner", 1), + ("februar", 2), + ("feber", 2), + ("märz", 3), + ("april", 4), + ("mai", 5), + ("juni", 6), + ("juno", 6), + ("juli", 7), + ("julei", 7), + ("august", 8), + ("september", 9), + ("oktober", 10), + ("november", 11), + ("dezember", 12), + ("jan", 1), + ("jän", 1), + ("feb", 2), + ("mar", 3), + ("apr", 4), + ("jun", 6), + ("jul", 7), + ("aug", 8), + ("sep", 9), + ("sept", 9), + ("okt", 10), + ("nov", 11), + ("dez", 12), + ("1.", 1), + ("2.", 2), + ("3.", 3), + ("4.", 4), + ("5.", 5), + ("6.", 6), + ("7.", 7), + ("8.", 8), + ("9.", 9), + ("10.", 10), + ("11.", 11), + ("12.", 12), + ("01.", 1), + ("02.", 2), + ("03.", 3), + ("04.", 4), + ("05.", 5), + ("06.", 6), + ("07.", 7), + ("08.", 8), + ("09.", 9), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ("erst", 1), + ("zweit", 2), + ("dritt", 3), + ("viert", 4), + ("fünft", 5), + ("fuenft", 5), + ("sechst", 6), + ("siebt", 7), + ("acht", 8), + ("neunt", 9), + ("zehnt", 10), + ("elft", 11), + ("zwölft", 12), + ("zwoelft", 12), + ] + ) + Numbers = dict( + [ + ("null", 0), + ("eins", 1), + ("ein", 1), + ("eine", 1), + ("zween", 2), + ("zwei", 2), + ("zwo", 2), + ("drei", 3), + ("vier", 4), + ("fünf", 5), + ("fuenf", 5), + ("sechs", 6), + ("sieben", 7), + ("acht", 8), + ("neun", 9), + ("zehn", 10), + ("elf", 11), + ("zwölf", 12), + ("dreizehn", 13), + ("vierzehn", 14), + ("fünfzehn", 15), + ("sechzehn", 16), + ("siebzehn", 17), + ("achtzehn", 18), + ("neunzehn", 19), + ("zwanzig", 20), + ("einundzwanzig", 21), + ("zweiundzwanzig", 22), + ("dreiundzwanzig", 23), + ("vierundzwanzig", 24), + ("fünfundzwanzig", 25), + ("sechsundzwanzig", 26), + ("siebenundzwanzig", 27), + ("achtundzwanzig", 28), + ("neunundzwanzig", 29), + ("dreißig", 30), + ("einunddreißig", 31), + ("zweiunddreißig", 32), + ("dreiunddreißig", 33), + ("vierunddreißig", 34), + ("fünfunddreißig", 35), + ("sechsunddreißig", 36), + ("siebenunddreißig", 37), + ("achtunddreißig", 38), + ("neununddreißig", 39), + ("vierzig", 40), + ("einundvierzig", 41), + ("zweiundvierzig", 42), + ("dreiundvierzig", 43), + ("vierundvierzig", 44), + ("fünfundvierzig", 45), + ("sechsundvierzig", 46), + ("siebenundvierzig", 47), + ("achtundvierzig", 48), + ("neunundvierzig", 49), + ("fünfzig", 50), + ("einundfünfzig", 51), + ("zweiundfünfzig", 52), + ("dreiundfünfzig", 53), + ("vierundfünfzig", 54), + ("fünfundfünfzig", 55), + ("sechsundfünfzig", 56), + ("siebenundfünfzig", 57), + ("achtundfünfzig", 58), + ("neunundfünfzig", 59), + ("sechzig", 60), + ("einundsechzig", 61), + ("zweiundsechzig", 62), + ("dreiundsechzig", 63), + ("vierundsechzig", 64), + ("fünfundsechzig", 65), + ("sechsundsechzig", 66), + ("siebenundsechzig", 67), + ("achtundsechzig", 68), + ("neunundsechzig", 69), + ("siebzig", 70), + ("einundsiebzig", 71), + ("zweiundsiebzig", 72), + ("dreiundsiebzig", 73), + ("vierundsiebzig", 74), + ("fünfundsiebzig", 75), + ("sechsundsiebzig", 76), + ("siebenundsiebzig", 77), + ("achtundsiebzig", 78), + ("neunundsiebzig", 79), + ("achtzig", 80), + ("einundachtzig", 81), + ("zweiundachtzig", 82), + ("dreiundachtzig", 83), + ("vierundachtzig", 84), + ("fünfundachtzig", 85), + ("sechsundachtzig", 86), + ("siebenundachtzig", 87), + ("achtundachtzig", 88), + ("neunundachtzig", 89), + ("neunzig", 90), + ("einundneunzig", 91), + ("zweiundneunzig", 92), + ("dreiundneunzig", 93), + ("vierundneunzig", 94), + ("fünfundneunzig", 95), + ("sechsundneunzig", 96), + ("siebenundneunzig", 97), + ("achtundneunzig", 98), + ("neunundneunzig", 99), + ("einhundert", 100), + ] + ) + DayOfMonth = dict( + [ + ("1.", 1), + ("2.", 2), + ("3.", 3), + ("4.", 4), + ("5.", 5), + ("6.", 6), + ("7.", 7), + ("8.", 8), + ("9.", 9), + ("10.", 10), + ("11.", 11), + ("12.", 12), + ("13.", 13), + ("14.", 14), + ("15.", 15), + ("16.", 16), + ("17.", 17), + ("18.", 18), + ("19.", 19), + ("20.", 20), + ("21.", 21), + ("22.", 22), + ("23.", 23), + ("24.", 24), + ("25.", 25), + ("26.", 26), + ("27.", 27), + ("28.", 28), + ("29.", 29), + ("30.", 30), + ("31.", 31), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("13", 13), + ("14", 14), + ("15", 15), + ("16", 16), + ("17", 17), + ("18", 18), + ("19", 19), + ("20", 20), + ("21", 21), + ("22", 22), + ("23", 23), + ("24", 24), + ("25", 25), + ("26", 26), + ("27", 27), + ("28", 28), + ("29", 29), + ("30", 30), + ("31", 31), + ("erst", 1), + ("zweit", 2), + ("dritt", 3), + ("viert", 4), + ("fünft", 5), + ("fuenft", 5), + ("sechst", 6), + ("siebt", 7), + ("acht", 8), + ("neunt", 9), + ("zehnt", 10), + ("elft", 11), + ("zwölft", 12), + ("zwoelft", 12), + ("dreizehnt", 13), + ("vierzehnt", 14), + ("fünfzehnt", 15), + ("fuenfzehnt", 15), + ("sechzehnt", 16), + ("siebzehnt", 17), + ("achtzehnt", 18), + ("neunzehnt", 19), + ("zwanzigst", 20), + ("einundzwanzigst", 21), + ("zweiundzwanzigst", 22), + ("dreiundzwanzigst", 23), + ("vierundzwanzigst", 24), + ("fünfundzwanzigst", 25), + ("fuenfundzwanzigst", 25), + ("sechsundzwanzigst", 26), + ("siebenundzwanzigst", 27), + ("achtundzwanzigst", 28), + ("neunundzwanzigst", 29), + ("dreißigst", 30), + ("einunddreißigst", 31), + ] + ) + DoubleNumbers = dict([("halb", 0.5), ("viertel", 0.25)]) + HolidayNames = dict( + [ + ("reformationday", ["reformationstag", "reformationsfest", "gedenktagderreformation"]), + ("stmartinsday", ["martinstag", "st.martin", "sanktmartin", "martinsfest", "martini"]), + ("saintnicholasday", ["nikolaustag"]), + ("biblicalmagiday", ["dreik\u00f6nigstag", "dreik\u00f6nigsfest"]), + ("walpurgisnight", ["walpurgisnacht"]), + ("austriannationalday", ["nationalfeiertag"]), + ("immaculateconception", ["mari\u00e4empf\u00e4ngnis"]), + ( + "firstchristmasday", + [ + "weihnachten", + "weihnachtstag", + "weihnachtsfeiertag", + "erstenweihnachtstag", + "erstenweihnachtsfeiertag", + "ersterweihnachtstag", + "ersterweihnachtsfeiertag", + "erstenweihnachtstag", + "erstenweihnachtsfeiertag", + "1.weihnachtstag", + "1.weihnachtsfeiertag", + ], + ), + ( + "secondchristmasday", + [ + "zweiterweihnachtstag", + "zweiterweihnachtsfeiertag", + "zweiteweihnachtstag", + "zweiteweihnachtsfeiertag", + "zweitenweihnachtstag", + "zweitenweihnachtsfeiertag", + "2.weihnachtstag", + "2.weihnachtsfeiertag", + "stefanitag", + "stafanstag", + ], + ), + ( + "berchtoldsday", + ["berchtoldstag", "bechtelistag", "b\u00e4chtelistag", "berchtelistag", "b\u00e4rzelistag"], + ), + ("saintjosephsday", ["josefstag", "joseftag", "josefitag"]), + ("easterday", ["ostern"]), + ("eastermonday", ["ostermontag"]), + ("eastersunday", ["ostersonntag"]), + ("swissnationalday", ["bundesfeiertag", "bundesfeier"]), + ("assumptionofmary", ["mari\u00e4himmelfahrt"]), + ("germanunityday", ["tagderdeutscheneinheit"]), + ("fathers", ["vatertag", "m\u00e4nnertag"]), + ("mothers", ["muttertag"]), + ("thanksgiving", ["erntedankfest", "erntedank", "thanksgiving"]), + ("martinlutherking", ["martinlutherkingday", "martinlutherkingjrday"]), + ("washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]), + ("canberra", ["canberraday"]), + ("labour", ["tagderarbeit"]), + ("columbus", ["columbusday"]), + ("memorial", ["memorialday"]), + ("yuandan", ["yuandan"]), + ("maosbirthday", ["maosbirthday"]), + ("teachersday", ["teachersday", "teacherday"]), + ("singleday", ["singleday"]), + ("allsaintsday", ["allerheiligen"]), + ("youthday", ["tag der jugend"]), + ("childrenday", ["kindertag", "weltkindertag"]), + ("femaleday", ["frauentag"]), + ("treeplantingday", ["treeplantingday"]), + ("arborday", ["tag des baumes"]), + ("girlsday", ["girlsday"]), + ("whiteloverday", ["whiteloverday"]), + ("loverday", ["loverday"]), + ("xmas", ["xmas"]), + ("newyear", ["neujahr"]), + ("newyearday", ["neujahrstag", "neujahr"]), + ("newyearsday", ["neujahrstag", "neujahr"]), + ("inaugurationday", ["inaugurationday"]), + ("groundhougday", ["murmeltiertag"]), + ("valentinesday", ["valentinstag"]), + ("stpatrickday", ["stpatrickday"]), + ("aprilfools", ["erster april", "aprilscherz"]), + ("stgeorgeday", ["georgstag"]), + ("mayday", ["mayday", "maitag", "tagderarbeit", "maifeiertag"]), + ("laborday", ["mayday", "maitag", "tagderarbeit", "maifeiertag"]), + ("cincodemayoday", ["cincodemayo"]), + ("baptisteday", ["geburtjohannesdest\u00e4ufers"]), + ("usindependenceday", ["usunabh\u00e4ngigkeitstag"]), + ("independenceday", ["unabh\u00e4ngigkeitstag"]), + ("bastilleday", ["sturmaufdiebastille"]), + ("halloweenday", ["halloween"]), + ("allhallowday", ["allerheiligen"]), + ("allsoulsday", ["allerseelen"]), + ("guyfawkesday", ["guyfawkesday", "guyfawkesnight"]), + ("veteransday", ["veteransday"]), + ("piday", ["piday", "pitag", "pi-tag"]), + ("christmaseve", ["heiligabend"]), + ("newyeareve", ["silvester"]), + ("weiberfastnacht", ["weiberfastnacht"]), + ("carnival", ["karneval"]), + ("ashwednesday", ["aschermittwoch"]), + ("palmsunday", ["palmensonntag", "palmsonntag"]), + ("goodfriday", ["karfreitag"]), + ("ascensionofchrist", ["christihimmelfahrt"]), + ("whitesunday", ["pfingstsonntag", "pfingsten"]), + ("whitemonday", ["pfingstmontag"]), + ("corpuschristi", ["fronleichnam"]), + ("rosenmontag", ["rosenmontag"]), + ("fastnacht", ["fastnacht"]), + ("holythursday", ["gr\u00fcndonnerstag", "himmelfahrt"]), + ("memorialdaygermany", ["volkstrauertag"]), + ("dayofrepentance", ["bu\u00dfundbettag", "bu\u00df-undbettag", "bussundbettag"]), + ("totensonntag", ["totensonntag", "totenfest", "ewigkeitssonntag"]), + ("firstadvent", ["ersteadvent", "erstenadvent", "ersteradvent", "1.advent"]), + ("secondadvent", ["zweiteadvent", "zweitenadvent", "zweiteradvent", "2.advent"]), + ("thirdadvent", ["dritteadvent", "drittenadvent", "dritteradvent", "3.advent"]), + ("fourthadvent", ["vierteadvent", "viertenadvent", "vierteradvent", "4.advent"]), + ( + "chedayofrepentance", + ["schweizerbu\u00dfundbettag", "schweizerbu\u00df-undbettag", "schweizerbussundbettag"], + ), + ("beginningofsummer", ["sommeranfang"]), + ("beginningofwinter", ["winteranfang"]), + ("beginningofspring", ["fr\u00fchlingsanfang"]), + ("beginningoffall", ["herbstanfang"]), + ("eastersaturday", ["karsamstag"]), + ("fastnachtssamstag", ["fastnachtssamstag"]), + ("fastnachtssonntag", ["fastnachtssonntag"]), + ("heiligedreikönige", ["heiligedreik\u00f6nige"]), + ("barbaratag", ["barbaratag"]), + ("augsburgerfriedensfest", ["augsburgerfriedensfest"]), + ("johannistag", ["johannistag"]), + ("peterundpaul", ["peterundpaul"]), + ] + ) + WrittenDecades = dict( + [ + ("hundert", 0), + ("zehn", 10), + ("zwanziger", 20), + ("dreißiger", 30), + ("vierziger", 40), + ("fünfziger", 50), + ("sechziger", 60), + ("siebziger", 70), + ("achtziger", 80), + ("neunziger", 90), + ("zwanzigern", 20), + ("dreißigern", 30), + ("vierzigern", 40), + ("fünfzigern", 50), + ("sechzigern", 60), + ("siebzigern", 70), + ("achtzigern", 80), + ("neunzigern", 90), + ] + ) SpecialDecadeCases = dict([("zweitausender", 2000)]) DefaultLanguageFallback = 'DMY' DurationDateRestrictions = [r'today', r'now'] - AmbiguityFiltersDict = dict([("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), - ("\\b(morgen|nachmittag|abend|nacht|tag)\\b", "\\b(gut(en?)?\\s+(morgen|nachmittag|abend|nacht|tag))\\b"), - ("^(apr|aug|dez|feb|j[äa]n|jul|jun|märz|mai|nov|okt|sept?)$", "([$%£&!?@#])(apr|aug|dez|feb|j[äa]n|jul|jun|märz|mai|nov|okt|sept?)|(apr|aug|dez|feb|j[äa]n|jul|jun|märz|mai|nov|okt|sept?)([$%£&@#])"), - ("^(mo|di|mi|do|fr|sa|so)$", "\\b(mo|di|mi|do|fr|sa|so)\\b"), - ("^((früh|spät)(\\s+am|er)?\\s*)?(abends?|morgens?|nachts?|(vor|nach)mittags?|früh|primetime)$", "((?\\b(fino\\s+a(l(l[aoe\'])?|gli|i|d)?|a(l(l[aoe\'])?|gli|i|d)?|e\\s+(il?|l[aoe\']|gli))\\b|--|-|—|——|~)' - RestrictedTillRegex = f'(?\\b(fino\\s+a(l(l[aoe\'])?|gli|i|d)?)\\b|--|-|—|——|~)' - RangeConnectorRegex = f'(?\\b(e(\\s+l[aoe\']|gli|i|d)?|a(l(l[aoe\'])?|gli|i|d)?)\\b|{BaseDateTime.RangeConnectorSymbolRegex})' - RelativeRegex = f'\\b(?((il?|l[ae])\\s+)?prossim[\'oaie]|((il?|l[ae])\\s+)?seguent[ei]|((il?|l[ae])\\s+)?successiv[oaei]|in\\s+arrivo|quest[\'oaie]|(l\'|gli\\s+|le\\s+)?ultim[\'oaie]|((il?|l[ae])\\s+)?passat[oaie]|((il?|l[ae])\\s+)?precedent[ei]|((lo|l[ae]|gli)\\s+)?scors[oaie]|((il?|l[ae])\\s+)?corrent[ei]|quest[\'oaei]|il?|l[oae\']|gli)' - StrictRelativeRegex = f'(?prossim[\'oaie]|seguent[ei]|successiv[oaei]|in\\s+arrivo|quest[\'oaie]|ultim[\'oaie]|passat[oaie]|precedent[ei]|scors[oaie]|corrent[ei]|quest[\'oaei])' - NextSuffixRegex = f'(?prossim[oaei]|seguent[ei]|successiv[oaei]|imminent[ei]|in\\s+arrivo)\\b' - PastSuffixRegex = f'(?precedent[ei]|scors[oaei]|passat[oaei]|ultim[\'oaie])\\b' - ThisPrefixRegex = f'(quest[\'oa]|corrente)' - UpcomingPrefixRegex = f'((quest[aoei]\\s+)?(stess[oaei]|imminent[ei])|in\\s+arrivo)' + TillRegex = ( + '(?\\b(fino\\s+a(l(l[aoe\'])?|gli|i|d)?|a(l(l[aoe\'])?|gli|i|d)?|e\\s+(il?|l[aoe\']|gli))\\b|--|-|—|——|~)' + ) + RestrictedTillRegex = '(?\\b(fino\\s+a(l(l[aoe\'])?|gli|i|d)?)\\b|--|-|—|——|~)' + RangeConnectorRegex = ( + f'(?\\b(e(\\s+l[aoe\']|gli|i|d)?|a(l(l[aoe\'])?|gli|i|d)?)\\b|{BaseDateTime.RangeConnectorSymbolRegex})' + ) + RelativeRegex = '\\b(?((il?|l[ae])\\s+)?prossim[\'oaie]|((il?|l[ae])\\s+)?seguent[ei]|((il?|l[ae])\\s+)?successiv[oaei]|in\\s+arrivo|quest[\'oaie]|(l\'|gli\\s+|le\\s+)?ultim[\'oaie]|((il?|l[ae])\\s+)?passat[oaie]|((il?|l[ae])\\s+)?precedent[ei]|((lo|l[ae]|gli)\\s+)?scors[oaie]|((il?|l[ae])\\s+)?corrent[ei]|quest[\'oaei]|il?|l[oae\']|gli)' + StrictRelativeRegex = '(?prossim[\'oaie]|seguent[ei]|successiv[oaei]|in\\s+arrivo|quest[\'oaie]|ultim[\'oaie]|passat[oaie]|precedent[ei]|scors[oaie]|corrent[ei]|quest[\'oaei])' + NextSuffixRegex = '(?prossim[oaei]|seguent[ei]|successiv[oaei]|imminent[ei]|in\\s+arrivo)\\b' + PastSuffixRegex = '(?precedent[ei]|scors[oaei]|passat[oaei]|ultim[\'oaie])\\b' + ThisPrefixRegex = '(quest[\'oa]|corrente)' + UpcomingPrefixRegex = '((quest[aoei]\\s+)?(stess[oaei]|imminent[ei])|in\\s+arrivo)' NextPrefixRegex = f'\\b(((il?|l[ae])\\s+)?successiv[oaei]|((il?|l[ae])\\s+)?seguent[ei]|((il?|l[ae])\\s+)?prossim[oaei]|{UpcomingPrefixRegex})\\b' - AfterNextSuffixRegex = f'\\b(dopo\\s+(il|la)\\s+prossim[oa])\\b' - PastPrefixRegex = f'\\b(((lo|l[ae]|gli)\\s+)?scors[oaei])\\b' + AfterNextSuffixRegex = '\\b(dopo\\s+(il|la)\\s+prossim[oa])\\b' + PastPrefixRegex = '\\b(((lo|l[ae]|gli)\\s+)?scors[oaei])\\b' PreviousPrefixRegex = f'\\b(((il?|l[ae])\\s+)?passat[oaei]|((il?|l[ae])\\s+)?precedent[ei]|(l\'|gli\\s+|le\\s+)?ultim[oaei]|{PastPrefixRegex})\\b' - RangePrefixRegex = f'\\b(da(l(l[oae\'])?|i|gli)?|tra|fra|entro)(\\s+(il|l[aeo\']|gli|i))?\\b' - WrittenOneToNineRegex = f'(uno|due|tre|quattro|cinque|sei|sette|otto|nove)' - WrittenElevenToNineteenRegex = f'(undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove)' - WrittenTensRegex = f'(dieci|venti?|trenta?|quaranta?|cinquanta?|sessanta?|settanta?|o?ttanta?|novanta?)' - WrittenNumRegex = f'({WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|({WrittenTensRegex}{WrittenOneToNineRegex}?))' - FirstDayRegex = f'(primo(?=\\s+(aprile|apr|agosto|ago|dicembre|dic|febbraio|feb|gennaio|gen|luglio|lug|giugno|giu|marzo|mar|maggio|mag|novembre|nov|ottobre|ott|settembre|set|sett)\\b))' + RangePrefixRegex = '\\b(da(l(l[oae\'])?|i|gli)?|tra|fra|entro)(\\s+(il|l[aeo\']|gli|i))?\\b' + WrittenOneToNineRegex = '(uno|due|tre|quattro|cinque|sei|sette|otto|nove)' + WrittenElevenToNineteenRegex = '(undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove)' + WrittenTensRegex = '(dieci|venti?|trenta?|quaranta?|cinquanta?|sessanta?|settanta?|o?ttanta?|novanta?)' + WrittenNumRegex = ( + f'({WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|({WrittenTensRegex}{WrittenOneToNineRegex}?))' + ) + FirstDayRegex = '(primo(?=\\s+(aprile|apr|agosto|ago|dicembre|dic|febbraio|feb|gennaio|gen|luglio|lug|giugno|giu|marzo|mar|maggio|mag|novembre|nov|ottobre|ott|settembre|set|sett)\\b))' WrittenDayRegex = f'(?uno|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti|ventuno|ventidue|ventitre|ventiquattro|venticinque|ventisei|ventisette|ventotto|ventinove|trenta|trentuno|{FirstDayRegex})' - DayRegex = f'\\b((il|l\')\\s*)?(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?!°)(?=\\b|t)' - MonthNumRegex = f'(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b' - WeekDayRegex = f'\\b(?domenica|lunedì|martedì|mercoledì|giovedì|venerdì|sabato|lun|mar|mer|gio|ven|sab|dom)\\b' + DayRegex = '\\b((il|l\')\\s*)?(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?!°)(?=\\b|t)' + MonthNumRegex = '(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b' + WeekDayRegex = ( + '\\b(?domenica|lunedì|martedì|mercoledì|giovedì|venerdì|sabato|lun|mar|mer|gio|ven|sab|dom)\\b' + ) RelativeMonthRegex = f'(?((di|del|dell[o\'])\\s+)?(({ThisPrefixRegex}\\s+mese)|(mese\\s+({PastSuffixRegex}|{NextSuffixRegex}))|(({PastSuffixRegex}|{NextSuffixRegex})\\s+mese)))\\b' - MonthRegex = f'(?apr(ile)?|ago(sto)?|dic(embre)?|feb(braio)?|gen(naio)?|lug(lio)?|giu(gno)?|mar(zo)?|mag(gio)?|nov(embre)?|ott(obre)?|set(tembre|t)?)\\b' + MonthRegex = '(?apr(ile)?|ago(sto)?|dic(embre)?|feb(braio)?|gen(naio)?|lug(lio)?|giu(gno)?|mar(zo)?|mag(gio)?|nov(embre)?|ott(obre)?|set(tembre|t)?)\\b' EngMonthRegex = f'(((il\\s+)?mese di\\s+)?{MonthRegex})' MonthSuffixRegex = f'(?(in\\s+|nel(l[\'o])?\\s*|di\\s+|del(l[\'o])?\\s*|a([ld]|ll[\'o])?\\s*|(il|l[o\'])\\s*)?({RelativeMonthRegex}|{EngMonthRegex}))' - SpecialDescRegex = f'((?)p\\b)' + SpecialDescRegex = '((?)p\\b)' AmDescRegex = f'({BaseDateTime.BaseAmDescRegex})' PmDescRegex = f'({BaseDateTime.BasePmDescRegex})' AmPmDescRegex = f'({BaseDateTime.BaseAmPmDescRegex})' DescRegex = f'(?in punto|{AmPmDescRegex}|{AmDescRegex}|{PmDescRegex}|{SpecialDescRegex})' - WrittenCenturyCardinalYearRegex = f'(cento|duecento|trecento|quattrocento|cinquecento|seicento|settecento|ottocento|novecento)' - WrittenCenturyOrdinalYearRegex = f'(ventunesimo|ventiduesimo|primo|secondo|terzo|quarto|quinto|sesto|settimo|ottavo|nono|decimo|undicesimo|ventesimo|tredicesimo|quattordicesimo|quindicesimo|sedicesimo|diciassettesimo|diciottesimo|diciannovesimo|ventesimo)(\\s+secolo)?' - WrittenCenturyFullYearRegex = f'(?(mille|duemila)({WrittenCenturyCardinalYearRegex})?|{WrittenCenturyCardinalYearRegex})' + WrittenCenturyCardinalYearRegex = ( + '(cento|duecento|trecento|quattrocento|cinquecento|seicento|settecento|ottocento|novecento)' + ) + WrittenCenturyOrdinalYearRegex = '(ventunesimo|ventiduesimo|primo|secondo|terzo|quarto|quinto|sesto|settimo|ottavo|nono|decimo|undicesimo|ventesimo|tredicesimo|quattordicesimo|quindicesimo|sedicesimo|diciassettesimo|diciottesimo|diciannovesimo|ventesimo)(\\s+secolo)?' + WrittenCenturyFullYearRegex = ( + f'(?(mille|duemila)({WrittenCenturyCardinalYearRegex})?|{WrittenCenturyCardinalYearRegex})' + ) CenturyRegex = f'\\b(?{WrittenCenturyFullYearRegex})\\b' - DecadeRegex = f'(?dieci|venti|trenta|quaranta|cinquanta|sessanta|settanta|o?ttanta|novanta|due mila)' + DecadeRegex = '(?dieci|venti|trenta|quaranta|cinquanta|sessanta|settanta|o?ttanta|novanta|due mila)' DecadeWithCenturyRegex = f'\\b((gli\\s+)?anni\\s+)(((?\\d|1\\d|2\\d)?(\')?(?\\d0)(\')?)|(({CenturyRegex})?{DecadeRegex})|{WrittenCenturyFullYearRegex}({DecadeRegex})?)\\b' RelativeDecadeRegex = f'\\b((((il?|l\'|gli)\\s*)?{RelativeRegex}\\s+((?[\\w,]+)\\s+)?decennio?)|(((il?|l\'|gli)\\s*)?((?[\\w,]+)\\s+)?decennio?\\s+{RelativeRegex}))\\b' - LastTwoYearNumRegex = f'({WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}({WrittenOneToNineRegex})?)' - FullTextYearRegex = f'\\b((?{WrittenCenturyFullYearRegex})(?{LastTwoYearNumRegex})?)\\b' + LastTwoYearNumRegex = ( + f'({WrittenOneToNineRegex}|{WrittenElevenToNineteenRegex}|{WrittenTensRegex}({WrittenOneToNineRegex})?)' + ) + FullTextYearRegex = ( + f'\\b((?{WrittenCenturyFullYearRegex})(?{LastTwoYearNumRegex})?)\\b' + ) TwoDigitYearRegex = f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d)))\\b' - DateYearRegex = f'(?{BaseDateTime.FourDigitYearRegex}|{TwoDigitYearRegex})' + DateYearRegex = f'(?{BaseDateTime.FourDigitYearRegex}|\\\'?{TwoDigitYearRegex})' YearSuffix = f'(,?\\s*({DateYearRegex}|{FullTextYearRegex}))' YearRegex = f'({BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' - DateUnitRegex = f'\\b(?decennio|mese|settimana|(ann|giorn)(o|(?i))|(?decenni|mesi|settimane))\\b' + DateUnitRegex = ( + '\\b(?decennio|mese|settimana|(ann|giorn)(o|(?i))|(?decenni|mesi|settimane))\\b' + ) SimpleCasesRegex = f'\\b((dal?|[tf]ra)\\s+)?({DayRegex})(\\s+{MonthSuffixRegex})?\\s*{TillRegex}\\s*({DayRegex}\\s+{MonthSuffixRegex}|{MonthSuffixRegex}\\s+{DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' MonthFrontSimpleCasesRegex = f'\\b((dal?|[tf]ra)\\s+)?{MonthSuffixRegex}\\s+((dal?|[tf]ra)\\s+)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' MonthFrontBetweenRegex = f'\\b{MonthSuffixRegex}\\s+([tf]ra\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' BetweenRegex = f'\\b([tf]ra\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*){YearRegex})?\\b' - YearWordRegex = f'\\b(?l\'anno)\\b' - MonthWithYear = f'\\b({MonthRegex}(\\.)?(\\s*)[/\\\\\\-\\.,]?(((\\s+del)?\\s+{YearRegex})|((\\s+(del|di|il))?\\s+(?prossim[\'o]|passato|quest[\'o])\\s*anno)|((\\s+(del)?l\')anno\\s+(?prossimo|passato))))' - SpecialYearPrefixes = f'(?fiscale|scolastico)' + YearWordRegex = '\\b(?l\'anno)\\b' + MonthWithYear = f'\\b({MonthRegex}(\\.)?(\\s*)[/\\\\\\-\\.,]?(((\\s+del)?\\s+{YearRegex}|\\\'?{TwoDigitYearRegex})|((\\s+(del|di|il))?\\s+(?prossim[\'o]|passato|quest[\'o])\\s*anno)|((\\s+(del)?l\')anno\\s+(?prossimo|passato))))' + SpecialYearPrefixes = '(?fiscale|scolastico)' OneWordPeriodRegex = f'\\b((((il|l[o\'])\\s*)?((mese di\\s+)|({RelativeRegex}\\s*))?{MonthRegex}(\\s+{RelativeRegex})?)|dall\'inizio\\s+del(l\')\\s*(mese|anno)|({RelativeRegex}\\s*)?(mi[ao]\\s+)?(weekend|finesettimana|settimana|mese|anno)(\\s+{RelativeRegex})?(?!((\\s+di|del)?\\s+\\d+))(\\s+{AfterNextSuffixRegex})?)\\b' MonthNumWithYear = f'({YearRegex}[/\\-\\.]{MonthNumRegex})|({MonthNumRegex}[/\\-]{YearRegex})' WeekOfMonthRegex = f'\\b(?(l[a\']\\s*)?(?prima|seconda|terza|quarta|quinta|ultima)\\s+settimana\\s+{MonthSuffixRegex}(\\s+{BaseDateTime.FourDigitYearRegex}|{RelativeRegex}\\s+year)?)\\b' WeekOfYearRegex = f'\\b(?(l[a\']\\s*)?(?prima|seconda|terza|quarta|quinta|ultima)\\s+settimana(\\s+(di|del(l[o\'])?))?\\s*({YearRegex}|({RelativeRegex}\\s*anno)|(anno\\s+(({NextSuffixRegex})|({PastSuffixRegex})))))' OfYearRegex = f'\\b((of|in)\\s+({YearRegex}|{StrictRelativeRegex}\\s+year))\\b' - FirstLastRegex = f'\\b(the\\s+)?((?first)|(?last))\\b' + FirstLastRegex = '\\b(the\\s+)?((?first)|(?last))\\b' FollowedDateUnit = f'^\\s*{DateUnitRegex}' NumberCombinedWithDateUnit = f'\\b(?\\d+([\\.,]\\d*)?)\\s*{DateUnitRegex}' QuarterRegex = f'\\b((il|l\')\\s*)?(?primo|secondo|terzo|quarto|ultimo)\\s+trimestre((\\s+(di|del(l[o\'])?)|\\s*,\\s*)?\\s*({YearRegex}|({RelativeRegex}\\s*anno)|(anno\\s+(({NextSuffixRegex})|({PastSuffixRegex})))))?' QuarterRegexYearFront = f'({YearRegex}|l\'anno\\s+({PastSuffixRegex}|{NextSuffixRegex})|{RelativeRegex}\\s+anno)\\s+((per\\s+)?il\\s+)?(?primo|secondo|terzo|quarto)\\s+trimestre' AllHalfYearRegex = f'((la\\s+)?((prima|seconda)\\s+metà)(\\s+(di|del(l[o\'])?)|\\s*,\\s*)\\s*({RelativeRegex}?\\s*anno)|(il\\s+)?((primo|secondo)\\s+semestre)((\\s+(di|del(l[o\'])?)|\\s*,\\s*)\\s*({RelativeRegex}?\\s*anno))?)' - EarlyPrefixRegex = f'\\b(?prima|a\\s+partire\\s+da(l(l[aoe\'])?)?|inizio(\\s+(di|del(l[ao\'])?))?)\\b' - MidPrefixRegex = f'\\b(?metà(\\s+(di|del(l[ao\'])?))?)\\b' - LaterPrefixRegex = f'\\b(?fine(\\s+(di|del(l[ao\'])?))?|(?più\\s+tardi(\\s+(in|a))?))\\b' + EarlyPrefixRegex = '\\b(?prima|a\\s+partire\\s+da(l(l[aoe\'])?)?|inizio(\\s+(di|del(l[ao\'])?))?)\\b' + MidPrefixRegex = '\\b(?metà(\\s+(di|del(l[ao\'])?))?)\\b' + LaterPrefixRegex = '\\b(?fine(\\s+(di|del(l[ao\'])?))?|(?più\\s+tardi(\\s+(in|a))?))\\b' PrefixPeriodRegex = f'({EarlyPrefixRegex}|{MidPrefixRegex}|{LaterPrefixRegex})' - PrefixDayRegex = f'\\b(((inizio|metà|fine)((\\s+(della\\s+)?giornata)|(\\s+del\\s+giorno)))|((prima|(più\\s+tardi))\\s+quel\\s+giorno))$' - CenturySuffixRegex = f'(^secolo)\\b' + PrefixDayRegex = '\\b(((inizio|metà|fine)((\\s+(della\\s+)?giornata)|(\\s+del\\s+giorno)))|((prima|(più\\s+tardi))\\s+quel\\s+giorno))$' + CenturySuffixRegex = '(^secolo)\\b' SeasonRegex = f'\\b(l[a\']|{PrefixPeriodRegex}\\s*)?(((primavera|estate|autunno|inverno)\\s*({NextSuffixRegex}|{PastSuffixRegex}))|(?({RelativeRegex}\\s*)?(?primavera|estate|autunno|inverno)((\\s+(di|del(l[o\'])?)|\\s*,\\s*)?\\s*({YearRegex}|{RelativeRegex}\\s*anno))?))\\b' - WhichWeekRegex = f'\\b(settimana)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])\\b' - WeekOfRegex = f'(la\\s+)?(settimana)(\\s*)(d[i\']|del(l[aeo\'])?|degli)' - MonthOfRegex = f'(il\\s+)?(mese)(\\s*)(d[i\']|del(l[aeo\'])?|degli)' + WhichWeekRegex = '\\b(settimana)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])\\b' + WeekOfRegex = '(la\\s+)?(settimana)(\\s*)(d[i\']|del(l[aeo\'])?|degli)' + MonthOfRegex = '(il\\s+)?(mese)(\\s*)(d[i\']|del(l[aeo\'])?|degli)' OnRegex = f'(?<=\\b(il|l\')\\s*)({DayRegex})\\b' - RelaxedOnRegex = f'(?<=\\b(il|l\'|del(l\')?|di|al(l\')?|a)\\s*)((?10|11|12|13|14|15|16|17|18|19|1°?|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9))(?!°)\\b' - PrefixWeekDayRegex = f'(\\s*((,?\\s*(di|il))|[,-—–]))' + RelaxedOnRegex = '(?<=\\b(il|l\'|del(l\')?|di|al(l\')?|a)\\s*)((?10|11|12|13|14|15|16|17|18|19|1°?|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9))(?!°)\\b' + PrefixWeekDayRegex = '(\\s*((,?\\s*(di|il))|[,-—–]))' ThisRegex = f'\\b(quest[oa](\\s+settimana{PrefixWeekDayRegex}?)?\\s*{WeekDayRegex})|({WeekDayRegex}((\\s+di)?\\s+questa\\s+settimana))\\b' LastDateRegex = f'\\b({WeekDayRegex}\\s+(del)?la\\s+(settimana\\s+{PastSuffixRegex}|{PastSuffixRegex}\\s+settimana))|(({PastSuffixRegex}\\s+settimana|settimana\\s+{PastSuffixRegex})(\\s*{PrefixWeekDayRegex}?\\s*{WeekDayRegex}))|({WeekDayRegex}(\\s+(mattina|pomeriggio|sera|notte))?\\s+{PastSuffixRegex})|({PastSuffixRegex}\\s+{WeekDayRegex})\\b' NextDateRegex = f'\\b({WeekDayRegex}\\s+(del)?la\\s+(settimana\\s+{NextSuffixRegex}|{NextSuffixRegex}\\s+settimana))|(({NextSuffixRegex}\\s+settimana|settimana\\s+{NextSuffixRegex})({PrefixWeekDayRegex}?\\s*{WeekDayRegex})?)|({WeekDayRegex}(\\s+(mattina|pomeriggio|sera|notte))?\\s+{NextSuffixRegex})|({NextSuffixRegex}\\s+{WeekDayRegex})\\b' SpecialDayRegex = f'\\b((avant\'?ieri)|(l\'altro\\s*ieri)|(ieri\\s+l\'altro)|(dopo\\s*domani)|(il\\s+giorno\\s+(dopo|seguente|passato|precedente|prima))|ieri|((l\')?in)?domani|(quest\')?oggi|in\\s+giornata|((il|la|l\')\\s*)?({RelativeRegex}|mi[oa])\\s*(giorno|giornata))\\b' SpecialDayWithNumRegex = f'\\b((?{WrittenNumRegex})\\s+giorni\\s+da\\s+(?ieri|domani|oggi))\\b' - StrictWeekDay = f'\\b(?domenica|lunedì|martedì|mercoledì|giovedì|venerdì|sabato|lun|mar|mer|gio|ven|sab|dom)\\b' + StrictWeekDay = ( + '\\b(?domenica|lunedì|martedì|mercoledì|giovedì|venerdì|sabato|lun|mar|mer|gio|ven|sab|dom)\\b' + ) RelativeDayRegex = f'\\b(((il|l\')\\s*)?{RelativeRegex}\\s+giorno)\\b' - SetWeekDayRegex = f'\\b(?(tutt[ei]\\s+)?(le|i)\\s+)(?(?mattin|ser)|(?pomerigg)|(?nott)|(?luned|marted|mercoled|gioved|venerd)|(?domenic)|(?sabat))(e|i|ì|he)\\b' WeekDayOfMonthRegex = f'(?((la|il)\\s+)?(?prim[ao]|second[ao]|terz[ao]|quart[ao]|quint[ao]|ultim[ao])\\s+{WeekDayRegex}\\s+{MonthSuffixRegex})' RelativeWeekDayRegex = f'\\b({WrittenNumRegex}\\s+{WeekDayRegex}\\s+(da\\s+ora|dopo))\\b' SpecialDate = f'(?<=\\b(il|l\'|al(l\')?)\\s*){DayRegex}\\b' @@ -117,41 +138,43 @@ class ItalianDateTime: OfMonth = f'(^\\s*(di\\s+)?){MonthRegex}' MonthEnd = f'{MonthRegex}\\s*,?\\s*(il)?\\s*$' WeekDayEnd = f'(quest[oa]\\s+)?{WeekDayRegex}\\s*,?\\s*$' - WeekDayStart = f'^[\\.]' - RangeUnitRegex = f'\\b(?l\'anno|ann[oi]?|mes[ei]|settiman[ae])\\b' - HourNumRegex = f'\\b(?zero|(?<=l\')una|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti|ventuno|ventidue|ventitre|ventiquattro)\\b' - FivesRegex = f'(?(quindici|venti(\\s*cinque)?|trenta(\\s*cinque)?|quaranta(\\s*cinque)?|cinquanta(\\s*cinque)?|dieci|cinque))\\b' + WeekDayStart = '^[\\.]' + RangeUnitRegex = '\\b(?l\'anno|ann[oi]?|mes[ei]|settiman[ae])\\b' + HourNumRegex = '\\b(?zero|(?<=l\')una|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti|ventuno|ventidue|ventitre|ventiquattro)\\b' + FivesRegex = '(?(quindici|venti(\\s*cinque)?|trenta(\\s*cinque)?|quaranta(\\s*cinque)?|cinquanta(\\s*cinque)?|dieci|cinque))\\b' HourRegex = f'\\b{BaseDateTime.HourRegex}' - PeriodHourNumRegex = f'\\b(?ventuno|ventidue|ventitre|ventiquattro|zero|(?<=l\')una|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti)\\b' - MinuteNumRegex = f'(?uno|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti|trenta|quaranta|cinquanta)' - DeltaMinuteNumRegex = f'\\b(?uno|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti|trenta|quaranta|cinquanta)\\b' - OclockRegex = f'(?in punto)' - OclockPrefix = f'(?ore)' - PmRegex = f'\\b(?(((di|del|a(l(l\')?)?|nel|il|per|verso)\\s+(il\\s+)?)?(pomeriggio|ora di pranzo))|(((di|della|nella|a|alla|verso|la|per|in)\\s+)?(la\\s+)?(notte|serata|sera|mezzanotte)))\\b' - RangePmRegex = f'\\b(?(((di|del|a(l(l\')?)?|nel|il|per|verso)\\s+(il\\s+)?)?(pomeriggio))|(((di|della|nella|a|alla|verso|la|per|in)\\s+)?(la\\s+)?(notte|serata|sera)))\\b' - AmRegex = f'\\b(?((((la|alla|verso|per|della|di|in)\\s+(la\\s+)?)?(mattinata|mattina))|(((il|al|verso|per|del|di)\\s+(il\\s+)?)?(mattino))))\\b' - LunchRegex = f'\\b(ora di pranzo)\\b' - NightRegex = f'\\b(mezzanotte|notte)\\b' - LessThanOneHour = f'(?(un\\s+quarto|tre quarti?|mezz[oa]|mezz\'ora|{BaseDateTime.DeltaMinuteRegex}(\\s+(minut[oi]|min))?|{DeltaMinuteNumRegex}(\\s+(minut[oi]|min))|(?<=(e|meno)\\s+){DeltaMinuteNumRegex}))' + PeriodHourNumRegex = '\\b(?ventuno|ventidue|ventitre|ventiquattro|zero|(?<=l\')una|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti)\\b' + MinuteNumRegex = '(?uno|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti|trenta|quaranta|cinquanta)' + DeltaMinuteNumRegex = '\\b(?uno|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti|trenta|quaranta|cinquanta)\\b' + OclockRegex = '(?in punto)' + OclockPrefix = '(?ore)' + PmRegex = '\\b(?(((di|del|a(l(l\')?)?|nel|il|per|verso)\\s+(il\\s+)?)?(pomeriggio|ora di pranzo))|(((di|della|nella|a|alla|verso|la|per|in)\\s+)?(la\\s+)?(notte|serata|sera|mezzanotte)))\\b' + RangePmRegex = '\\b(?(((di|del|a(l(l\')?)?|nel|il|per|verso)\\s+(il\\s+)?)?(pomeriggio))|(((di|della|nella|a|alla|verso|la|per|in)\\s+)?(la\\s+)?(notte|serata|sera)))\\b' + AmRegex = '\\b(?((((la|alla|verso|per|della|di|in)\\s+(la\\s+)?)?(mattinata|mattina))|(((il|al|verso|per|del|di)\\s+(il\\s+)?)?(mattino))))\\b' + LunchRegex = '\\b(ora di pranzo)\\b' + NightRegex = '\\b(mezzanotte|notte)\\b' + LessThanOneHour = ( + f'(?(un\\s+quarto|tre quarti?|mezz[oa]|mezz\'ora|{BaseDateTime.DeltaMinuteRegex}|{DeltaMinuteNumRegex}))' + ) EngTimeRegex = f'(?{HourNumRegex}\\s+e\\s+({MinuteNumRegex}|(?venti?|trenta?|quaranta?|cinquanta?){MinuteNumRegex}))' - TimePrefix = f'(?(e\\s+{LessThanOneHour}|{LessThanOneHour}\\s+(minut[oi]|min)\\s+all[e\']|meno {LessThanOneHour}))' + TimePrefix = f'(?((e|meno)\\s+{LessThanOneHour}(\\s+(minut[oi]|min))?|{LessThanOneHour}\\s+(minut[oi]|min)\\s+all[e\']))' TimeSuffix = f'(?{AmRegex}|{PmRegex}|{OclockRegex})' BasicTime = f'\\b(?{EngTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}:{BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|{BaseDateTime.HourRegex})' - MidnightRegex = f'(?mezzanotte|mezza notte)' - CommonDatePrefixRegex = f'^[\\.]' - MorningRegex = f'(?mattin[oa]|mattinata)' - AfternoonRegex = f'(?pomeriggio)' + MidnightRegex = '(?mezzanotte|mezza notte)' + CommonDatePrefixRegex = '^[\\.]' + MorningRegex = '(?mattin[oa]|mattinata)' + AfternoonRegex = '(?pomeriggio)' MidmorningRegex = f'(?metà\\s*{MorningRegex})' - MiddayRegex = f'(?metà\\s*giornata|(12\\s)?mezzogiorno)' + MiddayRegex = '(?metà\\s*giornata|(12\\s)?mezzogiorno)' MidafternoonRegex = f'(?metà\\s*{AfternoonRegex})' MidTimeRegex = f'(?({MidnightRegex}|{MidmorningRegex}|{MidafternoonRegex}|{MiddayRegex}))' - PrepRegex = f'\\b((\\.|,)(?!\\d+)|!|\\?|$|circa|presso|vicino|sopra|sotto|lontano|dentro|fuori|di|del(l[\'oae])?|dei|degli|a|al(l[\'oae])?|ai|agli|da|dal(l[\'oae])?|dai|dagli|in|nel(l[\'oae])?|nei|negli|su|sul(l[\'oae])?|sui|sugli)\\b' + PrepRegex = '\\b((\\.|,)(?!\\d+)|!|\\?|$|circa|presso|vicino|sopra|sotto|lontano|dentro|fuori|di|del(l[\'oae])?|dei|degli|a|al(l[\'oae])?|ai|agli|da|dal(l[\'oae])?|dai|dagli|in|nel(l[\'oae])?|nei|negli|su|sul(l[\'oae])?|sui|sugli)\\b' AtRegex = f'\\b(((?<=\\b(a)\\s+){MidTimeRegex}|{MidTimeRegex}\\b)|((?<=\\ball[e\']\\s*){EngTimeRegex}\\b)|((?<=\\b\\d+\\s+all[e\']\\s*)({HourNumRegex}|{BaseDateTime.HourRegex})\\b(?=\\s*(e|{DescRegex}|{PrepRegex})\\b))|((?<=([^\\d\\s]|^)\\s*\\ball[e\']\\s*)({HourNumRegex}|{BaseDateTime.HourRegex})\\b(?![\\.,]\\d+)))' IshRegex = f'\\b(((poco\\s+(prima|dopo)(\\s+(di|dell[e\']))?)|circa(\\s+a(ll[\'e])?)?|più o meno(\\s+a(ll[\'e])?)?)\\s*(({BaseDateTime.HourRegex}|{PeriodHourNumRegex})(?!\\s*({DescRegex}|[:\\.,/e]\\s*\\d+))|mezzogiorno)|(({BaseDateTime.HourRegex}|{PeriodHourNumRegex})(?!\\s*({DescRegex}|[:\\.,/e]\\s*\\d+))(\\s+circa)|mezzogiorno(\\s+circa)|verso\\s+mezzogiorno))\\b' - TimeUnitRegex = f'(\\b\\d+([\\.,]\\d*)?|\\b)(?or(a|(?e))|(minut|second)(o|(?i))|h|(hr|min|sec)(?s)?)\\b' - RestrictedTimeUnitRegex = f'(?ore|minuti)\\b' + TimeUnitRegex = '(\\b\\d+([\\.,]\\d*)?|\\b)(?or(a|(?e))|(minut|second)(o|(?i))|h|(hr|min|sec)(?s)?)\\b' + RestrictedTimeUnitRegex = '(?ore|minuti)\\b' ConnectNumRegex = f'{BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59)\\s*{DescRegex}' - AmbiguousRangeModifierPrefix = f'^[.]' + AmbiguousRangeModifierPrefix = '^[.]' NumberEndingPattern = f'^(\\s+(?riunione|appuntamento|conferenza|chiamata|chiamata skype)\\s+all[\'e]\\s*(?{PeriodHourNumRegex}|{HourRegex})((\\.)?$|(\\.,|,|!|\\?)))' TimeRegex1 = f'(((((?<=\\b(da|al)?(le|l\'|ore)\\s*)({EngTimeRegex}))|((?<=\\b(da|al)?(le|l\'|ore)\\s*)({HourNumRegex}|{BaseDateTime.HourRegex})(?![\\.,]\\d+)(?=\\s*({PrepRegex}))))|(({TimePrefix}\\s+)({EngTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}))|(({EngTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})\\s+{TimePrefix}))((\\s*{DescRegex})|\\b))' TimeRegex2 = f'(t)?({BaseDateTime.HourRegex})(\\s*)?:(\\s*)?{BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?{BaseDateTime.SecondRegex})?((\\s*{DescRegex})|\\b)' @@ -162,52 +185,63 @@ class ItalianDateTime: TimeRegex7 = f'\\b{TimeSuffix}\\s+d?all[e\']\\s*{BasicTime}(\\s+{TimePrefix})?((\\s*{DescRegex})|\\b)' TimeRegex8 = f'\\b({TimeSuffix}|{OclockPrefix})\\s+{BasicTime}((\\s*{DescRegex})|\\b)' TimeRegex9 = f'\\b{PeriodHourNumRegex}(\\s+e)\\s+{FivesRegex}((\\s*{DescRegex})|\\b)' - TimeRegex10 = f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' + TimeRegex10 = ( + f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' + ) TimeRegexWithDotConnector = f'({BaseDateTime.HourRegex}(\\s*\\.\\s*){BaseDateTime.MinuteRegex})' FirstTimeRegexInTimeRange = f'\\b{TimeRegexWithDotConnector}(\\s*{DescRegex})?' - PeriodDescRegex = f'(?pm|am|p\\.m\\.|a\\.m\\.)' - PeriodPmRegex = f'\\b(?(nel|questo)\\s+pomeriggio|(questa|di)\\s+sera|(durante\\s+la|in)\\s+serata|nella\\s+notte)\\b' - PeriodAmRegex = f'\\b(?al mattino|alla mattina|di mattina|in mattinata)\\b' + PeriodDescRegex = '(?pm|am|p\\.m\\.|a\\.m\\.)' + PeriodPmRegex = ( + '\\b(?(nel|questo)\\s+pomeriggio|(questa|di)\\s+sera|(durante\\s+la|in)\\s+serata|nella\\s+notte)\\b' + ) + PeriodAmRegex = '\\b(?al mattino|alla mattina|di mattina|in mattinata)\\b' PureNumFromTo = f'(((?{PmRegex}|{AmRegex})\\s*da(ll[e\'])?\\s*({HourRegex}|{PeriodHourNumRegex})\\s*{TillRegex}\\s*({HourRegex}|{PeriodHourNumRegex}))|((?{PmRegex}|{AmRegex}|{PeriodDescRegex}))?\\s*{TillRegex}\\s*({HourRegex}|{PeriodHourNumRegex})\\s*(?{PmRegex}|{AmRegex}|{PeriodDescRegex})?))' PureNumBetweenAnd = f'([tf]ra(\\s+l[e\'])?\\s*)({HourRegex}|{PeriodHourNumRegex})(\\s*(?{PmRegex}|{AmRegex}|{PeriodDescRegex}))?\\s*{RangeConnectorRegex}\\s*({HourRegex}|{PeriodHourNumRegex})(\\s*(?{PmRegex}|{AmRegex}|{PeriodDescRegex}))?' SpecificTimeFromTo = f'(da(ll[e\'])?\\s*)(?(({TimeRegex2}|{FirstTimeRegexInTimeRange})|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{TillRegex}\\s*(?(({TimeRegex2}|{TimeRegexWithDotConnector}(?\\s*{DescRegex}))|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))' SpecificTimeBetweenAnd = f'([tf]ra(\\s+l[e\'])?\\s*)(?(({TimeRegex2}|{FirstTimeRegexInTimeRange})|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{RangeConnectorRegex}\\s*(?(({TimeRegex2}|{TimeRegexWithDotConnector}(?\\s*{DescRegex}))|({HourRegex}|{PeriodHourNumRegex})(\\s*(?{DescRegex}))?))' - PrepositionRegex = f'(?^(,\\s*)?(a(l(l[\'e])?)?|il|la|di|del(l[ae\'])?)$)' - TimeOfDayRegex = f'\\b(?(((((il|la|in|a(l(la)?)?|nel(la)?|di)\\s+)?(((mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)(?\\s+presto)|(?prim[ao]\\s+)(mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata))|((mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)(?\\s+(tardi|inoltrat[oa]|fonda))|(?tard[oa]\\s+)?(mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)))))|(in\\s+giornata|durante\\s+il\\s+giorno|(durante\\s+le|nelle)\\s+ore\\s+d[i\']\\s*ufficio)))\\b' + PrepositionRegex = '(?^(,\\s*)?(a(l(l[\'e])?)?|il|la|di|del(l[ae\'])?)$)' + TimeOfDayRegex = '\\b(?(((((il|la|in|a(l(la)?)?|nel(la)?|di)\\s+)?(((mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)(?\\s+presto)|(?prim[ao]\\s+)(mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata))|((mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)(?\\s+(tardi|inoltrat[oa]|fonda))|(?tard[oa]\\s+)?(mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)))))|(in\\s+giornata|durante\\s+il\\s+giorno|(durante\\s+le|nelle)\\s+ore\\s+d[i\']\\s*ufficio)))\\b' SpecificTimeOfDayRegex = f'\\b(di\\s+)?(({RelativeRegex}\\s+{TimeOfDayRegex})|({TimeOfDayRegex}\\s*({NextSuffixRegex}|{PastSuffixRegex}))|(stamattina|stasera|stanotte))\\b' TimeFollowedUnit = f'^\\s*{TimeUnitRegex}' TimeNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?)\\s*{TimeUnitRegex}' - NowRegex = f'\\b(?(proprio\\s+)?(adesso|ora(?!\\s+(di|del(l[aeo\'])?|degli|\\d+|x))|in\\s+questo\\s+momento)|il prima possibile|asap|recentemente|precedentemente)\\b' - SuffixRegex = f'^\\s*\\b((in|nel(la)?|al(la)?|di)\\s+)?(mattin[oa]|mattinata|pomeriggio|sera|serata|notte|nottata)\\b' - DateTimeTimeOfDayRegex = f'\\b(?mattin[oa]|mattinata|pomeriggio|sera|serata|notte|nottata)\\b' + NowRegex = '\\b(?(proprio\\s+)?(adesso|ora(?!\\s+(di|del(l[aeo\'])?|degli|\\d+|x))|in\\s+questo\\s+momento)|il prima possibile|asap|recentemente|precedentemente)\\b' + SuffixRegex = ( + '^\\s*\\b((in|nel(la)?|al(la)?|di)\\s+)?(mattin[oa]|mattinata|pomeriggio|sera|serata|notte|nottata)\\b' + ) + DateTimeTimeOfDayRegex = '\\b(?mattin[oa]|mattinata|pomeriggio|sera|serata|notte|nottata)\\b' DateTimeSpecificTimeOfDayRegex = f'\\b(di\\s+)?(({RelativeRegex}\\s+{DateTimeTimeOfDayRegex})|({DateTimeTimeOfDayRegex}\\s+({NextSuffixRegex}|{PastSuffixRegex}))|stamattina|stasera|stanotte)\\b' TimeOfTodayAfterRegex = f'^\\s*(,\\s*)?(in|nel(la)?|di|del(la)?\\s+)?{DateTimeSpecificTimeOfDayRegex}' - TimeOfTodayBeforeRegex = f'({DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+((intorno\\s+)?(a(ll[e\'])?)|verso\\s+l[e\']))?\\s*$)' - SimpleTimeOfTodayAfterRegex = f'({HourNumRegex}|{HourRegex})\\s*(,\\s*)?(in|nel(la)?|di|del(la)?\\s+)?{DateTimeSpecificTimeOfDayRegex}' + TimeOfTodayBeforeRegex = ( + f'({DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+((intorno\\s+)?(a(ll[e\'])?)|verso\\s+l[e\']))?\\s*$)' + ) + SimpleTimeOfTodayAfterRegex = ( + f'({HourNumRegex}|{HourRegex})\\s*(,\\s*)?(in|nel(la)?|di|del(la)?\\s+)?{DateTimeSpecificTimeOfDayRegex}' + ) SimpleTimeOfTodayBeforeRegex = f'({DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(all[\'e]|verso\\s+l[\'e]))?\\s*({HourNumRegex}|{BaseDateTime.HourRegex}))' - SpecificEndOfRegex = f'(alla\\s+)?fine\\s+(di|del(l[\'a])?)\\s*$' - UnspecificEndOfRegex = f'(\\b(a|((al)?la)\\s+))?((fine\\s+(della\\s+)?giornata))\\b' - UnspecificEndOfRangeRegex = f'\\b(fine\\s*(dell\')?anno)\\b' - PeriodTimeOfDayRegex = f'\\b(((il|la|in|a(l(la)?)?|nel(la)?|di)\\s+)?(((?mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)(?\\s+presto)|(?prim[ao]\\s+)(?mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata))|((?mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)(?\\s+(tardi|inoltrat[oa]|fonda))|(?tard[oa]\\s+)?(?mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata))))\\b' - PeriodSpecificTimeOfDayRegex = f'\\b(di\\s+)?(({RelativeRegex}\\s+{PeriodTimeOfDayRegex})|sta(mattina|sera|notte))\\b' + SpecificEndOfRegex = '(alla\\s+)?fine\\s+(di|del(l[\'a])?)\\s*$' + UnspecificEndOfRegex = '(\\b(a|((al)?la)\\s+))?((fine\\s+(della\\s+)?giornata))\\b' + UnspecificEndOfRangeRegex = '\\b(fine\\s*(dell\')?anno)\\b' + PeriodTimeOfDayRegex = '\\b(((il|la|in|a(l(la)?)?|nel(la)?|di)\\s+)?(((?mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)(?\\s+presto)|(?prim[ao]\\s+)(?mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata))|((?mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata)(?\\s+(tardi|inoltrat[oa]|fonda))|(?tard[oa]\\s+)?(?mattin[ao]|mattinata|pomeriggio|sera|serata|notte|nottata))))\\b' + PeriodSpecificTimeOfDayRegex = ( + f'\\b(di\\s+)?(({RelativeRegex}\\s+{PeriodTimeOfDayRegex})|sta(mattina|sera|notte))\\b' + ) PeriodTimeOfDayWithDateRegex = f'\\b({TimeOfDayRegex}(\\s+(il|l\'|del(l\')?|di))?)\\b' - LessThanRegex = f'\\b(meno\\s+di)\\b' - MoreThanRegex = f'\\b(più\\s+di)\\b' + LessThanRegex = '\\b(meno\\s+di)\\b' + MoreThanRegex = '\\b(più\\s+di)\\b' DurationUnitRegex = f'(?{DateUnitRegex}|or[ae]|hrs?|h|minut[oi]|mins?|second[oi]|secs?)\\b' - SuffixAndRegex = f'(?\\s*e\\s+(un\\s+)?(?mezzo|mezza|quarto))' - PeriodicRegex = f'\\b(?giornalier[oaei]|giornalmente|quotidian[oaei]|quotidianamente|mensil[ei]|mensilmente|settimanal[ei]|settimanalmente|bisettimanal[ei]|annual[ei]|annualmente)\\b' - EachUnitRegex = f'(?(ogni|tutte\\s+le|tutti\\s+(gl)?i|una\\s+volta\\s+(al(l\')?|l\'))(?\\s+altro)?\\s*{DurationUnitRegex})' - EachPrefixRegex = f'\\b(?(ogni|tutte\\s+le|tutti\\s+(gl)?i|una\\s+volta\\s+(al(l\')?|l\'))\\s*$)' - SetEachRegex = f'\\b(?(ogni|tutte\\s+le|tutti\\s+(gl)?i|una\\s+volta\\s+(al(l\')?|l\'))\\s*)' - SetLastRegex = f'(?prossim[oaei]|seguent[ei]|in\\s+arrivo|quest[oaei]|ultim[oaei]|passat[oaei]|scors[oaei]|precedent[ei]|corrent[ei])' - EachDayRegex = f'^\\s*(ogni|tutti\\s+i)\\s+giorn[oi]\\b' - DurationFollowedUnit = f'(^\\s*{DurationUnitRegex}\\s+{SuffixAndRegex})|(^\\s*{SuffixAndRegex}?(\\s+|-)?{DurationUnitRegex})' + SuffixAndRegex = '(?\\s*e\\s+(un\\s+)?(?mezzo|mezza|quarto))' + PeriodicRegex = '\\b(?giornalier[oaei]|giornalmente|quotidian[oaei]|quotidianamente|mensil[ei]|mensilmente|settimanal[ei]|settimanalmente|bisettimanal[ei]|annual[ei]|annualmente)\\b' + DurationFollowedUnit = ( + f'(^\\s*{DurationUnitRegex}\\s+{SuffixAndRegex})|(^\\s*{SuffixAndRegex}?(\\s+|-)?{DurationUnitRegex})' + ) NumberCombinedWithDurationUnit = f'\\b(?\\d+([\\.,]\\d*)?)(-)?\\s*{DurationUnitRegex}' AnUnitRegex = f'(((?mezz[oa]?|metà)[-\']?|un[oa\']?|un altro|un\'altra)\\s*{DurationUnitRegex})' - DuringRegex = f'\\b(per|durante)\\s+(il|l[a\'])\\s+(?anno|mese|settimana|giorno)\\b' - AllRegex = f'\\b(?(tutt[oa](\\s+(il|l[a\']))?|inter[oa])(\\s*|-)(?anno|mese|settimana|giorno)|(?anno|mese|settimana|giorno)\\s+inter[oa])\\b' - HalfRegex = f'\\b((?(metà|mezz[oa])\\s+(?anno|mese|settimana|giorno|ora))|(?(?semestr[ei])))\\b' - ConjunctionRegex = f'\\b((e(\\s+per)?)|con)\\b' + DuringRegex = '\\b(per|durante)\\s+(il|l[a\'])\\s+(?anno|mese|settimana|giorno)\\b' + AllRegex = '\\b(?(tutt[oa](\\s+(il|l[a\']))?|inter[oa])(\\s*|-)(?anno|mese|settimana|giorno)|(?anno|mese|settimana|giorno)\\s+inter[oa])\\b' + HalfRegex = ( + '\\b((?(metà|mezz[oa])\\s+(?anno|mese|settimana|giorno|ora))|(?(?semestr[ei])))\\b' + ) + ConjunctionRegex = '\\b((e(\\s+per)?)|con)\\b' HolidayRegex1 = f'\\b(?capodanno cinese|cenone di capodanno|veglione di capodanno|(la )?vigilia di capodanno|capodanno|mercoledì delle ceneri|le ceneri|martedì grasso|primo dell\'anno|festa del papà|pesce d\'aprile|vigilia di natale|la vigilia|giorno di natale|natale|halloween|domenica di pasqua|pasqua|lunedì dell\'angelo)(\\s+((del|di)\\s+)?({YearRegex}|{RelativeRegex}\\s*anno))?\\b' HolidayRegex2 = f'\\b(?giorno dei morti|i morti|tutti i santi|i santi|giorno dell\'independenza|((giorno|festa) del)?la liberazione|festa della repubblica|festa del lavoro|festa dei lavoratori)(\\s+((del|di)\\s+)?({YearRegex}|{RelativeRegex}\\s*anno))?\\b' HolidayRegex3 = f'(?(giorno\\s+((di|del(la)?)\\s+)?)?(pasqua|quaresima|memoria|ringraziamento|san patrizio|festa della mamma|festa delle donne|festa della donna|san valentino|ferragosto))(\\s+((del|di)\\s+)?({YearRegex}|{RelativeRegex}\\s*anno))?' @@ -215,397 +249,430 @@ class ItalianDateTime: TimeTokenPrefix = 'alle ' TokenBeforeDate = 'il ' TokenBeforeTime = 'alle ' - AMTimeRegex = f'(?mattin[oa]|mattinata|notte|nottata)' - PMTimeRegex = f'\\b(?pomeriggio|sera|serata)\\b' - BeforeRegex = f'\\b(prima(\\s+(di|del(l[\'aoei])?|degli|dei))?|entro\\s*(l[\'aoe]|il?|gli|i)?|(non\\s+dopo\\s+(il?|l[oae\']|gli)|non\\s+più\\s+tardi\\s+(di|del(l[\'aoei])?|degli|dei)|termina(no)?(\\s+con)?(\\s+(il?|l[oae\']|gli))?|precedente\\s+a((l(l[\'aoe])?)|gli|i)?|fino\\s+a((l(l[\'aoe])?)|gli|i)?))\\b' - BeforeRegex2 = f'\\b(entro\\s*(l[\'aoe]|il?|gli|i)?)\\b' - AfterRegex = f'\\b((?mattin[oa]|mattinata|notte|nottata)' + PMTimeRegex = '\\b(?pomeriggio|sera|serata)\\b' + BeforeRegex = '\\b(prima(\\s+(di|del(l[\'aoei])?|degli|dei))?|entro\\s*(l[\'aoe]|il?|gli|i)?|(non\\s+dopo\\s+(il?|l[oae\']|gli)|non\\s+più\\s+tardi\\s+(di|del(l[\'aoei])?|degli|dei)|termina(no)?(\\s+con)?(\\s+(il?|l[oae\']|gli))?|precedente\\s+a((l(l[\'aoe])?)|gli|i)?|fino\\s+a((l(l[\'aoe])?)|gli|i)?))\\b' + BeforeRegex2 = '\\b(entro\\s*(l[\'aoe]|il?|gli|i)?)\\b' + AfterRegex = '\\b((?{NextPrefixRegex}))?)\\b' - TodayNowRegex = f'\\b(oggi|adesso)\\b' + TodayNowRegex = '\\b(oggi|adesso)\\b' MorningStartEndRegex = f'(^(((di\\s+|questa\\s+|sta)?mattin[oa]|mattinata)|{AmDescRegex}))|((((di\\s+|questa\\s+|sta)?mattin[oa]|mattinata)|{AmDescRegex})$)' AfternoonStartEndRegex = f'(^((((di|al)\\s+|questo\\s+|sto)?pomeriggio)|{PmDescRegex}))|(((((di|il)\\s+|questo\\s+|sto)?pomeriggio)|{PmDescRegex})$)' - EveningStartEndRegex = f'(^((di\\s+|questa\\s+|sta)?sera|serata))|(((di\\s+|questa\\s+|sta)?sera|serata)$)' - NightStartEndRegex = f'(^((di\\s+|questa\\s+|sta)?notte|nottata))|(((di\\s+|questa\\s+|sta)?notte|nottata)$)' - InexactNumberRegex = f'\\b(un\\s+po\'\\s+di|alcun[ei]|qualche|parecchie?|divers[ie]|molt[oaei]|poc[oa]|poch[ei])\\b' + EveningStartEndRegex = '(^((di\\s+|questa\\s+|sta)?sera|serata))|(((di\\s+|questa\\s+|sta)?sera|serata)$)' + NightStartEndRegex = '(^((di\\s+|questa\\s+|sta)?notte|nottata))|(((di\\s+|questa\\s+|sta)?notte|nottata)$)' + InexactNumberRegex = '\\b(un\\s+po\'\\s+di|alcun[ei]|qualche|parecchie?|divers[ie]|molt[oaei]|poc[oa]|poch[ei])\\b' InexactNumberUnitRegex = f'\\b((({InexactNumberRegex}\\s+|(?<=(prossim[ei]|scors[ei]|ultim[ei])\\s+)){DurationUnitRegex})|({DurationUnitRegex}(?=\\s+(seguenti|successiv[ei]|passat[ei]|precedent[ei]))))\\b' InexactNumberUnitRegex2 = f'\\b({InexactNumberRegex}\\s+{DurationUnitRegex}|(?decenni|anni|mesi|settimane|giorni|ore|minuti|secondi))' RelativeTimeUnitRegex = f'(((({ThisPrefixRegex}|{NextPrefixRegex}|{PreviousPrefixRegex})\\s+{TimeUnitRegex})|({ThisPrefixRegex}\\s+)?{TimeUnitRegex}\\s+({NextSuffixRegex}|{PastSuffixRegex}))|\\b(le|i|miei?)\\s+({RestrictedTimeUnitRegex}))' RelativeDurationUnitRegex = f'(((?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+)({DurationUnitRegex}))|(({DurationUnitRegex})(?=\\s+({NextSuffixRegex}|{PastSuffixRegex}|{ThisPrefixRegex})))|((le|i|miei?))\\s+({RestrictedTimeUnitRegex}))' - ReferenceDatePeriodRegex = f'\\b((quel(l[a\'])?)|((l[oa]\\s+)?stess[oa]))\\s+(?settimana|mese|anno|decennio|finesettimana|weekend)\\b' - ConnectorRegex = f'^\\s*(-|,|t|per l[e\']|all[e\']|intorno all[e\']|verso l[e\'])\\s*$' - ConnectorAndRegex = f'\\b(e(\\s+(il?|l[oae\']|gli))?)\\b.*' - FromRegex = f'\\b(da(l(l[oae\'])?|i|gli)?)$' - FromRegex2 = f'\\b(dopo(\\s*l[oae\']|il?)?)$' - FromToRegex = f'\\b(da(l(l[oae\'])?|i|gli)?).+(a(l(l[oae\'])?|i|gli)?)\\b.+' - SingleAmbiguousMonthRegex = f'(march)' - SingleAmbiguousTermsRegex = f'(?settimana|mese|anno|decennio|finesettimana|weekend)\\b' + ConnectorRegex = '^\\s*(-|,|t|per l[e\']|all[e\']|intorno all[e\']|verso l[e\'])\\s*$' + ConnectorAndRegex = '\\b(e(\\s+(il?|l[oae\']|gli))?)\\b.*' + FromRegex = '\\b(da(l(l[oae\'])?|i|gli)?)$' + FromRegex2 = '\\b(dopo(\\s*l[oae\']|il?)?)$' + FromToRegex = '\\b(da(l(l[oae\'])?|i|gli)?).+(a(l(l[oae\'])?|i|gli)?)\\b.+' + SingleAmbiguousMonthRegex = '(march)' + SingleAmbiguousTermsRegex = '(?({WrittenDayRegex}|{DayRegex}))' ForTheRegex = f'\\b((((?<=per\\s+il\\s+){FlexibleDayRegex})|((?\\s*(,|\\.|!|\\?|$)))' WeekDayAndDayOfMonthRegex = f'\\b{WeekDayRegex},?\\s+((il\\s+)?{FlexibleDayRegex})\\b(?!\\s+{MonthRegex}\\b)' WeekDayAndDayRegex = f'\\b{WeekDayRegex}\\s*,?\\s+(?!(il|l\')){DayRegex}(?!([-:]|(\\s+({AmDescRegex}|{{PmDescRegex|{OclockRegex}}}))))\\b' - RestOfDateRegex = f'\\bresto\\s+((di|del(l[a\'])?)\\s*)?((quest[oa\']|corrente|mia)\\s*)?(?settimana|mese|anno|decennio)(\\s+corrente)?\\b' - RestOfDateTimeRegex = f'\\bresto\\s+((di|del(la)?)\\s+)?((quest[oa]|corrente|mi[oa])\\s+)?(?giorn(o|ata))(\\s+corrente)?\\b' - SuffixAfterRegex = f'\\b(((a)\\s)?(o|e)\\s+(sopra|dopo|più\\s+tardi|più\\s+grande)(?!\\s+di))\\b' + RestOfDateRegex = '\\bresto\\s+((di|del(l[a\'])?)\\s*)?((quest[oa\']|corrente|mia)\\s*)?(?settimana|mese|anno|decennio)(\\s+corrente)?\\b' + RestOfDateTimeRegex = ( + '\\bresto\\s+((di|del(la)?)\\s+)?((quest[oa]|corrente|mi[oa])\\s+)?(?giorn(o|ata))(\\s+corrente)?\\b' + ) + SuffixAfterRegex = '\\b(((a)\\s)?(o|e)\\s+(sopra|dopo|più\\s+tardi|più\\s+grande)(?!\\s+di))\\b' LaterEarlyPeriodRegex = f'\\b((({PrefixPeriodRegex})(\\s+(di|del(l[ao\'])?))?)\\s*\\b\\s*(?{OneWordPeriodRegex})|({UnspecificEndOfRangeRegex}))\\b' WeekWithWeekDayRangeRegex = f'\\b((?({NextPrefixRegex}|{PreviousPrefixRegex}|questa)\\s+settimana)((\\s+[tf]ra\\s+{WeekDayRegex}\\s+e\\s+{WeekDayRegex})|(\\s+da\\s+{WeekDayRegex}\\s+a\\s+{WeekDayRegex})))\\b' - GeneralEndingRegex = f'^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$' - MiddlePauseRegex = f'\\s*(,)\\s*' - DurationConnectorRegex = f'^\\s*(?\\s+|e|,)\\s*$' - PrefixArticleRegex = f'\\b(il?|l[oae\']|gli)\\s*' - OrRegex = f'\\s*(o|oppure)\\s*' + GeneralEndingRegex = '^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$' + MiddlePauseRegex = '\\s*(,)\\s*' + DurationConnectorRegex = '^\\s*(?\\s+|e|,)\\s*$' + PrefixArticleRegex = '\\b(il?|l[oae\']|gli)\\s*' + OrRegex = '\\s*(o|oppure)\\s*' YearPlusNumberRegex = f'\\b(anno\\s+((?(\\d{{3,4}}))|{FullTextYearRegex}))\\b' NumberAsTimeRegex = f'\\b({EngTimeRegex}|{PeriodHourNumRegex}|{BaseDateTime.HourRegex})\\b' TimeBeforeAfterRegex = f'\\b(((?<=\\b(prima (di|dell[e\'])|non prima (di|dell[e\'])|per(\\s+l[e\'])?|dopo(\\s+l[e\'])?)\\s*)({EngTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}|{MidTimeRegex}))|{MidTimeRegex})\\b' - DateNumberConnectorRegex = f'^\\s*(?(,)?\\s+(il|all[e\']|(verso|per) l[e\']|intorno all[e\']))\\s*$' - DateAfterRegex = f'\\b((e|o)\\s+(dopo|passato|oltre))\\b' + DateNumberConnectorRegex = '^\\s*(?(,)?\\s+(il|all[e\']|(verso|per) l[e\']|intorno all[e\']))\\s*$' + DateAfterRegex = '\\b((e|o)\\s+(dopo|passato|oltre))\\b' YearPeriodRegex = f'(((dal|durante|nel|[tf]ra)\\s+(il\\s+)?)?{YearRegex}\\s*{TillRegex}\\s*{YearRegex})' - FutureSuffixRegex = f'\\b(((in|nel)\\s+)?(futuro|seguito))|(da\\s+questo\\s+momento)\\b' + FutureSuffixRegex = '\\b(((in|nel)\\s+)?(futuro|seguito))|(da\\s+questo\\s+momento)\\b' ModPrefixRegex = f'\\b({RelativeRegex}|{AroundRegex}|{BeforeRegex}|{AfterRegex}|{SinceRegex})\\b' ModSuffixRegex = f'\\b({AgoRegex}|{LaterRegex}|{BeforeAfterRegex}|{FutureSuffixRegex}|{PastSuffixRegex})\\b' ComplexDatePeriodRegex = f'(((da(l(l[aeo\'])?|i)?|durante|in|nel(l[aeo\'])?|negli)\\s*)?(?.+)\\s*({TillRegex})\\s*(?.+)|(([tf]ra)\\s+)(?.+)\\s*({RangeConnectorRegex})\\s*(?.+))' - AmbiguousPointRangeRegex = f'^(mar)$' - UnitMap = dict([("decenni", "10Y"), - ("decennio", "10Y"), - ("anni", "Y"), - ("anno", "Y"), - ("semestre", "Y"), - ("semestri", "Y"), - ("mesi", "MON"), - ("mese", "MON"), - ("settimane", "W"), - ("settimana", "W"), - ("giorni", "D"), - ("giorno", "D"), - ("giornata", "D"), - ("ore", "H"), - ("ora", "H"), - ("hrs", "H"), - ("hr", "H"), - ("h", "H"), - ("minuti", "M"), - ("minuto", "M"), - ("mins", "M"), - ("min", "M"), - ("secondi", "S"), - ("secondo", "S"), - ("secs", "S"), - ("sec", "S")]) - UnitValueMap = dict([("decenni", 315360000), - ("decennio", 315360000), - ("anni", 31536000), - ("anno", 31536000), - ("semestre", 31536000), - ("mesi", 2592000), - ("mese", 2592000), - ("settimane", 604800), - ("settimana", 604800), - ("giorni", 86400), - ("giorno", 86400), - ("ore", 3600), - ("ora", 3600), - ("hrs", 3600), - ("hr", 3600), - ("h", 3600), - ("minuti", 60), - ("minuto", 60), - ("mins", 60), - ("min", 60), - ("secondi", 1), - ("secondo", 1), - ("secs", 1), - ("sec", 1)]) - SpecialYearPrefixesMap = dict([("fiscale", "FY"), - ("scolastico", "SY")]) - SeasonMap = dict([("primavera", "SP"), - ("estate", "SU"), - ("autunno", "FA"), - ("inverno", "WI")]) - SeasonValueMap = dict([("SP", 3), - ("SU", 6), - ("FA", 9), - ("WI", 12)]) - CardinalMap = dict([("primo", 1), - ("prima", 1), - ("secondo", 2), - ("seconda", 2), - ("terzo", 3), - ("terza", 3), - ("quarto", 4), - ("quarta", 4), - ("quinto", 5), - ("quinta", 5)]) - DayOfWeek = dict([("lunedì", 1), - ("martedì", 2), - ("mercoledì", 3), - ("giovedì", 4), - ("venerdì", 5), - ("sabato", 6), - ("sabati", 6), - ("domenica", 0), - ("domeniche", 0), - ("lun", 1), - ("mar", 2), - ("mer", 3), - ("gio", 4), - ("ven", 5), - ("sab", 6), - ("dom", 0), - ("monday", 1), - ("tuesday", 2), - ("wednesday", 3), - ("thursday", 4), - ("friday", 5), - ("saturday", 6), - ("sunday", 0), - ("mon", 1), - ("tue", 2), - ("tues", 2), - ("wed", 3), - ("wedn", 3), - ("weds", 3), - ("thu", 4), - ("thur", 4), - ("thurs", 4), - ("fri", 5), - ("sat", 6), - ("sun", 0)]) - MonthOfYear = dict([("gennaio", 1), - ("febbraio", 2), - ("marzo", 3), - ("aprile", 4), - ("maggio", 5), - ("giugno", 6), - ("luglio", 7), - ("agosto", 8), - ("settembre", 9), - ("ottobre", 10), - ("novembre", 11), - ("dicembre", 12), - ("gen", 1), - ("feb", 2), - ("mar", 3), - ("apr", 4), - ("mag", 5), - ("giu", 6), - ("lug", 7), - ("ago", 8), - ("set", 9), - ("sett", 9), - ("ott", 10), - ("nov", 11), - ("dic", 12), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9)]) - Numbers = dict([("zero", 0), - ("uno", 1), - ("un", 1), - ("una", 1), - ("due", 2), - ("tre", 3), - ("quattro", 4), - ("cinque", 5), - ("sei", 6), - ("sette", 7), - ("otto", 8), - ("nove", 9), - ("dieci", 10), - ("undici", 11), - ("dodici", 12), - ("tredici", 13), - ("quattordici", 14), - ("quindici", 15), - ("sedici", 16), - ("diciassette", 17), - ("diciotto", 18), - ("diciannove", 19), - ("venti", 20), - ("ventuno", 21), - ("ventidue", 22), - ("ventitre", 23), - ("ventiquattro", 24), - ("venticinque", 25), - ("ventisei", 26), - ("ventisette", 27), - ("ventotto", 28), - ("ventinove", 29), - ("trenta", 30), - ("trentuno", 31), - ("trentadue", 32), - ("trentatre", 33), - ("trentaquattro", 34), - ("trentacinque", 35), - ("trentasei", 36), - ("trentasette", 37), - ("trentotto", 38), - ("trentanove", 39), - ("quaranta", 40), - ("quarantuno", 41), - ("quarantadue", 42), - ("quarantatre", 43), - ("quarantaquattro", 44), - ("quarantacinque", 45), - ("quarantasei", 46), - ("quarantasette", 47), - ("quarantotto", 48), - ("quarantanove", 49), - ("cinquanta", 50), - ("cinquantuno", 51), - ("cinquantadue", 52), - ("cinquantatre", 53), - ("cinquantaquattro", 54), - ("cinquantacinque", 55), - ("cinquantasei", 56), - ("cinquantasette", 57), - ("cinquantotto", 58), - ("cinquantanove", 59), - ("sessanta", 60), - ("sessantuno", 61), - ("sessantadue", 62), - ("sessantatre", 63), - ("sessantaquattro", 64), - ("sessantacinque", 65), - ("sessantasei", 66), - ("sessantasette", 67), - ("sessantotto", 68), - ("sessantanove", 69), - ("settanta", 70), - ("settantuno", 71), - ("settantadue", 72), - ("settantatre", 73), - ("settantaquattro", 74), - ("settantacinque", 75), - ("settantasei", 76), - ("settantasette", 77), - ("settantotto", 78), - ("settantanove", 79), - ("ottanta", 80), - ("ottantuno", 81), - ("ottantadue", 82), - ("ottantatre", 83), - ("ottantaquattro", 84), - ("ottantacinque", 85), - ("ottantasei", 86), - ("ottantasette", 87), - ("ottantotto", 88), - ("ottantanove", 89), - ("novanta", 90), - ("novantuno", 91), - ("novantadue", 92), - ("novantatre", 93), - ("novantaquattro", 94), - ("novantacinque", 95), - ("novantasei", 96), - ("novantasette", 97), - ("novantotto", 98), - ("novantanove", 99), - ("cento", 100)]) - DayOfMonth = dict([("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("13", 13), - ("14", 14), - ("15", 15), - ("16", 16), - ("17", 17), - ("18", 18), - ("19", 19), - ("20", 20), - ("21", 21), - ("22", 22), - ("23", 23), - ("24", 24), - ("25", 25), - ("26", 26), - ("27", 27), - ("28", 28), - ("29", 29), - ("30", 30), - ("31", 31)]) - DoubleNumbers = dict([("mezzo", 0.5), - ("mezza", 0.5), - ("metà", 0.5), - ("quarto", 0.25), - ("quarti", 0.25)]) - HolidayNames = dict([("easterday", ["pasqua", "giornodipasqua", "domenicadipasqua"]), - ("eastermonday", ["lunedidell'angelo"]), - ("fathersday", ["festadelpap\u00e0"]), - ("mothersday", ["festadellamamma"]), - ("memorialday", ["giornodellamemoria"]), - ("mardigras", ["martedigrasso"]), - ("ashwednesday", ["mercoledidelleceneri", "leceneri"]), - ("allsaintsday", ["tuttiisanti", "isanti"]), - ("allsoulsday", ["giornodeimorti", "imorti"]), - ("femaleday", ["festadelladonna", "festadelledonne"]), - ("ferragosto", ["ferragosto"]), - ("christmas", ["giornodinatale", "natale"]), - ("christmaseve", ["vigiliadinatale", "lavigilia"]), - ("newyear", ["capodannocinese", "capodanno"]), - ("valentinesday", ["sanvalentino"]), - ("stpatrickday", ["giornodisanpatrizio"]), - ("aprilfools", ["pescedaprile"]), - ("labourday", ["festadeilavoratori", "festadellavoro"]), - ("independenceday", ["giornodell'indipendenza"]), - ("liberationday", ["giornodellaliberazione", "festadellaliberazione", "laliberazione"]), - ("republicday", ["festadellarepubblica"]), - ("halloweenday", ["halloween"]), - ("newyeareve", ["cenonedicapodoanno", "veglionedicapodanno", "lavigiliadicapodanno", "vigiliadicapodanno"]), - ("thanksgiving", ["giornodelringraziamento", "ringraziamento"])]) - WrittenDecades = dict([("dieci", 10), - ("venti", 20), - ("trenta", 30), - ("quaranta", 40), - ("cinquanta", 50), - ("sessanta", 60), - ("settanta", 70), - ("ottanta", 80), - ("novanta", 90)]) - SpecialDecadeCases = dict([("questo secolo", 2000), - ("duemila", 2000)]) + AmbiguousPointRangeRegex = '^(mar)$' + UnitMap = dict( + [ + ("decenni", "10Y"), + ("decennio", "10Y"), + ("anni", "Y"), + ("anno", "Y"), + ("semestre", "Y"), + ("semestri", "Y"), + ("mesi", "MON"), + ("mese", "MON"), + ("settimane", "W"), + ("settimana", "W"), + ("giorni", "D"), + ("giorno", "D"), + ("giornata", "D"), + ("ore", "H"), + ("ora", "H"), + ("hrs", "H"), + ("hr", "H"), + ("h", "H"), + ("minuti", "M"), + ("minuto", "M"), + ("mins", "M"), + ("min", "M"), + ("secondi", "S"), + ("secondo", "S"), + ("secs", "S"), + ("sec", "S"), + ] + ) + UnitValueMap = dict( + [ + ("decenni", 315360000), + ("decennio", 315360000), + ("anni", 31536000), + ("anno", 31536000), + ("semestre", 31536000), + ("mesi", 2592000), + ("mese", 2592000), + ("settimane", 604800), + ("settimana", 604800), + ("giorni", 86400), + ("giorno", 86400), + ("ore", 3600), + ("ora", 3600), + ("hrs", 3600), + ("hr", 3600), + ("h", 3600), + ("minuti", 60), + ("minuto", 60), + ("mins", 60), + ("min", 60), + ("secondi", 1), + ("secondo", 1), + ("secs", 1), + ("sec", 1), + ] + ) + SpecialYearPrefixesMap = dict([("fiscale", "FY"), ("scolastico", "SY")]) + SeasonMap = dict([("primavera", "SP"), ("estate", "SU"), ("autunno", "FA"), ("inverno", "WI")]) + SeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + CardinalMap = dict( + [ + ("primo", 1), + ("prima", 1), + ("secondo", 2), + ("seconda", 2), + ("terzo", 3), + ("terza", 3), + ("quarto", 4), + ("quarta", 4), + ("quinto", 5), + ("quinta", 5), + ] + ) + DayOfWeek = dict( + [ + ("lunedì", 1), + ("martedì", 2), + ("mercoledì", 3), + ("giovedì", 4), + ("venerdì", 5), + ("sabato", 6), + ("sabati", 6), + ("domenica", 0), + ("domeniche", 0), + ("lun", 1), + ("mar", 2), + ("mer", 3), + ("gio", 4), + ("ven", 5), + ("sab", 6), + ("dom", 0), + ("monday", 1), + ("tuesday", 2), + ("wednesday", 3), + ("thursday", 4), + ("friday", 5), + ("saturday", 6), + ("sunday", 0), + ("mon", 1), + ("tue", 2), + ("tues", 2), + ("wed", 3), + ("wedn", 3), + ("weds", 3), + ("thu", 4), + ("thur", 4), + ("thurs", 4), + ("fri", 5), + ("sat", 6), + ("sun", 0), + ] + ) + MonthOfYear = dict( + [ + ("gennaio", 1), + ("febbraio", 2), + ("marzo", 3), + ("aprile", 4), + ("maggio", 5), + ("giugno", 6), + ("luglio", 7), + ("agosto", 8), + ("settembre", 9), + ("ottobre", 10), + ("novembre", 11), + ("dicembre", 12), + ("gen", 1), + ("feb", 2), + ("mar", 3), + ("apr", 4), + ("mag", 5), + ("giu", 6), + ("lug", 7), + ("ago", 8), + ("set", 9), + ("sett", 9), + ("ott", 10), + ("nov", 11), + ("dic", 12), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ] + ) + Numbers = dict( + [ + ("zero", 0), + ("uno", 1), + ("un", 1), + ("una", 1), + ("due", 2), + ("tre", 3), + ("quattro", 4), + ("cinque", 5), + ("sei", 6), + ("sette", 7), + ("otto", 8), + ("nove", 9), + ("dieci", 10), + ("undici", 11), + ("dodici", 12), + ("tredici", 13), + ("quattordici", 14), + ("quindici", 15), + ("sedici", 16), + ("diciassette", 17), + ("diciotto", 18), + ("diciannove", 19), + ("venti", 20), + ("ventuno", 21), + ("ventidue", 22), + ("ventitre", 23), + ("ventiquattro", 24), + ("venticinque", 25), + ("ventisei", 26), + ("ventisette", 27), + ("ventotto", 28), + ("ventinove", 29), + ("trenta", 30), + ("trentuno", 31), + ("trentadue", 32), + ("trentatre", 33), + ("trentaquattro", 34), + ("trentacinque", 35), + ("trentasei", 36), + ("trentasette", 37), + ("trentotto", 38), + ("trentanove", 39), + ("quaranta", 40), + ("quarantuno", 41), + ("quarantadue", 42), + ("quarantatre", 43), + ("quarantaquattro", 44), + ("quarantacinque", 45), + ("quarantasei", 46), + ("quarantasette", 47), + ("quarantotto", 48), + ("quarantanove", 49), + ("cinquanta", 50), + ("cinquantuno", 51), + ("cinquantadue", 52), + ("cinquantatre", 53), + ("cinquantaquattro", 54), + ("cinquantacinque", 55), + ("cinquantasei", 56), + ("cinquantasette", 57), + ("cinquantotto", 58), + ("cinquantanove", 59), + ("sessanta", 60), + ("sessantuno", 61), + ("sessantadue", 62), + ("sessantatre", 63), + ("sessantaquattro", 64), + ("sessantacinque", 65), + ("sessantasei", 66), + ("sessantasette", 67), + ("sessantotto", 68), + ("sessantanove", 69), + ("settanta", 70), + ("settantuno", 71), + ("settantadue", 72), + ("settantatre", 73), + ("settantaquattro", 74), + ("settantacinque", 75), + ("settantasei", 76), + ("settantasette", 77), + ("settantotto", 78), + ("settantanove", 79), + ("ottanta", 80), + ("ottantuno", 81), + ("ottantadue", 82), + ("ottantatre", 83), + ("ottantaquattro", 84), + ("ottantacinque", 85), + ("ottantasei", 86), + ("ottantasette", 87), + ("ottantotto", 88), + ("ottantanove", 89), + ("novanta", 90), + ("novantuno", 91), + ("novantadue", 92), + ("novantatre", 93), + ("novantaquattro", 94), + ("novantacinque", 95), + ("novantasei", 96), + ("novantasette", 97), + ("novantotto", 98), + ("novantanove", 99), + ("cento", 100), + ] + ) + DayOfMonth = dict( + [ + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("13", 13), + ("14", 14), + ("15", 15), + ("16", 16), + ("17", 17), + ("18", 18), + ("19", 19), + ("20", 20), + ("21", 21), + ("22", 22), + ("23", 23), + ("24", 24), + ("25", 25), + ("26", 26), + ("27", 27), + ("28", 28), + ("29", 29), + ("30", 30), + ("31", 31), + ] + ) + DoubleNumbers = dict([("mezzo", 0.5), ("mezza", 0.5), ("metà", 0.5), ("quarto", 0.25), ("quarti", 0.25)]) + HolidayNames = dict( + [ + ("easterday", ["pasqua", "giornodipasqua", "domenicadipasqua"]), + ("eastermonday", ["lunedidell'angelo"]), + ("fathersday", ["festadelpap\u00e0"]), + ("mothersday", ["festadellamamma"]), + ("memorialday", ["giornodellamemoria"]), + ("mardigras", ["martedigrasso"]), + ("ashwednesday", ["mercoledidelleceneri", "leceneri"]), + ("allsaintsday", ["tuttiisanti", "isanti"]), + ("allsoulsday", ["giornodeimorti", "imorti"]), + ("femaleday", ["festadelladonna", "festadelledonne"]), + ("ferragosto", ["ferragosto"]), + ("christmas", ["giornodinatale", "natale"]), + ("christmaseve", ["vigiliadinatale", "lavigilia"]), + ("newyear", ["capodannocinese", "capodanno"]), + ("valentinesday", ["sanvalentino"]), + ("stpatrickday", ["giornodisanpatrizio"]), + ("aprilfools", ["pescedaprile"]), + ("labourday", ["festadeilavoratori", "festadellavoro"]), + ("independenceday", ["giornodell'indipendenza"]), + ("liberationday", ["giornodellaliberazione", "festadellaliberazione", "laliberazione"]), + ("republicday", ["festadellarepubblica"]), + ("halloweenday", ["halloween"]), + ("newyeareve", ["cenonedicapodoanno", "veglionedicapodanno", "lavigiliadicapodanno", "vigiliadicapodanno"]), + ("thanksgiving", ["giornodelringraziamento", "ringraziamento"]), + ] + ) + WrittenDecades = dict( + [ + ("dieci", 10), + ("venti", 20), + ("trenta", 30), + ("quaranta", 40), + ("cinquanta", 50), + ("sessanta", 60), + ("settanta", 70), + ("ottanta", 80), + ("novanta", 90), + ] + ) + SpecialDecadeCases = dict([("questo secolo", 2000), ("duemila", 2000)]) DefaultLanguageFallback = 'DMY' DurationDateRestrictions = [] - AmbiguityFiltersDict = dict([("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), - ("\\bgiorno|pomeriggio|sera|notte\\b", "\\b(buona?\\s*(giorno|pomeriggio|sera|notte))\\b"), - ("^(apr|ago|dic|feb|gen|lug|giu|mar|mag|nov|ott|sett?)$", "([$%£&!?@#])(apr|ago|dic|feb|gen|lug|giu|mar|mag|nov|ott|sett?)|(apr|ago|dic|feb|gen|lug|giu|mar|mag|nov|ott|sett?)([$%£&@#])"), - ("^\\d{1,4}-\\d{1,4}$", "\\d{1,4}-\\d{1,4}-\\d|\\d-\\d{1,4}-\\d{1,4}"), - ("^\\d{1,4}-\\d{1,4}-\\d{1,4}$", "\\d{1,4}-\\d{1,4}-\\d{1,4}-\\d|\\d-\\d{1,4}-\\d{1,4}-\\d{1,4}")]) + AmbiguityFiltersDict = dict( + [ + ("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), + ("\\bgiorno|pomeriggio|sera|notte\\b", "\\b(buona?\\s*(giorno|pomeriggio|sera|notte))\\b"), + ( + "^(apr|ago|dic|feb|gen|lug|giu|mar|mag|nov|ott|sett?)$", + "([$%£&!?@#])(apr|ago|dic|feb|gen|lug|giu|mar|mag|nov|ott|sett?)|(apr|ago|dic|feb|gen|lug|giu|mar|mag|nov|ott|sett?)([$%£&@#])", + ), + ("^\\d{1,4}-\\d{1,4}$", "\\d{1,4}-\\d{1,4}-\\d|\\d-\\d{1,4}-\\d{1,4}"), + ("^\\d{1,4}-\\d{1,4}-\\d{1,4}$", "\\d{1,4}-\\d{1,4}-\\d{1,4}-\\d|\\d-\\d{1,4}-\\d{1,4}-\\d{1,4}"), + ] + ) MorningTermList = [r'mattino', r'mattina', r'mattine', r'mattinata'] AfternoonTermList = [r'pomeriggio', r'pomeriggi', r'dopo pranzo'] EveningTermList = [r'sera', r'sere', r'serata'] @@ -616,13 +683,37 @@ class ItalianDateTime: MinusOneDayTerms = [r'ieri', r'giorno prima'] PlusTwoDayTerms = [r'dopodomani', r'domani l\'altro'] MinusTwoDayTerms = [r'l\'altroieri', r'altroieri'] - FutureStartTerms = [r'questo', r'questa', r'questi', r'queste', r'quest\'', r'prossimo', r'prossima', r'prossimi', r'prossime', r'prossim\''] + FutureStartTerms = [ + r'questo', + r'questa', + r'questi', + r'queste', + r'quest\'', + r'prossimo', + r'prossima', + r'prossimi', + r'prossime', + r'prossim\'', + ] FutureEndTerms = [r'prossimo', r'prossima', r'prossimi', r'prossime', r'prossim\''] - LastCardinalTerms = [r'ultimo', r'ultima', r'ultimi', r'ultime', r'ultim\'', r'l\'ultimo', r'l\'ultima', r'l\'ultimi', r'l\'ultime', r'l\'ultim\''] + LastCardinalTerms = [ + r'ultimo', + r'ultima', + r'ultimi', + r'ultime', + r'ultim\'', + r'l\'ultimo', + r'l\'ultima', + r'l\'ultimi', + r'l\'ultime', + r'l\'ultim\'', + ] MonthTerms = [r'mese', r'mesi'] MonthToDateTerms = [r'dall\'inizio del mese'] WeekendTerms = [r'finesettimana', r'weekend'] WeekTerms = [r'settimana', r'settimane'] YearTerms = [r'anno', r'anni', r'annata', r'annate'] YearToDateTerms = [r'dall\'inizio dell\'anno', r'da inizio anno'] + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/japanese_date_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/japanese_date_time.py new file mode 100644 index 0000000000..17d4870a4f --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/japanese_date_time.py @@ -0,0 +1,935 @@ +# ------------------------------------------------------------------------------ +# +# This code was generated by a tool. +# Changes to this file may cause incorrect behavior and will be lost if +# the code is regenerated. +# +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +# ------------------------------------------------------------------------------ + +from .base_date_time import BaseDateTime + + +# pylint: disable=line-too-long + + +class JapaneseDateTime: + LangMarker = 'Jpn' + MonthRegex = '(?(正|一|二|三|四|五|六|七|八|九|十|十一|十二|0?[1-9]|1[0-2])\\s*(か月(?!で)|月間?))' + MonthRegexForPeriod = '(?正月|一月|二月|三月|四月|五月|六月|七月|八月|九月|十月|十一月|十二月|(0?[1-9]|1[0-2])か?月)(?=\\b|t|まで|から)?' + MonthNumRegexForPeriod = '(?0?[1-9]|1[0-2])(?=\\b|t|まで|から)?' + DayRegex = '(?[0-2]?[1-9]|[1-3]0|31)((日|目)(?!かかる|待つ|泊まる|経つ|都合)間?)?' + DayRegexForPeriod = '(?3[01]|[0-2]?\\d|(三十一?|(一|二)?十?[一二三四五六七八九]))((\\s*日(?!かかる|待つ|泊まる|経つ))目?)?(?=\\b|t|まで|から)?' + DayNumberRegex = '(二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|二十一|三十一|十二|十三|十四|十五|十六|十七|十八|十一|十|二十|廿(?!日市市)|三十|一|二|三|四|五|六|七|八|九)' + DateDayRegexInCJK = f'(?初一|({DayNumberRegex}|3[01]|[0-2]?\\d)(\\s*日|号)(?!かかる|待つ|泊まる|経つ))目?' + DayRegexNumInCJK = '(?一|十一|二十一|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|廿(?!日市市)|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|廿|卅)' + MonthNumRegex = '(?0?[1-9]|1[0-2])' + TwoNumYear = '50' + YearNumRegex = '((?((?\\d{2,4})(?!\\$|ドル|円|¥))(\\s*年)?' + ZeroToNineIntegerRegexCJK = '[一二三四五六七八九十廿零壹贰叁肆伍陆柒捌玖〇两千俩倆仨]' + DynastyStartYear = '元' + RegionTitleRegex = '(昭和|平成|令和|大正|明治|寛政|享和|文化|文政|天保|弘化|嘉永|安政|万延|文久|元治|慶応)' + DynastyYearRegex = f'((?{RegionTitleRegex})(?({DynastyStartYear}|\\d{{1,2}}|({ZeroToNineIntegerRegexCJK}){{1,3}}))年?)|(((?慶応)|(?明治)|(?大正)|(?昭和)|(?平成)|(?令和))(\\d+|元|{ZeroToNineIntegerRegexCJK})年)' + DateYearInCJKRegex = f'(?({ZeroToNineIntegerRegexCJK}{{2,4}}|{DynastyYearRegex}))年?' + WeekDayRegex = '(前の?)?(週(間)?の?)?(?(日|月|火|水|木|金|土)曜日?)' + WeekDayStartEnd = f'(^(の)?{WeekDayRegex}|{WeekDayRegex}$)' + LunarRegex = '(农历|初一|正月|大年|旧暦)' + DateThisRegex = f'(这个|这一个|这|这一|本|(?今週)|これ?)(的|の)?({WeekDayRegex}|日)' + DateLastRegex = f'(上一个|上个|上一|上|最后一个|最后|前の?|(?先週)|最後)(的|の)?({WeekDayRegex}|日)' + DateNextRegex = f'(下一个|下个|下一|下|(?(来|翌)週)|次)(的|の)?{WeekDayRegex}' + WeekWithWeekDayRangeRegex = f'({DateThisRegex}|{DateNextRegex}|{DateLastRegex})(から)({WeekDayRegex})' + WoMLastRegex = '過去|去|最後|先' + WoMPreviousRegex = '前' + WoMNextRegex = '次|翌|来|これから(の)?' + SpecialMonthRegex = '(先月|来月|今月|前月|再来月|昨月|先々月|ぜんげつ|(せん)?せんげつ|さくげつ|らいげつ|こんげつ)' + SpecialYearRegex = '(ことし|さ?らいねん|きょねん|さくねん)' + SpecialDayRegex = '((いっ)?さくじつ|おとつい|最近(?!の)|前天|后天|明日から二日((?今日)から(?1日半)(の間)?)|((?今日)から(?2日半)(の間)?)|(?本日)|昨日の2日前|昨日から4日|今日から二日|今日から4日|昨日から2日間|昨天|明天|今天|(?日曜日?|月曜日?|火曜日?|水曜日?|木曜日?|金曜日?|土曜日?))?' + WeekDayOfMonthRegex = f'((({SpecialMonthRegex}|{MonthRegex}|{MonthNumRegex}|((这个|这一个|这|这一|本|今|上个|上一个|上|上一|去|下个|下一个|下|下一|明)月))(的|の)?\\s*)?(第|最)?(?([初一二三四五])|最後|最終|([1-5])|最后一)(个|の|\\s)*{WeekDayRegex})' + WeekDayAndDayRegex = f'({DayRegexForPeriod}(の|的)?(\\s|,)*{WeekDayRegex})' + ThisPrefixRegex = '这个|这一个|这|这一|本|今|こ' + LastPrefixRegex = '上个|上一个|上|上一|去|過去|ここ|最後|前|先|昨|最終' + NextPrefixRegex = '下个|下一个|下|下一|明(?!治)|次|再?来|向こう|これから(の)?|翌|向こう' + RelativeRegex = f'(?({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex}))' + SpecialDate = f'(?({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex})年)?(の|的)?(?({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex})(の|的)?月)?(の|的)?{DateDayRegexInCJK}' + DateUnitRegex = '(?年|个月|月|周|(?営業)日|(?あとで?)|(?の早い時間)' + DateRegexList1 = f'({LunarRegex}(的|の|\\s)*)?(({SimpleYearRegex}|{DateYearInCJKRegex})[/\\\\\\-の的]?(\\s*{MonthRegex})[/\\\\\\-の的]?(\\s*{DayRegexForPeriod})((\\s|,)*{WeekDayRegex})?)' + DateRegexList2 = f'((?到|至|から|--|-|—|——|~|–)(?!\\d泊)' + DatePeriodRangeSuffixRegex = '(に?まで|の間)' + DatePeriodRangePrefixRegex = '^\\b$' + DatePeriodTillSuffixRequiredRegex = '(?与|和)' + DatePeriodDayRegexInCJK = '(?(二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|二十二|二十三|二十一|十一|三十一|十二|十三|十四|十五|十六|十七|十八|十九|十|二十|三十|一|十|二|三|四|五|六|七|八|九|3[0-1]|[1-2]\\d|0?[1-9])日|初一|三十|(一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|三十|3[0-1]|[1-2]\\d|0?[1-9])号|一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|十|二十|三十|廿(?!日市市)|卅)目?' + DatePeriodThisRegex = '(?再来|以降)|下个|下一个|下|下一|最初|来|向こう|これから(の)?|翌|今後|次(の)?|の後' + DateRangePrepositions = '((ひと|こ|私の|その|この|これらの|それらの)\\s*)?' + RelativeMonthRegex = f'(?({DatePeriodThisRegex}|{DatePeriodLastRegex}|{DatePeriodNextRegex})\\s*月)' + HalfYearRegex = '((?の?(上|前)半期?)|(?の?(下|后|後)半期?))' + YearRegex = f'((({YearNumRegex})(\\s*年)?|({SimpleYearRegex})\\s*年)(に)?{HalfYearRegex}?)|({DynastyYearRegex})' + StrictYearRegex = f'(((ひと|こ|その|この|これらの|それらの)\\s*)?{YearRegex})' + YearRegexInNumber = '(?(\\d{3,4}))' + DatePeriodYearInCJKRegex = f'(?({ZeroToNineIntegerRegexCJK}{{2,4}}))年{HalfYearRegex}?' + MonthSuffixRegex = f'(?({RelativeMonthRegex}|{MonthRegex}))' + SimpleCasesRegex = f'({DateRangePrepositions})(({YearRegex}|{DatePeriodYearInCJKRegex})\\s*)?{MonthSuffixRegex}({DatePeriodDayRegexInCJK}|{DayRegex})\\s*{DatePeriodTillRegex}\\s*({DatePeriodDayRegexInCJK}|{DayRegex})(?!\\d)((\\s+|\\s*,\\s*){YearRegex})?(までの間|まで|の間)?' + YearAndMonth = f'(({YearNumRegex}|{DateYearInCJKRegex})の?\\s*{MonthRegex}(\\b|から)?)' + SimpleYearAndMonth = f'({DateRangePrepositions})({YearNumRegex}[/\\\\\\-]{MonthNumRegex}(\\b|から)$)' + PureNumYearAndMonth = f'({DateRangePrepositions})({YearRegexInNumber}\\s*[-\\.\\/]\\s*{MonthNumRegex})(?!\\d)|({MonthNumRegex}\\s*\\/\\s*{YearRegexInNumber})' + OneWordPeriodRegex = f'({DateRangePrepositions})((((周末|週(間)?|日間?|明年|(?(今|再来|翌|去|前|后|来)年))(,|の(残り)?)?\\s*)?{MonthRegex}|(({DatePeriodThisRegex}|{DatePeriodLastRegex}|{DatePeriodNextRegex})の?\\s*)?(数|\\d\\d?|{ZeroToNineIntegerRegexCJK}|(?半))?(?ヶ?((?営業)日|(?半)|(?の残りの日|いっぱい)?)|(({DatePeriodThisRegex}|{DatePeriodLastRegex}|{DatePeriodNextRegex})({MonthRegex}(?!で)|{DayRegex})))(?後に|以内に|初来)?' + LaterEarlyPeriodRegex = '((?来|翌)|(?今|同じ)|(?この|去|先|前(の)?))?(?(?週(間)?)|(?(正|一|二|三|四|五|六|七|八|九|十|十一|十二|0?[1-9]|1[0-2]))?((?(?の下旬|この後|の後半)|の終わり(ごろ)?|末|下旬)|(?(の)?(半ば|中旬))|(?(の)?初め|のはじめ|早くに|初旬|(?ちょっと前に|上旬(に)?)))' + DatePointWithAgoAndLater = '((?今日)|(?昨日)|(?明日))(から|の)(\\d)(?週間|日)((?以内)|(?以上)(?前)|(?以上(あと)?))' + WeekOfMonthRegex = f'({DateRangePrepositions})((?({YearRegex}\\s*)?{MonthSuffixRegex}(的|の))(?第一|第二|第三|第四|第五|最后一|第\\d|{DatePeriodThisRegex}|{DatePeriodLastRegex}|{DatePeriodNextRegex})?\\s*の?(週|周)\\s*)' + WeekOfYearRegex = f'({DateRangePrepositions})(?({YearRegex}|{RelativeRegex}年)(的|の)(?第一|第二|第三|第四|第五|最后一|第\\d|{DatePeriodThisRegex}|{DatePeriodLastRegex}|{DatePeriodNextRegex})?\\s*の?(週|周)\\s*)' + WeekOfDateRegex = f'(({DateRangePrepositions})({MonthSuffixRegex}({DayRegex})(的|の))第?\\s*の?(週|周)s*)|({DayRegex}日の?(週(間)?))' + MonthOfDateRegex = f'({DateRangePrepositions})({MonthSuffixRegex}({DayRegex})(的|の))第?\\s*の?(月)s*' + RestOfDateRegex = '((当|この|今)(?日)の)?(?残りの?)(?時間|日|週|月|年)' + UnitRegex = '(?ヶ?(年|(个)?月|周|週間|日|天))' + FollowedUnit = f'^\\s*{UnitRegex}' + NumberCombinedWithUnit = f'(?\\d+(\\.\\d*)?){UnitRegex}' + YearMonthDayRange = f'({YearNumRegex}[/\\\\\\-]?({MonthRegex}|{MonthNumRegex})[/\\\\\\-]?({DayRegexForPeriod}|{DateDayRegexInCJK})から{YearNumRegex}[/\\\\\\-]?({MonthRegex}|{MonthNumRegex})[/\\\\\\-]?({DayRegexForPeriod}|{DateDayRegexInCJK})(までの間|まで|の間|にわたって))|(({YearNumRegex})?({MonthRegex}|{MonthNumRegex})[/\\\\\\-]?({DayRegexForPeriod}|{DateDayRegexInCJK}){WeekDayRegex}?から({MonthRegex}|{MonthNumRegex})?({DayRegexForPeriod}|{DateDayRegexInCJK}){WeekDayRegex}(までの間|まで|の間|にわたって))' + YearMonthRange = f'({YearNumRegex}[/\\\\\\-]?({MonthRegex}|{MonthNumRegex})から{YearNumRegex}[/\\\\\\-]?({MonthRegex}|{MonthNumRegex})(までの間|まで|の間|にわたって))' + MonthDayRange = f'({YearNumRegex})?({MonthRegex}|{MonthNumRegex})[/\\\\\\-]?(({DayRegexForPeriod}|{DateDayRegexInCJK})|{WeekDayRegex})から(({DayRegexForPeriod}|{DateDayRegexInCJK})|{WeekDayRegex})(までの間|まで|の間|にわたって)' + YearToYear = f'({DateRangePrepositions})(({SpecialYearRegex}|{DatePeriodYearInCJKRegex}|{YearNumRegex})から({SpecialYearRegex}|{DatePeriodYearInCJKRegex}|{YearNumRegex})(ま(での間|で)?|の間|にわたって))' + YearToYearSuffixRequired = '^[.]' + MonthToMonth = f'({DateRangePrepositions})(({SimpleYearRegex}?({SpecialMonthRegex}|{MonthRegex})(SpecialDayRegex}}|{DayRegex})?から({SpecialMonthRegex}|{MonthRegex})(SpecialDayRegex}}|{DayRegex})?(までの間|まで|の間))|({SimpleYearRegex}{MonthRegexForPeriod}から{SimpleYearRegex}{MonthRegexForPeriod}(までの間|まで|の間))|({SimpleYearRegex}[/\\\\\\-](?{MonthNumRegexForPeriod})から{SimpleYearRegex}[/\\\\\\-](?{MonthNumRegexForPeriod})(までの間|まで|の間)))' + MonthToMonthSuffixRequired = '^[.]' + DayToDay = f'({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex})?(({SpecialMonthRegex}|{MonthRegex})の?)?(({SpecialDayRegex}|{DayRegex}|{WeekDayRegex})から(({SpecialMonthRegex}|{MonthRegex})の?)?({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex})?((今月|来月|{MonthRegex})の?)?({SpecialDayRegex}|{DayRegex}|{WeekDayRegex})(までの間|まで|の間))|{SpecialDayRegex}' + FirstLastOfYearRegex = f'(({DatePeriodYearInCJKRegex}|{YearRegex}|(?再来年|翌年|来年|今年|去年))的?)((?前)|(?(最后|最後|最終)))' + ComplexDatePeriodRegex = f'({DateRangePrepositions})(?.+)(から)(?.+)(までの間|(?まで)|(?(この|(?((?以内に)|後に|向こう|后|次の|今後|今日の午後|これから(の)?|(?春(?!節)|夏|秋|冬)(天|季)?(の)?((?半ば)|(?初め|のはじめ)|(?終わり(ごろ)?|末|下旬))?' + WhichWeekRegex = '第(?5[0-3]|[1-4]\\d|0?[1-9])週' + SeasonWithYear = f'({DateRangePrepositions})(({YearRegex}|{DatePeriodYearInCJKRegex}|(?再来年|翌年|来年|今年|去年))(的|の)?)?({ThisPrefixRegex}|{LastPrefixRegex}|{NextPrefixRegex})?{SeasonRegex}' + QuarterRegex = f'({DateRangePrepositions})((({YearRegex}|{DatePeriodYearInCJKRegex}|(?再来年|翌年|来年|今年|去年))(的|の)?)(第(?1|2|3|4|一|二|三|四)(四半期|クォーター)?)|(第(?1|2|3|4|一|二|三|四)(四半期|クォーター)))|(({DatePeriodLastRegex}|{DatePeriodThisRegex}|{DatePeriodNextRegex})(四半期|クォーター))' + CenturyNumRegex = '(?\\d|1\\d|2\\d)世紀' + CenturyRegexInCJK = ( + '(?一|二|三|四|五|六|七|八|九|十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|二十一|二十二)世紀' + ) + CenturyRegex = f'({CenturyNumRegex}|{CenturyRegexInCJK})' + RelativeCenturyRegex = f'(?({DatePeriodLastRegex}|{DatePeriodThisRegex}|{DatePeriodNextRegex}))世紀' + DecadeRegexInCJK = '(?十|一十|二十|三十|四十|五十|六十|七十|八十|九十)' + DecadeRegex = f'({DateRangePrepositions})(?({CenturyRegex}|{CenturyRegexInCJK}|{RelativeCenturyRegex}))?の?(?(?\\d{{2}}(?=\\d)))?(?((\\d{{1}}0)|{DecadeRegexInCJK}))年代(のごろ)?' + TimeHourNumRegex = '(?^(,?(夜の|的|の(?朝|夜|午後|晩)?|t),?|在)$)' + NowRegex = '(?出来る限り早く|できるだけ早く|现在|马上|立刻|刚刚才|刚刚|刚才|今日中|今(?!日)(すぐ)?)' + NightRegex = '(?早|晚|夜|泊(?=の?予約))' + TomorrowRegex = '(?(?昨日の?(午前|午後|中|夜|泊(?=の?予約)|朝)?)' + TodayRegex = '(?(今朝の?|今朝の午前|今晩|今晚|今早|今晨|明晚|明早|明晨|昨晚|今夜|昨夜)(的|在)?)' + FromNowRegex = '((?今)から)' + SpecialDayHourRegex = f'((?{TimeHourCJKRegex}|{TimeHourNumRegex})(時間?|(:00)))' + SpecialDayMinuteRegex = f'((?{TimeMinuteCJKRegex}|{TimeMinuteNumRegex})分間?)' + SpecialDaySecondRegex = f'((?{TimeSecondCJKRegex}|{TimeSecondNumRegex})秒間?)' + SpecialDayModRegex = '((?過ぎに|以降)|(?で)|(?弱|たらず)|(?以上))' + SpecialDayEndOfRegex = f'((?明日の終わり|今?({WeekDayRegex}の?終わり))|(?日の終わり|一日の終わり|その日の終わり))' + TimeOfSpecialDayRegex = f'(({SpecialDayEndOfRegex}|{WeekDayRegex}|{TomorrowRegex}|{YesterdayRegex}|あと|{TodayRegex})(\\d日)?(と)?(({SpecialDayHourRegex}{SpecialDayMinuteRegex}?{SpecialDaySecondRegex}?)|({SpecialDayMinuteRegex}{SpecialDaySecondRegex}?)){SpecialDayModRegex}?)|(({SpecialDayHourRegex}(の?うちに)))|(({SpecialDayEndOfRegex}|{TomorrowRegex}|{YesterdayRegex}|あと|{TodayRegex}){SpecialDayModRegex}?)|({WeekDayRegex}(\\d日)?(と)?{SpecialDayModRegex})|({FromNowRegex}\\d+(分|時|秒)後)' + NowTimeRegex = '(现在|今)' + RecentlyTimeRegex = '(刚刚才?|刚才)' + AsapTimeRegex = '(出来る限り早く|立刻|马上)' + DateTimePeriodTillRegex = '(? 到|至|から|--|-|—|——|~)' + DateTimePeriodFromPrefixRegex = '(从)' + DateTimePeriodFromSuffixRegex = '(の間|まで(の間)?)' + DateTimePeriodConnectorRegex = '(和|与|到)' + DateTimePeriodPrepositionRegex = '(?^\\s*(的|の(?!午)|在)\\s*$)' + BeforeAfterRegex = '(?[零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)' + ZhijianRegex = '^\\s*(之间|之内|期间|中间|间)' + DateTimePeriodThisRegex = '这个|这一个|这|这一|今後|今から|これから' + DateTimePeriodLastRegex = '上个|上一个|上|上一|昨' + DateTimePeriodNextRegex = '下个|下一个|下|下一' + AmPmDescRegex = '(?(am|a\\.m\\.|a m|a\\. m\\.|a\\.m|a\\. m|a m|pm|p\\.m\\.|p m|p\\. m\\.|p\\.m|p\\. m|p m|夜|晚|晩|午後|午后|午前(半ば|中)?|正午|真昼|夜中|深夜|昼食時|夕方に|朝|午後|昼(?!食)))' + TimeOfDayRegex = '(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|夜间|深夜|傍晚|晩|泊(?=の?予約)|夜|((?ぎりぎり)|(今夜|今晩|今朝|今早|今晨|明晚|明早|明晨|昨晚)|(({FutureRegex}|{PastRegex})(?(日|月|火|水|木|金|土)曜日?)の(午前|午後|中|夜|泊(?=の?予約)|朝)((?(([零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)(つ)?)|([0-1]?\\d|2[0-4]))時間?)((?([二三四五]?十[一二三四五六七八九]?|六十|[零〇一二三四五六七八九])|([0-5]?\\d))分間?)?((?([二三四五]?十[一二三四五六七八九]?|六十|[零〇一二三四五六七八九])|([0-5]?\\d))秒間?)?まで)|(({FutureRegex}|{PastRegex})の?(?数)((時|分|秒)間?)))' + DateTimePeriodUnitRegex = '(?(時|分|秒)間?)' + DateTimePeriodFollowedUnit = f'^\\s*{DateTimePeriodUnitRegex}' + DateTimePeriodNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?){DateTimePeriodUnitRegex}' + PlusOneDayRegex = 'あす|あした|明日|来|次|翌' + MinusOneDayRegex = 'きのう|最後の日|前日|昨|昨日の?' + PlusTwoDayRegex = '后天|後天|明後日|あさって|今日から二日' + MinusTwoDayRegex = '前天|一昨日|二日前|おととい' + PlusThreeDayRegex = '大后天|大後天|明日から二日|昨日から4日' + MinusThreeDayRegex = '大前天|昨日の2日前|昨日から2日間' + PlusFourDayRegex = '今日から4日' + DurationAllRegex = '(まる)' + DurationHalfRegex = '^[.]' + DurationRelativeDurationUnitRegex = '(?数ヶ|数)|(?(?以内)|(?後|(?(?(?(?数(?((か|ヶ)?(時|月|日(?!都合)|週|年|周|週|週|秒|分|営業日|年)間?))(たらず|以上)?)' + ) + DurationMoreOrLessRegex = '(?たらず|以下|を下回る)|(?以上|を上回る)' + DurationYearRegex = '((\\d{3,4})|0\\d|两千)\\s*年' + DurationHalfSuffixRegex = '半' + DurationSuffixList = dict( + [ + ("M", "分|分間"), + ("S", "秒钟|秒|秒間"), + ("H", "時|時間"), + ("D", "天|日|泊|日間"), + ("BD", "営業日"), + ("W", "星期|个星期|周|週間|週"), + ("MON", "ひと月|月間|か月間|ヶ月|ヶ月間|个月|か月|月"), + ("Y", "年|年間"), + ] + ) + DurationAmbiguousUnits = [ + r'分钟', + r'秒钟', + r'秒', + r'个小时', + r'小时', + r'天', + r'日', + r'泊', + r'星期', + r'个星期', + r'周', + r'个月', + r'年', + r'時', + r'時間', + r'月', + ] + DurationUnitRegex = f'(?年|个月|月|周|時間?|泊|(?営業)日|天|週間?|星期|个星期|か月|(?別)の?(?日|年|月|時間?)' + DurationConnectorRegex = '^\\s*(?[と]?|,)\\s*$' + ConnectorRegex = '^\\s*[,-]\\s*$' + LunarHolidayRegex = f'(({YearRegex}|{DatePeriodYearInCJKRegex}|(?明年|今年|去年|来年))(的)?)?(?除夕|春节|旧暦の正月初一|中秋(節|节)?|元宵(节|節)|端午(节|の節句)?|重(阳节|陽節))' + HolidayRegexList1 = f'(旧暦の)?(({YearRegex}|{DatePeriodYearInCJKRegex}|(?明年|今年|去年|来年))(的|の)?)?(?新年|五一|劳动节|国際的な労働者の日|メーデー|元旦节|元旦|の?独立記念日|大晦日|愚人节|エイプリルフール|圣诞节|クリスマス(の日|イブ)?|感謝祭(の日)?|クリーンマンデイ|父の日|植树节|国庆节|国慶節|情人节|バレンタインデー|教(师节|師の日)|儿童节|妇女节|青年(节|の日)|建军节|建軍節|女生节|光棍节|双十一|清明(节|節)?|キング牧師記念日|旧正月|ガールズデー|(こども|子ども|子供)の日|お正月|植樹祭|シングルデー|シングルズデー|国際婦人デー|ダブル十一|復活祭|イースター)(の\\d日)?' + HolidayRegexList2 = f'(({YearRegex}|{DatePeriodYearInCJKRegex}|(?明年|今年|去年|来年))(的)?)?(?母(亲节|の日)|父亲节|感恩节|万圣节|ハロウィン)' + TimeHourRegex = f'(?{TimeHourCJKRegex}|{TimeHourNumRegex}){TimeClockDescRegex}' + TimeMinuteRegex = f'(?{TimeMinuteCJKRegex}|{TimeMinuteNumRegex}){TimeMinuteDescRegex}' + TimeSecondRegex = f'(?{TimeSecondCJKRegex}|{TimeSecondNumRegex}){TimeSecondDescRegex}' + TimeHalfRegex = '(?过半|半)' + TimeQuarterRegex = '(?[一两二三四1-4])\\s*(刻钟|刻)' + LessThanHalfHourRegex = ( + f'(?([0-2]?\\d)|(二?十[一二三四五六七八九]?|[零〇一二三四五六七八九]))({TimeMinuteDescRegex})' + ) + TimeCJKTimeRegex = f'{TimeHourRegex}({TimeQuarterRegex}|({TimeHalfRegex}({TimeSecondRegex})?)|((((过|又)?{TimeMinuteRegex})({TimeSecondRegex})?)|({TimeSecondRegex})))?' + TimeDigitTimeRegex = ( + f'(?{TimeHourNumRegex}):(?{TimeMinuteNumRegex})(:(?{TimeSecondNumRegex}))?({AmPmDescRegex})?' + ) + LessTimeRegex = f'(({TimeHourRegex}|(?{TimeHourNumRegex}):){LessThanHalfHourRegex}前)({AmPmDescRegex})?' + TimeDayDescRegex = f'(?(正午|夜中|午前半ば|(昼食時)|真昼)|((?<=({TimeDigitTimeRegex}|{TimeCJKTimeRegex})(の)?)(早朝(に)?|午後(に)?|晚|晩|(深)?夜(に)?|未明|午前(中)?|日中|白昼|(未|早)?朝(に)?|昼前に|昼すぎに|夕方前に|夕方に|営業時間内に|昼(?!食)))|((早朝(に)?|午後(に)?|晚|晩|(深)?夜(に)?|泊(?=の?予約)|未明|(早朝)?午前(中)?|日中|白昼|(未|早)?朝(に)?|昼前に|昼すぎに|夕方前に|夕方に|営業時間内に|昼(?!食))(?=(の)?({TimeDigitTimeRegex}|{TimeCJKTimeRegex}))))' + TimeApproximateDescPreffixRegex = '(ぐらい|おそらく|多分|ほとんど|まもなく|昨日の|昨日|来週の|来週|昼食時|昼食|真)' + TimeApproximateDescSuffixRegex = '(過ぎに|過ぎ|丁度に|丁度|きっかりに|きっかり|を過ぎた頃に|を過ぎた頃|ちょっと前に|ちょっと前|近くに|近く|昼食時|昼食|ぐらい|時かっきり|頃|かっきり)' + TimeRegexes1 = f'{TimeApproximateDescPreffixRegex}?({TimeDayDescRegex}(の)?)?({TimeDigitTimeRegex}|{TimeCJKTimeRegex})((の)?{TimeDayDescRegex})?{TimeApproximateDescSuffixRegex}?' + TimeRegexes2 = ( + f'({TimeApproximateDescPreffixRegex}(の)?)?{TimeDayDescRegex}((の)?{TimeApproximateDescSuffixRegex})?' + ) + TimeRegexes3 = f'({TimeDayDescRegex}(の)?)?({LessTimeRegex})((の)?{TimeDayDescRegex})?' + TimePeriodTimePeriodConnectWords = '(まで(の間)?|の間|–|-|—|~|~)' + TimePeriodLeftCJKTimeRegex = f'(?{TimeDayDescRegex}?({TimeCJKTimeRegex}))(から)?' + TimePeriodRightCJKTimeRegex = f'{TimePeriodTimePeriodConnectWords}?(?{TimeDayDescRegex}?{TimeCJKTimeRegex}){TimePeriodTimePeriodConnectWords}?' + TimePeriodLeftDigitTimeRegex = f'(?{TimeDayDescRegex}?({TimeDigitTimeRegex}))(から)?' + TimePeriodRightDigitTimeRegex = f'{TimePeriodTimePeriodConnectWords}?(?{TimeDayDescRegex}?{TimeDigitTimeRegex}){TimePeriodTimePeriodConnectWords}?' + TimePeriodShortLeftCJKTimeRegex = f'(?{TimeDayDescRegex}?({TimeHourCJKRegex}))(から)?' + TimePeriodShortLeftDigitTimeRegex = f'(?{TimeDayDescRegex}?({TimeHourNumRegex}))(から)?' + TimePeriodRegexes1 = f'({TimePeriodLeftDigitTimeRegex}{TimePeriodRightDigitTimeRegex}|{TimePeriodLeftCJKTimeRegex}{TimePeriodRightCJKTimeRegex})' + TimePeriodRegexes2 = f'(((早朝(に)?|午後(に)?|(深)?夜(に)?|未明|午前(中)?|日中|白昼|(未|早)?朝(に)?|昼前に|昼すぎに|夕方前に|夕方に|営業時間内に|昼(?!食))({TimePeriodShortLeftDigitTimeRegex}{TimePeriodRightDigitTimeRegex}|{TimePeriodShortLeftCJKTimeRegex}{TimePeriodRightCJKTimeRegex}))|((早朝(に)?|午後(に)?|(深)?夜(に)?|未明|午前(中)?|日中|白昼|(未|早)?朝(に)?|昼前に|昼すぎに|夕方前に|夕方に|営業時間内に|昼(?!食))(?=((?!({TimeCJKTimeRegex}|{TimeDigitTimeRegex})(から)?)))))' + FromToRegex = '^[.]' + AmbiguousRangeModifierPrefix = '^[.]' + UnspecificDatePeriodRegex = '^(の?(分|日|週|周|月|年|時間))$' + ReferenceDatePeriodRegex = '(同じ|その)(?月|週末|年|週)' + ParserConfigurationBefore = '((?(または|及び|と)そ)?の前|またはそれ以前|之前|以前|前|まで|以前)' + ParserConfigurationAfter = '(の後から|(?または)それ以降|之后|之後|以后|以後|后|の?後|以降)' + ParserConfigurationUntil = '(直到|直至|截至|截止(到)?)' + ParserConfigurationSincePrefix = '(自从|自|自打|打|早ければ)' + ParserConfigurationSinceSuffix = '(またはその後|以来|开始|(?早|晨|am)' + DateTimeSimplePmRegex = '(?晚|晩|pm)' + DateTimePeriodMORegex = '(朝|凌晨|清晨|早上|早|上午)' + DateTimePeriodMIRegex = '昼(?!食)' + DateTimePeriodAFRegex = '(中午|下午|午后|傍晚)' + DateTimePeriodEVRegex = '(晚上|夜里|夜晚|晚|晩)' + DateTimePeriodNIRegex = '(半夜|夜间|深夜|夜|泊(?=の?予約))' + AmbiguityFiltersDict = dict([("^\\d{1,2}\\.\\d{1,2}$", "\\d{1,2}\\.\\d{1,2}(?!\\s*に[戻残]|から|で)")]) + AmbiguityDateFiltersDict = dict([("^今週$", "今週"), ("^[1一]日$", "[1一]日")]) + AmbiguityDateTimeFiltersDict = dict([("から.+まで", "")]) + AmbiguityDatePeriodFiltersDict = dict( + [ + ("^年$", "年"), + ( + "(よい|いい)([0-9]|[一二三四五六七八九十])?か?(日|週|月|年)間?", + "(よい|いい)([0-9]|[一二三四五六七八九十])?か?(日|週|月|年)間?", + ), + ] + ) + AmbiguityTimeFiltersDict = dict([("^(\\d+|[一二三四五六七八九十廿])時$", "(\\d+|[一二三四五六七八九十廿])時間")]) + AmbiguityTimePeriodFiltersDict = dict([("^早$", "早")]) + AmbiguityDurationFiltersDict = dict( + [ + ("月", "(?\\b(at[eé]h?|[aà]s|ao?)\\b|--|-|—|——)(\\s+\\b(o|[aà](s)?)\\b)?' + TillRegex = '(?\\b(at[eé]h?|[aà]s|ao?)\\b|--|-|—|——)(\\s+\\b(o|[aà](s)?)\\b)?' RangeConnectorRegex = f'(?(e\\s*(([àa]s?)|o)?)|{BaseDateTime.RangeConnectorSymbolRegex})' - DayRegex = f'(?(?:3[0-1]|[1-2]\\d|0?[1-9]))(?=\\b|t)' - WrittenDayRegex = f'(?(vinte\\s+e\\s+)?(um|dois|tr[eê]s|quatro|cinco|seis|sete|oito|nove)|dez|onze|doze|treze|(c|qu)atorze|quinze|dez[ae](s(seis|sete)|nove)|dezoito|vinte|trinta(\\s+e\\s+um)?)' - MonthNumRegex = f'(?1[0-2]|(0)?[1-9])\\b' + DayRegex = '(?(?:3[0-1]|[1-2]\\d|0?[1-9]))(?=\\b|t)' + WrittenDayRegex = '(?(vinte\\s+e\\s+)?(um|dois|tr[eê]s|quatro|cinco|seis|sete|oito|nove)|dez|onze|doze|treze|(c|qu)atorze|quinze|dez[ae](s(seis|sete)|nove)|dezoito|vinte|trinta(\\s+e\\s+um)?)' + MonthNumRegex = '(?1[0-2]|(0)?[1-9])\\b' AmDescRegex = f'({BaseDateTime.BaseAmDescRegex})' PmDescRegex = f'({BaseDateTime.BasePmDescRegex})' AmPmDescRegex = f'({BaseDateTime.BaseAmPmDescRegex})' - OclockRegex = f'(?em\\s+ponto)' + OclockRegex = '(?em\\s+ponto)' DescRegex = f'((horas\\s+)?(?{AmDescRegex}|{PmDescRegex})|{OclockRegex})' - OfPrepositionRegex = f'(\\bd(o|a|e)s?\\b)' - AfterNextSuffixRegex = f'\\b(que\\s+vem|passad[oa])\\b' - RangePrefixRegex = f'((de(sde)?|das?|entre)\\s+(a(s)?\\s+)?)' + OfPrepositionRegex = '(\\bd(o|a|e)s?\\b)' + AfterNextSuffixRegex = '\\b(que\\s+vem|passad[oa])\\b' + RangePrefixRegex = '((de(sde)?|das?|entre)\\s+(a(s)?\\s+)?)' TwoDigitYearRegex = f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d)))\\b' - RelativeRegex = f'(?((n?est[ae]s?|pr[oó]xim[oa]s?|([uú]ltim[ao]s?))(\\s+fina(l|is)\\s+d[eao])?)|(fina(l|is)\\s+d[eao]))\\b' - StrictRelativeRegex = f'(?((n?est[ae]|pr[oó]xim[oa]|([uú]ltim(o|as|os)))(\\s+fina(l|is)\\s+d[eao])?)|(fina(l|is)\\s+d[eao]))\\b' - WrittenOneToNineRegex = f'(uma?|dois|duas|tr[eê]s|quatro|cinco|seis|sete|oito|nove)' - WrittenOneHundredToNineHundredRegex = f'(duzent[oa]s|trezent[oa]s|[cq]uatrocent[ao]s|quinhent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|cem|(?((n?est[ae]s?|pr[oó]xim[oa]s?|([uú]ltim[ao]s?))(\\s+fina(l|is)\\s+d[eao])?)|(fina(l|is)\\s+d[eao]))\\b' + StrictRelativeRegex = ( + '(?((n?est[ae]|pr[oó]xim[oa]|([uú]ltim(o|as|os)))(\\s+fina(l|is)\\s+d[eao])?)|(fina(l|is)\\s+d[eao]))\\b' + ) + WrittenOneToNineRegex = '(uma?|dois|duas|tr[eê]s|quatro|cinco|seis|sete|oito|nove)' + WrittenOneHundredToNineHundredRegex = '(duzent[oa]s|trezent[oa]s|[cq]uatrocent[ao]s|quinhent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|cem|(?((dois\\s+)?mil)((\\s+e)?\\s+{WrittenOneHundredToNineHundredRegex})?((\\s+e)?\\s+{WrittenOneToNinetyNineRegex})?)' YearRegex = f'({BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' - RelativeMonthRegex = f'(?([nd]?es[st]e|pr[óo]ximo|passsado|[uú]ltimo)\\s+m[eê]s)\\b' - MonthRegex = f'(?abr(il)?|ago(sto)?|dez(embro)?|fev(ereiro)?|jan(eiro)?|ju[ln](ho)?|mar([çc]o)?|maio?|nov(embro)?|out(ubro)?|sep?t(embro)?)' + RelativeMonthRegex = '(?([nd]?es[st]e|pr[óo]ximo|passsado|[uú]ltimo)\\s+m[eê]s)\\b' + MonthRegex = '(?abr(il)?|ago(sto)?|dez(embro)?|fev(ereiro)?|jan(eiro)?|ju[ln](ho)?|mar([çc]o)?|maio?|nov(embro)?|out(ubro)?|sep?t(embro)?)' MonthSuffixRegex = f'(?((em|no)\\s+|d[eo]\\s+)?({RelativeMonthRegex}|{MonthRegex}))' - DateUnitRegex = f'(?(?m[êe]s)(?es)?|(ano|(?semana|dia))(?s)?)\\b' - PastRegex = f'(?\\b(passad[ao](s)?|[uú]ltim[oa](s)?|anterior(es)?|h[aá]|pr[ée]vi[oa](s)?)\\b)' - FutureRegex = f'(?\\b(seguinte(s)?|pr[oó]xim[oa](s)?|daqui\\s+a)\\b)' + DateUnitRegex = '(?(?m[êe]s)(?es)?|(ano|(?semana|dia))(?s)?)\\b' + PastRegex = '(?\\b(passad[ao](s)?|[uú]ltim[oa](s)?|anterior(es)?|h[aá]|pr[ée]vi[oa](s)?)\\b)' + FutureRegex = '(?\\b(seguinte(s)?|pr[oó]xim[oa](s)?|daqui\\s+a)\\b)' SimpleCasesRegex = f'\\b((desde\\s+[oa]|desde|d[oa])\\s+)?(dia\\s+)?({DayRegex})\\s*{TillRegex}\\s*(o dia\\s+)?({DayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*){YearRegex})?\\b' MonthFrontSimpleCasesRegex = f'\\b{MonthSuffixRegex}\\s+((desde\\s+[oa]|desde|d[oa])\\s+)?(dia\\s+)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' MonthFrontBetweenRegex = f'\\b{MonthSuffixRegex}\\s+((entre|entre\\s+[oa]s?)\\s+)(dias?\\s+)?({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*){YearRegex})?\\b' DayBetweenRegex = f'\\b((entre|entre\\s+[oa]s?)\\s+)(dia\\s+)?({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*){YearRegex})?\\b' - SpecialYearPrefixes = f'((do\\s+)?calend[aá]rio|civil|(?fiscal|escolar|letivo))' + SpecialYearPrefixes = '((do\\s+)?calend[aá]rio|civil|(?fiscal|escolar|letivo))' OneWordPeriodRegex = f'\\b(((pr[oó]xim[oa]?|[nd]?es[st]e|aquel[ea]|[uú]ltim[oa]?|em)\\s+)?(?abr(il)?|ago(sto)?|dez(embro)?|fev(ereiro)?|jan(eiro)?|ju[ln](ho)?|mar([çc]o)?|maio?|nov(embro)?|out(ubro)?|sep?t(embro)?)|({RelativeRegex}\\s+)?(ano\\s+{SpecialYearPrefixes}|{SpecialYearPrefixes}\\s+ano)|(?<=\\b(de|do|da|o|a)\\s+)?(pr[oó]xim[oa](s)?|[uú]ltim[oa]s?|est(e|a))\\s+(fim de semana|fins de semana|semana|m[êe]s|ano)|fim de semana|fins de semana|(m[êe]s|anos)? [àa] data)\\b' - MonthWithYearRegex = f'\\b((((pr[oó]xim[oa](s)?|[nd]?es[st]e|aquele|[uú]ltim[oa]?|em)\\s+)?{MonthRegex}|((n?o\\s+)?(?primeiro|1o|segundo|2o|terceiro|3o|[cq]uarto|4o|quinto|5o|sexto|6o|s[eé]timo|7o|oitavo|8o|nono|9o|d[eé]cimo(\\s+(primeiro|segundo))?|10o|11o|12o|[uú]ltimo)\\s+m[eê]s(?=\\s+(d[aeo]|[ao]))))\\s+((d[aeo]|[ao])\\s+)?({YearRegex}|{TwoDigitYearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|[nd]?es[st]e)\\s+ano))\\b' - MonthNumWithYearRegex = f'({YearRegex}(\\s*?)[/\\-\\.](\\s*?){MonthNumRegex})|({MonthNumRegex}(\\s*?)[/\\-](\\s*?){YearRegex})' + MonthWithYearRegex = f'\\b((((pr[oó]xim[oa](s)?|[nd]?es[st]e|aquele|[uú]ltim[oa]?|em)\\s+)?{MonthRegex}|((n?o\\s+)?(?primeiro|1o|segundo|2o|terceiro|3o|[cq]uarto|4o|quinto|5o|sexto|6o|s[eé]timo|7o|oitavo|8o|nono|9o|d[eé]cimo(\\s+(primeiro|segundo))?|10o|11o|12o|[uú]ltimo)\\s+m[eê]s(?=\\s+(d[aeo]|[ao]))))\\s+((d[aeo]|[ao])\\s+)?({YearRegex}|\\\'?{TwoDigitYearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|[nd]?es[st]e)\\s+ano))\\b' + MonthNumWithYearRegex = ( + f'({YearRegex}(\\s*?)[/\\-\\.](\\s*?){MonthNumRegex})|({MonthNumRegex}(\\s*?)[/\\-](\\s*?){YearRegex})' + ) WeekOfMonthRegex = f'(?(a|na\\s+)?(?primeira?|1a|segunda|2a|terceira|3a|[qc]uarta|4a|quinta|5a|[uú]ltima)\\s+semana\\s+{MonthSuffixRegex})' WeekOfYearRegex = f'(?(a|na\\s+)?(?primeira?|1a|segunda|2a|terceira|3a|[qc]uarta|4a|quinta|5a|[uú]ltima?)\\s+semana(\\s+d[oe]?)?\\s+({YearRegex}|(?pr[oó]ximo|[uú]ltimo|[nd]?es[st]e)\\s+ano))' OfYearRegex = f'\\b((d[aeo]?|[ao])\\s*({YearRegex}|{StrictRelativeRegex}\\s+ano))\\b' - FirstLastRegex = f'\\b(n?[ao]s?\\s+)?((?primeir[ao]s?)|(?[uú]ltim[ao]s?))\\b' + FirstLastRegex = '\\b(n?[ao]s?\\s+)?((?primeir[ao]s?)|(?[uú]ltim[ao]s?))\\b' FollowedDateUnit = f'^\\s*{DateUnitRegex}' NumberCombinedWithDateUnit = f'\\b(?\\d+(\\.\\d*)?){DateUnitRegex}' QuarterRegex = f'(n?o\\s+)?(?primeiro|1[oº]|segundo|2[oº]|terceiro|3[oº]|[qc]uarto|4[oº])\\s+trimestre(\\s+d[oe]|\\s*,\\s*)?\\s+({YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|[nd]?es[st]e)\\s+ano)' QuarterRegexYearFront = f'({YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|[nd]?es[st]e)\\s+ano)\\s+(n?o\\s+)?(?(primeiro)|1[oº]|segundo|2[oº]|terceiro|3[oº]|[qc]uarto|4[oº])\\s+trimestre' - AllHalfYearRegex = f'^[.]' - PrefixDayRegex = f'^[.]' + AllHalfYearRegex = '^[.]' + PrefixDayRegex = '^[.]' SeasonRegex = f'\\b(?(([uú]ltim[oa]|[nd]?es[st][ea]|n?[oa]|(pr[oó]xim[oa]s?|seguinte))\\s+)?(?primavera|ver[ãa]o|outono|inverno)((\\s+)?(seguinte|((de\\s+|,)?\\s*{YearRegex})|((do\\s+)?(?pr[oó]ximo|[uú]ltimo|[nd]?es[st]e)\\s+ano)))?)\\b' WhichWeekRegex = f'\\b(semana)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])(\\s+(de|do)\\s+({YearRegex}|(?pr[oó]ximo|[uú]ltimo|[nd]?es[st]e)\\s+ano|ano\\s+(?passado)))?\\b' - WeekOfRegex = f'(semana)(\\s*)((do|da|de))' - MonthOfRegex = f'(mes)(\\s*)((do|da|de))' - RangeUnitRegex = f'\\b(?anos?|meses|m[êe]s|semanas?)\\b' - BeforeAfterRegex = f'^[.]' - UpcomingPrefixRegex = f'.^' + WeekOfRegex = '(semana)(\\s*)((do|da|de))' + MonthOfRegex = '(mes)(\\s*)((do|da|de))' + RangeUnitRegex = '\\b(?anos?|meses|m[êe]s|semanas?)\\b' + BeforeAfterRegex = '^[.]' + UpcomingPrefixRegex = '.^' NextPrefixRegex = f'(pr[oó]xim[oa]s?|seguinte|{UpcomingPrefixRegex})\\b' - InConnectorRegex = f'\\b(em)\\b' - SinceYearSuffixRegex = f'^[.]' + InConnectorRegex = '\\b(em)\\b' + SinceYearSuffixRegex = '^[.]' WithinNextPrefixRegex = f'\\b(dentro\\s+d(e|as)(\\s+(?{NextPrefixRegex}))?)\\b' - TodayNowRegex = f'\\b(hoje|agora)\\b' - CenturySuffixRegex = f'^[.]' - FromRegex = f'(de(sde)?(\\s*a(s)?)?)$' - BetweenRegex = f'(entre\\s*([oa](s)?)?)' - WeekDayRegex = f'\\b(?(domingos?|(segunda|ter[çc]a|quarta|quinta|sexta)s?([-\\s+]feiras?)?|s[aá]bados?|(2|3|4|5|6)[aª])\\b|(dom|seg|ter[cç]|qua|qui|sex|sab)\\b(\\.?(?=\\s|,|;|$)))' + TodayNowRegex = '\\b(hoje|agora)\\b' + CenturySuffixRegex = '^[.]' + FromRegex = '(de(sde)?(\\s*a(s)?)?)$' + BetweenRegex = '(entre\\s*([oa](s)?)?)' + WeekDayRegex = '\\b(?(domingos?|(segunda|ter[çc]a|quarta|quinta|sexta)s?([-\\s+]feiras?)?|s[aá]bados?|(2|3|4|5|6)[aª])\\b|(dom|seg|ter[cç]|qua|qui|sex|sab)\\b(\\.?(?=\\s|,|;|$)))' OnRegex = f'(?<=\\b(em|no)\\s+)({DayRegex}s?)\\b' RelaxedOnRegex = f'((?<=\\b(em|[nd][oa])\\s+)(dia\\s+)?({DayRegex}s?)|dia\\s+{DayRegex}s?)\\b(?!\\s*[/\\\\\\-\\.,:\\s]\\s*(\\d|(de\\s+)?{MonthRegex}))' ThisRegex = f'\\b(([nd]?es[st][ea]\\s*){WeekDayRegex})|({WeekDayRegex}\\s*([nd]?es[st]a\\s+semana))\\b' LastDateRegex = f'\\b(([uú]ltim[ao])\\s*{WeekDayRegex})|({WeekDayRegex}(\\s+(([nd]?es[st]a|[nd]a)\\s+([uú]ltima\\s+)?semana)))\\b' NextDateRegex = f'\\b(((pr[oó]xim[oa]|seguinte)\\s*){WeekDayRegex})|({WeekDayRegex}((\\s+(pr[oó]xim[oa]|seguinte))|(\\s+(da\\s+)?(semana\\s+seguinte|pr[oó]xima\\s+semana))))\\b' - SpecialDayRegex = f'\\b((d?o\\s+)?(dia\\s+antes\\s+de\\s+ontem|antes\\s+de\\s+ontem|anteontem)|((d?o\\s+)?(dia\\s+|depois\\s+|dia\\s+depois\\s+)?de\\s+amanh[aã])|(o\\s)?dia\\s+seguinte|(o\\s)?pr[oó]ximo\\s+dia|(o\\s+)?[uú]ltimo\\s+dia|ontem|amanh[ãa]|hoje)|(do\\s+dia$)\\b' - SpecialDayWithNumRegex = f'^[.]' - ForTheRegex = f'.^' + SpecialDayRegex = '\\b((d?o\\s+)?(dia\\s+antes\\s+de\\s+ontem|antes\\s+de\\s+ontem|anteontem)|((d?o\\s+)?(dia\\s+|depois\\s+|dia\\s+depois\\s+)?de\\s+amanh[aã])|(o\\s)?dia\\s+seguinte|(o\\s)?pr[oó]ximo\\s+dia|(o\\s+)?[uú]ltimo\\s+dia|ontem|amanh[ãa]|hoje)|(do\\s+dia$)\\b' + SpecialDayWithNumRegex = '^[.]' + ForTheRegex = '.^' FlexibleDayRegex = f'(?([a-z]+\\s)?({WrittenDayRegex}|{DayRegex}))' WeekDayAndDayOfMonthRegex = f'\\b{WeekDayRegex}\\s+(dia\\s+{FlexibleDayRegex})\\b' - WeekDayAndDayRegex = f'\\b{WeekDayRegex}\\s+({DayRegex})(?!([-:/]|\\.\\d|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' + WeekDayAndDayRegex = ( + f'\\b{WeekDayRegex}\\s+({DayRegex})(?!([-:/]|\\.\\d|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' + ) WeekDayOfMonthRegex = f'(?(n?[ao]\\s+)?(?primeir[ao]|1[ao]|segund[ao]|2[ao]|terceir[ao]|3[ao]|[qc]uart[ao]|4[ao]|quint[ao]|5[ao]|[uú]ltim[ao])\\s+{WeekDayRegex}\\s+{MonthSuffixRegex})' - RelativeWeekDayRegex = f'^[.]' - AmbiguousRangeModifierPrefix = f'^[.]' - NumberEndingPattern = f'^[.]' + RelativeWeekDayRegex = '^[.]' + AmbiguousRangeModifierPrefix = '^[.]' + NumberEndingPattern = '^[.]' SpecialDateRegex = f'(?<=\\bno\\s+){DayRegex}\\b' - OfMonthRegex = f'^(\\s*de)?\\s*{MonthSuffixRegex}' - MonthEndRegex = f'({MonthRegex}\\s*(o)?\\s*$)' + OfMonth = f'^(\\s*de)?\\s*{MonthSuffixRegex}' + MonthEnd = f'({MonthRegex}\\s*(o)?\\s*$)' WeekDayEnd = f'{WeekDayRegex}\\s*,?\\s*$' - WeekDayStart = f'^\\b$' - DateYearRegex = f'(?{YearRegex}|{TwoDigitYearRegex})' + WeekDayStart = '^\\b$' + DateYearRegex = f'(?{YearRegex}|\\\'?{TwoDigitYearRegex})' DateExtractor1 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?{DayRegex}((\\s*(de)|[/\\\\\\.\\- ])\\s*)?{MonthRegex}\\b' DateExtractor2 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?({DayRegex}(\\s*([/\\.\\-]|de)?\\s*{MonthRegex}|\\s+de\\s+{MonthNumRegex})(\\s*([,./-]|de|\\s+)\\s*){DateYearRegex}|{BaseDateTime.FourDigitYearRegex}\\s*[/\\.\\- ]\\s*{DayRegex}\\s*[/\\.\\- ]\\s*{MonthRegex})\\b' DateExtractor3 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?{MonthRegex}(\\s*[/\\.\\- ]\\s*|\\s+de\\s+){DayRegex}(?!\\s*\\-\\s*\\d{{2}}\\b)((\\s*[/\\.\\- ]\\s*|\\s+de\\s+){DateYearRegex})?\\b' @@ -106,28 +114,28 @@ class PortugueseDateTime: DateExtractor6 = f'(?<=\\b(em|no|o)\\s+){MonthNumRegex}[\\-\\.]{DayRegex}{BaseDateTime.CheckDecimalRegex}\\b' DateExtractor7 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?{MonthNumRegex}\\s*/\\s*{DayRegex}((\\s+|\\s*(,|de)\\s*){DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\\b' DateExtractor8 = f'(?<=\\b(em|no|o)\\s+){DayRegex}[\\\\\\-]{MonthNumRegex}{BaseDateTime.CheckDecimalRegex}\\b' - DateExtractor9 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?{DayRegex}\\s*/\\s*{MonthNumRegex}((\\s+|\\s*(,|de)\\s*){DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\\b' + DateExtractor9 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?(dia\\s)?{DayRegex}\\s*(/|do)\\s*{MonthNumRegex}((\\s+|\\s*(,|de)\\s*|\\s*[/\\\\\\-\\.]){DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\\b' DateExtractor10 = f'\\b({WeekDayRegex}(\\s+|\\s*,\\s*))?({YearRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DayRegex}|{MonthRegex}\\s*[/\\\\\\-\\.]\\s*{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*{DayRegex}|{DayRegex}\\s*[/\\\\\\-\\.]\\s*{BaseDateTime.FourDigitYearRegex}\\s*[/\\\\\\-\\.]\\s*{MonthRegex})(?!\\s*[/\\\\\\-\\.:]\\s*\\d+)' DateExtractor11 = f'(?<=\\b(dia)\\s+){DayRegex}' - HourNumRegex = f'\\b(?zero|uma|duas|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze)\\b' - MinuteNumRegex = f'(?um|dois|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|catorze|quatorze|quinze|dez[ea]sseis|dez[ea]sete|dezoito|dez[ea]nove|vinte|trinta|[qc]uarenta|cin[qc]uenta)' - DeltaMinuteNumRegex = f'(?um|dois|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|catorze|quatorze|quinze|dez[ea]sseis|dez[ea]sete|dezoito|dez[ea]nove|vinte|trinta|[qc]uarenta|cin[qc]uenta)' - PmRegex = f'(horas\\s+)?(?((pela|de|da|\\b[àa]\\b|na)\\s+(tarde|noite)))|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio dia|meio-dia))' - AmRegex = f'(horas\\s+)?(?(pela|de|da|na)\\s+(manh[ãa]|madrugada))' - AmTimeRegex = f'(?([dn]?es[st]a|(pela|de|da|na))\\s+(manh[ãa]|madrugada))' - PmTimeRegex = f'(?(([dn]?es[st]a|\\b[àa]\\b|(pela|de|da|na))\\s+(tarde|noite)))|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio dia|meio-dia))' + HourNumRegex = '\\b(?zero|uma|duas|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze)\\b' + MinuteNumRegex = '(?um|dois|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|catorze|quatorze|quinze|dez[ea]sseis|dez[ea]sete|dezoito|dez[ea]nove|vinte|trinta|[qc]uarenta|cin[qc]uenta)' + DeltaMinuteNumRegex = '(?um|dois|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|catorze|quatorze|quinze|dez[ea]sseis|dez[ea]sete|dezoito|dez[ea]nove|vinte|trinta|[qc]uarenta|cin[qc]uenta)' + PmRegex = '(horas\\s+)?(?((pela|de|da|\\b[àa]\\b|na)\\s+(tarde|noite)))|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio dia|meio-dia))' + AmRegex = '(horas\\s+)?(?(pela|de|da|na)\\s+(manh[ãa]|madrugada))' + AmTimeRegex = '(?([dn]?es[st]a|(pela|de|da|na))\\s+(manh[ãa]|madrugada))' + PmTimeRegex = '(?(([dn]?es[st]a|\\b[àa]\\b|(pela|de|da|na))\\s+(tarde|noite)))|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio dia|meio-dia))' LessThanOneHour = f'(?((\\s+e\\s+)?(quinze|(um\\s+|dois\\s+|tr[êes]\\s+)?quartos?)|quinze|(\\s*)(um\\s+|dois\\s+|tr[êes]\\s+)?quartos?|(\\s+e\\s+)(meia|trinta)|({BaseDateTime.DeltaMinuteRegex}|{DeltaMinuteNumRegex})(\\s+(minuto|minutos|min|mins))?))' - LessThanOneHourSuffix = f'(?((\\s+e\\s+)?(quinze|(um\\s+|dois\\s+|tr[êes]\\s+)?quartos?)|quinze|(\\s*)(um\\s+|dois\\s+|tr[êes]\\s+)?quartos?|(\\s+e\\s+)(meia|trinta)))' - TensTimeRegex = f'(?dez|vinte|trinta|[qc]uarenta|cin[qc]uenta)' + LessThanOneHourSuffix = '(?((\\s+e\\s+)?(quinze|(um\\s+|dois\\s+|tr[êes]\\s+)?quartos?)|quinze|(\\s*)(um\\s+|dois\\s+|tr[êes]\\s+)?quartos?|(\\s+e\\s+)(meia|trinta)))' + TensTimeRegex = '(?dez|vinte|trinta|[qc]uarenta|cin[qc]uenta)' WrittenTimeRegex = f'(?({HourNumRegex}\\s*((e|menos)\\s+)?(({TensTimeRegex}((\\s*e\\s+)?{MinuteNumRegex}))|{MinuteNumRegex}))|(({MinuteNumRegex}|({TensTimeRegex}((\\s*e\\s+)?{MinuteNumRegex})?))\\s*((para as|pras|antes da|antes das)\\s+)?({HourNumRegex}|{BaseDateTime.HourRegex})))' TimePrefix = f'(?{LessThanOneHour}(\\s+(passad[ao]s)\\s+(as)?|\\s+depois\\s+(das?|do)|\\s+pras?|\\s+(para|antes)?\\s+([àa]s?)))' TimeSuffix = f'(?({LessThanOneHour}\\s+)?({AmRegex}|{PmRegex}|{OclockRegex}))' BasicTime = f'(?{WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}:{BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|{BaseDateTime.HourRegex})' - MidnightRegex = f'(?meia\\s*(-\\s*)?noite)' - MidmorningRegex = f'(?meio\\s+da\\s+manhã)' - MidEarlyMorning = f'(?meio\\s+da\\s+madrugada)' - MidafternoonRegex = f'(?meio\\s+da\\s+tarde)' - MiddayRegex = f'(?meio\\s*(-\\s*)?dia)' + MidnightRegex = '(?meia\\s*(-\\s*)?noite)' + MidmorningRegex = '(?meio\\s+da\\s+manhã)' + MidEarlyMorning = '(?meio\\s+da\\s+madrugada)' + MidafternoonRegex = '(?meio\\s+da\\s+tarde)' + MiddayRegex = '(?meio\\s*(-\\s*)?dia)' MidTimeRegex = f'(?({MidnightRegex}|{MidmorningRegex}|{MidEarlyMorning}|{MidafternoonRegex}|{MiddayRegex}))' AtRegex = f'\\b(((?<=\\b(d?[aà]s?)\\s+)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}(\\s+e\\s+{BaseDateTime.MinuteRegex})?)(\\s+horas?|\\s*h\\b)?|(?<=\\b(s(er)?[aã]o|v[aã]o\\s+ser|^[eé]h?)\\s+|^\\s*)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})(\\s+horas?|\\s*h\\b))(\\s+{OclockRegex})?|{MidTimeRegex})\\b' ConnectNumRegex = f'({BaseDateTime.HourRegex}(?[0-5][0-9])\\s*{DescRegex})' @@ -141,402 +149,437 @@ class PortugueseDateTime: TimeRegex8 = f'\\b{TimeSuffix}\\s+{BasicTime}((\\s*{DescRegex})|\\b)' TimeRegex9 = f'\\b(?{HourNumRegex}\\s+({TensTimeRegex}\\s*)(e\\s+)?{MinuteNumRegex}?)\\b' TimeRegex11 = f'\\b({WrittenTimeRegex})(\\s+{DescRegex})?\\b' - TimeRegex12 = f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' - PrepositionRegex = f'(?([àa]s?|em|por|pel[ao]|n[ao]|de|d[ao]?)?$)' - NowRegex = f'\\b(?((logo|exatamente)\\s+)?agora(\\s+mesmo)?|neste\\s+momento|(assim\\s+que|t[ãa]o\\s+cedo\\s+quanto)\\s+(poss[ií]vel|possas?|possamos)|o\\s+mais\\s+(cedo|r[aá]pido)\\s+poss[íi]vel|recentemente|previamente)\\b' - SuffixRegex = f'^\\s*((e|a|em|por|pel[ao]|n[ao]|de)\\s+)?(manh[ãa]|madrugada|meio\\s*dia|tarde|noite)\\b' - TimeOfDayRegex = f'\\b(?manh[ãa]|madrugada|tarde|noite|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio[ -]dia)))\\b' - SpecificTimeOfDayRegex = f'\\b(((((a)?\\s+|[nd]?es[st]a|seguinte|pr[oó]xim[oa]|[uú]ltim[oa])\\s+)?{TimeOfDayRegex}))\\b' + TimeRegex12 = ( + f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' + ) + PrepositionRegex = '(?([àa]s?|em|por|pel[ao]|n[ao]|de|d[ao]?)?$)' + NowRegex = '\\b(?((logo|exatamente)\\s+)?agora(\\s+mesmo)?|neste\\s+momento|(assim\\s+que|t[ãa]o\\s+cedo\\s+quanto)\\s+(poss[ií]vel|possas?|possamos)|o\\s+mais\\s+(cedo|r[aá]pido)\\s+poss[íi]vel|recentemente|previamente)\\b' + SuffixRegex = '^\\s*((e|a|em|por|pel[ao]|n[ao]|de)\\s+)?(manh[ãa]|madrugada|meio\\s*dia|tarde|noite)\\b' + TimeOfDayRegex = ( + '\\b(?manh[ãa]|madrugada|tarde|noite|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio[ -]dia)))\\b' + ) + SpecificTimeOfDayRegex = ( + f'\\b(((((a)?\\s+|[nd]?es[st]a|seguinte|pr[oó]xim[oa]|[uú]ltim[oa])\\s+)?{TimeOfDayRegex}))\\b' + ) TimeOfTodayAfterRegex = f'^\\s*(,\\s*)?([àa]|em|por|pel[ao]|de|no|na?\\s+)?{SpecificTimeOfDayRegex}' TimeOfTodayBeforeRegex = f'({SpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]s|para))?\\s*)' SimpleTimeOfTodayAfterRegex = f'({HourNumRegex}|{BaseDateTime.HourRegex})\\s*(,\\s*)?{SpecificTimeOfDayRegex}' SimpleTimeOfTodayBeforeRegex = f'({SpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]s|((cerca|perto|ao\\s+redor|por\\s+volta)\\s+(de|das))))?\\s*({HourNumRegex}|{BaseDateTime.HourRegex}))' - SpecificEndOfRegex = f'([na]o\\s+)?(fi(m|nal)|t[ée]rmin(o|ar))(\\s+d?o(\\s+dia)?(\\s+de)?)?\\s*$' - UnspecificEndOfRegex = f'^[.]' - UnspecificEndOfRangeRegex = f'^[.]' - UnitRegex = f'(?anos?|meses|m[êe]s|semanas?|dias?|horas?|hrs?|hs?|minutos?|mins?|segundos?|segs?)\\b' - ConnectorRegex = f'^(,|t|para [ao]|para as|pras|(cerca|perto|ao\\s+redor|por\\s+volta)\\s+(de|das)|quase)$' - TimeHourNumRegex = f'(?vinte( e (um|dois|tr[êe]s|quatro))?|zero|uma?|dois|duas|tr[êe]s|quatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|quatorze|catorze|quinze|dez([ea]sseis|[ea]ssete|oito|[ea]nove))' + SpecificEndOfRegex = '([na]o\\s+)?(fi(m|nal)|t[ée]rmin(o|ar))(\\s+d?o(\\s+dia)?(\\s+de)?)?\\s*$' + UnspecificEndOfRegex = '^[.]' + UnspecificEndOfRangeRegex = '^[.]' + UnitRegex = '(?anos?|meses|m[êe]s|semanas?|dias?|horas?|hrs?|hs?|minutos?|mins?|segundos?|segs?)\\b' + ConnectorRegex = '^(,|t|para [ao]|para as|pras|(cerca|perto|ao\\s+redor|por\\s+volta)\\s+(de|das)|quase)$' + TimeHourNumRegex = '(?vinte( e (um|dois|tr[êe]s|quatro))?|zero|uma?|dois|duas|tr[êe]s|quatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|quatorze|catorze|quinze|dez([ea]sseis|[ea]ssete|oito|[ea]nove))' PureNumFromTo = f'(((desde|de|da|das)\\s+(a(s)?\\s+)?)?({BaseDateTime.HourRegex}|{TimeHourNumRegex})(\\s*(?{DescRegex}|horas))?\\s*{TillRegex}(?{DescRegex}|horas))?\\s*{TillRegex})\\s*({BaseDateTime.HourRegex}|{TimeHourNumRegex})\\s*(?{PmRegex}|{AmRegex}|{DescRegex}|horas)?' PureNumBetweenAnd = f'(entre\\s+((a|as)?\\s+)?)({BaseDateTime.HourRegex}|{TimeHourNumRegex})(\\s*(?{DescRegex}|horas))?\\s*e\\s*(a(s)?\\s+)?({BaseDateTime.HourRegex}|{TimeHourNumRegex})\\s*(?{PmRegex}|{AmRegex}|{DescRegex}|horas)?' - SpecificTimeFromTo = f'^[.]' - SpecificTimeBetweenAnd = f'^[.]' - TimeUnitRegex = f'(?(hora|minuto|min|segundo|se[cg])(?s)?|h)\\b' + SpecificTimeFromTo = '^[.]' + SpecificTimeBetweenAnd = '^[.]' + TimeUnitRegex = '(?(hora|minuto|min|segundo|se[cg])(?s)?|h)\\b' TimeFollowedUnit = f'^\\s*{TimeUnitRegex}' TimeNumberCombinedWithUnit = f'\\b(?\\d+(\\,\\d*)?)\\s*{TimeUnitRegex}' DateTimePeriodNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?)\\s*{TimeUnitRegex}' - PeriodTimeOfDayWithDateRegex = f'\\b((e|[àa]|em|na|no|ao|pel[ao]|de)\\s+)?(?manh[ãa]|madrugada|(passado\\s+(o\\s+)?)?meio\\s+dia|tarde|noite)\\b' + PeriodTimeOfDayWithDateRegex = '\\b((e|[àa]|em|na|no|ao|pel[ao]|de)\\s+)?(?manh[ãa]|madrugada|(passado\\s+(o\\s+)?)?meio\\s+dia|tarde|noite)\\b' RelativeTimeUnitRegex = f'({PastRegex}|{FutureRegex})\\s+{UnitRegex}|{UnitRegex}\\s+({PastRegex}|{FutureRegex})' - SuffixAndRegex = f'(?\\s*(e)\\s+(?meia|(um\\s+)?quarto))' + SuffixAndRegex = '(?\\s*(e)\\s+(?meia|(um\\s+)?quarto))' FollowedUnit = f'^\\s*{UnitRegex}' - LessThanRegex = f'^[.]' - MoreThanRegex = f'^[.]' + LessThanRegex = '^[.]' + MoreThanRegex = '^[.]' DurationNumberCombinedWithUnit = f'\\b(?\\d+(\\,\\d*)?){UnitRegex}' AnUnitRegex = f'\\b(um(a)?)\\s+{UnitRegex}' - DuringRegex = f'^[.]' - AllRegex = f'\\b(?tod[oa]?\\s+(o|a)\\s+(?ano|m[êe]s|semana|dia))\\b' - HalfRegex = f'\\b(?mei[oa]\\s+(?ano|m[êe]s|semana|dia|hora))\\b' - ConjunctionRegex = f'^[.]' - InexactNumberRegex = f'\\b(poucos|pouco|algum|alguns|v[áa]rios)\\b' + DuringRegex = '^[.]' + AllRegex = '\\b(?tod[oa]?\\s+(o|a)\\s+(?ano|m[êe]s|semana|dia))\\b' + HalfRegex = '\\b(?mei[oa]\\s+(?ano|m[êe]s|semana|dia|hora))\\b' + ConjunctionRegex = '^[.]' + InexactNumberRegex = '\\b(poucos|pouco|algum|alguns|v[áa]rios)\\b' InexactNumberUnitRegex = f'\\b(poucos|pouco|algum|alguns|v[áa]rios)\\s+{UnitRegex}' HolidayRegex1 = f'\\b(?sexta-feira santa|sexta-feira da paix[ãa]o|quarta-feira de cinzas|carnaval|dia dos? presidentes?|ano novo chin[eê]s|ano novo|v[ée]spera de ano novo|natal|v[ée]spera de natal|dia de a[cç][ãa]o de gra[çc]as|a[cç][ãa]o de gra[çc]as|yuandan|halloween|dia das bruxas|p[áa]scoa)(\\s+(d[eo]?\\s+)?({YearRegex}|(?(pr[oó]xim[oa]?|[nd]?es[st][ea]|[uú]ltim[oa]?|em))\\s+ano))?\\b' HolidayRegex2 = f'\\b(?(dia\\s+(d[eoa]s?\\s+)?)?(martin luther king|todos os santos|s[ãa]o (patr[íi]cio|francisco|jorge|jo[ãa]o)|independ[êe]ncia))(\\s+(d[eo]?\\s+)?({YearRegex}|(?(pr[oó]xim[oa]?|[nd]?es[st][ea]|[uú]ltim[oa]?|em))\\s+ano))?\\b' HolidayRegex3 = f'\\b(?(dia\\s+d[eoa]s?\\s+)(trabalh(o|ador(es)?)|m[ãa]es?|pais?|mulher(es)?|crian[çc]as?|marmota|professor(es)?))(\\s+(d[eo]?\\s+)?({YearRegex}|(?(pr[oó]xim[oa]?|[nd]?es[st][ea]|[uú]ltim[oa]?|em))\\s+ano))?\\b' - BeforeRegex = f'(antes(\\s+(d(e\\s+)?[aeo]s?)?)?|at[ée]h?(\\s+[oàa]s?\\b)?)' - AfterRegex = f'((depois|ap[óo]s|a\\s+partir)(\\s*(de|d?[oa]s?)?)?)' - SinceRegex = f'(desde(\\s+(as?|o))?)' - AroundRegex = f'(?:\\b(?:cerca|perto|ao\\s+redor|por\\s+volta)\\s*?\\b)(\\s+(de|das))?' - PeriodicRegex = f'\\b(?di[áa]ri[ao]|(diaria|mensal|semanal|quinzenal|(bi|tri|se)mestral|anual)(mente)?)\\b' - EachExpression = f'cada|tod[oa]s?\\s*([oa]s)?' - EachUnitRegex = f'(?({EachExpression})\\s*{UnitRegex})' - EachPrefixRegex = f'(?({EachExpression})\\s*$)' - EachDayRegex = f'\\s*({EachExpression})\\s*dias\\s*\\b' + BeforeRegex = '(antes(\\s+(d(e\\s+)?[aeo]s?)?)?|at[ée]h?(\\s+[oàa]s?\\b)?)' + AfterRegex = '((depois|ap[óo]s|a\\s+partir)(\\s*(de|d?[oa]s?)?)?)' + SinceRegex = '(desde(\\s+(as?|o))?)' + AroundRegex = '(?:\\b(?:cerca|perto|ao\\s+redor|por\\s+volta)\\s*?\\b)(\\s+(de|das))?' + EachExpression = 'cada|tod[oa]s?\\s*([oa]s)?' BeforeEachDayRegex = f'({EachExpression})\\s*dias(\\s+a[so])?\\s*\\b' - SetEachRegex = f'(?({EachExpression})\\s*)' - LaterEarlyPeriodRegex = f'^[.]' - WeekWithWeekDayRangeRegex = f'^[.]' - GeneralEndingRegex = f'^[.]' - MiddlePauseRegex = f'^[.]' - PrefixArticleRegex = f'^[\\.]' - OrRegex = f'^[.]' - SpecialYearTermsRegex = f'\\b(({SpecialYearPrefixes}\\s+anos?\\s+|anos?\\s+({SpecialYearPrefixes}\\s+)?)(d[oe]\\s+)?)' + LaterEarlyPeriodRegex = '^[.]' + WeekWithWeekDayRangeRegex = '^[.]' + GeneralEndingRegex = '^[.]' + MiddlePauseRegex = '^[.]' + PrefixArticleRegex = '^[\\.]' + OrRegex = '^[.]' + SpecialYearTermsRegex = ( + f'\\b(({SpecialYearPrefixes}\\s+anos?\\s+|anos?\\s+({SpecialYearPrefixes}\\s+)?)(d[oe]\\s+)?)' + ) YearPlusNumberRegex = f'\\b({SpecialYearTermsRegex}((?(\\d{{2,4}}))|{FullTextYearRegex}))\\b' NumberAsTimeRegex = f'\\b({WrittenTimeRegex}|({TimeHourNumRegex}|{BaseDateTime.HourRegex})(?\\s*horas)?)\\b' - TimeBeforeAfterRegex = f'^[.]' - DateNumberConnectorRegex = f'^[.]' - ComplexDatePeriodRegex = f'^[.]' - AgoRegex = f'\\b(antes(\\s+d[eoa]s?\\s+(?hoje|ontem|manhã))?|atr[áa]s|no passado)\\b' - LaterRegex = f'\\b(depois(\\s+d[eoa]s?\\s+(agora|(?hoje|ontem|manhã)))?|ap[óo]s (as)?|desde( (as|o))?|no futuro|mais tarde)\\b' + TimeBeforeAfterRegex = '^[.]' + DateNumberConnectorRegex = '^[.]' + ComplexDatePeriodRegex = '^[.]' + AgoRegex = '\\b(antes(\\s+d[eoa]s?\\s+(?hoje|ontem|manhã))?|atr[áa]s|no passado)\\b' + LaterRegex = '\\b(depois(\\s+d[eoa]s?\\s+(agora|(?hoje|ontem|manhã)))?|ap[óo]s (as)?|desde( (as|o))?|no futuro|mais tarde)\\b' Tomorrow = 'amanh[ãa]' - UnitMap = dict([("anos", "Y"), - ("ano", "Y"), - ("meses", "MON"), - ("mes", "MON"), - ("mês", "MON"), - ("semanas", "W"), - ("semana", "W"), - ("dias", "D"), - ("dia", "D"), - ("horas", "H"), - ("hora", "H"), - ("hrs", "H"), - ("hr", "H"), - ("h", "H"), - ("minutos", "M"), - ("minuto", "M"), - ("mins", "M"), - ("min", "M"), - ("segundos", "S"), - ("segundo", "S"), - ("segs", "S"), - ("seg", "S")]) - UnitValueMap = dict([("anos", 31536000), - ("ano", 31536000), - ("meses", 2592000), - ("mes", 2592000), - ("mês", 2592000), - ("semanas", 604800), - ("semana", 604800), - ("dias", 86400), - ("dia", 86400), - ("horas", 3600), - ("hora", 3600), - ("hrs", 3600), - ("hr", 3600), - ("h", 3600), - ("minutos", 60), - ("minuto", 60), - ("mins", 60), - ("min", 60), - ("segundos", 1), - ("segundo", 1), - ("segs", 1), - ("seg", 1)]) - SpecialYearPrefixesMap = dict([("fiscal", "FY"), - ("escolar", "SY"), - ("letivo", "SY")]) - SeasonMap = dict([("primavera", "SP"), - ("verao", "SU"), - ("verão", "SU"), - ("outono", "FA"), - ("inverno", "WI")]) - SeasonValueMap = dict([("SP", 3), - ("SU", 6), - ("FA", 9), - ("WI", 12)]) - CardinalMap = dict([("primeiro", 1), - ("primeira", 1), - ("1o", 1), - ("1a", 1), - ("segundo", 2), - ("segunda", 2), - ("2o", 2), - ("2a", 2), - ("terceiro", 3), - ("terceira", 3), - ("3o", 3), - ("3a", 3), - ("cuarto", 4), - ("quarto", 4), - ("cuarta", 4), - ("quarta", 4), - ("4o", 4), - ("4a", 4), - ("quinto", 5), - ("quinta", 5), - ("5o", 5), - ("5a", 5), - ("sexto", 6), - ("sexta", 6), - ("6o", 6), - ("6a", 6), - ("setimo", 7), - ("sétimo", 7), - ("setima", 7), - ("sétima", 7), - ("7o", 7), - ("7a", 7), - ("oitavo", 8), - ("oitava", 8), - ("8o", 8), - ("8a", 8), - ("nono", 9), - ("nona", 9), - ("9o", 9), - ("9a", 9), - ("decimo", 10), - ("décimo", 10), - ("decima", 10), - ("décima", 10), - ("10o", 10), - ("10a", 10), - ("decimo primeiro", 11), - ("décimo primeiro", 11), - ("decima primeira", 11), - ("décima primeira", 11), - ("11o", 11), - ("11a", 11), - ("decimo segundo", 12), - ("décimo segundo", 12), - ("decima segunda", 12), - ("décima segunda", 12), - ("12o", 12), - ("12a", 12)]) - DayOfWeek = dict([("segunda-feira", 1), - ("segundas-feiras", 1), - ("segunda feira", 1), - ("segundas feiras", 1), - ("segunda", 1), - ("segundas", 1), - ("terça-feira", 2), - ("terças-feiras", 2), - ("terça feira", 2), - ("terças feiras", 2), - ("terça", 2), - ("terças", 2), - ("terca-feira", 2), - ("tercas-feiras", 2), - ("terca feira", 2), - ("tercas feiras", 2), - ("terca", 2), - ("tercas", 2), - ("quarta-feira", 3), - ("quartas-feiras", 3), - ("quarta feira", 3), - ("quartas feiras", 3), - ("quarta", 3), - ("quartas", 3), - ("quinta-feira", 4), - ("quintas-feiras", 4), - ("quinta feira", 4), - ("quintas feiras", 4), - ("quinta", 4), - ("quintas", 4), - ("sexta-feira", 5), - ("sextas-feiras", 5), - ("sexta feira", 5), - ("sextas feiras", 5), - ("sexta", 5), - ("sextas", 5), - ("sabado", 6), - ("sabados", 6), - ("sábado", 6), - ("sábados", 6), - ("domingo", 0), - ("domingos", 0), - ("seg", 1), - ("seg.", 1), - ("2a", 1), - ("ter", 2), - ("ter.", 2), - ("3a", 2), - ("qua", 3), - ("qua.", 3), - ("4a", 3), - ("qui", 4), - ("qui.", 4), - ("5a", 4), - ("sex", 5), - ("sex.", 5), - ("6a", 5), - ("sab", 6), - ("sab.", 6), - ("dom", 0), - ("dom.", 0)]) - MonthOfYear = dict([("janeiro", 1), - ("fevereiro", 2), - ("março", 3), - ("marco", 3), - ("abril", 4), - ("maio", 5), - ("junho", 6), - ("julho", 7), - ("agosto", 8), - ("septembro", 9), - ("setembro", 9), - ("outubro", 10), - ("novembro", 11), - ("dezembro", 12), - ("jan", 1), - ("fev", 2), - ("mar", 3), - ("abr", 4), - ("mai", 5), - ("jun", 6), - ("jul", 7), - ("ago", 8), - ("sept", 9), - ("set", 9), - ("out", 10), - ("nov", 11), - ("dez", 12), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9)]) - Numbers = dict([("zero", 0), - ("um", 1), - ("uma", 1), - ("dois", 2), - ("tres", 3), - ("três", 3), - ("quatro", 4), - ("cinco", 5), - ("seis", 6), - ("sete", 7), - ("oito", 8), - ("nove", 9), - ("dez", 10), - ("onze", 11), - ("doze", 12), - ("dezena", 12), - ("dezenas", 12), - ("treze", 13), - ("catorze", 14), - ("quatorze", 14), - ("quinze", 15), - ("dezesseis", 16), - ("dezasseis", 16), - ("dezessete", 17), - ("dezassete", 17), - ("dezoito", 18), - ("dezenove", 19), - ("dezanove", 19), - ("vinte", 20), - ("vinte e um", 21), - ("vinte e uma", 21), - ("vinte e dois", 22), - ("vinte e duas", 22), - ("vinte e tres", 23), - ("vinte e três", 23), - ("vinte e quatro", 24), - ("vinte e cinco", 25), - ("vinte e seis", 26), - ("vinte e sete", 27), - ("vinte e oito", 28), - ("vinte e nove", 29), - ("trinta", 30), - ("trinta e um", 31), - ("quarenta", 40), - ("cinquenta", 50)]) - HolidayNames = dict([("pai", ["diadopai", "diadospais"]), - ("mae", ["diadamae", "diadasmaes"]), - ("acaodegracas", ["diadegracas", "diadeacaodegracas", "acaodegracas"]), - ("trabalho", ["diadotrabalho", "diadotrabalhador", "diadostrabalhadores"]), - ("pascoa", ["diadepascoa", "pascoa"]), - ("natal", ["natal", "diadenatal"]), - ("vesperadenatal", ["vesperadenatal"]), - ("anonovo", ["anonovo", "diadeanonovo", "diadoanonovo"]), - ("vesperadeanonovo", ["vesperadeanonovo", "vesperadoanonovo"]), - ("yuandan", ["yuandan"]), - ("todosossantos", ["todosossantos"]), - ("professor", ["diadoprofessor", "diadosprofessores"]), - ("crianca", ["diadacrianca", "diadascriancas"]), - ("mulher", ["diadamulher"])]) - VariableHolidaysTimexDictionary = dict([("pai", "-06-WXX-7-3"), - ("mae", "-05-WXX-7-2"), - ("acaodegracas", "-11-WXX-4-4"), - ("memoria", "-03-WXX-2-4")]) - DoubleNumbers = dict([("metade", 0.5), - ("quarto", 0.25)]) + UnitMap = dict( + [ + ("anos", "Y"), + ("ano", "Y"), + ("meses", "MON"), + ("mes", "MON"), + ("mês", "MON"), + ("semanas", "W"), + ("semana", "W"), + ("dias", "D"), + ("dia", "D"), + ("horas", "H"), + ("hora", "H"), + ("hrs", "H"), + ("hr", "H"), + ("h", "H"), + ("minutos", "M"), + ("minuto", "M"), + ("mins", "M"), + ("min", "M"), + ("segundos", "S"), + ("segundo", "S"), + ("segs", "S"), + ("seg", "S"), + ] + ) + UnitValueMap = dict( + [ + ("anos", 31536000), + ("ano", 31536000), + ("meses", 2592000), + ("mes", 2592000), + ("mês", 2592000), + ("semanas", 604800), + ("semana", 604800), + ("dias", 86400), + ("dia", 86400), + ("horas", 3600), + ("hora", 3600), + ("hrs", 3600), + ("hr", 3600), + ("h", 3600), + ("minutos", 60), + ("minuto", 60), + ("mins", 60), + ("min", 60), + ("segundos", 1), + ("segundo", 1), + ("segs", 1), + ("seg", 1), + ] + ) + SpecialYearPrefixesMap = dict([("fiscal", "FY"), ("escolar", "SY"), ("letivo", "SY")]) + SeasonMap = dict([("primavera", "SP"), ("verao", "SU"), ("verão", "SU"), ("outono", "FA"), ("inverno", "WI")]) + SeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + CardinalMap = dict( + [ + ("primeiro", 1), + ("primeira", 1), + ("1o", 1), + ("1a", 1), + ("segundo", 2), + ("segunda", 2), + ("2o", 2), + ("2a", 2), + ("terceiro", 3), + ("terceira", 3), + ("3o", 3), + ("3a", 3), + ("cuarto", 4), + ("quarto", 4), + ("cuarta", 4), + ("quarta", 4), + ("4o", 4), + ("4a", 4), + ("quinto", 5), + ("quinta", 5), + ("5o", 5), + ("5a", 5), + ("sexto", 6), + ("sexta", 6), + ("6o", 6), + ("6a", 6), + ("setimo", 7), + ("sétimo", 7), + ("setima", 7), + ("sétima", 7), + ("7o", 7), + ("7a", 7), + ("oitavo", 8), + ("oitava", 8), + ("8o", 8), + ("8a", 8), + ("nono", 9), + ("nona", 9), + ("9o", 9), + ("9a", 9), + ("decimo", 10), + ("décimo", 10), + ("decima", 10), + ("décima", 10), + ("10o", 10), + ("10a", 10), + ("decimo primeiro", 11), + ("décimo primeiro", 11), + ("decima primeira", 11), + ("décima primeira", 11), + ("11o", 11), + ("11a", 11), + ("decimo segundo", 12), + ("décimo segundo", 12), + ("decima segunda", 12), + ("décima segunda", 12), + ("12o", 12), + ("12a", 12), + ] + ) + DayOfWeek = dict( + [ + ("segunda-feira", 1), + ("segundas-feiras", 1), + ("segunda feira", 1), + ("segundas feiras", 1), + ("segunda", 1), + ("segundas", 1), + ("terça-feira", 2), + ("terças-feiras", 2), + ("terça feira", 2), + ("terças feiras", 2), + ("terça", 2), + ("terças", 2), + ("terca-feira", 2), + ("tercas-feiras", 2), + ("terca feira", 2), + ("tercas feiras", 2), + ("terca", 2), + ("tercas", 2), + ("quarta-feira", 3), + ("quartas-feiras", 3), + ("quarta feira", 3), + ("quartas feiras", 3), + ("quarta", 3), + ("quartas", 3), + ("quinta-feira", 4), + ("quintas-feiras", 4), + ("quinta feira", 4), + ("quintas feiras", 4), + ("quinta", 4), + ("quintas", 4), + ("sexta-feira", 5), + ("sextas-feiras", 5), + ("sexta feira", 5), + ("sextas feiras", 5), + ("sexta", 5), + ("sextas", 5), + ("sabado", 6), + ("sabados", 6), + ("sábado", 6), + ("sábados", 6), + ("domingo", 0), + ("domingos", 0), + ("seg", 1), + ("seg.", 1), + ("2a", 1), + ("ter", 2), + ("ter.", 2), + ("3a", 2), + ("qua", 3), + ("qua.", 3), + ("4a", 3), + ("qui", 4), + ("qui.", 4), + ("5a", 4), + ("sex", 5), + ("sex.", 5), + ("6a", 5), + ("sab", 6), + ("sab.", 6), + ("dom", 0), + ("dom.", 0), + ] + ) + MonthOfYear = dict( + [ + ("janeiro", 1), + ("fevereiro", 2), + ("março", 3), + ("marco", 3), + ("abril", 4), + ("maio", 5), + ("junho", 6), + ("julho", 7), + ("agosto", 8), + ("septembro", 9), + ("setembro", 9), + ("outubro", 10), + ("novembro", 11), + ("dezembro", 12), + ("jan", 1), + ("fev", 2), + ("mar", 3), + ("abr", 4), + ("mai", 5), + ("jun", 6), + ("jul", 7), + ("ago", 8), + ("sept", 9), + ("set", 9), + ("out", 10), + ("nov", 11), + ("dez", 12), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ] + ) + Numbers = dict( + [ + ("zero", 0), + ("um", 1), + ("uma", 1), + ("dois", 2), + ("tres", 3), + ("três", 3), + ("quatro", 4), + ("cinco", 5), + ("seis", 6), + ("sete", 7), + ("oito", 8), + ("nove", 9), + ("dez", 10), + ("onze", 11), + ("doze", 12), + ("dezena", 12), + ("dezenas", 12), + ("treze", 13), + ("catorze", 14), + ("quatorze", 14), + ("quinze", 15), + ("dezesseis", 16), + ("dezasseis", 16), + ("dezessete", 17), + ("dezassete", 17), + ("dezoito", 18), + ("dezenove", 19), + ("dezanove", 19), + ("vinte", 20), + ("vinte e um", 21), + ("vinte e uma", 21), + ("vinte e dois", 22), + ("vinte e duas", 22), + ("vinte e tres", 23), + ("vinte e três", 23), + ("vinte e quatro", 24), + ("vinte e cinco", 25), + ("vinte e seis", 26), + ("vinte e sete", 27), + ("vinte e oito", 28), + ("vinte e nove", 29), + ("trinta", 30), + ("trinta e um", 31), + ("quarenta", 40), + ("cinquenta", 50), + ] + ) + HolidayNames = dict( + [ + ("pai", ["diadopai", "diadospais"]), + ("mae", ["diadamae", "diadasmaes"]), + ("acaodegracas", ["diadegracas", "diadeacaodegracas", "acaodegracas"]), + ("trabalho", ["diadotrabalho", "diadotrabalhador", "diadostrabalhadores"]), + ("pascoa", ["diadepascoa", "pascoa"]), + ("natal", ["natal", "diadenatal"]), + ("vesperadenatal", ["vesperadenatal"]), + ("anonovo", ["anonovo", "diadeanonovo", "diadoanonovo"]), + ("vesperadeanonovo", ["vesperadeanonovo", "vesperadoanonovo"]), + ("yuandan", ["yuandan"]), + ("todosossantos", ["todosossantos"]), + ("professor", ["diadoprofessor", "diadosprofessores"]), + ("crianca", ["diadacrianca", "diadascriancas"]), + ("mulher", ["diadamulher"]), + ] + ) + VariableHolidaysTimexDictionary = dict( + [("pai", "-06-WXX-7-3"), ("mae", "-05-WXX-7-2"), ("acaodegracas", "-11-WXX-4-4"), ("memoria", "-03-WXX-2-4")] + ) + DoubleNumbers = dict([("metade", 0.5), ("quarto", 0.25)]) DateTokenPrefix = 'em ' TimeTokenPrefix = 'as ' TokenBeforeDate = 'o ' TokenBeforeTime = 'as ' - PastPrefixRegex = f'.^' + PastPrefixRegex = '.^' PreviousPrefixRegex = f'([uú]ltim[oa]s?|passad[oa]s?|{PastPrefixRegex})\\b' - ThisPrefixRegex = f'([nd]?es[st][ea])\\b' - RelativeDayRegex = f'^[\\.]' - RestOfDateRegex = f'^[\\.]' + ThisPrefixRegex = '([nd]?es[st][ea])\\b' + RelativeDayRegex = '^[\\.]' + RestOfDateRegex = '^[\\.]' DurationUnitRegex = f'(?{DateUnitRegex}|{TimeUnitRegex}|noites?)\\b' - RelativeDurationUnitRegex = f'(?:(?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+)({DurationUnitRegex}))' - ReferenceDatePeriodRegex = f'^[.]' - FromToRegex = f'\\b(from).+(to)\\b.+' - SingleAmbiguousMonthRegex = f'^(the\\s+)?(may|march)$' - UnspecificDatePeriodRegex = f'^[.]' - PrepositionSuffixRegex = f'\\b(on|in|at|around|from|to)$' - RestOfDateTimeRegex = f'^[\\.]' - SetWeekDayRegex = f'^[\\.]' - NightRegex = f'\\b(meia noite|noite|de noite)\\b' - CommonDatePrefixRegex = f'\\b(dia)\\s+$' - DurationConnectorRegex = f'^[.]' - CenturyRegex = f'^[.]' - DecadeRegex = f'^[.]' - DecadeWithCenturyRegex = f'^[.]' + RelativeDurationUnitRegex = ( + f'(?:(?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+)({DurationUnitRegex}))' + ) + ReferenceDatePeriodRegex = '^[.]' + FromToRegex = '\\b(from).+(to)\\b.+' + SingleAmbiguousMonthRegex = '^(the\\s+)?(may|march)$' + UnspecificDatePeriodRegex = '^[.]' + PrepositionSuffixRegex = '\\b(on|in|at|around|from|to)$' + RestOfDateTimeRegex = '^[\\.]' + NightRegex = '\\b(meia noite|noite|de noite)\\b' + CommonDatePrefixRegex = '\\b(dia)\\s+$' + DurationConnectorRegex = '^[.]' + CenturyRegex = '^[.]' + DecadeRegex = '^[.]' + DecadeWithCenturyRegex = '^[.]' RelativeDecadeRegex = f'\\b((n?as?\\s+)?{RelativeRegex}\\s+((?[\\w,]+)\\s+)?(d[eé]cada)s?)\\b' YearSuffix = f'((,|\\sde)?\\s*({YearRegex}|{FullTextYearRegex}))' - SuffixAfterRegex = f'^\\b$' + SuffixAfterRegex = '^\\b$' YearPeriodRegex = f'((((de(sde)?(\\s*a(s)?)?)\\s+)?{YearRegex}\\s*({TillRegex})\\s*{YearRegex})|(((entre\\s*([oa](s)?)?)\\s+){YearRegex}\\s*({RangeConnectorRegex})\\s*{YearRegex}))' - FutureSuffixRegex = f'\\b(seguinte(s)?|pr[oó]xim[oa](s)?|no\\s+futuro)\\b' - PastSuffixRegex = f'^\\b$' + FutureSuffixRegex = '\\b(seguinte(s)?|pr[oó]xim[oa](s)?|no\\s+futuro)\\b' + PastSuffixRegex = '^\\b$' ModPrefixRegex = f'\\b({RelativeRegex}|{AroundRegex}|{BeforeRegex}|{AfterRegex}|{SinceRegex})\\b' ModSuffixRegex = f'\\b({AgoRegex}|{LaterRegex}|{BeforeAfterRegex}|{FutureSuffixRegex}|{PastSuffixRegex})\\b' WrittenDecades = dict([("", 0)]) SpecialDecadeCases = dict([("", 0)]) DefaultLanguageFallback = 'DMY' DurationDateRestrictions = [] - AmbiguityFiltersDict = dict([("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), - ("^(abr|ago|dez|fev|jan|ju[ln]|mar|maio?|nov|out|sep?t)$", "([$%£&!?@#])(abr|ago|dez|fev|jan|ju[ln]|mar|maio?|nov|out|sep?t)|(abr|ago|dez|fev|jan|ju[ln]|mar|maio?|nov|out|sep?t)([$%£&@#])"), - ("^\\d{1,4}-\\d{1,4}$", "\\d{1,4}-\\d{1,4}-\\d|\\d-\\d{1,4}-\\d{1,4}"), - ("^\\d{1,4}-\\d{1,4}-\\d{1,4}$", "\\d{1,4}-\\d{1,4}-\\d{1,4}-\\d|\\d-\\d{1,4}-\\d{1,4}-\\d{1,4}")]) - AmbiguityTimeFiltersDict = dict([("horas?$", "\\b((por|duração\\s+de|durante)\\s+(\\S+\\s+){1,2}horas?|horas?\\s+(\\S+\\s+){0,2}dur(ação|ou|a(rá|va)?))\\b")]) + AmbiguityFiltersDict = dict( + [ + ("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), + ( + "^(abr|ago|dez|fev|jan|ju[ln]|mar|maio?|nov|out|sep?t)$", + "([$%£&!?@#])(abr|ago|dez|fev|jan|ju[ln]|mar|maio?|nov|out|sep?t)|(abr|ago|dez|fev|jan|ju[ln]|mar|maio?|nov|out|sep?t)([$%£&@#])", + ), + ("^\\d{1,4}-\\d{1,4}$", "\\d{1,4}-\\d{1,4}-\\d|\\d-\\d{1,4}-\\d{1,4}"), + ("^\\d{1,4}-\\d{1,4}-\\d{1,4}$", "\\d{1,4}-\\d{1,4}-\\d{1,4}-\\d|\\d-\\d{1,4}-\\d{1,4}-\\d{1,4}"), + ] + ) + AmbiguityTimeFiltersDict = dict( + [ + ( + "horas?$", + "\\b((por|duração\\s+de|durante)\\s+(\\S+\\s+){1,2}horas?|horas?\\s+(\\S+\\s+){0,2}dur(ação|ou|a(rá|va)?))\\b", + ) + ] + ) EarlyMorningTermList = [r'madrugada'] MorningTermList = [r'manha', r'manhã'] AfternoonTermList = [r'passado o meio dia', r'depois do meio dia'] @@ -553,24 +596,37 @@ class PortugueseDateTime: WeekTerms = [r'semana'] FortnightTerms = [r'quinzena'] YearTerms = [r'ano', r'anos'] - YearToDateTerms = [r'ano ate agora', r'ano ate hoje', r'ano ate a data', r'anos ate agora', r'anos ate hoje', r'anos ate a data'] - SpecialCharactersEquivalent = dict([("á", "a"), - ("é", "e"), - ("í", "i"), - ("ó", "o"), - ("ú", "u"), - ("ê", "e"), - ("ô", "o"), - ("ü", "u"), - ("ã", "a"), - ("õ", "o"), - ("ç", "c")]) - DayTypeRegex = f'(diari([ao]|amente))$' - WeekTypeRegex = f'(semanal(mente)?)$' - BiWeekTypeRegex = f'(quinzenal(mente)?)$' - MonthTypeRegex = f'(mensal(mente)?)$' - BiMonthTypeRegex = f'(bimestral(mente)?)$' - QuarterTypeRegex = f'(trimestral(mente)?)$' - SemiAnnualTypeRegex = f'(semestral(mente)?)$' - YearTypeRegex = f'(anual(mente)?)$' + YearToDateTerms = [ + r'ano ate agora', + r'ano ate hoje', + r'ano ate a data', + r'anos ate agora', + r'anos ate hoje', + r'anos ate a data', + ] + SpecialCharactersEquivalent = dict( + [ + ("á", "a"), + ("é", "e"), + ("í", "i"), + ("ó", "o"), + ("ú", "u"), + ("ê", "e"), + ("ô", "o"), + ("ü", "u"), + ("ã", "a"), + ("õ", "o"), + ("ç", "c"), + ] + ) + DayTypeRegex = '(diari([ao]|amente))$' + WeekTypeRegex = '(semanal(mente)?)$' + BiWeekTypeRegex = '(quinzenal(mente)?)$' + MonthTypeRegex = '(mensal(mente)?)$' + BiMonthTypeRegex = '(bimestral(mente)?)$' + QuarterTypeRegex = '(trimestral(mente)?)$' + SemiAnnualTypeRegex = '(semestral(mente)?)$' + YearTypeRegex = '(anual(mente)?)$' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/spanish_date_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/spanish_date_time.py index 77cda13a91..af8dc577bc 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/spanish_date_time.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/spanish_date_time.py @@ -9,59 +9,64 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_date_time import BaseDateTime +from .base_date_time import BaseDateTime, BaseDateTimeResource + + # pylint: disable=line-too-long -class SpanishDateTime: +class SpanishDateTime(BaseDateTimeResource): LangMarker = 'Spa' CheckBothBeforeAfter = False TillRegex = f'(?\\b(hasta|hacia|al?)\\b(\\s+(el|la(s)?)\\b)?|{BaseDateTime.RangeConnectorSymbolRegex})' StrictTillRegex = f'(?\\b(hasta|hacia|al?)(\\s+(el|la(s)?))?\\b|{BaseDateTime.RangeConnectorSymbolRegex}(?!\\s*[qt][1-4](?!(\\s+de|\\s*,\\s*))))' RangeConnectorRegex = f'(?\\b(y\\s*(el|(la(s)?)?))\\b|{BaseDateTime.RangeConnectorSymbolRegex})' - WrittenDayRegex = f'(?uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciséis|diecisiete|dieciocho|diecinueve|veinte|veintiuno|veintidós|veintitrés|veinticuatro|veinticinco|veintiséis|veintisiete|veintiocho|veintinueve|treinta(\\s+y\\s+uno)?)' - DayRegex = f'\\b(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?:\\.[º°])?(?=\\b|t)' - MonthNumRegex = f'(?1[0-2]|(0)?[1-9])\\b' - OclockRegex = f'(?en\\s+punto)' + WrittenDayRegex = '(?uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciséis|diecisiete|dieciocho|diecinueve|veinte|veintiuno|veintidós|veintitrés|veinticuatro|veinticinco|veintis[ée]is|veintisiete|veintiocho|veintinueve|treinta(\\s+y\\s+uno)?)' + WrittenMonthNumRegex = '(?uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce)' + DayRegex = '\\b(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?:\\.[º°])?(?=\\b|t)' + MonthNumRegex = '(?1[0-2]|(0)?[1-9])\\b' + OclockRegex = '(?en\\s+punto)' AmDescRegex = f'({BaseDateTime.BaseAmDescRegex})' PmDescRegex = f'({BaseDateTime.BasePmDescRegex})' AmPmDescRegex = f'({BaseDateTime.BaseAmPmDescRegex})' DescRegex = f'(?({AmDescRegex}|{PmDescRegex}))' - OfPrepositionRegex = f'(\\bd(o|al?|el?)\\b)' - AfterNextSuffixRegex = f'\\b(despu[eé]s\\s+de\\s+la\\s+pr[oó]xima)\\b' - NextSuffixRegex = f'\\b(que\\s+viene|pr[oó]xim[oa]|siguiente)\\b' - PreviousSuffixRegex = f'\\b(pasad[ao]|anterior(?!\\s+(al?|del?)\\b))\\b' + OfPrepositionRegex = '(\\bd(o|al?|el?)\\b)' + AfterNextSuffixRegex = '\\b(despu[eé]s\\s+de\\s+la\\s+pr[oó]xima)\\b' + NextSuffixRegex = '\\b(que\\s+viene|pr[oó]xim[oa]|siguiente)\\b' + PreviousSuffixRegex = '\\b(pasad[ao]|anterior(?!\\s+(al?|del?)\\b))\\b' RelativeSuffixRegex = f'({AfterNextSuffixRegex}|{NextSuffixRegex}|{PreviousSuffixRegex})' - RangePrefixRegex = f'((de(l|sde)?|entre)(\\s+la(s)?)?)' - TwoDigitYearRegex = f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d))|\\.?[º°ª])\\b' - RelativeRegex = f'(?est[ae]s?|pr[oó]xim[oa]s?|siguiente|(([uú]ltim|pasad)[ao]s?))\\b' - StrictRelativeRegex = f'(?est[ae]|pr[oó]xim[oa]|siguiente|(([uú]ltim|pasad)(o|as|os)))\\b' - WrittenOneToNineRegex = f'(un[ao]?|dos|tres|cuatro|cinco|seis|siete|ocho|nueve)' - WrittenOneHundredToNineHundredRegex = f'(doscient[oa]s|trescient[oa]s|cuatrocient[ao]s|quinient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|cien(to)?)' + RangePrefixRegex = '((de(l|sde)?|entre)(\\s+la(s)?)?)' + TwoDigitYearRegex = ( + f'\\b(?([0-9]\\d))(?!(\\s*((\\:\\d)|{AmDescRegex}|{PmDescRegex}|\\.\\d))|\\.?[º°ª])\\b' + ) + RelativeRegex = '(?est[ae]s?|pr[oó]xim[oa]s?|siguiente|(([uú]ltim|pasad)[ao]s?))\\b' + StrictRelativeRegex = '(?est[ae]|pr[oó]xim[oa]|siguiente|(([uú]ltim|pasad)(o|as|os)))\\b' + WrittenOneToNineRegex = '(un[ao]?|dos|tres|cuatro|cinco|seis|siete|ocho|nueve)' + WrittenOneHundredToNineHundredRegex = '(doscient[oa]s|trescient[oa]s|cuatrocient[ao]s|quinient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|cien(to)?)' WrittenOneToNinetyNineRegex = f'(((treinta|cuarenta|cincuenta|sesenta|setenta|ochenta|noventa)(\\s+y\\s+{WrittenOneToNineRegex})?)|diez|once|doce|trece|catorce|quince|dieciséis|dieciseis|diecisiete|dieciocho|diecinueve|veinte|veintiuno|veintiún|veintiun|veintiuna|veintidós|veintidos|veintitrés|veintitres|veinticuatro|veinticinco|veintiséis|veintisiete|veintiocho|veintinueve|un[ao]?|dos|tres|cuatro|cinco|seis|siete|ocho|nueve)' FullTextYearRegex = f'\\b(?((dos\\s+)?mil)(\\s+{WrittenOneHundredToNineHundredRegex})?(\\s+{WrittenOneToNinetyNineRegex})?)' YearRegex = f'({BaseDateTime.FourDigitYearRegex}|{FullTextYearRegex})' - RelativeMonthRegex = f'(?(de\\s+)?((este|pr[oó]ximo|([uú]ltim(o|as|os)))\\s+mes)|(del\\s+)?(mes\\s+((que\\s+viene)|pasado)))\\b' - MonthRegex = f'\\b(?abr(\\.|(il)?\\b)|ago(\\.|(sto)?\\b)|dic(\\.|(iembre)?\\b)|feb(\\.|(rero)?\\b)|ene(\\.|(ro)?\\b)|ju[ln](\\.|(io)?\\b)|mar(\\.|(zo)?\\b)|may(\\.|(o)?\\b)|nov(\\.|(iembre)?\\b)|oct(\\.|(ubre)?\\b)|sep?t(\\.|(iembre)?\\b)|sep(\\.|\\b))' + RelativeMonthRegex = '(?(de\\s+)?((este|pr[oó]ximo|([uú]ltim(o|as|os)))\\s+mes)|(del\\s+)?(mes\\s+((que\\s+viene)|pasado)))\\b' + MonthRegex = '\\b(?abr(\\.|(il)?\\b)|ago(\\.|(sto)?\\b)|dic(\\.|(iembre)?\\b)|feb(\\.|(rero)?\\b)|ene(\\.|(ro)?\\b)|ju[ln](\\.|(io)?\\b)|mar(\\.|(zo)?\\b)|may(\\.|(o)?\\b)|nov(\\.|(iembre)?\\b)|oct(\\.|(ubre)?\\b)|sep?t(\\.|(iembre)?\\b)|sep(\\.|\\b))' MonthSuffixRegex = f'(?((del?|la|el)\\s+)?({RelativeMonthRegex}|{MonthRegex}))' - DateUnitRegex = f'(?(año|(?semana))(?s)?|(?mes)(?es)?|(?d[ií]a)(?s)?(?\\s+(h[aá]biles|laborales))?)\\b' - PastRegex = f'(?\\b(pasad(a|o)(s)?|[uú]ltim[oa](s)?|anterior(es)?|previo(s)?)\\b)' - FutureRegex = f'\\b(siguiente(s)?|pr[oó]xim[oa](s)?)\\b' + DateUnitRegex = '(?(año|(?semana))(?s)?|(?mes)(?es)?|(?d[ií]a)(?s)?(?\\s+(h[aá]biles|laborales))?)\\b' + PastRegex = '(?\\b(pasad(a|o)(s)?|[uú]ltim[oa](s)?|anterior(es)?|previo(s)?)\\b)' + FutureRegex = '\\b(siguiente(s)?|pr[oó]xim[oa](s)?)\\b' SimpleCasesRegex = f'\\b((desde(\\s+el)?|entre|del?)\\s+)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*)((en|del?)\\s+)?{YearRegex})?\\b' MonthFrontSimpleCasesRegex = f'\\b{MonthSuffixRegex}\\s+((desde(\\s+el)?|entre|del)\\s+)?({DayRegex})\\s*{TillRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*)((en|del?)\\s+)?{YearRegex})?\\b' MonthFrontBetweenRegex = f'\\b{MonthSuffixRegex}\\s+((entre(\\s+el)?)\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})((\\s+|\\s*,\\s*)((en|del?)\\s+)?{YearRegex})?\\b' DayBetweenRegex = f'\\b((entre(\\s+el)?)\\s+)({DayRegex})\\s*{RangeConnectorRegex}\\s*({DayRegex})\\s+{MonthSuffixRegex}((\\s+|\\s*,\\s*)((en|del?)\\s+)?{YearRegex})?\\b' - SpecialYearPrefixes = f'((del\\s+)?calend[aá]rio|(?fiscal|escolar))' + SpecialYearPrefixes = '((del\\s+)?calend[aá]rio|(?fiscal|escolar))' OneWordPeriodRegex = f'\\b(((((la|el)\\s+)?mes\\s+(({OfPrepositionRegex})\\s+)?)|((pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?)\\s+))?({MonthRegex})|((el\\s+)?{RelativeRegex}\\s+)?(({SpecialYearPrefixes}\\s+)año|año\\s+{SpecialYearPrefixes})|(((la|el)\\s+)?((({RelativeRegex}\\s+)({DateUnitRegex}|(fin\\s+de\\s+)?semana|finde)(\\s+{RelativeSuffixRegex})?)|{DateUnitRegex}(\\s+{RelativeSuffixRegex}))|va\\s+de\\s+{DateUnitRegex}|((año|mes)(\\s+(a|hasta)\\s+la\\s+fecha)?|((el\\s+)?fin\\s+de\\s+)?semana|(el\\s+)?finde))\\b)' - MonthWithYearRegex = f'\\b((((pr[oó]xim[oa](s)?|est?[ae]|[uú]ltim[oa]?)\\s+)?{MonthRegex}|((el\\s+)?(?primero?|1(er|ro)|segundo|2do|tercero?|3(er|ro)|uarto|4to|quinto|5to|sexto|6to|s[eé]ptimo|7mo|octavo|8vo|noveno|9no|d[eé]cimo|10mo|und[eé]cimo|11mo|duod[eé]cimo|12mo|[uú]ltimo)\\s+mes(?=\\s+(del?|en))))((\\s+|(\\s*[,-]\\s*))((de(l|\\s+la)?|en)\\s+)?({YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año)|\\s+(del?|en)\\s+{TwoDigitYearRegex}))\\b' + MonthWithYearRegex = f'\\b((((pr[oó]xim[oa](s)?|est?[ae]|[uú]ltim[oa]?)\\s+)?{MonthRegex}|((el\\s+)?(?primero?|1(er|ro)|segundo|2do|tercero?|3(er|ro)|uarto|4to|quinto|5to|sexto|6to|s[eé]ptimo|7mo|octavo|8vo|noveno|9no|d[eé]cimo|10mo|und[eé]cimo|11mo|duod[eé]cimo|12mo|[uú]ltimo)\\s+mes(?=\\s+(del?|en))))((\\s+|(\\s*[,-]\\s*))((de(l|\\s+la)?|en)\\s+)?({YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año)|\\s+(del?|en)\\s+\\\'?{TwoDigitYearRegex}))\\b' MonthNumWithYearRegex = f'\\b(({YearRegex}(\\s*?)[/\\-\\.~](\\s*?){MonthNumRegex})|({MonthNumRegex}(\\s*?)[/\\-\\.~](\\s*?){YearRegex}))\\b' WeekOfMonthRegex = f'(?(la\\s+)?(?primera?|1ra|segunda|2da|tercera?|3ra|cuarta|4ta|quinta|5ta|([12345](\\.)?ª)|[uú]ltima)\\s+semana\\s+{MonthSuffixRegex}((\\s+de)?\\s+({BaseDateTime.FourDigitYearRegex}|{RelativeRegex}\\s+año))?)\\b' WeekOfYearRegex = f'(?(la\\s+)?(?primera?|1ra|segunda|2da|tercera?|3ra|cuarta|4ta|quinta|5ta|[uú]ltima?|([12345]ª))\\s+semana(\\s+(del?|en))?\\s+({YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año))' OfYearRegex = f'\\b((del?)\\s+({YearRegex}|{StrictRelativeRegex}\\s+año))\\b' - FirstLastRegex = f'\\b((el|las?|los?)\\s+)?((?primer([ao]s?)?)|(?[uú]ltim[ao]s?))\\b' + FirstLastRegex = '\\b((el|las?|los?)\\s+)?((?primer([ao]s?)?)|(?[uú]ltim[ao]s?))\\b' FollowedDateUnit = f'^\\s*{DateUnitRegex}' NumberCombinedWithDateUnit = f'\\b(?\\d+(\\.\\d*)?){DateUnitRegex}' - QuarterTermRegex = f'\\b((?primer|1er|segundo|2do|tercer|3ro|4to|([1234](\\.)?º))\\s+(trimestre|cuarto)|[tq](?[1-4]))\\b' + QuarterTermRegex = '\\b((?primer|1er|segundo|2do|tercer|3ro|4to|([1234](\\.)?º))\\s+(trimestre|cuarto)|[tq](?[1-4]))\\b' RelativeQuarterTermRegex = f'\\b((?{StrictRelativeRegex})\\s+(trimestre|cuarto)|(trimestre|cuarto)\\s+(?(actual|pr[oó]ximo|siguiente|pasado|anterior)))\\b' QuarterRegex = f'(el\\s+)?{QuarterTermRegex}((\\s+(del?\\s+)?|\\s*[,-]\\s*)({YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+a[ñn]o|a[ñn]o(\\s+{RelativeSuffixRegex}))|\\s+del\\s+a[ñn]o)?|{RelativeQuarterTermRegex}' QuarterRegexYearFront = f'({YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+a[ñn]o)(?:\\s*-\\s*|\\s+(el\\s+)?)?{QuarterTermRegex}' @@ -71,75 +76,83 @@ class SpanishDateTime: LaterPrefixRegex = f'\\b(?((fin(al)?(es)?|[uú]ltimos)\\s+({OfPrepositionRegex}))|(?m[aá]s\\s+tarde(\\s+(del?|en))?))(\\s+(el|las?|los?))?\\b' PrefixPeriodRegex = f'({EarlyPrefixRegex}|{MidPrefixRegex}|{LaterPrefixRegex})' PrefixDayRegex = f'\\b((?(comienzos?|inicios?|principios?|temprano))|(?mediados)|(?(fin((al)?es)?|m[aá]s\\s+tarde)))(\\s+(en|{OfPrepositionRegex}))?(\\s+([ae]l)(\\s+d[ií]a)?)?$' - CenturySuffixRegex = f'(^siglo)\\b' + CenturySuffixRegex = '(^siglo)\\b' SeasonRegex = f'\\b(?(([uú]ltim[oa]|est[ea]|el|la|(pr[oó]xim[oa]s?|siguiente)|{PrefixPeriodRegex})\\s+)?(?primavera|verano|otoño|invierno)((\\s+(del?|en)|\\s*,\\s*)?\\s+({YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año))?)\\b' WhichWeekRegex = f'\\b(semana)(\\s*)(?5[0-3]|[1-4]\\d|0?[1-9])(\\s+del?\\s+({YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año|año\\s+(?pasado)))?\\b' WeekOfRegex = f'((del?|el|la)\\s+)?(semana)(\\s*)({OfPrepositionRegex}|que\\s+(inicia|comienza)\\s+el|(que\\s+va|a\\s+partir)\\s+del)' MonthOfRegex = f'(mes)(\\s+)({OfPrepositionRegex})' - RangeUnitRegex = f'\\b(?años?|mes(es)?|semanas?)\\b' - BeforeAfterRegex = f'^[.]' - InConnectorRegex = f'\\b(en)(?=\\s*$)\\b' - TodayNowRegex = f'\\b(hoy|ahora|este entonces)\\b' - FromRegex = f'((\\bde(sde)?)(\\s*la(s)?)?)$' - BetweenRegex = f'(\\bentre\\s*(la(s)?)?)' - WeekDayRegex = f'\\b(?(domingos?|lunes|martes|mi[eé]rcoles|jueves|viernes|s[aá]bados?)\\b|(lun|mar|mi[eé]|jue|vie|s[aá]b|dom|lu|ma|mi|ju|vi|s[aá]|do)(\\.|\\b))(?!ñ)' + RangeUnitRegex = '\\b(?años?|mes(es)?|semanas?)\\b' + BeforeAfterRegex = '^[.]' + InConnectorRegex = '\\b(en)(?=\\s*$)\\b' + TodayNowRegex = '\\b(hoy|ahora|este entonces)\\b' + FromRegex = '((\\bde(sde)?)(\\s*la(s)?)?)$' + BetweenRegex = '(\\bentre\\s*(la(s)?)?)' + WeekDayRegex = '\\b(?(domingos?|lunes|martes|mi[eé]rcoles|jueves|viernes|s[aá]bados?)\\b|(lun|mar|mi[eé]|jue|vie|s[aá]b|dom|lu|ma|mi|ju|vi|s[aá]|do)(\\.|\\b))(?!ñ)' OnRegex = f'((?<=\\b(e[ln])\\s+)|(\\be[ln]\\s+d[ií]a\\s+))({DayRegex}s?)(?![.,]\\d)\\b' - RelaxedOnRegex = f'(?<=\\b(en|d?el)\\s+)((?10|11|12|13|14|15|16|17|18|19|1st|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)s?)(?![.,]\\d)\\b' - SpecialDayRegex = f'\\b((el\\s+)?(d[ií]a\\s+antes\\s+de\\s+ayer|anteayer)|((el\\s+)?d[ií]a\\s+(despu[eé]s\\s+)?de\\s+mañana|pasado\\s+mañana)|(el\\s)?d[ií]a\\s+(siguiente|anterior)|(el\\s)?pr[oó]ximo\\s+d[ií]a|(el\\s+)?[uú]ltimo\\s+d[ií]a|(d)?el\\s+d[ií]a(?!\\s+(de|internacional))|ayer|mañana|hoy)\\b' - SpecialDayWithNumRegex = f'^[.]' + RelaxedOnRegex = '(?<=\\b(en|d?el)\\s+)((?10|11|12|13|14|15|16|17|18|19|1st|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)s?)(?![.,]\\d)\\b' + SpecialDayRegex = '\\b((el\\s+)?(d[ií]a\\s+antes\\s+de\\s+ayer|anteayer)|((el\\s+)?d[ií]a\\s+(despu[eé]s\\s+)?de\\s+mañana|pasado\\s+mañana)|(el\\s)?d[ií]a\\s+(siguiente|anterior)|(el\\s)?pr[oó]ximo\\s+d[ií]a|(el\\s+)?[uú]ltimo\\s+d[ií]a|(d)?el\\s+d[ií]a(?!\\s+(de|internacional))|ayer|mañana|hoy)\\b' + SpecialDayWithNumRegex = '^[.]' FlexibleDayRegex = f'(?([a-z]+\\s)?({WrittenDayRegex}|{DayRegex}))' ForTheRegex = f'\\b((((?<=para\\s+el\\s+){FlexibleDayRegex})|((?\\s*(,|\\.(?![º°ª])|!|\\?|-|$))(?!\\d))' WeekDayAndDayOfMonthRegex = f'\\b{WeekDayRegex}\\s+((el\\s+(d[ií]a\\s+)?){FlexibleDayRegex})\\b' WeekDayAndDayRegex = f'\\b{WeekDayRegex}\\s+({DayRegex}|{WrittenDayRegex})(?!([-:/]|\\.\\d|(\\s+({AmDescRegex}|{PmDescRegex}|{OclockRegex}))))\\b' WeekDayOfMonthRegex = f'(?(el\\s+)?(?primera?|1era?|segund[ao]|2d[ao]|tercera?|3era?|cuart[ao]|4t[ao]|quint[ao]|5t[ao]|((1|2|3|4|5)(\\.)?[ºª])|[uú]ltim[ao])\\s+(semana\\s+{MonthSuffixRegex}\\s+el\\s+{WeekDayRegex}|{WeekDayRegex}\\s+{MonthSuffixRegex}))' - RelativeWeekDayRegex = f'^[.]' - AmbiguousRangeModifierPrefix = f'^[.]' - NumberEndingPattern = f'^[.]' + RelativeWeekDayRegex = '^[.]' + AmbiguousRangeModifierPrefix = '^[.]' + NumberEndingPattern = '^[.]' DateTokenPrefix = 'en ' TimeTokenPrefix = 'a las ' TokenBeforeDate = 'el ' TokenBeforeTime = 'a las ' - HalfTokenRegex = f'^((y\\s+)?media)' - QuarterTokenRegex = f'^((y\\s+)?cuarto|(?menos\\s+cuarto))' - PastTokenRegex = f'\\b(pasad[ao]s(\\s+(de\\s+)?las)?)$' - ToTokenRegex = f'\\b((para|antes)(\\s+(de\\s+)?las?)|(?^menos))$' + HalfTokenRegex = '^((y\\s+)?media)' + QuarterTokenRegex = '^((y\\s+)?cuarto|(?menos\\s+cuarto))' + PastTokenRegex = '\\b(pasad[ao]s(\\s+(de\\s+)?las)?)$' + ToTokenRegex = '\\b((para|antes)(\\s+(de\\s+)?las?)|(?^menos))$' SpecialDateRegex = f'(?<=\\b(en)\\s+el\\s+){DayRegex}\\b' - OfMonthRegex = f'^\\s*((d[ií]a\\s+)?d[eo]\\s+)?{MonthSuffixRegex}' - MonthEndRegex = f'({MonthRegex}\\s*(el)?\\s*$)' + OfMonth = f'^\\s*((d[ií]a\\s+)?d[eo]\\s+)?{MonthSuffixRegex}' + MonthEnd = f'({MonthRegex}\\s*(el)?\\s*$)' WeekDayEnd = f'{WeekDayRegex}\\s*,?\\s*$' - WeekDayStart = f'^\\b$' - DateYearRegex = f'(?{YearRegex}|(?{YearRegex}|(?2[0-4]|[0-1]?\\d)' - HourNumRegex = f'\\b(?cero|una|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce)\\b' - MinuteNumRegex = f'(?uno?|d[óo]s|tr[eé]s|cuatro|cinco|s[eé]is|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|diecis[eé]is|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)' - DeltaMinuteNumRegex = f'(?uno?|d[óo]s|tr[eé]s|cuatro|cinco|s[eé]is|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|diecis[eé]is|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)' - PmRegex = f'(?((por|de|a|en)\\s+la)\\s+(tarde|noche))' - AmRegex = f'(?((por|de|a|en)\\s+la)\\s+(mañana|madrugada))' - AmTimeRegex = f'(?(esta|(por|de|a|en)\\s+la)\\s+(mañana|madrugada))' - PmTimeRegex = f'(?(esta|(por|de|a|en)\\s+la)\\s+(tarde|noche))' - NightTimeRegex = f'(noche)' - LastNightTimeRegex = f'(anoche)' - NowTimeRegex = f'(ahora|mismo|momento)' - RecentlyTimeRegex = f'(mente)' - AsapTimeRegex = f'(posible|pueda[ns]?|podamos)' + HourRegex = '\\b(?2[0-4]|[0-1]?\\d)' + HourNumRegex = '\\b(?cero|una|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce)\\b' + MinuteNumRegex = '(?uno?|d[óo]s|tr[eé]s|cuatro|cinco|s[eé]is|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|diecis[eé]is|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)' + DeltaMinuteNumRegex = '(?uno?|d[óo]s|tr[eé]s|cuatro|cinco|s[eé]is|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|diecis[eé]is|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)' + PmRegex = '(?((por|de|a|en)\\s+la)\\s+(tarde|noche))' + AmRegex = '(?((por|de|a|en)\\s+la)\\s+(mañana|madrugada))' + AmTimeRegex = '(?(esta|(por|de|a|en)\\s+la)\\s+(mañana|madrugada))' + PmTimeRegex = '(?(esta|(por|de|a|en)\\s+la)\\s+(tarde|noche))' + NightTimeRegex = '(noche)' + LastNightTimeRegex = '(anoche)' + NowTimeRegex = '(ahora|mismo|momento)' + RecentlyTimeRegex = '(mente)' + AsapTimeRegex = '(posible|pueda[ns]?|podamos)' LessThanOneHour = f'(?((\\s+y\\s+)?cuarto|(\\s*)menos cuarto|(\\s+y\\s+)media|{BaseDateTime.DeltaMinuteRegex}(\\s+(minutos?|mins?))|{DeltaMinuteNumRegex}(\\s+(minutos?|mins?))))' - TensTimeRegex = f'(?diez|veint(i|e)|treinta|cuarenta|cincuenta)' - WrittenTimeRegex = f'(?{HourNumRegex}\\s*((y|(?menos))\\s+)?(({TensTimeRegex}(\\s*y\\s+)?)?{MinuteNumRegex}))' - TimePrefix = f'(?{LessThanOneHour}(\\s+(pasad[ao]s)\\s+(de\\s+las|las)?|\\s+(para|antes\\s+de)?\\s+(las?))?)' + TensTimeRegex = '(?diez|veint(i|e)|treinta|cuarenta|cincuenta)' + WrittenTimeRegex = ( + f'(?{HourNumRegex}\\s*((y|(?menos))\\s+)?(({TensTimeRegex}(\\s*y\\s+)?)?{MinuteNumRegex}))' + ) + TimePrefix = ( + f'(?{LessThanOneHour}(\\s+(pasad[ao]s)\\s+(de\\s+las|las)?|\\s+(para|antes\\s+de)?\\s+(las?))?)' + ) TimeSuffix = f'(?({LessThanOneHour}\\s+)?({AmRegex}|{PmRegex}|{OclockRegex}))' GeneralDescRegex = f'({DescRegex}|(?{AmRegex}|{PmRegex}))' BasicTime = f'(?{WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}:{BaseDateTime.MinuteRegex}(:{BaseDateTime.SecondRegex})?|{BaseDateTime.HourRegex})' - MidTimeRegex = f'(?((?media\\s*noche)|(?media\\s*madrugada)|(?media\\s*mañana)|(?media\\s*tarde)|(?medio\\s*d[ií]a)))' + MidTimeRegex = '(?((?media\\s*noche)|(?media\\s*madrugada)|(?media\\s*mañana)|(?media\\s*tarde)|(?medio\\s*d[ií]a)))' AtRegex = f'\\b((?<=\\b((a|de(sde)?)\\s+las?|al)\\s+)(({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex})\\b(\\s*\\bh\\b)?(DescRegex)?|{MidTimeRegex})|{MidTimeRegex})' ConnectNumRegex = f'({BaseDateTime.HourRegex}(?[0-5][0-9])\\s*{DescRegex})' TimeRegexWithDotConnector = f'({BaseDateTime.HourRegex}\\.{BaseDateTime.MinuteRegex})' @@ -153,467 +166,580 @@ class SpanishDateTime: TimeRegex8 = f'\\b{TimeSuffix}\\s+{BasicTime}((\\s*{DescRegex})|\\b)' TimeRegex9 = f'\\b(?{HourNumRegex}\\s+({TensTimeRegex}\\s*)(y\\s+)?{MinuteNumRegex}?)\\b' TimeRegex11 = f'\\b({WrittenTimeRegex})(\\s+{DescRegex})?\\b' - TimeRegex12 = f'(\\b{TimePrefix}\\s+)?{BaseDateTime.HourRegex}(\\s*h\\s*){BaseDateTime.MinuteRegex}(\\s*{DescRegex})?' - PrepositionRegex = f'(?^(,\\s*)?(a(l)?|en|de(l)?)?(\\s*(la(s)?|el|los))?$)' - LaterEarlyRegex = f'((?temprano)|(?fin(al)?(\\s+de)?|m[aá]s\\s+tarde))' - NowRegex = f'\\b(?(justo\\s+)?ahora(\\s+mismo)?|en\\s+este\\s+momento|tan\\s+pronto\\s+como\\s+sea\\s+posible|tan\\s+pronto\\s+como\\s+(pueda|puedas|podamos|puedan)|lo\\s+m[aá]s\\s+pronto\\s+posible|recientemente|previamente|este entonces)\\b' - SuffixRegex = f'^\\s*(((y|a|en|por)\\s+la|al)\\s+)?(mañana|madrugada|medio\\s*d[ií]a|(?^(,\\s*)?(a(l)?|en|de(l)?)?(\\s*(la(s)?|el|los))?$)' + LaterEarlyRegex = '((?temprano)|(?fin(al)?(\\s+de)?|m[aá]s\\s+tarde))' + NowRegex = '\\b(?(justo\\s+)?ahora(\\s+mismo)?|en\\s+este\\s+momento|tan\\s+pronto\\s+como\\s+sea\\s+posible|tan\\s+pronto\\s+como\\s+(pueda|puedas|podamos|puedan)|lo\\s+m[aá]s\\s+pronto\\s+posible|recientemente|previamente|este entonces)\\b' + SuffixRegex = ( + '^\\s*(((y|a|en|por)\\s+la|al)\\s+)?(mañana|madrugada|medio\\s*d[ií]a|(?(({LaterEarlyRegex}\\s+)((del?|en|por)(\\s+(el|los?|las?))?\\s+)?)?(mañana|madrugada|pasado\\s+(el\\s+)?medio\\s?d[ií]a|(?mañana|madrugada|(?pasado\\s+(el\\s+)?medio\\s?d[ií]a|tarde|noche))\\b' - PeriodTimeOfDayRegex = f'\\b((en\\s+(el|la|lo)?\\s+)?({LaterEarlyRegex}\\s+)?(est[ae]\\s+)?{DateTimeTimeOfDayRegex})\\b' + SpecificEndOfRegex = '((a|e)l\\s+)?fin(alizar|al)?(\\s+(el|de(l)?)(\\s+d[ií]a)?(\\s+de)?)?\\s*$' + UnspecificEndOfRegex = '\\b([ae]l\\s+)?(fin(al)?\\s+del?\\s+d[ií]a)\\b' + UnspecificEndOfRangeRegex = '^[.]' + DateTimeTimeOfDayRegex = ( + '\\b(?mañana|madrugada|(?pasado\\s+(el\\s+)?medio\\s?d[ií]a|tarde|noche))\\b' + ) + PeriodTimeOfDayRegex = ( + f'\\b((en\\s+(el|la|lo)?\\s+)?({LaterEarlyRegex}\\s+)?(est[ae]\\s+)?{DateTimeTimeOfDayRegex})\\b' + ) PeriodSpecificTimeOfDayRegex = f'\\b(({LaterEarlyRegex}\\s+)?est[ae]\\s+{DateTimeTimeOfDayRegex}|({StrictRelativeRegex}\\s+{PeriodTimeOfDayRegex})|anoche)\\b' - UnitRegex = f'(?años?|(bi|tri|cuatri|se)mestre|mes(es)?|semanas?|fin(es)?\\s+de\\s+semana|finde|d[ií]as?|horas?|hra?s?|hs?|minutos?|mins?|segundos?|segs?|noches?)\\b' - ConnectorRegex = f'^(,|t|(para|y|a|en|por) las?|(\\s*,\\s*)?((cerca|alrededor)\\s+)?(de\\s+las?|del))$' - TimeHourNumRegex = f'(?veint(i(uno|dos|tres|cuatro)|e)|cero|uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieci(s([eé])is|siete|ocho|nueve))' + UnitRegex = '(?años?|(bi|tri|cuatri|se)mestre|mes(es)?|semanas?|fin(es)?\\s+de\\s+semana|finde|d[ií]as?|horas?|hra?s?|hs?|minutos?|mins?|segundos?|segs?|noches?)\\b' + ConnectorRegex = '^(,|t|(para|y|a|en|por) las?|(\\s*,\\s*)?((cerca|alrededor)\\s+)?(de\\s+las?|del))$' + TimeHourNumRegex = '(?veint(i(uno|dos|tres|cuatro)|e)|cero|uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieci(s([eé])is|siete|ocho|nueve))' PureNumFromTo = f'((\\b(desde|de)\\s+(la(s)?\\s+)?)?({BaseDateTime.HourRegex}|{TimeHourNumRegex})(?!\\s+al?\\b)(\\s*(?{DescRegex}))?|(\\b(desde|de)\\s+(la(s)?\\s+)?)({BaseDateTime.HourRegex}|{TimeHourNumRegex})(\\s*(?{DescRegex}))?)\\s*{TillRegex}\\s*({BaseDateTime.HourRegex}|{TimeHourNumRegex})\\s*(?{PmRegex}|{AmRegex}|{DescRegex})?' PureNumBetweenAnd = f'(\\bentre\\s+(la(s)?\\s+)?)(({BaseDateTime.TwoDigitHourRegex}{BaseDateTime.TwoDigitMinuteRegex})|{BaseDateTime.HourRegex}|{TimeHourNumRegex})(\\s*(?{DescRegex}))?\\s*{RangeConnectorRegex}\\s*(({BaseDateTime.TwoDigitHourRegex}{BaseDateTime.TwoDigitMinuteRegex})|{BaseDateTime.HourRegex}|{TimeHourNumRegex})\\s*(?{PmRegex}|{AmRegex}|{DescRegex})?' SpecificTimeFromTo = f'({RangePrefixRegex}\\s+)?(?(({TimeRegex2}|{TimeRegexWithDotConnector}(\\s*{DescRegex})?)|({BaseDateTime.HourRegex}|{TimeHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{TillRegex}\\s*(?(({TimeRegex2}|{TimeRegexWithDotConnector}(\\s*{DescRegex})?)|({BaseDateTime.HourRegex}|{TimeHourNumRegex})(\\s*(?{DescRegex}))?))' SpecificTimeBetweenAnd = f'({BetweenRegex}\\s+)(?(({TimeRegex1}|{TimeRegex2}|{TimeRegexWithDotConnector}(\\s*{DescRegex})?)|({BaseDateTime.HourRegex}|{TimeHourNumRegex})(\\s*(?{DescRegex}))?))\\s*{RangeConnectorRegex}\\s*(?(({TimeRegex1}|{TimeRegex2}|{TimeRegexWithDotConnector}(\\s*{DescRegex})?)|({BaseDateTime.HourRegex}|{TimeHourNumRegex})(\\s*(?{DescRegex}))?))' - TimeUnitRegex = f'([^A-Za-z]{{1,}}|\\b)(?(hora|minuto|min|segundo|se[cg])(?s)?|h)\\b' + TimeUnitRegex = '([^A-Za-z]{1,}|\\b)(?(hora|minuto|min|segundo|se[cg])(?s)?|h)\\b' TimeFollowedUnit = f'^\\s*{TimeUnitRegex}' TimeNumberCombinedWithUnit = f'\\b(?\\d+(\\,\\d*)?)\\s*{TimeUnitRegex}' DateTimePeriodNumberCombinedWithUnit = f'\\b(?\\d+(\\.\\d*)?)\\s*{TimeUnitRegex}' PeriodTimeOfDayWithDateRegex = f'\\b(((y|a|en|por)\\s+(la\\s+)?|al\\s+)?((((?primeras\\s+horas\\s+)|(?(últimas|altas)\\s+horas\\s+))(de\\s+la\\s+)?|{LaterEarlyRegex}\\s+(est[ae]\\s+)?)?(?(mañana|madrugada|pasado\\s+(el\\s+)?medio\\s?d[ií]a|(?\\s*(y)\\s+((un[ao]?)\\s+)?(?media|cuarto))' + LessThanRegex = '\\b(dentro\\s+de\\s+menos\\s+de)\\b' + MoreThanRegex = '\\b(durante\\s+(m[áa]s\\s+)?de)\\b' + SuffixAndRegex = '(?\\s*(y)\\s+((un[ao]?)\\s+)?(?media|cuarto))' FollowedUnit = f'^\\s*{UnitRegex}' DurationNumberCombinedWithUnit = f'\\b(?\\d+(\\,\\d*)?){UnitRegex}' AnUnitRegex = f'\\b(una?|otr[ao])\\s+{UnitRegex}' - DuringRegex = f'^[.]' - AllRegex = f'\\b(?tod[oa]?\\s+(el|la)\\s+(?año|mes|semana|d[ií]a)|((una?|el|la)\\s+)?(?año|mes|semana|d[ií]a)\\s+enter[ao])\\b' - HalfRegex = f'\\b(?medi[oa]\\s+(?ano|mes|semana|d[íi]a|hora))\\b' - ConjunctionRegex = f'^[.]' - InexactNumberRegex = f'\\b(pocos?|algo|vari[ao]s|algun[ao]s|un[ao]s)\\b' + DuringRegex = '^[.]' + AllRegex = '\\b(?tod[oa]?\\s+(el|la)\\s+(?año|mes|semana|d[ií]a)|((una?|el|la)\\s+)?(?año|mes|semana|d[ií]a)\\s+enter[ao])\\b' + HalfRegex = '\\b(?medi[oa]\\s+(?ano|mes|semana|d[íi]a|hora))\\b' + ConjunctionRegex = '^[.]' + InexactNumberRegex = '\\b(pocos?|algo|vari[ao]s|algun[ao]s|un[ao]s)\\b' InexactNumberUnitRegex = f'({InexactNumberRegex})\\s+{UnitRegex}' HolidayRegex1 = f'\\b(?viernes\\s+(santo|negro)|mi[eé]rcoles de ceniza|martes de carnaval|d[ií]a (de|de los) presidentes?|clebraci[oó]n de mao|año nuevo chino|año nuevo|noche vieja|(festividad de )?los mayos|d[ií]a de los inocentes|navidad|noche buena|d[ií]a de acci[oó]n de gracias|acci[oó]n de gracias|yuandan|halloween|noches de brujas|pascuas)(\\s+(del?\\s+)?({YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b' HolidayRegex2 = f'\\b(?(d[ií]a( del?( la)?)? )?(martin luther king|todos los santos|tierra|blanco|san patricio|san valent[ií]n|san jorge|cinco de mayo|independencia|raza|trabajador))(\\s+(del?\\s+)?({YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b' HolidayRegex3 = f'\\b(?(d[ií]a( internacional)?( del?( l[ao]s?)?)? )(trabajador(es)?|madres?|padres?|[aá]rbol|mujer(es)?|solteros?|niños?|marmota|san valent[ií]n|maestro))(\\s+(del?\\s+)?({YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b' - BeforeRegex = f'(\\b((ante(s|rior)|m[aá]s\\s+temprano|no\\s+m[aá]s\\s+tard(e|ar)|hasta|(?tan\\s+tarde\\s+como))(\\s+(del?|a|que)(\\s+(el|las?|los?))?)?)|(?)((?<\\s*=)|<))' - AfterRegex = f'((\\b(despu[eé]s|(año\\s+)?posterior|m[aá]s\\s+tarde|a\\s+primeros)(\\s*(del?|en|a)(\\s+(el|las?|los?))?)?|(empi?en?zando|comenzando)(\\s+(el|las?|los?))?)\\b|(?>\\s*=)|>))' - SinceRegex = f'\\b(((cualquier\\s+tiempo\\s+)?(desde|a\\s+partir\\s+del?)|tan\\s+(temprano|pronto)\\s+como(\\s+(de|a))?)(\\s+(el|las?|los?))?)\\b' + BeforeRegex = '(\\b((ante(s|rior)|m[aá]s\\s+temprano|no\\s+m[aá]s\\s+tard(e|ar)|hasta|(?tan\\s+tarde\\s+como))(\\s+(del?|a|que)(\\s+(el|las?|los?))?)?)|(?)((?<\\s*=)|<))' + AfterRegex = '((\\b(despu[eé]s|(año\\s+)?posterior|m[aá]s\\s+tarde|a\\s+primeros)(\\s*(del?|en|a)(\\s+(el|las?|los?))?)?|(empi?en?zando|comenzando)(\\s+(el|las?|los?))?)\\b|(?>\\s*=)|>))' + SinceRegex = '\\b(((cualquier\\s+tiempo\\s+)?(desde|a\\s+partir\\s+del?)|tan\\s+(temprano|pronto)\\s+como(\\s+(de|a))?)(\\s+(el|las?|los?))?)\\b' SinceRegexExp = f'({SinceRegex}|\\bde\\b)' - AroundRegex = f'(?:\\b(?:cerca|alrededor|aproximadamente)(\\s+(de\\s+(las?|el)|del?))?\\s*\\b)' - PeriodicRegex = f'\\b(?a\\s*diario|diaria(s|mente)|(bi|tri)?(semanal|quincenal|mensual|(se|tri)mestral|anual)(es|mente)?)\\b' - EachExpression = f'\\b(cada|tod[oa]s\\s*(l[oa]s)?)\\b\\s*(?!\\s*l[oa]\\b)' - EachUnitRegex = f'(?({EachExpression})\\s*({UnitRegex}|(?fin(es)?\\s+de\\s+semana|finde)\\b))' - EachPrefixRegex = f'(?({EachExpression})\\s*$)' - EachDayRegex = f'\\s*({EachExpression})\\s*d[ií]as\\s*\\b' + AroundRegex = '(?:\\b(?:cerca|alrededor|aproximadamente)(\\s+(de\\s+(las?|el)|del?))?\\s*\\b)' + EachExpression = '\\b(cada|tod[oa]s\\s*(l[oa]s)?)\\b\\s*(?!\\s*l[oa]\\b)' BeforeEachDayRegex = f'({EachExpression})\\s*d[ií]as(\\s+a\\s+las?)?\\s*\\b' - SetEachRegex = f'(?({EachExpression})\\s*)' LaterEarlyPeriodRegex = f'\\b(({PrefixPeriodRegex})\\s+(?{OneWordPeriodRegex}|(?{BaseDateTime.FourDigitYearRegex}))|({UnspecificEndOfRangeRegex}))\\b' - RelativeWeekRegex = f'(((la|el)\\s+)?(((est[ae]|pr[oó]xim[oa]|[uú]ltim(o|as|os))\\s+semanas?)|(semanas?\\s+(que\\s+viene|pasad[oa]))))' + RelativeWeekRegex = '(((la|el)\\s+)?(((est[ae]|pr[oó]xim[oa]|[uú]ltim(o|as|os))\\s+semanas?)|(semanas?\\s+(que\\s+viene|pasad[oa]))))' WeekWithWeekDayRangeRegex = f'\\b((({RelativeWeekRegex})((\\s+entre\\s+{WeekDayRegex}\\s+y\\s+{WeekDayRegex})|(\\s+de\\s+{WeekDayRegex}\\s+a\\s+{WeekDayRegex})))|((entre\\s+{WeekDayRegex}\\s+y\\s+{WeekDayRegex})|(de\\s+{WeekDayRegex}\\s+a\\s+{WeekDayRegex})){OfPrepositionRegex}\\s+{RelativeWeekRegex})\\b' - GeneralEndingRegex = f'^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$' - MiddlePauseRegex = f'^[.]' - PrefixArticleRegex = f'\\b(e[ln]\\s+(d[ií]a\\s+)?)' - OrRegex = f'^[.]' + GeneralEndingRegex = '^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$' + MiddlePauseRegex = '^[.]' + PrefixArticleRegex = '\\b(e[ln]\\s+(d[ií]a\\s+)?)' + OrRegex = '^[.]' SpecialYearTermsRegex = f'\\b(({SpecialYearPrefixes}\\s+años?\\s+|años?\\s+({SpecialYearPrefixes}\\s+)?)(de\\s+)?)' YearPlusNumberRegex = f'\\b({SpecialYearTermsRegex}((?(\\d{{2,4}}))|{FullTextYearRegex}))\\b' NumberAsTimeRegex = f'\\b({WrittenTimeRegex}|{HourRegex}(?\\s*h(oras)?)?)\\b' TimeBeforeAfterRegex = f'\\b((?<=\\b(antes|no\\s+m[aá]s\\s+tard(e|ar)\\s+(de|a\\s+las?)|por| después)\\s+)({WrittenTimeRegex}|{HourNumRegex}|{BaseDateTime.HourRegex}|{MidTimeRegex}))\\b' - DateNumberConnectorRegex = f'^\\s*(?a\\s+las)\\s*$' - CenturyRegex = f'^[.]' - DecadeRegex = f'(?diez|veinte|treinta|cuarenta|cincuenta|se[st]enta|ochenta|noventa)' + DateNumberConnectorRegex = '^\\s*(?a\\s+las)\\s*$' + CenturyRegex = '^[.]' + DecadeRegex = '(?diez|veinte|treinta|cuarenta|cincuenta|se[st]enta|ochenta|noventa)' DecadeWithCenturyRegex = f'(los\\s+)?((((d[ée]cada(\\s+de)?)\\s+)(((?\\d|1\\d|2\\d)?(?\\d0))))|a[ñn]os\\s+((((dos\\s+)?mil\\s+)?({WrittenOneHundredToNineHundredRegex}\\s+)?{DecadeRegex})|((dos\\s+)?mil\\s+)?({WrittenOneHundredToNineHundredRegex})(\\s+{DecadeRegex}?)|((dos\\s+)?mil)(\\s+{WrittenOneHundredToNineHundredRegex}\\s+)?{DecadeRegex}?))' RelativeDecadeRegex = f'\\b(((el|las?)\\s+)?{RelativeRegex}\\s+((?[\\w,]+)\\s+)?(d[eé]cada|decenio)s?)\\b' ComplexDatePeriodRegex = f'(?:((de(sde)?)\\s+)?(?.+)\\s*({StrictTillRegex})\\s*(?.+)|((entre)\\s+)(?.+)\\s*({RangeConnectorRegex})\\s*(?.+))' - AmbiguousPointRangeRegex = f'^(mar\\.?)$' + AmbiguousPointRangeRegex = '^(mar\\.?)$' YearSuffix = f'((,|\\sdel?)?\\s*({YearRegex}|{FullTextYearRegex}))' SinceYearSuffixRegex = f'(^\\s*{SinceRegex}(\\s*(el\\s+)?año\\s*)?{YearSuffix})' - AgoRegex = f'\\b(antes\\s+de\\s+(?hoy|ayer|mañana)|antes|hace)\\b' - LaterRegex = f'\\b(despu[eé]s(?!\\s+de\\b)|desde\\s+ahora|(a\\s+partir|despu[eé]s)\\s+de\\s+(ahora|(?hoy|ayer|mañana)))\\b' + AgoRegex = '\\b(antes\\s+de\\s+(?hoy|ayer|mañana)|antes|hace)\\b' + LaterRegex = '\\b(despu[eé]s(?!\\s+de\\b)|desde\\s+ahora|(a\\s+partir|despu[eé]s)\\s+de\\s+(ahora|(?hoy|ayer|mañana)))\\b' Tomorrow = 'mañana' - UnitMap = dict([("años", "Y"), - ("año", "Y"), - ("meses", "MON"), - ("mes", "MON"), - ("trimestre", "3MON"), - ("trimestres", "3MON"), - ("cuatrimestre", "4MON"), - ("cuatrimestres", "4MON"), - ("semestre", "6MON"), - ("semestres", "6MON"), - ("bimestre", "2MON"), - ("bimestres", "2MON"), - ("semanas", "W"), - ("semana", "W"), - ("fin de semana", "WE"), - ("fines de semana", "WE"), - ("finde", "WE"), - ("dias", "D"), - ("dia", "D"), - ("días", "D"), - ("día", "D"), - ("jornada", "D"), - ("noche", "D"), - ("noches", "D"), - ("horas", "H"), - ("hora", "H"), - ("hrs", "H"), - ("hras", "H"), - ("hra", "H"), - ("hr", "H"), - ("h", "H"), - ("minutos", "M"), - ("minuto", "M"), - ("mins", "M"), - ("min", "M"), - ("segundos", "S"), - ("segundo", "S"), - ("segs", "S"), - ("seg", "S")]) - UnitValueMap = dict([("años", 31536000), - ("año", 31536000), - ("meses", 2592000), - ("mes", 2592000), - ("semanas", 604800), - ("semana", 604800), - ("fin de semana", 172800), - ("fines de semana", 172800), - ("finde", 172800), - ("dias", 86400), - ("dia", 86400), - ("días", 86400), - ("día", 86400), - ("noche", 86400), - ("noches", 86400), - ("horas", 3600), - ("hora", 3600), - ("hrs", 3600), - ("hras", 3600), - ("hra", 3600), - ("hr", 3600), - ("h", 3600), - ("minutos", 60), - ("minuto", 60), - ("mins", 60), - ("min", 60), - ("segundos", 1), - ("segundo", 1), - ("segs", 1), - ("seg", 1)]) - SpecialYearPrefixesMap = dict([("fiscal", "FY"), - ("escolar", "SY")]) - SeasonMap = dict([("primavera", "SP"), - ("verano", "SU"), - ("otoño", "FA"), - ("invierno", "WI")]) - SeasonValueMap = dict([("SP", 3), - ("SU", 6), - ("FA", 9), - ("WI", 12)]) - CardinalMap = dict([("primer", 1), - ("primero", 1), - ("primera", 1), - ("1er", 1), - ("1ro", 1), - ("1ra", 1), - ("1.º", 1), - ("1º", 1), - ("1ª", 1), - ("segundo", 2), - ("segunda", 2), - ("2do", 2), - ("2da", 2), - ("2.º", 2), - ("2º", 2), - ("2ª", 2), - ("tercer", 3), - ("tercero", 3), - ("tercera", 3), - ("3er", 3), - ("3ro", 3), - ("3ra", 3), - ("3.º", 3), - ("3º", 3), - ("3ª", 3), - ("cuarto", 4), - ("cuarta", 4), - ("4to", 4), - ("4ta", 4), - ("4.º", 4), - ("4º", 4), - ("4ª", 4), - ("quinto", 5), - ("quinta", 5), - ("5to", 5), - ("5ta", 5), - ("5.º", 5), - ("5º", 5), - ("5ª", 5), - ("sexto", 6), - ("sexta", 6), - ("6to", 6), - ("6ta", 6), - ("septimo", 7), - ("séptimo", 7), - ("septima", 7), - ("séptima", 7), - ("7mo", 7), - ("7ma", 7), - ("octavo", 8), - ("octava", 8), - ("8vo", 8), - ("8va", 8), - ("noveno", 9), - ("novena", 9), - ("9no", 9), - ("9na", 9), - ("decimo", 10), - ("décimo", 10), - ("decima", 10), - ("décima", 10), - ("10mo", 10), - ("10ma", 10), - ("undecimo", 11), - ("undécimo", 11), - ("undecima", 11), - ("undécima", 11), - ("11mo", 11), - ("11ma", 11), - ("duodecimo", 12), - ("duodécimo", 12), - ("duodecima", 12), - ("duodécima", 12), - ("12mo", 12), - ("12ma", 12)]) - DayOfWeek = dict([("lunes", 1), - ("martes", 2), - ("miercoles", 3), - ("miércoles", 3), - ("jueves", 4), - ("viernes", 5), - ("sabado", 6), - ("sábado", 6), - ("domingo", 0), - ("dom", 0), - ("lun", 1), - ("mar", 2), - ("mie", 3), - ("mié", 3), - ("jue", 4), - ("vie", 5), - ("sab", 6), - ("sáb", 6), - ("dom.", 0), - ("lun.", 1), - ("mar.", 2), - ("mie.", 3), - ("mié.", 3), - ("jue.", 4), - ("vie.", 5), - ("sab.", 6), - ("sáb.", 6), - ("do", 0), - ("lu", 1), - ("ma", 2), - ("mi", 3), - ("ju", 4), - ("vi", 5), - ("sa", 6)]) - MonthOfYear = dict([("enero", 1), - ("febrero", 2), - ("marzo", 3), - ("abril", 4), - ("mayo", 5), - ("junio", 6), - ("julio", 7), - ("agosto", 8), - ("septiembre", 9), - ("setiembre", 9), - ("octubre", 10), - ("noviembre", 11), - ("diciembre", 12), - ("ene", 1), - ("feb", 2), - ("mar", 3), - ("abr", 4), - ("may", 5), - ("jun", 6), - ("jul", 7), - ("ago", 8), - ("sept", 9), - ("sep", 9), - ("set", 9), - ("oct", 10), - ("nov", 11), - ("dic", 12), - ("ene.", 1), - ("feb.", 2), - ("mar.", 3), - ("abr.", 4), - ("may.", 5), - ("jun.", 6), - ("jul.", 7), - ("ago.", 8), - ("sept.", 9), - ("sep.", 9), - ("set.", 9), - ("oct.", 10), - ("nov.", 11), - ("dic.", 12), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("10", 10), - ("11", 11), - ("12", 12), - ("01", 1), - ("02", 2), - ("03", 3), - ("04", 4), - ("05", 5), - ("06", 6), - ("07", 7), - ("08", 8), - ("09", 9)]) - Numbers = dict([("cero", 0), - ("un", 1), - ("una", 1), - ("uno", 1), - ("dos", 2), - ("dós", 2), - ("tres", 3), - ("trés", 3), - ("cuatro", 4), - ("cinco", 5), - ("seis", 6), - ("séis", 6), - ("siete", 7), - ("ocho", 8), - ("nueve", 9), - ("diez", 10), - ("once", 11), - ("doce", 12), - ("docena", 12), - ("docenas", 12), - ("trece", 13), - ("catorce", 14), - ("quince", 15), - ("dieciseis", 16), - ("dieciséis", 16), - ("diecisiete", 17), - ("dieciocho", 18), - ("diecinueve", 19), - ("veinte", 20), - ("veinti", 20), - ("ventiuna", 21), - ("ventiuno", 21), - ("veintiun", 21), - ("veintiún", 21), - ("veintiuno", 21), - ("veintiuna", 21), - ("veintidos", 22), - ("veintidós", 22), - ("veintitres", 23), - ("veintitrés", 23), - ("veinticuatro", 24), - ("veinticinco", 25), - ("veintiseis", 26), - ("veintiséis", 26), - ("veintisiete", 27), - ("veintiocho", 28), - ("veintinueve", 29), - ("treinta", 30), - ("cuarenta", 40), - ("cincuenta", 50)]) - HolidayNames = dict([("padres", ["diadelpadre"]), - ("madres", ["diadelamadre"]), - ("acciondegracias", ["diadegracias", "diadeacciondegracias", "acciondegracias"]), - ("trabajador", ["diadeltrabajador", "diadelostrabajadores", "diainternacionaldeltrabajador", "diainternacionaldelostrabajadores"]), - ("delaraza", ["diadelaraza", "diadeladiversidadcultural"]), - ("memoria", ["diadelamemoria"]), - ("pascuas", ["diadepascuas", "pascuas"]), - ("navidad", ["navidad", "diadenavidad"]), - ("nochebuena", ["diadenochebuena", "nochebuena"]), - ("añonuevo", ["a\u00f1onuevo", "diadea\u00f1onuevo"]), - ("nochevieja", ["nochevieja", "diadenochevieja"]), - ("yuandan", ["yuandan"]), - ("earthday", ["diadelatierra"]), - ("maestro", ["diadelmaestro"]), - ("todoslossantos", ["todoslossantos"]), - ("niño", ["diadelni\u00f1o"]), - ("mujer", ["diadelamujer"]), - ("independencia", ["diadelaindependencia", "diadeindependencia", "independencia"]), - ("blackfriday", ["viernesnegro"]), - ("goodfriday", ["viernessanto"]), - ("stpatrickday", ["sanpatricio", "diadesanpatricio"]), - ("valentinesday", ["sanvalentin", "diadesanvalentin"])]) - VariableHolidaysTimexDictionary = dict([("padres", "-06-WXX-7-3"), - ("madres", "-05-WXX-7-2"), - ("acciondegracias", "-11-WXX-4-4"), - ("delaraza", "-10-WXX-1-2"), - ("memoria", "-03-WXX-2-4")]) - DoubleNumbers = dict([("mitad", 0.5), - ("cuarto", 0.25)]) - UpcomingPrefixRegex = f'((este\\s+))' + UnitMap = dict( + [ + ("años", "Y"), + ("año", "Y"), + ("meses", "MON"), + ("mes", "MON"), + ("trimestre", "3MON"), + ("trimestres", "3MON"), + ("cuatrimestre", "4MON"), + ("cuatrimestres", "4MON"), + ("semestre", "6MON"), + ("semestres", "6MON"), + ("bimestre", "2MON"), + ("bimestres", "2MON"), + ("semanas", "W"), + ("semana", "W"), + ("fin de semana", "WE"), + ("fines de semana", "WE"), + ("finde", "WE"), + ("dias", "D"), + ("dia", "D"), + ("días", "D"), + ("día", "D"), + ("jornada", "D"), + ("noche", "D"), + ("noches", "D"), + ("horas", "H"), + ("hora", "H"), + ("hrs", "H"), + ("hras", "H"), + ("hra", "H"), + ("hr", "H"), + ("h", "H"), + ("minutos", "M"), + ("minuto", "M"), + ("mins", "M"), + ("min", "M"), + ("segundos", "S"), + ("segundo", "S"), + ("segs", "S"), + ("seg", "S"), + ] + ) + UnitValueMap = dict( + [ + ("años", 31536000), + ("año", 31536000), + ("meses", 2592000), + ("mes", 2592000), + ("semanas", 604800), + ("semana", 604800), + ("fin de semana", 172800), + ("fines de semana", 172800), + ("finde", 172800), + ("dias", 86400), + ("dia", 86400), + ("días", 86400), + ("día", 86400), + ("noche", 86400), + ("noches", 86400), + ("horas", 3600), + ("hora", 3600), + ("hrs", 3600), + ("hras", 3600), + ("hra", 3600), + ("hr", 3600), + ("h", 3600), + ("minutos", 60), + ("minuto", 60), + ("mins", 60), + ("min", 60), + ("segundos", 1), + ("segundo", 1), + ("segs", 1), + ("seg", 1), + ] + ) + SpecialYearPrefixesMap = dict([("fiscal", "FY"), ("escolar", "SY")]) + SeasonMap = dict([("primavera", "SP"), ("verano", "SU"), ("otoño", "FA"), ("invierno", "WI")]) + SeasonValueMap = dict([("SP", 3), ("SU", 6), ("FA", 9), ("WI", 12)]) + CardinalMap = dict( + [ + ("primer", 1), + ("primero", 1), + ("primera", 1), + ("1er", 1), + ("1ro", 1), + ("1ra", 1), + ("1.º", 1), + ("1º", 1), + ("1ª", 1), + ("segundo", 2), + ("segunda", 2), + ("2do", 2), + ("2da", 2), + ("2.º", 2), + ("2º", 2), + ("2ª", 2), + ("tercer", 3), + ("tercero", 3), + ("tercera", 3), + ("3er", 3), + ("3ro", 3), + ("3ra", 3), + ("3.º", 3), + ("3º", 3), + ("3ª", 3), + ("cuarto", 4), + ("cuarta", 4), + ("4to", 4), + ("4ta", 4), + ("4.º", 4), + ("4º", 4), + ("4ª", 4), + ("quinto", 5), + ("quinta", 5), + ("5to", 5), + ("5ta", 5), + ("5.º", 5), + ("5º", 5), + ("5ª", 5), + ("sexto", 6), + ("sexta", 6), + ("6to", 6), + ("6ta", 6), + ("septimo", 7), + ("séptimo", 7), + ("septima", 7), + ("séptima", 7), + ("7mo", 7), + ("7ma", 7), + ("octavo", 8), + ("octava", 8), + ("8vo", 8), + ("8va", 8), + ("noveno", 9), + ("novena", 9), + ("9no", 9), + ("9na", 9), + ("decimo", 10), + ("décimo", 10), + ("decima", 10), + ("décima", 10), + ("10mo", 10), + ("10ma", 10), + ("undecimo", 11), + ("undécimo", 11), + ("undecima", 11), + ("undécima", 11), + ("11mo", 11), + ("11ma", 11), + ("duodecimo", 12), + ("duodécimo", 12), + ("duodecima", 12), + ("duodécima", 12), + ("12mo", 12), + ("12ma", 12), + ] + ) + DayOfWeek = dict( + [ + ("lunes", 1), + ("martes", 2), + ("miercoles", 3), + ("miércoles", 3), + ("jueves", 4), + ("viernes", 5), + ("sabado", 6), + ("sábado", 6), + ("domingo", 0), + ("dom", 0), + ("lun", 1), + ("mar", 2), + ("mie", 3), + ("mié", 3), + ("jue", 4), + ("vie", 5), + ("sab", 6), + ("sáb", 6), + ("dom.", 0), + ("lun.", 1), + ("mar.", 2), + ("mie.", 3), + ("mié.", 3), + ("jue.", 4), + ("vie.", 5), + ("sab.", 6), + ("sáb.", 6), + ("do", 0), + ("lu", 1), + ("ma", 2), + ("mi", 3), + ("ju", 4), + ("vi", 5), + ("sa", 6), + ] + ) + MonthOfYear = dict( + [ + ("enero", 1), + ("febrero", 2), + ("marzo", 3), + ("abril", 4), + ("mayo", 5), + ("junio", 6), + ("julio", 7), + ("agosto", 8), + ("septiembre", 9), + ("setiembre", 9), + ("octubre", 10), + ("noviembre", 11), + ("diciembre", 12), + ("ene", 1), + ("feb", 2), + ("mar", 3), + ("abr", 4), + ("may", 5), + ("jun", 6), + ("jul", 7), + ("ago", 8), + ("sept", 9), + ("sep", 9), + ("set", 9), + ("oct", 10), + ("nov", 11), + ("dic", 12), + ("ene.", 1), + ("feb.", 2), + ("mar.", 3), + ("abr.", 4), + ("may.", 5), + ("jun.", 6), + ("jul.", 7), + ("ago.", 8), + ("sept.", 9), + ("sep.", 9), + ("set.", 9), + ("oct.", 10), + ("nov.", 11), + ("dic.", 12), + ("uno", 1), + ("dos", 2), + ("tres", 3), + ("cuatro", 4), + ("cinco", 5), + ("seis", 6), + ("siete", 7), + ("ocho", 8), + ("nueve", 9), + ("diez", 10), + ("once", 11), + ("doce", 12), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("10", 10), + ("11", 11), + ("12", 12), + ("01", 1), + ("02", 2), + ("03", 3), + ("04", 4), + ("05", 5), + ("06", 6), + ("07", 7), + ("08", 8), + ("09", 9), + ] + ) + DayOfMonth = dict( + [ + ("uno", 1), + ("dos", 2), + ("tres", 3), + ("cuatro", 4), + ("cinco", 5), + ("seis", 6), + ("siete", 7), + ("ocho", 8), + ("nueve", 9), + ("diez", 10), + ("once", 11), + ("doce", 12), + ("trece", 13), + ("catorce", 14), + ("quince", 15), + ("dieciséis", 16), + ("dieciseis", 16), + ("diecisiete", 17), + ("dieciocho", 18), + ("diecinueve", 19), + ("veinte", 20), + ("veintiuno", 21), + ("veintidós", 22), + ("veintidos", 22), + ("veintitrés", 23), + ("veinticuatro", 24), + ("veinticinco", 25), + ("veintiséis", 26), + ("veintiseis", 26), + ("veintisiete", 27), + ("veintiocho", 28), + ("veintinueve", 29), + ("treinta", 30), + ("treinta y uno", 31), + ] + ) + Numbers = dict( + [ + ("cero", 0), + ("un", 1), + ("una", 1), + ("uno", 1), + ("dos", 2), + ("dós", 2), + ("tres", 3), + ("trés", 3), + ("cuatro", 4), + ("cinco", 5), + ("seis", 6), + ("séis", 6), + ("siete", 7), + ("ocho", 8), + ("nueve", 9), + ("diez", 10), + ("once", 11), + ("doce", 12), + ("docena", 12), + ("docenas", 12), + ("trece", 13), + ("catorce", 14), + ("quince", 15), + ("dieciseis", 16), + ("dieciséis", 16), + ("diecisiete", 17), + ("dieciocho", 18), + ("diecinueve", 19), + ("veinte", 20), + ("veinti", 20), + ("ventiuna", 21), + ("ventiuno", 21), + ("veintiun", 21), + ("veintiún", 21), + ("veintiuno", 21), + ("veintiuna", 21), + ("veintidos", 22), + ("veintidós", 22), + ("veintitres", 23), + ("veintitrés", 23), + ("veinticuatro", 24), + ("veinticinco", 25), + ("veintiseis", 26), + ("veintiséis", 26), + ("veintisiete", 27), + ("veintiocho", 28), + ("veintinueve", 29), + ("treinta", 30), + ("cuarenta", 40), + ("cincuenta", 50), + ] + ) + HolidayNames = dict( + [ + ("padres", ["diadelpadre"]), + ("madres", ["diadelamadre"]), + ("acciondegracias", ["diadegracias", "diadeacciondegracias", "acciondegracias"]), + ( + "trabajador", + [ + "diadeltrabajador", + "diadelostrabajadores", + "diainternacionaldeltrabajador", + "diainternacionaldelostrabajadores", + ], + ), + ("delaraza", ["diadelaraza", "diadeladiversidadcultural"]), + ("memoria", ["diadelamemoria"]), + ("pascuas", ["diadepascuas", "pascuas"]), + ("navidad", ["navidad", "diadenavidad"]), + ("nochebuena", ["diadenochebuena", "nochebuena"]), + ("añonuevo", ["a\u00f1onuevo", "diadea\u00f1onuevo"]), + ("nochevieja", ["nochevieja", "diadenochevieja"]), + ("yuandan", ["yuandan"]), + ("earthday", ["diadelatierra"]), + ("maestro", ["diadelmaestro"]), + ("todoslossantos", ["todoslossantos"]), + ("niño", ["diadelni\u00f1o"]), + ("mujer", ["diadelamujer"]), + ("independencia", ["diadelaindependencia", "diadeindependencia", "independencia"]), + ("blackfriday", ["viernesnegro"]), + ("goodfriday", ["viernessanto"]), + ("stpatrickday", ["sanpatricio", "diadesanpatricio"]), + ("valentinesday", ["sanvalentin", "diadesanvalentin"]), + ] + ) + VariableHolidaysTimexDictionary = dict( + [ + ("padres", "-06-WXX-7-3"), + ("madres", "-05-WXX-7-2"), + ("acciondegracias", "-11-WXX-4-4"), + ("delaraza", "-10-WXX-1-2"), + ("memoria", "-03-WXX-2-4"), + ] + ) + DoubleNumbers = dict([("mitad", 0.5), ("cuarto", 0.25)]) + UpcomingPrefixRegex = '((este\\s+))' NextPrefixRegex = f'\\b({UpcomingPrefixRegex}?pr[oó]xim[oa]s?|siguiente|que\\s+viene)\\b' - PastPrefixRegex = f'((este\\s+))' - PreviousPrefixRegex = f'\\b({PastPrefixRegex}?pasad[oa]s?(?!(\\s+el)?\\s+medio\\s*d[ií]a)|[uú]ltim[oa]s?|anterior)\\b' - ThisPrefixRegex = f'(est?[ea]|actual)\\b' - PrefixWeekDayRegex = f'(\\s*((,?\\s*el)|[-—–]))' + PastPrefixRegex = '((este\\s+))' + PreviousPrefixRegex = ( + f'\\b({PastPrefixRegex}?pasad[oa]s?(?!(\\s+el)?\\s+medio\\s*d[ií]a)|[uú]ltim[oa]s?|anterior)\\b' + ) + ThisPrefixRegex = '(est?[ea]|actual)\\b' + PrefixWeekDayRegex = '(\\s*((,?\\s*el)|[-—–]))' ThisRegex = f'\\b((est[ae]\\s*)(semana{PrefixWeekDayRegex}?)?\\s*{WeekDayRegex})|({WeekDayRegex}\\s*((de\\s+)?esta\\s+semana))\\b' LastDateRegex = f'\\b(({PreviousPrefixRegex}\\s+(semana{PrefixWeekDayRegex}?)?|(la\\s+)?semana\\s+{PreviousPrefixRegex}{PrefixWeekDayRegex})\\s*{WeekDayRegex})|(este\\s+)?({WeekDayRegex}\\s+([uú]ltimo|pasado|anterior))|({WeekDayRegex}(\\s+((de\\s+)?((esta|la)\\s+([uú]ltima\\s+)?semana)|(de\\s+)?(la\\s+)?semana\\s+(pasada|anterior))))\\b' NextDateRegex = f'\\b((({NextPrefixRegex}\\s+)(semana{PrefixWeekDayRegex}?)?|(la\\s+)?semana\\s+{NextPrefixRegex}{PrefixWeekDayRegex})\\s*{WeekDayRegex})|(este\\s+)?({WeekDayRegex}\\s+(pr[oó]ximo|siguiente|que\\s+viene))|({WeekDayRegex}(\\s+(de\\s+)?(la\\s+)?((pr[oó]xima|siguiente)\\s+semana|semana\\s+(pr[oó]xima|siguiente))))\\b' - RelativeDayRegex = f'(?((este|pr[oó]ximo|([uú]ltim(o|as|os)))\\s+días)|(días\\s+((que\\s+viene)|pasado)))\\b' - RestOfDateRegex = f'\\bresto\\s+((del|de)\\s+)?((la|el|est?[ae])\\s+)?(?semana|mes|año|decada)(\\s+actual)?\\b' + RelativeDayRegex = '(?((este|pr[oó]ximo|([uú]ltim(o|as|os)))\\s+días)|(días\\s+((que\\s+viene)|pasado)))\\b' + RestOfDateRegex = ( + '\\bresto\\s+((del|de)\\s+)?((la|el|est?[ae])\\s+)?(?semana|mes|año|decada)(\\s+actual)?\\b' + ) WithinNextPrefixRegex = f'\\b(dentro\\s+de((\\s+(el|l[ao]s?))?\\s+(?{NextPrefixRegex}))?)(?=\\s*$)\\b' DurationUnitRegex = f'(?{DateUnitRegex}|horas?|hra?s?|hs?|minutos?|mins?|segundos?|segs?|noches?)\\b' - DurationConnectorRegex = f'^\\s*(?\\s+|y|,)\\s*$' - RelativeDurationUnitRegex = f'(?:(?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+)({DurationUnitRegex}))' - ReferencePrefixRegex = f'(mism[ao]|aquel|est?e)\\b' + DurationConnectorRegex = '^\\s*(?\\s+|y|,)\\s*$' + RelativeDurationUnitRegex = ( + f'(?:(?<=({NextPrefixRegex}|{PreviousPrefixRegex}|{ThisPrefixRegex})\\s+)({DurationUnitRegex}))' + ) + ReferencePrefixRegex = '(mism[ao]|aquel|est?e)\\b' ReferenceDatePeriodRegex = f'\\b{ReferencePrefixRegex}\\s+({DateUnitRegex}|fin\\s+de\\s+semana)\\b' - FromToRegex = f'\\b(from).+(to)\\b.+' - SingleAmbiguousMonthRegex = f'^(the\\s+)?(may|march)$' - UnspecificDatePeriodRegex = f'^[\\.]' - PrepositionSuffixRegex = f'\\b(en|el|la|cerca|alrededor|desde|durante|hasta|hacia)$' - RestOfDateTimeRegex = f'\\bresto\\s+((del?)\\s+)?((la|el|est[ae])\\s+)?(?(día|jornada))(\\s+de\\s+hoy)?\\b' - SetWeekDayRegex = f'^[\\.]' - NightRegex = f'\\b(medionoche|noche)\\b' - CommonDatePrefixRegex = f'^[\\.]' - SuffixAfterRegex = f'\\b((a\\s+)?(o|y)\\s+(arriba|despu[eé]s|posterior|mayor|m[aá]s\\s+tarde)(?!\\s+(que|de)))\\b' + FromToRegex = '\\b(from).+(to)\\b.+' + SingleAmbiguousMonthRegex = '^(the\\s+)?(may|march)$' + UnspecificDatePeriodRegex = '^[\\.]' + PrepositionSuffixRegex = '\\b(en|el|la|cerca|alrededor|desde|durante|hasta|hacia)$' + RestOfDateTimeRegex = '\\bresto\\s+((del?)\\s+)?((la|el|est[ae])\\s+)?(?(día|jornada))(\\s+de\\s+hoy)?\\b' + NightRegex = '\\b(medionoche|noche)\\b' + CommonDatePrefixRegex = '^[\\.]' + SuffixAfterRegex = '\\b((a\\s+)?(o|y)\\s+(arriba|despu[eé]s|posterior|mayor|m[aá]s\\s+tarde)(?!\\s+(que|de)))\\b' YearPeriodRegex = f'((((de(sde)?|durante|en)\\s+)?{YearRegex}\\s*({TillRegex})\\s*{YearRegex})|(((entre)\\s+){YearRegex}\\s*({RangeConnectorRegex})\\s*{YearRegex}))' - FutureSuffixRegex = f'\\b(siguiente(s)?|pr[oó]xim[oa](s)?|(en\\s+el\\s+)?futuro)\\b' - PastSuffixRegex = f'^\\b$' + FutureSuffixRegex = '\\b(siguiente(s)?|pr[oó]xim[oa](s)?|(en\\s+el\\s+)?futuro)\\b' + PastSuffixRegex = '^\\b$' ModPrefixRegex = f'\\b({RelativeRegex}|{AroundRegex}|{BeforeRegex}|{AfterRegex}|{SinceRegex})\\b' ModSuffixRegex = f'\\b({AgoRegex}|{LaterRegex}|{BeforeAfterRegex}|{FutureSuffixRegex}|{PastSuffixRegex})\\b' WrittenDecades = dict([("", 0)]) SpecialDecadeCases = dict([("", 0)]) DefaultLanguageFallback = 'DMY' DurationDateRestrictions = [r'hoy'] - AmbiguityFiltersDict = dict([("^\\d{4}$", "(\\d\\.\\d{4}|\\d{4}\\.\\d)"), - ("^(este\\s+)?mi(\\s+([uú]ltimo|pasado|anterior|pr[oó]ximo|siguiente|que\\s+viene))?$", "\\b(este\\s+)?mi(\\s+([uú]ltimo|pasado|anterior|pr[oó]ximo|siguiente|que\\s+viene))?\\b"), - ("^a[nñ]o$", "(? Extractor: - return self._unit_num_extractor - - @property - def build_prefix(self) -> str: - return self._build_prefix - - @property - def build_suffix(self) -> str: - return self._build_suffix - - @property - def connector_token(self) -> str: - return ChineseNumericWithUnit.ConnectorToken - - @property - def compound_unit_connector_regex(self) -> Pattern: - return self._compound_unit_connector_regex - - @property - def non_unit_regex(self) -> Pattern: - return self._pm_non_unit_regex - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return None - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return None - - @property - def extract_type(self) -> str: - raise NotImplementedError - - @property - def suffix_list(self) -> Dict[str, str]: - raise NotImplementedError - - @property - def prefix_list(self) -> Dict[str, str]: - raise NotImplementedError - - @property - def ambiguous_unit_list(self) -> List[str]: - raise NotImplementedError - - @property - def culture_info(self) -> CultureInfo: - return self._culture_info - - def expand_half_suffix(self, source, result, numbers): - # Expand Chinese phrase to the `half` patterns when it follows closely origin phrase. - if self._half_unit_regex and numbers: - match = [number for number in numbers if regex.match(self._half_unit_regex, number.text)] - if match: - res = [] - for er in result: - start = er.start - length = er.length - match_suffix = [mr for mr in match if mr.start == (start + length)] - if len(match_suffix) == 1: - mr = match_suffix[0] - er.length += mr.length - er.text += mr.text - er.data = [er.data, mr] - res.append(er) - result = res - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Chinese) - super().__init__(culture_info) - self._unit_num_extractor = ChineseNumberExtractor( - ChineseNumberExtractorMode.EXTRACT_ALL) - self._build_prefix = ChineseNumericWithUnit.BuildPrefix - self._build_suffix = ChineseNumericWithUnit.BuildSuffix - self._compound_unit_connector_regex = RegExpUtility.get_safe_reg_exp( - ChineseNumericWithUnit.CompoundUnitConnectorRegex) - self._pm_non_unit_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.PmNonUnitRegex) - self._half_unit_regex = RegExpUtility.get_safe_reg_exp(ChineseNumericWithUnit.HalfUnitRegex) - -# pylint: enable=abstract-method - - -class ChineseAgeExtractorConfiguration(ChineseNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_AGE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = ChineseNumericWithUnit.AgeSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = ChineseNumericWithUnit.AgeAmbiguousValues - - -class ChineseCurrencyExtractorConfiguration(ChineseNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_CURRENCY - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = Culture.Chinese): - super().__init__(culture_info) - self._suffix_list = ChineseNumericWithUnit.CurrencySuffixList - self._prefix_list = ChineseNumericWithUnit.CurrencyPrefixList - self._ambiguous_unit_list = ChineseNumericWithUnit.CurrencyAmbiguousValues - - -class ChineseDimensionExtractorConfiguration(ChineseNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_DIMENSION - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = ChineseNumericWithUnit.DimensionSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = ChineseNumericWithUnit.DimensionAmbiguousValues - - -class ChineseTemperatureExtractorConfiguration(ChineseNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_TEMPERATURE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return self._ambiguous_unit_number_multiplier_regex - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = ChineseNumericWithUnit.TemperatureSuffixList - self._prefix_list = ChineseNumericWithUnit.TemperaturePrefixList - self._ambiguous_unit_list = ChineseNumericWithUnit.TemperatureAmbiguousValues - self._ambiguous_unit_number_multiplier_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.AmbiguousUnitNumberMultiplierRegex) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/chinese/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/chinese/parsers.py deleted file mode 100644 index c918e14391..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/chinese/parsers.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.parser import Parser -from recognizers_number.culture import CultureInfo -from recognizers_number.number.chinese.extractors import ChineseNumberExtractor, ChineseNumberExtractorMode -from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType -from recognizers_number.number.chinese.parsers import ChineseNumberParserConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration -from recognizers_number_with_unit.resources.chinese_numeric_with_unit import ChineseNumericWithUnit - - -class ChineseNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): - @property - def internal_number_parser(self) -> Parser: - return self._internal_number_parser - - @property - def internal_number_extractor(self) -> Extractor: - return self._internal_number_extractor - - @property - def connector_token(self) -> str: - return '' - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Chinese) - super().__init__(culture_info) - self._internal_number_extractor = ChineseNumberExtractor( - ChineseNumberExtractorMode.EXTRACT_ALL) - self._internal_number_parser = AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, ChineseNumberParserConfiguration(culture_info)) - self.currency_name_to_iso_code_map = ChineseNumericWithUnit.CurrencyNameToIsoCodeMap - self.currency_fraction_code_list = ChineseNumericWithUnit.FractionalUnitNameToCodeMap - - -class ChineseAgeParserConfiguration(ChineseNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(ChineseNumericWithUnit.AgeSuffixList) - - -class ChineseCurrencyParserConfiguration(ChineseNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(ChineseNumericWithUnit.CurrencySuffixList) - self.add_dict_to_unit_map(ChineseNumericWithUnit.CurrencyPrefixList) - - -class ChineseDimensionParserConfiguration(ChineseNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(ChineseNumericWithUnit.DimensionSuffixList) - - -class ChineseTemperatureParserConfiguration(ChineseNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(ChineseNumericWithUnit.TemperatureSuffixList) - self.add_dict_to_unit_map(ChineseNumericWithUnit.TemperaturePrefixList) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/__init__.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/__init__.py new file mode 100644 index 0000000000..bb7817245e --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/__init__.py @@ -0,0 +1,11 @@ +from .arabic import * +from .catalan import * +from .chinese import * +from .dutch import * +from .english import * +from .french import * +from .german import * +from .italian import * +from .japanese import * +from .portuguese import * +from .spanish import * diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/arabic.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/arabic.py new file mode 100644 index 0000000000..885d718842 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/arabic.py @@ -0,0 +1,72 @@ +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.arabic.extractors import ArabicNumberExtractor, NumberMode +from recognizers_number.number.arabic.parsers import ArabicNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.arabic_numeric_with_unit import ArabicNumericWithUnit +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import RegExpUtility + + +class ArabicNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = None + unit_num_extractor: Extractor = ArabicNumberExtractor(NumberMode.Unit) + build_prefix: str = ArabicNumericWithUnit.BuildPrefix + build_suffix: str = ArabicNumericWithUnit.BuildSuffix + connector_token: str = None + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + ArabicNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Arabic) + super().__init__(culture_info) + + +class ArabicCurrencyExtractorConfiguration(ArabicNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = ArabicNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = ArabicNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = ArabicNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class ArabicNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = ArabicNumberExtractor(NumberMode.DEFAULT) + connector_token: str = None + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Arabic) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, ArabicNumberParserConfiguration(culture_info) + ) + + +class ArabicCurrencyParserConfiguration(ArabicNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(ArabicNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(ArabicNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = ArabicNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = ArabicNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/catalan.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/catalan.py new file mode 100644 index 0000000000..39969acc72 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/catalan.py @@ -0,0 +1,72 @@ +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.catalan.extractors import CatalanNumberExtractor, NumberMode +from recognizers_number.number.catalan.parsers import CatalanNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.catalan_numeric_with_unit import CatalanNumericWithUnit +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import RegExpUtility + + +class CatalanNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = None + unit_num_extractor: Extractor = CatalanNumberExtractor(NumberMode.Unit) + build_prefix: str = CatalanNumericWithUnit.BuildPrefix + build_suffix: str = CatalanNumericWithUnit.BuildSuffix + connector_token: str = CatalanNumericWithUnit.ConnectorToken + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + CatalanNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Catalan) + super().__init__(culture_info) + + +class CatalanCurrencyExtractorConfiguration(CatalanNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = CatalanNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = CatalanNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = CatalanNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class CatalanNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = CatalanNumberExtractor(NumberMode.DEFAULT) + connector_token: str = CatalanNumericWithUnit.ConnectorToken + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Catalan) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, CatalanNumberParserConfiguration(culture_info) + ) + + +class CatalanCurrencyParserConfiguration(CatalanNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(CatalanNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(CatalanNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = CatalanNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = CatalanNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/chinese.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/chinese.py new file mode 100644 index 0000000000..30f1c8b24d --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/chinese.py @@ -0,0 +1,93 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +import regex + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.chinese.extractors import ChineseNumberExtractor, ChineseNumberExtractorMode +from recognizers_number.number.chinese.parsers import ChineseNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.chinese_numeric_with_unit import ChineseNumericWithUnit +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import RegExpUtility + + +class ChineseNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = None + unit_num_extractor: Extractor = ChineseNumberExtractor(ChineseNumberExtractorMode.EXTRACT_ALL) + build_prefix: str = ChineseNumericWithUnit.BuildPrefix + build_suffix: str = ChineseNumericWithUnit.BuildSuffix + connector_token: str = ChineseNumericWithUnit.ConnectorToken + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + ChineseNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + # Expand Chinese phrase to the `half` patterns when it follows closely origin phrase. + if self._half_unit_regex and numbers: + match = [number for number in numbers if regex.match(self._half_unit_regex, number.text)] + if match: + res = [] + for er in result: + start = er.start + length = er.length + match_suffix = [mr for mr in match if mr.start == (start + length)] + if len(match_suffix) == 1: + mr = match_suffix[0] + er.length += mr.length + er.text += mr.text + er.data = [er.data, mr] + res.append(er) + result = res + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Chinese) + super().__init__(culture_info) + self._half_unit_regex = RegExpUtility.get_safe_reg_exp(ChineseNumericWithUnit.HalfUnitRegex) + + +class ChineseCurrencyExtractorConfiguration(ChineseNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = ChineseNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = ChineseNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = ChineseNumericWithUnit.CurrencyAmbiguousValues + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = Culture.Chinese): + super().__init__(culture_info) + + +class ChineseNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = ChineseNumberExtractor(ChineseNumberExtractorMode.EXTRACT_ALL) + connector_token: str = '' + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Chinese) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, ChineseNumberParserConfiguration(culture_info) + ) + self.currency_name_to_iso_code_map = ChineseNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = ChineseNumericWithUnit.FractionalUnitNameToCodeMap + + +class ChineseCurrencyParserConfiguration(ChineseNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(ChineseNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(ChineseNumericWithUnit.CurrencyPrefixList) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/dutch.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/dutch.py new file mode 100644 index 0000000000..40e8d693be --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/dutch.py @@ -0,0 +1,77 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.dutch.extractors import DutchNumberExtractor, NumberMode +from recognizers_number.number.dutch.parsers import DutchNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.dutch_numeric_with_unit import DutchNumericWithUnit +from recognizers_text import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class DutchNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = DefinitionLoader.load_ambiguity_filters( + DutchNumericWithUnit.AmbiguityFiltersDict + ) + unit_num_extractor: Extractor = DutchNumberExtractor(NumberMode.Unit) + build_prefix: str = DutchNumericWithUnit.BuildPrefix + build_suffix: str = DutchNumericWithUnit.BuildSuffix + connector_token: str = '' + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + DutchNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Dutch) + super().__init__(culture_info) + + +class DutchCurrencyExtractorConfiguration(DutchNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = DutchNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = DutchNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = DutchNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class DutchNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = DutchNumberExtractor(NumberMode.DEFAULT) + connector_token: str = '' + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Dutch) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, DutchNumberParserConfiguration(culture_info) + ) + + +class DutchCurrencyParserConfiguration(DutchNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(DutchNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(DutchNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = DutchNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = DutchNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/english.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/english.py new file mode 100644 index 0000000000..8e4fd84f26 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/english.py @@ -0,0 +1,78 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.english.extractors import EnglishNumberExtractor, NumberMode +from recognizers_number.number.english.parsers import EnglishNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.english_numeric_with_unit import EnglishNumericWithUnit +from recognizers_text import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class EnglishNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = DefinitionLoader.load_ambiguity_filters( + EnglishNumericWithUnit.AmbiguityFiltersDict + ) + unit_num_extractor: Extractor = EnglishNumberExtractor(NumberMode.Unit) + build_prefix: str = EnglishNumericWithUnit.BuildPrefix + build_suffix: str = EnglishNumericWithUnit.BuildSuffix + connector_token: str = '' + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + EnglishNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.English) + super().__init__(culture_info) + + +class EnglishCurrencyExtractorConfiguration(EnglishNumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = EnglishNumericWithUnit.AmbiguityFiltersDict + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = EnglishNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = EnglishNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = EnglishNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class EnglishNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = EnglishNumberExtractor(NumberMode.DEFAULT) + connector_token: str = '' + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.English) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, EnglishNumberParserConfiguration(culture_info) + ) + + +class EnglishCurrencyParserConfiguration(EnglishNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(EnglishNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(EnglishNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = EnglishNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = EnglishNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/french.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/french.py new file mode 100644 index 0000000000..7862acbc79 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/french.py @@ -0,0 +1,75 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.french.extractors import FrenchNumberExtractor, NumberMode +from recognizers_number.number.french.parsers import FrenchNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.french_numeric_with_unit import FrenchNumericWithUnit +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import RegExpUtility + + +class FrenchNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = FrenchNumericWithUnit.AmbiguityFiltersDict + unit_num_extractor: Extractor = FrenchNumberExtractor(NumberMode.Unit) + build_prefix: str = FrenchNumericWithUnit.BuildPrefix + build_suffix: str = FrenchNumericWithUnit.BuildSuffix + connector_token: str = FrenchNumericWithUnit.ConnectorToken + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + FrenchNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.French) + super().__init__(culture_info) + + +class FrenchCurrencyExtractorConfiguration(FrenchNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = FrenchNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = FrenchNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = FrenchNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class FrenchNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = FrenchNumberExtractor(NumberMode.DEFAULT) + connector_token: str = FrenchNumericWithUnit.ConnectorToken + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.French) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, FrenchNumberParserConfiguration(culture_info) + ) + + +class FrenchCurrencyParserConfiguration(FrenchNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(FrenchNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(FrenchNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = FrenchNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = FrenchNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/german.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/german.py new file mode 100644 index 0000000000..1288771952 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/german.py @@ -0,0 +1,74 @@ +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.german.extractors import GermanNumberExtractor, NumberMode +from recognizers_number.number.german.parsers import GermanNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.german_numeric_with_unit import GermanNumericWithUnit +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class GermanNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = DefinitionLoader.load_ambiguity_filters( + GermanNumericWithUnit.AmbiguityFiltersDict + ) + unit_num_extractor: Extractor = GermanNumberExtractor(NumberMode.Unit) + build_prefix: str = GermanNumericWithUnit.BuildPrefix + build_suffix: str = GermanNumericWithUnit.BuildSuffix + connector_token: str = GermanNumericWithUnit.ConnectorToken + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + GermanNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.German) + super().__init__(culture_info) + + +class GermanCurrencyExtractorConfiguration(GermanNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = GermanNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = GermanNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = GermanNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class GermanNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = GermanNumberExtractor(NumberMode.DEFAULT) + connector_token: str = GermanNumericWithUnit.ConnectorToken + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.German) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, GermanNumberParserConfiguration(culture_info) + ) + + +class GermanCurrencyParserConfiguration(GermanNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(GermanNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(GermanNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = GermanNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = GermanNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/italian.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/italian.py new file mode 100644 index 0000000000..24038886f2 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/italian.py @@ -0,0 +1,77 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.italian.extractors import ItalianNumberExtractor, NumberMode +from recognizers_number.number.italian.parsers import ItalianNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.italian_numeric_with_unit import ItalianNumericWithUnit +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class ItalianNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = DefinitionLoader.load_ambiguity_filters( + ItalianNumericWithUnit.AmbiguityFiltersDict + ) + unit_num_extractor: Extractor = ItalianNumberExtractor(NumberMode.Unit) + build_prefix: str = ItalianNumericWithUnit.BuildPrefix + build_suffix: str = ItalianNumericWithUnit.BuildSuffix + connector_token: str = ItalianNumericWithUnit.ConnectorToken + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + ItalianNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Italian) + super().__init__(culture_info) + + +class ItalianCurrencyExtractorConfiguration(ItalianNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = ItalianNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = ItalianNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = ItalianNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class ItalianNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = ItalianNumberExtractor(NumberMode.DEFAULT) + connector_token: str = ItalianNumericWithUnit.ConnectorToken + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Italian) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, ItalianNumberParserConfiguration(culture_info) + ) + + +class ItalianCurrencyParserConfiguration(ItalianNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(ItalianNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(ItalianNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = ItalianNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = ItalianNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/japanese.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/japanese.py new file mode 100644 index 0000000000..2227306cb9 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/japanese.py @@ -0,0 +1,76 @@ +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.japanese.extractors import JapaneseNumberExtractor, JapaneseNumberExtractorMode +from recognizers_number.number.japanese.parsers import JapaneseNumberParserConfiguration +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.number_with_unit.utilities import CommonUtils +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.japanese_numeric_with_unit import JapaneseNumericWithUnit +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class JapaneseNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = DefinitionLoader.load_ambiguity_filters( + JapaneseNumericWithUnit.AmbiguityFiltersDict + ) + unit_num_extractor: Extractor = JapaneseNumberExtractor(JapaneseNumberExtractorMode.EXTRACT_ALL) + build_prefix: str = JapaneseNumericWithUnit.BuildPrefix + build_suffix: str = JapaneseNumericWithUnit.BuildSuffix + connector_token: str = JapaneseNumericWithUnit.ConnectorToken + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + JapaneseNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + return CommonUtils.expand_half_suffix(source, result, numbers, self.half_unit_regex) + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Japanese) + super().__init__(culture_info) + self.half_unit_regex = RegExpUtility.get_safe_reg_exp(JapaneseNumericWithUnit.HalfUnitRegex) + + +class JapaneseCurrencyExtractorConfiguration(JapaneseNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = JapaneseNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = JapaneseNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = JapaneseNumericWithUnit.CurrencyAmbiguousValues + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class JapaneseNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = JapaneseNumberExtractor(JapaneseNumberExtractorMode.EXTRACT_ALL) + connector_token: str = JapaneseNumericWithUnit.ConnectorToken + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Japanese) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, JapaneseNumberParserConfiguration(culture_info) + ) + + +class JapaneseCurrencyParserConfiguration(JapaneseNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(JapaneseNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(JapaneseNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = JapaneseNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/portuguese.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/portuguese.py new file mode 100644 index 0000000000..adc8f0d4db --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/portuguese.py @@ -0,0 +1,77 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number.number.portuguese.extractors import NumberMode, PortugueseNumberExtractor +from recognizers_number.number.portuguese.parsers import PortugueseNumberParserConfiguration +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.portuguese_numeric_with_unit import PortugueseNumericWithUnit +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import DefinitionLoader, RegExpUtility + + +class PortugueseNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = DefinitionLoader.load_ambiguity_filters( + PortugueseNumericWithUnit.AmbiguityFiltersDict + ) + unit_num_extractor: Extractor = PortugueseNumberExtractor(NumberMode.Unit) + build_prefix: str = PortugueseNumericWithUnit.BuildPrefix + build_suffix: str = PortugueseNumericWithUnit.BuildSuffix + connector_token: str = PortugueseNumericWithUnit.ConnectorToken + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + PortugueseNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Portuguese) + super().__init__(culture_info) + + +class PortugueseCurrencyExtractorConfiguration(PortugueseNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = PortugueseNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = PortugueseNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = PortugueseNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class PortugueseNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = PortugueseNumberExtractor(NumberMode.DEFAULT) + connector_token: str = PortugueseNumericWithUnit.ConnectorToken + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Portuguese) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, PortugueseNumberParserConfiguration(culture_info) + ) + + +class PortugueseCurrencyParserConfiguration(PortugueseNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(PortugueseNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(PortugueseNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = PortugueseNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = PortugueseNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/spanish.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/spanish.py new file mode 100644 index 0000000000..f30e1114c3 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/configs/spanish.py @@ -0,0 +1,75 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, List, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number.number.spanish.extractors import NumberMode, SpanishNumberExtractor +from recognizers_number.number.spanish.parsers import SpanishNumberParserConfiguration +from recognizers_number_with_unit.number_with_unit.constants import Constants +from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration +from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration +from recognizers_number_with_unit.resources.base_units import BaseUnits +from recognizers_number_with_unit.resources.spanish_numeric_with_unit import SpanishNumericWithUnit +from recognizers_text.culture import Culture +from recognizers_text.extractor import Extractor +from recognizers_text.parser import Parser +from recognizers_text.utilities import RegExpUtility + + +class SpanishNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): + + ambiguity_filters_dict: Dict[Pattern, Pattern] = None + unit_num_extractor: Extractor = SpanishNumberExtractor(NumberMode.Unit) + build_prefix: str = SpanishNumericWithUnit.BuildPrefix + build_suffix: str = SpanishNumericWithUnit.BuildSuffix + connector_token: str = SpanishNumericWithUnit.ConnectorToken + compound_unit_connector_regex: Pattern = RegExpUtility.get_safe_reg_exp( + SpanishNumericWithUnit.CompoundUnitConnectorRegex + ) + non_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp(BaseUnits.PmNonUnitRegex) + ambiguous_unit_number_multiplier_regex: Pattern = None + culture_info: CultureInfo = None + + def expand_half_suffix(self, source, result, numbers): + pass + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Spanish) + super().__init__(culture_info) + + +class SpanishCurrencyExtractorConfiguration(SpanishNumberWithUnitExtractorConfiguration): + + extract_type: str = Constants.SYS_UNIT_CURRENCY + suffix_list: Dict[str, str] = SpanishNumericWithUnit.CurrencySuffixList + prefix_list: Dict[str, str] = SpanishNumericWithUnit.CurrencyPrefixList + ambiguous_unit_list: List[str] = SpanishNumericWithUnit.AmbiguousCurrencyUnitList + culture_info: CultureInfo = None + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + + +class SpanishNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): + + internal_number_extractor: Extractor = SpanishNumberExtractor(NumberMode.DEFAULT) + connector_token: str = SpanishNumericWithUnit.ConnectorToken + + def __init__(self, culture_info: CultureInfo): + culture_info = culture_info or CultureInfo(Culture.Spanish) + super().__init__(culture_info) + self.internal_number_parser: Parser = AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, SpanishNumberParserConfiguration(culture_info) + ) + + +class SpanishCurrencyParserConfiguration(SpanishNumberWithUnitParserConfiguration): + + def __init__(self, culture_info: CultureInfo = None): + super().__init__(culture_info) + self.add_dict_to_unit_map(SpanishNumericWithUnit.CurrencySuffixList) + self.add_dict_to_unit_map(SpanishNumericWithUnit.CurrencyPrefixList) + self.currency_name_to_iso_code_map = SpanishNumericWithUnit.CurrencyNameToIsoCodeMap + self.currency_fraction_code_list = SpanishNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/__init__.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/__init__.py deleted file mode 100644 index 4065a709e7..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from .extractors import * -from .parsers import * diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/extractors.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/extractors.py deleted file mode 100644 index af3f932bde..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/extractors.py +++ /dev/null @@ -1,196 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Dict, List, Pattern - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility, DefinitionLoader -from recognizers_number.culture import CultureInfo -from recognizers_number.number.models import NumberMode -from recognizers_number.number.dutch.extractors import DutchNumberExtractor -from recognizers_number_with_unit.number_with_unit.constants import Constants -from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration -from recognizers_number_with_unit.resources.dutch_numeric_with_unit import DutchNumericWithUnit -from recognizers_number_with_unit.resources.base_units import BaseUnits - - -# pylint: disable=abstract-method -class DutchNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return DefinitionLoader.load_ambiguity_filters(DutchNumericWithUnit.AmbiguityFiltersDict) - - @property - def dimension_ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return DefinitionLoader.load_ambiguity_filters(DutchNumericWithUnit.DimensionAmbiguityFiltersDict) - - @property - def unit_num_extractor(self) -> Extractor: - return self._unit_num_extractor - - @property - def build_prefix(self) -> str: - return self._build_prefix - - @property - def build_suffix(self) -> str: - return self._build_suffix - - @property - def connector_token(self) -> str: - return '' - - @property - def compound_unit_connector_regex(self) -> Pattern: - return self._compound_unit_connector_regex - - @property - def non_unit_regex(self) -> Pattern: - return self._pm_non_unit_regex - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return None - - def expand_half_suffix(self, source, result, numbers): - pass - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Dutch) - super().__init__(culture_info) - self._unit_num_extractor = DutchNumberExtractor(NumberMode.Unit) - self._build_prefix = DutchNumericWithUnit.BuildPrefix - self._build_suffix = DutchNumericWithUnit.BuildSuffix - self._compound_unit_connector_regex = RegExpUtility.get_safe_reg_exp( - DutchNumericWithUnit.CompoundUnitConnectorRegex) - self._pm_non_unit_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.PmNonUnitRegex) - - -# pylint: enable=abstract-method - -class DutchAgeExtractorConfiguration(DutchNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_AGE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = DutchNumericWithUnit.AgeSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = list() - - -class DutchCurrencyExtractorConfiguration(DutchNumberWithUnitExtractorConfiguration): - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_CURRENCY - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = DutchNumericWithUnit.CurrencySuffixList - self._prefix_list = DutchNumericWithUnit.CurrencyPrefixList - self._ambiguous_unit_list = DutchNumericWithUnit.AmbiguousCurrencyUnitList - - -class DutchDimensionExtractorConfiguration(DutchNumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return DutchNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_DIMENSION - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = { - **DutchNumericWithUnit.InformationSuffixList, - **DutchNumericWithUnit.AreaSuffixList, - **DutchNumericWithUnit.LengthSuffixList, - **DutchNumericWithUnit.AngleSuffixList, - **DutchNumericWithUnit.SpeedSuffixList, - **DutchNumericWithUnit.VolumeSuffixList, - **DutchNumericWithUnit.WeightSuffixList - } - self._prefix_list = dict() - self._ambiguous_unit_list = DutchNumericWithUnit.AmbiguousDimensionUnitList +\ - DutchNumericWithUnit.AmbiguousAngleUnitList +\ - DutchNumericWithUnit.AmbiguousLengthUnitList +\ - DutchNumericWithUnit.AmbiguousVolumeUnitList +\ - DutchNumericWithUnit.AmbiguousWeightUnitList - - -class DutchTemperatureExtractorConfiguration(DutchNumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return DutchNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_TEMPERATURE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return self._ambiguous_unit_number_multiplier_regex - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = DutchNumericWithUnit.TemperatureSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = DutchNumericWithUnit.AmbiguousTemperatureUnitList - self._ambiguous_unit_number_multiplier_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.AmbiguousUnitNumberMultiplierRegex) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/parsers.py deleted file mode 100644 index ae80f1191e..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/dutch/parsers.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from recognizers_text import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.parser import Parser -from recognizers_number.culture import CultureInfo -from recognizers_number.number.dutch.extractors import DutchNumberExtractor, NumberMode -from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType -from recognizers_number.number.dutch.parsers import DutchNumberParserConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration -from recognizers_number_with_unit.resources.dutch_numeric_with_unit import DutchNumericWithUnit - - -class DutchNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): - @property - def internal_number_parser(self) -> Parser: - return self._internal_number_parser - - @property - def internal_number_extractor(self) -> Extractor: - return self._internal_number_extractor - - @property - def connector_token(self) -> str: - return '' - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Dutch) - super().__init__(culture_info) - self._internal_number_extractor = DutchNumberExtractor( - NumberMode.DEFAULT) - self._internal_number_parser = AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, DutchNumberParserConfiguration(culture_info)) - - -class DutchAgeParserConfiguration(DutchNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(DutchNumericWithUnit.AgeSuffixList) - - -class DutchCurrencyParserConfiguration(DutchNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(DutchNumericWithUnit.CurrencySuffixList) - self.add_dict_to_unit_map(DutchNumericWithUnit.CurrencyPrefixList) - self.currency_name_to_iso_code_map = DutchNumericWithUnit.CurrencyNameToIsoCodeMap - self.currency_fraction_code_list = DutchNumericWithUnit.FractionalUnitNameToCodeMap - - -class DutchDimensionParserConfiguration(DutchNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(DutchNumericWithUnit.InformationSuffixList) - self.add_dict_to_unit_map(DutchNumericWithUnit.AreaSuffixList) - self.add_dict_to_unit_map(DutchNumericWithUnit.LengthSuffixList) - self.add_dict_to_unit_map(DutchNumericWithUnit.SpeedSuffixList) - self.add_dict_to_unit_map(DutchNumericWithUnit.AngleSuffixList) - self.add_dict_to_unit_map(DutchNumericWithUnit.VolumeSuffixList) - self.add_dict_to_unit_map(DutchNumericWithUnit.WeightSuffixList) - - -class DutchTemperatureParserConfiguration(DutchNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(DutchNumericWithUnit.TemperatureSuffixList) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/__init__.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/__init__.py deleted file mode 100644 index 4065a709e7..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from .extractors import * -from .parsers import * diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/extractors.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/extractors.py deleted file mode 100644 index 5ae6830aa9..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/extractors.py +++ /dev/null @@ -1,205 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Dict, List, Pattern - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility, DefinitionLoader -from recognizers_number.culture import CultureInfo -from recognizers_number.number.models import NumberMode -from recognizers_number.number.english.extractors import EnglishNumberExtractor -from recognizers_number_with_unit.number_with_unit.constants import Constants -from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration -from recognizers_number_with_unit.resources.english_numeric_with_unit import EnglishNumericWithUnit -from recognizers_number_with_unit.resources.base_units import BaseUnits - - -# pylint: disable=abstract-method -class EnglishNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return DefinitionLoader.load_ambiguity_filters(EnglishNumericWithUnit.AmbiguityFiltersDict) - - @property - def dimension_ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return DefinitionLoader.load_ambiguity_filters(EnglishNumericWithUnit.DimensionAmbiguityFiltersDict) - - @property - def unit_num_extractor(self) -> Extractor: - return self._unit_num_extractor - - @property - def build_prefix(self) -> str: - return self._build_prefix - - @property - def build_suffix(self) -> str: - return self._build_suffix - - @property - def connector_token(self) -> str: - return '' - - @property - def compound_unit_connector_regex(self) -> Pattern: - return self._compound_unit_connector_regex - - @property - def non_unit_regex(self) -> Pattern: - return self._pm_non_unit_regex - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return None - - def expand_half_suffix(self, source, result, numbers): - pass - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.English) - super().__init__(culture_info) - self._unit_num_extractor = EnglishNumberExtractor(NumberMode.Unit) - self._build_prefix = EnglishNumericWithUnit.BuildPrefix - self._build_suffix = EnglishNumericWithUnit.BuildSuffix - self._compound_unit_connector_regex = RegExpUtility.get_safe_reg_exp( - EnglishNumericWithUnit.CompoundUnitConnectorRegex) - self._pm_non_unit_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.PmNonUnitRegex) - - -# pylint: enable=abstract-method - -class EnglishAgeExtractorConfiguration(EnglishNumberWithUnitExtractorConfiguration): - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return EnglishNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_AGE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = EnglishNumericWithUnit.AgeSuffixList - self._prefix_list = EnglishNumericWithUnit.AgePrefixList - self._ambiguous_unit_list = EnglishNumericWithUnit.AmbiguousAgeUnitList - - -class EnglishCurrencyExtractorConfiguration(EnglishNumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return EnglishNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_CURRENCY - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = EnglishNumericWithUnit.CurrencySuffixList - self._prefix_list = EnglishNumericWithUnit.CurrencyPrefixList - self._ambiguous_unit_list = EnglishNumericWithUnit.AmbiguousCurrencyUnitList - - -class EnglishDimensionExtractorConfiguration(EnglishNumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return EnglishNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_DIMENSION - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = { - **EnglishNumericWithUnit.InformationSuffixList, - **EnglishNumericWithUnit.AreaSuffixList, - **EnglishNumericWithUnit.LengthSuffixList, - **EnglishNumericWithUnit.SpeedSuffixList, - **EnglishNumericWithUnit.VolumeSuffixList, - **EnglishNumericWithUnit.WeightSuffixList - } - self._prefix_list = dict() - self._ambiguous_unit_list = EnglishNumericWithUnit.AmbiguousDimensionUnitList +\ - EnglishNumericWithUnit.AmbiguousAngleUnitList +\ - EnglishNumericWithUnit.AmbiguousAreaUnitList +\ - EnglishNumericWithUnit.AmbiguousLengthUnitList +\ - EnglishNumericWithUnit.AmbiguousSpeedUnitList +\ - EnglishNumericWithUnit.AmbiguousVolumeUnitList +\ - EnglishNumericWithUnit.AmbiguousWeightUnitList - - -class EnglishTemperatureExtractorConfiguration(EnglishNumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return EnglishNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_TEMPERATURE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return self._ambiguous_unit_number_multiplier_regex - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = EnglishNumericWithUnit.TemperatureSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = EnglishNumericWithUnit.AmbiguousTemperatureUnitList - self._ambiguous_unit_number_multiplier_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.AmbiguousUnitNumberMultiplierRegex) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/parsers.py deleted file mode 100644 index 471595a2c9..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/english/parsers.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from recognizers_text import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.parser import Parser -from recognizers_number.culture import CultureInfo -from recognizers_number.number.english.extractors import EnglishNumberExtractor, NumberMode -from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType -from recognizers_number.number.english.parsers import EnglishNumberParserConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration -from recognizers_number_with_unit.resources.english_numeric_with_unit import EnglishNumericWithUnit - - -class EnglishNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): - @property - def internal_number_parser(self) -> Parser: - return self._internal_number_parser - - @property - def internal_number_extractor(self) -> Extractor: - return self._internal_number_extractor - - @property - def connector_token(self) -> str: - return '' - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.English) - super().__init__(culture_info) - self._internal_number_extractor = EnglishNumberExtractor( - NumberMode.DEFAULT) - self._internal_number_parser = AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, EnglishNumberParserConfiguration(culture_info)) - - -class EnglishAgeParserConfiguration(EnglishNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(EnglishNumericWithUnit.AgeSuffixList) - self.add_dict_to_unit_map(EnglishNumericWithUnit.AgePrefixList) - - -class EnglishCurrencyParserConfiguration(EnglishNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(EnglishNumericWithUnit.CurrencySuffixList) - self.add_dict_to_unit_map(EnglishNumericWithUnit.CurrencyPrefixList) - self.currency_name_to_iso_code_map = EnglishNumericWithUnit.CurrencyNameToIsoCodeMap - self.currency_fraction_code_list = EnglishNumericWithUnit.FractionalUnitNameToCodeMap - - -class EnglishDimensionParserConfiguration(EnglishNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(EnglishNumericWithUnit.InformationSuffixList) - self.add_dict_to_unit_map(EnglishNumericWithUnit.AreaSuffixList) - self.add_dict_to_unit_map(EnglishNumericWithUnit.LengthSuffixList) - self.add_dict_to_unit_map(EnglishNumericWithUnit.SpeedSuffixList) - self.add_dict_to_unit_map(EnglishNumericWithUnit.VolumeSuffixList) - self.add_dict_to_unit_map(EnglishNumericWithUnit.WeightSuffixList) - - -class EnglishTemperatureParserConfiguration(EnglishNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(EnglishNumericWithUnit.TemperatureSuffixList) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/extractors.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/extractors.py index a2f40b0dbe..419ebad1c0 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/extractors.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/extractors.py @@ -1,101 +1,48 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from abc import ABC, abstractmethod -from sys import prefix -from typing import List, Dict, Set, Pattern, Match -from copy import deepcopy from collections import namedtuple -from itertools import chain +from copy import deepcopy +from typing import Dict, List, Match, Pattern, Set + import regex -from .constants import * -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor, ExtractResult + from recognizers_number.culture import CultureInfo -from recognizers_text.matcher.string_matcher import StringMatcher +from recognizers_text.extractor import Extractor, ExtractResult +from recognizers_text.matcher.match_result import MatchResult from recognizers_text.matcher.match_strategy import MatchStrategy from recognizers_text.matcher.number_with_unit_tokenizer import NumberWithUnitTokenizer -from recognizers_text.matcher.match_result import MatchResult +from recognizers_text.matcher.string_matcher import StringMatcher +from recognizers_text.utilities import RegExpUtility + +from .constants import * from .utilities import Token PrefixUnitResult = namedtuple('PrefixUnitResult', ['offset', 'unit']) -class NumberWithUnitExtractorConfiguration(ABC): - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - pass +class NumberWithUnitExtractorConfiguration: - @property - def dimension_ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - pass - - @property - @abstractmethod - def extract_type(self) -> str: - raise NotImplementedError - - @property - @abstractmethod - def suffix_list(self) -> Dict[str, str]: - raise NotImplementedError + ambiguity_filters_dict: Dict[Pattern, Pattern] + ambiguous_unit_list: List[str] + ambiguous_unit_number_multiplier_regex: Pattern + extract_type: str + suffix_list: Dict[str, str] + prefix_list: Dict[str, str] + unit_num_extractor: Extractor + build_prefix: str + build_suffix: str + connector_token: str + compound_unit_connector_regex: Pattern + non_unit_regex: Pattern + culture_info: CultureInfo - @property - @abstractmethod - def prefix_list(self) -> Dict[str, str]: - raise NotImplementedError - - @property - @abstractmethod - def ambiguous_unit_list(self) -> List[str]: - raise NotImplementedError - - @property - @abstractmethod - def unit_num_extractor(self) -> Extractor: - raise NotImplementedError - - @property - @abstractmethod - def build_prefix(self) -> str: - raise NotImplementedError - - @property - @abstractmethod - def build_suffix(self) -> str: - raise NotImplementedError - - @property - @abstractmethod - def connector_token(self) -> str: - raise NotImplementedError - - @property - @abstractmethod - def compound_unit_connector_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def non_unit_regex(self) -> Pattern: - raise NotImplementedError - - @property - @abstractmethod - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - raise NotImplementedError - - @property - def culture_info(self) -> CultureInfo: - return self._culture_info - - @abstractmethod def expand_half_suffix(self, source, result, numbers): pass def __init__(self, culture_info: CultureInfo): - self._culture_info = culture_info + self.culture_info = culture_info class NumberWithUnitExtractor(Extractor): @@ -146,8 +93,7 @@ def __init__(self, config: NumberWithUnitExtractorConfiguration): self.max_prefix_match_len = 0 if self.config.suffix_list: - self.__suffix_matcher = self._build_matcher_from_set( - list(self.config.suffix_list.values())) + self.__suffix_matcher = self._build_matcher_from_set(list(self.config.suffix_list.values())) else: self.__suffix_matcher = StringMatcher() @@ -187,7 +133,12 @@ def extract(self, source: str) -> List[ExtractResult]: numbers: List[ExtractResult] = sorted(self.config.unit_num_extractor.extract(source), key=lambda o: o.start) - if len(numbers) > 0 and self.config.extract_type is Constants.SYS_UNIT_CURRENCY and len(prefix_match) > 0 and len(suffix_match) > 0: + if ( + len(numbers) > 0 + and self.config.extract_type is Constants.SYS_UNIT_CURRENCY + and len(prefix_match) > 0 + and len(suffix_match) > 0 + ): for number in numbers: start = number.start @@ -196,20 +147,20 @@ def extract(self, source: str) -> List[ExtractResult]: number_suffix = [mr.start == (start + length) for mr in suffix_match] if True in number_prefix and True in number_suffix and "," in number.text: comma_index = number.start + number.text.index(",") - source = source[:comma_index] + " " + source[comma_index + 1:] + source = source[:comma_index] + " " + source[comma_index + 1 :] - numbers: List[ExtractResult] = sorted(self.config.unit_num_extractor.extract(source), key=lambda o: o.start) + numbers: List[ExtractResult] = sorted( + self.config.unit_num_extractor.extract(source), key=lambda o: o.start + ) # Special case for cases where number multipliers clash with unit ambiguous_multiplier_regex = self.config.ambiguous_unit_number_multiplier_regex if ambiguous_multiplier_regex is not None: for num in numbers: - match = list(filter(lambda x: x.group(), regex.finditer( - ambiguous_multiplier_regex, num.text))) + match = list(filter(lambda x: x.group(), regex.finditer(ambiguous_multiplier_regex, num.text))) if match and len(match) == 1: - new_length = num.length - \ - (match[0].span()[1] - match[0].span()[0]) + new_length = num.length - (match[0].span()[1] - match[0].span()[0]) num.text = num.text[0:new_length] num.length = new_length @@ -229,13 +180,13 @@ def extract(self, source: str) -> List[ExtractResult]: if m.length > 0 and m.end > start: break - if m.length > 0 and source[m.start: m.start + (last_index - m.start)].strip() == m.text: + if m.length > 0 and source[m.start : m.start + (last_index - m.start)].strip() == m.text: best_match = m break if best_match is not None: off_set = last_index - best_match.start - unit_str = source[best_match.start:best_match.start + off_set] + unit_str = source[best_match.start : best_match.start + off_set] self.add_element(mapping_prefix, number.start, (PrefixUnitResult(off_set, unit_str))) prefix_unit = mapping_prefix.get(start, None) if max_find_suff > 0: @@ -249,19 +200,24 @@ def extract(self, source: str) -> List[ExtractResult]: end_pos = m.start + m.length - first_index if max_len < end_pos: - mid_str = source[first_index: first_index + (m.start - first_index)] - if mid_str is None or not mid_str or str.isspace(mid_str) \ - or mid_str.strip() == self.config.connector_token: + mid_str = source[first_index : first_index + (m.start - first_index)] + if ( + mid_str is None + or not mid_str + or str.isspace(mid_str) + or mid_str.strip() == self.config.connector_token + ): max_len = end_pos if m.end < len(source) and ( - (mid_str.endswith('(') and source[m.end] == ')') or - (mid_str.endswith('[') and source[m.end] == ']') or - (mid_str.endswith('{') and source[m.end] == '}') or - (mid_str.endswith('<') and source[m.end] == '>')): + (mid_str.endswith('(') and source[m.end] == ')') + or (mid_str.endswith('[') and source[m.end] == ']') + or (mid_str.endswith('{') and source[m.end] == '}') + or (mid_str.endswith('<') and source[m.end] == '>') + ): max_len = m.end - first_index + 1 if max_len != 0: - substr = source[start: start + length + max_len] + substr = source[start : start + length + max_len] er = ExtractResult() er.start = start @@ -288,8 +244,9 @@ def extract(self, source: str) -> List[ExtractResult]: for time in non_unit_match: trimmed_source = source.lower() index = trimmed_source.index(time.group()) - if er.start >= time.start() and er.start + er.length <= \ - time.start() + len(time.group()): + if er.start >= time.start() and er.start + er.length <= time.start() + len( + time.group() + ): is_not_unit = True break @@ -342,7 +299,9 @@ def validate_unit(self, source: str) -> bool: def _pre_check_str(self, source: str) -> bool: return len(source) != 0 - def _extract_separate_units(self, source: str, num_depend_source: List[ExtractResult], non_unit_matches) -> List[ExtractResult]: + def _extract_separate_units( + self, source: str, num_depend_source: List[ExtractResult], non_unit_matches + ) -> List[ExtractResult]: result = deepcopy(num_depend_source) match_result: List[bool] = [False] * len(source) for ex_result in num_depend_source: @@ -352,8 +311,7 @@ def _extract_separate_units(self, source: str, num_depend_source: List[ExtractRe match_result[start + i] = True i += 1 - match_collection = list( - filter(lambda x: x.group(), regex.finditer(self.separate_regex, source))) + match_collection = list(filter(lambda x: x.group(), regex.finditer(self.separate_regex, source))) for match in match_collection: i = 0 while i < len(match.group()) and not match_result[match.start() + i]: @@ -385,10 +343,14 @@ def _build_matcher_from_set(self, definitions) -> StringMatcher: matcher = StringMatcher(match_strategy=MatchStrategy.TrieTree, tokenizer=NumberWithUnitTokenizer()) - match_term_list = list(map(lambda words: - list(filter(lambda word: not str.isspace(word) and word is not None, - str(words).strip().split('|'))), - definitions)) + match_term_list = list( + map( + lambda words: list( + filter(lambda word: not str.isspace(word) and word is not None, str(words).strip().split('|')) + ), + definitions, + ) + ) match_terms = self.distinct(match_term_list) @@ -408,11 +370,9 @@ def __build_regex_from_str(self, source: str, ignore_case: bool) -> Pattern: def _build_separate_regex_from_config(self, ignore_case: bool = False) -> Pattern: separate_words: Set[str] = set() for add_word in self.config.prefix_list.values(): - separate_words |= set( - filter(self.validate_unit, add_word.split('|'))) + separate_words |= set(filter(self.validate_unit, add_word.split('|'))) for add_word in self.config.suffix_list.values(): - separate_words |= set( - filter(self.validate_unit, add_word.split('|'))) + separate_words |= set(filter(self.validate_unit, add_word.split('|'))) for to_delete in self.config.ambiguous_unit_list: separate_words.discard(to_delete) @@ -490,8 +450,17 @@ def _filter_ambiguity(self, ers: List[ExtractResult], text: str, ambiguity_filte reg_match = list(filter(lambda x: x.group(), regex.finditer(regexvar_value, text))) if len(reg_match) > 0: - ers = list(filter(lambda x: not any([m.start() < x.start + x.length and m.start() + - len(m.group()) > x.start for m in reg_match]), ers)) + ers = list( + filter( + lambda x: not any( + [ + m.start() < x.start + x.length and m.start() + len(m.group()) > x.start + for m in reg_match + ] + ), + ers, + ) + ) except Exception: pass @@ -506,7 +475,9 @@ def _filter_ambiguity(self, ers: List[ExtractResult], text: str, ambiguity_filte return ers - def _select_candidates(self, source: str, ers: List[ExtractResult], unit_is_prefix: List[bool]) -> List[ExtractResult]: + def _select_candidates( + self, source: str, ers: List[ExtractResult], unit_is_prefix: List[bool] + ) -> List[ExtractResult]: total_candidate = len(unit_is_prefix) have_conflict = False @@ -546,7 +517,7 @@ def _select_candidates(self, source: str, ers: List[ExtractResult], unit_is_pref no_space_units: List[Token] = [] for unit_prefix in prefix_result: if isinstance(unit_prefix.data, ExtractResult): - unit_str = unit_prefix.text[:unit_prefix.data.start] + unit_str = unit_prefix.text[: unit_prefix.data.start] if len(unit_str) > 0 and unit_str == unit_str.rstrip(): no_space_units.append(Token(unit_prefix.start, unit_prefix.start + len(unit_str))) @@ -563,8 +534,10 @@ def _select_candidates(self, source: str, ers: List[ExtractResult], unit_is_pref suffix_result.append(ers[index]) if len(suffix_result) >= len(prefix_result): + def sort_by_start(e): return e.start + suffix_result.sort(key=sort_by_start) return suffix_result @@ -592,7 +565,11 @@ def __merged_compound_units(self, source: str): idx = 0 while idx < len(ers) - 1: - if ers[idx].type != ers[idx + 1].type and not ers[idx].type == Constants.SYS_NUM and not ers[idx + 1].type == Constants.SYS_NUM: + if ( + ers[idx].type != ers[idx + 1].type + and not ers[idx].type == Constants.SYS_NUM + and not ers[idx + 1].type == Constants.SYS_NUM + ): idx = idx + 1 continue @@ -604,8 +581,7 @@ def __merged_compound_units(self, source: str): middle_begin = ers[idx].start + ers[idx].length middle_end = ers[idx + 1].start - middle_str = source[middle_begin: middle_begin + (middle_end - - middle_begin)].strip().lower() + middle_str = source[middle_begin : middle_begin + (middle_end - middle_begin)].strip().lower() # Separated by whitespace if not middle_str: @@ -646,7 +622,7 @@ def __merged_compound_units(self, source: str): period_end = ers[idx + 1].start + ers[idx + 1].length result[group].length = period_end - period_begin - result[group].text = source[period_begin:period_begin + (period_end - period_begin)] + result[group].text = source[period_begin : period_begin + (period_end - period_begin)] result[group].type = Constants.SYS_UNIT_CURRENCY if isinstance(result[group].data, list): result[group].data.append(ers[idx + 1]) @@ -682,8 +658,7 @@ def __merge_pure_number(self, source: str, ers: List[ExtractResult]) -> List[Ext middle_begin = ers[j - 1].start + ers[j - 1].length middle_end = num_ers[i].start - middle_str = source[middle_begin: middle_begin + (middle_end - - middle_begin)].strip().lower() + middle_str = source[middle_begin : middle_begin + (middle_end - middle_begin)].strip().lower() # separated by whitespace if not middle_str: diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/__init__.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/__init__.py deleted file mode 100644 index 4065a709e7..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from .extractors import * -from .parsers import * diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/extractors.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/extractors.py deleted file mode 100644 index 2f60b17538..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/extractors.py +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Dict, List, Pattern - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility -from recognizers_number.culture import CultureInfo -from recognizers_number.number.models import NumberMode -from recognizers_number.number.french.extractors import FrenchNumberExtractor -from recognizers_number_with_unit.number_with_unit.constants import Constants -from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration -from recognizers_number_with_unit.resources.french_numeric_with_unit import FrenchNumericWithUnit -from recognizers_number_with_unit.resources.base_units import BaseUnits - - -# pylint: disable=abstract-method -class FrenchNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return FrenchNumericWithUnit.AmbiguityFiltersDict - - @property - def unit_num_extractor(self) -> Extractor: - return self._unit_num_extractor - - @property - def build_prefix(self) -> str: - return self._build_prefix - - @property - def build_suffix(self) -> str: - return self._build_suffix - - @property - def connector_token(self) -> str: - return self._connector_token - - @property - def compound_unit_connector_regex(self) -> Pattern: - return self._compound_unit_connector_regex - - @property - def non_unit_regex(self) -> Pattern: - return self._pm_non_unit_regex - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return None - - def expand_half_suffix(self, source, result, numbers): - pass - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.French) - super().__init__(culture_info) - self._unit_num_extractor = FrenchNumberExtractor(NumberMode.Unit) - self._build_prefix = FrenchNumericWithUnit.BuildPrefix - self._build_suffix = FrenchNumericWithUnit.BuildSuffix - self._connector_token = FrenchNumericWithUnit.ConnectorToken - self._compound_unit_connector_regex = RegExpUtility.get_safe_reg_exp( - FrenchNumericWithUnit.CompoundUnitConnectorRegex) - self._pm_non_unit_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.PmNonUnitRegex) - - -# pylint: enable=abstract-method - -class FrenchAgeExtractorConfiguration(FrenchNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_AGE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = FrenchNumericWithUnit.AgeSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = list() - - -class FrenchCurrencyExtractorConfiguration(FrenchNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_CURRENCY - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = FrenchNumericWithUnit.CurrencySuffixList - self._prefix_list = FrenchNumericWithUnit.CurrencyPrefixList - self._ambiguous_unit_list = FrenchNumericWithUnit.AmbiguousCurrencyUnitList - - -class FrenchDimensionExtractorConfiguration(FrenchNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_DIMENSION - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = { - **FrenchNumericWithUnit.InformationSuffixList, - **FrenchNumericWithUnit.AreaSuffixList, - **FrenchNumericWithUnit.LengthSuffixList, - **FrenchNumericWithUnit.SpeedSuffixList, - **FrenchNumericWithUnit.VolumeSuffixList, - **FrenchNumericWithUnit.WeightSuffixList - } - self._prefix_list = dict() - self._ambiguous_unit_list = FrenchNumericWithUnit.AmbiguousDimensionUnitList +\ - FrenchNumericWithUnit.AmbiguousAngleUnitList +\ - FrenchNumericWithUnit.AmbiguousLengthUnitList +\ - FrenchNumericWithUnit.AmbiguousSpeedUnitList +\ - FrenchNumericWithUnit.AmbiguousVolumeUnitList +\ - FrenchNumericWithUnit.AmbiguousWeightUnitList - - -class FrenchTemperatureExtractorConfiguration(FrenchNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_TEMPERATURE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return self._ambiguous_unit_number_multiplier_regex - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = FrenchNumericWithUnit.TemperatureSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = list() - self._ambiguous_unit_number_multiplier_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.AmbiguousUnitNumberMultiplierRegex) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/parsers.py deleted file mode 100644 index 227e1011d4..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/french/parsers.py +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.parser import Parser -from recognizers_number.culture import CultureInfo -from recognizers_number.number.french.extractors import FrenchNumberExtractor, NumberMode -from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType -from recognizers_number.number.french.parsers import FrenchNumberParserConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration -from recognizers_number_with_unit.resources.french_numeric_with_unit import FrenchNumericWithUnit - - -class FrenchNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): - @property - def internal_number_parser(self) -> Parser: - return self._internal_number_parser - - @property - def internal_number_extractor(self) -> Extractor: - return self._internal_number_extractor - - @property - def connector_token(self) -> str: - return self._connector_token - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.French) - super().__init__(culture_info) - self._internal_number_extractor = FrenchNumberExtractor( - NumberMode.DEFAULT) - self._internal_number_parser = AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, FrenchNumberParserConfiguration(culture_info)) - self._connector_token = FrenchNumericWithUnit.ConnectorToken - - -class FrenchAgeParserConfiguration(FrenchNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(FrenchNumericWithUnit.AgeSuffixList) - - -class FrenchCurrencyParserConfiguration(FrenchNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(FrenchNumericWithUnit.CurrencySuffixList) - self.add_dict_to_unit_map(FrenchNumericWithUnit.CurrencyPrefixList) - self.currency_name_to_iso_code_map = FrenchNumericWithUnit.CurrencyNameToIsoCodeMap - self.currency_fraction_code_list = FrenchNumericWithUnit.FractionalUnitNameToCodeMap - - -class FrenchDimensionParserConfiguration(FrenchNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(FrenchNumericWithUnit.InformationSuffixList) - self.add_dict_to_unit_map(FrenchNumericWithUnit.AreaSuffixList) - self.add_dict_to_unit_map(FrenchNumericWithUnit.LengthSuffixList) - self.add_dict_to_unit_map(FrenchNumericWithUnit.SpeedSuffixList) - self.add_dict_to_unit_map(FrenchNumericWithUnit.VolumeSuffixList) - self.add_dict_to_unit_map(FrenchNumericWithUnit.WeightSuffixList) - - -class FrenchTemperatureParserConfiguration(FrenchNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._connector_token = None - self.add_dict_to_unit_map(FrenchNumericWithUnit.TemperatureSuffixList) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/german/extractors.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/german/extractors.py deleted file mode 100644 index eb7ff9aa98..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/german/extractors.py +++ /dev/null @@ -1,90 +0,0 @@ -from typing import Dict, List, Pattern - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility -from recognizers_number.culture import CultureInfo -from recognizers_number.number.models import NumberMode -from recognizers_number.number.german.extractors import GermanNumberExtractor -from recognizers_number_with_unit.number_with_unit.constants import Constants -from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration -from recognizers_number_with_unit.resources.german_numeric_with_unit import GermanNumericWithUnit -from recognizers_number_with_unit.resources.base_units import BaseUnits - - -# pylint: disable=abstract-method -class GermanNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return GermanNumericWithUnit.AmbiguityFiltersDict - - @property - def unit_num_extractor(self) -> Extractor: - return self._unit_num_extractor - - @property - def build_prefix(self) -> str: - return self._build_prefix - - @property - def build_suffix(self) -> str: - return self._build_suffix - - @property - def connector_token(self) -> str: - return self._connector_token - - @property - def compound_unit_connector_regex(self) -> Pattern: - return self._compound_unit_connector_regex - - @property - def non_unit_regex(self) -> Pattern: - return self._pm_non_unit_regex - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return None - - def expand_half_suffix(self, source, result, numbers): - pass - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.German) - super().__init__(culture_info) - self._unit_num_extractor = GermanNumberExtractor(NumberMode.Unit) - self._build_prefix = GermanNumericWithUnit.BuildPrefix - self._build_suffix = GermanNumericWithUnit.BuildSuffix - self._connector_token = GermanNumericWithUnit.ConnectorToken - self._compound_unit_connector_regex = RegExpUtility.get_safe_reg_exp( - GermanNumericWithUnit.CompoundUnitConnectorRegex) - self._pm_non_unit_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.PmNonUnitRegex) - - -# pylint: enable=abstract-method - -class GermanCurrencyExtractorConfiguration(GermanNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_CURRENCY - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = GermanNumericWithUnit.CurrencySuffixList - self._prefix_list = GermanNumericWithUnit.CurrencyPrefixList - self._ambiguous_unit_list = GermanNumericWithUnit.AmbiguousCurrencyUnitList diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/german/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/german/parsers.py deleted file mode 100644 index 7d180348f7..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/german/parsers.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.parser import Parser -from recognizers_number.culture import CultureInfo -from recognizers_number.number.german.extractors import GermanNumberExtractor, NumberMode -from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType -from recognizers_number.number.german.parsers import GermanNumberParserConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration -from recognizers_number_with_unit.resources.german_numeric_with_unit import GermanNumericWithUnit - - -class GermanNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): - @property - def internal_number_parser(self) -> Parser: - return self._internal_number_parser - - @property - def internal_number_extractor(self) -> Extractor: - return self._internal_number_extractor - - @property - def connector_token(self) -> str: - return self._connector_token - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.German) - super().__init__(culture_info) - self._internal_number_extractor = GermanNumberExtractor( - NumberMode.DEFAULT) - self._internal_number_parser = AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, GermanNumberParserConfiguration(culture_info)) - self._connector_token = GermanNumericWithUnit.ConnectorToken - - -class GermanCurrencyParserConfiguration(GermanNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(GermanNumericWithUnit.CurrencySuffixList) - self.add_dict_to_unit_map(GermanNumericWithUnit.CurrencyPrefixList) - self.currency_name_to_iso_code_map = GermanNumericWithUnit.CurrencyNameToIsoCodeMap - self.currency_fraction_code_list = GermanNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/italian/extractors.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/italian/extractors.py deleted file mode 100644 index 75e2efc432..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/italian/extractors.py +++ /dev/null @@ -1,200 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Dict, List, Pattern - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility, DefinitionLoader -from recognizers_number.culture import CultureInfo -from recognizers_number.number.models import NumberMode -from recognizers_number.number.italian.extractors import ItalianNumberExtractor -from recognizers_number_with_unit.number_with_unit.constants import Constants -from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration -from recognizers_number_with_unit.resources.italian_numeric_with_unit import ItalianNumericWithUnit -from recognizers_number_with_unit.resources.base_units import BaseUnits - - -# pylint: disable=abstract-method -class ItalianNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return DefinitionLoader.load_ambiguity_filters(ItalianNumericWithUnit.AmbiguityFiltersDict) - - @property - def unit_num_extractor(self) -> Extractor: - return self._unit_num_extractor - - @property - def build_prefix(self) -> str: - return self._build_prefix - - @property - def build_suffix(self) -> str: - return self._build_suffix - - @property - def connector_token(self) -> str: - return self._connector_token - - @property - def compound_unit_connector_regex(self) -> Pattern: - return self._compound_unit_connector_regex - - @property - def non_unit_regex(self) -> Pattern: - return self._pm_non_unit_regex - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return None - - def expand_half_suffix(self, source, result, numbers): - pass - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Italian) - super().__init__(culture_info) - self._unit_num_extractor = ItalianNumberExtractor(NumberMode.Unit) - self._build_prefix = ItalianNumericWithUnit.BuildPrefix - self._build_suffix = ItalianNumericWithUnit.BuildSuffix - self._connector_token = ItalianNumericWithUnit.ConnectorToken - self._compound_unit_connector_regex = RegExpUtility.get_safe_reg_exp( - ItalianNumericWithUnit.CompoundUnitConnectorRegex) - self._pm_non_unit_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.PmNonUnitRegex) - - -# pylint: enable=abstract-method - -class ItalianAgeExtractorConfiguration(ItalianNumberWithUnitExtractorConfiguration): - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return ItalianNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_AGE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = ItalianNumericWithUnit.AgeSuffixList - self._prefix_list = ItalianNumericWithUnit.AgePrefixList - self._ambiguous_unit_list = ItalianNumericWithUnit.AmbiguousAgeUnitList - - -class ItalianCurrencyExtractorConfiguration(ItalianNumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return ItalianNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_CURRENCY - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = ItalianNumericWithUnit.CurrencySuffixList - self._prefix_list = ItalianNumericWithUnit.CurrencyPrefixList - self._ambiguous_unit_list = ItalianNumericWithUnit.AmbiguousCurrencyUnitList - - -class ItalianDimensionExtractorConfiguration(ItalianNumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return ItalianNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_DIMENSION - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = { - **ItalianNumericWithUnit.InformationSuffixList, - **ItalianNumericWithUnit.AreaSuffixList, - **ItalianNumericWithUnit.LengthSuffixList, - **ItalianNumericWithUnit.SpeedSuffixList, - **ItalianNumericWithUnit.VolumeSuffixList, - **ItalianNumericWithUnit.WeightSuffixList - } - self._prefix_list = dict() - self._ambiguous_unit_list = ItalianNumericWithUnit.AmbiguousDimensionUnitList +\ - ItalianNumericWithUnit.AmbiguousAngleUnitList +\ - ItalianNumericWithUnit.AmbiguousLengthUnitList +\ - ItalianNumericWithUnit.AmbiguousVolumeUnitList +\ - ItalianNumericWithUnit.AmbiguousWeightUnitList - - -class ItalianTemperatureExtractorConfiguration(ItalianNumberWithUnitExtractorConfiguration): - - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return ItalianNumericWithUnit.AmbiguityFiltersDict - - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_TEMPERATURE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return self._ambiguous_unit_number_multiplier_regex - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = ItalianNumericWithUnit.TemperatureSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = ItalianNumericWithUnit.AmbiguousTemperatureUnitList - self._ambiguous_unit_number_multiplier_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.AmbiguousUnitNumberMultiplierRegex) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/italian/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/italian/parsers.py deleted file mode 100644 index 10fe1e007b..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/italian/parsers.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.parser import Parser -from recognizers_number.culture import CultureInfo -from recognizers_number.number.italian.extractors import ItalianNumberExtractor, NumberMode -from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType -from recognizers_number.number.italian.parsers import ItalianNumberParserConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration -from recognizers_number_with_unit.resources.italian_numeric_with_unit import ItalianNumericWithUnit - - -class ItalianNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): - @property - def internal_number_parser(self) -> Parser: - return self._internal_number_parser - - @property - def internal_number_extractor(self) -> Extractor: - return self._internal_number_extractor - - @property - def connector_token(self) -> str: - return self._connector_token - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Italian) - super().__init__(culture_info) - self._internal_number_extractor = ItalianNumberExtractor( - NumberMode.DEFAULT) - self._internal_number_parser = AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, ItalianNumberParserConfiguration(culture_info)) - self._connector_token = ItalianNumericWithUnit.ConnectorToken - - -class ItalianCurrencyParserConfiguration(ItalianNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(ItalianNumericWithUnit.CurrencySuffixList) - self.add_dict_to_unit_map(ItalianNumericWithUnit.CurrencyPrefixList) - self.currency_name_to_iso_code_map = ItalianNumericWithUnit.CurrencyNameToIsoCodeMap - self.currency_fraction_code_list = ItalianNumericWithUnit.FractionalUnitNameToCodeMap diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/models.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/models.py index 61f19c18a7..e5f14ac246 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/models.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/models.py @@ -4,11 +4,11 @@ from abc import abstractmethod from typing import List -from recognizers_text.model import Model, ModelResult +from recognizers_number_with_unit.number_with_unit.parsers import CurrencyUnitValue, UnitValue from recognizers_text.extractor import Extractor +from recognizers_text.model import Model, ModelResult from recognizers_text.parser import Parser from recognizers_text.utilities import QueryProcessor -from recognizers_number_with_unit.number_with_unit.parsers import UnitValue, CurrencyUnitValue class ExtractorParserModel: @@ -43,20 +43,23 @@ def parse(self, query: str) -> List[ModelResult]: parse_results.append(j) else: parse_results.append(r) - + model_result = None for parse_result in parse_results: model_result = ModelResult() model_result.start = parse_result.start model_result.end = parse_result.start + parse_result.length - 1 model_result.text = parse_result.text model_result.type_name = self.model_type_name - model_result.resolution = self.get_resolution( - parse_result.value) + model_result.resolution = self.get_resolution(parse_result.value) - b_add = not [x for x in extraction_results if (model_result.start <= x.start and model_result.end >= x.end)] + b_add = not [ + x for x in extraction_results if (model_result.start <= x.start and model_result.end >= x.end) + ] if b_add: extraction_results.append(model_result) + if model_result: + break except Exception: pass @@ -65,55 +68,25 @@ def parse(self, query: str) -> List[ModelResult]: @staticmethod def get_resolution(data): if isinstance(data, str): - return { - 'value': data - } + return {'value': data} elif isinstance(data, UnitValue): - return { - 'value': data.number, - 'unit': data.unit - } + return {'value': data.number, 'unit': data.unit} elif isinstance(data, CurrencyUnitValue): - return { - 'value': data.number, - 'unit': data.unit, - 'isoCurrency': data.iso_currency - } + return {'value': data.number, 'unit': data.unit, 'isoCurrency': data.iso_currency} elif isinstance(data, list): if hasattr(data[0].value, 'iso_currency'): return { 'value': data[0].value.number, 'unit': data[0].value.unit, - 'isoCurrency': data[0].value.iso_currency + 'isoCurrency': data[0].value.iso_currency, } else: - return { - 'value': data[0].value.number, - 'unit': data[0].value.unit - } + return {'value': data[0].value.number, 'unit': data[0].value.unit} return None -class AgeModel(AbstractNumberWithUnitModel): - @property - def model_type_name(self) -> str: - return 'age' - - class CurrencyModel(AbstractNumberWithUnitModel): @property def model_type_name(self) -> str: return 'currency' - - -class DimensionModel(AbstractNumberWithUnitModel): - @property - def model_type_name(self) -> str: - return 'dimension' - - -class TemperatureModel(AbstractNumberWithUnitModel): - @property - def model_type_name(self) -> str: - return 'temperature' diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/number_with_unit_recognizer.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/number_with_unit_recognizer.py index eaf9bccf0b..37f588a6f8 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/number_with_unit_recognizer.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/number_with_unit_recognizer.py @@ -1,66 +1,37 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - from enum import IntFlag from typing import List + +from recognizers_number.culture import CultureInfo from recognizers_text import Culture, Recognizer from recognizers_text.model import Model, ModelResult -from recognizers_number.culture import CultureInfo -from .models import CurrencyModel, TemperatureModel, DimensionModel, AgeModel, ExtractorParserModel -from .extractors import NumberWithUnitExtractor, BaseMergedUnitExtractor -from .parsers import NumberWithUnitParser, BaseMergedUnitParser -from .english.extractors import (EnglishCurrencyExtractorConfiguration, - EnglishTemperatureExtractorConfiguration, - EnglishDimensionExtractorConfiguration, - EnglishAgeExtractorConfiguration) -from .english.parsers import (EnglishCurrencyParserConfiguration, - EnglishTemperatureParserConfiguration, - EnglishDimensionParserConfiguration, - EnglishAgeParserConfiguration) -from .chinese.extractors import (ChineseCurrencyExtractorConfiguration, - ChineseTemperatureExtractorConfiguration, - ChineseDimensionExtractorConfiguration, - ChineseAgeExtractorConfiguration) -from .chinese.parsers import (ChineseCurrencyParserConfiguration, - ChineseTemperatureParserConfiguration, - ChineseDimensionParserConfiguration, - ChineseAgeParserConfiguration) -from .dutch.extractors import (DutchCurrencyExtractorConfiguration, - DutchTemperatureExtractorConfiguration, - DutchDimensionExtractorConfiguration, - DutchAgeExtractorConfiguration) -from .dutch.parsers import (DutchCurrencyParserConfiguration, - DutchTemperatureParserConfiguration, - DutchDimensionParserConfiguration, - DutchAgeParserConfiguration) -from .spanish.extractors import (SpanishCurrencyExtractorConfiguration, - SpanishTemperatureExtractorConfiguration, - SpanishDimensionExtractorConfiguration, - SpanishAgeExtractorConfiguration) -from .spanish.parsers import (SpanishCurrencyParserConfiguration, - SpanishTemperatureParserConfiguration, - SpanishDimensionParserConfiguration, - SpanishAgeParserConfiguration) -from .french.extractors import (FrenchCurrencyExtractorConfiguration, - FrenchTemperatureExtractorConfiguration, - FrenchDimensionExtractorConfiguration, - FrenchAgeExtractorConfiguration) -from .french.parsers import (FrenchCurrencyParserConfiguration, - FrenchTemperatureParserConfiguration, - FrenchDimensionParserConfiguration, - FrenchAgeParserConfiguration) -from .portuguese.extractors import (PortugueseCurrencyExtractorConfiguration, - PortugueseTemperatureExtractorConfiguration, - PortugueseDimensionExtractorConfiguration, - PortugueseAgeExtractorConfiguration) -from .portuguese.parsers import (PortugueseCurrencyParserConfiguration, - PortugueseTemperatureParserConfiguration, - PortugueseDimensionParserConfiguration, - PortugueseAgeParserConfiguration) -from .german.extractors import GermanCurrencyExtractorConfiguration -from .german.parsers import GermanCurrencyParserConfiguration -from .italian.extractors import ItalianCurrencyExtractorConfiguration -from .italian.parsers import ItalianCurrencyParserConfiguration + +from .configs import ( + ArabicCurrencyExtractorConfiguration, + ArabicCurrencyParserConfiguration, + CatalanCurrencyExtractorConfiguration, + CatalanCurrencyParserConfiguration, + ChineseCurrencyExtractorConfiguration, + ChineseCurrencyParserConfiguration, + DutchCurrencyExtractorConfiguration, + DutchCurrencyParserConfiguration, + EnglishCurrencyExtractorConfiguration, + EnglishCurrencyParserConfiguration, + FrenchCurrencyExtractorConfiguration, + FrenchCurrencyParserConfiguration, + GermanCurrencyExtractorConfiguration, + GermanCurrencyParserConfiguration, + ItalianCurrencyExtractorConfiguration, + ItalianCurrencyParserConfiguration, + JapaneseCurrencyExtractorConfiguration, + JapaneseCurrencyParserConfiguration, + PortugueseCurrencyExtractorConfiguration, + PortugueseCurrencyParserConfiguration, + SpanishCurrencyExtractorConfiguration, + SpanishCurrencyParserConfiguration, +) +from .extractors import BaseMergedUnitExtractor, NumberWithUnitExtractor +from .models import CurrencyModel, ExtractorParserModel +from .parsers import BaseMergedUnitParser, NumberWithUnitParser class NumberWithUnitOptions(IntFlag): @@ -68,236 +39,217 @@ class NumberWithUnitOptions(IntFlag): class NumberWithUnitRecognizer(Recognizer[NumberWithUnitOptions]): - def __init__(self, target_culture: str = None, - options: NumberWithUnitOptions = NumberWithUnitOptions.NONE, - lazy_initialization: bool = True): + def __init__( + self, + target_culture: str = None, + options: NumberWithUnitOptions = NumberWithUnitOptions.NONE, + lazy_initialization: bool = True, + ): if options < NumberWithUnitOptions.NONE or options > NumberWithUnitOptions.NONE: raise ValueError() super().__init__(target_culture, options, lazy_initialization) def initialize_configuration(self): # region English - self.register_model('CurrencyModel', Culture.English, lambda options: CurrencyModel( - [ExtractorParserModel(BaseMergedUnitExtractor(EnglishCurrencyExtractorConfiguration( - )), BaseMergedUnitParser(EnglishCurrencyParserConfiguration()))] - )) - self.register_model('TemperatureModel', Culture.English, lambda options: TemperatureModel( - [ExtractorParserModel(NumberWithUnitExtractor(EnglishTemperatureExtractorConfiguration( - )), NumberWithUnitParser(EnglishTemperatureParserConfiguration()))] - )) - self.register_model('DimensionModel', Culture.English, lambda options: DimensionModel( - [ExtractorParserModel(NumberWithUnitExtractor(EnglishDimensionExtractorConfiguration( - )), NumberWithUnitParser(EnglishDimensionParserConfiguration()))] - )) - self.register_model('AgeModel', Culture.English, lambda options: AgeModel( - [ExtractorParserModel(NumberWithUnitExtractor(EnglishAgeExtractorConfiguration( - )), NumberWithUnitParser(EnglishAgeParserConfiguration()))] - )) + self.register_model( + 'CurrencyModel', + Culture.English, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(EnglishCurrencyExtractorConfiguration()), + BaseMergedUnitParser(EnglishCurrencyParserConfiguration()), + ) + ] + ), + ) # endregion # region Chinese - self.register_model('CurrencyModel', Culture.Chinese, lambda options: CurrencyModel([ - ExtractorParserModel( - BaseMergedUnitExtractor( - ChineseCurrencyExtractorConfiguration()), - BaseMergedUnitParser(ChineseCurrencyParserConfiguration())), - ExtractorParserModel( - NumberWithUnitExtractor( - EnglishCurrencyExtractorConfiguration()), - NumberWithUnitParser(EnglishCurrencyParserConfiguration())) - ])) - self.register_model('TemperatureModel', Culture.Chinese, lambda options: TemperatureModel([ - ExtractorParserModel( - NumberWithUnitExtractor( - ChineseTemperatureExtractorConfiguration()), - NumberWithUnitParser(ChineseTemperatureParserConfiguration())), - ExtractorParserModel( - NumberWithUnitExtractor( - EnglishTemperatureExtractorConfiguration()), - NumberWithUnitParser(EnglishTemperatureParserConfiguration())) - ])) - self.register_model('DimensionModel', Culture.Chinese, lambda options: DimensionModel([ - ExtractorParserModel( - NumberWithUnitExtractor( - ChineseDimensionExtractorConfiguration()), - NumberWithUnitParser(ChineseDimensionParserConfiguration())), - ExtractorParserModel( - NumberWithUnitExtractor( - EnglishDimensionExtractorConfiguration()), - NumberWithUnitParser(EnglishDimensionParserConfiguration())) - ])) - self.register_model('AgeModel', Culture.Chinese, lambda options: AgeModel([ - ExtractorParserModel( - NumberWithUnitExtractor(ChineseAgeExtractorConfiguration()), - NumberWithUnitParser(ChineseAgeParserConfiguration())), - ExtractorParserModel( - NumberWithUnitExtractor(EnglishAgeExtractorConfiguration()), - NumberWithUnitParser(EnglishAgeParserConfiguration())) - ])) + self.register_model( + 'CurrencyModel', + Culture.Chinese, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(ChineseCurrencyExtractorConfiguration()), + BaseMergedUnitParser(ChineseCurrencyParserConfiguration()), + ), + ExtractorParserModel( + NumberWithUnitExtractor(EnglishCurrencyExtractorConfiguration()), + NumberWithUnitParser(EnglishCurrencyParserConfiguration()), + ), + ] + ), + ) # endregion # region Dutch - self.register_model('CurrencyModel', Culture.Dutch, lambda options: CurrencyModel( - [ExtractorParserModel(BaseMergedUnitExtractor(DutchCurrencyExtractorConfiguration( - )), BaseMergedUnitParser(DutchCurrencyParserConfiguration()))] - )) - self.register_model('TemperatureModel', Culture.Dutch, lambda options: TemperatureModel([ - ExtractorParserModel( - NumberWithUnitExtractor( - DutchTemperatureExtractorConfiguration()), - NumberWithUnitParser(DutchTemperatureParserConfiguration())) - ])) - self.register_model('DimensionModel', Culture.Dutch, lambda options: DimensionModel([ - ExtractorParserModel( - NumberWithUnitExtractor( - DutchDimensionExtractorConfiguration()), - NumberWithUnitParser(DutchDimensionParserConfiguration())) - ])) - self.register_model('AgeModel', Culture.Dutch, lambda options: AgeModel([ - ExtractorParserModel( - NumberWithUnitExtractor(DutchAgeExtractorConfiguration()), - NumberWithUnitParser(DutchAgeParserConfiguration())) - ])) + self.register_model( + 'CurrencyModel', + Culture.Dutch, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(DutchCurrencyExtractorConfiguration()), + BaseMergedUnitParser(DutchCurrencyParserConfiguration()), + ) + ] + ), + ) # endregion # region French - self.register_model('CurrencyModel', Culture.French, lambda options: CurrencyModel( - [ExtractorParserModel(BaseMergedUnitExtractor(FrenchCurrencyExtractorConfiguration( - )), BaseMergedUnitParser(FrenchCurrencyParserConfiguration()))] - )) - self.register_model('TemperatureModel', Culture.French, lambda options: TemperatureModel([ - ExtractorParserModel( - NumberWithUnitExtractor( - FrenchTemperatureExtractorConfiguration()), - NumberWithUnitParser(FrenchTemperatureParserConfiguration())) - ])) - self.register_model('DimensionModel', Culture.French, lambda options: DimensionModel([ - ExtractorParserModel( - NumberWithUnitExtractor( - FrenchDimensionExtractorConfiguration()), - NumberWithUnitParser(FrenchDimensionParserConfiguration())) - ])) - self.register_model('AgeModel', Culture.French, lambda options: AgeModel([ - ExtractorParserModel( - NumberWithUnitExtractor(FrenchAgeExtractorConfiguration()), - NumberWithUnitParser(FrenchAgeParserConfiguration())) - ])) + self.register_model( + 'CurrencyModel', + Culture.French, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(FrenchCurrencyExtractorConfiguration()), + BaseMergedUnitParser(FrenchCurrencyParserConfiguration()), + ) + ] + ), + ) # endregion # region Portuguese - self.register_model('CurrencyModel', Culture.Portuguese, lambda options: CurrencyModel( - [ExtractorParserModel(BaseMergedUnitExtractor(PortugueseCurrencyExtractorConfiguration( - )), BaseMergedUnitParser(PortugueseCurrencyParserConfiguration()))] - )) - self.register_model('TemperatureModel', Culture.Portuguese, lambda options: TemperatureModel([ - ExtractorParserModel( - NumberWithUnitExtractor( - PortugueseTemperatureExtractorConfiguration()), - NumberWithUnitParser(PortugueseTemperatureParserConfiguration())) - ])) - self.register_model('DimensionModel', Culture.Portuguese, lambda options: DimensionModel([ - ExtractorParserModel( - NumberWithUnitExtractor( - PortugueseDimensionExtractorConfiguration()), - NumberWithUnitParser(PortugueseDimensionParserConfiguration())) - ])) - self.register_model('AgeModel', Culture.Portuguese, lambda options: AgeModel([ - ExtractorParserModel( - NumberWithUnitExtractor(PortugueseAgeExtractorConfiguration()), - NumberWithUnitParser(PortugueseAgeParserConfiguration())) - ])) + self.register_model( + 'CurrencyModel', + Culture.Portuguese, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(PortugueseCurrencyExtractorConfiguration()), + BaseMergedUnitParser(PortugueseCurrencyParserConfiguration()), + ) + ] + ), + ) # endregion # region Spanish - self.register_model('CurrencyModel', Culture.Spanish, lambda options: CurrencyModel( - [ExtractorParserModel(BaseMergedUnitExtractor(SpanishCurrencyExtractorConfiguration( - )), BaseMergedUnitParser(SpanishCurrencyParserConfiguration()))] - )) - self.register_model('TemperatureModel', Culture.Spanish, lambda options: TemperatureModel( - [ExtractorParserModel(NumberWithUnitExtractor(SpanishTemperatureExtractorConfiguration( - )), NumberWithUnitParser(SpanishTemperatureParserConfiguration()))] - )) - self.register_model('DimensionModel', Culture.Spanish, lambda options: DimensionModel( - [ExtractorParserModel(NumberWithUnitExtractor(SpanishDimensionExtractorConfiguration( - )), NumberWithUnitParser(SpanishDimensionParserConfiguration()))] - )) - self.register_model('AgeModel', Culture.Spanish, lambda options: AgeModel( - [ExtractorParserModel(NumberWithUnitExtractor(SpanishAgeExtractorConfiguration( - )), NumberWithUnitParser(SpanishAgeParserConfiguration()))] - )) + self.register_model( + 'CurrencyModel', + Culture.Spanish, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(SpanishCurrencyExtractorConfiguration()), + BaseMergedUnitParser(SpanishCurrencyParserConfiguration()), + ) + ] + ), + ) # endregion # region Spanish Mexican - self.register_model('CurrencyModel', Culture.SpanishMexican, lambda options: CurrencyModel( - [ExtractorParserModel(BaseMergedUnitExtractor(SpanishCurrencyExtractorConfiguration( - )), BaseMergedUnitParser(SpanishCurrencyParserConfiguration(culture_info=CultureInfo(Culture.SpanishMexican))))] - )) - self.register_model('TemperatureModel', Culture.SpanishMexican, lambda options: TemperatureModel( - [ExtractorParserModel(NumberWithUnitExtractor(SpanishTemperatureExtractorConfiguration( - )), NumberWithUnitParser(SpanishTemperatureParserConfiguration(culture_info=CultureInfo(Culture.SpanishMexican))))] - )) - self.register_model('DimensionModel', Culture.SpanishMexican, lambda options: DimensionModel( - [ExtractorParserModel(NumberWithUnitExtractor(SpanishDimensionExtractorConfiguration( - )), NumberWithUnitParser(SpanishDimensionParserConfiguration(culture_info=CultureInfo(Culture.SpanishMexican))))] - )) - self.register_model('AgeModel', Culture.SpanishMexican, lambda options: AgeModel( - [ExtractorParserModel(NumberWithUnitExtractor(SpanishAgeExtractorConfiguration( - )), NumberWithUnitParser(SpanishAgeParserConfiguration(culture_info=CultureInfo(Culture.SpanishMexican))))] - )) + self.register_model( + 'CurrencyModel', + Culture.SpanishMexican, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(SpanishCurrencyExtractorConfiguration()), + BaseMergedUnitParser( + SpanishCurrencyParserConfiguration(culture_info=CultureInfo(Culture.SpanishMexican)) + ), + ) + ] + ), + ) # endregion # region Italian - self.register_model('CurrencyModel', Culture.Italian, lambda options: CurrencyModel([ - ExtractorParserModel( - BaseMergedUnitExtractor( - ItalianCurrencyExtractorConfiguration()), - BaseMergedUnitParser(ItalianCurrencyParserConfiguration())) - ])) + self.register_model( + 'CurrencyModel', + Culture.Italian, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(ItalianCurrencyExtractorConfiguration()), + BaseMergedUnitParser(ItalianCurrencyParserConfiguration()), + ) + ] + ), + ) # endregion # region German - self.register_model('CurrencyModel', Culture.German, lambda options: CurrencyModel([ - ExtractorParserModel( - BaseMergedUnitExtractor( - GermanCurrencyExtractorConfiguration()), - BaseMergedUnitParser(GermanCurrencyParserConfiguration())) - ])) + self.register_model( + 'CurrencyModel', + Culture.German, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(GermanCurrencyExtractorConfiguration()), + BaseMergedUnitParser(GermanCurrencyParserConfiguration()), + ) + ] + ), + ) # endregion - def get_age_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: - return self.get_model('AgeModel', culture, fallback_to_default_culture) - - def get_currency_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: - return self.get_model('CurrencyModel', culture, fallback_to_default_culture) - - def get_dimension_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: - return self.get_model('DimensionModel', culture, fallback_to_default_culture) + # region Japanese + self.register_model( + 'CurrencyModel', + Culture.Japanese, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(JapaneseCurrencyExtractorConfiguration()), + BaseMergedUnitParser(JapaneseCurrencyParserConfiguration()), + ), + ExtractorParserModel( + NumberWithUnitExtractor(EnglishCurrencyExtractorConfiguration()), + NumberWithUnitParser(EnglishCurrencyParserConfiguration()), + ), + ] + ), + ) + # endregion - def get_temperature_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: - return self.get_model('TemperatureModel', culture, fallback_to_default_culture) + # region Catalan + self.register_model( + 'CurrencyModel', + Culture.Catalan, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(CatalanCurrencyExtractorConfiguration()), + BaseMergedUnitParser(CatalanCurrencyParserConfiguration()), + ) + ] + ), + ) + # endregion + # region Arabic + self.register_model( + 'CurrencyModel', + Culture.Arabic, + lambda options: CurrencyModel( + [ + ExtractorParserModel( + BaseMergedUnitExtractor(ArabicCurrencyExtractorConfiguration()), + BaseMergedUnitParser(ArabicCurrencyParserConfiguration()), + ) + ] + ), + ) + # endregion -def recognize_age(query: str, culture: str, options: NumberWithUnitOptions = NumberWithUnitOptions.NONE, fallback_to_default_culture: bool = True) -> List[ModelResult]: - recognizer = NumberWithUnitRecognizer(culture, options) - model = recognizer.get_age_model(culture, fallback_to_default_culture) - return model.parse(query) + def get_currency_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: + return self.get_model('CurrencyModel', culture, fallback_to_default_culture) -def recognize_currency(query: str, culture: str, options: NumberWithUnitOptions = NumberWithUnitOptions.NONE, fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_currency( + query: str, + culture: str, + options: NumberWithUnitOptions = NumberWithUnitOptions.NONE, + fallback_to_default_culture: bool = True, +) -> List[ModelResult]: recognizer = NumberWithUnitRecognizer(culture, options) model = recognizer.get_currency_model(culture, fallback_to_default_culture) return model.parse(query) - - -def recognize_dimension(query: str, culture: str, options: NumberWithUnitOptions = NumberWithUnitOptions.NONE, fallback_to_default_culture: bool = True) -> List[ModelResult]: - recognizer = NumberWithUnitRecognizer(culture, options) - model = recognizer.get_dimension_model( - culture, fallback_to_default_culture) - return model.parse(query) - - -def recognize_temperature(query: str, culture: str, options: NumberWithUnitOptions = NumberWithUnitOptions.NONE, fallback_to_default_culture: bool = True) -> List[ModelResult]: - recognizer = NumberWithUnitRecognizer(culture, options) - model = recognizer.get_temperature_model( - culture, fallback_to_default_culture) - return model.parse(query) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/parsers.py index 459e7f357a..6a4d15753a 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/parsers.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/parsers.py @@ -1,36 +1,27 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from abc import ABC, abstractmethod -from typing import Dict, List, Optional from collections import namedtuple +from typing import Dict, List, Optional -from .constants import * -from .utilities import DictionaryUtility -from recognizers_text.extractor import Extractor, ExtractResult -from recognizers_text.parser import Parser, ParseResult from recognizers_number.culture import CultureInfo from recognizers_number_with_unit.resources.base_currency import BaseCurrency +from recognizers_text.extractor import Extractor, ExtractResult +from recognizers_text.parser import Parser, ParseResult + +from .constants import * +from .utilities import DictionaryUtility + UnitValue = namedtuple('UnitValue', ['number', 'unit']) CurrencyUnitValue = namedtuple('UnitValue', ['number', 'unit', 'iso_currency']) -class NumberWithUnitParserConfiguration(ABC): - @property - @abstractmethod - def internal_number_parser(self) -> Parser: - raise NotImplementedError - - @property - @abstractmethod - def internal_number_extractor(self) -> Extractor: - raise NotImplementedError +class NumberWithUnitParserConfiguration: - @property - @abstractmethod - def connector_token(self) -> str: - raise NotImplementedError + internal_number_parser: Parser + internal_number_extractor: Extractor + connector_token: str def __init__(self, culture_info: CultureInfo): self.culture_info: CultureInfo = culture_info @@ -72,13 +63,11 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: while i <= len(key): if i == len(key): if unit_key_build: - self.__add_if_not_contained( - unit_keys, unit_key_build.strip()) + self.__add_if_not_contained(unit_keys, unit_key_build.strip()) # number_result.start is a relative position elif i == number_result.start: if unit_key_build: - self.__add_if_not_contained( - unit_keys, unit_key_build.strip()) + self.__add_if_not_contained(unit_keys, unit_key_build.strip()) unit_key_build = '' if number_result.length: i = number_result.start + number_result.length - 1 @@ -89,12 +78,11 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: # Unit type depends on last unit in suffix. last_unit = unit_keys[-1] if half_result and half_result.text in last_unit: - last_unit = last_unit[:-1 * half_result.length] + last_unit = last_unit[: -1 * half_result.length] normalized_last_unit = last_unit.lower() if self.config.connector_token and normalized_last_unit.startswith(self.config.connector_token): - normalized_last_unit = normalized_last_unit[len( - self.config.connector_token):].strip() - last_unit = last_unit[len(self.config.connector_token):].strip() + normalized_last_unit = normalized_last_unit[len(self.config.connector_token) :].strip() + last_unit = last_unit[len(self.config.connector_token) :].strip() last_unit = self.__delete_brackets_if_exists(last_unit) normalized_last_unit = self.__delete_brackets_if_exists(normalized_last_unit) @@ -106,17 +94,14 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: elif normalized_last_unit in self.config.unit_map: unit_value = self.config.unit_map[normalized_last_unit] if unit_value: - num_value = self.config.internal_number_parser.parse( - number_result) if number_result.text else None + num_value = self.config.internal_number_parser.parse(number_result) if number_result.text else None resolution_str = num_value.resolution_str if num_value else None if half_result: half_result = self.config.internal_number_parser.parse(half_result) resolution_str += half_result.resolution_str[1:] if half_result else 0 - ret.value = UnitValue( - number=resolution_str, - unit=unit_value) + ret.value = UnitValue(number=resolution_str, unit=unit_value) ret.resolution_str = f'{resolution_str} {unit_value}'.strip() ret.text = ret.text.lower() @@ -130,20 +115,20 @@ def __add_if_not_contained(self, keys: List[str], new_key: str): def __delete_brackets_if_exists(self, unit: str): has_brackets = False - if (unit.startswith('(') and unit.endswith(')')): + if unit.startswith('(') and unit.endswith(')'): has_brackets = True - if (unit.startswith('[') and unit.endswith(']')): + if unit.startswith('[') and unit.endswith(']'): has_brackets = True - if (unit.startswith('{') and unit.endswith('}')): + if unit.startswith('{') and unit.endswith('}'): has_brackets = True - if (unit.startswith('<') and unit.endswith('>')): + if unit.startswith('<') and unit.endswith('>'): has_brackets = True if has_brackets is True: - unit = unit[1: len(unit) - 1] + unit = unit[1 : len(unit) - 1] return unit @@ -159,14 +144,13 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: else: ret = self.number_with_unit_parser.parse(source) - main_unit_iso_code = self.config.currency_name_to_iso_code_map.get(ret.value.unit, - None) if ret.value else None + main_unit_iso_code = ( + self.config.currency_name_to_iso_code_map.get(ret.value.unit, None) if ret.value else None + ) if main_unit_iso_code and main_unit_iso_code.startswith(Constants.FAKE_ISO_CODE_PREFIX): - ret.value = UnitValue( - ret.value.number, ret.value.unit) if ret.value else None + ret.value = UnitValue(ret.value.number, ret.value.unit) if ret.value else None else: - ret.value = CurrencyUnitValue( - ret.value.number, ret.value.unit, main_unit_iso_code) + ret.value = CurrencyUnitValue(ret.value.number, ret.value.unit, main_unit_iso_code) return ret @@ -209,43 +193,47 @@ def __merge_compound_unit(self, compound_result: ExtractResult) -> ParseResult: number_value = float(parse_result_value.number) result.resolution_str = parse_result.resolution_str - main_unit_iso_code = self.config.currency_name_to_iso_code_map.get( - unit_value, None) + main_unit_iso_code = self.config.currency_name_to_iso_code_map.get(unit_value, None) # If the main unit can't be recognized, finish process this group. if not main_unit_iso_code: - result.value = UnitValue( - self.__get_number_value(number_value), main_unit_value) + result.value = UnitValue(self.__get_number_value(number_value), main_unit_value) results.append(result) result = None idx = idx + 1 continue - fraction_units_string = self.config.currency_fraction_mapping.get( - main_unit_iso_code) + fraction_units_string = self.config.currency_fraction_mapping.get(main_unit_iso_code) else: if extract_result.type == Constants.SYS_NUM: - number_value = number_value + \ - float(parse_result.value) * (1 / 100) + number_value = number_value + float(parse_result.value) * (1 / 100) result.resolution_str = result.resolution_str + ' ' + str(parse_result.resolution_str or '') result.length = parse_result.start + parse_result.length - result.start count = count + 1 idx = idx + 1 continue - fraction_unit_code = self.config.currency_fraction_code_list.get( - unit_value, None) - fraction_num_value = self.config.currency_fraction_num_map.get(parse_result_value.unit, - None) if parse_result_value else None - - if fraction_unit_code and fraction_num_value != 0 and self.__check_units_string_contains( - fraction_unit_code, fraction_units_string): + fraction_unit_code = self.config.currency_fraction_code_list.get(unit_value, None) + fraction_num_value = ( + self.config.currency_fraction_num_map.get(parse_result_value.unit, None) + if parse_result_value + else None + ) + + if ( + fraction_unit_code + and fraction_num_value != 0 + and self.__check_units_string_contains(fraction_unit_code, fraction_units_string) + ): number_value = number_value + ( - float(parse_result_value.number) * (1 / fraction_num_value) if parse_result_value else 0) + float(parse_result_value.number) * (1 / fraction_num_value) if parse_result_value else 0 + ) result.resolution_str = result.resolution_str + ' ' + parse_result.resolution_str result.length = parse_result.start + parse_result.length - result.start else: if result: - result = self.__create_currency_result(result, main_unit_iso_code, number_value, main_unit_value) + result = self.__create_currency_result( + result, main_unit_iso_code, number_value, main_unit_value + ) results.append(result) result = None @@ -260,8 +248,7 @@ def __merge_compound_unit(self, compound_result: ExtractResult) -> ParseResult: result = self.__create_currency_result(result, main_unit_iso_code, number_value, main_unit_value) results.append(result) - self.__resolve_text(results, compound_result.text, - compound_result.start) + self.__resolve_text(results, compound_result.text, compound_result.start) ret = ParseResult(compound_result) @@ -270,8 +257,7 @@ def __merge_compound_unit(self, compound_result: ExtractResult) -> ParseResult: def __check_units_string_contains(self, fraction_unit_code: str, fraction_units_string: str) -> bool: units_map = dict() - DictionaryUtility.bind_units_string( - units_map, '', fraction_units_string) + DictionaryUtility.bind_units_string(units_map, '', fraction_units_string) if fraction_unit_code in units_map: return True @@ -280,22 +266,23 @@ def __check_units_string_contains(self, fraction_unit_code: str, fraction_units_ def __resolve_text(self, prs: List[ParseResult], source: str, bias: int): for parse_result in prs: if parse_result.start is not None and parse_result.length is not None: - parse_result.text = source[parse_result.start - bias:parse_result.start - bias + parse_result.length] + parse_result.text = source[parse_result.start - bias : parse_result.start - bias + parse_result.length] def __get_number_value(self, number_value): if number_value: - return self.config.culture_info.format(number_value) if self.config.culture_info is not None \ + return ( + self.config.culture_info.format(number_value) + if self.config.culture_info is not None else repr(number_value) + ) else: return None def __create_currency_result(self, result, main_unit_iso_code, number_value, main_unit_value) -> ParseResult: if not main_unit_iso_code or main_unit_iso_code.startswith(Constants.FAKE_ISO_CODE_PREFIX): - result.value = UnitValue( - self.__get_number_value(number_value), main_unit_value) + result.value = UnitValue(self.__get_number_value(number_value), main_unit_value) else: - result.value = CurrencyUnitValue( - self.__get_number_value(number_value), main_unit_value, main_unit_iso_code) + result.value = CurrencyUnitValue(self.__get_number_value(number_value), main_unit_value, main_unit_iso_code) return result diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/__init__.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/__init__.py deleted file mode 100644 index 4065a709e7..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from .extractors import * -from .parsers import * diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/extractors.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/extractors.py deleted file mode 100644 index 7c6b63f228..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/extractors.py +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Dict, List, Pattern - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility, DefinitionLoader -from recognizers_number.culture import CultureInfo -from recognizers_number.number.models import NumberMode -from recognizers_number.number.portuguese.extractors import PortugueseNumberExtractor -from recognizers_number_with_unit.number_with_unit.constants import Constants -from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration -from recognizers_number_with_unit.resources.portuguese_numeric_with_unit import PortugueseNumericWithUnit -from recognizers_number_with_unit.resources.base_units import BaseUnits - - -# pylint: disable=abstract-method -class PortugueseNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return DefinitionLoader.load_ambiguity_filters(PortugueseNumericWithUnit.AmbiguityFiltersDict) - - @property - def unit_num_extractor(self) -> Extractor: - return self._unit_num_extractor - - @property - def build_prefix(self) -> str: - return self._build_prefix - - @property - def build_suffix(self) -> str: - return self._build_suffix - - @property - def connector_token(self) -> str: - return PortugueseNumericWithUnit.ConnectorToken - - @property - def compound_unit_connector_regex(self) -> Pattern: - return self._compound_unit_connector_regex - - @property - def non_unit_regex(self) -> Pattern: - return self._pm_non_unit_regex - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return None - - def expand_half_suffix(self, source, result, numbers): - pass - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Portuguese) - super().__init__(culture_info) - self._unit_num_extractor = PortugueseNumberExtractor(NumberMode.Unit) - self._build_prefix = PortugueseNumericWithUnit.BuildPrefix - self._build_suffix = PortugueseNumericWithUnit.BuildSuffix - self._compound_unit_connector_regex = RegExpUtility.get_safe_reg_exp( - PortugueseNumericWithUnit.CompoundUnitConnectorRegex) - self._pm_non_unit_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.PmNonUnitRegex) - - -# pylint: enable=abstract-method - -class PortugueseAgeExtractorConfiguration(PortugueseNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_AGE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = PortugueseNumericWithUnit.AgeSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = PortugueseNumericWithUnit.AmbiguousAgeUnitList - - -class PortugueseCurrencyExtractorConfiguration(PortugueseNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_CURRENCY - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = PortugueseNumericWithUnit.CurrencySuffixList - self._prefix_list = PortugueseNumericWithUnit.CurrencyPrefixList - self._ambiguous_unit_list = PortugueseNumericWithUnit.AmbiguousCurrencyUnitList - - -class PortugueseDimensionExtractorConfiguration(PortugueseNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_DIMENSION - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - - super().__init__(culture_info) - - self._suffix_list = { - **PortugueseNumericWithUnit.InformationSuffixList, - **PortugueseNumericWithUnit.AreaSuffixList, - **PortugueseNumericWithUnit.LengthSuffixList, - **PortugueseNumericWithUnit.SpeedSuffixList, - **PortugueseNumericWithUnit.VolumeSuffixList, - **PortugueseNumericWithUnit.WeightSuffixList - } - - self._prefix_list = dict() - self._ambiguous_unit_list = PortugueseNumericWithUnit.AmbiguousDimensionUnitList +\ - PortugueseNumericWithUnit.AmbiguousAngleUnitList +\ - PortugueseNumericWithUnit.AmbiguousLengthUnitList +\ - PortugueseNumericWithUnit.AmbiguousSpeedUnitList +\ - PortugueseNumericWithUnit.AmbiguousWeightUnitList - - -class PortugueseTemperatureExtractorConfiguration(PortugueseNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_TEMPERATURE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return self._ambiguous_unit_number_multiplier_regex - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = PortugueseNumericWithUnit.TemperatureSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = [] - self._ambiguous_unit_number_multiplier_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.AmbiguousUnitNumberMultiplierRegex) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/parsers.py deleted file mode 100644 index 83be4ce980..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/portuguese/parsers.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.parser import Parser -from recognizers_number.culture import CultureInfo -from recognizers_number.number.portuguese.extractors import PortugueseNumberExtractor, NumberMode -from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType -from recognizers_number.number.portuguese.parsers import PortugueseNumberParserConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration -from recognizers_number_with_unit.resources.portuguese_numeric_with_unit import PortugueseNumericWithUnit - - -class PortugueseNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): - @property - def internal_number_parser(self) -> Parser: - return self._internal_number_parser - - @property - def internal_number_extractor(self) -> Extractor: - return self._internal_number_extractor - - @property - def connector_token(self) -> str: - return PortugueseNumericWithUnit.ConnectorToken - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Portuguese) - super().__init__(culture_info) - self._internal_number_extractor = PortugueseNumberExtractor( - NumberMode.DEFAULT) - self._internal_number_parser = AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, PortugueseNumberParserConfiguration(culture_info)) - - -class PortugueseAgeParserConfiguration(PortugueseNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.AgeSuffixList) - - -class PortugueseCurrencyParserConfiguration(PortugueseNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.CurrencySuffixList) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.CurrencyPrefixList) - self.currency_name_to_iso_code_map = PortugueseNumericWithUnit.CurrencyNameToIsoCodeMap - self.currency_fraction_code_list = PortugueseNumericWithUnit.FractionalUnitNameToCodeMap - - -class PortugueseDimensionParserConfiguration(PortugueseNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.InformationSuffixList) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.AreaSuffixList) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.LengthSuffixList) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.SpeedSuffixList) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.VolumeSuffixList) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.WeightSuffixList) - - -class PortugueseTemperatureParserConfiguration(PortugueseNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(PortugueseNumericWithUnit.TemperatureSuffixList) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/__init__.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/__init__.py deleted file mode 100644 index 4065a709e7..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from .extractors import * -from .parsers import * diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/extractors.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/extractors.py deleted file mode 100644 index 39e54bd8dd..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/extractors.py +++ /dev/null @@ -1,182 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from typing import Dict, List, Pattern - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.utilities import RegExpUtility -from recognizers_number.culture import CultureInfo -from recognizers_number.number.models import NumberMode -from recognizers_number.number.spanish.extractors import SpanishNumberExtractor -from recognizers_number_with_unit.number_with_unit.constants import Constants -from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractorConfiguration -from recognizers_number_with_unit.resources.spanish_numeric_with_unit import SpanishNumericWithUnit -from recognizers_number_with_unit.resources.base_units import BaseUnits - - -# pylint: disable=abstract-method -class SpanishNumberWithUnitExtractorConfiguration(NumberWithUnitExtractorConfiguration): - @property - def ambiguity_filters_dict(self) -> Dict[Pattern, Pattern]: - return None - - @property - def unit_num_extractor(self) -> Extractor: - return self._unit_num_extractor - - @property - def build_prefix(self) -> str: - return self._build_prefix - - @property - def build_suffix(self) -> str: - return self._build_suffix - - @property - def connector_token(self) -> str: - return SpanishNumericWithUnit.ConnectorToken - - @property - def compound_unit_connector_regex(self) -> Pattern: - return self._compound_unit_connector_regex - - @property - def non_unit_regex(self) -> Pattern: - return self._pm_non_unit_regex - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return None - - def expand_half_suffix(self, source, result, numbers): - pass - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Spanish) - super().__init__(culture_info) - self._unit_num_extractor = SpanishNumberExtractor(NumberMode.Unit) - self._build_prefix = SpanishNumericWithUnit.BuildPrefix - self._build_suffix = SpanishNumericWithUnit.BuildSuffix - self._compound_unit_connector_regex = RegExpUtility.get_safe_reg_exp( - SpanishNumericWithUnit.CompoundUnitConnectorRegex) - self._pm_non_unit_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.PmNonUnitRegex) - - -# pylint: enable=abstract-method - -class SpanishAgeExtractorConfiguration(SpanishNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_AGE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = SpanishNumericWithUnit.AgeSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = SpanishNumericWithUnit.AmbiguousAgeUnitList - - -class SpanishCurrencyExtractorConfiguration(SpanishNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_CURRENCY - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = SpanishNumericWithUnit.CurrencySuffixList - self._prefix_list = SpanishNumericWithUnit.CurrencyPrefixList - self._ambiguous_unit_list = SpanishNumericWithUnit.AmbiguousCurrencyUnitList - - -class SpanishDimensionExtractorConfiguration(SpanishNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_DIMENSION - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - - self._suffix_list = { - **SpanishNumericWithUnit.InformationSuffixList, - **SpanishNumericWithUnit.AreaSuffixList, - **SpanishNumericWithUnit.LengthSuffixList, - **SpanishNumericWithUnit.SpeedSuffixList, - **SpanishNumericWithUnit.VolumeSuffixList, - **SpanishNumericWithUnit.WeightSuffixList - } - - self._prefix_list = dict() - self._ambiguous_unit_list = SpanishNumericWithUnit.AmbiguousDimensionUnitList +\ - SpanishNumericWithUnit.AmbiguousAngleUnitList +\ - SpanishNumericWithUnit.AmbiguousLengthUnitList +\ - SpanishNumericWithUnit.AmbiguousSpeedUnitList +\ - SpanishNumericWithUnit.AmbiguousWeightUnitList - - -class SpanishTemperatureExtractorConfiguration(SpanishNumberWithUnitExtractorConfiguration): - @property - def extract_type(self) -> str: - return Constants.SYS_UNIT_TEMPERATURE - - @property - def suffix_list(self) -> Dict[str, str]: - return self._suffix_list - - @property - def prefix_list(self) -> Dict[str, str]: - return self._prefix_list - - @property - def ambiguous_unit_list(self) -> List[str]: - return self._ambiguous_unit_list - - @property - def ambiguous_unit_number_multiplier_regex(self) -> Pattern: - return self._ambiguous_unit_number_multiplier_regex - - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self._suffix_list = SpanishNumericWithUnit.TemperatureSuffixList - self._prefix_list = dict() - self._ambiguous_unit_list = [] - self._ambiguous_unit_number_multiplier_regex = RegExpUtility.get_safe_reg_exp( - BaseUnits.AmbiguousUnitNumberMultiplierRegex) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/parsers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/parsers.py deleted file mode 100644 index f777cdf84d..0000000000 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/spanish/parsers.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from recognizers_text.culture import Culture -from recognizers_text.extractor import Extractor -from recognizers_text.parser import Parser -from recognizers_number.culture import CultureInfo -from recognizers_number.number.spanish.extractors import SpanishNumberExtractor, NumberMode -from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType -from recognizers_number.number.spanish.parsers import SpanishNumberParserConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParserConfiguration -from recognizers_number_with_unit.resources.spanish_numeric_with_unit import SpanishNumericWithUnit - - -class SpanishNumberWithUnitParserConfiguration(NumberWithUnitParserConfiguration): - @property - def internal_number_parser(self) -> Parser: - return self._internal_number_parser - - @property - def internal_number_extractor(self) -> Extractor: - return self._internal_number_extractor - - @property - def connector_token(self) -> str: - return SpanishNumericWithUnit.ConnectorToken - - def __init__(self, culture_info: CultureInfo): - if culture_info is None: - culture_info = CultureInfo(Culture.Spanish) - super().__init__(culture_info) - self._internal_number_extractor = SpanishNumberExtractor( - NumberMode.DEFAULT) - self._internal_number_parser = AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, SpanishNumberParserConfiguration(culture_info)) - - -class SpanishAgeParserConfiguration(SpanishNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(SpanishNumericWithUnit.AgeSuffixList) - - -class SpanishCurrencyParserConfiguration(SpanishNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(SpanishNumericWithUnit.CurrencySuffixList) - self.add_dict_to_unit_map(SpanishNumericWithUnit.CurrencyPrefixList) - self.currency_name_to_iso_code_map = SpanishNumericWithUnit.CurrencyNameToIsoCodeMap - self.currency_fraction_code_list = SpanishNumericWithUnit.FractionalUnitNameToCodeMap - - -class SpanishDimensionParserConfiguration(SpanishNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(SpanishNumericWithUnit.InformationSuffixList) - self.add_dict_to_unit_map(SpanishNumericWithUnit.AreaSuffixList) - self.add_dict_to_unit_map(SpanishNumericWithUnit.LengthSuffixList) - self.add_dict_to_unit_map(SpanishNumericWithUnit.SpeedSuffixList) - self.add_dict_to_unit_map(SpanishNumericWithUnit.VolumeSuffixList) - self.add_dict_to_unit_map(SpanishNumericWithUnit.WeightSuffixList) - - -class SpanishTemperatureParserConfiguration(SpanishNumberWithUnitParserConfiguration): - def __init__(self, culture_info: CultureInfo = None): - super().__init__(culture_info) - self.add_dict_to_unit_map(SpanishNumericWithUnit.TemperatureSuffixList) diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/utilities.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/utilities.py index ac83a20c64..5f5b30f759 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/utilities.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/utilities.py @@ -1,10 +1,12 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict +from typing import Dict, List, Pattern +from recognizers_text import ExtractResult, RegExpUtility -class DictionaryUtility(): + +class DictionaryUtility: # Safely bind dictionary which contains several key-value pairs to the destination dictionary. # This function is used to bind all the prefix and suffix for units. @staticmethod @@ -53,3 +55,44 @@ def end(self) -> int: @end.setter def end(self, value) -> int: self._end = value + + +class CommonUtils: + # Expand patterns with 'half' suffix in CJK implementation. + @staticmethod + def expand_half_suffix( + source: str, result: List[ExtractResult], numbers: List[ExtractResult], half_unit_regex: Pattern + ) -> List[ExtractResult]: + if half_unit_regex and numbers: + match: List[ExtractResult] = [] + + for number in numbers: + if len(RegExpUtility.get_matches(half_unit_regex, number.text)) == 1: + match.append(number) + if len(match) > 0: + res: List[ExtractResult] = [] + for er in result: + start = int(er.start) + length = int(er.length) + match_suffix: List[ExtractResult] = [] + for mr in match: + # Take into account possible whitespaces between result and half unit. + if int(mr.start) - (start + length) >= 0: + sub_length = int(mr.start) - (start + length) + else: + sub_length = 0 + mid_str = source[start + length : sub_length] + if not mid_str and int(mr.start) - (start + length) >= 0: + match_suffix.append(mr) + + if len(match_suffix) == 1: + mr = match_suffix[0] + suffix_length = int(mr.start) + int(mr.length) - (start + length) + er.length += suffix_length + er.text += source[start + length : suffix_length] + tmp = ExtractResult() + tmp.data = er.data + er.data = [tmp, mr] + res.append(er) + result = res + return result diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/__init__.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/__init__.py index 4ec196c636..4c688c57f3 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/__init__.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/__init__.py @@ -1,12 +1,12 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - +from .arabic_numeric_with_unit import ArabicNumericWithUnit from .base_numbers import BaseNumbers +from .catalan_numeric_with_unit import CatalanNumericWithUnit from .chinese_numeric_with_unit import ChineseNumericWithUnit +from .dutch_numeric_with_unit import DutchNumericWithUnit from .english_numeric_with_unit import EnglishNumericWithUnit from .french_numeric_with_unit import FrenchNumericWithUnit -from .italian_numeric_with_unit import ItalianNumericWithUnit from .german_numeric_with_unit import GermanNumericWithUnit -from .dutch_numeric_with_unit import DutchNumericWithUnit +from .italian_numeric_with_unit import ItalianNumericWithUnit +from .japanese_numeric_with_unit import JapaneseNumericWithUnit from .portuguese_numeric_with_unit import PortugueseNumericWithUnit from .spanish_numeric_with_unit import SpanishNumericWithUnit diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/arabic_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/arabic_numeric_with_unit.py new file mode 100644 index 0000000000..83a8205269 --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/arabic_numeric_with_unit.py @@ -0,0 +1,716 @@ +# pylint: disable=line-too-long + + +class ArabicNumericWithUnit: + CurrencySuffixList = dict( + [ + ("Abkhazian apsar", "أبخازية أبسار"), + ("Afghan afghani", "أفغاني أفغاني|؋|الأفغاني|أفغاني"), + ("Pul", "بول"), + ("Euro", "EUR|يورو|اليورو|€|يورو"), + ("Cent", "سنتًا|سنتا|سنت|-سنتا|-سنت"), + ("Albanian lek", "ليك الألباني|ليك|ليك"), + ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), + ("Angolan kwanza", "كوانزا الأنغولية|kz|aoa|كوانزا|كوانزاس|الكوانزا الأنغولية"), + ("Armenian dram", "الدرام الأرمنية|الدراما الأرمنية"), + ("Aruban florin", "فلورين أروبي|ƒ|awg|فلورين أروبي"), + ("Bangladeshi taka", "تاكا بنجلاديشي|৳|bdt|تاكا|تاكاس|تاكا بنجلاديشي"), + ("Paisa", "بويشا|بيسا"), + ("Bhutanese ngultrum", "نولتروم بوتاني|نو.|btn"), + ("Chetrum", "شيتروم|شيتروم"), + ("Bolivian boliviano", "بوليفيانو بوليفي|بوب|بكالوريوس|بوليفيا بوليفيانو|بوليفيا بوليفيا|بوليفيانو بوليفي"), + ("Bosnia and Herzegovina convertible mark", "علامة البوسنة والهرسك القابلة للتحويل | بام"), + ("Fening", "fenings|fenings"), + ("Botswana pula", "بولا بوتسوانا|bwp|بولا|بولا|بولا بوتسوانا"), + ("Thebe", "ويكون"), + ("Brazilian real", "ريال برازيلي|r$|brl|ريال برازيلي|ريال برازيلي|ريال برازيلي"), + ("Bulgarian lev", "ليف بلغاري|bgn|лв|ليف بلغاريا|ليف بلغاري|ليف بلغاري"), + ("Stotinka", "ستوتينكي|ستوتينكا"), + ("Cambodian riel", "رييل كمبودي|khr|៛|رييل كمبودي|رييل كمبودي|رييل كمبودي"), + ("Cape Verdean escudo", "اسكودو الرأس الأخضر|cve"), + ( + "Costa Rican colón", + "القولون الكوستاريكي|الكولون الكوستاريكي|crc|₡|الكولون الكوستاريكي|الكولون الكوستاريكي|الكولون الكوستاريكي|الكولون الكوستاريكي|الكولون الكوستاريكي|الكولون الكوستاريكي", + ), + ( + "Salvadoran colón", + "svc|الكولون السلفادوري|الكولون السلفادوري|الكولون السلفادور|الكولون السلفادور|الكولون السلفادوري|الكولون السلفادوري|الكولون السلفادوري|الكولون السلفادور", + ), + ("Céntimo", "سنتيمو"), + ("Croatian kuna", "كونا كرواتية|kn|hrk|كونا كرواتيا|كونا كرواتية|كونا كرواتية"), + ("Lipa", "ليبا"), + ("Czech koruna", "الكورونا التشيكية|czk|kč|الكورونا التشيكية"), + ("Haléř", "هالي"), + ("Eritrean nakfa", "الناكفا الإريترية|nfk|ern|الناكفا الإريترية"), + ("Ethiopian birr", "بير إثيوبي|etb"), + ("Gambian dalasi", "gmd"), + ("Butut", "بوتات|بوتوت"), + ("Georgian lari", "لاري جورجي|لاري|جل|₾"), + ("Tetri", "تتري"), + ("Ghanaian cedi", "السيدي الغاني|ghs|₵|gh₵"), + ("Pesewa", "بيسيوا|بيسيوا"), + ("Guatemalan quetzal", "الكوازال الغواتيمالي|gtq|الكوازال الغواتيمالي"), + ("Haitian gourde", "غورد هايتي|htg"), + ("Honduran lempira", "لمبيرا هندوراس|hnl"), + ("Hungarian forint", "فورنت مجري|huf|قدم|فورنت مجري|فورنت مجري|فورنت مجري"), + ("Fillér", "حشو"), + ("Iranian rial", "الريال الإيراني|irr|الريال الإيراني|الريال الإيراني|الريال الإيراني"), + ("Yemeni rial", "ريال يمني|يير|ريال يمني"), + ("Israeli new shekel", "₪|إيلس|أغورا"), + ("Lithuanian litas", "ltl|ليتاس الليتواني|ليتاس الليتواني|ليتاس الليتواني|ليتاس الليتواني"), + ("Japanese yen", "ين ياباني|ين ياباني|ين|-ين|¥|ين|ين ياباني|ين ياباني|ين ياباني"), + ("Kazakhstani tenge", "تنغي كازاخستاني|تنغي كازاخستاني|تنغي كازاخستاني|كزت"), + ("Kenyan shilling", "شلن كيني|كيس"), + ("North Korean won", "وون كوريا الشمالية|kpw|وون كوريا الشمالية"), + ("South Korean won", "وون كوريا الجنوبية|krw|وون كوريا الجنوبية"), + ("Korean won", "وون كوري|₩|وون كوري"), + ("Kyrgyzstani som", "سوم قيرغيزستاني|كجم"), + ("Uzbekitan som", "السوم الأوزبكي|uzs"), + ("Lao kip", "لاو كيب|لاك|₭ن|₭"), + ("Att", "أت"), + ("Lesotho loti", "لوتي ليسوتو|lsl|لوتي"), + ("Sente", "استماع|استماع"), + ("South African rand", "راند جنوب أفريقيا|زار|راند جنوب أفريقيا|راند جنوب أفريقيا|راند جنوب أفريقيا"), + ("Macanese pataca", "باتاكا ماكاوية|ممسحة$|ممسحة"), + ("Avo", "تجنب|تجنب"), + ("Macedonian denar", "دينار مقدوني|mkd|ден"), + ("Deni", "ديني"), + ("Malagasy ariary", "ارياري مدغشقر|mga"), + ("Iraimbilanja", "iraimbilanja"), + ("Malawian kwacha", "كواشا ملاوية|mk|mwk"), + ("Tambala", "تامبالا"), + ("Malaysian ringgit", "رينغيت ماليزيا|rm|مير|رينغيت ماليزيا|رينغيت ماليزيا|رينغيت ماليزيا"), + ("Mauritanian ouguiya", "أوقية موريتانية|أم|مرو|أوقية موريتانية|أوقية موريتانية|أوقية موريتانية"), + ("Khoums", "الخمس"), + ( + "Mongolian tögrög", + "توجروج منغولي|mnt|₮|توجروج منغوليا|توجروج منغوليا|توجروج منغولي|توجروج منغولي|توجروج منغولي|توجروج منغولي|توجروج منغوليا|توجروج منغولي", + ), + ("Mozambican metical", "ميتيكال موزمبيق|mt|mzn|ميتيكال موزمبيق|ميتيكال موزمبيق|ميتيكال موزمبيق"), + ("Burmese kyat", "كيات البورمية|ks|mmk"), + ("Pya", "بيا"), + ("Nicaraguan córdoba", "كوردوبا النيكاراغوية|نيو"), + ("Nigerian naira", "نايرا نيجيري|نايرا|ngn|₦|نايرا نيجيري|نايرا نيجيري|نايرا نيجيري"), + ("Kobo", "كوبو"), + ("Turkish lira", "الليرة التركية|try|tl|الليرة التركية|الليرة التركية|الليرة التركية"), + ("Kuruş", "kuruş"), + ("Omani rial", "ريال عماني|عمر|ر.ع."), + ("Panamanian balboa", "بالبوا البنمي|ب/.|pab"), + ("Centesimo", "سنتيسيمو"), + ("Papua New Guinean kina", "بابوا غينيا الجديدة كينا|كينا|pgk"), + ("Toea", "إلى عصام"), + ("Paraguayan guaraní", "غواراني باراغواي|₲|pyg"), + ("Peruvian sol", "سول بيرو|النعال|سول|سول بيرو الجديد"), + ("Polish złoty", "زلوتي|زلوتي بولندي|zł|pln|زلوتي|زلوتي بولندي|زلوتي بولندا|زلوتي بولندا"), + ("Grosz", "جروزي|جروز|جروزي"), + ("Qatari riyal", "ريال قطري|قار|ريال قطري|ريال قطري|ريال قطري"), + ("Saudi riyal", "الريال السعودي|الريال|الريال السعودي|ريال سعودي"), + ("Riyal", "ريال|ريال|ريال|﷼"), + ("Dirham", "درهم|درهم|درهم"), + ("Halala", "هللة|هللة"), + ("Samoan tālā", "تالا ساموا|تالا|تالا|ws$|ساموا|غرب|تالا ساموا"), + ("Sene", "سيني"), + ("São Tomé and Príncipe dobra", "ساو تومي وبرينسيبي دوبرا|دوبراس|دوبرا"), + ("Sierra Leonean leone", "ليون سيراليوني|sll|ليون|le"), + ("Peseta", "بيزيتا|بيسيتا"), + ( + "Netherlands guilder", + "فلورين|جلدر جزر الأنتيل|ang|جولدن هولندا|الغيلدر|الغيلدر|-الغيلدر|-الغيلدر|الغيلدر الهولندي|الغيلدر الهولندي|fl", + ), + ("Swazi lilangeni", "ليلانجيني سوازي|ليلانجيني|szl|إيمالانجيني"), + ("Tajikistani somoni", "السوموني الطاجيكي|tjs|السوموني"), + ("Diram", "درام|درم"), + ("Thai baht", "باهت تايلاندي|฿|thb|باهت"), + ("Satang", "ساتانغ|ساتانغ"), + ("Tongan paʻanga", "بانجا تونجا|بانجا|بانجا تونجا|باانجانج"), + ("Seniti", "سينيتي"), + ("Ukrainian hryvnia", "هريفنيا أوكرانية|هريفنيا|uah|₴|هريفنيا أوكرانيا|هريفنيا أوكرانيا|هريفنيا أوكرانية"), + ("Vanuatu vatu", "فانواتو فاتو|فاتو|فوف"), + ( + "Venezuelan bolívar", + "بوليفار فنزويلا|بوليفار فنزويلا|bs.f.|vef|بوليفار فويرتي|بوليفار فنزويلا|بوليفار فنزويلا|بوليفار فنزويلا|بوليفار فنزويلا|بوليفار فنزويلا|بوليفار فنزويلا|بوليفار فنزويلا", + ), + ("Vietnamese dong", "دونج فيتنام|vnd|دونج|دونج فيتنام|دونج فيتنام|دونج فيتنام"), + ("Zambian kwacha", "كواشا زامبيا|zk|zmw|كواشا زامبيا|كواشا|كواشا زامبيا"), + ("Moroccan dirham", "درهم مغربي|mad|د.م."), + ("United Arab Emirates dirham", "درهم الإمارات العربية المتحدة|د.إ|aed"), + ("Azerbaijani manat", "مانات أذربيجان|azn"), + ("Turkmenistan manat", "مانات تركمانستان|مانات تركمانستان الجديد|tmt"), + ("Manat", "مانات|مانات"), + ("Qəpik", "qəpik"), + ("Somali shilling", "شلن صومالي|شلن صومالي|شيلين صومالي|-شيلين صومالي|scellino|shilin|sh.so.|sos"), + ("Somaliland shilling", "شلن صوماليلاند|شلن صوماليلاند|سوماليلاند شيلين"), + ("Tanzanian shilling", "شلن تنزاني|شلن تنزاني|tsh|tzs|شلن تنزاني|شلن تنزاني"), + ("Ugandan shilling", "شلن أوغندي|شلن أوغندي|ugx|شلن أوغندي|شلن أوغندي"), + ("Romanian leu", "ليو الروماني|ليو|رون|ليو رومانيا"), + ("Moldovan leu", "ليو مولدوفا|mdl|ليو مولدوفا"), + ("Leu", "ليو"), + ("Ban", "بني|-حظر|حظر"), + ("Nepalese rupee", "روبية نيبالية|روبية نيبالية|npr"), + ("Pakistani rupee", "الروبية الباكستانية|الروبية الباكستانية|pkr"), + ("Indian rupee", "روبية هندية|روبية هندية|inr|₹|روبية هندية|روبية هندية"), + ("Seychellois rupee", "روبية سيشيلية|روبية سيشيلية|scr|sr|sre"), + ("Mauritian rupee", "روبية موريشيوسية|روبية موريشيوسية|مور"), + ("Maldivian rufiyaa", "روفية جزر المالديف|روفية جزر المالديف|mvr|.य|روفية جزر المالديف|روفية جزر المالديف"), + ("Sri Lankan rupee", "روبية سريلانكية|روبية سريلانكية|lkr|රු|ரூ"), + ("Indonesian rupiah", "الروبية الإندونيسية|الروبية|بيراك|RP|IDR"), + ("Rupee", "روبية|روبية|رس"), + ("Danish krone", "الكرونة الدنماركية|dkk|الكرونة الدنماركية|الكرونة الدنماركية|الكرونة الدنماركية"), + ("Norwegian krone", "كرونة نرويجية|نوك|كرونة نرويجية|كرونة نرويجية|كرونة نرويجية"), + ("Faroese króna", "الكرونا الفارويزية|الكرونا الفارويزية"), + ("Icelandic króna", "الكرونا الايسلندية|isk|الكرونا الايسلندية|الكرونا الايسلندية|الكرونا الايسلندية"), + ("Swedish krona", "كرونة سويدية|سيك|كرونا سويدية"), + ("Krone", "كرونة|كرونا|كرونا|كرونة|كرونات|kr|-kr"), + ("Øre", "أوري|أويرا|إيرير"), + ("West African CFA franc", "فرنك غرب أفريقيا|xof|فرنك غرب أفريقيا|فرنك غرب أفريقيا|فرنك غرب أفريقيا"), + ("Central African CFA franc", "فرنك وسط أفريقيا|xaf|فرنك وسط أفريقيا|فرنك وسط أفريقيا|فرنك وسط أفريقيا"), + ("Comorian franc", "فرنك جزر القمر|كمف"), + ("Congolese franc", "الفرنك الكونغولي|cdf"), + ("Burundian franc", "الفرنك البوروندي|bif"), + ("Djiboutian franc", "الفرنك الجيبوتي|djf"), + ("CFP franc", "فرنك CFP|xpf"), + ("Guinean franc", "الفرنك الغيني|gnf"), + ("Swiss franc", "فرنك سويسري|فرنك سويسري|فرنك سويسري|فرنك سويسري."), + ("Rwandan franc", "الفرنك الرواندي|rwf|rf|r₣|frw"), + ("Belgian franc", "الفرنك البلجيكي|bi.|b.fr.|bef|الفرنك البلجيكي"), + ("Rappen", "رابن|-رابين"), + ("Franc", "فرنك|فرنك|فرنك|fs"), + ("Centime", "سنتيم|سنتيم|سانتيم"), + ("Russian ruble", "روبل روسي|₽|فرك|روبل روسي|روسيا ₽|روسي ₽|روبل روسي|روبل روسي"), + ("New Belarusian ruble", "روبل بيلاروسي جديد|byn|روبل بيلاروسي جديد|روبل بيلاروسي جديد|روبل بيلاروسي جديد"), + ("Old Belarusian ruble", "روبل بيلاروسي قديم|بير|روبل بيلاروسي قديم|روبل بيلاروسي قديم|روبل بيلاروسي قديم"), + ("Transnistrian ruble", "روبل ترانسنيستريا|prb|Р."), + ("Belarusian ruble", "روبل بيلاروسي|روبل بيلاروسي|روبل بيلاروسيا|روبل بيلاروسي"), + ("Kopek", "كوبيك|كوبيك"), + ("Kapyeyka", "kapyeyka"), + ("Ruble", "rأوبلس|روبل|ر"), + ("Algerian dinar", "دينار جزائري|د.ج|dzd|دينار جزائري|دينار جزائري|دينار جزائري"), + ("Bahraini dinar", "دينار بحريني|دينار بحريني|bhd|.د.ب"), + ("Santeem", "سانتيم|سانتيم"), + ("Iraqi dinar", "دينار عراقي|دينار عراقي|دينار عراقي|دينار عراقي|iqd|ع.د"), + ("Jordanian dinar", "دينار أردني|دينار أردني|د.ا|جود|دينار أردني|دينار أردني"), + ("Kuwaiti dinar", "دينار كويتي|دينار كويتي|كود|د.ك"), + ("Libyan dinar", "دينار ليبي|دينار ليبي|دينار ليبي|دينار ليبي|ليد"), + ("Serbian dinar", "دينار صربي|دينار صربي|دين.|rsd|дин.|دينار صربيا|دينار صربيا"), + ("Tunisian dinar", "دينار تونسي|دينار تونسي|tnd|دينار تونسي|دينار تونسي"), + ("Yugoslav dinar", "دينار يوغوسلافي|دينار يوغوسلافي|يون"), + ("Dinar", "دينار|دينار|دينار|-دينار|-دينار"), + ("Fils", "فلس|فولوس|-فلس|-فيل"), + ("Para", "بارا|نابا"), + ("Millime", "مليم|مليم"), + ("Argentine peso", "بيزو أرجنتيني|ars|بيزو أرجنتيني|بيزو أرجنتيني|بيزو أرجنتيني"), + ("Chilean peso", "بيزو شيلي|بيزو تشيلي|clp|بيزو شيلي|بيزو تشيلي"), + ("Colombian peso", "البيزو الكولومبي|البيزو الكولومبي|شرطي|البيزو الكولومبي|البيزو الكولومبي"), + ( + "Cuban convertible peso", + "البيزو الكوبي القابل للتحويل|البيزو الكوبي القابل للتحويل|cuc|البيزو الكوبي القابل للتحويل|البيزو الكوبي القابل للتحويل", + ), + ("Cuban peso", "بيزو كوبي | بيزو كوبي | كوب | بيزو كوبا | بيزو كوبا"), + ("Dominican peso", "بيزو دومينيكي|بيزو دومينيكي|dop|بيزو دومينيكا|بيزو دومينيكا"), + ("Mexican peso", "البيزو المكسيكي|البيزو المكسيكي|mxn|البيزو المكسيكي|البيزو المكسيكي|mxn$|mxn $|mex$"), + ("Philippine peso", "بيزو|بيزو فلبيني|بيزو فلبيني|₱|php"), + ("Uruguayan peso", "بيزو أوروغواي|بيزو أوروغواي|uyu₱|php"), + ("Peso", "بيزو|بيزو"), + ("Centavo", "سنتافو|سنتافو"), + ("Alderney pound", "جنيه ألدرني|جنيه ألدرني|جنيه ألدرني"), + ( + "British pound", + "الجنيه البريطاني|الجنيه الاسترليني|الجنيه الاسترليني|الجنيه الاسترليني|الجنيه الاسترليني|الجنيه الاسترليني|الجنيه الاسترليني|الجنيه الاسكتلندي|الجنيه الاسكتلندي", + ), + ("Guernsey pound", "جنيه جيرنسي|جيرنسي جنيه استرليني|ggp"), + ("Ascension pound", "جنيه الصعود|جنيه الصعود|جنيه الصعود"), + ("Saint Helena pound", "جنيه سانت هيلينا|جنيه سانت هيلينا|جنيه سانت هيلينا جنيه استرليني|shp"), + ("Egyptian pound", "جنيه مصري|جنيه مصري|جنيه إسترليني|egp|ج.م|الجنيه المصري|جنيه مصري"), + ( + "Falkland Islands pound", + "جنيه جزر فوكلاند|جنيه جزر فوكلاند|جنيه جزر فوكلاند|جنيه استرليني|fkp|جنيه جزيرة فوكلاند|جنيه جزيرة فوكلاند|جنيه جزيرة فوكلاند", + ), + ("Gibraltar pound", "جنيه جبل طارق|جنيه جبل طارق|جنيه جبل طارق|gip"), + ("Manx pound", "جنيه مانكس|جنيه مانكس|جنيه مانكس|عفريت"), + ("Jersey pound", "جنيه جيرسي | جنيه جيرسي | جنيه إسترليني جيرسي | جيب"), + ( + "Lebanese pound", + "ليرة لبنانية|ليرة لبنانية|ليرة لبنانية|ليرة لبنانية|ليرة لبنانية|ليرة لبنانية|ليرة لبنانية|ل.ل", + ), + ( + "South Georgia and the South Sandwich Islands pound", + "جورجيا الجنوبية وجزر ساندويتش الجنوبية جنيه إسترليني|جورجيا الجنوبية وجزر ساندويتش الجنوبية جنيه إسترليني|جورجيا الجنوبية وجزر ساندويتش الجنوبية جنيه إسترليني", + ), + ( + "South Sudanese pound", + "جنيه جنوب السودان|جنيه جنوب السودان|جنيه جنوب السودان|ssp|جنيه جنوب السودان|جنيه جنوب السودان|جنيه جنوب السودان", + ), + ("Sudanese pound", "جنيه سوداني|جنيه سوداني|جنيه سوداني|ج.س.|sdg|جنيه سوداني|جنيه سوداني|جنيه سوداني"), + ("Syrian pound", "ليرة سورية|ليرة سورية|ليرة سورية|ل.س|syp|ليرة سورية|ليرة سورية|ليرة سورية"), + ("Tristan da Cunha pound", "جنيه تريستان دا كونيا|جنيه تريستان دا كونيا|جنيه تريستان دا كونيا"), + ("Pound", "جنيها|جنيه|جنيه|-جنيه|-جنيه|جنيه إسترليني"), + ("Pence", "قرشا|بِنْس|بنس"), + ("Shilling", "شلن|شلن|شيلنجي|ش"), + ("Penny", "بينس|بيني"), + ( + "United States dollar", + "دولارات الولايات المتحدة|دولار الولايات المتحدة|الولايات المتحدة $|الولايات المتحدة. دولار|الولايات المتحدة. دولار|دولار أمريكي|دولار أمريكي|USD|دولار أمريكي|دولار أمريكي|دولار أمريكي|دولار أمريكي|دولار أمريكي|دولار أمريكي|دولار أمريكي|USD$", + ), + ("East Caribbean dollar", "دولار شرق الكاريبي|دولار شرق الكاريبي|دولار شرق الكاريبي $|xcd"), + ( + "Australian dollar", + "دولار أسترالي|دولار أسترالي|دولار أسترالي|أسترالي$|AUD|دولار أسترالي|دولار أسترالي|أسترالي $|أسترالي$", + ), + ( + "Bahamian dollar", + "دولار بهامي|دولار بهامي|دولار بهامي $|دولار بهامي$|bsd|دولار بهامي|دولار بهامي|باهامي $|باهامي$", + ), + ("Barbadian dollar", "دولار بربادوسي|دولار بربادوسي|دولار بربادوسي|bbd"), + ("Belize dollar", "دولار بليز|دولار بليز|دولار بليز|bzd"), + ( + "Bermudian dollar", + "دولار برمودي|دولار برمودي|دولار برمودي|دولار برمودي|دولار برمودي|دولار برمودي|دولار برمودي", + ), + ( + "British Virgin Islands dollar", + "دولار جزر فيرجن البريطانية|دولار جزر فيرجن البريطانية|جزر فيرجن البريطانية $|bvi$|دولار جزر فيرجن|دولار جزر فيرجن|جزر فيرجن $|دولار جزر فيرجن|دولار جزيرة فيرجن|دولار جزيرة فيرجن $", + ), + ("Brunei dollar", "دولار بروناي|دولار بروناي $|مليار دولار"), + ("Sen", "سين"), + ("Singapore dollar", "دولار سنغافوري|دولار سنغافوري|دولار سنغافوري $|s$|sgd"), + ( + "Canadian dollar", + "دولارًا كنديًا|دولار كندي|دولار كندي|دولار كندي|دولار كندي|can$|c$|دولار كندي|دولار كندي|كندا$", + ), + ( + "Cayman Islands dollar", + "دولار جزر كايمان|دولار جزر كايمان|جزر كايمان $|kyd|ci$|دولار جزر كايمان|دولارات جزر كايمان|دولار جزر كايمان $", + ), + ("New Zealand dollar", "دولار نيوزيلندي|دولار نيوزيلندي|نيوزيلندا $|nz$|nzd|كيوي"), + ("Cook Islands dollar", "دولار جزر كوك|دولار جزر كوك|جزر كوك $|دولار جزر كوك|دولار جزيرة كوك|جزيرة كوك $"), + ("Fijian dollar", "دولار فيجي|دولار فيجي|دولار فيجي|دولار فيجي|دولار فيجي|دولار فيجي|دولار فيجي"), + ("Guyanese dollar", "دولار جوياني|دولار جوياني|gyd|gy$"), + ( + "Hong Kong dollar", + "دولار هونج كونج|دولار هونج كونج|دولار هونج كونج|$hk$|hkd|دولار هونج كونج|دولار هونج كونج|دولار هونج كونج|دولار هونج كونج|دولار هونج كونج", + ), + ( + "Jamaican dollar", + "دولار جامايكي|دولار جامايكي|دولار جامايكي|j$|دولار جامايكي|دولار جامايكي|جامايكا $|JMD", + ), + ("Kiribati dollar", "دولار كيريباتي|دولار كيريباتي|دولار كيريباتي"), + ( + "Liberian dollar", + "دولار ليبيري|دولار ليبيري|دولار ليبيري|دولار ليبيري|دولار ليبيري|ليبيري $|ليرة لبنانية", + ), + ("Micronesian dollar", "دولار ميكرونيزي | دولار ميكرونيزي | دولار ميكرونيزي"), + ("Namibian dollar", "دولار ناميبي|دولار ناميبي|دولار ناميبي|ناد|n$|دولار ناميبي|دولار ناميبي|ناميبيا $"), + ("Nauruan dollar", "دولار ناورو|دولار ناورو|دولار ناورو"), + ("Niue dollar", "دولار نيوي|دولار نيوي|دولار نيوي"), + ("Palauan dollar", "دولار بالاو | دولار بالاو | دولار بالاو"), + ( + "Pitcairn Islands dollar", + "دولارات جزر بيتكيرن|دولار جزر بيتكيرن|دولارات جزر بيتكيرن $|دولار جزيرة بيتكيرن|دولار جزيرة بيتكيرن|دولار جزيرة بيتكيرن $", + ), + ( + "Solomon Islands dollar", + "دولار جزر سليمان|دولار جزر سليمان|جزر سليمان $|si$|sbd|دولار جزر سليمان|دولار جزيرة سليمان|جزر سليمان $", + ), + ("Surinamese dollar", "دولار سورينام|دولار سورينامي|دولار سورينام|srd"), + ("New Taiwan dollar", "دولار تايواني جديد|دولار تايواني جديد|nt$|twd|ntd"), + ( + "Trinidad and Tobago dollar", + "دولار ترينداد وتوباغو|دولار ترينداد وتوباغو|دولار ترينداد وتوباغو $|ترينداد $|دولار ترينداد|دولار ترينداد|دولار ترينيدادي|دولار ترينيدادي|دولار ترينيدادي $|ttd", + ), + ("Tuvaluan dollar", "دولار توفالو|دولار توفالو|دولار توفالو"), + ("Dollar", "دولارًا|دولارات|الدولارات|دولار|دولار|$"), + ("Chinese yuan", "يوان|كواي|يوان صيني|رنمينبي|cny|رنمينبي|¥|元"), + ("Fen", "الفين"), + ("Jiao", "جياو|ماو"), + ("Finnish markka", "سومن ماركا|ماركا الفنلندية|فينسك مارك|فيم|ماركا|ماركا"), + ("Penni", "بينيا|بيني"), + ("Bitcoin", "بيتكوين|بيتكوينز|btc|xbt|₿"), + ("Millibitcoin", "ميلي بيتكوين| ميلي بيتكوين | ميلي بيتكوين | ميلي بيتكوين"), + ("Satoshi", "ساتوشي|ساتوشي"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afghan afghani", "AFN"), + ("Euro", "EUR"), + ("Albanian lek", "ALL"), + ("Angolan kwanza", "AOA"), + ("Armenian dram", "AMD"), + ("Aruban florin", "AWG"), + ("Bangladeshi taka", "BDT"), + ("Bhutanese ngultrum", "BTN"), + ("Bolivian boliviano", "BOB"), + ("Bosnia and Herzegovina convertible mark", "BAM"), + ("Botswana pula", "BWP"), + ("Brazilian real", "BRL"), + ("Bulgarian lev", "BGN"), + ("Cambodian riel", "KHR"), + ("Cape Verdean escudo", "CVE"), + ("Costa Rican colón", "CRC"), + ("Croatian kuna", "HRK"), + ("Czech koruna", "CZK"), + ("Eritrean nakfa", "ERN"), + ("Ethiopian birr", "ETB"), + ("Gambian dalasi", "GMD"), + ("Georgian lari", "GEL"), + ("Ghanaian cedi", "GHS"), + ("Guatemalan quetzal", "GTQ"), + ("Haitian gourde", "HTG"), + ("Honduran lempira", "HNL"), + ("Hungarian forint", "HUF"), + ("Iranian rial", "IRR"), + ("Yemeni rial", "YER"), + ("Israeli new shekel", "ILS"), + ("Japanese yen", "JPY"), + ("Kazakhstani tenge", "KZT"), + ("Kenyan shilling", "KES"), + ("North Korean won", "KPW"), + ("South Korean won", "KRW"), + ("Kyrgyzstani som", "KGS"), + ("Lao kip", "LAK"), + ("Lesotho loti", "LSL"), + ("South African rand", "ZAR"), + ("Macanese pataca", "MOP"), + ("Macedonian denar", "MKD"), + ("Malagasy ariary", "MGA"), + ("Malawian kwacha", "MWK"), + ("Malaysian ringgit", "MYR"), + ("Mauritanian ouguiya", "MRO"), + ("Mongolian tögrög", "MNT"), + ("Mozambican metical", "MZN"), + ("Burmese kyat", "MMK"), + ("Nicaraguan córdoba", "NIO"), + ("Nigerian naira", "NGN"), + ("Turkish lira", "TRY"), + ("Omani rial", "OMR"), + ("Panamanian balboa", "PAB"), + ("Papua New Guinean kina", "PGK"), + ("Paraguayan guaraní", "PYG"), + ("Peruvian sol", "PEN"), + ("Polish złoty", "PLN"), + ("Qatari riyal", "QAR"), + ("Saudi riyal", "SAR"), + ("Samoan tālā", "WST"), + ("São Tomé and Príncipe dobra", "STN"), + ("Sierra Leonean leone", "SLL"), + ("Swazi lilangeni", "SZL"), + ("Tajikistani somoni", "TJS"), + ("Thai baht", "THB"), + ("Ukrainian hryvnia", "UAH"), + ("Vanuatu vatu", "VUV"), + ("Venezuelan bolívar", "VEF"), + ("Zambian kwacha", "ZMW"), + ("Moroccan dirham", "MAD"), + ("United Arab Emirates dirham", "AED"), + ("Azerbaijani manat", "AZN"), + ("Turkmenistan manat", "TMT"), + ("Somali shilling", "SOS"), + ("Tanzanian shilling", "TZS"), + ("Ugandan shilling", "UGX"), + ("Romanian leu", "RON"), + ("Moldovan leu", "MDL"), + ("Nepalese rupee", "NPR"), + ("Pakistani rupee", "PKR"), + ("Indian rupee", "INR"), + ("Seychellois rupee", "SCR"), + ("Mauritian rupee", "MUR"), + ("Maldivian rufiyaa", "MVR"), + ("Sri Lankan rupee", "LKR"), + ("Indonesian rupiah", "IDR"), + ("Danish krone", "DKK"), + ("Norwegian krone", "NOK"), + ("Icelandic króna", "ISK"), + ("Swedish krona", "SEK"), + ("West African CFA franc", "XOF"), + ("Central African CFA franc", "XAF"), + ("Comorian franc", "KMF"), + ("Congolese franc", "CDF"), + ("Burundian franc", "BIF"), + ("Djiboutian franc", "DJF"), + ("CFP franc", "XPF"), + ("Guinean franc", "GNF"), + ("Swiss franc", "CHF"), + ("Franc", "CHF"), + ("Rwandan franc", "RWF"), + ("Russian ruble", "RUB"), + ("Transnistrian ruble", "PRB"), + ("New Belarusian ruble", "BYN"), + ("Algerian dinar", "DZD"), + ("Bahraini dinar", "BHD"), + ("Iraqi dinar", "IQD"), + ("Jordanian dinar", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Libyan dinar", "LYD"), + ("Serbian dinar", "RSD"), + ("Tunisian dinar", "TND"), + ("Argentine peso", "ARS"), + ("Chilean peso", "CLP"), + ("Colombian peso", "COP"), + ("Cuban convertible peso", "CUC"), + ("Cuban peso", "CUP"), + ("Dominican peso", "DOP"), + ("Mexican peso", "MXN"), + ("Uruguayan peso", "UYU"), + ("British pound", "GBP"), + ("Saint Helena pound", "SHP"), + ("Egyptian pound", "EGP"), + ("Falkland Islands pound", "FKP"), + ("Gibraltar pound", "GIP"), + ("Manx pound", "IMP"), + ("Jersey pound", "JEP"), + ("Lebanese pound", "LBP"), + ("South Sudanese pound", "SSP"), + ("Sudanese pound", "SDG"), + ("Syrian pound", "SYP"), + ("United States dollar", "USD"), + ("Australian dollar", "AUD"), + ("Bahamian dollar", "BSD"), + ("Barbadian dollar", "BBD"), + ("Belize dollar", "BZD"), + ("Bermudian dollar", "BMD"), + ("Brunei dollar", "BND"), + ("Singapore dollar", "SGD"), + ("Canadian dollar", "CAD"), + ("Cayman Islands dollar", "KYD"), + ("New Zealand dollar", "NZD"), + ("Fijian dollar", "FJD"), + ("Guyanese dollar", "GYD"), + ("Hong Kong dollar", "HKD"), + ("Jamaican dollar", "JMD"), + ("Liberian dollar", "LRD"), + ("Namibian dollar", "NAD"), + ("Solomon Islands dollar", "SBD"), + ("Surinamese dollar", "SRD"), + ("New Taiwan dollar", "TWD"), + ("Trinidad and Tobago dollar", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Chinese yuan", "CNY"), + ("Rial", "__RI"), + ("Shiling", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dollar", "__D"), + ("Manat", "__MA"), + ("Rupee", "__R"), + ("Krone", "__K"), + ("Krona", "__K"), + ("Crown", "__K"), + ("Frank", "__F"), + ("Mark", "__M"), + ("Ruble", "__RB"), + ("Peso", "__PE"), + ("Pound", "__P"), + ("Tristan da Cunha pound", "_TP"), + ("South Georgia and the South Sandwich Islands pound", "_SP"), + ("Somaliland shilling", "_SS"), + ("Pitcairn Islands dollar", "_PND"), + ("Palauan dollar", "_PD"), + ("Niue dollar", "_NID"), + ("Nauruan dollar", "_ND"), + ("Micronesian dollar", "_MD"), + ("Kiribati dollar", "_KID"), + ("Guernsey pound", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dollar", "_CKD"), + ("British Virgin Islands dollar", "_BD"), + ("Ascension pound", "_AP"), + ("Alderney pound", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarkë", "QINDARKE"), + ("Penny", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENTAVO"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENTIMO"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '(?ًا و|أيضا|واو العطف|و)' + MultiplierRegex = '\\s*\\b(ألف|مليون|مليار|تريليون)s?\\b' + CurrencyPrefixList = dict( + [ + ("Dobra", "ديسيبل | الأمراض المنقولة جنسيا"), + ("Dollar", "$"), + ("Brazilian Real", "ريال $"), + ("United States dollar", "الولايات المتحدة $|us$|us $|u.s. $|u.s $|usd$"), + ("East Caribbean dollar", "شرق الكاريبي $"), + ("Mexican peso", "mxn$|mxn $|mex$"), + ("Australian dollar", "أسترالي $|أستراليا $"), + ("Bahamian dollar", "الباهامية $|البهامية $"), + ("Barbadian dollar", "بربادوسي $|بربادين $"), + ("Belize dollar", "بليز $"), + ("Bermudian dollar", "برمودي $"), + ( + "British Virgin Islands dollar", + "جزر فيرجن البريطانية $|bvi$|جزر فيرجن $|جزيرة فيرجن $|جزيرة فيرجن البريطانية $", + ), + ("Brunei dollar", "بروناي $|ب$"), + ("Sen", "سين"), + ("Singapore dollar", "سنغافورة $|s$"), + ("Canadian dollar", "الكندي $|can$|c$|c $|canada $"), + ("Cayman Islands dollar", "جزر كايمان $|ci$|جزيرة كايمان $"), + ("New Zealand dollar", "نيوزيلندا $|nz$|nz $"), + ("Cook Islands dollar", "جزر كوك $|جزيرة كوك $"), + ("Fijian dollar", "فيجي $|فيجي $"), + ("Guyanese dollar", "gy$|gy $|g$|g $"), + ("Hong Kong dollar", "هونج كونج $|هونج كونج$|هكد|هونج كونج $"), + ("Indian rupee", "₹"), + ("Jamaican dollar", "الجامايكي $|j$|جامايكا $"), + ("Kiribati dollar", "كيريباتي $"), + ("Liberian dollar", "ليبيريا $|ليبيريا $"), + ("Micronesian dollar", "ميكرونيزيا $"), + ("Namibian dollar", "الناميبي $|nad|n$|ناميبيا $"), + ("Nauruan dollar", "ناورو $"), + ("Niue dollar", "نيو $"), + ("Palauan dollar", "بالاو $"), + ("Pitcairn Islands dollar", "جزر بيتكيرن $|جزيرة بيتكيرن $"), + ("Solomon Islands dollar", "جزر سليمان $|si$|si $|جزيرة سليمان $"), + ("Surinamese dollar", "سورينام $|سورينام $"), + ("New Taiwan dollar", "NT$|نت $"), + ("Trinidad and Tobago dollar", "ترينيداد وتوباغو $|ترينيداد $|ترينيداد $"), + ("Tuvaluan dollar", "توفالو $"), + ("Samoan tālā", "ws$"), + ("Chinese yuan", "¥"), + ("Japanese yen", "¥"), + ("Euro", "€"), + ("Pound", "£"), + ("Costa Rican colón", "₡"), + ("Turkish lira", "₺"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) + AmbiguousCurrencyUnitList = [ + r'din.', + r'kiwi', + r'kina', + r'kobo', + r'lari', + r'lipa', + r'napa', + r'para', + r'sfr.', + r'taka', + r'tala', + r'toea', + r'vatu', + r'yuan', + r'all', + r'ang', + r'ban', + r'bob', + r'btn', + r'byr', + r'cad', + r'cop', + r'cup', + r'dop', + r'gip', + r'jod', + r'kgs', + r'lak', + r'lei', + r'mga', + r'mop', + r'nad', + r'omr', + r'pul', + r'sar', + r'sbd', + r'scr', + r'sdg', + r'sek', + r'sen', + r'sol', + r'sos', + r'std', + r'try', + r'yer', + r'yen', + r'db', + r'pen', + r'ron', + r'mad', + r'zar', + r'gel', + r'satoshi', + r'satoshis', + ] + BuildPrefix = '(?<=(\\s|^))' + BuildSuffix = '(?=(\\s|\\W|$))' + + +# pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/base_currency.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/base_currency.py index dee24918b8..b7b4d691f8 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/base_currency.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/base_currency.py @@ -13,259 +13,275 @@ class BaseCurrency: - CurrencyFractionMapping = dict([("CNY", "FEN|JIAO"), - ("__D", "CENT"), - ("RUB", "KOPEK"), - ("AFN", "PUL"), - ("EUR", "CENT|KWARTJE|DUBBELTJE|STUIVER"), - ("ALL", "QINDARKE"), - ("_ALP", "PENNY"), - ("GBP", "PENNY"), - ("_GGP", "PENNY"), - ("DZD", "SANTEEM"), - ("AOA", "CENTIMO"), - ("ARS", "CENTAVO"), - ("AMD", "LUMA"), - ("AWG", "CENT"), - ("_AP", "PENNY"), - ("SHP", "PENNY"), - ("AUD", "CENT"), - ("AZN", "QƏPIK"), - ("BSD", "CENT"), - ("BHD", "FILS"), - ("BDT", "POISHA"), - ("BBD", "CENT"), - ("BYN", "KAPYEYKA"), - ("BZD", "CENT"), - ("XOF", "CENTIME"), - ("BMD", "CENT"), - ("BTN", "CHETRUM"), - ("INR", "PAISA"), - ("BOB", "CENTAVO"), - ("USD", "CENT"), - ("BAM", "FENING"), - ("BWP", "THEBE"), - ("BRL", "CENTAVO"), - ("_BD", "CENT"), - ("BND", "SEN"), - ("SGD", "CENT"), - ("BGN", "STOTINKA"), - ("BIF", "CENTIME"), - ("KHR", "SEN"), - ("XAF", "CENTIME"), - ("CAD", "CENT"), - ("CVE", "CENTAVO"), - ("KYD", "CENT"), - ("CLP", "CENTAVO"), - ("COP", "CENTAVO"), - ("KMF", "CENTIME"), - ("CDF", "CENTIME"), - ("NZD", "CENT"), - ("_CKD", "CENT"), - ("CRC", "CENTIMO"), - ("HRK", "LIPA"), - ("CUC", "CENTAVO"), - ("CUP", "CENTAVO"), - ("CZK", "HALER"), - ("DKK", "ØRE"), - ("DJF", "CENTIME"), - ("DOP", "CENTAVO"), - ("EGP", "PIASTRE"), - ("ERN", "CENT"), - ("ETB", "SANTIM"), - ("FKP", "PENNY"), - ("_FOK", "OYRA"), - ("FJD", "CENT"), - ("XPF", "CENTIME"), - ("GMD", "BUTUT"), - ("GEL", "TETRI"), - ("GHS", "PESEWA"), - ("GIP", "PENNY"), - ("GTQ", "CENTAVO"), - ("GNF", "CENTIME"), - ("GYD", "CENT"), - ("HTG", "CENTIME"), - ("HNL", "CENTAVO"), - ("HKD", "CENT"), - ("HUF", "FILLER"), - ("ISK", "EYRIR"), - ("IDR", "SEN"), - ("IRR", "DINAR"), - ("IQD", "FILS"), - ("IMP", "PENNY"), - ("ILS", "AGORA"), - ("JMD", "CENT"), - ("JPY", "SEN"), - ("JEP", "PENNY"), - ("JOD", "PIASTRE"), - ("KZT", "TIIN"), - ("KES", "CENT"), - ("_KID", "CENT"), - ("KPW", "CHON"), - ("KRW", "JEON"), - ("KWD", "FILS"), - ("KGS", "TYIYN"), - ("LAK", "ATT"), - ("LBP", "PIASTRE"), - ("LSL", "SENTE"), - ("ZAR", "CENT"), - ("LRD", "CENT"), - ("LYD", "DIRHAM"), - ("CHF", "RAPPEN"), - ("MOP", "AVO"), - ("MKD", "DENI"), - ("MGA", "IRAIMBILANJA"), - ("MWK", "TAMBALA"), - ("MYR", "SEN"), - ("MVR", "LAARI"), - ("MRO", "KHOUMS"), - ("MUR", "CENT"), - ("MXN", "CENTAVO"), - ("_MD", "CENT"), - ("MDL", "BAN"), - ("MNT", "MONGO"), - ("MAD", "CENTIME"), - ("MZN", "CENTAVO"), - ("MMK", "PYA"), - ("NAD", "CENT"), - ("_ND", "CENT"), - ("NPR", "PAISA"), - ("NIO", "CENTAVO"), - ("NGN", "KOBO"), - ("_NID", "CENT"), - ("TRY", "KURUS"), - ("NOK", "ØRE"), - ("OMR", "BAISA"), - ("PKR", "PAISA"), - ("_PD", "CENT"), - ("PAB", "CENTESIMO"), - ("PGK", "TOEA"), - ("PYG", "CENTIMO"), - ("PEN", "CENTIMO"), - ("_PND", "CENT"), - ("PLN", "GROSZ"), - ("QAR", "DIRHAM"), - ("RON", "BAN"), - ("RWF", "CENTIME"), - ("WST", "SENE"), - ("STD", "CENTIMO"), - ("SAR", "HALALA"), - ("RSD", "PARA"), - ("SCR", "CENT"), - ("SLL", "CENT"), - ("SBD", "CENT"), - ("SOS", "CENT"), - ("_SS", "CENT"), - ("_SP", "PENNY"), - ("SSP", "PIASTRE"), - ("LKR", "CENT"), - ("SDG", "PIASTRE"), - ("SRD", "CENT"), - ("SZL", "CENT"), - ("SEK", "ORE"), - ("SYP", "PIASTRE"), - ("TWD", "CENT"), - ("TJS", "DIRAM"), - ("TZS", "CENT"), - ("THB", "SATANG"), - ("PRB", "KOPEK"), - ("TTD", "CENT"), - ("_TP", "PENNY"), - ("TND", "MILLIME"), - ("TMT", "TENNESI"), - ("TVD", "CENT"), - ("UGX", "CENT"), - ("UAH", "KOPIYKA"), - ("AED", "FILS"), - ("UYU", "CENTESIMO"), - ("VEF", "CENTIMO"), - ("YER", "FILS"), - ("ZMW", "NGWEE"), - ("_XBT", "MILLIBITCOIN|SATOSHI")]) - CurrencyFractionalRatios = dict([("Kopek", 100), - ("Pul", 100), - ("Cent", 100), - ("Qindarkë", 100), - ("Penny", 100), - ("Santeem", 100), - ("Cêntimo", 100), - ("Centavo", 100), - ("Luma", 100), - ("Qəpik", 100), - ("Fils", 1000), - ("Poisha", 100), - ("Kapyeyka", 100), - ("Centime", 100), - ("Chetrum", 100), - ("Paisa", 100), - ("Fening", 100), - ("Thebe", 100), - ("Sen", 100), - ("Stotinka", 100), - ("Jiao", 10), - ("Fen", 100), - ("Céntimo", 100), - ("Lipa", 100), - ("Haléř", 100), - ("Øre", 100), - ("Piastre", 100), - ("Santim", 100), - ("Oyra", 100), - ("Butut", 100), - ("Tetri", 100), - ("Pesewa", 100), - ("Fillér", 100), - ("Eyrir", 100), - ("Dinar", 100), - ("Agora", 100), - ("Tïın", 100), - ("Chon", 100), - ("Jeon", 100), - ("Tyiyn", 100), - ("Att", 100), - ("Sente", 100), - ("Dirham", 1000), - ("Rappen", 100), - ("Avo", 100), - ("Deni", 100), - ("Iraimbilanja", 5), - ("Tambala", 100), - ("Laari", 100), - ("Khoums", 5), - ("Ban", 100), - ("Möngö", 100), - ("Pya", 100), - ("Kobo", 100), - ("Kuruş", 100), - ("Baisa", 1000), - ("Centésimo", 100), - ("Toea", 100), - ("Sentimo", 100), - ("Grosz", 100), - ("Sene", 100), - ("Halala", 100), - ("Para", 100), - ("Öre", 100), - ("Diram", 100), - ("Satang", 100), - ("Seniti", 100), - ("Millime", 1000), - ("Tennesi", 100), - ("Kopiyka", 100), - ("Tiyin", 100), - ("Hào", 10), - ("Ngwee", 100), - ("Kwartje", 4), - ("Dubbeltje", 10), - ("Stuiver", 20), - ("Millibitcoin", 1000), - ("Satoshi", 100000000)]) - NonStandardFractionalSubunits = dict([("JOD", 1000), - ("KWD", 1000), - ("BHD", 1000), - ("OMR", 1000), - ("YDD", 1000), - ("TND", 1000), - ("MRO", 5), - ("_XBT", 1000)]) + CurrencyFractionMapping = dict( + [ + ("CNY", "FEN|JIAO"), + ("__D", "CENT"), + ("RUB", "KOPEK"), + ("AFN", "PUL"), + ("EUR", "CENT|KWARTJE|DUBBELTJE|STUIVER"), + ("ALL", "QINDARKE"), + ("_ALP", "PENNY|PENCE"), + ("GBP", "PENNY|PENCE"), + ("_GGP", "PENNY|PENCE"), + ("DZD", "SANTEEM"), + ("AOA", "CENTIMO"), + ("ARS", "CENTAVO"), + ("AMD", "LUMA"), + ("AWG", "CENT"), + ("_AP", "PENNY|PENCE"), + ("SHP", "PENNY|PENCE"), + ("AUD", "CENT"), + ("AZN", "QƏPIK"), + ("BSD", "CENT"), + ("BHD", "FILS"), + ("BDT", "POISHA"), + ("BBD", "CENT"), + ("BYN", "KAPYEYKA"), + ("BZD", "CENT"), + ("XOF", "CENTIME"), + ("BMD", "CENT"), + ("BTN", "CHETRUM"), + ("INR", "PAISA"), + ("BOB", "CENTAVO"), + ("USD", "CENT"), + ("BAM", "FENING"), + ("BWP", "THEBE"), + ("BRL", "CENTAVO"), + ("_BD", "CENT"), + ("BND", "SEN"), + ("SGD", "CENT"), + ("BGN", "STOTINKA"), + ("BIF", "CENTIME"), + ("KHR", "SEN"), + ("XAF", "CENTIME"), + ("CAD", "CENT"), + ("CVE", "CENTAVO"), + ("KYD", "CENT"), + ("CLP", "CENTAVO"), + ("COP", "CENTAVO"), + ("KMF", "CENTIME"), + ("CDF", "CENTIME"), + ("NZD", "CENT"), + ("_CKD", "CENT"), + ("CRC", "CENTIMO"), + ("HRK", "LIPA"), + ("CUC", "CENTAVO"), + ("CUP", "CENTAVO"), + ("CZK", "HALER"), + ("DKK", "ØRE"), + ("DJF", "CENTIME"), + ("DOP", "CENTAVO"), + ("EGP", "PIASTRE"), + ("ERN", "CENT"), + ("ETB", "SANTIM"), + ("FKP", "PENNY|PENCE"), + ("_FOK", "OYRA"), + ("FJD", "CENT"), + ("XPF", "CENTIME"), + ("GMD", "BUTUT"), + ("GEL", "TETRI"), + ("GHS", "PESEWA"), + ("GIP", "PENNY|PENCE"), + ("GTQ", "CENTAVO"), + ("GNF", "CENTIME"), + ("GYD", "CENT"), + ("HTG", "CENTIME"), + ("HNL", "CENTAVO"), + ("HKD", "CENT"), + ("HUF", "FILLER"), + ("ISK", "EYRIR"), + ("IDR", "SEN"), + ("IRR", "DINAR"), + ("IQD", "FILS"), + ("IMP", "PENNY|PENCE"), + ("ILS", "AGORA"), + ("JMD", "CENT"), + ("JPY", "SEN"), + ("JEP", "PENNY|PENCE"), + ("JOD", "PIASTRE"), + ("KZT", "TIIN"), + ("KES", "CENT"), + ("_KID", "CENT"), + ("KPW", "CHON"), + ("KRW", "JEON"), + ("KWD", "FILS"), + ("KGS", "TYIYN"), + ("LAK", "ATT"), + ("LBP", "PIASTRE"), + ("LSL", "SENTE"), + ("ZAR", "CENT"), + ("LRD", "CENT"), + ("LYD", "DIRHAM"), + ("CHF", "RAPPEN"), + ("MOP", "AVO"), + ("MKD", "DENI"), + ("MGA", "IRAIMBILANJA"), + ("MWK", "TAMBALA"), + ("MYR", "SEN"), + ("MVR", "LAARI"), + ("MRO", "KHOUMS"), + ("MUR", "CENT"), + ("MXN", "CENTAVO"), + ("_MD", "CENT"), + ("MDL", "BAN"), + ("MNT", "MONGO"), + ("MAD", "CENTIME"), + ("MZN", "CENTAVO"), + ("MMK", "PYA"), + ("NAD", "CENT"), + ("_ND", "CENT"), + ("NPR", "PAISA"), + ("NIO", "CENTAVO"), + ("NGN", "KOBO"), + ("_NID", "CENT"), + ("TRY", "KURUS"), + ("NOK", "ØRE"), + ("OMR", "BAISA"), + ("PKR", "PAISA"), + ("_PD", "CENT"), + ("PAB", "CENTESIMO"), + ("PGK", "TOEA"), + ("PYG", "CENTIMO"), + ("PEN", "CENTIMO"), + ("_PND", "CENT"), + ("PLN", "GROSZ"), + ("QAR", "DIRHAM"), + ("RON", "BAN"), + ("RWF", "CENTIME"), + ("WST", "SENE"), + ("STD", "CENTIMO"), + ("SAR", "HALALA"), + ("RSD", "PARA"), + ("SCR", "CENT"), + ("SLL", "CENT"), + ("SBD", "CENT"), + ("SOS", "CENT"), + ("_SS", "CENT"), + ("_SP", "PENNY|PENCE"), + ("SSP", "PIASTRE"), + ("LKR", "CENT"), + ("SDG", "PIASTRE"), + ("SRD", "CENT"), + ("SZL", "CENT"), + ("SEK", "ORE"), + ("SYP", "PIASTRE"), + ("TWD", "CENT"), + ("TJS", "DIRAM"), + ("TZS", "CENT"), + ("THB", "SATANG"), + ("PRB", "KOPEK"), + ("TTD", "CENT"), + ("_TP", "PENNY|PENCE"), + ("TND", "MILLIME"), + ("TMT", "TENNESI"), + ("TVD", "CENT"), + ("UGX", "CENT"), + ("UAH", "KOPIYKA"), + ("AED", "FILS"), + ("UYU", "CENTESIMO"), + ("VEF", "CENTIMO"), + ("YER", "FILS"), + ("ZMW", "NGWEE"), + ("_XBT", "MILLIBITCOIN|SATOSHI"), + ] + ) + CurrencyFractionalRatios = dict( + [ + ("Kopek", 100), + ("Pul", 100), + ("Cent", 100), + ("Qindarkë", 100), + ("Penny", 100), + ("Pence", 100), + ("Santeem", 100), + ("Cêntimo", 100), + ("Centavo", 100), + ("Cèntim", 100), + ("Luma", 100), + ("Qəpik", 100), + ("Fils", 1000), + ("Poisha", 100), + ("Kapyeyka", 100), + ("Centime", 100), + ("Chetrum", 100), + ("Paisa", 100), + ("Fening", 100), + ("Thebe", 100), + ("Sen", 100), + ("Stotinka", 100), + ("Jiao", 10), + ("Fen", 100), + ("Céntimo", 100), + ("Lipa", 100), + ("Haléř", 100), + ("Øre", 100), + ("Piastre", 100), + ("Santim", 100), + ("Oyra", 100), + ("Butut", 100), + ("Tetri", 100), + ("Pesewa", 100), + ("Fillér", 100), + ("Eyrir", 100), + ("Dinar", 100), + ("Agora", 100), + ("Tïın", 100), + ("Chon", 100), + ("Jeon", 100), + ("Tyiyn", 100), + ("Att", 100), + ("Sente", 100), + ("Dirham", 1000), + ("Rappen", 100), + ("Avo", 100), + ("Deni", 100), + ("Iraimbilanja", 5), + ("Tambala", 100), + ("Laari", 100), + ("Khoums", 5), + ("Ban", 100), + ("Möngö", 100), + ("Pya", 100), + ("Kobo", 100), + ("Kuruş", 100), + ("Baisa", 1000), + ("Centésimo", 100), + ("Toea", 100), + ("Sentimo", 100), + ("Grosz", 100), + ("Sene", 100), + ("Halala", 100), + ("Para", 100), + ("Öre", 100), + ("Diram", 100), + ("Satang", 100), + ("Seniti", 100), + ("Millime", 1000), + ("Tennesi", 100), + ("Kopiyka", 100), + ("Tiyin", 100), + ("Hào", 10), + ("Ngwee", 100), + ("Kwartje", 4), + ("Dubbeltje", 10), + ("Stuiver", 20), + ("Millibitcoin", 1000), + ("Satoshi", 100000000), + ] + ) + NonStandardFractionalSubunits = dict( + [ + ("JOD", 1000), + ("KWD", 1000), + ("BHD", 1000), + ("OMR", 1000), + ("YDD", 1000), + ("TND", 1000), + ("MRO", 5), + ("_XBT", 1000), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/base_numbers.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/base_numbers.py index 7d7d25186f..240f032d4b 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/base_numbers.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/base_numbers.py @@ -18,15 +18,21 @@ class BaseNumbers: def IntegerRegexDefinition(placeholder, thousandsmark): return f'(((?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?' - MinuteRegex = f'(?00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|0|1|2|3|4|5|6|7|8|9)(?!\\d)' - SecondRegex = f'(?00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|0|1|2|3|4|5|6|7|8|9)' + HourRegex = ( + '(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?' + ) + MinuteRegex = '(?00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|0|1|2|3|4|5|6|7|8|9)(?!\\d)' + SecondRegex = '(?00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|0|1|2|3|4|5|6|7|8|9)' PmNonUnitRegex = f'({HourRegex}\\s*:\\s*{MinuteRegex}(\\s*:\\s*{SecondRegex})?\\s*pm)' AmbiguousTimeTerm = 'pm' - AmbiguousUnitNumberMultiplierRegex = f'(\\s([Kk]|mil))' - SingleCharUnitRegex = f'^\\b(c|f|g|k|l|m|s)(\\s*\\.|\\b)$' + AmbiguousUnitNumberMultiplierRegex = '(\\s([Kk]|mil))' + SingleCharUnitRegex = '^\\b(c|f|g|k|l|m|s)(\\s*\\.|\\b)$' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/catalan_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/catalan_numeric_with_unit.py new file mode 100644 index 0000000000..fb0001fc5d --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/catalan_numeric_with_unit.py @@ -0,0 +1,650 @@ +# pylint: disable=line-too-long + + +class CatalanNumericWithUnit: + CurrencySuffixList = dict( + [ + ("Dòlar", "dòlar|dòlars|dolar|dolars|$"), + ("Pes", "pes|pesos"), + ("Ruble", "ruble|rubles"), + ("Lliura", "lliura|lliures|£"), + ("Florín", "florín|florines"), + ("Dinar", "dinar|dinars"), + ("Franc", "franc|francs"), + ("Rupia", "rupia|rupies"), + ("Escut", "escut|escuts"), + ("Xelín", "xíling|xílins"), + ("Lira", "lira|lires"), + ("Centavo", "centavo|centavos|centaus|centau"), + ("Cèntim", "cèntim|cèntims"), + ("Centèsim", "centèsim|centèsims"), + ("Penique", "penique|peniques"), + ("Euro", "euro|euros|€|eur|d'euros"), + ("Cèntim d'Euro", "cèntim d'euro|cèntims d'euros"), + ("Dòlar del Carib Oriental", "dòlar del carib oriental|dòlars del carib oriental|ec$|xcd"), + ("Centau del Carib Oriental", "centau del carib oriental|centaus del carib oriental"), + ("Franc CFA d'Àfrica Occidental", "franc cfa d'Àfrica occidental|francs cfa d'Àfrica occidental|fcfa|xof"), + ( + "Cèntim de CFA d'Àfrica Occidental", + "cèntim de cfa d'Àfrica occidental|cèntims de cfa d'Àfrica occidental", + ), + ("Franc CFA d'Àfrica Central", "franc cfa d'Àfrica central|francs cfa d'Àfrica central|xaf"), + ("Cèntim de CFA d'Àfrica Central", "cèntim de cfa d'Àfrica central|cèntims de cfa d'Àfrica central"), + ("Apsar", "apsar|apsares"), + ("Afgani afganès", "afgani afganès|؋|afn|afganis|afgani"), + ("Pul", "pul|puls"), + ("Lek albanès", "lek|lekë|lekes|lek albanès"), + ("Qindarka", "qindarka|qindarkë|qindarkas"), + ("Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleño|kwanzas angoleño|kwanzas|aoa|kz"), + ("Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"), + ( + "Florí antillano neerlandès", + "florí antillano neerlandès|florins antillano neerlandès|ƒ antillano neerlandès|ang|naƒ", + ), + ("Cent antillano neerlandès", "cent|centen"), + ("Riyal saudita", "riial saudita|riials saudita|sar"), + ("Halalà saudita", "halalà saudita|hallalah"), + ("Dinar algerià", "dinar algerià|dinars algerians|dzd"), + ("Cèntim algerià", "cèntim algerià|cèntims algerians"), + ("Pes argentí", "pes argentí|pesos argentins|ar$|ars"), + ("Centau argentí", "centau argentí|centaus argentins|ctv.|ctius."), + ("Dram armeni", "dram armeni|dram armenis|dram|դր."), + ("Luma armeni", "luma armeni|luma armenis"), + ("Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"), + ("Yotin arubeño", "yotin arubeño|yotines arubeños"), + ("Dòlar australià", "dòlar australià|dòlars australians|a$|aud"), + ("Centau australià", "centau australià|centaus australians"), + ("Manat àzeri", "manat àzeri|man|azn"), + ("Qəpik azerí", "qəpik azerí|qəpik"), + ("Dòlar bahameño", "dòlar bahameño|dòlars bahameños|b$|bsd"), + ("Centau bahameño", "centavo bahameño|centavos bahameños"), + ("Dinar bahreiní", "dinar bahreiní|dinars bahrainis|bhd"), + ("Fil bahrainí", "fil bahrainí|fils bahrainis"), + ("Taka bangladeshí", "taka bangladeshí|taques bangladeshí|bdt"), + ("Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"), + ("Dòlar de Barbats", "dòlar de barbats|dòlars de barbats|bbd"), + ("Centau de Barbados", "centau de barbados|centavos de barbados"), + ("Dòlar de Belize", "Dòlar de Belize|dòlars de Belize|bz$|bzd"), + ("Centau bel·liceny", "centau bel·liceny|centaus bel·licins"), + ("Dòlar bermudeño", "dòlar bermudeño|dòlars bermudeños|bd$|bmd"), + ("Centau bermudeño", "centavo bermudeño|centavos bermudeños"), + ("Ruble bielorus", "ruble bielorus|rubles bielorus|byr"), + ("Kòpek bielorus", "kopek bielorús|kopek bielorus|kap"), + ("Kyat birmà", "kyat birmà|kyats birmans|mmk"), + ("Pya birmà", "pia birmà|pies birmans"), + ("Bolivià", "bolivià|bolivians|bob|bs"), + ("Centíssim Bolivià", "centèssim bolivià|centèsims bolivians"), + ( + "Marc bosniohercegoví", + "marc convertible|marc bosniohercegoví|marcs convertibles|marcs bosniohercegovins|bam", + ), + ("Feningas bosniohercegoví", "feninga convertible|feninga bosniohercegovina|feninges convertibles"), + ("Pula", "pula|bwp"), + ("Thebe", "thebe"), + ("Real brasiler", "real brasiler|reals brasilers|r$|brl"), + ("Centau brasiler", "centavo brasiler|centavos brasilers"), + ("Dòlar de Brunei", "dòlar de brunei|dòlars de brunei|bnd"), + ("Sen de Brunéi", "sense de brunéi"), + ("Lev búlgar", "lev búlgar|lleva búlgars|lv|bgn"), + ("Stotinki búlgar", "stotinka búlgar|stotinki búlgars"), + ("Franc de Burundi", "franc de burundi|francs de burundi|fbu|fib"), + ("Cèntim Burundi", "cèntim burundi|cèntims burundies"), + ("Ngultrum butanès", "ngultrum butanès|ngultrum butanesos|btn"), + ("Chetrum butanès", "chetrum butanès|chetrum butanesos"), + ("Escut capverdià", "escut capverdià|escuts capverdians|cve"), + ("Riel cambodjà", "riel cambodjà|riels cambodjans|khr"), + ("Dòlar canadenc", "dòlar canadenc|dòlars canadencs|c$|cad"), + ("Centau canadenc", "centau canadenc|centaus canadencs"), + ("Pes xilè", "pes xilè|pesos xilens|cpl"), + ("Yuan xinès", "yuan xinès|iuans xinesos|yuan|iuans|renminbi|rmb|cny|¥"), + ("Pes colombià", "pes colombià|pesos colombians|cop|col$"), + ("Centau colombià", "centau colombià|centaus colombians"), + ("Franc comorà", "franc comorà|francs comorans|kmf|₣"), + ("Franc congolès", "franc congolès|francs congolesos|cdf"), + ("Cèntim congolès", "cèntim congolès|cèntims congolesos"), + ("Won nord-coreà", "won nord-coreà|wŏn nord-coreà|wŏn nord-coreans|kpw"), + ("Chon nord-coreà", "chon nord-coreà|chŏn nord-coreà|chŏn nord-coreans|chon nord-coreans"), + ("Won sud-coreà", "wŏn sud-coreà|won sud-coreà|wŏnes sud-coreans|wons sud-coreans|krw"), + ("Chon sud-coreà", "chon sud-coreà|chŏn sud-coreà|chon sud-coreans|chon sud-coreans"), + ("Coló costarricense", "còlon costarricenc|culls costarricencs|crc"), + ("Kuna croat", "kuna croat|kuna croat|hrk"), + ("Llipa croata", "llipa croata|lipa croates"), + ("Pes cubà", "pes cubà|pesos cubans|cup"), + ("Pes cubà convertible", "pes cubà convertible|pesos cubans convertible|cuc"), + ("Corona danesa", "corona danesa|corones daneses|dkk"), + ("Lliura egípcia", "lliura egípcia|lliures egípcies|egp|l.e."), + ("Piastra egípcia", "piastra egípcia|piastres egípcies"), + ("Coló salvadorenc", "coló salvadorenc|colons salvadorencs|svc"), + ("Dirham dels Unió dels Emirats Àrabs", "dirham|dirhams|dirham dels emirats Àrabs units|aed|dhs"), + ("Nakfa", "nakfa|nfk|ern"), + ("Cèntim de Nakfa", "cèntim de nakfa|cèntims de nakfa"), + ("Pesseta", "pesseta|pessetes|pts.|ptes.|esp"), + ("Dòlar nord-americà", "dòlar nord-americà|dòlars nord-americans|usd|u$d|us$"), + ("Corona estonia", "corona estonia|corones estonias|eek"), + ("Senti estonia", "senti estonia|senti estonias"), + ("Birr etíop", "birr etíop|birr etíops|br|etb"), + ("Santim etíop", "santim etíop|santim etíops"), + ("Pes filipí", "pes filipino|pes pes filipins|php"), + ("Marc finlandès", "marc finlandès|marcs finlandesos"), + ("Dòlar fiyià", "dòlar fiyià|dòlars fiyians|fj$|fjd"), + ("Centau fiyiano", "centavo fiyiano|centavos fiyianos"), + ("Dalasi", "dalasi|gmd"), + ("Bututs", "butut|bututs"), + ("Lari georgià", "lari georgià|lari georgians|gel"), + ("Tetri georgià", "tetri georgià|tetri georgians"), + ("Cedi", "cedi|ghs|gh₵"), + ("Pesewa", "pesewa"), + ("Lliura gibraltarenya", "lliura gibraltareña|lliures gibraltarenyes|gip"), + ("Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"), + ("Quetzal guatemalenc", "quetzal guatemalenc|quetzals guatemalencs|quetzal|quetzals|gtq"), + ("Centau guatemalenc", "centau guatemalenc|centaus guatemalencs"), + ("Lliura de Guernsey", "lliura de guernsey|lliures de guernsey|ggp"), + ("Penique de Guernsey", "penique de guernsey|peniques de guernsey"), + ("Franc guineà", "franc guineà|francs guineans|gnf|fg"), + ("Cèntim guineà", "cèntim guineà|cèntims guineans"), + ("Dòlar guyanès", "dòlar guyanès|dòlars guyanesos|gyd|gy"), + ("Gourde haitiano", "gourde haitiano|gourde haitians|htg"), + ("Cèntim haitià", "cèntim haitià|cèntims haitians"), + ("Lempira hondureny", "lempira hondureny|lempira hondurenys|hnl"), + ("Centau hondureny", "centavo hondureny|centavos hondureny"), + ("Dòlar de Hong Kong", "dòlar de hong kong|dòlars de hong kong|hk$|hkd"), + ("Forint hongarès", "forint hongarès|forint hongarès|huf"), + ("Rúpia índia", "rupia índia|rupies índies|inr"), + ("Paisa índia", "paisa índia|paise índies"), + ("Rúpia indonèsia", "rupia indonèsia|rupies indonèsies|idr"), + ("Sen indonèsia", "sense indonèsia|sense indonèsies"), + ("Rial iranià", "rial iranià|rial iranies|irr"), + ("Dinar iraquià", "dinar iraquià|dinars iraquís|iqd"), + ("Fil iraquià", "fil iraquià|fils iraquís"), + ("Lliura manesa", "lliura manesa|lliures maneses|imp"), + ("Penique manes", "penique manes|peniques manesos"), + ("Corona islandesa", "corona islandesa|corones islandeses|isk|ikr"), + ("Aurar islandes", "aurar islandes|aurar islandesos"), + ("Dòlar de les Illes Caiman", "dòlar de les illes caiman|dòlars de les illes caiman|ci$|kyd"), + ("Dòlar de les Illes Cook", "dòlar de les illes cook|dòlars de les illes cook"), + ("Corona feroesa", "corona feroesa|corones feroeses|fkr"), + ("Lliura malvinenca", "lliura malvinenca|lliures malvinenques|fk£|fkp"), + ("Dòlar de les Illes Salomó", "dòlar de les illes salomón|dòlars de les illes salomón|sbd"), + ("Nou shéquel", "nou shéquel|nous shéquel|ils"), + ("Agorot", "agorot"), + ("Dòlar jamaiquí", "dòlar jamaiquí|dòlars jamaiquins|j$|ja$|jmd"), + ("ien", "ien|iens|jpy"), + ("Lliura de Jersey", "lliura de jersei|lliures de jersei|jep"), + ("Dinar jordà", "dinar jordà|dinars jordans|jd|jod"), + ("Piastra jordà", "piastra jordà|piastres jordans"), + ("Tenge kazakh", "tenge|tenge kazakh|kzt"), + ("Xelín kenià", "xíling kenià|xílings kenyans|ksh|kes"), + ("Som kirguís", "som kirguís|kgs"), + ("Tyiyn", "tyiyn"), + ("Dòlar de Kiribati", "dòlar de kiribati|dòlars de kiribati"), + ("Dinar kuwaití", "dinar kuwaití|dinars kuwaití"), + ("Kip laosià", "kip|kip laosià|kip laosians|lak"), + ("Att laosià", "att|att laosià|att laosians"), + ("Loti", "loti|maloti|lsl"), + ("Sent", "sent|llisent"), + ("Lliura libanesa", "lliura libanesa|lliures libaneses|lbp"), + ("Dòlar liberià", "dòlar liberià|dòlars liberians|l$|lrd"), + ("Dinar libi", "dinar libi|dinars libis|ld|lyd"), + ("Dirham libi", "dirham libi|dirhams libis"), + ("Lites lituana", "lites lituana|litai lituanes|ltl"), + ("Pataca macaense", "pataca macaense|pataques macaenses|mop$|mop"), + ("Avo macaense", "avo macaense|aus macaenses"), + ("Ho macaense", "ho macaense|ho macaenses"), + ("Denar macedoni", "denar macedoni|denare macedoni|den|mkd"), + ("Deni macedoni", "deni macedoni|deni macedonis"), + ("Ariary malgaixos", "ariary malgaixos|ariary malgaixos|mga"), + ("Iraimbilanja malgaixos", "iraimbilanja malgaixos|iraimbilanja malgaixos"), + ("Ringgit malai", "ringgit malai|ringgit malais|rm|myr"), + ("Sen malayo", "sen malayo|sen malais"), + ("Kwacha malauí", "kwacha malauí|mk|mwk"), + ("Tamba malauí", "tamba malauí"), + ("Rúpia de Maldives", "rupia de maldives|rupies de maldives|mvr"), + ("Dirham marroquí", "dirham marroquí|dirhams marroquins|mad"), + ("Rúpia de Maurici", "rupia de Maurici|rupies de Maurici|mur"), + ("Uguiya", "uguiya|uguiyas|mro"), + ("Jum", "jum|jums"), + ("Pes mexicà", "pes mexicà|pesos mexicans|mxn|mxn$|mxn $|mex$"), + ("Centau mexicà", "centau mexicà|centaus mexicans"), + ("Leu moldau", "leu moldau|llei moldaus|mdl"), + ("Ban moldau", "ban moldau|bani moldaus"), + ("Tugrik mongol", "tugrik mongol|tugrik|tugrik mongols|tug|mnt"), + ("Metical moçambiquès", "metical|metical moçambiquès|meticals|meticals moçambiquesos|mtn|mzn"), + ("Dram de Nagorno Karabaj", "dram de nagorno karabaj|drams de nagorno karabaj"), + ("Luma de Nagorno Karabakh", "luma de nagorn karabakh"), + ("Dòlar namibi", "dòlar namibi|dòlars namibis|n$|nad"), + ("Centau namibi", "centau namibi|centaus namibis"), + ("Rúpia nepalès", "rupia nepalesa|rupies nepales|npr"), + ("Païsa nepalès", "païssa nepalesa|països nepalesos"), + ("Còrdova nicaragüenc", "còrdova nicaragüenc|còrdoves nicaragüencs|ni"), + ("Centau nicaragüenc", "centau nicaragüenc|centaus nicaragüencs"), + ("Naira", "naira|ngn"), + ("Kobo", "kobo"), + ("Corona noruega", "corona noruega|corones noruegues|nok"), + ("Franc CFP", "franc cfp|francs cfp|xpf"), + ( + "Dòlar neozelandès", + "dòlar neozelandès|dòlars neozelandesos|dòlar de nova zelanda|dòlars de nova zelanda|nz$|nzd", + ), + ( + "Centau neozelandès", + "centau neozelandès|centau de nova zelanda|centaus de nova zelanda|centaus neozelandesos", + ), + ("Rial omaní", "rial omaní|rials omanies|omr"), + ("Baisa omaní", "baisa omaní|baisa omanies"), + ("Florí neerlandès", "florí neerlandès|florins neerlandesos|nlg"), + ("Rúpia pakistanesa", "rupia pakistanesa|rupies pakistaneses|pkr"), + ("Païsa pakistanesa", "paisa pakistanesa|països pakistanesos"), + ("Balboa panameny", "balboa panameny|balboa panamenys|pab"), + ("Centíssim panameny", "centèsim panameny|centèsims panamenys"), + ("Kina", "kina|pkg|pgk"), + ("Toea", "toea"), + ("Guaraní", "guaraní|guaranies|gs|pyg"), + ("Sol", "sol|sols|nou sol|pen|s#."), + ("Cèntim de sol", "cèntim de sol|cèntims de sol"), + ("Złoty", "złoty|esloti|eslotis|zł|pln"), + ("Groszy", "groszy"), + ("Riyal qatarià", "riyal qatarià|riyal qatarià|qr|qar"), + ("Dirham qatarià", "dirham qatarià|dirhams qataries"), + ("Lliura esterlina", "lliura esterlina|lliures esterlines|gbp"), + ("Corona txeca", "corona txeca|corones txeques|kc|czk"), + ("Pes dominicà", "pes dominicà|pesos dominicans|rd$|dop"), + ("Centau dominicà", "centau dominicà|centaus dominicans"), + ("Franc ruandès", "franc ruandès|francs ruandesos|rf|rwf"), + ("Cèntim ruandès", "cèntim ruandès|cèntims ruandesos"), + ("Leu romanès", "leu romanès|llei romanesos|rom"), + ("Ban romanès", "ban romanès|bani romanesos"), + ("Ruble rus", "ruble rus|rubles russos|rub"), + ("Kopek rus", "kopek rus|kopeks russos"), + ("Tala", "tala|tālā|ws$|sat|wst"), + ("Sene", "sene"), + ("Lliura de Santa Helena", "lliura de santa hel·lena|lliures de santa hel·lena|shp"), + ("Penique de Santa Helena", "penique de santa hel·lena|peniques de santa hel·lena"), + ("Dobra", "dobra"), + ("Dinar serbi", "dinar serbi|dinars serbis|rsd"), + ("Per a serbi", "per a serbi|per a serbis"), + ("Rúpia de Seychelles", "rupia de seychelles|rupies de seychelles|scr"), + ("Centau de Seychelles", "centau de seychelles|centaus de seychelles"), + ("Leone", "leone|li|sll"), + ("Dòlar de Singapur", "dòlar de singapur|dòlars de singapur|sgb"), + ("Centau de Singapur", "centau de Singapur|centaus de Singapur"), + ("Lliura siriana", "lliura siriana|lliures sirianes|s£|syp"), + ("Piastra siriana", "piastra siriana|piastres sirianes"), + ("Xelin somali", "xíling somali|xílings somalis|sos"), + ("Centau somali", "centau somali|centaus somalies"), + ("Xelín somalilandès", "xíling somalilandès|xílings somalilandesos"), + ("Centau somalilandès", "centau somalilandès|centaus somalilandesos"), + ("Rúpia de Sri Lanka", "rupia de Sri Lanka|rupies de Sri Lanka|lkr"), + ("Cèntim de Sri Lanka", "cèntim de Sri Lanka|cèntims de Sri Lanka"), + ("Lilangeni", "lilangeni|emalangeni|szl"), + ("Rand sud-africà", "rand|rand sud-africà|tsar"), + ("Lliura sudanesa", "lliura sudanesa|lliures sudaneses|sdg"), + ("Piastra sudanesa", "piastra sudanesa|piastres sudaneses"), + ("Lliura sursudanesa", "lliura sursudanesa|lliures sursudanesa|ssp"), + ("Piastra sursudanesa", "piastra sursudanesa|piastres sursudaneses"), + ("Corona sueca", "corona sueca|corones sueques|sek"), + ("Franc suís", "franc suís|francs suïssos|sfr|chf"), + ("Rappen suís", "rappen suís|rappens suïssos"), + ("Dòlar surinamés", "òolar surinamés|dòlars surinamesos|srd"), + ("Centau surinamés", "centau surinamés|centaus surinamés"), + ("Baht tailandès", "baht tailandès|baht tailandesos|thb"), + ("Satang tailandès", "satang tailandès|satang tailandesos"), + ("Nou dòlar taiwanès", "nou dòlar taiwanès|dòlar taiwanès|dòlars taiwanesos|twd"), + ("Centau taiwanès", "centau taiwanès|centaus taiwanesos"), + ("Xelín tanzano", "xíling tanzano|xílings tanzanos|tzs"), + ("Centau tanzano", "centavo tanzano|centavos tanzanos"), + ("Somoni tayiko", "somoni tayiko|somoni|tjs"), + ("Diram", "diram|dirams"), + ("Paʻanga", "dòlar tongan|dòlars tongans|paʻanga|pa'anga|top"), + ("Seniti", "seniti"), + ("Ruble de Transnistria", "ruble de transnistria|rubles de transnistria"), + ("Kopek de Transnistria", "kopek de transnistria|kopeks de transnistria"), + ("Dòlar trinitenc", "dòlar trinitenc|dòlars trinitencs|ttd"), + ("Centau trinitense", "centavo trinitense|centavos trinitenses"), + ("Dinar tunisià", "dinar tunisià|dinars tunisians|tnd"), + ("Millime tunisià", "millime tunisià|millimes tunisians"), + ("Lira turca", "lira turca|lires turques|try"), + ("Kuruş turca", "kuruş turca|kuruş turques"), + ("Manat turcman", "manat turcmen|manat turkmenos|tmt"), + ("Tennesi turcman", "tennesi turcman|tenge turcman"), + ("Dòlar tuvaluà", "dòlar tuvaluà|dòlars tuvaluans"), + ("Centau tuvaluà", "centau tuvaluà|centaus tuvaluans"), + ("Grivna", "grivna|grivnas|uah"), + ("Kopiyka", "kopiyka|kopeks"), + ("Xelín ugandès", "xíling ugandès|xílings ugandesos|ugx"), + ("Centau ugandès", "centau ugandès|centaus ugandesos"), + ("Pes uruguaià", "pes uruguaià|pesos uruguaians|uyu"), + ("Centèssim uruguaià", "centèsim uruguaià|centèsims uruguaians"), + ("Som uzbeko", "som uzbeko|som uzbekos|uzs"), + ("Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"), + ("Vatu", "vatu|vuv"), + ("Bolívar fort", "bolívar fort|bolívar|bolívars|vef"), + ("Cèntim de bolívar", "cèntim de bolívar|cèntims de bolívar"), + ("Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamites|vnd"), + ("Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamites"), + ("Rial iemenita", "rial iemenit|rials iemenites|yer"), + ("Fils iemenita", "fils iemenita|fils iemenites"), + ("Franc gibutià", "franc gibutià|francs gibutians|djf"), + ("Dinar iugoslau", "dinar iugoslau|dinars iugoslaus|yud"), + ("Kwacha zambià", "kwacha zambià|kwacha zambians|zmw"), + ("Ngwee zambià", "ngwee zambià|ngwee zambians"), + ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), + ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), + ("Satoshi", "satoshi|satoshis"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afgani afganès", "AFN"), + ("Euro", "EUR"), + ("Lek albanès", "ALL"), + ("Kwanza angolès", "AOA"), + ("Dram armeni", "AMD"), + ("Florín arubeño", "AWG"), + ("Taka bangladeshí", "BDT"), + ("Ngultrum butanès", "BTN"), + ("Bolivià", "BOB"), + ("Marc bosniohercegoví", "BAM"), + ("Pula", "BWP"), + ("Real brasiler", "BRL"), + ("Lev búlgar", "BGN"), + ("Riel cambodjà", "KHR"), + ("Escut caboverdià", "CVE"), + ("Coló costarricense", "CRC"), + ("Kuna croata", "HRK"), + ("Corona txeca", "CZK"), + ("Nakfa", "ERN"), + ("Birr etíop", "ETB"), + ("Dalasi", "GMD"), + ("Lari georgià", "GEL"), + ("Cedi", "GHS"), + ("Quetzal guatemalenc", "GTQ"), + ("Gourde haitià", "HTG"), + ("Lempira hondureny", "HNL"), + ("Forint hongarès", "HUF"), + ("Rial iranià", "IRR"), + ("Rial iemenita", "YER"), + ("Nou shéquel", "ILS"), + ("Ien", "JPY"), + ("Tenge kazakh", "KZT"), + ("Xelín kenià", "KES"), + ("Won nord-coreà", "KPW"), + ("Won sud-coreà", "KRW"), + ("Som kirguís", "KGS"), + ("Kip laosià", "LAK"), + ("Loti", "LSL"), + ("Rand sud-africà", "ZAR"), + ("Pataca macaense", "MOP"), + ("Denar macedoni", "MKD"), + ("Ariary malgaix", "MGA"), + ("Kwacha malauí", "MWK"), + ("Ringgit malai", "MYR"), + ("Uguiya", "MRO"), + ("Tugrik mongol", "MNT"), + ("Metical moçambiquès", "MZN"), + ("Kyat birmà", "MMK"), + ("Còrdova nicaragüenc", "NIO"), + ("Naira", "NGN"), + ("Lira turca", "TRY"), + ("Rial omaní", "OMR"), + ("Balboa panameny", "PAB"), + ("Kina", "PGK"), + ("Guaraní", "PYG"), + ("Sol", "PEN"), + ("Złoty", "PLN"), + ("Riyal qatarià", "QAR"), + ("Riyal saudita", "SAR"), + ("Tala", "WST"), + ("Són Tomé and Príncep dobra", "STN"), + ("Leone", "SLL"), + ("Lilangeni", "SZL"), + ("Somoni tayiko", "TJS"), + ("Baht tailandès", "THB"), + ("Grivna", "UAH"), + ("Vatu", "VUV"), + ("Bolívar fort", "VEF"), + ("Kwacha zambià", "ZMW"), + ("Dirham marroquí", "MAD"), + ("Dirham dels Unió dels Emirats Àrabs", "AED"), + ("Manat azerí", "AZN"), + ("Manat turkmè", "TMT"), + ("Xelin somali", "SOS"), + ("Xelín tanzano", "TZS"), + ("Xelín ugandès", "UGX"), + ("Leu romanès", "RON"), + ("Leu moldau", "MDL"), + ("Rúpia nepalesa", "NPR"), + ("Rupia pakistanesa", "PKR"), + ("Rúpia índia", "INR"), + ("Rúpia de Seychelles", "SCR"), + ("Rúpia de Maurici", "MUR"), + ("Rúpia de Maldives", "MVR"), + ("Rúpia de Sri Lanka", "LKR"), + ("Rupia indonèsia", "IDR"), + ("Corona danesa", "DKK"), + ("Corona noruega", "NOK"), + ("Corona islandesa", "ISK"), + ("Corona sueca", "SEK"), + ("Franc CFA d'Àfrica Occidental", "XOF"), + ("Franc CFA d'Àfrica Central", "XAF"), + ("Franc comorà", "KMF"), + ("Franc congolès", "CDF"), + ("Burundian franc", "BIF"), + ("Franc gibutià", "DJF"), + ("Franco CFP", "XPF"), + ("Franc guineà", "GNF"), + ("Franc suís", "CHF"), + ("Franc ruandès", "RWF"), + ("Ruble rus", "RUB"), + ("Transnistrian ruble", "PRB"), + ("New Belarusian ruble", "BYN"), + ("Dinar algerià", "DZD"), + ("Dinar bahrainès", "BHD"), + ("Dinar iraquià", "IQD"), + ("Dinar jordà", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Dinar libi", "LYD"), + ("Dinar serbi", "RSD"), + ("Dinar tunisià", "TND"), + ("Pes argentí", "ARS"), + ("Xilean pes", "CLP"), + ("Pes colombià", "COP"), + ("Pes cubà convertible", "CUC"), + ("Pes cubà", "CUP"), + ("Pes dominicà", "DOP"), + ("Pes mexicà", "MXN"), + ("Pes uruguaià", "UYU"), + ("Lliura esterlina", "GBP"), + ("Lliura de Santa Helena", "SHP"), + ("Lliura egípcia", "EGP"), + ("Lliura malvinenca", "FKP"), + ("Lliura gibraltarenya", "GIP"), + ("Lliura manesa", "IMP"), + ("Lliura de Jersey", "JEP"), + ("Lliura libanesa", "LBP"), + ("Lliura sursudanesa", "SSP"), + ("Lliura sudanesa", "SDG"), + ("Lliura siriana", "SYP"), + ("Dòlar nord-americà", "USD"), + ("Dòlar australià", "AUD"), + ("Dòlar de Bahama", "BSD"), + ("Dòlar de Barbados", "BBD"), + ("Dòlar bel·liceny", "BZD"), + ("Dòlar bermudeny", "BMD"), + ("Dòlar de Brunéi", "BND"), + ("Dòlar de Singapur", "SGD"), + ("Dòlar canadenc", "CAD"), + ("Dòlar de les Illes Caiman", "KYD"), + ("Dòlar neozelandès", "NZD"), + ("Dòlar fiyià", "FJD"), + ("Dòlar guyanès", "GYD"), + ("Dòlar de Hong Kong", "HKD"), + ("Dòlar jamaiquí", "JMD"), + ("Dòlar liberià", "LRD"), + ("Dòlar namíbi", "NAD"), + ("Dòlar de les Illes Salomó", "SBD"), + ("Dòlar surinamés", "SRD"), + ("Nou dòlar taiwanès", "TWD"), + ("Dòlar trinitenc", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Yuan xinès", "CNY"), + ("Rial", "__RI"), + ("Xelín", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dòlar", "__D"), + ("Manat", "__MA"), + ("Rupia", "__R"), + ("Corona", "__K"), + ("Franco", "__F"), + ("Marc", "__M"), + ("Ruble", "__RB"), + ("Pes", "__PE"), + ("Lliura", "__P"), + ("Tristan dóna Cunha lliura", "_TP"), + ("South Georgia and the South Sandwich Islands lliura", "_SP"), + ("Somaliland xíling", "_SS"), + ("Pitcairn Islands dòlar", "_PND"), + ("Palauan dòlar", "_PD"), + ("Niu dòlar", "_NID"), + ("Nauruan dòlar", "_ND"), + ("Micronesian dòlar", "_MD"), + ("Kiribati dòlar", "_KID"), + ("Guernsey lliura", "_GGP"), + ("Faroese corona", "_FOK"), + ("Cook Islands dòlar", "_CKD"), + ("British Virgin Islands dòlar", "_BD"), + ("Ascensió lliura", "_AP"), + ("Alderney lliura", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kópek", "KOPEK"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarka", "QINDARKE"), + ("Penique", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENT"), + ("Centau", "CENT"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Kopyeyka", "KOPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Païsa", "PAISA"), + ("Feningas", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Cèntim", "CENT"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Filler", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tiın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sent", "SENT"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PIA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISSA"), + ("Centíssim", "CENTESIM"), + ("Toea", "TOEA"), + ("Sentim", "SENTIM"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Per", "PER"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '(?i|amb)' + MultiplierRegex = '\\s*\\b(((mil\\s+)?el meu|bi|quatri|quinti|sexti|sèpti)ll[oó]n|mil)(és)?\\b' + CurrencyPrefixList = dict( + [ + ("Dobra", "db|std"), + ("Dòlar", "$|dòlar|dòlars|dolar|dolars"), + ("Dòlar nord-americà", "us$|u$d|usd"), + ("Dòlar del Carib Oriental", "ec$|xcd"), + ("Dòlar australià", "a$|aud"), + ("Dòlar de Bahama", "b$|bsd"), + ("Dòlar de Barbados", "bds$|bbd"), + ("Dòlar bel·liceny", "bz$|bzd"), + ("Dòlar bermudeny", "bd$|bmd"), + ("Dòlar de Brunéi", "brunèi $|bnd"), + ("Dòlar de Singapur", "s$|sgd"), + ("Dòlar canadenc", "c$|can$|cad"), + ("Dòlar de les Illes Caiman", "ci$|kyd"), + ("Dòlar neozelandès", "nz$|nzd"), + ("Dòlar fiià", "fj$|fjd"), + ("Dòlar guyanès", "gi$|gyd"), + ("Dòlar de Hong Kong", "hk$|hkd"), + ("Dòlar jamaiquí", "j$|ja$|jmd"), + ("Dòlar liberià", "l$|lrd"), + ("Dòlar namíbi", "n$|nad"), + ("Dòlar de les Illes Salomó", "si$|sbd"), + ("Nou dòlar taiwanès", "nt$|twd"), + ("Pes mexicà", "mxn|mxn$|mxn $|mex$"), + ("Real brasiler", "r$|brl"), + ("Guaraní", "₲|gs.|pyg"), + ("Dòlar trinitenc", "tt$|ttd"), + ("Yuan xinès", "¥|cny|rmb"), + ("Ien", "¥|jpy"), + ("Euro", "€|eur"), + ("Florín", "ƒ"), + ("Lliura", "£"), + ("Coló costarricense", "₡"), + ("Lira turca", "₺"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) + AmbiguousCurrencyUnitList = [r'le', r'db', r'std'] + BuildPrefix = '(?<=(\\s|^|\\P{L}))' + BuildSuffix = '(?=(\\s|\\P{L}|$))' + ConnectorToken = 'de' + + +# pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/chinese_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/chinese_numeric_with_unit.py index 34b04e482b..2d7d2af56d 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/chinese_numeric_with_unit.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/chinese_numeric_with_unit.py @@ -9,594 +9,526 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_numbers import BaseNumbers + # pylint: disable=line-too-long class ChineseNumericWithUnit: - AgeAmbiguousValues = [r'岁'] - AgeSuffixList = dict([("Year", "岁|周岁"), - ("Month", "个月大|月大"), - ("Week", "周大"), - ("Day", "天大")]) BuildPrefix = '' BuildSuffix = '' ConnectorToken = '' - CurrencySuffixList = dict([("Afghan afghani", "阿富汗尼"), - ("Pul", "普尔"), - ("Euro", "欧元"), - ("Cent", "美分"), - ("Albanian lek", "阿尔巴尼亚列克|列克"), - ("Angolan kwanza", "安哥拉宽扎|宽扎"), - ("Armenian dram", "亚美尼亚德拉姆"), - ("Aruban florin", "阿鲁巴弗罗林|阿鲁巴币"), - ("Bangladeshi taka", "塔卡|孟加拉塔卡"), - ("Paisa", "派萨|帕萨"), - ("Bhutanese ngultrum", "不丹努尔特鲁姆|不丹努扎姆|努扎姆"), - ("Chetrum", "切特鲁姆"), - ("Bolivian boliviano", "玻利维亚诺|玻利维亚币"), - ("Bosnia and Herzegovina convertible mark", "波斯尼亚和黑塞哥维那可兑换马克|波赫可兑换马克"), - ("Botswana pula", "博茨瓦纳普拉|普拉"), - ("Thebe", "thebe"), - ("Brazilian real", "巴西雷亚尔"), - ("Bulgarian lev", "保加利亚列弗|保加利亚列瓦"), - ("Stotinka", "斯托丁卡"), - ("Cambodian riel", "瑞尔"), - ("Cape Verdean escudo", "佛得角埃斯库多|维德角埃斯库多"), - ("Croatian kuna", "克罗地亚库纳|克罗地亚库那|克罗埃西亚库纳"), - ("Lipa", "利巴"), - ("Eritrean nakfa", "厄立特里亚纳克法"), - ("Ethiopian birr", "埃塞俄比亚比尔|埃塞俄比亚元"), - ("Gambian dalasi", "冈比亚达拉西|甘比亚达拉西"), - ("Butut", "布达|布图"), - ("Georgian lari", "格鲁吉亚拉里"), - ("Tetri", "特特里|泰特里"), - ("Ghanaian cedi", "塞地|加纳塞地"), - ("Pesewa", "比塞瓦"), - ("Guatemalan quetzal", "瓜地马拉格查尔"), - ("Haitian gourde", "海地古德"), - ("Honduran lempira", "洪都拉斯伦皮拉"), - ("Hungarian forint", "匈牙利福林|匈牙利货币|匈牙利福林币"), - ("Iranian rial", "伊朗里亚尔|伊朗莱尔"), - ("Yemeni rial", "叶门莱尔|叶门里亚尔"), - ("Israeli new shekel", "₪|ils|以色列币|以色列新克尔|谢克尔"), - ("Japanese yen", "日元|日本元|日币|日圆"), - ("Sen", "日本銭"), - ("Kazakhstani tenge", "哈萨克斯坦坚戈"), - ("Kenyan shilling", "肯尼亚先令"), - ("North Korean won", "朝鲜圆|朝鲜元"), - ("South Korean won", "韩元|韩圆"), - ("Korean won", "₩"), - ("Kyrgyzstani som", "吉尔吉斯斯坦索姆"), - ("Lao kip", "基普|老挝基普|老挝币"), - ("Att", "att"), - ("Lesotho loti", "莱索托洛提|莱索托马洛蒂"), - ("South African rand", "南非兰特"), - ("Macedonian denar", "马其顿代纳尔|马其顿币|代纳尔"), - ("Deni", "第尼"), - ("Malagasy ariary", "马达加斯加阿里亚里"), - ("Iraimbilanja", "伊莱姆比拉贾"), - ("Malawian kwacha", "马拉威克瓦查"), - ("Tambala", "坦巴拉"), - ("Malaysian ringgit", "马来西亚币|马币|马来西亚林吉特"), - ("Mauritanian ouguiya", "毛里塔尼亚乌吉亚"), - ("Khoums", "库姆斯"), - ("Mozambican metical", "莫桑比克梅蒂卡尔|梅蒂卡尔"), - ("Burmese kyat", "缅甸元|缅元"), - ("Pya", "缅分"), - ("Nigerian naira", "尼日利亚奈拉|尼日利亚币|奈拉"), - ("Kobo", "考包"), - ("Turkish lira", "土耳其里拉"), - ("Kuruş", "库鲁"), - ("Omani rial", "阿曼里亚尔|阿曼莱尔"), - ("Panamanian balboa", "巴拿马巴波亚"), - ("Centesimo", "意大利分|乌拉圭分|巴拿马分"), - ("Papua New Guinean kina", "基那"), - ("Toea", "托亚|托伊"), - ("Peruvian sol", "秘鲁索尔"), - ("Polish złoty", "波兰币|波兰兹罗提|兹罗提"), - ("Grosz", "格罗希"), - ("Qatari riyal", "卡达里亚尔"), - ("Saudi riyal", "沙特里亚尔"), - ("Riyal", "里亚尔"), - ("Dirham", "迪拉姆"), - ("Halala", "哈拉"), - ("Samoan tālā", "萨摩亚塔拉"), - ("Sierra Leonean leone", "塞拉利昂利昂|利昂"), - ("Peseta", "比塞塔|西班牙比塞塔|西班牙币"), - ("Swazi lilangeni", "斯威士兰里兰吉尼|兰吉尼"), - ("Tajikistani somoni", "塔吉克斯坦索莫尼"), - ("Thai baht", "泰铢|泰元"), - ("Satang", "萨当"), - ("Tongan paʻanga", "汤加潘加|潘加"), - ("Ukrainian hryvnia", "乌克兰格里夫纳|格里夫纳"), - ("Vanuatu vatu", "瓦努阿图瓦图"), - ("Vietnamese dong", "越南盾"), - ("Indonesian rupiah", "印度尼西亚盾"), - ("Netherlands guilder", "荷兰盾|荷属安的列斯盾|列斯盾"), - ("Surinam florin", "苏里南盾"), - ("Guilder", "盾"), - ("Zambian kwacha", "赞比亚克瓦查"), - ("Moroccan dirham", "摩洛哥迪拉姆"), - ("United Arab Emirates dirham", "阿联酋迪拉姆"), - ("Azerbaijani manat", "阿塞拜疆马纳特"), - ("Turkmenistan manat", "土库曼马纳特"), - ("Manat", "马纳特"), - ("Somali shilling", "索马里先令|索马利先令"), - ("Somaliland shilling", "索马里兰先令"), - ("Tanzanian shilling", "坦桑尼亚先令"), - ("Ugandan shilling", "乌干达先令"), - ("Romanian leu", "罗马尼亚列伊"), - ("Moldovan leu", "摩尔多瓦列伊"), - ("Leu", "列伊"), - ("Ban", "巴尼"), - ("Nepalese rupee", "尼泊尔卢比"), - ("Pakistani rupee", "巴基斯坦卢比"), - ("Indian rupee", "印度卢比"), - ("Seychellois rupee", "塞舌尔卢比"), - ("Mauritian rupee", "毛里求斯卢比"), - ("Maldivian rufiyaa", "马尔代夫卢比"), - ("Sri Lankan rupee", "斯里兰卡卢比"), - ("Rupee", "卢比"), - ("Czech koruna", "捷克克朗"), - ("Danish krone", "丹麦克朗|丹麦克郎"), - ("Norwegian krone", "挪威克朗"), - ("Faroese króna", "法罗克朗"), - ("Icelandic króna", "冰岛克朗"), - ("Swedish krona", "瑞典克朗"), - ("Krone", "克朗"), - ("Øre", "奥依拉|奥拉|埃利"), - ("West African CFA franc", "非共体法郎"), - ("Central African CFA franc", "中非法郎|中非金融合作法郎"), - ("Comorian franc", "科摩罗法郎"), - ("Congolese franc", "刚果法郎"), - ("Burundian franc", "布隆迪法郎"), - ("Djiboutian franc", "吉布提法郎"), - ("CFP franc", "太平洋法郎"), - ("Guinean franc", "几内亚法郎"), - ("Swiss franc", "瑞士法郎"), - ("Rwandan franc", "卢旺达法郎"), - ("Belgian franc", "比利时法郎"), - ("Rappen", "瑞士分|瑞士生丁"), - ("Franc", "法郎"), - ("Centime", "生丁|仙士"), - ("Russian ruble", "俄国卢布|俄罗斯卢布"), - ("Transnistrian ruble", "德涅斯特卢布"), - ("Belarusian ruble", "白俄罗斯卢布"), - ("Kopek", "戈比"), - ("Ruble", "卢布"), - ("Algerian dinar", "阿尔及利亚第纳尔"), - ("Bahraini dinar", "巴林第纳尔"), - ("Iraqi dinar", "伊拉克第纳尔"), - ("Jordanian dinar", "约旦第纳尔"), - ("Kuwaiti dinar", "科威特第纳尔|科威特币"), - ("Libyan dinar", "利比亚第纳尔"), - ("Serbian dinar", "塞尔维亚第纳尔|塞尔维亚币"), - ("Tunisian dinar", "突尼斯第纳尔"), - ("Dinar", "第纳尔"), - ("Fils", "费尔"), - ("Para", "帕拉"), - ("Millime", "米利姆"), - ("Argentine peso", "阿根廷比索"), - ("Chilean peso", "智利比索"), - ("Colombian peso", "哥伦比亚比索"), - ("Cuban peso", "古巴比索"), - ("Dominican peso", "多米尼加比索"), - ("Mexican peso", "墨西哥比索"), - ("Philippine peso", "菲律宾比索"), - ("Uruguayan peso", "乌拉圭比索"), - ("Peso", "比索"), - ("Centavo", "仙|菲辅币"), - ("Alderney pound", "奥尔德尼镑"), - ("British pound", "英镑"), - ("Guernsey pound", "根西镑"), - ("Saint Helena pound", "圣赫勒拿镑"), - ("Egyptian pound", "埃及镑"), - ("Falkland Islands pound", "福克兰镑"), - ("Gibraltar pound", "直布罗陀镑"), - ("Manx pound", "马恩岛镑"), - ("Jersey pound", "泽西岛镑"), - ("Lebanese pound", "黎巴嫩镑"), - ("South Sudanese pound", "南苏丹镑"), - ("Sudanese pound", "苏丹镑"), - ("Syrian pound", "叙利亚镑"), - ("Pence", "便士"), - ("Shilling", "先令"), - ("United States dollar", "美元|美金|美圆"), - ("East Caribbean dollar", "东加勒比元"), - ("Australian dollar", "澳大利亚元|澳元"), - ("Bahamian dollar", "巴哈马元"), - ("Barbadian dollar", "巴巴多斯元"), - ("Belize dollar", "伯利兹元"), - ("Bermudian dollar", "百慕大元"), - ("Brunei dollar", "文莱元"), - ("Singapore dollar", "新加坡元|新元"), - ("Canadian dollar", "加元|加拿大元"), - ("Cayman Islands dollar", "开曼岛元"), - ("New Zealand dollar", "新西兰元|纽元"), - ("Cook Islands dollar", "库克群岛元"), - ("Fijian dollar", "斐济元|斐币"), - ("Guyanese dollar", "圭亚那元"), - ("Hong Kong dollar", "蚊|港元|港圆|港币"), - ("Macau Pataca", "澳门币|澳门元"), - ("New Taiwan dollar", "箍|新台币|台币"), - ("Jamaican dollar", "牙买加元"), - ("Kiribati dollar", "吉里巴斯元"), - ("Liberian dollar", "利比里亚元"), - ("Namibian dollar", "纳米比亚元"), - ("Surinamese dollar", "苏里南元"), - ("Trinidad and Tobago dollar", "特立尼达多巴哥元"), - ("Tuvaluan dollar", "吐瓦鲁元"), - ("Chinese yuan", "人民币|人民币元|元人民币|块钱|块|元|圆"), - ("Fen", "分钱|分"), - ("Jiao", "毛钱|毛|角钱|角"), - ("Finnish markka", "芬兰马克"), - ("Penni", "盆尼"), - ("Bitcoin", "₿|btc|xbt|个比特币|比特币")]) - CurrencyNameToIsoCodeMap = dict([("Afghan afghani", "AFN"), - ("Euro", "EUR"), - ("Albanian lek", "ALL"), - ("Angolan kwanza", "AOA"), - ("Armenian dram", "AMD"), - ("Aruban florin", "AWG"), - ("Bangladeshi taka", "BDT"), - ("Bhutanese ngultrum", "BTN"), - ("Bolivian boliviano", "BOB"), - ("Bosnia and Herzegovina convertible mark", "BAM"), - ("Botswana pula", "BWP"), - ("Brazilian real", "BRL"), - ("Bulgarian lev", "BGN"), - ("Cambodian riel", "KHR"), - ("Cape Verdean escudo", "CVE"), - ("Costa Rican colón", "CRC"), - ("Croatian kuna", "HRK"), - ("Czech koruna", "CZK"), - ("Eritrean nakfa", "ERN"), - ("Ethiopian birr", "ETB"), - ("Gambian dalasi", "GMD"), - ("Georgian lari", "GEL"), - ("Ghanaian cedi", "GHS"), - ("Guatemalan quetzal", "GTQ"), - ("Haitian gourde", "HTG"), - ("Honduran lempira", "HNL"), - ("Hungarian forint", "HUF"), - ("Iranian rial", "IRR"), - ("Yemeni rial", "YER"), - ("Israeli new shekel", "ILS"), - ("Japanese yen", "JPY"), - ("Kazakhstani tenge", "KZT"), - ("Kenyan shilling", "KES"), - ("North Korean won", "KPW"), - ("South Korean won", "KRW"), - ("Kyrgyzstani som", "KGS"), - ("Lao kip", "LAK"), - ("Lesotho loti", "LSL"), - ("South African rand", "ZAR"), - ("Macanese pataca", "MOP"), - ("Macedonian denar", "MKD"), - ("Malagasy ariary", "MGA"), - ("Malawian kwacha", "MWK"), - ("Malaysian ringgit", "MYR"), - ("Mauritanian ouguiya", "MRO"), - ("Mongolian tögrög", "MNT"), - ("Mozambican metical", "MZN"), - ("Burmese kyat", "MMK"), - ("Nicaraguan córdoba", "NIO"), - ("Nigerian naira", "NGN"), - ("Turkish lira", "TRY"), - ("Omani rial", "OMR"), - ("Panamanian balboa", "PAB"), - ("Papua New Guinean kina", "PGK"), - ("Paraguayan guaraní", "PYG"), - ("Peruvian sol", "PEN"), - ("Polish złoty", "PLN"), - ("Qatari riyal", "QAR"), - ("Saudi riyal", "SAR"), - ("Samoan tālā", "WST"), - ("São Tomé and Príncipe dobra", "STD"), - ("Sierra Leonean leone", "SLL"), - ("Swazi lilangeni", "SZL"), - ("Tajikistani somoni", "TJS"), - ("Thai baht", "THB"), - ("Ukrainian hryvnia", "UAH"), - ("Vanuatu vatu", "VUV"), - ("Venezuelan bolívar", "VEF"), - ("Zambian kwacha", "ZMW"), - ("Moroccan dirham", "MAD"), - ("United Arab Emirates dirham", "AED"), - ("Azerbaijani manat", "AZN"), - ("Turkmenistan manat", "TMT"), - ("Somali shilling", "SOS"), - ("Tanzanian shilling", "TZS"), - ("Ugandan shilling", "UGX"), - ("Romanian leu", "RON"), - ("Moldovan leu", "MDL"), - ("Nepalese rupee", "NPR"), - ("Pakistani rupee", "PKR"), - ("Indian rupee", "INR"), - ("Seychellois rupee", "SCR"), - ("Mauritian rupee", "MUR"), - ("Maldivian rufiyaa", "MVR"), - ("Sri Lankan rupee", "LKR"), - ("Indonesian rupiah", "IDR"), - ("Danish krone", "DKK"), - ("Norwegian krone", "NOK"), - ("Icelandic króna", "ISK"), - ("Swedish krona", "SEK"), - ("West African CFA franc", "XOF"), - ("Central African CFA franc", "XAF"), - ("Comorian franc", "KMF"), - ("Congolese franc", "CDF"), - ("Burundian franc", "BIF"), - ("Djiboutian franc", "DJF"), - ("CFP franc", "XPF"), - ("Guinean franc", "GNF"), - ("Swiss franc", "CHF"), - ("Rwandan franc", "RWF"), - ("Russian ruble", "RUB"), - ("Transnistrian ruble", "PRB"), - ("Belarusian ruble", "BYN"), - ("Algerian dinar", "DZD"), - ("Bahraini dinar", "BHD"), - ("Iraqi dinar", "IQD"), - ("Jordanian dinar", "JOD"), - ("Kuwaiti dinar", "KWD"), - ("Libyan dinar", "LYD"), - ("Serbian dinar", "RSD"), - ("Tunisian dinar", "TND"), - ("Argentine peso", "ARS"), - ("Chilean peso", "CLP"), - ("Colombian peso", "COP"), - ("Cuban convertible peso", "CUC"), - ("Cuban peso", "CUP"), - ("Dominican peso", "DOP"), - ("Mexican peso", "MXN"), - ("Uruguayan peso", "UYU"), - ("British pound", "GBP"), - ("Saint Helena pound", "SHP"), - ("Egyptian pound", "EGP"), - ("Falkland Islands pound", "FKP"), - ("Gibraltar pound", "GIP"), - ("Manx pound", "IMP"), - ("Jersey pound", "JEP"), - ("Lebanese pound", "LBP"), - ("South Sudanese pound", "SSP"), - ("Sudanese pound", "SDG"), - ("Syrian pound", "SYP"), - ("United States dollar", "USD"), - ("Australian dollar", "AUD"), - ("Bahamian dollar", "BSD"), - ("Barbadian dollar", "BBD"), - ("Belize dollar", "BZD"), - ("Bermudian dollar", "BMD"), - ("Brunei dollar", "BND"), - ("Singapore dollar", "SGD"), - ("Canadian dollar", "CAD"), - ("Cayman Islands dollar", "KYD"), - ("New Zealand dollar", "NZD"), - ("Fijian dollar", "FJD"), - ("Guyanese dollar", "GYD"), - ("Hong Kong dollar", "HKD"), - ("Jamaican dollar", "JMD"), - ("Liberian dollar", "LRD"), - ("Namibian dollar", "NAD"), - ("Solomon Islands dollar", "SBD"), - ("Surinamese dollar", "SRD"), - ("New Taiwan dollar", "TWD"), - ("Trinidad and Tobago dollar", "TTD"), - ("Tuvaluan dollar", "TVD"), - ("Chinese yuan", "CNY"), - ("Rial", "__RI"), - ("Shiling", "__S"), - ("Som", "__SO"), - ("Dirham", "__DR"), - ("Dinar", "_DN"), - ("Dollar", "__D"), - ("Manat", "__MA"), - ("Rupee", "__R"), - ("Krone", "__K"), - ("Krona", "__K"), - ("Crown", "__K"), - ("Frank", "__F"), - ("Mark", "__M"), - ("Ruble", "__RB"), - ("Peso", "__PE"), - ("Pound", "__P"), - ("Tristan da Cunha pound", "_TP"), - ("South Georgia and the South Sandwich Islands pound", "_SP"), - ("Somaliland shilling", "_SS"), - ("Pitcairn Islands dollar", "_PND"), - ("Palauan dollar", "_PD"), - ("Niue dollar", "_NID"), - ("Nauruan dollar", "_ND"), - ("Micronesian dollar", "_MD"), - ("Kiribati dollar", "_KID"), - ("Guernsey pound", "_GGP"), - ("Faroese króna", "_FOK"), - ("Cook Islands dollar", "_CKD"), - ("British Virgin Islands dollar", "_BD"), - ("Ascension pound", "_AP"), - ("Alderney pound", "_ALP"), - ("Abkhazian apsar", "_AA")]) - FractionalUnitNameToCodeMap = dict([("Jiao", "JIAO"), - ("Kopek", "KOPEK"), - ("Pul", "PUL"), - ("Cent", "CENT"), - ("Qindarkë", "QINDARKE"), - ("Penny", "PENNY"), - ("Santeem", "SANTEEM"), - ("Cêntimo", "CENTIMO"), - ("Centavo", "CENTAVO"), - ("Luma", "LUMA"), - ("Qəpik", "QƏPIK"), - ("Fils", "FILS"), - ("Poisha", "POISHA"), - ("Kapyeyka", "KAPYEYKA"), - ("Centime", "CENTIME"), - ("Chetrum", "CHETRUM"), - ("Paisa", "PAISA"), - ("Fening", "FENING"), - ("Thebe", "THEBE"), - ("Sen", "SEN"), - ("Stotinka", "STOTINKA"), - ("Fen", "FEN"), - ("Céntimo", "CENTIMO"), - ("Lipa", "LIPA"), - ("Haléř", "HALER"), - ("Øre", "ØRE"), - ("Piastre", "PIASTRE"), - ("Santim", "SANTIM"), - ("Oyra", "OYRA"), - ("Butut", "BUTUT"), - ("Tetri", "TETRI"), - ("Pesewa", "PESEWA"), - ("Fillér", "FILLER"), - ("Eyrir", "EYRIR"), - ("Dinar", "DINAR"), - ("Agora", "AGORA"), - ("Tïın", "TIIN"), - ("Chon", "CHON"), - ("Jeon", "JEON"), - ("Tyiyn", "TYIYN"), - ("Att", "ATT"), - ("Sente", "SENTE"), - ("Dirham", "DIRHAM"), - ("Rappen", "RAPPEN"), - ("Avo", "AVO"), - ("Deni", "DENI"), - ("Iraimbilanja", "IRAIMBILANJA"), - ("Tambala", "TAMBALA"), - ("Laari", "LAARI"), - ("Khoums", "KHOUMS"), - ("Ban", "BAN"), - ("Möngö", "MONGO"), - ("Pya", "PYA"), - ("Kobo", "KOBO"), - ("Kuruş", "KURUS"), - ("Baisa", "BAISA"), - ("Centésimo", "CENTESIMO"), - ("Toea", "TOEA"), - ("Sentimo", "SENTIMO"), - ("Grosz", "GROSZ"), - ("Sene", "SENE"), - ("Halala", "HALALA"), - ("Para", "PARA"), - ("Öre", "ORE"), - ("Diram", "DIRAM"), - ("Satang", "SATANG"), - ("Seniti", "SENITI"), - ("Millime", "MILLIME"), - ("Tennesi", "TENNESI"), - ("Kopiyka", "KOPIYKA"), - ("Tiyin", "TIYIN"), - ("Hào", "HAO"), - ("Ngwee", "NGWEE")]) - CompoundUnitConnectorRegex = f'(?又|再)' - CurrencyPrefixList = dict([("Dollar", "$"), - ("United States dollar", "us$"), - ("British Virgin Islands dollar", "bvi$"), - ("Brunei dollar", "b$"), - ("Sen", "sen"), - ("Singapore dollar", "s$"), - ("Canadian dollar", "can$|c$|c $"), - ("Cayman Islands dollar", "ci$"), - ("New Zealand dollar", "nz$|nz $"), - ("Guyanese dollar", "gy$|gy $|g$|g $"), - ("Hong Kong dollar", "hk$|hkd|hk $"), - ("Jamaican dollar", "j$"), - ("Namibian dollar", "nad|n$|n $"), - ("Solomon Islands dollar", "si$|si $"), - ("New Taiwan dollar", "nt$|nt $"), - ("Samoan tālā", "ws$"), - ("Chinese yuan", "¥"), - ("Japanese yen", "¥"), - ("Turkish lira", "₺"), - ("Euro", "€"), - ("Pound", "£"), - ("Costa Rican colón", "₡"), - ("Bitcoin", "₿|btc|xbt")]) + CurrencySuffixList = dict( + [ + ("Afghan afghani", "阿富汗尼"), + ("Pul", "普尔"), + ("Euro", "欧元"), + ("Cent", "美分"), + ("Albanian lek", "阿尔巴尼亚列克|列克"), + ("Angolan kwanza", "安哥拉宽扎|宽扎"), + ("Armenian dram", "亚美尼亚德拉姆"), + ("Aruban florin", "阿鲁巴弗罗林|阿鲁巴币"), + ("Bangladeshi taka", "塔卡|孟加拉塔卡"), + ("Paisa", "派萨|帕萨"), + ("Bhutanese ngultrum", "不丹努尔特鲁姆|不丹努扎姆|努扎姆"), + ("Chetrum", "切特鲁姆"), + ("Bolivian boliviano", "玻利维亚诺|玻利维亚币"), + ("Bosnia and Herzegovina convertible mark", "波斯尼亚和黑塞哥维那可兑换马克|波赫可兑换马克"), + ("Botswana pula", "博茨瓦纳普拉|普拉"), + ("Thebe", "thebe"), + ("Brazilian real", "巴西雷亚尔"), + ("Bulgarian lev", "保加利亚列弗|保加利亚列瓦"), + ("Stotinka", "斯托丁卡"), + ("Cambodian riel", "瑞尔"), + ("Cape Verdean escudo", "佛得角埃斯库多|维德角埃斯库多"), + ("Croatian kuna", "克罗地亚库纳|克罗地亚库那|克罗埃西亚库纳"), + ("Lipa", "利巴"), + ("Eritrean nakfa", "厄立特里亚纳克法"), + ("Ethiopian birr", "埃塞俄比亚比尔|埃塞俄比亚元"), + ("Gambian dalasi", "冈比亚达拉西|甘比亚达拉西"), + ("Butut", "布达|布图"), + ("Georgian lari", "格鲁吉亚拉里"), + ("Tetri", "特特里|泰特里"), + ("Ghanaian cedi", "塞地|加纳塞地"), + ("Pesewa", "比塞瓦"), + ("Guatemalan quetzal", "瓜地马拉格查尔"), + ("Haitian gourde", "海地古德"), + ("Honduran lempira", "洪都拉斯伦皮拉"), + ("Hungarian forint", "匈牙利福林|匈牙利货币|匈牙利福林币"), + ("Iranian rial", "伊朗里亚尔|伊朗莱尔"), + ("Yemeni rial", "叶门莱尔|叶门里亚尔"), + ("Israeli new shekel", "₪|ils|以色列币|以色列新克尔|谢克尔"), + ("Japanese yen", "日元|日本元|日币|日圆"), + ("Sen", "日本銭"), + ("Kazakhstani tenge", "哈萨克斯坦坚戈"), + ("Kenyan shilling", "肯尼亚先令"), + ("North Korean won", "朝鲜圆|朝鲜元"), + ("South Korean won", "韩元|韩圆"), + ("Korean won", "₩"), + ("Kyrgyzstani som", "吉尔吉斯斯坦索姆"), + ("Lao kip", "基普|老挝基普|老挝币"), + ("Att", "att"), + ("Lesotho loti", "莱索托洛提|莱索托马洛蒂"), + ("South African rand", "南非兰特"), + ("Macedonian denar", "马其顿代纳尔|马其顿币|代纳尔"), + ("Deni", "第尼"), + ("Malagasy ariary", "马达加斯加阿里亚里"), + ("Iraimbilanja", "伊莱姆比拉贾"), + ("Malawian kwacha", "马拉威克瓦查"), + ("Tambala", "坦巴拉"), + ("Malaysian ringgit", "马来西亚币|马币|马来西亚林吉特"), + ("Mauritanian ouguiya", "毛里塔尼亚乌吉亚"), + ("Khoums", "库姆斯"), + ("Mozambican metical", "莫桑比克梅蒂卡尔|梅蒂卡尔"), + ("Burmese kyat", "缅甸元|缅元"), + ("Pya", "缅分"), + ("Nigerian naira", "尼日利亚奈拉|尼日利亚币|奈拉"), + ("Kobo", "考包"), + ("Turkish lira", "土耳其里拉"), + ("Kuruş", "库鲁"), + ("Omani rial", "阿曼里亚尔|阿曼莱尔"), + ("Panamanian balboa", "巴拿马巴波亚"), + ("Centesimo", "意大利分|乌拉圭分|巴拿马分"), + ("Papua New Guinean kina", "基那"), + ("Toea", "托亚|托伊"), + ("Peruvian sol", "秘鲁索尔"), + ("Polish złoty", "波兰币|波兰兹罗提|兹罗提"), + ("Grosz", "格罗希"), + ("Qatari riyal", "卡达里亚尔"), + ("Saudi riyal", "沙特里亚尔"), + ("Riyal", "里亚尔"), + ("Dirham", "迪拉姆"), + ("Halala", "哈拉"), + ("Samoan tālā", "萨摩亚塔拉"), + ("Sierra Leonean leone", "塞拉利昂利昂|利昂"), + ("Peseta", "比塞塔|西班牙比塞塔|西班牙币"), + ("Swazi lilangeni", "斯威士兰里兰吉尼|兰吉尼"), + ("Tajikistani somoni", "塔吉克斯坦索莫尼"), + ("Thai baht", "泰铢|泰元"), + ("Satang", "萨当"), + ("Tongan paʻanga", "汤加潘加|潘加"), + ("Ukrainian hryvnia", "乌克兰格里夫纳|格里夫纳"), + ("Vanuatu vatu", "瓦努阿图瓦图"), + ("Vietnamese dong", "越南盾"), + ("Indonesian rupiah", "印度尼西亚盾"), + ("Netherlands guilder", "荷兰盾|荷属安的列斯盾|列斯盾"), + ("Surinam florin", "苏里南盾"), + ("Guilder", "盾"), + ("Zambian kwacha", "赞比亚克瓦查"), + ("Moroccan dirham", "摩洛哥迪拉姆"), + ("United Arab Emirates dirham", "阿联酋迪拉姆"), + ("Azerbaijani manat", "阿塞拜疆马纳特"), + ("Turkmenistan manat", "土库曼马纳特"), + ("Manat", "马纳特"), + ("Somali shilling", "索马里先令|索马利先令"), + ("Somaliland shilling", "索马里兰先令"), + ("Tanzanian shilling", "坦桑尼亚先令"), + ("Ugandan shilling", "乌干达先令"), + ("Romanian leu", "罗马尼亚列伊"), + ("Moldovan leu", "摩尔多瓦列伊"), + ("Leu", "列伊"), + ("Ban", "巴尼"), + ("Nepalese rupee", "尼泊尔卢比"), + ("Pakistani rupee", "巴基斯坦卢比"), + ("Indian rupee", "印度卢比"), + ("Seychellois rupee", "塞舌尔卢比"), + ("Mauritian rupee", "毛里求斯卢比"), + ("Maldivian rufiyaa", "马尔代夫卢比"), + ("Sri Lankan rupee", "斯里兰卡卢比"), + ("Rupee", "卢比"), + ("Czech koruna", "捷克克朗"), + ("Danish krone", "丹麦克朗|丹麦克郎"), + ("Norwegian krone", "挪威克朗"), + ("Faroese króna", "法罗克朗"), + ("Icelandic króna", "冰岛克朗"), + ("Swedish krona", "瑞典克朗"), + ("Krone", "克朗"), + ("Øre", "奥依拉|奥拉|埃利"), + ("West African CFA franc", "非共体法郎"), + ("Central African CFA franc", "中非法郎|中非金融合作法郎"), + ("Comorian franc", "科摩罗法郎"), + ("Congolese franc", "刚果法郎"), + ("Burundian franc", "布隆迪法郎"), + ("Djiboutian franc", "吉布提法郎"), + ("CFP franc", "太平洋法郎"), + ("Guinean franc", "几内亚法郎"), + ("Swiss franc", "瑞士法郎"), + ("Rwandan franc", "卢旺达法郎"), + ("Belgian franc", "比利时法郎"), + ("Rappen", "瑞士分|瑞士生丁"), + ("Franc", "法郎"), + ("Centime", "生丁|仙士"), + ("Russian ruble", "俄国卢布|俄罗斯卢布"), + ("Transnistrian ruble", "德涅斯特卢布"), + ("Belarusian ruble", "白俄罗斯卢布"), + ("Kopek", "戈比"), + ("Ruble", "卢布"), + ("Algerian dinar", "阿尔及利亚第纳尔"), + ("Bahraini dinar", "巴林第纳尔"), + ("Iraqi dinar", "伊拉克第纳尔"), + ("Jordanian dinar", "约旦第纳尔"), + ("Kuwaiti dinar", "科威特第纳尔|科威特币"), + ("Libyan dinar", "利比亚第纳尔"), + ("Serbian dinar", "塞尔维亚第纳尔|塞尔维亚币"), + ("Tunisian dinar", "突尼斯第纳尔"), + ("Dinar", "第纳尔"), + ("Fils", "费尔"), + ("Para", "帕拉"), + ("Millime", "米利姆"), + ("Argentine peso", "阿根廷比索"), + ("Chilean peso", "智利比索"), + ("Colombian peso", "哥伦比亚比索"), + ("Cuban peso", "古巴比索"), + ("Dominican peso", "多米尼加比索"), + ("Mexican peso", "墨西哥比索"), + ("Philippine peso", "菲律宾比索"), + ("Uruguayan peso", "乌拉圭比索"), + ("Peso", "比索"), + ("Centavo", "仙|菲辅币"), + ("Alderney pound", "奥尔德尼镑"), + ("British pound", "英镑"), + ("Guernsey pound", "根西镑"), + ("Saint Helena pound", "圣赫勒拿镑"), + ("Egyptian pound", "埃及镑"), + ("Falkland Islands pound", "福克兰镑"), + ("Gibraltar pound", "直布罗陀镑"), + ("Manx pound", "马恩岛镑"), + ("Jersey pound", "泽西岛镑"), + ("Lebanese pound", "黎巴嫩镑"), + ("South Sudanese pound", "南苏丹镑"), + ("Sudanese pound", "苏丹镑"), + ("Syrian pound", "叙利亚镑"), + ("Pence", "便士"), + ("Shilling", "先令"), + ("United States dollar", "美元|美金|美圆"), + ("East Caribbean dollar", "东加勒比元"), + ("Australian dollar", "澳大利亚元|澳元"), + ("Bahamian dollar", "巴哈马元"), + ("Barbadian dollar", "巴巴多斯元"), + ("Belize dollar", "伯利兹元"), + ("Bermudian dollar", "百慕大元"), + ("Brunei dollar", "文莱元"), + ("Singapore dollar", "新加坡元|新元"), + ("Canadian dollar", "加元|加拿大元"), + ("Cayman Islands dollar", "开曼岛元"), + ("New Zealand dollar", "新西兰元|纽元"), + ("Cook Islands dollar", "库克群岛元"), + ("Fijian dollar", "斐济元|斐币"), + ("Guyanese dollar", "圭亚那元"), + ("Hong Kong dollar", "蚊|港元|港圆|港币"), + ("Macau Pataca", "澳门币|澳门元"), + ("New Taiwan dollar", "箍|新台币|台币"), + ("Jamaican dollar", "牙买加元"), + ("Kiribati dollar", "吉里巴斯元"), + ("Liberian dollar", "利比里亚元"), + ("Namibian dollar", "纳米比亚元"), + ("Surinamese dollar", "苏里南元"), + ("Trinidad and Tobago dollar", "特立尼达多巴哥元"), + ("Tuvaluan dollar", "吐瓦鲁元"), + ("Chinese yuan", "人民币|人民币元|元人民币|块钱|块|元|圆"), + ("Fen", "分钱|分"), + ("Jiao", "毛钱|毛|角钱|角"), + ("Finnish markka", "芬兰马克"), + ("Penni", "盆尼"), + ("Bitcoin", "₿|btc|xbt|个比特币|比特币"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afghan afghani", "AFN"), + ("Euro", "EUR"), + ("Albanian lek", "ALL"), + ("Angolan kwanza", "AOA"), + ("Armenian dram", "AMD"), + ("Aruban florin", "AWG"), + ("Bangladeshi taka", "BDT"), + ("Bhutanese ngultrum", "BTN"), + ("Bolivian boliviano", "BOB"), + ("Bosnia and Herzegovina convertible mark", "BAM"), + ("Botswana pula", "BWP"), + ("Brazilian real", "BRL"), + ("Bulgarian lev", "BGN"), + ("Cambodian riel", "KHR"), + ("Cape Verdean escudo", "CVE"), + ("Costa Rican colón", "CRC"), + ("Croatian kuna", "HRK"), + ("Czech koruna", "CZK"), + ("Eritrean nakfa", "ERN"), + ("Ethiopian birr", "ETB"), + ("Gambian dalasi", "GMD"), + ("Georgian lari", "GEL"), + ("Ghanaian cedi", "GHS"), + ("Guatemalan quetzal", "GTQ"), + ("Haitian gourde", "HTG"), + ("Honduran lempira", "HNL"), + ("Hungarian forint", "HUF"), + ("Iranian rial", "IRR"), + ("Yemeni rial", "YER"), + ("Israeli new shekel", "ILS"), + ("Japanese yen", "JPY"), + ("Kazakhstani tenge", "KZT"), + ("Kenyan shilling", "KES"), + ("North Korean won", "KPW"), + ("South Korean won", "KRW"), + ("Kyrgyzstani som", "KGS"), + ("Lao kip", "LAK"), + ("Lesotho loti", "LSL"), + ("South African rand", "ZAR"), + ("Macanese pataca", "MOP"), + ("Macedonian denar", "MKD"), + ("Malagasy ariary", "MGA"), + ("Malawian kwacha", "MWK"), + ("Malaysian ringgit", "MYR"), + ("Mauritanian ouguiya", "MRO"), + ("Mongolian tögrög", "MNT"), + ("Mozambican metical", "MZN"), + ("Burmese kyat", "MMK"), + ("Nicaraguan córdoba", "NIO"), + ("Nigerian naira", "NGN"), + ("Turkish lira", "TRY"), + ("Omani rial", "OMR"), + ("Panamanian balboa", "PAB"), + ("Papua New Guinean kina", "PGK"), + ("Paraguayan guaraní", "PYG"), + ("Peruvian sol", "PEN"), + ("Polish złoty", "PLN"), + ("Qatari riyal", "QAR"), + ("Saudi riyal", "SAR"), + ("Samoan tālā", "WST"), + ("São Tomé and Príncipe dobra", "STD"), + ("Sierra Leonean leone", "SLL"), + ("Swazi lilangeni", "SZL"), + ("Tajikistani somoni", "TJS"), + ("Thai baht", "THB"), + ("Ukrainian hryvnia", "UAH"), + ("Vanuatu vatu", "VUV"), + ("Venezuelan bolívar", "VEF"), + ("Zambian kwacha", "ZMW"), + ("Moroccan dirham", "MAD"), + ("United Arab Emirates dirham", "AED"), + ("Azerbaijani manat", "AZN"), + ("Turkmenistan manat", "TMT"), + ("Somali shilling", "SOS"), + ("Tanzanian shilling", "TZS"), + ("Ugandan shilling", "UGX"), + ("Romanian leu", "RON"), + ("Moldovan leu", "MDL"), + ("Nepalese rupee", "NPR"), + ("Pakistani rupee", "PKR"), + ("Indian rupee", "INR"), + ("Seychellois rupee", "SCR"), + ("Mauritian rupee", "MUR"), + ("Maldivian rufiyaa", "MVR"), + ("Sri Lankan rupee", "LKR"), + ("Indonesian rupiah", "IDR"), + ("Danish krone", "DKK"), + ("Norwegian krone", "NOK"), + ("Icelandic króna", "ISK"), + ("Swedish krona", "SEK"), + ("West African CFA franc", "XOF"), + ("Central African CFA franc", "XAF"), + ("Comorian franc", "KMF"), + ("Congolese franc", "CDF"), + ("Burundian franc", "BIF"), + ("Djiboutian franc", "DJF"), + ("CFP franc", "XPF"), + ("Guinean franc", "GNF"), + ("Swiss franc", "CHF"), + ("Rwandan franc", "RWF"), + ("Russian ruble", "RUB"), + ("Transnistrian ruble", "PRB"), + ("Belarusian ruble", "BYN"), + ("Algerian dinar", "DZD"), + ("Bahraini dinar", "BHD"), + ("Iraqi dinar", "IQD"), + ("Jordanian dinar", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Libyan dinar", "LYD"), + ("Serbian dinar", "RSD"), + ("Tunisian dinar", "TND"), + ("Argentine peso", "ARS"), + ("Chilean peso", "CLP"), + ("Colombian peso", "COP"), + ("Cuban convertible peso", "CUC"), + ("Cuban peso", "CUP"), + ("Dominican peso", "DOP"), + ("Mexican peso", "MXN"), + ("Uruguayan peso", "UYU"), + ("British pound", "GBP"), + ("Saint Helena pound", "SHP"), + ("Egyptian pound", "EGP"), + ("Falkland Islands pound", "FKP"), + ("Gibraltar pound", "GIP"), + ("Manx pound", "IMP"), + ("Jersey pound", "JEP"), + ("Lebanese pound", "LBP"), + ("South Sudanese pound", "SSP"), + ("Sudanese pound", "SDG"), + ("Syrian pound", "SYP"), + ("United States dollar", "USD"), + ("Australian dollar", "AUD"), + ("Bahamian dollar", "BSD"), + ("Barbadian dollar", "BBD"), + ("Belize dollar", "BZD"), + ("Bermudian dollar", "BMD"), + ("Brunei dollar", "BND"), + ("Singapore dollar", "SGD"), + ("Canadian dollar", "CAD"), + ("Cayman Islands dollar", "KYD"), + ("New Zealand dollar", "NZD"), + ("Fijian dollar", "FJD"), + ("Guyanese dollar", "GYD"), + ("Hong Kong dollar", "HKD"), + ("Jamaican dollar", "JMD"), + ("Liberian dollar", "LRD"), + ("Namibian dollar", "NAD"), + ("Solomon Islands dollar", "SBD"), + ("Surinamese dollar", "SRD"), + ("New Taiwan dollar", "TWD"), + ("Trinidad and Tobago dollar", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Chinese yuan", "CNY"), + ("Rial", "__RI"), + ("Shiling", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dollar", "__D"), + ("Manat", "__MA"), + ("Rupee", "__R"), + ("Krone", "__K"), + ("Krona", "__K"), + ("Crown", "__K"), + ("Frank", "__F"), + ("Mark", "__M"), + ("Ruble", "__RB"), + ("Peso", "__PE"), + ("Pound", "__P"), + ("Tristan da Cunha pound", "_TP"), + ("South Georgia and the South Sandwich Islands pound", "_SP"), + ("Somaliland shilling", "_SS"), + ("Pitcairn Islands dollar", "_PND"), + ("Palauan dollar", "_PD"), + ("Niue dollar", "_NID"), + ("Nauruan dollar", "_ND"), + ("Micronesian dollar", "_MD"), + ("Kiribati dollar", "_KID"), + ("Guernsey pound", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dollar", "_CKD"), + ("British Virgin Islands dollar", "_BD"), + ("Ascension pound", "_AP"), + ("Alderney pound", "_ALP"), + ("Abkhazian apsar", "_AA"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarkë", "QINDARKE"), + ("Penny", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENTAVO"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENTIMO"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ] + ) + CompoundUnitConnectorRegex = '(?又|再)' + CurrencyPrefixList = dict( + [ + ("Dollar", "$"), + ("United States dollar", "us$"), + ("British Virgin Islands dollar", "bvi$"), + ("Brunei dollar", "b$"), + ("Sen", "sen"), + ("Singapore dollar", "s$"), + ("Canadian dollar", "can$|c$|c $"), + ("Cayman Islands dollar", "ci$"), + ("New Zealand dollar", "nz$|nz $"), + ("Guyanese dollar", "gy$|gy $|g$|g $"), + ("Hong Kong dollar", "hk$|hkd|hk $"), + ("Jamaican dollar", "j$"), + ("Namibian dollar", "nad|n$|n $"), + ("Solomon Islands dollar", "si$|si $"), + ("New Taiwan dollar", "nt$|nt $"), + ("Samoan tālā", "ws$"), + ("Chinese yuan", "¥"), + ("Japanese yen", "¥"), + ("Turkish lira", "₺"), + ("Euro", "€"), + ("Pound", "£"), + ("Costa Rican colón", "₡"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) CurrencyAmbiguousValues = [r'元', r'仙', r'分', r'圆', r'块', r'毛', r'盾', r'箍', r'蚊', r'角'] - DimensionSuffixList = dict([("Meter", "米|公尺|m"), - ("Kilometer", "千米|公里|km"), - ("Decimeter", "分米|公寸|dm"), - ("Centimeter", "釐米|厘米|公分|cm"), - ("Micrometer", "毫米|公釐|mm"), - ("Microns", "微米"), - ("Picometer", "皮米"), - ("Nanometer", "纳米"), - ("Li", "里|市里"), - ("Zhang", "丈"), - ("Chi", "市尺|尺"), - ("Cun", "市寸|寸"), - ("Fen", "市分|分"), - ("Hao", "毫"), - ("Mile", "英里"), - ("Inch", "英寸"), - ("Foot", "呎|英尺"), - ("Yard", "码"), - ("Knot", "海里"), - ("Light year", "光年"), - ("Meter per second", "米每秒|米/秒|m/s"), - ("Kilometer per hour", "公里每小时|千米每小时|公里/小时|千米/小时|km/h"), - ("Kilometer per minute", "公里每分钟|千米每分钟|公里/分钟|千米/分钟|km/min"), - ("Kilometer per second", "公里每秒|千米每秒|公里/秒|千米/秒|km/s"), - ("Mile per hour", "英里每小时|英里/小时"), - ("Foot per second", "英尺每小时|英尺/小时"), - ("Foot per minute", "英尺每分钟|英尺/分钟"), - ("Yard per minute", "码每分|码/分"), - ("Yard per second", "码每秒|码/秒"), - ("Square centimetre", "平方厘米"), - ("Square decimeter", "平方分米"), - ("Square meter", "平方米"), - ("Square kilometer", "平方公里"), - ("Acre", "英亩|公亩"), - ("Hectare", "公顷"), - ("Mu", "亩|市亩"), - ("Liter", "公升|升|l"), - ("Milliliter", "毫升|ml"), - ("Cubic meter", "立方米"), - ("Cubic decimeter", "立方分米"), - ("Cubic millimeter", "立方毫米"), - ("Cubic feet", "立方英尺"), - ("Gallon", "加仑"), - ("Pint", "品脱"), - ("Dou", "市斗|斗"), - ("Dan", "市石|石"), - ("Kilogram", "千克|公斤|kg"), - ("Gram", "克|g"), - ("Milligram", "毫克|mg"), - ("Microgram", "微克|μg"), - ("Ton", "公吨|吨|t"), - ("Pound", "磅"), - ("Ounce", "盎司"), - ("Jin", "市斤|斤"), - ("Liang", "两"), - ("Barrel", "桶"), - ("Pot", "罐"), - ("Bit", "比特|位|b|bit"), - ("Kilobit", "千比特|千位|kb|Kb"), - ("Megabit", "兆比特|兆位|mb|Mb"), - ("Gigabit", "十亿比特|千兆比特|十亿位|千兆位|gb|Gb"), - ("Terabit", "万亿比特|兆兆比特|万亿位|兆兆位|tb|Tb"), - ("Petabit", "千兆兆比特|千万亿比特|千兆兆位|千万亿位|pb|Pb"), - ("Byte", "字节|byte|Byte"), - ("Kilobyte", "千字节|kB|KB"), - ("Megabyte", "兆字节|mB|MB"), - ("Gigabyte", "十亿字节|千兆字节|gB|GB"), - ("Terabyte", "万亿字节|兆兆字节|tB|TB"), - ("Petabyte", "千兆兆字节|千万亿字节|pB|PB")]) - DimensionAmbiguousValues = [r'丈', r'位', r'克', r'分', r'升', r'寸', r'尺', r'斗', r'斤', r'桶', r'毫', r'石', r'码', r'磅', r'米', r'罐', r'里', r'm', r'km', r'dm', r'cm', r'mm', r'l', r'ml', r'kg', r'mg', r'g', r't', r'b', r'byte', r'kb', r'mb', r'gb', r'tb', r'pb'] - AmbiguityFiltersDict = dict([("五角", "五角大楼"), - ("普尔", "标准普尔")]) - TemperatureSuffixList = dict([("F", "华氏温度|华氏度|°f"), - ("K", "开尔文温度|开氏度|凯氏度|K|k"), - ("R", "兰氏温度|°r"), - ("C", "摄氏温度|摄氏度|°c"), - ("Degree", "度")]) - TemperaturePrefixList = dict([("F", "华氏温度|华氏"), - ("K", "开氏温度|开氏"), - ("R", "兰氏温度|兰氏"), - ("C", "摄氏温度|摄氏")]) - TemperatureAmbiguousValues = [r'度', r'k'] - HalfUnitRegex = f'半' + AmbiguityFiltersDict = dict([("五角", "五角大楼"), ("普尔", "标准普尔")]) + HalfUnitRegex = '半' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/dutch_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/dutch_numeric_with_unit.py index 65c0511124..c0e5116822 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/dutch_numeric_with_unit.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/dutch_numeric_with_unit.py @@ -9,670 +9,865 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_numbers import BaseNumbers + # pylint: disable=line-too-long class DutchNumericWithUnit: - AgeSuffixList = dict([("Year", "jaren oud|jaar oud|jaar|jaren|levensjaren|jarige leeftijd|-jarige leeftijd|-jarige|jarige"), - ("Month", "maanden oud|maand oud|maand|maanden"), - ("Week", "week oud|weken oud|week|weken"), - ("Day", "dag oud|dagen oud|dag|dagen")]) - AreaSuffixList = dict([("Square kilometer", "vierkante km|vierkante kilometer|kilometer km2|kilometer km^2|km^2|km²|km2"), - ("Square hectometer", "vierkante hm|vierkante hectometer|hm^2|hm²|hektar|hm2"), - ("Square decameter", "vierkante dam|vierkante decameter|dam^2|dam²|dam2"), - ("Square meter", "vierkante m|vierkante meter|m^2|m²|m2"), - ("Square decimeter", "vierkante dm|vierkante decimeter|dm^2|dm²|dm2"), - ("Square centimeter", "vierkante cm|vierkante centimeter|cm^2|cm²|cm2"), - ("Square millimeter", "vierkante mm|vierkante millimeter|mm^2|mm²|mm2"), - ("Square inch", "in2|in^2|in²"), - ("Square foot", "ft2|ft^2|ft²"), - ("Square mile", "vierkante mijl|mi^2|mi²|mi2"), - ("Square yard", "vierkante yard|yd^2|yd²|yd2"), - ("Hectare", "hectare|ha"), - ("Acre", "are")]) - InformationSuffixList = dict([("Bit", "-bit|bit|bits"), - ("Kilobit", "kilobit|kilobits|kb|Kb|kbit"), - ("Megabit", "megabit|megabits|Mb|mb|Mbit"), - ("Gigabit", "gigabit|gigabits|Gb|gb|Gbit"), - ("Terabit", "terabit|terabits|Tb|tb|Tbit"), - ("Petabit", "petabit|petabits|Pb|pb|Pbit"), - ("Byte", "-byte|byte|bytes"), - ("Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|KB|kilobytes|kilo byte|kilo bytes|kByte"), - ("Megabyte", "-megabyte|-megabytes|megabyte|mB|MB|megabytes|mega byte|mega bytes|MByte"), - ("Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|GB|gigabytes|giga byte|giga bytes|GByte"), - ("Terabyte", "-terabyte|-terabytes|terabyte|tB|TB|terabytes|tera byte|tera bytes|TByte"), - ("Petabyte", "-petabyte|-petabytes|petabyte|pB|PB|petabytes|peta byte|peta bytes|PByte")]) - AmbiguousDimensionUnitList = [r'vat', r'voet', r'voeten', r'ons', r'dm', r'"'] - BuildPrefix = f'(?<=(\\s|^))' - BuildSuffix = f'(?=(\\s|\\W|$))' - LengthSuffixList = dict([("Kilometer", "km|kilometer|kilometers|kilometers"), - ("Hectometer", "hm|hectometer|hectometers"), - ("Decameter", "dam|decameter|decameters"), - ("Meter", "m|meter|meters"), - ("Decimeter", "dm|decimeter|decimeters"), - ("Centimeter", "cm|centimeter|centimeters"), - ("Millimeter", "mm|millimeter|millimeters"), - ("Micrometer", "μm|micrometer|micrometers"), - ("Nanometer", "nm|nanometer|nanometers|millimicron"), - ("Picometer", "pm|picometer|picometers"), - ("Mile", "-mijl|mijl|mijlen"), - ("Inch", "-inch|inch|inches"), - ("Foot", "-voet|voet"), - ("Light year", "lichtjaar|lichtjaren|lj"), - ("Pt", "pt|pts")]) - AmbiguousLengthUnitList = [r'm', r'pm', r'pt', r'pts'] - SpeedSuffixList = dict([("Meter per second", "meters / seconde|m/s|m per seconde|meters per seconde|meters per secondes|meter per seconde|meter per secondes"), - ("Kilometer per hour", "km/h|km/u|km per uur|kilometer per uur|kilometers per uur"), - ("Kilometer per minute", "km/min|kilometers per minuut|kilometer per minuut"), - ("Kilometer per second", "km/s|kilometers per seconde|kilometers per seconde"), - ("Mile per hour", "mph|mijl per uur|mijlen per hour"), - ("Knot", "kt|knopen"), - ("Foot per second", "ft/s|voet/s|voet per seconde"), - ("Foot per minute", "ft/min|voet/min|voet per minuut")]) - TemperatureSuffixList = dict([("F", "graden fahrenheit|graden f|gr. f|°f|fahrenheit|f"), - ("K", "k|K|kelvin"), - ("R", "rankine|°r"), - ("D", "delisle|°de"), - ("C", "graden celsius|graden c|gr. c|°c|c|celsius"), - ("Degree", "graden|gradendeg.|deg|°")]) - AmbiguousTemperatureUnitList = [r'c', r'f', r'k'] - VolumeSuffixList = dict([("Cubic meter", "m3|m^3|m³|kubieke meter|kubieke meters|kuub"), - ("Cubic centimeter", "cm3|cm^3|cm³|kubieke centimeter|kubieke centimetre|kubieke centimeters"), - ("Cubic millimiter", "mm3|mm^3|mm³|kubieke millimiter"), - ("Hectoliter", "hl|hectoliter|hectoliters"), - ("Decaliter", "dal|decaliter|decaliters"), - ("Liter", "l|liter|-liter|liters"), - ("Deciliter", "dl|-deciliter|deciliter|deciliters"), - ("Centiliter", "cl|-centiliter|centiliter|centiliters"), - ("Milliliter", "ml|-mililiter|milliliter|milliliters"), - ("Cubic inch", "in3|in^3|in³|kubieke inch"), - ("Cubic foot", "kubieke voet"), - ("Cubic mile", "kubieke mijl"), - ("Teaspoon", "theelepel|theelepels|tl"), - ("Tablespoon", "eetlepel|eetlepels|el"), - ("Pint", "pint|pints")]) - AmbiguousVolumeUnitList = [r'l', r'ons', r'oz', r'cup', r'peck', r'cord', r'gill'] - WeightSuffixList = dict([("Kilogram", "kg|kilogram|kilo"), - ("Gram", "g|gram"), - ("Milligram", "mg|milligram"), - ("Microgram", "μg|microgram"), - ("Barrel", "vat|vaten"), - ("Gallon", "-gallon|gallon"), - ("Metric ton", "metrische ton"), - ("Ton", "-ton|ton|t"), - ("Pound", "-pond|pond"), - ("Ounce", "-ons|ons")]) - AmbiguousWeightUnitList = [r'g', r't', r'oz'] - CurrencySuffixList = dict([("Abkhazian apsar", "abkhazian apsar|apsars"), - ("Afghan afghani", "afghaanse afghani|؋|afn|afghanis|afghani"), - ("Pul", "pul"), - ("Euro", "euros|euro|€|eur"), - ("Cent", "cents|cent|-cents|-cent"), - ("Kwartje", "kwartje"), - ("Dubbeltje", "dubbeltje"), - ("Stuiver", "stuiver"), - ("Tientje", "tientje"), - ("Albanian lek", "albanese lek|leks|lek"), - ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), - ("Angolan kwanza", "angolese kwanza|kz|aoa|kwanza|kwanzas|angolese kwanzas"), - ("Armenian dram", "armeense dram|dram"), - ("Aruban florin", "arubaanse florin|arubaanse florins|ƒ|awg|arubaanse florijn|arubaanse florijnen"), - ("Bangladeshi taka", "bengalese taka|৳|bdt|taka|takas|bengalese takas"), - ("Paisa", "poisha|paisa"), - ("Bhutanese ngultrum", "bhutaanse ngultrum|nu.|btn|ngultrum"), - ("Chetrum", "chetrums|chetrum"), - ("Bolivian boliviano", "boliviaanse boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|boliviaanse bolivianos|boliviano"), - ("Bosnia and Herzegovina convertible mark", "bosnische inwisselbare mark|bosnia and herzegovina convertible mark|bam"), - ("Fening", "fenings|fenings"), - ("Botswana pula", "botswaanse pula|bwp|pula|pulas|botswaanse pulas"), - ("Thebe", "thebe"), - ("Brazilian real", "braziliaanse real|r$|brl|brazil real|brazil reals|braziliaanse reals|real|reals"), - ("Bulgarian lev", "bulgaarse lev|bgn|лв|bulgaria lev|bulgaria levs|bulgaarse levs"), - ("Stotinka", "stotinki|stotinka"), - ("Cambodian riel", "cambodjaanse riel|khr|៛|cambodia riel|cambodia riels|cambodjaanse riels|riel|riels"), - ("Cape Verdean escudo", "kaapverdische escudo|cve|escudo"), - ("Costa Rican colón", "costa ricaanse colonolón|costa ricaanse colóns|crc|₡|costa rica colón|costa rica colóns|ccosta ricaanse colon|costa ricaanse colons|costa rica colon|costa rica colons"), - ("Salvadoran colón", "svc|salvadoraanse colón|salvadoraanse colóns|salvador colón|salvador colóns|salvadoraanse colon|salvadoraanse colons|salvador colon|salvador colons"), - ("Céntimo", "céntimo"), - ("Croatian kuna", "kroatische kuna|kn|hrk|croatia kuna|kroatische kunas|kroatische kuna kunas|kuna"), - ("Lipa", "lipa"), - ("Czech koruna", "tsjechische kroon|tsjechische kronen|czech koruna|czk|Kč|czech korunas|tsjechische koruna|tsjechische korunas|koruna|korunas"), - ("Haléř", "haléř"), - ("Eritrean nakfa", "eritrese nakfa|nfk|ern|eritrese nakfas|nakfa|nakfas"), - ("Ethiopian birr", "ethiopische birr|etb|birr"), - ("Gambian dalasi", "gambiaanse dalasi|gmd|dalasi"), - ("Butut", "bututs|butut"), - ("Georgian lari", "georgische lari|lari|gel|₾"), - ("Tetri", "tetri"), - ("Ghanaian cedi", "ghanese cedi|ghs|₵|gh₵|cedi"), - ("Pesewa", "pesewas|pesewa"), - ("Guatemalan quetzal", "guatemalteekse quetzal|gtq|guatemala quetzal|quetzal"), - ("Haitian gourde", "haïtiaanse gourde|haitiaanse gourde|htg|gourde"), - ("Honduran lempira", "hondurese lempira|hnl|lempira"), - ("Hungarian forint", "hongaarse forint|huf|ft|hungary forint|hungary forints|hongaarse forints|forint|forints"), - ("Fillér", "fillér"), - ("Iranian rial", "iraanse rial|irr|iran rial|iran rials|iraanse rials"), - ("Yemeni rial", "jemenitische rial|yer|jemenitische rials"), - ("Israeli new shekel", "israëlische sjekel|israelische sjekel|₪|ils|sjekel"), - ("Lithuanian litas", "ltl|litouwse litas|lithuan litas|litouwse lit|lithuan lit"), - ("Japanese yen", "japanse yen|jpy|yen|-yen|¥|yens|japanse yens|japan yen|japan yens"), - ("Kazakhstani tenge", "kazachse tenge|kzt"), - ("Kenyan shilling", "keniaanse shilling|kes"), - ("North Korean won", "noord-koreaanse won|noord koreaanse won|kpw|noord-koreaanse wons|noord koreaanse wons"), - ("South Korean won", "zuid-koreaanse won|zuid koreaanse won|krw|zuid-koreaanse wons|zuid koreaanse wons"), - ("Korean won", "koreaanse won|₩|koreaanse wons"), - ("Kyrgyzstani som", "kirgizische som|kgs"), - ("Uzbekitan som", "oezbeekse sum|uzs"), - ("Lao kip", "laotiaanse kip|lao kip|lak|₭n|₭"), - ("Att", "att"), - ("Lesotho loti", "lesothaanse loti|lesotho loti|lsl|loti"), - ("Sente", "sente|lisente"), - ("South African rand", "zuid-afrikaanse rand|zuid afrikaanse rand|south african rand|zar|south africa rand|south africa rands|south african rands"), - ("Macanese pataca", "macause pataca|macanese pataca|mop$|mop|pataca"), - ("Avo", "avos|avo"), - ("Macedonian denar", "macedonische denar|macedonian denar|mkd|ден"), - ("Deni", "deni"), - ("Malagasy ariary", "malagassische ariary|malagasy ariary|mga|ariary"), - ("Iraimbilanja", "iraimbilanja"), - ("Malawian kwacha", "malawische kwacha|malawian kwacha|mk|mwk"), - ("Tambala", "tambala"), - ("Malaysian ringgit", "maleisische ringgit|rm|myr|malaysia ringgit|malaysia ringgits|maleisische ringgits"), - ("Mauritanian ouguiya", "mauritaanse ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritaanse ouguiyas"), - ("Khoums", "khoums"), - ("Mongolian tögrög", "mongoolse tugrik|mongoolse tugriks|mongoolse tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongoolse tögrögs|mongoolse togrog|mongoolse togrogs|mongolia togrog|mongolia togrogs"), - ("Mozambican metical", "mozambikaanse metical|mt|mzn|mozambica metical|mozambica meticals|mozambikaanse meticals"), - ("Burmese kyat", "myanmarese kyat|burmese kyat|ks|mmk"), - ("Pya", "pya"), - ("Nicaraguan córdoba", "nicaraguaanse córdoba|nio"), - ("Nigerian naira", "nigeriaanse naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigeriaanse nairas"), - ("Kobo", "kobo"), - ("Turkish lira", "turkse lira|try|tl|turkey lira|turkey liras|turkse liras"), - ("Kuruş", "kuruş"), - ("Omani rial", "omaanse rial|omani rial|omr|ر.ع."), - ("Panamanian balboa", "panamese balboa|panamanian balboa|b/.|pab"), - ("Centesimo", "centesimo"), - ("Papua New Guinean kina", "papoea-nieuw-guinese kina|papoea nieuw guinese kina|papua new guinean kina|kina|pgk"), - ("Toea", "toea"), - ("Paraguayan guaraní", "paraguayaanse guarani|paraguayan guaraní|₲|pyg|guarani|guaraní"), - ("Peruvian sol", "peruviaanse sol|peruviaanse nieuwe sol|sol|soles|sol|peruviaanse nuevo sol"), - ("Polish złoty", "złoty|poolse złoty|zł|pln|zloty|poolse zloty|poland zloty|poland złoty"), - ("Grosz", "groszy|grosz|grosze"), - ("Qatari riyal", "qatarese rial|qatarese rials|qatarese riyal|qar|qatarese riyals|qatar riyal|qatar riyals"), - ("Saudi riyal", "saoedi-arabische riyal|saoedi-arabische riyals|saoedi arabische riyal|saoedi arabische riyals|saudi riyal|sar|saudi riyals|saoedi riyal|saoedi riyals"), - ("Riyal", "riyal|riyals|rial|rials|﷼"), - ("Dirham", "dirham|dirhem|dirhm"), - ("Halala", "halalas|halala"), - ("Samoan tālā", "samoaanse tālā|tālā|tala|ws$|samoa|wst|samoaanse tala"), - ("Sene", "sene"), - ("São Tomé and Príncipe dobra", "santomese dobra|são tomé and príncipe dobra|dobras|dobra|std"), - ("Sierra Leonean leone", "sierra leoonse leone|sierra Leonean leone|sll|leone|le"), - ("Peseta", "spaanse peseta|spaanse pesetas|pesetas|peseta"), - ("Netherlands guilder", "florin|netherlands antillean guilder|ang|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl"), - ("Swazi lilangeni", "swazische lilangeni|swazi lilangeni|lilangeni|szl|emalangeni"), - ("Tajikistani somoni", "tadzjiekse somoni|tajikistani somoni|tjs|somoni"), - ("Diram", "dirams|diram"), - ("Thai baht", "thaise baht|hai baht|฿|thb|baht"), - ("Satang", "satang|satangs"), - ("Tongan paʻanga", "tongaanse paʻanga|paʻanga|tongaanse pa'anga|pa'anga"), - ("Seniti", "seniti"), - ("Ukrainian hryvnia", "oekraïense grivna|oekraiense grivna|eukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias|grivna|grivnya"), - ("Vanuatu vatu", "vanuatuaanse vatu|vanuatu vatu|vatu|vuv"), - ("Venezuelan bolívar", "venezolaanse bolivar|venezolaanse bolívar|venezolaanse bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivars|venezolaanse bolivar|venezolaanse bolivars"), - ("Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"), - ("Zambian kwacha", "zambiaanse kwacha|zk|zmw|zambia kwacha|kwachas|zambiaanse kwachas"), - ("Moroccan dirham", "marokkaanse dirham|moroccan dirham|mad|د.م."), - ("United Arab Emirates dirham", "vae-dirham|vae dirham|verenigde arabische emiraten dirham|verenigde-arabische-emiraten dirham|united arab emirates dirham|د.إ|aed"), - ("Azerbaijani manat", "azerbeidzjaanse manat|azerbaijani manat|azn"), - ("Turkmenistan manat", "turkmeense manat|turkmeense nieuwe manat|turkmenistan manat|turkmenistan new manat|tmt"), - ("Manat", "manats|manat"), - ("Qəpik", "qəpik"), - ("Somali shilling", "somalische shilling|somalische shillings|somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos"), - ("Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"), - ("Tanzanian shilling", "tanzaniaanse shilling|tanzaniaanse shillings|tsh|tzs|tanzania shilling|tanzania shillings"), - ("Ugandan shilling", "oegandese shilling|oegandese shillings|ugx|uganda shilling|uganda shillings"), - ("Romanian leu", "roemeense leu|ron|romania leu"), - ("Moldovan leu", "moldavische leu|mdl|moldova leu"), - ("Leu", "leu|lei"), - ("Ban", "bani|-ban|ban"), - ("Nepalese rupee", "nepalese roepie|nepalese rupee|npr"), - ("Pakistani rupee", "pakistaanse roepie|pakistani rupee|pkr"), - ("Indian rupee", "indiase roepie|indian rupee|inr|₹|india rupee"), - ("Seychellois rupee", "seychelse roepie|seychellois rupee|scr|sr|sre"), - ("Mauritian rupee", "mauritiaanse roepie|mauritian rupee|mur"), - ("Maldivian rufiyaa", "maldivische rufiyaa|maldivian rufiyaa|mvr|.ރ|maldive rufiyaa"), - ("Sri Lankan rupee", "sri lankaanse roepie|sri lankan rupee|lkr|රු|ரூ"), - ("Indonesian rupiah", "indonesische roepia|indonesische rupiah|indonesian rupiah|rupiah|perak|rp|idr|roepia"), - ("Rupee", "roepie|rupee|rs"), - ("Danish krone", "deense kroon|dansk krone|dkk|denmark krone|denmark krones|deense kronen"), - ("Norwegian krone", "noorse kroon|nok|norway krone|norway krones|noorse kronen"), - ("Faroese króna", "faeröerse kroon|faeroerse kroon|faroese króna|faroese krona"), - ("Icelandic króna", "ijslandse kroon|ijslandse kronen|icelandic króna|isk|icelandic krona|iceland króna|iceland krona"), - ("Swedish krona", "zweedse kroon|zweedse kronen|swedish krona|swedish kronor|sek"), - ("Estonian kroon", "estische kroon|estische kronen|stonian kroon"), - ("Krone", "kroon|kronen|kronor|krona|króna|krone|krones|kr|-kr"), - ("Øre", "öre|Øre|oyra|eyrir"), - ("West African CFA franc", "west afrikaanse cfa frank|west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc"), - ("Central African CFA franc", "centraal afrikaanse cfa frank|central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc"), - ("Comorian franc", "comorese frank|comorese franc|comorian franc|kmf"), - ("Congolese franc", "congolese frank|congolese franc|cdf"), - ("Burundian franc", "burundese frank|burundese franc|burundian franc|bif"), - ("Djiboutian franc", "djiboutiaanse frank|djiboutiaanse franc|djiboutian franc|djf"), - ("CFP franc", "cfp-frank|cfp frank|cfp franc|xpf"), - ("Guinean franc", "guineese frank|guineese franc|guinean franc|gnf"), - ("Swiss franc", "zwitserse frank|zwitserse franc|swiss francs|swiss franc|chf|sfr."), - ("Rwandan franc", "rwandese frank|rwandese franc|Rwandan franc|rwf|rf|r₣|frw"), - ("Belgian franc", "belgische frank|bi.|b.fr.|bef|belgium franc"), - ("Rappen", "rappen|-rappen"), - ("Franc", "frank|franken|francs|franc|fr.|fs|ff|fc"), - ("Centime", "centimes|centime|santim"), - ("Russian ruble", "russische roebel|₽|rub|russia ruble|russia ₽|russian ₽|russische ₽|russische roebels"), - ("New Belarusian ruble", "nieuwe wit-russische roebel|nieuwe wit russische roebel|nieuwe witrussische roebel|new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles"), - ("Old Belarusian ruble", "oude wit-russische roebel|oude wit russische roebel|oude witrussische roebel|old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles"), - ("Transnistrian ruble", "transnistrische roebel|transnistrische roebels|transnistrian ruble|prb|р."), - ("Belarusian ruble", "wit-russische roebel|wit russische roebel|witrussische roebel|belarusian ruble|belarus ruble|belarus rubles"), - ("Kopek", "kopek|kopeken|kopeks"), - ("Kapyeyka", "kapyeyka"), - ("Ruble", "roebel|roebels|rubles|ruble|br"), - ("Algerian dinar", "algerijnse dinars|algerijnse dinar|algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"), - ("Bahraini dinar", "bahreinse dinars|bahreinse dinar|bahraini dinars|bahraini dinar|bhd|.د.ب"), - ("Santeem", "santeem|santeems"), - ("Iraqi dinar", "iraakse dinars|iraakse dinar|iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"), - ("Jordanian dinar", "jordaanse dinars|jordaanse dinar|jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"), - ("Kuwaiti dinar", "koeweitse dinars|koeweitse dinar|kuwaiti dinars|kuwaiti dinar|kwd|د.ك"), - ("Libyan dinar", "libische dinars|libische dinar|libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"), - ("Serbian dinar", "servische dinars|servische dinar|serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"), - ("Tunisian dinar", "tunesische dinars|tunesische dinar|tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"), - ("Yugoslav dinar", "joegoslavische dinars|joegoslavische dinar|yugoslav dinars|yugoslav dinar|yun"), - ("Dinar", "dinars|dinar|denar|-dinars|-dinar"), - ("Fils", "fils|fulūs|-fils|-fil"), - ("Para", "para|napa"), - ("Millime", "millimes|millime"), - ("Argentine peso", "argentijnse pesos|argentijnse peso|argentine peso|ars|argetina peso|argetina pesos|argentine pesos"), - ("Chilean peso", "chileense pesos|chileense peso|chilean pesos|chilean peso|clp|chile peso|chile peso"), - ("Colombian peso", "colombiaanse pesos|colombiaanse peso|colombian pesos|colombian peso|cop|colombia peso|colombia pesos"), - ("Cuban convertible peso", "convertibele pesos|convertibele peso|cubaanse convertible pesos|cubaanse convertible peso|cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"), - ("Cuban peso", "cubaanse pesos|cubaanse peso|cuban pesos|cuban peso|cup|cuba pesos|cuba peso"), - ("Dominican peso", "dominicaanse pesos|dominicaanse peso|dominican pesos|dominican peso|dop|dominica pesos|dominica peso"), - ("Mexican peso", "mexicaanse pesos|mexicaanse peso|mexican pesos|mexican peso|mxn|mexico pesos|mexico peso"), - ("Philippine peso", "filipijnse pesos|filipijnse peso|piso|philippine pesos|philippine peso|₱|php"), - ("Uruguayan peso", "uruguayaanse pesos|uruguayaanse peso|uruguayan pesos|uruguayan peso|uyu"), - ("Peso", "pesos|peso"), - ("Centavo", "centavos|centavo"), - ("Alderney pound", "alderney pond|alderney pounds|alderney pound|alderney £"), - ("British pound", "pond sterling|britse pond|britse ponden|britse £|british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots"), - ("Guernsey pound", "guernsey pounds|guernsey £|ggp"), - ("Ascension pound", "ascension ponden|ascension pond|ascension pounds|ascension pound|ascension £"), - ("Saint Helena pound", "sint-heleens pond|sint-heleens £|sint heleens pond|sint heleens £|saint helena pounds|saint helena pound|saint helena £|shp"), - ("Egyptian pound", "egyptische pond|egyptische £|egyptische ponden|egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"), - ("Falkland Islands pound", "falklandeilanden pond|falklandeilandse pond|falklandeilandse £|falklandeilanse ponden|falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £"), - ("Gibraltar pound", "gibraltarees pond|gibraltarees £|gibraltar pounds|gibraltar pound|gibraltar £|gip"), - ("Manx pound", "isle of man-pond|isle of man pond|isle of man-£|isle of man £|manx pounds|manx pound|manx £|imp"), - ("Jersey pound", "jerseypond|jerseyponden|jersey pounds|jersey pound|jersey £|jep"), - ("Lebanese pound", "libanese ponden|libanese pond|libanese £|lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل"), - ("South Georgia and the South Sandwich Islands pound", "zuid-georgia en de zuidelijke sandwicheilanden ponden|zuid-georgia en de zuidelijke sandwicheilanden pond|zuid-georgia en de zuidelijke sandwicheilanden £|south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"), - ("South Sudanese pound", "zuid sudanese ponden|zuid sudanese pond|zuid sudanese £|south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"), - ("Sudanese pound", "sudanese ponden|sudanese pond|sudanese £|sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"), - ("Syrian pound", "syrische ponden|syrische pond|syrische £|syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"), - ("Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"), - ("Pound", "pond|ponden|-pond|-ponden|pounds|pound|-pounds|-pound|£"), - ("Pence", "pence"), - ("Shilling", "shillings|shilling|shilingi|sh"), - ("Penny", "pennies|penny"), - ("United States dollar", "amerikaanse dollars|amerikaanse dollar|amerikaanse $|united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|US dollar|US dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars"), - ("East Caribbean dollar", "oost-caribische dollars|oost-caribische dollar|oost-caribische $|oost caribische dollars|oost caribische $|oost caribische dollar|east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"), - ("Australian dollar", "australische dollars|australische dollar|australische $|australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$"), - ("Bahamian dollar", "bahamaanse dollars|bahamaanse dollar|bahamaanse $|bahama $|bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$"), - ("Barbadian dollar", "barbadiaanse dollars|barbadiaanse dollar|barbadiaanse $|barbada $|barbadian dollars|barbadian dollar|barbadian $|bbd"), - ("Belize dollar", "belizaanse dollars|belizaanse dollar|belizaanse $|belize dollars|belize dollar|belize $|bzd"), - ("Bermudian dollar", "bermudaanse dollars|bermudaanse dollar|bermudaanse $|bermuda $|bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $"), - ("British Virgin Islands dollar", "britse maagdeneilanden dollars|britse maagdeneilanden dollar|britse maagdeneilanden $|british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"), - ("Brunei dollar", "bruneise dollars|bruneise dollar|bruneise $|brunei dollar|brunei $|bnd"), - ("Sen", "sen"), - ("Singapore dollar", "singaporese dollars|singaporese dollar|Singaporese $|singapore dollars|singapore dollar|singapore $|s$|sgd"), - ("Canadian dollar", "canadese dollars|canadese dollar|canadese $|canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $"), - ("Cayman Islands dollar", "kaaimaneilandse dollars|kaaimaneilandse dollar|kaaimaneilandse $|cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $"), - ("New Zealand dollar", "nieuw-zeelandse dollars|nieuw-zeelandse dollar|nieuw-zeelandse $|nieuw zeelandse dollars|nieuw zeelandse dollar|nieuw zeelandse $|new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"), - ("Cook Islands dollar", "cookeilandse dollars|cookeilandse dollar|cookeilandse $|cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $"), - ("Fijian dollar", "fiji-dollars|fiji-dollar|fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"), - ("Guyanese dollar", "guyaanse dollars|guyaanse dollar|guyaanse $|guyanese dollars|guyanese dollar|gyd|gy$"), - ("Hong Kong dollar", "hongkongse dollars|hongkongse dollar|hongkongse $|hongkong dollars|hongkong dollar|hongkong $|hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"), - ("Jamaican dollar", "jamaicaanse dollars|jamaicaanse dollar|jamaicaanse $|jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"), - ("Kiribati dollar", "kiribatische dollars|kiribatische dollar|kiribatische $|kiribati dollars|kiribati dollar|kiribati $"), - ("Liberian dollar", "liberiaanse dollars|liberiaanse dollar|liberiaanse $|liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"), - ("Micronesian dollar", "micronesische dollars|micronesische dollar|micronesische $|micronesia dollars|micronesia dollar|micronesia $|micronesian dollars|micronesian dollar|micronesian $"), - ("Namibian dollar", "namibische dollars|namibische dollar|namibische $|namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"), - ("Nauruan dollar", "nauruaanse dollars|nauruaanse dollar|nauruaanse $|nauruan dollars|nauruan dollar|nauruan $"), - ("Niue dollar", "niue dollars|niue dollar|niue $"), - ("Palauan dollar", "palaus dollars|palaus dollar|palaus $|palauan dollars|palauan dollar|palauan $"), - ("Pitcairn Islands dollar", "pitcairneilandse dollars|pitcairneilandse dollar|pitcairneilandse $|pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"), - ("Solomon Islands dollar", "salomon-dollars|salomon-dollar|salomon-$|salomon dollars|salomon dollar|salomon $|solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"), - ("Surinamese dollar", "surinaamse dollars|surinaamse dollar|surinaamse $|surinamese dollars|surinamese dollar|surinamese $|srd"), - ("New Taiwan dollar", "taiwanese dollars|taiwanese dollar|taiwanese $|nieuw taiwanese dollars|nieuw taiwanese dollar|nieuw taiwanese $|new taiwan dollars|new taiwan dollar|nt$|twd|ntd"), - ("Trinidad and Tobago dollar", "trinidad en tobagodollars|trinidad en tobagodollar|trinidad en tobago dollars|trinidad en tobago dollar|trinidad en tobago $|trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"), - ("Tuvaluan dollar", "tuvaluaanse dollars|tuvaluaanse dollar|tuvaluaanse $|tuvaluan dollars|tuvaluan dollar|tuvaluan $"), - ("Dollar", "dollars|dollar|$"), - ("Chinese yuan", "chinese renminbi|chinese yuan|yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"), - ("Fen", "fen"), - ("Jiao", "jiao|mao"), - ("Finnish markka", "finse mark|finse markka|suomen markka|finnish markka|finsk mark|fim|markkaa|markka"), - ("Penni", "penniä|penni"), - ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), - ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), - ("Satoshi", "satoshi|satoshis")]) - CurrencyNameToIsoCodeMap = dict([("Afghan afghani", "AFN"), - ("Euro", "EUR"), - ("Albanian lek", "ALL"), - ("Angolan kwanza", "AOA"), - ("Armenian dram", "AMD"), - ("Aruban florin", "AWG"), - ("Bangladeshi taka", "BDT"), - ("Bhutanese ngultrum", "BTN"), - ("Bolivian boliviano", "BOB"), - ("Bosnia and Herzegovina convertible mark", "BAM"), - ("Botswana pula", "BWP"), - ("Brazilian real", "BRL"), - ("Bulgarian lev", "BGN"), - ("Cambodian riel", "KHR"), - ("Cape Verdean escudo", "CVE"), - ("Costa Rican colón", "CRC"), - ("Croatian kuna", "HRK"), - ("Czech koruna", "CZK"), - ("Eritrean nakfa", "ERN"), - ("Ethiopian birr", "ETB"), - ("Gambian dalasi", "GMD"), - ("Georgian lari", "GEL"), - ("Ghanaian cedi", "GHS"), - ("Guatemalan quetzal", "GTQ"), - ("Haitian gourde", "HTG"), - ("Honduran lempira", "HNL"), - ("Hungarian forint", "HUF"), - ("Iranian rial", "IRR"), - ("Yemeni rial", "YER"), - ("Israeli new shekel", "ILS"), - ("Japanese yen", "JPY"), - ("Kazakhstani tenge", "KZT"), - ("Kenyan shilling", "KES"), - ("North Korean won", "KPW"), - ("South Korean won", "KRW"), - ("Kyrgyzstani som", "KGS"), - ("Lao kip", "LAK"), - ("Lesotho loti", "LSL"), - ("South African rand", "ZAR"), - ("Macanese pataca", "MOP"), - ("Macedonian denar", "MKD"), - ("Malagasy ariary", "MGA"), - ("Malawian kwacha", "MWK"), - ("Malaysian ringgit", "MYR"), - ("Mauritanian ouguiya", "MRO"), - ("Mongolian tögrög", "MNT"), - ("Mozambican metical", "MZN"), - ("Burmese kyat", "MMK"), - ("Nicaraguan córdoba", "NIO"), - ("Nigerian naira", "NGN"), - ("Turkish lira", "TRY"), - ("Omani rial", "OMR"), - ("Panamanian balboa", "PAB"), - ("Papua New Guinean kina", "PGK"), - ("Paraguayan guaraní", "PYG"), - ("Peruvian sol", "PEN"), - ("Polish złoty", "PLN"), - ("Qatari riyal", "QAR"), - ("Saudi riyal", "SAR"), - ("Samoan tālā", "WST"), - ("São Tomé and Príncipe dobra", "STD"), - ("Sierra Leonean leone", "SLL"), - ("Swazi lilangeni", "SZL"), - ("Tajikistani somoni", "TJS"), - ("Thai baht", "THB"), - ("Ukrainian hryvnia", "UAH"), - ("Vanuatu vatu", "VUV"), - ("Venezuelan bolívar", "VEF"), - ("Zambian kwacha", "ZMW"), - ("Moroccan dirham", "MAD"), - ("United Arab Emirates dirham", "AED"), - ("Azerbaijani manat", "AZN"), - ("Turkmenistan manat", "TMT"), - ("Somali shilling", "SOS"), - ("Tanzanian shilling", "TZS"), - ("Ugandan shilling", "UGX"), - ("Romanian leu", "RON"), - ("Moldovan leu", "MDL"), - ("Nepalese rupee", "NPR"), - ("Pakistani rupee", "PKR"), - ("Indian rupee", "INR"), - ("Seychellois rupee", "SCR"), - ("Mauritian rupee", "MUR"), - ("Maldivian rufiyaa", "MVR"), - ("Sri Lankan rupee", "LKR"), - ("Indonesian rupiah", "IDR"), - ("Danish krone", "DKK"), - ("Estonian kroon", "EEK"), - ("Norwegian krone", "NOK"), - ("Icelandic króna", "ISK"), - ("Swedish krona", "SEK"), - ("West African CFA franc", "XOF"), - ("Central African CFA franc", "XAF"), - ("Comorian franc", "KMF"), - ("Congolese franc", "CDF"), - ("Burundian franc", "BIF"), - ("Djiboutian franc", "DJF"), - ("CFP franc", "XPF"), - ("Guinean franc", "GNF"), - ("Swiss franc", "CHF"), - ("Rwandan franc", "RWF"), - ("Russian ruble", "RUB"), - ("Transnistrian ruble", "PRB"), - ("New Belarusian ruble", "BYN"), - ("Algerian dinar", "DZD"), - ("Bahraini dinar", "BHD"), - ("Iraqi dinar", "IQD"), - ("Jordanian dinar", "JOD"), - ("Kuwaiti dinar", "KWD"), - ("Libyan dinar", "LYD"), - ("Serbian dinar", "RSD"), - ("Tunisian dinar", "TND"), - ("Argentine peso", "ARS"), - ("Chilean peso", "CLP"), - ("Colombian peso", "COP"), - ("Cuban convertible peso", "CUC"), - ("Cuban peso", "CUP"), - ("Dominican peso", "DOP"), - ("Mexican peso", "MXN"), - ("Uruguayan peso", "UYU"), - ("British pound", "GBP"), - ("Saint Helena pound", "SHP"), - ("Egyptian pound", "EGP"), - ("Falkland Islands pound", "FKP"), - ("Gibraltar pound", "GIP"), - ("Manx pound", "IMP"), - ("Jersey pound", "JEP"), - ("Lebanese pound", "LBP"), - ("South Sudanese pound", "SSP"), - ("Sudanese pound", "SDG"), - ("Syrian pound", "SYP"), - ("United States dollar", "USD"), - ("Australian dollar", "AUD"), - ("Bahamian dollar", "BSD"), - ("Barbadian dollar", "BBD"), - ("Belize dollar", "BZD"), - ("Bermudian dollar", "BMD"), - ("Brunei dollar", "BND"), - ("Singapore dollar", "SGD"), - ("Canadian dollar", "CAD"), - ("Cayman Islands dollar", "KYD"), - ("New Zealand dollar", "NZD"), - ("Fijian dollar", "FJD"), - ("Guyanese dollar", "GYD"), - ("Hong Kong dollar", "HKD"), - ("Jamaican dollar", "JMD"), - ("Liberian dollar", "LRD"), - ("Namibian dollar", "NAD"), - ("Solomon Islands dollar", "SBD"), - ("Surinamese dollar", "SRD"), - ("New Taiwan dollar", "TWD"), - ("Trinidad and Tobago dollar", "TTD"), - ("Tuvaluan dollar", "TVD"), - ("Chinese yuan", "CNY"), - ("Rial", "__RI"), - ("Shiling", "__S"), - ("Som", "__SO"), - ("Dirham", "__DR"), - ("Dinar", "_DN"), - ("Dollar", "__D"), - ("Manat", "__MA"), - ("Rupee", "__R"), - ("Krone", "__K"), - ("Krona", "__K"), - ("Crown", "__K"), - ("Frank", "__F"), - ("Mark", "__M"), - ("Ruble", "__RB"), - ("Peso", "__PE"), - ("Pound", "__P"), - ("Tristan da Cunha pound", "_TP"), - ("South Georgia and the South Sandwich Islands pound", "_SP"), - ("Somaliland shilling", "_SS"), - ("Pitcairn Islands dollar", "_PND"), - ("Palauan dollar", "_PD"), - ("Niue dollar", "_NID"), - ("Nauruan dollar", "_ND"), - ("Micronesian dollar", "_MD"), - ("Kiribati dollar", "_KID"), - ("Guernsey pound", "_GGP"), - ("Faroese króna", "_FOK"), - ("Cook Islands dollar", "_CKD"), - ("British Virgin Islands dollar", "_BD"), - ("Ascension pound", "_AP"), - ("Alderney pound", "_ALP"), - ("Abkhazian apsar", "_AA"), - ("Bitcoin", "_XBT")]) - FractionalUnitNameToCodeMap = dict([("Jiao", "JIAO"), - ("Kopek", "KOPEK"), - ("Pul", "PUL"), - ("Cent", "CENT"), - ("Qindarkë", "QINDARKE"), - ("Penny", "PENNY"), - ("Santeem", "SANTEEM"), - ("Cêntimo", "CENTIMO"), - ("Centavo", "CENTAVO"), - ("Luma", "LUMA"), - ("Qəpik", "QƏPIK"), - ("Fils", "FILS"), - ("Poisha", "POISHA"), - ("Kapyeyka", "KAPYEYKA"), - ("Centime", "CENTIME"), - ("Chetrum", "CHETRUM"), - ("Paisa", "PAISA"), - ("Fening", "FENING"), - ("Thebe", "THEBE"), - ("Sen", "SEN"), - ("Stotinka", "STOTINKA"), - ("Fen", "FEN"), - ("Céntimo", "CENTIMO"), - ("Lipa", "LIPA"), - ("Haléř", "HALER"), - ("Øre", "ØRE"), - ("Piastre", "PIASTRE"), - ("Santim", "SANTIM"), - ("Oyra", "OYRA"), - ("Butut", "BUTUT"), - ("Tetri", "TETRI"), - ("Pesewa", "PESEWA"), - ("Fillér", "FILLER"), - ("Eyrir", "EYRIR"), - ("Dinar", "DINAR"), - ("Agora", "AGORA"), - ("Tïın", "TIIN"), - ("Chon", "CHON"), - ("Jeon", "JEON"), - ("Tyiyn", "TYIYN"), - ("Att", "ATT"), - ("Sente", "SENTE"), - ("Dirham", "DIRHAM"), - ("Rappen", "RAPPEN"), - ("Avo", "AVO"), - ("Deni", "DENI"), - ("Iraimbilanja", "IRAIMBILANJA"), - ("Tambala", "TAMBALA"), - ("Laari", "LAARI"), - ("Khoums", "KHOUMS"), - ("Ban", "BAN"), - ("Möngö", "MONGO"), - ("Pya", "PYA"), - ("Kobo", "KOBO"), - ("Kuruş", "KURUS"), - ("Baisa", "BAISA"), - ("Centésimo", "CENTESIMO"), - ("Toea", "TOEA"), - ("Sentimo", "SENTIMO"), - ("Grosz", "GROSZ"), - ("Sene", "SENE"), - ("Halala", "HALALA"), - ("Para", "PARA"), - ("Öre", "ORE"), - ("Diram", "DIRAM"), - ("Satang", "SATANG"), - ("Seniti", "SENITI"), - ("Millime", "MILLIME"), - ("Tennesi", "TENNESI"), - ("Kopiyka", "KOPIYKA"), - ("Tiyin", "TIYIN"), - ("Hào", "HAO"), - ("Ngwee", "NGWEE"), - ("Kwartje", "KWARTJE"), - ("Dubbeltje", "DUBBELTJE"), - ("Stuiver", "STUIVER"), - ("Millibitcoin", "MILLIBITCOIN"), - ("Satoshi", "SATOSHI")]) - CompoundUnitConnectorRegex = f'(?en)' - CurrencyPrefixList = dict([("Dollar", "$"), - ("United States dollar", "amerikaanse $|united states $|us$|us $|u.s. $|u.s $"), - ("East Caribbean dollar", "oost-caribische $|oost caribische $|east caribbean $"), - ("Australian dollar", "australische $|australian $|australia $"), - ("Bahamian dollar", "bahamaanse $|bahamian $|bahamia $"), - ("Barbadian dollar", "barbadiaanse $|barbadian $|barbadin $"), - ("Belize dollar", "belizaanse $|belize $"), - ("Bermudian dollar", "bermudaanse $|bermudian $"), - ("British Virgin Islands dollar", "britse maagdeneilanden $|british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"), - ("Brunei dollar", "bruneise $|brunei $|b$"), - ("Sen", "sen"), - ("Singapore dollar", "singaporese $|singapore $|s$"), - ("Canadian dollar", "canadese $|canadian $|can$|c$|c $|canada $"), - ("Cayman Islands dollar", "kaaimaneilandse $|cayman islands $|ci$|cayman island $"), - ("New Zealand dollar", "nieuw-zeelandse $|nieuw zeelandse $|new zealand $|nz$|nz $"), - ("Cook Islands dollar", "cookeilandse $|cook islands $|cook island $"), - ("Fijian dollar", "fiji-$|fijian $|fiji $"), - ("Guyanese dollar", "guyaanse $|gy$|gy $|g$|g $"), - ("Hong Kong dollar", "hongkong $|hong kong $|hk$|hkd|hk $"), - ("Jamaican dollar", "jamaicaanse $|jamaican $|j$|jamaica $"), - ("Kiribati dollar", "kiribatische $|kiribati $"), - ("Liberian dollar", "liberiaanse $|liberian $|liberia $"), - ("Micronesian dollar", "micronesische $|micronesian $"), - ("Namibian dollar", "namibische $|namibian $|nad|n$|namibia $"), - ("Nauruan dollar", "nauruaanse $|nauruan $"), - ("Niue dollar", "niue $"), - ("Palauan dollar", "palaus $|palauan $"), - ("Pitcairn Islands dollar", "pitcairneilandse $|pitcairn islands $|pitcairn island $"), - ("Solomon Islands dollar", "salomon-$|salomon $|solomon islands $|si$|si $|solomon island $"), - ("Surinamese dollar", "surinaamse $|surinamese $|surinam $"), - ("New Taiwan dollar", "taiwanese $|nt$|nt $"), - ("Trinidad and Tobago dollar", "trinidad en tobago $|trinidad and tobago $|trinidad $|trinidadian $"), - ("Tuvaluan dollar", "tuvaluaanse $|tuvaluan $"), - ("Samoan tālā", "ws$"), - ("Chinese yuan", "¥"), - ("Japanese yen", "¥"), - ("Euro", "€|eur"), - ("Pound", "£"), - ("Costa Rican colón", "₡"), - ("Turkish lira", "₺"), - ("Bitcoin", "₿|btc|xbt")]) - AmbiguousCurrencyUnitList = [r'din.', r'kiwi', r'kina', r'kobo', r'lari', r'lipa', r'napa', r'para', r'sfr.', r'taka', r'tala', r'toea', r'vatu', r'yuan', r'ang', r'ban', r'bob', r'btn', r'byr', r'cad', r'cop', r'cup', r'dop', r'gip', r'jod', r'kgs', r'lak', r'lei', r'mga', r'mop', r'nad', r'omr', r'pul', r'sar', r'sbd', r'scr', r'sdg', r'sek', r'sen', r'sol', r'sos', r'std', r'try', r'yer', r'yen'] - AngleSuffixList = dict([("Degree", "graad|graden|°"), - ("Radian", "radiaal|radialen|rad"), - ("Turn", "draai|draaien|slag|slagen")]) - AmbiguousAngleUnitList = [r'draai', r'draaien', r'slag', r'slagen'] + BuildPrefix = '(?<=(\\s|^))' + BuildSuffix = '(?=(\\s|\\W|$))' + CurrencySuffixList = dict( + [ + ("Abkhazian apsar", "abkhazian apsar|apsars"), + ("Afghan afghani", "afghaanse afghani|؋|afn|afghanis|afghani"), + ("Pul", "pul"), + ("Euro", "euros|euro|€|eur"), + ("Cent", "cents|cent|-cents|-cent"), + ("Kwartje", "kwartje"), + ("Dubbeltje", "dubbeltje"), + ("Stuiver", "stuiver"), + ("Tientje", "tientje"), + ("Albanian lek", "albanese lek|leks|lek"), + ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), + ("Angolan kwanza", "angolese kwanza|kz|aoa|kwanza|kwanzas|angolese kwanzas"), + ("Armenian dram", "armeense dram|dram"), + ("Aruban florin", "arubaanse florin|arubaanse florins|ƒ|awg|arubaanse florijn|arubaanse florijnen"), + ("Bangladeshi taka", "bengalese taka|৳|bdt|taka|takas|bengalese takas"), + ("Paisa", "poisha|paisa"), + ("Bhutanese ngultrum", "bhutaanse ngultrum|nu.|btn|ngultrum"), + ("Chetrum", "chetrums|chetrum"), + ( + "Bolivian boliviano", + "boliviaanse boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|boliviaanse bolivianos|boliviano", + ), + ( + "Bosnia and Herzegovina convertible mark", + "bosnische inwisselbare mark|bosnia and herzegovina convertible mark|bam", + ), + ("Fening", "fenings|fenings"), + ("Botswana pula", "botswaanse pula|bwp|pula|pulas|botswaanse pulas"), + ("Thebe", "thebe"), + ("Brazilian real", "braziliaanse real|r$|brl|brazil real|brazil reals|braziliaanse reals|real|reals"), + ("Bulgarian lev", "bulgaarse lev|bgn|лв|bulgaria lev|bulgaria levs|bulgaarse levs"), + ("Stotinka", "stotinki|stotinka"), + ("Cambodian riel", "cambodjaanse riel|khr|៛|cambodia riel|cambodia riels|cambodjaanse riels|riel|riels"), + ("Cape Verdean escudo", "kaapverdische escudo|cve|escudo"), + ( + "Costa Rican colón", + "costa ricaanse colonolón|costa ricaanse colóns|crc|₡|costa rica colón|costa rica colóns|ccosta ricaanse colon|costa ricaanse colons|costa rica colon|costa rica colons", + ), + ( + "Salvadoran colón", + "svc|salvadoraanse colón|salvadoraanse colóns|salvador colón|salvador colóns|salvadoraanse colon|salvadoraanse colons|salvador colon|salvador colons", + ), + ("Céntimo", "céntimo"), + ("Croatian kuna", "kroatische kuna|kn|hrk|croatia kuna|kroatische kunas|kroatische kuna kunas|kuna"), + ("Lipa", "lipa"), + ( + "Czech koruna", + "tsjechische kroon|tsjechische kronen|czech koruna|czk|Kč|czech korunas|tsjechische koruna|tsjechische korunas|koruna|korunas", + ), + ("Haléř", "haléř"), + ("Eritrean nakfa", "eritrese nakfa|nfk|ern|eritrese nakfas|nakfa|nakfas"), + ("Ethiopian birr", "ethiopische birr|etb|birr"), + ("Gambian dalasi", "gambiaanse dalasi|gmd|dalasi"), + ("Butut", "bututs|butut"), + ("Georgian lari", "georgische lari|lari|gel|₾"), + ("Tetri", "tetri"), + ("Ghanaian cedi", "ghanese cedi|ghs|₵|gh₵|cedi"), + ("Pesewa", "pesewas|pesewa"), + ("Guatemalan quetzal", "guatemalteekse quetzal|gtq|guatemala quetzal|quetzal"), + ("Haitian gourde", "haïtiaanse gourde|haitiaanse gourde|htg|gourde"), + ("Honduran lempira", "hondurese lempira|hnl|lempira"), + ( + "Hungarian forint", + "hongaarse forint|huf|ft|hungary forint|hungary forints|hongaarse forints|forint|forints", + ), + ("Fillér", "fillér"), + ("Iranian rial", "iraanse rial|irr|iran rial|iran rials|iraanse rials"), + ("Yemeni rial", "jemenitische rial|yer|jemenitische rials"), + ("Israeli new shekel", "israëlische sjekel|israelische sjekel|₪|ils|sjekel"), + ("Lithuanian litas", "ltl|litouwse litas|lithuan litas|litouwse lit|lithuan lit"), + ("Japanese yen", "japanse yen|jpy|yen|-yen|¥|yens|japanse yens|japan yen|japan yens"), + ("Kazakhstani tenge", "kazachse tenge|kzt"), + ("Kenyan shilling", "keniaanse shilling|kes"), + ( + "North Korean won", + "noord-koreaanse won|noord koreaanse won|kpw|noord-koreaanse wons|noord koreaanse wons", + ), + ("South Korean won", "zuid-koreaanse won|zuid koreaanse won|krw|zuid-koreaanse wons|zuid koreaanse wons"), + ("Korean won", "koreaanse won|₩|koreaanse wons"), + ("Kyrgyzstani som", "kirgizische som|kgs"), + ("Uzbekitan som", "oezbeekse sum|uzs"), + ("Lao kip", "laotiaanse kip|lao kip|lak|₭n|₭"), + ("Att", "att"), + ("Lesotho loti", "lesothaanse loti|lesotho loti|lsl|loti"), + ("Sente", "sente|lisente"), + ( + "South African rand", + "zuid-afrikaanse rand|zuid afrikaanse rand|south african rand|zar|south africa rand|south africa rands|south african rands", + ), + ("Macanese pataca", "macause pataca|macanese pataca|mop$|mop|pataca"), + ("Avo", "avos|avo"), + ("Macedonian denar", "macedonische denar|macedonian denar|mkd|ден"), + ("Deni", "deni"), + ("Malagasy ariary", "malagassische ariary|malagasy ariary|mga|ariary"), + ("Iraimbilanja", "iraimbilanja"), + ("Malawian kwacha", "malawische kwacha|malawian kwacha|mk|mwk"), + ("Tambala", "tambala"), + ("Malaysian ringgit", "maleisische ringgit|rm|myr|malaysia ringgit|malaysia ringgits|maleisische ringgits"), + ( + "Mauritanian ouguiya", + "mauritaanse ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritaanse ouguiyas", + ), + ("Khoums", "khoums"), + ( + "Mongolian tögrög", + "mongoolse tugrik|mongoolse tugriks|mongoolse tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongoolse tögrögs|mongoolse togrog|mongoolse togrogs|mongolia togrog|mongolia togrogs", + ), + ( + "Mozambican metical", + "mozambikaanse metical|mt|mzn|mozambica metical|mozambica meticals|mozambikaanse meticals", + ), + ("Burmese kyat", "myanmarese kyat|burmese kyat|ks|mmk"), + ("Pya", "pya"), + ("Nicaraguan córdoba", "nicaraguaanse córdoba|nio"), + ("Nigerian naira", "nigeriaanse naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigeriaanse nairas"), + ("Kobo", "kobo"), + ("Turkish lira", "turkse lira|try|tl|turkey lira|turkey liras|turkse liras"), + ("Kuruş", "kuruş"), + ("Omani rial", "omaanse rial|omani rial|omr|ر.ع."), + ("Panamanian balboa", "panamese balboa|panamanian balboa|b/.|pab"), + ("Centesimo", "centesimo"), + ( + "Papua New Guinean kina", + "papoea-nieuw-guinese kina|papoea nieuw guinese kina|papua new guinean kina|kina|pgk", + ), + ("Toea", "toea"), + ("Paraguayan guaraní", "paraguayaanse guarani|paraguayan guaraní|₲|pyg|guarani|guaraní"), + ("Peruvian sol", "peruviaanse sol|peruviaanse nieuwe sol|sol|soles|sol|peruviaanse nuevo sol"), + ("Polish złoty", "złoty|poolse złoty|zł|pln|zloty|poolse zloty|poland zloty|poland złoty"), + ("Grosz", "groszy|grosz|grosze"), + ( + "Qatari riyal", + "qatarese rial|qatarese rials|qatarese riyal|qar|qatarese riyals|qatar riyal|qatar riyals", + ), + ( + "Saudi riyal", + "saoedi-arabische riyal|saoedi-arabische riyals|saoedi arabische riyal|saoedi arabische riyals|saudi riyal|sar|saudi riyals|saoedi riyal|saoedi riyals", + ), + ("Riyal", "riyal|riyals|rial|rials|﷼"), + ("Dirham", "dirham|dirhem|dirhm"), + ("Halala", "halalas|halala"), + ("Samoan tālā", "samoaanse tālā|tālā|tala|ws$|samoa|wst|samoaanse tala"), + ("Sene", "sene"), + ("São Tomé and Príncipe dobra", "santomese dobra|são tomé and príncipe dobra|dobras|dobra|std"), + ("Sierra Leonean leone", "sierra leoonse leone|sierra Leonean leone|sll|leone|le"), + ("Peseta", "spaanse peseta|spaanse pesetas|pesetas|peseta"), + ( + "Netherlands guilder", + "florin|netherlands antillean guilder|ang|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl", + ), + ("Swazi lilangeni", "swazische lilangeni|swazi lilangeni|lilangeni|szl|emalangeni"), + ("Tajikistani somoni", "tadzjiekse somoni|tajikistani somoni|tjs|somoni"), + ("Diram", "dirams|diram"), + ("Thai baht", "thaise baht|hai baht|฿|thb|baht"), + ("Satang", "satang|satangs"), + ("Tongan paʻanga", "tongaanse paʻanga|paʻanga|tongaanse pa'anga|pa'anga"), + ("Seniti", "seniti"), + ( + "Ukrainian hryvnia", + "oekraïense grivna|oekraiense grivna|eukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias|grivna|grivnya", + ), + ("Vanuatu vatu", "vanuatuaanse vatu|vanuatu vatu|vatu|vuv"), + ( + "Venezuelan bolívar", + "venezolaanse bolivar|venezolaanse bolívar|venezolaanse bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivars|venezolaanse bolivar|venezolaanse bolivars", + ), + ("Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"), + ("Zambian kwacha", "zambiaanse kwacha|zk|zmw|zambia kwacha|kwachas|zambiaanse kwachas"), + ("Moroccan dirham", "marokkaanse dirham|moroccan dirham|mad|د.م."), + ( + "United Arab Emirates dirham", + "vae-dirham|vae dirham|verenigde arabische emiraten dirham|verenigde-arabische-emiraten dirham|united arab emirates dirham|د.إ|aed", + ), + ("Azerbaijani manat", "azerbeidzjaanse manat|azerbaijani manat|azn"), + ( + "Turkmenistan manat", + "turkmeense manat|turkmeense nieuwe manat|turkmenistan manat|turkmenistan new manat|tmt", + ), + ("Manat", "manats|manat"), + ("Qəpik", "qəpik"), + ( + "Somali shilling", + "somalische shilling|somalische shillings|somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos", + ), + ("Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"), + ( + "Tanzanian shilling", + "tanzaniaanse shilling|tanzaniaanse shillings|tsh|tzs|tanzania shilling|tanzania shillings", + ), + ("Ugandan shilling", "oegandese shilling|oegandese shillings|ugx|uganda shilling|uganda shillings"), + ("Romanian leu", "roemeense leu|ron|romania leu"), + ("Moldovan leu", "moldavische leu|mdl|moldova leu"), + ("Leu", "leu|lei"), + ("Ban", "bani|-ban|ban"), + ("Nepalese rupee", "nepalese roepie|nepalese rupee|npr"), + ("Pakistani rupee", "pakistaanse roepie|pakistani rupee|pkr"), + ("Indian rupee", "indiase roepie|indian rupee|inr|₹|india rupee"), + ("Seychellois rupee", "seychelse roepie|seychellois rupee|scr|sr|sre"), + ("Mauritian rupee", "mauritiaanse roepie|mauritian rupee|mur"), + ("Maldivian rufiyaa", "maldivische rufiyaa|maldivian rufiyaa|mvr|.ރ|maldive rufiyaa"), + ("Sri Lankan rupee", "sri lankaanse roepie|sri lankan rupee|lkr|රු|ரூ"), + ( + "Indonesian rupiah", + "indonesische roepia|indonesische rupiah|indonesian rupiah|rupiah|perak|rp|idr|roepia", + ), + ("Rupee", "roepie|rupee|rs"), + ("Danish krone", "deense kroon|dansk krone|dkk|denmark krone|denmark krones|deense kronen"), + ("Norwegian krone", "noorse kroon|nok|norway krone|norway krones|noorse kronen"), + ("Faroese króna", "faeröerse kroon|faeroerse kroon|faroese króna|faroese krona"), + ( + "Icelandic króna", + "ijslandse kroon|ijslandse kronen|icelandic króna|isk|icelandic krona|iceland króna|iceland krona", + ), + ("Swedish krona", "zweedse kroon|zweedse kronen|swedish krona|swedish kronor|sek"), + ("Estonian kroon", "estische kroon|estische kronen|stonian kroon"), + ("Krone", "kroon|kronen|kronor|krona|króna|krone|krones|kr|-kr"), + ("Øre", "öre|Øre|oyra|eyrir"), + ( + "West African CFA franc", + "west afrikaanse cfa frank|west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc", + ), + ( + "Central African CFA franc", + "centraal afrikaanse cfa frank|central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc", + ), + ("Comorian franc", "comorese frank|comorese franc|comorian franc|kmf"), + ("Congolese franc", "congolese frank|congolese franc|cdf"), + ("Burundian franc", "burundese frank|burundese franc|burundian franc|bif"), + ("Djiboutian franc", "djiboutiaanse frank|djiboutiaanse franc|djiboutian franc|djf"), + ("CFP franc", "cfp-frank|cfp frank|cfp franc|xpf"), + ("Guinean franc", "guineese frank|guineese franc|guinean franc|gnf"), + ("Swiss franc", "zwitserse frank|zwitserse franc|swiss francs|swiss franc|chf|sfr."), + ("Rwandan franc", "rwandese frank|rwandese franc|Rwandan franc|rwf|rf|r₣|frw"), + ("Belgian franc", "belgische frank|bi.|b.fr.|bef|belgium franc"), + ("Rappen", "rappen|-rappen"), + ("Franc", "frank|franken|francs|franc|fr.|fs|ff|fc"), + ("Centime", "centimes|centime|santim"), + ("Russian ruble", "russische roebel|₽|rub|russia ruble|russia ₽|russian ₽|russische ₽|russische roebels"), + ( + "New Belarusian ruble", + "nieuwe wit-russische roebel|nieuwe wit russische roebel|nieuwe witrussische roebel|new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles", + ), + ( + "Old Belarusian ruble", + "oude wit-russische roebel|oude wit russische roebel|oude witrussische roebel|old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles", + ), + ("Transnistrian ruble", "transnistrische roebel|transnistrische roebels|transnistrian ruble|prb|р."), + ( + "Belarusian ruble", + "wit-russische roebel|wit russische roebel|witrussische roebel|belarusian ruble|belarus ruble|belarus rubles", + ), + ("Kopek", "kopek|kopeken|kopeks"), + ("Kapyeyka", "kapyeyka"), + ("Ruble", "roebel|roebels|rubles|ruble|br"), + ( + "Algerian dinar", + "algerijnse dinars|algerijnse dinar|algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars", + ), + ("Bahraini dinar", "bahreinse dinars|bahreinse dinar|bahraini dinars|bahraini dinar|bhd|.د.ب"), + ("Santeem", "santeem|santeems"), + ("Iraqi dinar", "iraakse dinars|iraakse dinar|iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"), + ( + "Jordanian dinar", + "jordaanse dinars|jordaanse dinar|jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars", + ), + ("Kuwaiti dinar", "koeweitse dinars|koeweitse dinar|kuwaiti dinars|kuwaiti dinar|kwd|د.ك"), + ("Libyan dinar", "libische dinars|libische dinar|libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"), + ( + "Serbian dinar", + "servische dinars|servische dinar|serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar", + ), + ( + "Tunisian dinar", + "tunesische dinars|tunesische dinar|tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar", + ), + ("Yugoslav dinar", "joegoslavische dinars|joegoslavische dinar|yugoslav dinars|yugoslav dinar|yun"), + ("Dinar", "dinars|dinar|denar|-dinars|-dinar"), + ("Fils", "fils|fulūs|-fils|-fil"), + ("Para", "para|napa"), + ("Millime", "millimes|millime"), + ( + "Argentine peso", + "argentijnse pesos|argentijnse peso|argentine peso|ars|argetina peso|argetina pesos|argentine pesos", + ), + ("Chilean peso", "chileense pesos|chileense peso|chilean pesos|chilean peso|clp|chile peso|chile peso"), + ( + "Colombian peso", + "colombiaanse pesos|colombiaanse peso|colombian pesos|colombian peso|cop|colombia peso|colombia pesos", + ), + ( + "Cuban convertible peso", + "convertibele pesos|convertibele peso|cubaanse convertible pesos|cubaanse convertible peso|cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso", + ), + ("Cuban peso", "cubaanse pesos|cubaanse peso|cuban pesos|cuban peso|cup|cuba pesos|cuba peso"), + ( + "Dominican peso", + "dominicaanse pesos|dominicaanse peso|dominican pesos|dominican peso|dop|dominica pesos|dominica peso", + ), + ( + "Mexican peso", + "mexicaanse pesos|mexicaanse peso|mexican pesos|mexican peso|mxn|mexico pesos|mexico peso", + ), + ("Philippine peso", "filipijnse pesos|filipijnse peso|piso|philippine pesos|philippine peso|₱|php"), + ("Uruguayan peso", "uruguayaanse pesos|uruguayaanse peso|uruguayan pesos|uruguayan peso|uyu"), + ("Peso", "pesos|peso"), + ("Centavo", "centavos|centavo"), + ("Alderney pound", "alderney pond|alderney pounds|alderney pound|alderney £"), + ( + "British pound", + "pond sterling|britse pond|britse ponden|britse £|british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots", + ), + ("Guernsey pound", "guernsey pounds|guernsey £|ggp"), + ("Ascension pound", "ascension ponden|ascension pond|ascension pounds|ascension pound|ascension £"), + ( + "Saint Helena pound", + "sint-heleens pond|sint-heleens £|sint heleens pond|sint heleens £|saint helena pounds|saint helena pound|saint helena £|shp", + ), + ( + "Egyptian pound", + "egyptische pond|egyptische £|egyptische ponden|egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound", + ), + ( + "Falkland Islands pound", + "falklandeilanden pond|falklandeilandse pond|falklandeilandse £|falklandeilanse ponden|falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £", + ), + ("Gibraltar pound", "gibraltarees pond|gibraltarees £|gibraltar pounds|gibraltar pound|gibraltar £|gip"), + ( + "Manx pound", + "isle of man-pond|isle of man pond|isle of man-£|isle of man £|manx pounds|manx pound|manx £|imp", + ), + ("Jersey pound", "jerseypond|jerseyponden|jersey pounds|jersey pound|jersey £|jep"), + ( + "Lebanese pound", + "libanese ponden|libanese pond|libanese £|lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل", + ), + ( + "South Georgia and the South Sandwich Islands pound", + "zuid-georgia en de zuidelijke sandwicheilanden ponden|zuid-georgia en de zuidelijke sandwicheilanden pond|zuid-georgia en de zuidelijke sandwicheilanden £|south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £", + ), + ( + "South Sudanese pound", + "zuid sudanese ponden|zuid sudanese pond|zuid sudanese £|south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £", + ), + ( + "Sudanese pound", + "sudanese ponden|sudanese pond|sudanese £|sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £", + ), + ( + "Syrian pound", + "syrische ponden|syrische pond|syrische £|syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £", + ), + ("Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"), + ("Pound", "pond|ponden|-pond|-ponden|pounds|pound|-pounds|-pound|£"), + ("Pence", "pence"), + ("Shilling", "shillings|shilling|shilingi|sh"), + ("Penny", "pennies|penny"), + ( + "United States dollar", + "amerikaanse dollars|amerikaanse dollar|amerikaanse $|united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|US dollar|US dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars", + ), + ( + "East Caribbean dollar", + "oost-caribische dollars|oost-caribische dollar|oost-caribische $|oost caribische dollars|oost caribische $|oost caribische dollar|east caribbean dollars|east caribbean dollar|east Caribbean $|xcd", + ), + ( + "Australian dollar", + "australische dollars|australische dollar|australische $|australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$", + ), + ( + "Bahamian dollar", + "bahamaanse dollars|bahamaanse dollar|bahamaanse $|bahama $|bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$", + ), + ( + "Barbadian dollar", + "barbadiaanse dollars|barbadiaanse dollar|barbadiaanse $|barbada $|barbadian dollars|barbadian dollar|barbadian $|bbd", + ), + ( + "Belize dollar", + "belizaanse dollars|belizaanse dollar|belizaanse $|belize dollars|belize dollar|belize $|bzd", + ), + ( + "Bermudian dollar", + "bermudaanse dollars|bermudaanse dollar|bermudaanse $|bermuda $|bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $", + ), + ( + "British Virgin Islands dollar", + "britse maagdeneilanden dollars|britse maagdeneilanden dollar|britse maagdeneilanden $|british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $", + ), + ("Brunei dollar", "bruneise dollars|bruneise dollar|bruneise $|brunei dollar|brunei $|bnd"), + ("Sen", "sen"), + ( + "Singapore dollar", + "singaporese dollars|singaporese dollar|Singaporese $|singapore dollars|singapore dollar|singapore $|s$|sgd", + ), + ( + "Canadian dollar", + "canadese dollars|canadese dollar|canadese $|canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $", + ), + ( + "Cayman Islands dollar", + "kaaimaneilandse dollars|kaaimaneilandse dollar|kaaimaneilandse $|cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $", + ), + ( + "New Zealand dollar", + "nieuw-zeelandse dollars|nieuw-zeelandse dollar|nieuw-zeelandse $|nieuw zeelandse dollars|nieuw zeelandse dollar|nieuw zeelandse $|new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi", + ), + ( + "Cook Islands dollar", + "cookeilandse dollars|cookeilandse dollar|cookeilandse $|cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $", + ), + ( + "Fijian dollar", + "fiji-dollars|fiji-dollar|fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $", + ), + ("Guyanese dollar", "guyaanse dollars|guyaanse dollar|guyaanse $|guyanese dollars|guyanese dollar|gyd|gy$"), + ( + "Hong Kong dollar", + "hongkongse dollars|hongkongse dollar|hongkongse $|hongkong dollars|hongkong dollar|hongkong $|hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$", + ), + ( + "Jamaican dollar", + "jamaicaanse dollars|jamaicaanse dollar|jamaicaanse $|jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd", + ), + ( + "Kiribati dollar", + "kiribatische dollars|kiribatische dollar|kiribatische $|kiribati dollars|kiribati dollar|kiribati $", + ), + ( + "Liberian dollar", + "liberiaanse dollars|liberiaanse dollar|liberiaanse $|liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd", + ), + ( + "Micronesian dollar", + "micronesische dollars|micronesische dollar|micronesische $|micronesia dollars|micronesia dollar|micronesia $|micronesian dollars|micronesian dollar|micronesian $", + ), + ( + "Namibian dollar", + "namibische dollars|namibische dollar|namibische $|namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $", + ), + ( + "Nauruan dollar", + "nauruaanse dollars|nauruaanse dollar|nauruaanse $|nauruan dollars|nauruan dollar|nauruan $", + ), + ("Niue dollar", "niue dollars|niue dollar|niue $"), + ("Palauan dollar", "palaus dollars|palaus dollar|palaus $|palauan dollars|palauan dollar|palauan $"), + ( + "Pitcairn Islands dollar", + "pitcairneilandse dollars|pitcairneilandse dollar|pitcairneilandse $|pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $", + ), + ( + "Solomon Islands dollar", + "salomon-dollars|salomon-dollar|salomon-$|salomon dollars|salomon dollar|salomon $|solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $", + ), + ( + "Surinamese dollar", + "surinaamse dollars|surinaamse dollar|surinaamse $|surinamese dollars|surinamese dollar|surinamese $|srd", + ), + ( + "New Taiwan dollar", + "taiwanese dollars|taiwanese dollar|taiwanese $|nieuw taiwanese dollars|nieuw taiwanese dollar|nieuw taiwanese $|new taiwan dollars|new taiwan dollar|nt$|twd|ntd", + ), + ( + "Trinidad and Tobago dollar", + "trinidad en tobagodollars|trinidad en tobagodollar|trinidad en tobago dollars|trinidad en tobago dollar|trinidad en tobago $|trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd", + ), + ( + "Tuvaluan dollar", + "tuvaluaanse dollars|tuvaluaanse dollar|tuvaluaanse $|tuvaluan dollars|tuvaluan dollar|tuvaluan $", + ), + ("Dollar", "dollars|dollar|$"), + ("Chinese yuan", "chinese renminbi|chinese yuan|yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"), + ("Fen", "fen"), + ("Jiao", "jiao|mao"), + ("Finnish markka", "finse mark|finse markka|suomen markka|finnish markka|finsk mark|fim|markkaa|markka"), + ("Penni", "penniä|penni"), + ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), + ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), + ("Satoshi", "satoshi|satoshis"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afghan afghani", "AFN"), + ("Euro", "EUR"), + ("Albanian lek", "ALL"), + ("Angolan kwanza", "AOA"), + ("Armenian dram", "AMD"), + ("Aruban florin", "AWG"), + ("Bangladeshi taka", "BDT"), + ("Bhutanese ngultrum", "BTN"), + ("Bolivian boliviano", "BOB"), + ("Bosnia and Herzegovina convertible mark", "BAM"), + ("Botswana pula", "BWP"), + ("Brazilian real", "BRL"), + ("Bulgarian lev", "BGN"), + ("Cambodian riel", "KHR"), + ("Cape Verdean escudo", "CVE"), + ("Costa Rican colón", "CRC"), + ("Croatian kuna", "HRK"), + ("Czech koruna", "CZK"), + ("Eritrean nakfa", "ERN"), + ("Ethiopian birr", "ETB"), + ("Gambian dalasi", "GMD"), + ("Georgian lari", "GEL"), + ("Ghanaian cedi", "GHS"), + ("Guatemalan quetzal", "GTQ"), + ("Haitian gourde", "HTG"), + ("Honduran lempira", "HNL"), + ("Hungarian forint", "HUF"), + ("Iranian rial", "IRR"), + ("Yemeni rial", "YER"), + ("Israeli new shekel", "ILS"), + ("Japanese yen", "JPY"), + ("Kazakhstani tenge", "KZT"), + ("Kenyan shilling", "KES"), + ("North Korean won", "KPW"), + ("South Korean won", "KRW"), + ("Kyrgyzstani som", "KGS"), + ("Lao kip", "LAK"), + ("Lesotho loti", "LSL"), + ("South African rand", "ZAR"), + ("Macanese pataca", "MOP"), + ("Macedonian denar", "MKD"), + ("Malagasy ariary", "MGA"), + ("Malawian kwacha", "MWK"), + ("Malaysian ringgit", "MYR"), + ("Mauritanian ouguiya", "MRO"), + ("Mongolian tögrög", "MNT"), + ("Mozambican metical", "MZN"), + ("Burmese kyat", "MMK"), + ("Nicaraguan córdoba", "NIO"), + ("Nigerian naira", "NGN"), + ("Turkish lira", "TRY"), + ("Omani rial", "OMR"), + ("Panamanian balboa", "PAB"), + ("Papua New Guinean kina", "PGK"), + ("Paraguayan guaraní", "PYG"), + ("Peruvian sol", "PEN"), + ("Polish złoty", "PLN"), + ("Qatari riyal", "QAR"), + ("Saudi riyal", "SAR"), + ("Samoan tālā", "WST"), + ("São Tomé and Príncipe dobra", "STD"), + ("Sierra Leonean leone", "SLL"), + ("Swazi lilangeni", "SZL"), + ("Tajikistani somoni", "TJS"), + ("Thai baht", "THB"), + ("Ukrainian hryvnia", "UAH"), + ("Vanuatu vatu", "VUV"), + ("Venezuelan bolívar", "VEF"), + ("Zambian kwacha", "ZMW"), + ("Moroccan dirham", "MAD"), + ("United Arab Emirates dirham", "AED"), + ("Azerbaijani manat", "AZN"), + ("Turkmenistan manat", "TMT"), + ("Somali shilling", "SOS"), + ("Tanzanian shilling", "TZS"), + ("Ugandan shilling", "UGX"), + ("Romanian leu", "RON"), + ("Moldovan leu", "MDL"), + ("Nepalese rupee", "NPR"), + ("Pakistani rupee", "PKR"), + ("Indian rupee", "INR"), + ("Seychellois rupee", "SCR"), + ("Mauritian rupee", "MUR"), + ("Maldivian rufiyaa", "MVR"), + ("Sri Lankan rupee", "LKR"), + ("Indonesian rupiah", "IDR"), + ("Danish krone", "DKK"), + ("Estonian kroon", "EEK"), + ("Norwegian krone", "NOK"), + ("Icelandic króna", "ISK"), + ("Swedish krona", "SEK"), + ("West African CFA franc", "XOF"), + ("Central African CFA franc", "XAF"), + ("Comorian franc", "KMF"), + ("Congolese franc", "CDF"), + ("Burundian franc", "BIF"), + ("Djiboutian franc", "DJF"), + ("CFP franc", "XPF"), + ("Guinean franc", "GNF"), + ("Swiss franc", "CHF"), + ("Rwandan franc", "RWF"), + ("Russian ruble", "RUB"), + ("Transnistrian ruble", "PRB"), + ("New Belarusian ruble", "BYN"), + ("Algerian dinar", "DZD"), + ("Bahraini dinar", "BHD"), + ("Iraqi dinar", "IQD"), + ("Jordanian dinar", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Libyan dinar", "LYD"), + ("Serbian dinar", "RSD"), + ("Tunisian dinar", "TND"), + ("Argentine peso", "ARS"), + ("Chilean peso", "CLP"), + ("Colombian peso", "COP"), + ("Cuban convertible peso", "CUC"), + ("Cuban peso", "CUP"), + ("Dominican peso", "DOP"), + ("Mexican peso", "MXN"), + ("Uruguayan peso", "UYU"), + ("British pound", "GBP"), + ("Saint Helena pound", "SHP"), + ("Egyptian pound", "EGP"), + ("Falkland Islands pound", "FKP"), + ("Gibraltar pound", "GIP"), + ("Manx pound", "IMP"), + ("Jersey pound", "JEP"), + ("Lebanese pound", "LBP"), + ("South Sudanese pound", "SSP"), + ("Sudanese pound", "SDG"), + ("Syrian pound", "SYP"), + ("United States dollar", "USD"), + ("Australian dollar", "AUD"), + ("Bahamian dollar", "BSD"), + ("Barbadian dollar", "BBD"), + ("Belize dollar", "BZD"), + ("Bermudian dollar", "BMD"), + ("Brunei dollar", "BND"), + ("Singapore dollar", "SGD"), + ("Canadian dollar", "CAD"), + ("Cayman Islands dollar", "KYD"), + ("New Zealand dollar", "NZD"), + ("Fijian dollar", "FJD"), + ("Guyanese dollar", "GYD"), + ("Hong Kong dollar", "HKD"), + ("Jamaican dollar", "JMD"), + ("Liberian dollar", "LRD"), + ("Namibian dollar", "NAD"), + ("Solomon Islands dollar", "SBD"), + ("Surinamese dollar", "SRD"), + ("New Taiwan dollar", "TWD"), + ("Trinidad and Tobago dollar", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Chinese yuan", "CNY"), + ("Rial", "__RI"), + ("Shiling", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dollar", "__D"), + ("Manat", "__MA"), + ("Rupee", "__R"), + ("Krone", "__K"), + ("Krona", "__K"), + ("Crown", "__K"), + ("Frank", "__F"), + ("Mark", "__M"), + ("Ruble", "__RB"), + ("Peso", "__PE"), + ("Pound", "__P"), + ("Tristan da Cunha pound", "_TP"), + ("South Georgia and the South Sandwich Islands pound", "_SP"), + ("Somaliland shilling", "_SS"), + ("Pitcairn Islands dollar", "_PND"), + ("Palauan dollar", "_PD"), + ("Niue dollar", "_NID"), + ("Nauruan dollar", "_ND"), + ("Micronesian dollar", "_MD"), + ("Kiribati dollar", "_KID"), + ("Guernsey pound", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dollar", "_CKD"), + ("British Virgin Islands dollar", "_BD"), + ("Ascension pound", "_AP"), + ("Alderney pound", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarkë", "QINDARKE"), + ("Penny", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENTAVO"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENTIMO"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Kwartje", "KWARTJE"), + ("Dubbeltje", "DUBBELTJE"), + ("Stuiver", "STUIVER"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '(?en)' + CurrencyPrefixList = dict( + [ + ("Dollar", "$"), + ("United States dollar", "amerikaanse $|united states $|us$|us $|u.s. $|u.s $"), + ("East Caribbean dollar", "oost-caribische $|oost caribische $|east caribbean $"), + ("Australian dollar", "australische $|australian $|australia $"), + ("Bahamian dollar", "bahamaanse $|bahamian $|bahamia $"), + ("Barbadian dollar", "barbadiaanse $|barbadian $|barbadin $"), + ("Belize dollar", "belizaanse $|belize $"), + ("Bermudian dollar", "bermudaanse $|bermudian $"), + ( + "British Virgin Islands dollar", + "britse maagdeneilanden $|british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $", + ), + ("Brunei dollar", "bruneise $|brunei $|b$"), + ("Sen", "sen"), + ("Singapore dollar", "singaporese $|singapore $|s$"), + ("Canadian dollar", "canadese $|canadian $|can$|c$|c $|canada $"), + ("Cayman Islands dollar", "kaaimaneilandse $|cayman islands $|ci$|cayman island $"), + ("New Zealand dollar", "nieuw-zeelandse $|nieuw zeelandse $|new zealand $|nz$|nz $"), + ("Cook Islands dollar", "cookeilandse $|cook islands $|cook island $"), + ("Fijian dollar", "fiji-$|fijian $|fiji $"), + ("Guyanese dollar", "guyaanse $|gy$|gy $|g$|g $"), + ("Hong Kong dollar", "hongkong $|hong kong $|hk$|hkd|hk $"), + ("Jamaican dollar", "jamaicaanse $|jamaican $|j$|jamaica $"), + ("Kiribati dollar", "kiribatische $|kiribati $"), + ("Liberian dollar", "liberiaanse $|liberian $|liberia $"), + ("Micronesian dollar", "micronesische $|micronesian $"), + ("Namibian dollar", "namibische $|namibian $|nad|n$|namibia $"), + ("Nauruan dollar", "nauruaanse $|nauruan $"), + ("Niue dollar", "niue $"), + ("Palauan dollar", "palaus $|palauan $"), + ("Pitcairn Islands dollar", "pitcairneilandse $|pitcairn islands $|pitcairn island $"), + ("Solomon Islands dollar", "salomon-$|salomon $|solomon islands $|si$|si $|solomon island $"), + ("Surinamese dollar", "surinaamse $|surinamese $|surinam $"), + ("New Taiwan dollar", "taiwanese $|nt$|nt $"), + ("Trinidad and Tobago dollar", "trinidad en tobago $|trinidad and tobago $|trinidad $|trinidadian $"), + ("Tuvaluan dollar", "tuvaluaanse $|tuvaluan $"), + ("Samoan tālā", "ws$"), + ("Chinese yuan", "¥"), + ("Japanese yen", "¥"), + ("Euro", "€|eur"), + ("Pound", "£"), + ("Costa Rican colón", "₡"), + ("Turkish lira", "₺"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) + AmbiguousCurrencyUnitList = [ + r'din.', + r'kiwi', + r'kina', + r'kobo', + r'lari', + r'lipa', + r'napa', + r'para', + r'sfr.', + r'taka', + r'tala', + r'toea', + r'vatu', + r'yuan', + r'ang', + r'ban', + r'bob', + r'btn', + r'byr', + r'cad', + r'cop', + r'cup', + r'dop', + r'gip', + r'jod', + r'kgs', + r'lak', + r'lei', + r'mga', + r'mop', + r'nad', + r'omr', + r'pul', + r'sar', + r'sbd', + r'scr', + r'sdg', + r'sek', + r'sen', + r'sol', + r'sos', + r'std', + r'try', + r'yer', + r'yen', + ] AmbiguityFiltersDict = dict([("null", "null")]) - TemperatureAmbiguityFiltersDict = dict([("\\b(gra(ad|den)|°)$", "\\b((gra(ad|den)|°)\\s*(draai(en|t)?|geroteerd|roterend|rotatie|hoek)|(draai(en|t)?|geroteerd|roterend|rotatie|hoek)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(gra(ad|den)\\b|°))")]) - DimensionAmbiguityFiltersDict = dict([("\\b(gra(ad|den)|°)$", "\\b((gra(ad|den)|°)\\s*(c(elsius)?|f(ah?renheit)?)|(temperatuur)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(gra(ad|den)\\b|°))")]) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/english_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/english_numeric_with_unit.py index a70f1811ba..85280a1795 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/english_numeric_with_unit.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/english_numeric_with_unit.py @@ -9,704 +9,778 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_numbers import BaseNumbers + # pylint: disable=line-too-long class EnglishNumericWithUnit: - AgePrefixList = dict([("Age", "Age|age")]) - AgeSuffixList = dict([("Year", "years old|year old|year-old|years-old|-year-old|-years-old|years of age|year of age|yo"), - ("Month", "months old|month old|month-old|months-old|-month-old|-months-old|month of age|months of age|mo"), - ("Week", "weeks old|week old|week-old|weeks-old|-week-old|-weeks-old|week of age|weeks of age"), - ("Day", "days old|day old|day-old|days-old|-day-old|-days-old|day of age|days of age")]) - AmbiguousAgeUnitList = [r'yo', r'mo'] - AreaSuffixList = dict([("Square kilometer", "sq km|sq kilometer|sq kilometre|sq kilometers|sq kilometres|square kilometer|square kilometre|square kilometers|square kilometres|km2|km^2|km²"), - ("Square hectometer", "sq hm|sq hectometer|sq hectometre|sq hectometers|sq hectometres|square hectometer|square hectometre|square hectometers|square hectometres|hm2|hm^2|hm²|hectare|hectares"), - ("Square decameter", "sq dam|sq decameter|sq decametre|sq decameters|sq decametres|square decameter|square decametre|square decameters|square decametres|sq dekameter|sq dekametre|sq dekameters|sq dekametres|square dekameter|square dekametre|square dekameters|square dekametres|dam2|dam^2|dam²"), - ("Square meter", "sq m|sq meter|sq metre|sq meters|sq metres|sq metre|square meter|square meters|square metre|square metres|m2|m^2|m²"), - ("Square decimeter", "sq dm|sq decimeter|sq decimetre|sq decimeters|sq decimetres|square decimeter|square decimetre|square decimeters|square decimetres|dm2|dm^2|dm²"), - ("Square centimeter", "sq cm|sq centimeter|sq centimetre|sq centimeters|sq centimetres|square centimeter|square centimetre|square centimeters|square centimetres|cm2|cm^2|cm²"), - ("Square millimeter", "sq mm|sq millimeter|sq millimetre|sq millimeters|sq millimetres|square millimeter|square millimetre|square millimeters|square millimetres|mm2|mm^2|mm²"), - ("Square inch", "sq in|sq inch|square inch|square inches|in2|in^2|in²"), - ("Square foot", "sqft|sq ft|sq foot|sq feet|square foot|square feet|feet2|feet^2|feet²|ft2|ft^2|ft²"), - ("Square mile", "sq mi|sq mile|sqmiles|square mile|square miles|mi2|mi^2|mi²"), - ("Square yard", "sq yd|sq yard|sq yards|square yard|square yards|yd2|yd^2|yd²"), - ("Acre", "-acre|acre|acres")]) - AmbiguousAreaUnitList = [r'n/a'] - CurrencySuffixList = dict([("Abkhazian apsar", "abkhazian apsar|apsars"), - ("Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"), - ("Pul", "pul"), - ("Euro", "euros|euro|€|eur"), - ("Cent", "cents|cent|-cents|-cent"), - ("Albanian lek", "albanian lek|leks|lek"), - ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), - ("Angolan kwanza", "angolan kwanza|kz|aoa|kwanza|kwanzas|angolan kwanzas"), - ("Armenian dram", "armenian drams|armenian dram"), - ("Aruban florin", "aruban florin|ƒ|awg|aruban florins"), - ("Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"), - ("Paisa", "poisha|paisa"), - ("Bhutanese ngultrum", "bhutanese ngultrum|nu.|btn"), - ("Chetrum", "chetrums|chetrum"), - ("Bolivian boliviano", "bolivian boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|bolivian bolivianos"), - ("Bosnia and Herzegovina convertible mark", "bosnia and herzegovina convertible mark|bam"), - ("Fening", "fenings|fenings"), - ("Botswana pula", "botswana pula|bwp|pula|pulas|botswana pulas"), - ("Thebe", "thebe"), - ("Brazilian real", "brazilian real|r$|brl|brazil real|brazil reals|brazilian reals"), - ("Bulgarian lev", "bulgarian lev|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"), - ("Stotinka", "stotinki|stotinka"), - ("Cambodian riel", "cambodian riel|khr|៛|cambodia riel|cambodia riels|cambodian riels"), - ("Cape Verdean escudo", "cape verdean escudo|cve"), - ("Costa Rican colón", "costa rican colón|costa rican colóns|crc|₡|costa rica colón|costa rica colóns|costa rican colon|costa rican colons|costa rica colon|costa rica colons"), - ("Salvadoran colón", "svc|salvadoran colón|salvadoran colóns|salvador colón|salvador colóns|salvadoran colon|salvadoran colons|salvador colon|salvador colons"), - ("Céntimo", "céntimo"), - ("Croatian kuna", "croatian kuna|kn|hrk|croatia kuna|croatian kunas|croatian kuna kunas"), - ("Lipa", "lipa"), - ("Czech koruna", "czech koruna|czk|kč|czech korunas"), - ("Haléř", "haléř"), - ("Eritrean nakfa", "eritrean nakfa|nfk|ern|eritrean nakfas"), - ("Ethiopian birr", "ethiopian birr|etb"), - ("Gambian dalasi", "gmd"), - ("Butut", "bututs|butut"), - ("Georgian lari", "georgian lari|lari|gel|₾"), - ("Tetri", "tetri"), - ("Ghanaian cedi", "ghanaian cedi|ghs|₵|gh₵"), - ("Pesewa", "pesewas|pesewa"), - ("Guatemalan quetzal", "guatemalan quetzal|gtq|guatemala quetzal"), - ("Haitian gourde", "haitian gourde|htg"), - ("Honduran lempira", "honduran lempira|hnl"), - ("Hungarian forint", "hungarian forint|huf|ft|hungary forint|hungary forints|hungarian forints"), - ("Fillér", "fillér"), - ("Iranian rial", "iranian rial|irr|iran rial|iran rials|iranian rials"), - ("Yemeni rial", "yemeni rial|yer|yemeni rials"), - ("Israeli new shekel", "₪|ils|agora"), - ("Lithuanian litas", "ltl|lithuanian litas|lithuan litas|lithuanian lit|lithuan lit"), - ("Japanese yen", "japanese yen|jpy|yen|-yen|¥|yens|japanese yens|japan yen|japan yens"), - ("Kazakhstani tenge", "kazakhstani tenge|kazakh tenge|kazak tenge|kzt"), - ("Kenyan shilling", "kenyan shilling|kes"), - ("North Korean won", "north korean won|kpw|north korean wons"), - ("South Korean won", "south korean won|krw|south korean wons"), - ("Korean won", "korean won|₩|korean wons"), - ("Kyrgyzstani som", "kyrgyzstani som|kgs"), - ("Uzbekitan som", "uzbekitan som|uzs"), - ("Lao kip", "lao kip|lak|₭n|₭"), - ("Att", "att"), - ("Lesotho loti", "lesotho loti|lsl|loti"), - ("Sente", "sente|lisente"), - ("South African rand", "south african rand|zar|south africa rand|south africa rands|south african rands"), - ("Macanese pataca", "macanese pataca|mop$|mop"), - ("Avo", "avos|avo"), - ("Macedonian denar", "macedonian denar|mkd|ден"), - ("Deni", "deni"), - ("Malagasy ariary", "malagasy ariary|mga"), - ("Iraimbilanja", "iraimbilanja"), - ("Malawian kwacha", "malawian kwacha|mk|mwk"), - ("Tambala", "tambala"), - ("Malaysian ringgit", "malaysian ringgit|rm|myr|malaysia ringgit|malaysia ringgits|malaysian ringgits"), - ("Mauritanian ouguiya", "mauritanian ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritanian ouguiyas"), - ("Khoums", "khoums"), - ("Mongolian tögrög", "mongolian tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongolian tögrögs|mongolian togrog|mongolian togrogs|mongolia togrog|mongolia togrogs"), - ("Mozambican metical", "mozambican metical|mt|mzn|mozambica metical|mozambica meticals|mozambican meticals"), - ("Burmese kyat", "burmese kyat|ks|mmk"), - ("Pya", "pya"), - ("Nicaraguan córdoba", "nicaraguan córdoba|nio"), - ("Nigerian naira", "nigerian naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigerian nairas"), - ("Kobo", "kobo"), - ("Turkish lira", "turkish lira|try|tl|turkey lira|turkey liras|turkish liras"), - ("Kuruş", "kuruş"), - ("Omani rial", "omani rial|omr|ر.ع."), - ("Panamanian balboa", "panamanian balboa|b/.|pab"), - ("Centesimo", "centesimo"), - ("Papua New Guinean kina", "papua new guinean kina|kina|pgk"), - ("Toea", "toea"), - ("Paraguayan guaraní", "paraguayan guaraní|₲|pyg"), - ("Peruvian sol", "peruvian sol|soles|sol|peruvian nuevo sol"), - ("Polish złoty", "złoty|polish złoty|zł|pln|zloty|polish zloty|poland zloty|poland złoty"), - ("Grosz", "groszy|grosz|grosze"), - ("Qatari riyal", "qatari riyal|qar|qatari riyals|qatar riyal|qatar riyals"), - ("Saudi riyal", "saudi riyal|sar|saudi riyals"), - ("Riyal", "riyal|riyals|rial|﷼"), - ("Dirham", "dirham|dirhem|dirhm"), - ("Halala", "halalas|halala"), - ("Samoan tālā", "samoan tālā|tālā|tala|ws$|samoa|wst|samoan tala"), - ("Sene", "sene"), - ("São Tomé and Príncipe dobra", "são tomé and príncipe dobra|dobras|dobra"), - ("Sierra Leonean leone", "sierra leonean leone|sll|leone|le"), - ("Peseta", "pesetas|peseta"), - ("Netherlands guilder", "florin|netherlands antillean guilder|ang|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl"), - ("Swazi lilangeni", "swazi lilangeni|lilangeni|szl|emalangeni"), - ("Tajikistani somoni", "tajikistani somoni|tjs|somoni"), - ("Diram", "dirams|diram"), - ("Thai baht", "thai baht|฿|thb|baht"), - ("Satang", "satang|satangs"), - ("Tongan paʻanga", "tongan paʻanga|paʻanga|tongan pa'anga|pa'anga"), - ("Seniti", "seniti"), - ("Ukrainian hryvnia", "ukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias"), - ("Vanuatu vatu", "vanuatu vatu|vatu|vuv"), - ("Venezuelan bolívar", "venezuelan bolívar|venezuelan bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivarsvenezuelan bolivar|venezuelan bolivars"), - ("Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"), - ("Zambian kwacha", "zambian kwacha|zk|zmw|zambia kwacha|kwachas|zambian kwachas"), - ("Moroccan dirham", "moroccan dirham|mad|د.م."), - ("United Arab Emirates dirham", "united arab emirates dirham|د.إ|aed"), - ("Azerbaijani manat", "azerbaijani manat|azn"), - ("Turkmenistan manat", "turkmenistan manat|turkmenistan new manat|tmt"), - ("Manat", "manats|manat"), - ("Qəpik", "qəpik"), - ("Somali shilling", "somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos"), - ("Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"), - ("Tanzanian shilling", "tanzanian shilling|tanzanian shillings|tsh|tzs|tanzania shilling|tanzania shillings"), - ("Ugandan shilling", "ugandan shilling|ugandan shillings|ugx|uganda shilling|uganda shillings"), - ("Romanian leu", "romanian leu|lei|ron|romania leu"), - ("Moldovan leu", "moldovan leu|mdl|moldova leu"), - ("Leu", "leu"), - ("Ban", "bani|-ban|ban"), - ("Nepalese rupee", "nepalese rupees|nepalese rupee|npr"), - ("Pakistani rupee", "pakistani rupees|pakistani rupee|pkr"), - ("Indian rupee", "indian rupees|indian rupee|inr|₹|india rupees|india rupee"), - ("Seychellois rupee", "seychellois rupees|seychellois rupee|scr|sr|sre"), - ("Mauritian rupee", "mauritian rupees|mauritian rupee|mur"), - ("Maldivian rufiyaa", "maldivian rufiyaas|maldivian rufiyaa|mvr|.ރ|maldive rufiyaas|maldive rufiyaa"), - ("Sri Lankan rupee", "sri lankan rupees|sri lankan rupee|lkr|රු|ரூ"), - ("Indonesian rupiah", "indonesian rupiah|rupiah|perak|rp|idr"), - ("Rupee", "rupee|rupees|rs"), - ("Danish krone", "danish krone|dkk|denmark krone|denmark krones|danish krones"), - ("Norwegian krone", "norwegian krone|nok|norway krone|norway krones|norwegian krones"), - ("Faroese króna", "faroese króna|faroese krona"), - ("Icelandic króna", "icelandic króna|isk|icelandic krona|iceland króna|iceland krona"), - ("Swedish krona", "swedish krona|sek|swedan krona"), - ("Krone", "kronor|krona|króna|krone|krones|kr|-kr"), - ("Øre", "Øre|oyra|eyrir"), - ("West African CFA franc", "west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc"), - ("Central African CFA franc", "central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc"), - ("Comorian franc", "comorian franc|kmf"), - ("Congolese franc", "congolese franc|cdf"), - ("Burundian franc", "burundian franc|bif"), - ("Djiboutian franc", "djiboutian franc|djf"), - ("CFP franc", "cfp franc|xpf"), - ("Guinean franc", "guinean franc|gnf"), - ("Swiss franc", "swiss francs|swiss franc|chf|sfr."), - ("Rwandan franc", "Rwandan franc|rwf|rf|r₣|frw"), - ("Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"), - ("Rappen", "rappen|-rappen"), - ("Franc", "francs|franc|fr.|fs"), - ("Centime", "centimes|centime|santim"), - ("Russian ruble", "russian ruble|₽|rub|russia ruble|russia ₽|russian ₽|russian rubles|russia rubles"), - ("New Belarusian ruble", "new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles"), - ("Old Belarusian ruble", "old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles"), - ("Transnistrian ruble", "transnistrian ruble|prb|р."), - ("Belarusian ruble", "belarusian ruble|belarus ruble|belarus rubles|belarusian rubles"), - ("Kopek", "kopek|kopeks"), - ("Kapyeyka", "kapyeyka"), - ("Ruble", "rubles|ruble|br"), - ("Algerian dinar", "algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"), - ("Bahraini dinar", "bahraini dinars|bahraini dinar|bhd|.د.ب"), - ("Santeem", "santeem|santeems"), - ("Iraqi dinar", "iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"), - ("Jordanian dinar", "jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"), - ("Kuwaiti dinar", "kuwaiti dinars|kuwaiti dinar|kwd|د.ك"), - ("Libyan dinar", "libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"), - ("Serbian dinar", "serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"), - ("Tunisian dinar", "tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"), - ("Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"), - ("Dinar", "dinars|dinar|denar|-dinars|-dinar"), - ("Fils", "fils|fulūs|-fils|-fil"), - ("Para", "para|napa"), - ("Millime", "millimes|millime"), - ("Argentine peso", "argentine peso|ars|argetina peso|argetina pesos|argentine pesos"), - ("Chilean peso", "chilean pesos|chilean peso|clp|chile peso|chile peso"), - ("Colombian peso", "colombian pesos|colombian peso|cop|colombia peso|colombia pesos"), - ("Cuban convertible peso", "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"), - ("Cuban peso", "cuban pesos|cuban peso|cup|cuba pesos|cuba peso"), - ("Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"), - ("Mexican peso", "mexican pesos|mexican peso|mxn|mexico pesos|mexico peso|mxn$|mxn $|mex$"), - ("Philippine peso", "piso|philippine pesos|philippine peso|₱|php"), - ("Uruguayan peso", "uruguayan pesos|uruguayan peso|uyu"), - ("Peso", "pesos|peso"), - ("Centavo", "centavos|centavo"), - ("Alderney pound", "alderney pounds|alderney pound|alderney £"), - ("British pound", "british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots"), - ("Guernsey pound", "guernsey pounds|guernsey £|ggp"), - ("Ascension pound", "ascension pounds|ascension pound|ascension £"), - ("Saint Helena pound", "saint helena pounds|saint helena pound|saint helena £|shp"), - ("Egyptian pound", "egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"), - ("Falkland Islands pound", "falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £"), - ("Gibraltar pound", "gibraltar pounds|gibraltar pound|gibraltar £|gip"), - ("Manx pound", "manx pounds|manx pound|manx £|imp"), - ("Jersey pound", "jersey pounds|jersey pound|jersey £|jep"), - ("Lebanese pound", "lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل"), - ("South Georgia and the South Sandwich Islands pound", "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"), - ("South Sudanese pound", "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"), - ("Sudanese pound", "sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"), - ("Syrian pound", "syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"), - ("Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"), - ("Pound", "pounds|pound|-pounds|-pound|£"), - ("Pence", "pence"), - ("Shilling", "shillings|shilling|shilingi|sh"), - ("Penny", "pennies|penny"), - ("United States dollar", "united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars|usd$"), - ("East Caribbean dollar", "east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"), - ("Australian dollar", "australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$"), - ("Bahamian dollar", "bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$"), - ("Barbadian dollar", "barbadian dollars|barbadian dollar|barbadian $|bbd"), - ("Belize dollar", "belize dollars|belize dollar|belize $|bzd"), - ("Bermudian dollar", "bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $"), - ("British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"), - ("Brunei dollar", "brunei dollar|brunei $|bnd"), - ("Sen", "sen"), - ("Singapore dollar", "singapore dollars|singapore dollar|singapore $|s$|sgd"), - ("Canadian dollar", "canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $"), - ("Cayman Islands dollar", "cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $"), - ("New Zealand dollar", "new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"), - ("Cook Islands dollar", "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $"), - ("Fijian dollar", "fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"), - ("Guyanese dollar", "guyanese dollars|guyanese dollar|gyd|gy$"), - ("Hong Kong dollar", "hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"), - ("Jamaican dollar", "jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"), - ("Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $"), - ("Liberian dollar", "liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"), - ("Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"), - ("Namibian dollar", "namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"), - ("Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"), - ("Niue dollar", "niue dollars|niue dollar|niue $"), - ("Palauan dollar", "palauan dollars|palauan dollar|palauan $"), - ("Pitcairn Islands dollar", "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"), - ("Solomon Islands dollar", "solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"), - ("Surinamese dollar", "surinamese dollars|surinamese dollar|surinamese $|srd"), - ("New Taiwan dollar", "new taiwan dollars|new taiwan dollar|nt$|twd|ntd"), - ("Trinidad and Tobago dollar", "trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"), - ("Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"), - ("Dollar", "dollars|dollar|$"), - ("Chinese yuan", "yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"), - ("Fen", "fen"), - ("Jiao", "jiao|mao"), - ("Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka"), - ("Penni", "penniä|penni"), - ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), - ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), - ("Satoshi", "satoshi|satoshis")]) - CurrencyNameToIsoCodeMap = dict([("Afghan afghani", "AFN"), - ("Euro", "EUR"), - ("Albanian lek", "ALL"), - ("Angolan kwanza", "AOA"), - ("Armenian dram", "AMD"), - ("Aruban florin", "AWG"), - ("Bangladeshi taka", "BDT"), - ("Bhutanese ngultrum", "BTN"), - ("Bolivian boliviano", "BOB"), - ("Bosnia and Herzegovina convertible mark", "BAM"), - ("Botswana pula", "BWP"), - ("Brazilian real", "BRL"), - ("Bulgarian lev", "BGN"), - ("Cambodian riel", "KHR"), - ("Cape Verdean escudo", "CVE"), - ("Costa Rican colón", "CRC"), - ("Croatian kuna", "HRK"), - ("Czech koruna", "CZK"), - ("Eritrean nakfa", "ERN"), - ("Ethiopian birr", "ETB"), - ("Gambian dalasi", "GMD"), - ("Georgian lari", "GEL"), - ("Ghanaian cedi", "GHS"), - ("Guatemalan quetzal", "GTQ"), - ("Haitian gourde", "HTG"), - ("Honduran lempira", "HNL"), - ("Hungarian forint", "HUF"), - ("Iranian rial", "IRR"), - ("Yemeni rial", "YER"), - ("Israeli new shekel", "ILS"), - ("Japanese yen", "JPY"), - ("Kazakhstani tenge", "KZT"), - ("Kenyan shilling", "KES"), - ("North Korean won", "KPW"), - ("South Korean won", "KRW"), - ("Kyrgyzstani som", "KGS"), - ("Lao kip", "LAK"), - ("Lesotho loti", "LSL"), - ("South African rand", "ZAR"), - ("Macanese pataca", "MOP"), - ("Macedonian denar", "MKD"), - ("Malagasy ariary", "MGA"), - ("Malawian kwacha", "MWK"), - ("Malaysian ringgit", "MYR"), - ("Mauritanian ouguiya", "MRO"), - ("Mongolian tögrög", "MNT"), - ("Mozambican metical", "MZN"), - ("Burmese kyat", "MMK"), - ("Nicaraguan córdoba", "NIO"), - ("Nigerian naira", "NGN"), - ("Turkish lira", "TRY"), - ("Omani rial", "OMR"), - ("Panamanian balboa", "PAB"), - ("Papua New Guinean kina", "PGK"), - ("Paraguayan guaraní", "PYG"), - ("Peruvian sol", "PEN"), - ("Polish złoty", "PLN"), - ("Qatari riyal", "QAR"), - ("Saudi riyal", "SAR"), - ("Samoan tālā", "WST"), - ("São Tomé and Príncipe dobra", "STN"), - ("Sierra Leonean leone", "SLL"), - ("Swazi lilangeni", "SZL"), - ("Tajikistani somoni", "TJS"), - ("Thai baht", "THB"), - ("Ukrainian hryvnia", "UAH"), - ("Vanuatu vatu", "VUV"), - ("Venezuelan bolívar", "VEF"), - ("Zambian kwacha", "ZMW"), - ("Moroccan dirham", "MAD"), - ("United Arab Emirates dirham", "AED"), - ("Azerbaijani manat", "AZN"), - ("Turkmenistan manat", "TMT"), - ("Somali shilling", "SOS"), - ("Tanzanian shilling", "TZS"), - ("Ugandan shilling", "UGX"), - ("Romanian leu", "RON"), - ("Moldovan leu", "MDL"), - ("Nepalese rupee", "NPR"), - ("Pakistani rupee", "PKR"), - ("Indian rupee", "INR"), - ("Seychellois rupee", "SCR"), - ("Mauritian rupee", "MUR"), - ("Maldivian rufiyaa", "MVR"), - ("Sri Lankan rupee", "LKR"), - ("Indonesian rupiah", "IDR"), - ("Danish krone", "DKK"), - ("Norwegian krone", "NOK"), - ("Icelandic króna", "ISK"), - ("Swedish krona", "SEK"), - ("West African CFA franc", "XOF"), - ("Central African CFA franc", "XAF"), - ("Comorian franc", "KMF"), - ("Congolese franc", "CDF"), - ("Burundian franc", "BIF"), - ("Djiboutian franc", "DJF"), - ("CFP franc", "XPF"), - ("Guinean franc", "GNF"), - ("Swiss franc", "CHF"), - ("Rwandan franc", "RWF"), - ("Russian ruble", "RUB"), - ("Transnistrian ruble", "PRB"), - ("New Belarusian ruble", "BYN"), - ("Algerian dinar", "DZD"), - ("Bahraini dinar", "BHD"), - ("Iraqi dinar", "IQD"), - ("Jordanian dinar", "JOD"), - ("Kuwaiti dinar", "KWD"), - ("Libyan dinar", "LYD"), - ("Serbian dinar", "RSD"), - ("Tunisian dinar", "TND"), - ("Argentine peso", "ARS"), - ("Chilean peso", "CLP"), - ("Colombian peso", "COP"), - ("Cuban convertible peso", "CUC"), - ("Cuban peso", "CUP"), - ("Dominican peso", "DOP"), - ("Mexican peso", "MXN"), - ("Uruguayan peso", "UYU"), - ("British pound", "GBP"), - ("Saint Helena pound", "SHP"), - ("Egyptian pound", "EGP"), - ("Falkland Islands pound", "FKP"), - ("Gibraltar pound", "GIP"), - ("Manx pound", "IMP"), - ("Jersey pound", "JEP"), - ("Lebanese pound", "LBP"), - ("South Sudanese pound", "SSP"), - ("Sudanese pound", "SDG"), - ("Syrian pound", "SYP"), - ("United States dollar", "USD"), - ("Australian dollar", "AUD"), - ("Bahamian dollar", "BSD"), - ("Barbadian dollar", "BBD"), - ("Belize dollar", "BZD"), - ("Bermudian dollar", "BMD"), - ("Brunei dollar", "BND"), - ("Singapore dollar", "SGD"), - ("Canadian dollar", "CAD"), - ("Cayman Islands dollar", "KYD"), - ("New Zealand dollar", "NZD"), - ("Fijian dollar", "FJD"), - ("Guyanese dollar", "GYD"), - ("Hong Kong dollar", "HKD"), - ("Jamaican dollar", "JMD"), - ("Liberian dollar", "LRD"), - ("Namibian dollar", "NAD"), - ("Solomon Islands dollar", "SBD"), - ("Surinamese dollar", "SRD"), - ("New Taiwan dollar", "TWD"), - ("Trinidad and Tobago dollar", "TTD"), - ("Tuvaluan dollar", "TVD"), - ("Chinese yuan", "CNY"), - ("Rial", "__RI"), - ("Shiling", "__S"), - ("Som", "__SO"), - ("Dirham", "__DR"), - ("Dinar", "_DN"), - ("Dollar", "__D"), - ("Manat", "__MA"), - ("Rupee", "__R"), - ("Krone", "__K"), - ("Krona", "__K"), - ("Crown", "__K"), - ("Frank", "__F"), - ("Mark", "__M"), - ("Ruble", "__RB"), - ("Peso", "__PE"), - ("Pound", "__P"), - ("Tristan da Cunha pound", "_TP"), - ("South Georgia and the South Sandwich Islands pound", "_SP"), - ("Somaliland shilling", "_SS"), - ("Pitcairn Islands dollar", "_PND"), - ("Palauan dollar", "_PD"), - ("Niue dollar", "_NID"), - ("Nauruan dollar", "_ND"), - ("Micronesian dollar", "_MD"), - ("Kiribati dollar", "_KID"), - ("Guernsey pound", "_GGP"), - ("Faroese króna", "_FOK"), - ("Cook Islands dollar", "_CKD"), - ("British Virgin Islands dollar", "_BD"), - ("Ascension pound", "_AP"), - ("Alderney pound", "_ALP"), - ("Abkhazian apsar", "_AA"), - ("Bitcoin", "_XBT")]) - FractionalUnitNameToCodeMap = dict([("Jiao", "JIAO"), - ("Kopek", "KOPEK"), - ("Pul", "PUL"), - ("Cent", "CENT"), - ("Qindarkë", "QINDARKE"), - ("Penny", "PENNY"), - ("Santeem", "SANTEEM"), - ("Cêntimo", "CENTIMO"), - ("Centavo", "CENTAVO"), - ("Luma", "LUMA"), - ("Qəpik", "QƏPIK"), - ("Fils", "FILS"), - ("Poisha", "POISHA"), - ("Kapyeyka", "KAPYEYKA"), - ("Centime", "CENTIME"), - ("Chetrum", "CHETRUM"), - ("Paisa", "PAISA"), - ("Fening", "FENING"), - ("Thebe", "THEBE"), - ("Sen", "SEN"), - ("Stotinka", "STOTINKA"), - ("Fen", "FEN"), - ("Céntimo", "CENTIMO"), - ("Lipa", "LIPA"), - ("Haléř", "HALER"), - ("Øre", "ØRE"), - ("Piastre", "PIASTRE"), - ("Santim", "SANTIM"), - ("Oyra", "OYRA"), - ("Butut", "BUTUT"), - ("Tetri", "TETRI"), - ("Pesewa", "PESEWA"), - ("Fillér", "FILLER"), - ("Eyrir", "EYRIR"), - ("Dinar", "DINAR"), - ("Agora", "AGORA"), - ("Tïın", "TIIN"), - ("Chon", "CHON"), - ("Jeon", "JEON"), - ("Tyiyn", "TYIYN"), - ("Att", "ATT"), - ("Sente", "SENTE"), - ("Dirham", "DIRHAM"), - ("Rappen", "RAPPEN"), - ("Avo", "AVO"), - ("Deni", "DENI"), - ("Iraimbilanja", "IRAIMBILANJA"), - ("Tambala", "TAMBALA"), - ("Laari", "LAARI"), - ("Khoums", "KHOUMS"), - ("Ban", "BAN"), - ("Möngö", "MONGO"), - ("Pya", "PYA"), - ("Kobo", "KOBO"), - ("Kuruş", "KURUS"), - ("Baisa", "BAISA"), - ("Centésimo", "CENTESIMO"), - ("Toea", "TOEA"), - ("Sentimo", "SENTIMO"), - ("Grosz", "GROSZ"), - ("Sene", "SENE"), - ("Halala", "HALALA"), - ("Para", "PARA"), - ("Öre", "ORE"), - ("Diram", "DIRAM"), - ("Satang", "SATANG"), - ("Seniti", "SENITI"), - ("Millime", "MILLIME"), - ("Tennesi", "TENNESI"), - ("Kopiyka", "KOPIYKA"), - ("Tiyin", "TIYIN"), - ("Hào", "HAO"), - ("Ngwee", "NGWEE"), - ("Millibitcoin", "MILLIBITCOIN"), - ("Satoshi", "SATOSHI")]) - CompoundUnitConnectorRegex = f'(?and)' - MultiplierRegex = f'\\s*\\b(thousand|million|billion|trillion)s?\\b' - CurrencyPrefixList = dict([("Dobra", "db|std"), - ("Dollar", "$"), - ("Brazilian Real", "R$"), - ("United States dollar", "united states $|us$|us $|u.s. $|u.s $|usd$"), - ("East Caribbean dollar", "east caribbean $"), - ("Mexican peso", "mxn$|mxn $|mex$"), - ("Australian dollar", "australian $|australia $"), - ("Bahamian dollar", "bahamian $|bahamia $"), - ("Barbadian dollar", "barbadian $|barbadin $"), - ("Belize dollar", "belize $"), - ("Bermudian dollar", "bermudian $"), - ("British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"), - ("Brunei dollar", "brunei $|b$"), - ("Sen", "sen"), - ("Singapore dollar", "singapore $|s$"), - ("Canadian dollar", "canadian $|can$|c$|c $|canada $"), - ("Cayman Islands dollar", "cayman islands $|ci$|cayman island $"), - ("New Zealand dollar", "new zealand $|nz$|nz $"), - ("Cook Islands dollar", "cook islands $|cook island $"), - ("Fijian dollar", "fijian $|fiji $"), - ("Guyanese dollar", "gy$|gy $|g$|g $"), - ("Hong Kong dollar", "hong kong $|hk$|hkd|hk $"), - ("Indian rupee", "₹"), - ("Jamaican dollar", "jamaican $|j$|jamaica $"), - ("Kiribati dollar", "kiribati $"), - ("Liberian dollar", "liberian $|liberia $"), - ("Micronesian dollar", "micronesian $"), - ("Namibian dollar", "namibian $|nad|n$|namibia $"), - ("Nauruan dollar", "nauruan $"), - ("Niue dollar", "niue $"), - ("Palauan dollar", "palauan $"), - ("Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"), - ("Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"), - ("Surinamese dollar", "surinamese $|surinam $"), - ("New Taiwan dollar", "nt$|nt $"), - ("Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"), - ("Tuvaluan dollar", "tuvaluan $"), - ("Samoan tālā", "ws$"), - ("Chinese yuan", "¥"), - ("Japanese yen", "¥"), - ("Euro", "€"), - ("Pound", "£"), - ("Costa Rican colón", "₡"), - ("Turkish lira", "₺"), - ("Bitcoin", "₿|btc|xbt")]) - AmbiguousCurrencyUnitList = [r'din.', r'kiwi', r'kina', r'kobo', r'lari', r'lipa', r'napa', r'para', r'sfr.', r'taka', r'tala', r'toea', r'vatu', r'yuan', r'all', r'ang', r'ban', r'bob', r'btn', r'byr', r'cad', r'cop', r'cup', r'dop', r'gip', r'jod', r'kgs', r'lak', r'lei', r'mga', r'mop', r'nad', r'omr', r'pul', r'sar', r'sbd', r'scr', r'sdg', r'sek', r'sen', r'sol', r'sos', r'std', r'try', r'yer', r'yen', r'db', r'pen', r'ron', r'mad', r'zar', r'gel', r'satoshi', r'satoshis'] - InformationSuffixList = dict([("Bit", "-bit|bit|bits"), - ("Kilobit", "kilobit|kilobits|kb|Kb|kbit"), - ("Megabit", "megabit|megabits|mb|Mb|mbit"), - ("Gigabit", "gigabit|gigabits|gb|Gb|gbit"), - ("Terabit", "terabit|terabits|tb|Tb|tbit"), - ("Petabit", "petabit|petabits|pb|Pb|pbit"), - ("Byte", "-byte|byte|bytes"), - ("Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|KB|kilobytes|kilo byte|kilo bytes|kbyte"), - ("Megabyte", "-megabyte|-megabytes|megabyte|mB|MB|megabytes|mega byte|mega bytes|mbyte"), - ("Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|GB|gigabytes|giga byte|giga bytes|gbyte"), - ("Terabyte", "-terabyte|-terabytes|terabyte|tB|TB|terabytes|tera byte|tera bytes|tbyte"), - ("Petabyte", "-petabyte|-petabytes|petabyte|pB|PB|petabytes|peta byte|peta bytes|pbyte")]) - AmbiguousDimensionUnitList = [r'barrel', r'barrels', r'grain', r'grains', r'pound', r'stone', r'stones', r'yards', r'yard', r'cord', r'cords', r'dram', r'drachm', r'drachma', r'feet', r'foot', r'gill', r'knot', r'knots', r'peck', r'pecks', r'cup', r'cups', r'fps', r'pts', r'in', r'dm', r'"', r'pinch', r'pinches'] - BuildPrefix = f'(?<=(\\s|^))' - BuildSuffix = f'(?=(\\s|\\W|$))' - LengthSuffixList = dict([("Kilometer", "km|kilometer|kilometre|kilometers|kilometres|kilo meter|kilo meters|kilo metres|kilo metre"), - ("Hectometer", "hm|hectometer|hectometre|hectometers|hectometres|hecto meter|hecto meters|hecto metres|hecto metre"), - ("Decameter", "dam|decameter|decametre|decameters|decametres|deca meter|deca meters|deca metres|deca metre"), - ("Meter", "m|meter|metre|meters|metres"), - ("Decimeter", "dm|decimeter|decimeters|decimetre|decimetres|deci meter|deci meters|deci metres|deci metre"), - ("Centimeter", "cm|centimeter|centimeters|centimetre|centimetres|centi meter|centi meters|centi metres|centi metre"), - ("Millimeter", "mm|millimeter|millimeters|millimetre|millimetres|milli meter|milli meters|milli metres|milli metre"), - ("Micrometer", "μm|micrometer|micrometre|micrometers|micrometres|micro meter|micro meters|micro metres|micro metre"), - ("Nanometer", "nm|nanometer|nanometre|nanometers|nanometres|nano meter|nano meters|nano metres|nano metre"), - ("Picometer", "pm|picometer|picometre|picometers|picometres|pico meter|pico meters|pico metres|pico metre"), - ("Mile", "-mile|mile|miles"), - ("Yard", "yard|yards"), - ("Inch", "-inch|inch|inches|in|\""), - ("Foot", "-foot|foot|feet|ft"), - ("Light year", "light year|light-year|light years|light-years"), - ("Pt", "pt|pts")]) - AmbiguousLengthUnitList = [r'm', r'yard', r'yards', r'pm', r'pt', r'pts'] - SpeedSuffixList = dict([("Meter per second", "meter/second|meters/second|meters / second|m/s|meters per second|metres per second|meter per second|metre per second"), - ("Kilometer per hour", "km/h|kilometres per hour|kilometers per hour|kilometer per hour|kilometre per hour|kph|kmph|km/hr"), - ("Kilometer per minute", "km/min|kilometers per minute|kilometres per minute|kilometer per minute|kilometre per minute"), - ("Kilometer per second", "km/s|kilometers per second|kilometres per second|kilometer per second|kilometre per second"), - ("Mile per hour", "mph|mile per hour|miles per hour|mi/h|mile / hour|miles / hour|miles an hour|mi/hr"), - ("Knot", "kt|knot|knots|kn"), - ("Foot per second", "ft/s|foot/s|feet/s|foot per second|feet per second|fps"), - ("Foot per minute", "ft/min|foot/min|feet/min|foot per minute|feet per minute"), - ("Yard per minute", "yards per minute|yard per minute|yards / minute|yards/min|yard/min"), - ("Yard per second", "yards per second|yard per second|yards / second|yards/s|yard/s"), - ("Meter per millisecond", "meter/millisecond|meters/millisecond|meter / millisecond|meters / millisecond|meter per millisecond|meters per millisecond|m/ms"), - ("Centimeter per millisecond", "centimeter/millisecond|centimeters/millisecond|centimeter / millisecond|centimeters / millisecond|centimeter per millisecond|centimeters per millisecond|cm/ms"), - ("Kilometer per millisecond", "kilometer/millisecond|kilometers/millisecond|kilometer / millisecond|kilometers / millisecond|kilometer per millisecond|kilometers per millisecond|km/ms")]) - AmbiguousSpeedUnitList = [r'knot', r'knots', r'fps'] - TemperatureSuffixList = dict([("F", "degrees fahrenheit|degree fahrenheit|deg fahrenheit|degs fahrenheit|fahrenheit|°f|° f|degrees farenheit|degree farenheit|deg farenheit|degs farenheit|degrees f|degree f|deg f|degs f|farenheit|f"), - ("K", "k|K|kelvin"), - ("R", "rankine|°r"), - ("D", "delisle|°de"), - ("C", "degrees celsius|degree celsius|deg celsius|degs celsius|celsius|degrees celcius|degree celcius|celcius|deg celcius|degs celcius|degrees centigrade|degree centigrade|centigrade|degrees centigrate|degree centigrate|degs centigrate|deg centigrate|centigrate|degrees c|degree c|deg c|degs c|°c|° c|c"), - ("Degree", "degree|degrees|deg.|deg|°")]) - AmbiguousTemperatureUnitList = [r'c', r'f', r'k'] - VolumeSuffixList = dict([("Cubic meter", "m3|cubic meter|cubic meters|cubic metre|cubic metres"), - ("Cubic centimeter", "cubic centimeter|cubic centimetre|cubic centimeters|cubic centimetres"), - ("Cubic millimiter", "cubic millimiter|cubic millimitre|cubic millimiters|cubic millimitres"), - ("Hectoliter", "hectoliter|hectolitre|hectoliters|hectolitres"), - ("Decaliter", "decaliter|decalitre|dekaliter|dekalitre|decaliters|decalitres|dekaliters|dekalitres"), - ("Liter", "l|litre|liter|liters|litres"), - ("Deciliter", "dl|deciliter|decilitre|deciliters|decilitres"), - ("Centiliter", "cl|centiliter|centilitre|centiliters|centilitres"), - ("Milliliter", "ml|mls|millilitre|milliliter|millilitres|milliliters|cc"), - ("Cubic yard", "cubic yard|cubic yards"), - ("Cubic inch", "cubic inch|cubic inches"), - ("Cubic foot", "cubic foot|cubic feet"), - ("Cubic mile", "cubic mile|cubic miles"), - ("Fluid ounce", "fl oz|fluid ounce|fluid ounces"), - ("Teaspoon", "teaspoon|teaspoons|teaspoonful|teaspoonfuls|tsp|tsp.|tspn|tspn.|tea spoon|tea spoons|t.|ts."), - ("Tablespoon", "tablespoon|tablespoons|tablespoonful|tablespoonfuls|tbl|tbl.|tbs|tbs.|tbsp|tbsp.|table spoon|table spoons|T.|Tb.|tbls.|tbls"), - ("Pint", "pint|pints|fl pt| fluid pint"), - ("Quart", "quart|quarts|fl qt"), - ("Cup", "cup|cups"), - ("Gill", "gill|gills"), - ("Pinch", "pinch|pinches"), - ("Fluid Dram", "fluid dram|fluid drachm|fluid drachma|fluidram|fluidrams"), - ("Barrel", "barrel|bbl|barrels"), - ("Minim", "minim"), - ("Cord", "cord|cords"), - ("Peck", "peck|pecks"), - ("Bushel", "bushel"), - ("Hogshead", "hogshead")]) - AmbiguousVolumeUnitList = [r'l', r'ounce', r'oz', r'cup', r'cups', r'peck', r'pecks', r'cord', r'cords', r'gill', r'gills', r'barrel', r'barrels', r'tbl', r'quart', r'quarts', r'pinch', r't.', r'T.', r'Tb.', r'ts.'] - WeightSuffixList = dict([("Kilogram", "kg|kilogram|kilograms|kilo|kilos|kilogramme|kilogrammes"), - ("Gram", "g|gram|grams|gm|gramme|grammes"), - ("Milligram", "mg|milligram|milligrams|milligramme|milligrammes"), - ("Microgram", "μg|microgram|micrograms|micro gram|micro grams|microgramme|microgrammes|mcg"), - ("Gallon", "-gallon|gallons|gallon|gal"), - ("Metric ton", "metric tons|metric ton"), - ("Ton", "-ton|ton|tons|tonne|tonnes|t"), - ("Pound", "pound|pounds|lb|lbs"), - ("Ounce", "-ounce|ounce|oz|ounces"), - ("Grain", "grain|grains|gr"), - ("Pennyweight", "pennyweight"), - ("Long ton (British)", "british long ton|long ton (british)"), - ("Short ton (US)", "us short ton|short ton (us)"), - ("Short hundredweight (US)", "us short hundredweight|short hundredweight (us)"), - ("Stone", "stone"), - ("Dram", "dram|drachm|drachma|roman drachma|greek drachma")]) - AmbiguousWeightUnitList = [r'g', r't', r'gr', r'oz', r'stone', r'dram', r'lbs', r'gal', r'grain', r'grains'] - AngleSuffixList = dict([("Degree", "degree|degrees|deg.|deg|°"), - ("Radian", "radian|radians|rad"), - ("Turn", "turn|turns")]) - AmbiguousAngleUnitList = [r'turn', r'turns'] - AmbiguityFiltersDict = dict([("\\bm\\b", "((('|’)\\s*m)|(m\\s*('|’)))"), - ("^\\d{5} [cf]$", "\\b([a-z]{2} \\d{5} [cf])\\b"), - ("\\b\\d+\\s*\\p{L}+$", "((\\d+(\\s*\\p{L}+[-—–-]|\\p{L}+)\\d+)|(((\\p{L}|\\d)[-—–-]\\d+\\s*|\\p{L}\\d+)\\p{L}+))"), - ("^(all|bob|pen|cad|cup|cop|sos|ron|mad|mop|zar|gel)", "(all|bob|pen|cad|cup|cop|sos|ron|mad|mop|zar|gel)\\s*(\\d|\\p{L})"), - ("\\d\\s*pm\\b", "\\b(at|until|since|before|after)\\s\\d(\\d)?\\s*pm\\b"), - ("\\bin\\b", "\\bin\\s*(\\d{4}|(jan|febr)uary|march|april|may|ju(ne|ly)|august|october|(sept|nov|dec)ember)"), - ("\\b(13)?f\\b", "(\\bf-series\\b|\\b13f\\s(filings?|be fill?ed))"), - ("\\d\\d\\df", "boeing\\s777f"), - ("\\bc\\b", "\\bc\\.p\\.i(\\.)?"), - ("\\d\\s*c\\b", "(dividend (of|by) (\\d\\.)?\\d(\\d)?\\s*c|(\\d\\.)?\\d(\\d)?\\s*c/? (a share|per security))")]) - TemperatureAmbiguityFiltersDict = dict([("\\b(deg(rees?)?|°)$", "\\b((deg(rees?)?|°)\\s*(angle|rotation)|(rotat(ion|e[ds]?|ing)|angle)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(deg(rees?)?\\b|°))")]) - DimensionAmbiguityFiltersDict = dict([("\\b(deg(rees?)?|°)$", "\\b((deg(rees?)?|°)\\s*(c(elsius|entigrate)?|f(ah?renheit)?)|(temperature)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(deg(rees?)?\\b|°))"), - ("\\b\\d+\\s*\\p{L}+$", "((\\d+\\s*\\p{L}+\\d+)|(\\p{L}\\d+\\s*\\p{L}+))")]) + CurrencySuffixList = dict( + [ + ("Abkhazian apsar", "abkhazian apsar|apsars"), + ("Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"), + ("Pul", "pul"), + ("Euro", "euros|euro|€|eur"), + ("Cent", "cents|cent|-cents|-cent"), + ("Albanian lek", "albanian lek|leks|lek"), + ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), + ("Angolan kwanza", "angolan kwanza|kz|aoa|kwanza|kwanzas|angolan kwanzas"), + ("Armenian dram", "armenian drams|armenian dram"), + ("Aruban florin", "aruban florin|ƒ|awg|aruban florins"), + ("Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"), + ("Paisa", "poisha|paisa"), + ("Bhutanese ngultrum", "bhutanese ngultrum|nu.|btn"), + ("Chetrum", "chetrums|chetrum"), + ( + "Bolivian boliviano", + "bolivian boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|bolivian bolivianos", + ), + ("Bosnia and Herzegovina convertible mark", "bosnia and herzegovina convertible mark|bam"), + ("Fening", "fenings|fenings"), + ("Botswana pula", "botswana pula|bwp|pula|pulas|botswana pulas"), + ("Thebe", "thebe"), + ("Brazilian real", "brazilian real|r$|brl|brazil real|brazil reals|brazilian reals"), + ("Bulgarian lev", "bulgarian lev|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"), + ("Stotinka", "stotinki|stotinka"), + ("Cambodian riel", "cambodian riel|khr|៛|cambodia riel|cambodia riels|cambodian riels"), + ("Cape Verdean escudo", "cape verdean escudo|cve"), + ( + "Costa Rican colón", + "costa rican colón|costa rican colóns|crc|₡|costa rica colón|costa rica colóns|costa rican colon|costa rican colons|costa rica colon|costa rica colons", + ), + ( + "Salvadoran colón", + "svc|salvadoran colón|salvadoran colóns|salvador colón|salvador colóns|salvadoran colon|salvadoran colons|salvador colon|salvador colons", + ), + ("Céntimo", "céntimo"), + ("Croatian kuna", "croatian kuna|kn|hrk|croatia kuna|croatian kunas|croatian kuna kunas"), + ("Lipa", "lipa"), + ("Czech koruna", "czech koruna|czk|kč|czech korunas"), + ("Haléř", "haléř"), + ("Eritrean nakfa", "eritrean nakfa|nfk|ern|eritrean nakfas"), + ("Ethiopian birr", "ethiopian birr|etb"), + ("Gambian dalasi", "gmd"), + ("Butut", "bututs|butut"), + ("Georgian lari", "georgian lari|lari|gel|₾"), + ("Tetri", "tetri"), + ("Ghanaian cedi", "ghanaian cedi|ghs|₵|gh₵"), + ("Pesewa", "pesewas|pesewa"), + ("Guatemalan quetzal", "guatemalan quetzal|gtq|guatemala quetzal"), + ("Haitian gourde", "haitian gourde|htg"), + ("Honduran lempira", "honduran lempira|hnl"), + ("Hungarian forint", "hungarian forint|huf|ft|hungary forint|hungary forints|hungarian forints"), + ("Fillér", "fillér"), + ("Iranian rial", "iranian rial|irr|iran rial|iran rials|iranian rials"), + ("Yemeni rial", "yemeni rial|yer|yemeni rials"), + ("Israeli new shekel", "₪|ils|agora"), + ("Lithuanian litas", "ltl|lithuanian litas|lithuan litas|lithuanian lit|lithuan lit"), + ("Japanese yen", "japanese yen|jpy|yen|-yen|¥|yens|japanese yens|japan yen|japan yens"), + ("Kazakhstani tenge", "kazakhstani tenge|kazakh tenge|kazak tenge|kzt"), + ("Kenyan shilling", "kenyan shilling|kes"), + ("North Korean won", "north korean won|kpw|north korean wons"), + ("South Korean won", "south korean won|krw|south korean wons"), + ("Korean won", "korean won|₩|korean wons"), + ("Kyrgyzstani som", "kyrgyzstani som|kgs"), + ("Uzbekitan som", "uzbekitan som|uzs"), + ("Lao kip", "lao kip|lak|₭n|₭"), + ("Att", "att"), + ("Lesotho loti", "lesotho loti|lsl|loti"), + ("Sente", "sente|lisente"), + ("South African rand", "south african rand|zar|south africa rand|south africa rands|south african rands"), + ("Macanese pataca", "macanese pataca|mop$|mop"), + ("Avo", "avos|avo"), + ("Macedonian denar", "macedonian denar|mkd|ден"), + ("Deni", "deni"), + ("Malagasy ariary", "malagasy ariary|mga"), + ("Iraimbilanja", "iraimbilanja"), + ("Malawian kwacha", "malawian kwacha|mk|mwk"), + ("Tambala", "tambala"), + ("Malaysian ringgit", "malaysian ringgit|rm|myr|malaysia ringgit|malaysia ringgits|malaysian ringgits"), + ( + "Mauritanian ouguiya", + "mauritanian ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritanian ouguiyas", + ), + ("Khoums", "khoums"), + ( + "Mongolian tögrög", + "mongolian tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongolian tögrögs|mongolian togrog|mongolian togrogs|mongolia togrog|mongolia togrogs", + ), + ( + "Mozambican metical", + "mozambican metical|mt|mzn|mozambica metical|mozambica meticals|mozambican meticals", + ), + ("Burmese kyat", "burmese kyat|ks|mmk"), + ("Pya", "pya"), + ("Nicaraguan córdoba", "nicaraguan córdoba|nio"), + ("Nigerian naira", "nigerian naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigerian nairas"), + ("Kobo", "kobo"), + ("Turkish lira", "turkish lira|try|tl|turkey lira|turkey liras|turkish liras"), + ("Kuruş", "kuruş"), + ("Omani rial", "omani rial|omr|ر.ع."), + ("Panamanian balboa", "panamanian balboa|b/.|pab"), + ("Centesimo", "centesimo"), + ("Papua New Guinean kina", "papua new guinean kina|kina|pgk"), + ("Toea", "toea"), + ("Paraguayan guaraní", "paraguayan guaraní|₲|pyg"), + ("Peruvian sol", "peruvian sol|soles|sol|peruvian nuevo sol"), + ("Polish złoty", "złoty|polish złoty|zł|pln|zloty|polish zloty|poland zloty|poland złoty"), + ("Grosz", "groszy|grosz|grosze"), + ("Qatari riyal", "qatari riyal|qar|qatari riyals|qatar riyal|qatar riyals"), + ("Saudi riyal", "saudi riyal|sar|saudi riyals"), + ("Riyal", "riyal|riyals|rial|﷼"), + ("Dirham", "dirham|dirhem|dirhm"), + ("Halala", "halalas|halala"), + ("Samoan tālā", "samoan tālā|tālā|tala|ws$|samoa|wst|samoan tala"), + ("Sene", "sene"), + ("São Tomé and Príncipe dobra", "são tomé and príncipe dobra|dobras|dobra"), + ("Sierra Leonean leone", "sierra leonean leone|sll|leone|le"), + ("Peseta", "pesetas|peseta"), + ( + "Netherlands guilder", + "florin|netherlands antillean guilder|ang|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl", + ), + ("Swazi lilangeni", "swazi lilangeni|lilangeni|szl|emalangeni"), + ("Tajikistani somoni", "tajikistani somoni|tjs|somoni"), + ("Diram", "dirams|diram"), + ("Thai baht", "thai baht|฿|thb|baht"), + ("Satang", "satang|satangs"), + ("Tongan paʻanga", "tongan paʻanga|paʻanga|tongan pa'anga|pa'anga"), + ("Seniti", "seniti"), + ("Ukrainian hryvnia", "ukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias"), + ("Vanuatu vatu", "vanuatu vatu|vatu|vuv"), + ( + "Venezuelan bolívar", + "venezuelan bolívar|venezuelan bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivarsvenezuelan bolivar|venezuelan bolivars", + ), + ("Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"), + ("Zambian kwacha", "zambian kwacha|zk|zmw|zambia kwacha|kwachas|zambian kwachas"), + ("Moroccan dirham", "moroccan dirham|mad|د.م."), + ("United Arab Emirates dirham", "united arab emirates dirham|د.إ|aed"), + ("Azerbaijani manat", "azerbaijani manat|azn"), + ("Turkmenistan manat", "turkmenistan manat|turkmenistan new manat|tmt"), + ("Manat", "manats|manat"), + ("Qəpik", "qəpik"), + ( + "Somali shilling", + "somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos", + ), + ("Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"), + ( + "Tanzanian shilling", + "tanzanian shilling|tanzanian shillings|tsh|tzs|tanzania shilling|tanzania shillings", + ), + ("Ugandan shilling", "ugandan shilling|ugandan shillings|ugx|uganda shilling|uganda shillings"), + ("Romanian leu", "romanian leu|lei|ron|romania leu"), + ("Moldovan leu", "moldovan leu|mdl|moldova leu"), + ("Leu", "leu"), + ("Ban", "bani|-ban|ban"), + ("Nepalese rupee", "nepalese rupees|nepalese rupee|npr"), + ("Pakistani rupee", "pakistani rupees|pakistani rupee|pkr"), + ("Indian rupee", "indian rupees|indian rupee|inr|₹|india rupees|india rupee"), + ("Seychellois rupee", "seychellois rupees|seychellois rupee|scr|sr|sre"), + ("Mauritian rupee", "mauritian rupees|mauritian rupee|mur"), + ("Maldivian rufiyaa", "maldivian rufiyaas|maldivian rufiyaa|mvr|.ރ|maldive rufiyaas|maldive rufiyaa"), + ("Sri Lankan rupee", "sri lankan rupees|sri lankan rupee|lkr|රු|ரூ"), + ("Indonesian rupiah", "indonesian rupiah|rupiah|perak|rp|idr"), + ("Rupee", "rupee|rupees|rs"), + ("Danish krone", "danish krone|dkk|denmark krone|denmark krones|danish krones"), + ("Norwegian krone", "norwegian krone|nok|norway krone|norway krones|norwegian krones"), + ("Faroese króna", "faroese króna|faroese krona"), + ("Icelandic króna", "icelandic króna|isk|icelandic krona|iceland króna|iceland krona"), + ("Swedish krona", "swedish krona|sek|swedan krona"), + ("Krone", "kronor|krona|króna|krone|krones|kr|-kr"), + ("Øre", "Øre|oyra|eyrir"), + ( + "West African CFA franc", + "west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc", + ), + ( + "Central African CFA franc", + "central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc", + ), + ("Comorian franc", "comorian franc|kmf"), + ("Congolese franc", "congolese franc|cdf"), + ("Burundian franc", "burundian franc|bif"), + ("Djiboutian franc", "djiboutian franc|djf"), + ("CFP franc", "cfp franc|xpf"), + ("Guinean franc", "guinean franc|gnf"), + ("Swiss franc", "swiss francs|swiss franc|chf|sfr."), + ("Rwandan franc", "Rwandan franc|rwf|rf|r₣|frw"), + ("Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"), + ("Rappen", "rappen|-rappen"), + ("Franc", "francs|franc|fr.|fs"), + ("Centime", "centimes|centime|santim"), + ("Russian ruble", "russian ruble|₽|rub|russia ruble|russia ₽|russian ₽|russian rubles|russia rubles"), + ( + "New Belarusian ruble", + "new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles", + ), + ( + "Old Belarusian ruble", + "old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles", + ), + ("Transnistrian ruble", "transnistrian ruble|prb|р."), + ("Belarusian ruble", "belarusian ruble|belarus ruble|belarus rubles|belarusian rubles"), + ("Kopek", "kopek|kopeks"), + ("Kapyeyka", "kapyeyka"), + ("Ruble", "rubles|ruble|br"), + ("Algerian dinar", "algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"), + ("Bahraini dinar", "bahraini dinars|bahraini dinar|bhd|.د.ب"), + ("Santeem", "santeem|santeems"), + ("Iraqi dinar", "iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"), + ("Jordanian dinar", "jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"), + ("Kuwaiti dinar", "kuwaiti dinars|kuwaiti dinar|kwd|د.ك"), + ("Libyan dinar", "libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"), + ("Serbian dinar", "serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"), + ("Tunisian dinar", "tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"), + ("Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"), + ("Dinar", "dinars|dinar|denar|-dinars|-dinar"), + ("Fils", "fils|fulūs|-fils|-fil"), + ("Para", "para|napa"), + ("Millime", "millimes|millime"), + ("Argentine peso", "argentine peso|ars|argetina peso|argetina pesos|argentine pesos"), + ("Chilean peso", "chilean pesos|chilean peso|clp|chile peso|chile peso"), + ("Colombian peso", "colombian pesos|colombian peso|cop|colombia peso|colombia pesos"), + ( + "Cuban convertible peso", + "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso", + ), + ("Cuban peso", "cuban pesos|cuban peso|cup|cuba pesos|cuba peso"), + ("Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"), + ("Mexican peso", "mexican pesos|mexican peso|mxn|mexico pesos|mexico peso|mxn$|mxn $|mex$"), + ("Philippine peso", "piso|philippine pesos|philippine peso|₱|php"), + ("Uruguayan peso", "uruguayan pesos|uruguayan peso|uyu"), + ("Peso", "pesos|peso"), + ("Centavo", "centavos|centavo"), + ("Alderney pound", "alderney pounds|alderney pound|alderney £"), + ( + "British pound", + "british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots", + ), + ("Guernsey pound", "guernsey pounds|guernsey £|ggp"), + ("Ascension pound", "ascension pounds|ascension pound|ascension £"), + ("Saint Helena pound", "saint helena pounds|saint helena pound|saint helena £|shp"), + ("Egyptian pound", "egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"), + ( + "Falkland Islands pound", + "falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £", + ), + ("Gibraltar pound", "gibraltar pounds|gibraltar pound|gibraltar £|gip"), + ("Manx pound", "manx pounds|manx pound|manx £|imp"), + ("Jersey pound", "jersey pounds|jersey pound|jersey £|jep"), + ( + "Lebanese pound", + "lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل", + ), + ( + "South Georgia and the South Sandwich Islands pound", + "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £", + ), + ( + "South Sudanese pound", + "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £", + ), + ("Sudanese pound", "sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"), + ("Syrian pound", "syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"), + ("Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"), + ("Pound", "pounds|pound|-pounds|-pound|£"), + ("Pence", "pence|p"), + ("Shilling", "shillings|shilling|shilingi|sh"), + ("Penny", "pennies|penny"), + ( + "United States dollar", + "united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars|usd$", + ), + ("East Caribbean dollar", "east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"), + ( + "Australian dollar", + "australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$", + ), + ( + "Bahamian dollar", + "bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$", + ), + ("Barbadian dollar", "barbadian dollars|barbadian dollar|barbadian $|bbd"), + ("Belize dollar", "belize dollars|belize dollar|belize $|bzd"), + ( + "Bermudian dollar", + "bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $", + ), + ( + "British Virgin Islands dollar", + "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $", + ), + ("Brunei dollar", "brunei dollar|brunei $|bnd"), + ("Sen", "sen"), + ("Singapore dollar", "singapore dollars|singapore dollar|singapore $|s$|sgd"), + ( + "Canadian dollar", + "canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $", + ), + ( + "Cayman Islands dollar", + "cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $", + ), + ("New Zealand dollar", "new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"), + ( + "Cook Islands dollar", + "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $", + ), + ("Fijian dollar", "fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"), + ("Guyanese dollar", "guyanese dollars|guyanese dollar|gyd|gy$"), + ( + "Hong Kong dollar", + "hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$", + ), + ( + "Jamaican dollar", + "jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd", + ), + ("Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $"), + ( + "Liberian dollar", + "liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd", + ), + ("Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"), + ( + "Namibian dollar", + "namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $", + ), + ("Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"), + ("Niue dollar", "niue dollars|niue dollar|niue $"), + ("Palauan dollar", "palauan dollars|palauan dollar|palauan $"), + ( + "Pitcairn Islands dollar", + "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $", + ), + ( + "Solomon Islands dollar", + "solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $", + ), + ("Surinamese dollar", "surinamese dollars|surinamese dollar|surinamese $|srd"), + ("New Taiwan dollar", "new taiwan dollars|new taiwan dollar|nt$|twd|ntd"), + ( + "Trinidad and Tobago dollar", + "trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd", + ), + ("Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"), + ("Dollar", "dollars|dollar|$"), + ("Chinese yuan", "yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"), + ("Fen", "fen"), + ("Jiao", "jiao|mao"), + ("Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka"), + ("Penni", "penniä|penni"), + ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), + ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), + ("Satoshi", "satoshi|satoshis"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afghan afghani", "AFN"), + ("Euro", "EUR"), + ("Albanian lek", "ALL"), + ("Angolan kwanza", "AOA"), + ("Armenian dram", "AMD"), + ("Aruban florin", "AWG"), + ("Bangladeshi taka", "BDT"), + ("Bhutanese ngultrum", "BTN"), + ("Bolivian boliviano", "BOB"), + ("Bosnia and Herzegovina convertible mark", "BAM"), + ("Botswana pula", "BWP"), + ("Brazilian real", "BRL"), + ("Bulgarian lev", "BGN"), + ("Cambodian riel", "KHR"), + ("Cape Verdean escudo", "CVE"), + ("Costa Rican colón", "CRC"), + ("Croatian kuna", "HRK"), + ("Czech koruna", "CZK"), + ("Eritrean nakfa", "ERN"), + ("Ethiopian birr", "ETB"), + ("Gambian dalasi", "GMD"), + ("Georgian lari", "GEL"), + ("Ghanaian cedi", "GHS"), + ("Guatemalan quetzal", "GTQ"), + ("Haitian gourde", "HTG"), + ("Honduran lempira", "HNL"), + ("Hungarian forint", "HUF"), + ("Iranian rial", "IRR"), + ("Yemeni rial", "YER"), + ("Israeli new shekel", "ILS"), + ("Japanese yen", "JPY"), + ("Kazakhstani tenge", "KZT"), + ("Kenyan shilling", "KES"), + ("North Korean won", "KPW"), + ("South Korean won", "KRW"), + ("Kyrgyzstani som", "KGS"), + ("Lao kip", "LAK"), + ("Lesotho loti", "LSL"), + ("South African rand", "ZAR"), + ("Macanese pataca", "MOP"), + ("Macedonian denar", "MKD"), + ("Malagasy ariary", "MGA"), + ("Malawian kwacha", "MWK"), + ("Malaysian ringgit", "MYR"), + ("Mauritanian ouguiya", "MRO"), + ("Mongolian tögrög", "MNT"), + ("Mozambican metical", "MZN"), + ("Burmese kyat", "MMK"), + ("Nicaraguan córdoba", "NIO"), + ("Nigerian naira", "NGN"), + ("Turkish lira", "TRY"), + ("Omani rial", "OMR"), + ("Panamanian balboa", "PAB"), + ("Papua New Guinean kina", "PGK"), + ("Paraguayan guaraní", "PYG"), + ("Peruvian sol", "PEN"), + ("Polish złoty", "PLN"), + ("Qatari riyal", "QAR"), + ("Saudi riyal", "SAR"), + ("Samoan tālā", "WST"), + ("São Tomé and Príncipe dobra", "STN"), + ("Sierra Leonean leone", "SLL"), + ("Swazi lilangeni", "SZL"), + ("Tajikistani somoni", "TJS"), + ("Thai baht", "THB"), + ("Ukrainian hryvnia", "UAH"), + ("Vanuatu vatu", "VUV"), + ("Venezuelan bolívar", "VEF"), + ("Zambian kwacha", "ZMW"), + ("Moroccan dirham", "MAD"), + ("United Arab Emirates dirham", "AED"), + ("Azerbaijani manat", "AZN"), + ("Turkmenistan manat", "TMT"), + ("Somali shilling", "SOS"), + ("Tanzanian shilling", "TZS"), + ("Ugandan shilling", "UGX"), + ("Romanian leu", "RON"), + ("Moldovan leu", "MDL"), + ("Nepalese rupee", "NPR"), + ("Pakistani rupee", "PKR"), + ("Indian rupee", "INR"), + ("Seychellois rupee", "SCR"), + ("Mauritian rupee", "MUR"), + ("Maldivian rufiyaa", "MVR"), + ("Sri Lankan rupee", "LKR"), + ("Indonesian rupiah", "IDR"), + ("Danish krone", "DKK"), + ("Norwegian krone", "NOK"), + ("Icelandic króna", "ISK"), + ("Swedish krona", "SEK"), + ("West African CFA franc", "XOF"), + ("Central African CFA franc", "XAF"), + ("Comorian franc", "KMF"), + ("Congolese franc", "CDF"), + ("Burundian franc", "BIF"), + ("Djiboutian franc", "DJF"), + ("CFP franc", "XPF"), + ("Guinean franc", "GNF"), + ("Swiss franc", "CHF"), + ("Rwandan franc", "RWF"), + ("Russian ruble", "RUB"), + ("Transnistrian ruble", "PRB"), + ("New Belarusian ruble", "BYN"), + ("Algerian dinar", "DZD"), + ("Bahraini dinar", "BHD"), + ("Iraqi dinar", "IQD"), + ("Jordanian dinar", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Libyan dinar", "LYD"), + ("Serbian dinar", "RSD"), + ("Tunisian dinar", "TND"), + ("Argentine peso", "ARS"), + ("Chilean peso", "CLP"), + ("Colombian peso", "COP"), + ("Cuban convertible peso", "CUC"), + ("Cuban peso", "CUP"), + ("Dominican peso", "DOP"), + ("Mexican peso", "MXN"), + ("Uruguayan peso", "UYU"), + ("British pound", "GBP"), + ("Saint Helena pound", "SHP"), + ("Egyptian pound", "EGP"), + ("Falkland Islands pound", "FKP"), + ("Gibraltar pound", "GIP"), + ("Manx pound", "IMP"), + ("Jersey pound", "JEP"), + ("Lebanese pound", "LBP"), + ("South Sudanese pound", "SSP"), + ("Sudanese pound", "SDG"), + ("Syrian pound", "SYP"), + ("United States dollar", "USD"), + ("Australian dollar", "AUD"), + ("Bahamian dollar", "BSD"), + ("Barbadian dollar", "BBD"), + ("Belize dollar", "BZD"), + ("Bermudian dollar", "BMD"), + ("Brunei dollar", "BND"), + ("Singapore dollar", "SGD"), + ("Canadian dollar", "CAD"), + ("Cayman Islands dollar", "KYD"), + ("New Zealand dollar", "NZD"), + ("Fijian dollar", "FJD"), + ("Guyanese dollar", "GYD"), + ("Hong Kong dollar", "HKD"), + ("Jamaican dollar", "JMD"), + ("Liberian dollar", "LRD"), + ("Namibian dollar", "NAD"), + ("Solomon Islands dollar", "SBD"), + ("Surinamese dollar", "SRD"), + ("New Taiwan dollar", "TWD"), + ("Trinidad and Tobago dollar", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Chinese yuan", "CNY"), + ("Rial", "__RI"), + ("Shiling", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dollar", "__D"), + ("Manat", "__MA"), + ("Rupee", "__R"), + ("Krone", "__K"), + ("Krona", "__K"), + ("Crown", "__K"), + ("Frank", "__F"), + ("Mark", "__M"), + ("Ruble", "__RB"), + ("Peso", "__PE"), + ("Pound", "__P"), + ("Tristan da Cunha pound", "_TP"), + ("South Georgia and the South Sandwich Islands pound", "_SP"), + ("Somaliland shilling", "_SS"), + ("Pitcairn Islands dollar", "_PND"), + ("Palauan dollar", "_PD"), + ("Niue dollar", "_NID"), + ("Nauruan dollar", "_ND"), + ("Micronesian dollar", "_MD"), + ("Kiribati dollar", "_KID"), + ("Guernsey pound", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dollar", "_CKD"), + ("British Virgin Islands dollar", "_BD"), + ("Ascension pound", "_AP"), + ("Alderney pound", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarkë", "QINDARKE"), + ("Penny", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENTAVO"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENTIMO"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '(?and)' + MultiplierRegex = '\\s*\\b(thousand|million|billion|trillion)s?\\b' + CurrencyPrefixList = dict( + [ + ("Dobra", "db|std"), + ("Dollar", "$"), + ("Brazilian Real", "R$"), + ("United States dollar", "united states $|us$|us $|u.s. $|u.s $|usd$|usd"), + ("East Caribbean dollar", "east caribbean $|xcd"), + ("Mexican peso", "mxn$|mxn $|mex$|mxn"), + ("Australian dollar", "australian $|australia $|aud|aud$"), + ("Bahamian dollar", "bahamian $|bahamia $|bsd"), + ("Barbadian dollar", "barbadian $|barbadin $|bbd"), + ("Belize dollar", "belize $|bzd"), + ("Bermudian dollar", "bermudian $|bmd"), + ( + "British Virgin Islands dollar", + "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $", + ), + ("Brunei dollar", "brunei $|b$|bnd"), + ("Sen", "sen"), + ("Singapore dollar", "singapore $|s$|sgd"), + ("Canadian dollar", "canadian $|can$|c$|c $|canada $|cad|cad$"), + ("Cayman Islands dollar", "cayman islands $|ci$|cayman island $|kyd"), + ("New Zealand dollar", "new zealand $|nz$|nz $|nzd|nzd$"), + ("Cook Islands dollar", "cook islands $|cook island $"), + ("Fijian dollar", "fijian $|fiji $|fjd"), + ("Guyanese dollar", "gy$|gy $|g$|g $|gyd"), + ("Hong Kong dollar", "hong kong $|hk$|hkd|hk $|hkd"), + ("Indian rupee", "₹|inr"), + ("Jamaican dollar", "jamaican $|j$|jamaica $|jmd"), + ("Kiribati dollar", "kiribati $"), + ("Liberian dollar", "liberian $|liberia $|lrd"), + ("Micronesian dollar", "micronesian $"), + ("Namibian dollar", "namibian $|nad|n$|namibia $|nad"), + ("Nauruan dollar", "nauruan $"), + ("Niue dollar", "niue $"), + ("Palauan dollar", "palauan $"), + ("Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"), + ("Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $|sbd"), + ("Surinamese dollar", "surinamese $|surinam $|srd"), + ("New Taiwan dollar", "nt$|nt $|ntd|twd"), + ("Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $|ttd"), + ("Tuvaluan dollar", "tuvaluan $"), + ("Samoan tālā", "ws$|wst"), + ("Chinese yuan", "¥|cny|rmb"), + ("Japanese yen", "¥|jpy"), + ("Euro", "€|eur"), + ("Pound", "£|gbp"), + ("Costa Rican colón", "₡|crc"), + ("Turkish lira", "₺|try"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) + AmbiguousCurrencyUnitList = [ + r'din.', + r'kiwi', + r'kina', + r'kobo', + r'lari', + r'lipa', + r'napa', + r'para', + r'sfr.', + r'taka', + r'tala', + r'toea', + r'vatu', + r'yuan', + r'all', + r'ang', + r'ban', + r'bob', + r'btn', + r'byr', + r'cad', + r'cop', + r'cup', + r'dop', + r'gip', + r'jod', + r'kgs', + r'lak', + r'lei', + r'mga', + r'mop', + r'nad', + r'omr', + r'pul', + r'sar', + r'sbd', + r'scr', + r'sdg', + r'sek', + r'sen', + r'sol', + r'sos', + r'std', + r'try', + r'yer', + r'yen', + r'db', + r'pen', + r'ron', + r'mad', + r'zar', + r'gel', + r'satoshi', + r'satoshis', + ] + BuildPrefix = '(?<=(\\s|^))' + BuildSuffix = '(?=(\\s|\\W|$))' + AmbiguityFiltersDict = dict( + [ + ("\\bm\\b", "((('|’)\\s*m)|(m\\s*('|’)))"), + ("^\\d{5} [cf]$", "\\b([a-z]{2} \\d{5} [cf])\\b"), + ( + "\\b\\d+\\s*\\p{L}+$", + "((\\d+(\\s*\\p{L}+[-—–-]|\\p{L}+)\\d+)|(((\\p{L}|\\d)[-—–-]\\d+\\s*|\\p{L}\\d+)\\p{L}+))", + ), + ( + "^(all|bob|pen|cad|cup|cop|sos|ron|mad|mop|zar|gel)", + "(all|bob|pen|cad|cup|cop|sos|ron|mad|mop|zar|gel)\\s*(\\d|\\p{L})", + ), + ("\\d\\s*pm\\b", "\\b(at|until|since|before|after)\\s\\d(\\d)?\\s*pm\\b"), + ( + "\\bin\\b", + "\\bin\\s*(\\d{4}|(jan|febr)uary|march|april|may|ju(ne|ly)|august|october|(sept|nov|dec)ember)", + ), + ("\\b(13)?f\\b", "(\\bf-series\\b|\\b13f\\s(filings?|be fill?ed))"), + ("\\d\\d\\df", "boeing\\s777f"), + ("\\bc\\b", "\\bc\\.p\\.i(\\.)?"), + ( + "\\d\\s*c\\b", + "(dividend (of|by) (\\d\\.)?\\d(\\d)?\\s*c|(\\d\\.)?\\d(\\d)?\\s*c/? (a share|per security))", + ), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/french_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/french_numeric_with_unit.py index 8a96e22fc6..13259f37c9 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/french_numeric_with_unit.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/french_numeric_with_unit.py @@ -9,620 +9,659 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_numbers import BaseNumbers + # pylint: disable=line-too-long class FrenchNumericWithUnit: - AgeSuffixList = dict([("Ans", "ans"), - ("Mois", "mois d'âge|mois d'age|mois"), - ("Semaines", "semaine|semaines|semaines d'âge|semaines d'age"), - ("Jour", "jours|jour")]) - AreaSuffixList = dict([("Kilomètre carré", "km2|km^2|km²|kilomètres carrés|kilomètre carré"), - ("Hectomètre carré", "hm2|hm^2|hm²|hectomètre carré|hectomètres carrés"), - ("Décamètre carré", "dam2|dam^2|dam²|décamètre carré|décamètres carrés"), - ("Mètre carré", "m2|m^2|m²|mètre carré|mètres carrés"), - ("Décimètre carré", "dm2|dm^2|dm²|décimètre carré|décimètres carrés"), - ("Centimètre carré", "cm2|cm^2|cm²|centimètre carré|centimètres carrés"), - ("Millimètre carré", "mm2|mm^2|mm²|millimètre carré|millimètres carrés"), - ("Pouce carré", "pouces2|po2|pouce carré|pouces carrés|in^2|in²|in2"), - ("Pied carré", "pied carré|pieds carrés|pi2|pi^2|pi²"), - ("Mile carré", "mile carré|miles carrés|mi2|mi^2|mi²"), - ("Acre", "acre|acres")]) - CurrencySuffixList = dict([("Abkhazie apsar", "abkhazie apsar|apsars"), - ("Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"), - ("Pul", "pul"), - ("Euro", "euros|euro|€|eur|d'euros"), - ("Cent", "cents|cent|-cents|-cent"), - ("lek Albanais", "lek albanais|leks|lek"), - ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), - ("Kwanza angolais", "kwanza angolais|kz|aoa|kwanza|kwanzas"), - ("Dram arménien", "dram arménien|drams arméniens"), - ("Florins d'Aruba", "florins aruba|ƒ|awg"), - ("Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"), - ("Paisa", "poisha|paisa"), - ("Ngultrum bhoutanais", "ngultrum bhoutanais|nu.|btn"), - ("Chetrum", "chetrums|chetrum"), - ("Boliviano bolivien", "boliviano bolivien|bolivianos bolivien|bolivianos bolivie|boliviano bolivie|bob|bs."), - ("Bosnie-Herzégovine mark convertible", "bosnie-herzégovine mark convertible|bosnie-et-herzégovine mark convertible|bam"), - ("Fening", "fening|fenings"), - ("Pula", "pula|bwp"), - ("Thebe", "thebe"), - ("Réal brésilien", "réal brésilien|réals brésilien|r$|brl|real bresil|reals bresilien"), - ("Lev bulgare", "lev bulgare|levs bulgare|lv|bgn"), - ("Stotinki búlgaro", "stotinki bulgare"), - ("Riel cambodgien", "riel cambodgien|khr|៛"), - ("Escudo du cap-vert", "escudo cap-verdien|cve"), - ("Colon du costa rica", "colon du costa rica|colons du costa rica|crc|₡"), - ("Colon du salvador", "colon du salvador|colons du salvador|svc"), - ("Kuna croate", "kuna croate|kunas croate|kn|hrk"), - ("Lipa", "lipa"), - ("Couronne tchèque", "couronne tchèque|couronnes tchèque|czk|Kč"), - ("Haléř", "haléř"), - ("Nakfas érythréens", "nakfas érythréens|nfk|ern|nakfa érythréens"), - ("Birr éthiopien", "birr éthiopien|birrs éthiopien|etb"), - ("Dalasi gambienne", "gmd"), - ("Butut", "bututs|butut"), - ("Lari géorgien", "lari géorgie|lari géorgiens|gel|₾"), - ("Tetri géorgien", "tetri géorgie|tetris géorgiens"), - ("Cedi", "cedi|ghs|cedi ghanéen|gh₵"), - ("Pesewa", "pesewa|pesewas"), - ("Quetzal guatémaltèque", "quetzal guatémaltèque|gtq|quetzal|quetzales"), - ("Gourdes haïtiennes", "gourdes haïtiennes|gourdes|htg|gourde haïtienne"), - ("Lempira hondurien", "lempira hondurien|hnl"), - ("Forint hongrois", "forint hongrois|huf|fg|forints hongrois"), - ("Fillér", "fillér"), - ("Rial iranien", "rial iranien|irr|rials iranien|rials iraniens"), - ("Litas lituanien", "litas lituanien|ltl|lit lithuanien|litas lithuanie"), - ("Yen Japonais", "yen japonais|yen japon|yens|jpy|yen|¥|-yen"), - ("Tenge kazakh", "tenge kazakh|kzt"), - ("Shilling kényan", "shilling kényan|kes|shillings kényans"), - ("Won coréen", "won coréen|won coréens|₩"), - ("Won sud-coréen", "won sud-coréen|won sud coréen|won sud-coréens|krw"), - ("Corée du nord won", "corée du nord won|corée nord won|kpw"), - ("Som Kirghizie", "som kirghizie|kgs"), - ("Sum Ouzbékistan", "sum ouzbékistan|sum ouzbeks|sum ouzbéks|uzs"), - ("Kip laotien", "kip laotien|lak|₭n|₭"), - ("Att", "att"), - ("Loti", "loti|maloti|lsl"), - ("Sente", "sente|lisente"), - ("Rand sud-africain", "rand sud-africain|zar"), - ("Pataca macanais", "pataca macanais|mop$|mop"), - ("Avo", "avos|avo"), - ("Dinar macédonien", "dinar macédonien|mkd|ден"), - ("Deni", "deni"), - ("Ariary malagache", "ariary malagache|mga"), - ("Iraimbilanja", "Iraimbilanja"), - ("Kwacha malawien", "kwacha malawien|mk|mwk"), - ("Tambala", "Tambala"), - ("Ringitt malaisien", "ringitt malaisien|rm|myr|ringitts malaisien"), - ("Ouguiya mauritanienne", "ouguiya|um|mro|ouguiya mauritanien|ouguiya mauritanienne"), - ("Khoums", "khoums"), - ("Togrogs mongoles", "togrogs mongoles|togrogs|tugriks|tögrög|mnt|₮|tögrög mongoles|tögrög mongolie|togrogs mongolie"), - ("Metical mozambique", "metical du mozambique|metical mozambique|mt|mzn|meticals mozambique"), - ("Kyat birmanie", "kyat birmanie|ks|mmk"), - ("Pya", "pya"), - ("Cordoba nicaraguayen", "cordoba nicaraguayen|córdoba nicaraguayen|nio|córdoba oro|cordoba oro nicaraguayen"), - ("Naira nigérians", "naira nigérians|naira|ngm|₦|nairas nigérians"), - ("Livre turque", "livre turque|try|tl|livre turques"), - ("Kuruş", "kuruş"), - ("Rials omanais", "rials omanais|omr|ر.ع.|rial omanais"), - ("Balboa panaméennes", "balboa panaméennes|balboa|pab"), - ("Kina", "kina|pkg|pgk"), - ("Toea", "toea"), - ("Guaraní paraguayen", "guaraní paraguayen|₲|pyg"), - ("Sol péruvien", "nuevo sol péruvien|soles|sol|sol péruvien"), - ("Złoty polonais", "złoty polonais|złoty|zł|pln|zloty|zloty polonais"), - ("Groxz", "groszy|grosz|grosze"), - ("Riyal qatari", "riyal qatari|qar|riyals qatari"), - ("Riyal saudi", "riyal saudi|sar|riyals saudi"), - ("Riyal", "riyal|riyals|rial|﷼"), - ("Dirham", "dirham|dirhem|dirhm"), - ("Halala", "halalas|halala"), - ("Tala", "tala|tālā|ws$|sat|wst"), - ("Sene", "sene"), - ("Dobra", "dobra|db|std"), - ("Leone", "leone|sll"), - ("Florins Néerlandais", "florins hollandais|florins néerlandais|florins|ang|florin|fl"), - ("Lilangeni", "lilangeni|szl"), - ("Somoni tadjikistan", "somoni tadjikistan|tjs|somoni"), - ("Diram", "dirams|diram"), - ("Baht thaïlandais", "baht thaïlandais|baht thailandais|baht thaï|baht thai|baht|฿|thb"), - ("Satang", "satang|satangs"), - ("Paʻanga", "paʻanga|pa'anga|top"), - ("Hryvnia ukrainien", "hryvnia ukrainien|hyrvnia|uah|₴|hryvnias ukrainien|hryvnia ukrainienne"), - ("Vanuatu vatu", "vanuatu vatu|vatu|vuv"), - ("Bolívar vénézuélien", "bolívar vénézuélien|bolivar venezuelien|bs.f.|vef|bolívars vénézuélien|bolivars venezuelien"), - ("Dong vietnamien", "dong vietnamien|dongs vietnamiens|dong|đồng|vnd|dông|dông vietnamiens"), - ("Kwacha de Zambie", "kwacha de zambie|zk|zmw|kwachas"), - ("Dirham marocain", "dirham marocain|mad|د.م."), - ("Dirham des Émirats arabes unis", "dirham des Émirats arabes unis|د.إ|aed"), - ("Manat azerbaïdjanais", "manat azerbaïdjanais|manat azerbaidjanais|azn"), - ("Manat turkmène", "manat turkmène|tmt|manat turkmene"), - ("Manat", "manats|manat"), - ("Qəpik", "qəpik"), - ("Shilling somalien", "shilling somalien|shillings somalien|sos"), - ("Shilling tanzanien", "shilling tanzanien|shillings tanzanien|tzs|tsh|shilling tanzanienne|shillings tanzanienne"), - ("Shilling ougandais", "shilling ougandais|shillings ougandais|ugx"), - ("Leu roumain", "leu roumain|lei|leu roumaine|ron"), - ("Leu moldave", "leu meoldave|mdl"), - ("Leu", "leu"), - ("Ban", "bani|-ban|ban"), - ("Roupie népalaise", "roupie népalaise|roupie nepalaise|npr"), - ("Roupie pakistanaise", "roupie pakistanaise|pkr"), - ("Roupie indienne", "roupie indienne|roupies indiennes|inr|roupie indien|inr|₹"), - ("Roupie seychelloise", "roupie seychelloise|scr|sr|sre"), - ("Roupie mauricienne", "roupie mauricienne|mur"), - ("Rufiyaa maldives", "rufiyaa maldives|mvr|.ރ|rf"), - ("Roupie srilankaise", "roupie srilankaise|lrk|රු|ரூ"), - ("Rupiah Indonésie", "rupia indonésie|rupia indonesie|rupiah|rp|idr"), - ("Roupie", "roupie|roupies"), - ("Couronne danoise", "couronne danoise|dkk|couronnes danoise|couronne danemark|couronnes danemark"), - ("Couronne norvégienne", "couronne norvégienne|couronne norvegienne|couronnes norvégienne|couronnes norvegienne|nok"), - ("Couronne féroïenne", "couronne féroïenne|couronne feroienne"), - ("Couronne suédoise", "couronne suédoise|couronne suéde|sek|couronnes suédoise|couronne suedoise"), - ("Couronne", "couronne|couronnes"), - ("Øre", "Øre|oyra|eyrir"), - ("Franc CFA de l'Afrique de l'Ouest", "franc cfa de l''afrique de l''ouest|franc cfa ouest africain|franc cfa|francs cfa|fcfa|frs cfa|cfa francs|xof"), - ("Franc CFA d'Afrique centrale", "franc cfa d''afrique centrale|franc cfa centrale|frs cfa centrale|xaf"), - ("Franc comorien", "franc comorien|kmf"), - ("Franc congolais", "franc congolais|cdf"), - ("Franc burundais", "franc burundais|bif"), - ("Franc djiboutienne", "franc djiboutienne|djf"), - ("Franc CFP", "franc cfp|xpf"), - ("Franc guinéen", "franc guinéen|gnf"), - ("Franc Suisse", "franc suisse|chf|sfr.|francs suisses"), - ("Franc rwandais", "franc rwandais|rwf|rw|r₣|frw"), - ("Franc belge", "franc belge|bi.|b.fr.|bef"), - ("Rappen", "rappen|-rappen"), - ("Franc", "francs|franc|fr.|fs"), - ("Centimes", "centimes|centime|santim"), - ("Rouble russe", "rouble russe|rub|₽|₽ russe|roubles russe|roubles russes|₽ russes"), - ("Nouveau rouble biélorusse", "nouveau rouble biélorusse|byn|nouveau roubles biélorusse|nouveau rouble bielorusse|nouveau roubles biélorusse"), - ("Rouble transnistriens", "rouble transnistriens|prb"), - ("Rouble biélorusses", "rouble biélorusses|roubles biélorusses|rouble bielorusses|roubles bielorusses"), - ("Kopek", "kopek|kopeks"), - ("Kapyeyka", "kapyeyka"), - ("Rouble", "roubles|rouble|br"), - ("Dinar algérien", "dinar algérien|د.ج|dzd|dinars algérien|dinar algerien|dinars algerien"), - ("Dinar de bahreïn", "dinar de bahreïn|bhd|.د.ب|dinar de bahrein"), - ("Santeem", "santeem|santeems"), - ("Dinar iraquien", "dinar iraquien|dinars iraquien|iqd|ع.د|dinar iraquienne|dinars iraquienne"), - ("Dinar jordanien", "dinar jordanien|dinars jordanien|د.ا|jod"), - ("Dinar koweïtien", "dinar koweïtien|dinar koweitien|dinars koweïtien|kwd|د.ك"), - ("Dinar libyen", "dinar libyen|dinars libyen|lyd"), - ("Dinar serbe", "dinar serbe|dinars serbe|rsd|дин."), - ("Dinar tunisien", "dinar tunisien|dinars tunisien|tnd"), - ("Dinar yougoslave", "dinar yougoslave|dinars yougoslave|yun"), - ("Dinar", "dinars|dinar|denar|-dinars|-dinar"), - ("Fils", "fils|fulūs|-fils|-fil"), - ("Para", "para|napa"), - ("Millime", "millimes|millime"), - ("Peso argentin", "peso argentin|ars|pesos argentin|peso argentine|pesos argentine"), - ("Peso chilien", "peso chilien|pesos chilien|clp"), - ("Peso colombien", "peso colombien|pesos colombien|cop|peso colombie|pesos colombien"), - ("Peso cubains convertibles", "peso cubains convertibles|pesos cubains convertibles|cuc"), - ("Peso cubains", "peso cubaines|pesos cubaines|peso cubaine|pesos cubaines|cup"), - ("Peso dominicain", "peso dominicain|pesos dominicain|dop|peso dominicaine|pesos dominicaine"), - ("Peso philippin", "peso philippin|pesos philippin|piso|₱|php"), - ("Peso uruguayen", "peso uruguayen|pesos uruguayen|uyu"), - ("Peso", "pesos|Peso"), - ("Centavo", "centavos|Centavo"), - ("Livre britannique", "livre britannique|livres britannique|gbp|£ britannique"), - ("Livre guernesey", "livre guernesey|£ guernesey|ggp"), - ("Livre ascension", "livre ascension|livres ascension|£ ascension"), - ("Livre sainte-hélène", "livre de sainte-hélène|livre sainte-hélène|livre sainte-helene|livre de sainte hélène|shp"), - ("Livre égyptienne", "livre égyptienne|livre egyptienne|egp|ج.م"), - ("Livre des îles falkland", "livre des îles falkland|livre des iles falkland|fkp|£ iles falkland"), - ("Livre gibraltar", "livre gibraltar|livre de gibraltar|£ gibraltar|gip"), - ("Livre manx", "imp|livre manx|£ manx"), - ("Livre jersey", "livre de jersey|livre jersey|jep|£ jersey"), - ("Livre libanaise", "livre libanaise|£ libanaise|livres libanaise|lbp|ل.ل"), - ("Livre des îles malouines", "livre des îles malouines|livre des iles malouines|£ iles malouines"), - ("Livre sud-soudanaise", "livre sud-soudanaise|livre sud soudanaise|livre du soudan du sud|livres sud-soudanaises|livre sud soudan|livre soudan sud"), - ("Livre soudanaise", "livre soudanaise|livres soudanaise|sdg|£ soudan|ج.س.|livre soudan|livres soudan"), - ("Livre syrienne", "livre syrienne|ل.س|syp|livre syrie|livres syrie|£ syrie"), - ("Livre", "livre|livres|-livre|-livres|£"), - ("Pence", "pence"), - ("Shilling", "shilling|shillings|sh"), - ("Penny", "penny|sou"), - ("Dollar États-Unis", "dollar américain|$ américain|$ americain|usd|$usd|$ usd|dollar americain|dollar États-Unis|dollar des États-Unis|dollar États Unis|dollar etats unis|dollar etats-unis|$ etats-unis|$ États-Unis"), - ("Dollar des Caraïbes orientales", "dollar des caraïbes orientales|dollar des caraibes orientales|xcd|$ caraibes orientales|$ caraïbes orientales"), - ("Dollar Australien", "dollar australien|dollars australiens|$ australien|aud|$australien|australien $|$ australie|dollar australie"), - ("Dollar des bahamas", "dollar des bahamas|dollar bahamas|$ bahamas|bsd|bahama $|dollar bahama|$ bahamas"), - ("Dollar des bermudes", "dollar des bermudes|dollar bermude|dollar bermudes|$ bermudes|bmd"), - ("Dollar de belize", "dollar de Belize|dollar belizien|bzd|$ belize"), - ("Dollar îles Vierges britanniques", "dollar îles vierges britanniques|dollar iles vierges britanniques|$ iles vierges britanniques"), - ("Dollar de brunei", "dollar de brunei|$ brunei|bnd|dollar brunei"), - ("Sen", "sen"), - ("Dollar de Singapour", "dollar de singapour|dollar singapour|$ sinapour|sgd|$s"), - ("Dollar Canadien", "dollar canadien|dollars canadien|$ canadien|cad|$can|$c|$ c|dollar canada|dollar canadienne|$ canada|$cad|cad$"), - ("Dollar des îles Caïmans", "dollars des îles caïmanes|dollar des îles caïmanes|dollars des iles caimanes|dollar iles caimanes|kyd|$ci"), - ("Dollar néo-zélandais", "dollar néo-zélandais|dollar néo zélandais|dollar neo-zelandais|dollar neo zelandais|$nz|$ néo-zélandais|$ neo zelandais"), - ("Dollar îles cook", "dollar îles cook|dollar iles cook|$ iles cook"), - ("Dollar des fidji", "dollar des fidji|$ fidji|dollar fidji|dollar de fidji|dollars des fidji|dollars de fidji"), - ("Dollar guyanien", "dollar guyanien|dollar du guyana|dollar dre guyana|$ guayana|gyd|$gy"), - ("Dollar de Hong Kong", "dollar hong kong|dollar hongkong|dollar de hong kong|dollar de hongkong|$hk|$ hk|hkd|hk $|hk$|dollar hk|$hongkong|dollars hongkong|dollars hong kong"), - ("Dollar jamaïcain", "dollar jamaïcain|dollars jamaïcain|dollar jamaicain|dollars jamaicain|$j|$ jamaïque|dollar jamaïque|jmd"), - ("Dollar libérien", "dollar libérien|dollars libérien|dollar liberien|dollars liberien|lrd|$ libérien|$ liberia|$ liberien"), - ("Dollar namibien", "dollar namibien|dollars namibien|$ namibien|nad|$n|dollar namibie|dollars namibie|$ namibie"), - ("Dollar des îles Salomon", "dollar des îles Salomon|dollar des iles salomon|$si|sbd|$ iles salomon|$ îles salomon"), - ("Dollar du suriname", "dollar du suriname|srd|$ du suriname|$ suriname|dollar suriname|dollars suriname|dollars du suriname"), - ("Nouveau dollar de Taïwan", "nouveau dollar de taïwan|nouveau dollar de taiwan|twd|ntd|$nt"), - ("Dollar trinidadien", "dollar trinidadien|dollars trinidadien|ttd|$ trinidadien"), - ("Dollar", "dollar|$|dollars"), - ("Yuan Chinois", "yuan|yuans|yuan chinois|renminbi|cny|rmb|¥"), - ("Fen", "fen"), - ("Jiao", "jiao"), - ("Mark Finlandais", "marks finlandais|mark finlandais|fim|mark"), - ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), - ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), - ("Satoshi", "satoshi|satoshis")]) - CurrencyNameToIsoCodeMap = dict([("Afghan afghani", "AFN"), - ("Euro", "EUR"), - ("Albanian lek", "ALL"), - ("Kwanza angolais", "AOA"), - ("Armenian dram", "AMD"), - ("Florins d'Aruba", "AWG"), - ("Bangladeshi taka", "BDT"), - ("Ngultrum bhoutanais", "BTN"), - ("Boliviano bolivien", "BOB"), - ("Bosnie-Herzégovine mark convertible", "BAM"), - ("Pula", "BWP"), - ("Réal brésilien", "BRL"), - ("Lev bulgare", "BGN"), - ("Riel cambodgien", "KHR"), - ("Escudo du cap-vert", "CVE"), - ("Colon du costa rica", "CRC"), - ("Kuna croate", "HRK"), - ("Couronne tchèque", "CZK"), - ("Nakfas érythréens", "ERN"), - ("Birr éthiopien", "ETB"), - ("Dalasi gambienne", "GMD"), - ("Lari géorgien", "GEL"), - ("Cedi", "GHS"), - ("Quetzal guatémaltèque", "GTQ"), - ("Gourdes haïtiennes", "HTG"), - ("Lempira hondurien", "HNL"), - ("Forint hongrois", "HUF"), - ("Rial iranien", "IRR"), - ("Yemeni rial", "YER"), - ("Israeli new shekel", "ILS"), - ("Yen Japonais", "JPY"), - ("Tenge kazakh", "KZT"), - ("Shilling kényan", "KES"), - ("Corée du nord won", "KPW"), - ("Won sud-coréen", "KRW"), - ("Som Kirghizie", "KGS"), - ("Kip laotien", "LAK"), - ("Loti", "LSL"), - ("Rand sud-africain", "ZAR"), - ("Pataca macanais", "MOP"), - ("Dinar macédonien", "MKD"), - ("Ariary malagache", "MGA"), - ("Kwacha malawien", "MWK"), - ("Ringitt malaisien", "MYR"), - ("Ouguiya mauritanienne", "MRO"), - ("Togrogs mongoles", "MNT"), - ("Metical mozambique", "MZN"), - ("Kyat birmanie", "MMK"), - ("Cordoba nicaraguayen", "NIO"), - ("Nigerian naira", "NGN"), - ("Livre turque", "TRY"), - ("Rials omanais", "OMR"), - ("Balboa panaméennes", "PAB"), - ("Kina", "PGK"), - ("Guaraní paraguayen", "PYG"), - ("Peruvian sol", "PEN"), - ("Złoty polonais", "PLN"), - ("Riyal qatari", "QAR"), - ("Riyal saudi", "SAR"), - ("Tala", "WST"), - ("São Tomé and Príncipe dobra", "STN"), - ("Leone", "SLL"), - ("Lilangeni", "SZL"), - ("Somoni tadjikistan", "TJS"), - ("Baht thaïlandais", "THB"), - ("Hryvnia ukrainien", "UAH"), - ("Vanuatu vatu", "VUV"), - ("Bolívar vénézuélien", "VEF"), - ("Kwacha de Zambie", "ZMW"), - ("Dirham marocain", "MAD"), - ("Dirham des Émirats arabes unis", "AED"), - ("Manat azerbaïdjanais", "AZN"), - ("Manat turkmène", "TMT"), - ("Shilling somalien", "SOS"), - ("Shilling tanzanien", "TZS"), - ("Shilling ougandais", "UGX"), - ("Leu roumain", "RON"), - ("Leu moldave", "MDL"), - ("Roupie népalaise", "NPR"), - ("Roupie pakistanaise", "PKR"), - ("Roupie indienne", "INR"), - ("Roupie seychelloise", "SCR"), - ("Roupie mauricienne", "MUR"), - ("Rufiyaa maldives", "MVR"), - ("Sri Lankan rupee", "LKR"), - ("Rupiah Indonésie", "IDR"), - ("Couronne danoise", "DKK"), - ("Couronne norvégienne", "NOK"), - ("Icelandic króna", "ISK"), - ("Couronne suédoise", "SEK"), - ("Franc CFA de l'Afrique de l'Ouest", "XOF"), - ("Franc CFA d'Afrique centrale", "XAF"), - ("Franc comorien", "KMF"), - ("Franc congolais", "CDF"), - ("Franc burundais", "BIF"), - ("Franc djiboutienne", "DJF"), - ("Franc CFP", "XPF"), - ("Franc guinéen", "GNF"), - ("Franc Suisse", "CHF"), - ("Franc rwandais", "RWF"), - ("Rouble russe", "RUB"), - ("Rouble transnistriens", "PRB"), - ("Nouveau rouble biélorusse", "BYN"), - ("Dinar algérien", "DZD"), - ("Dinar de bahreïn", "BHD"), - ("Dinar iraquien", "IQD"), - ("Dinar jordanien", "JOD"), - ("Dinar koweïtien", "KWD"), - ("Dinar libyen", "LYD"), - ("Dinar serbe", "RSD"), - ("Dinar tunisien", "TND"), - ("Peso argentin", "ARS"), - ("Peso chilien", "CLP"), - ("Peso colombien", "COP"), - ("Peso cubains convertibles", "CUC"), - ("Peso cubains", "CUP"), - ("Peso dominicain", "DOP"), - ("Mexican peso", "MXN"), - ("Peso uruguayen", "UYU"), - ("Livre britannique", "GBP"), - ("Livre sainte-hélène", "SHP"), - ("Livre égyptienne", "EGP"), - ("Livre des îles falkland", "FKP"), - ("Livre gibraltar", "GIP"), - ("Livre manx", "IMP"), - ("Livre jersey", "JEP"), - ("Livre libanaise", "LBP"), - ("South Sudanese pound", "SSP"), - ("Livre soudanaise", "SDG"), - ("Livre syrienne", "SYP"), - ("Dollar États-Unis", "USD"), - ("Dollar Australien", "AUD"), - ("Dollar des bahamas", "BSD"), - ("Dollar barbadien", "BBD"), - ("Dollar de belize", "BZD"), - ("Dollar des bermudes", "BMD"), - ("Dollar de brunei", "BND"), - ("Dollar de Singapour", "SGD"), - ("Dollar Canadien", "CAD"), - ("Dollar des îles Caïmans", "KYD"), - ("Dollar néo-zélandais", "NZD"), - ("Dollar de Fidji", "FJD"), - ("Dollar guyanien", "GYD"), - ("Dollar de Hong Kong", "HKD"), - ("Dollar jamaïcain", "JMD"), - ("Dollar libérien", "LRD"), - ("Dollar namibien", "NAD"), - ("Dollar des îles Salomon", "SBD"), - ("Dollar du suriname", "SRD"), - ("Nouveau dollar de Taïwan", "TWD"), - ("Dollar trinidadien", "TTD"), - ("Tuvaluan dollar", "TVD"), - ("Yuan Chinois", "CNY"), - ("Rial", "__RI"), - ("Shiling", "__S"), - ("Som", "__SO"), - ("Dirham", "__DR"), - ("Dinar", "_DN"), - ("Dollar", "__D"), - ("Manat", "__MA"), - ("Rupee", "__R"), - ("Krone", "__K"), - ("Krona", "__K"), - ("Crown", "__K"), - ("Frank", "__F"), - ("Mark", "__M"), - ("Ruble", "__RB"), - ("Peso", "__PE"), - ("Pound", "__P"), - ("Tristan da Cunha pound", "_TP"), - ("South Georgia and the South Sandwich Islands pound", "_SP"), - ("Somaliland shilling", "_SS"), - ("Pitcairn Islands dollar", "_PND"), - ("Palauan dollar", "_PD"), - ("Niue dollar", "_NID"), - ("Nauruan dollar", "_ND"), - ("Micronesian dollar", "_MD"), - ("Kiribati dollar", "_KID"), - ("Guernsey pound", "_GGP"), - ("Faroese króna", "_FOK"), - ("Cook Islands dollar", "_CKD"), - ("British Virgin Islands dollar", "_BD"), - ("Ascension pound", "_AP"), - ("Alderney pound", "_ALP"), - ("Abkhazian apsar", "_AA"), - ("Bitcoin", "_XBT")]) - FractionalUnitNameToCodeMap = dict([("Jiao", "JIAO"), - ("Kopek", "KOPEK"), - ("Pul", "PUL"), - ("Cent", "CENT"), - ("Qindarkë", "QINDARKE"), - ("Penny", "PENNY"), - ("Santeem", "SANTEEM"), - ("Cêntimo", "CENTIMO"), - ("Centavo", "CENTAVO"), - ("Luma", "LUMA"), - ("Qəpik", "QƏPIK"), - ("Fils", "FILS"), - ("Poisha", "POISHA"), - ("Kapyeyka", "KAPYEYKA"), - ("Centime", "CENTIME"), - ("Chetrum", "CHETRUM"), - ("Paisa", "PAISA"), - ("Fening", "FENING"), - ("Thebe", "THEBE"), - ("Sen", "SEN"), - ("Stotinka", "STOTINKA"), - ("Fen", "FEN"), - ("Céntimo", "CENTIMO"), - ("Lipa", "LIPA"), - ("Haléř", "HALER"), - ("Øre", "ØRE"), - ("Piastre", "PIASTRE"), - ("Santim", "SANTIM"), - ("Oyra", "OYRA"), - ("Butut", "BUTUT"), - ("Tetri", "TETRI"), - ("Pesewa", "PESEWA"), - ("Fillér", "FILLER"), - ("Eyrir", "EYRIR"), - ("Dinar", "DINAR"), - ("Agora", "AGORA"), - ("Tïın", "TIIN"), - ("Chon", "CHON"), - ("Jeon", "JEON"), - ("Tyiyn", "TYIYN"), - ("Att", "ATT"), - ("Sente", "SENTE"), - ("Dirham", "DIRHAM"), - ("Rappen", "RAPPEN"), - ("Avo", "AVO"), - ("Deni", "DENI"), - ("Iraimbilanja", "IRAIMBILANJA"), - ("Tambala", "TAMBALA"), - ("Laari", "LAARI"), - ("Khoums", "KHOUMS"), - ("Ban", "BAN"), - ("Möngö", "MONGO"), - ("Pya", "PYA"), - ("Kobo", "KOBO"), - ("Kuruş", "KURUS"), - ("Baisa", "BAISA"), - ("Centésimo", "CENTESIMO"), - ("Toea", "TOEA"), - ("Sentimo", "SENTIMO"), - ("Grosz", "GROSZ"), - ("Sene", "SENE"), - ("Halala", "HALALA"), - ("Para", "PARA"), - ("Öre", "ORE"), - ("Diram", "DIRAM"), - ("Satang", "SATANG"), - ("Seniti", "SENITI"), - ("Millime", "MILLIME"), - ("Tennesi", "TENNESI"), - ("Kopiyka", "KOPIYKA"), - ("Tiyin", "TIYIN"), - ("Hào", "HAO"), - ("Ngwee", "NGWEE"), - ("Millibitcoin", "MILLIBITCOIN"), - ("Satoshi", "SATOSHI")]) - CompoundUnitConnectorRegex = f'(?et)' - CurrencyPrefixList = dict([("Dollar", "$"), - ("Dollar États-Unis", "$us|usd|us$"), - ("Dollar des Caraïbes orientales", "xcd|$ec"), - ("Dollar Australien", "a$|$a|aud"), - ("Dollar des bahamas", "bsd|b$"), - ("Dollar barbadien", "bbd|bds$"), - ("Dollar de belize", "bz$|bzd"), - ("Dollar des bermudes", "bd$|bmd"), - ("Dollar de brunei", "brunei $|bnd"), - ("Dollar de Singapour", "s$|sgd"), - ("Dollar Canadien", "cad|$ ca|$ca|$ c"), - ("Dollar des îles Caïmans", "ci$|kyd"), - ("Dollar néo-zélandais", "nz$|nzd"), - ("Dollar de Fidji", "$fj|fjd"), - ("Dollar guyanien", "g$|gyd"), - ("Dollar de Hong Kong", "hkd|hk$"), - ("Dollar jamaïcain", "j$|jmd"), - ("Dollar libérien", "lrd|l$"), - ("Dollar namibien", "nad|n$"), - ("Dollar des îles Salomon", "$ si|$si|sbd"), - ("Nouveau dollar de Taïwan", "nt$|twd"), - ("Réal brésilien", "r$|brl|reais"), - ("Guaraní paraguayen", "₲|gs.|pyg"), - ("Dollar trinidadien", "ttd|titis"), - ("Yuan Chinois", "cny|rmb|¥|元"), - ("Yen Japonais", "¥|jpy"), - ("Euro", "€|eur"), - ("Livre", "£"), - ("Bitcoin", "₿|btc|xbt")]) - AmbiguousCurrencyUnitList = [r'din.', r'kina', r'lari', r'taka', r'tala', r'vatu', r'yuan', r'bob', r'btn', r'cop', r'cup', r'dop', r'gip', r'jod', r'kgs', r'lak', r'mga', r'mop', r'nad', r'omr', r'sar', r'sbd', r'scr', r'sdg', r'sek', r'sos', r'std', r'try', r'yer', r'livre', r'ils'] - InformationSuffixList = dict([("Bit", "-bit|bit|bits"), - ("Kilobit", "kilobit|kilobits|kb|kbit|kbits"), - ("Megabit", "megabit|megabits|Mb|Mbit|mégabit|mégabits"), - ("Gigabit", "gigabit|gigabits|Gb|Gbit"), - ("Terabit", "terabit|terabits|Tb|Tbit|térabit|térabits"), - ("Petabit", "petabit|petabits|Pb|Pbit|pétabit|pétabits"), - ("octet", "octet|octets|-octet"), - ("Kilooctet", "kilo-octet|kilo-octets|kilooctet|kilooctets|ko|kio|kB|KiB|kilobyte|kilobytes"), - ("Mégaoctet", "mégaoctet|mégaoctets|méga-octet|méga-octets|Mo|Mio|MB|mégabyte|mégabytes"), - ("Gigaoctet", "gigaoctet|gigaoctets|Go|Gio|GB|GiB|gigabyte|gigabytes"), - ("Téraoctet", "téraoctet|téraoctets|To|Tio|TB|TiB|térabyte|térabytes"), - ("Pétaoctet", "pétaoctet|pétaoctets|Po|Pio|PB|PiB|pétabyte|pétabytes")]) - AmbiguousDimensionUnitList = [r'mi', r'barils', r'grain', r'pierre', r'fps', r'pts'] - BuildPrefix = f'(?<=(\\s|^|\\P{{L}}))' - BuildSuffix = f'(?=(\\s|\\P{{L}}|$))' + CurrencySuffixList = dict( + [ + ("Abkhazie apsar", "abkhazie apsar|apsars"), + ("Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"), + ("Pul", "pul"), + ("Euro", "euros|euro|€|eur|d'euros"), + ("Cent", "cents|cent|-cents|-cent"), + ("lek Albanais", "lek albanais|leks|lek"), + ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), + ("Kwanza angolais", "kwanza angolais|kz|aoa|kwanza|kwanzas"), + ("Dram arménien", "dram arménien|drams arméniens"), + ("Florins d'Aruba", "florins aruba|ƒ|awg"), + ("Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"), + ("Paisa", "poisha|paisa"), + ("Ngultrum bhoutanais", "ngultrum bhoutanais|nu.|btn"), + ("Chetrum", "chetrums|chetrum"), + ( + "Boliviano bolivien", + "boliviano bolivien|bolivianos bolivien|bolivianos bolivie|boliviano bolivie|bob|bs.", + ), + ( + "Bosnie-Herzégovine mark convertible", + "bosnie-herzégovine mark convertible|bosnie-et-herzégovine mark convertible|bam", + ), + ("Fening", "fening|fenings"), + ("Pula", "pula|bwp"), + ("Thebe", "thebe"), + ("Réal brésilien", "réal brésilien|réals brésilien|r$|brl|real bresil|reals bresilien"), + ("Lev bulgare", "lev bulgare|levs bulgare|lv|bgn"), + ("Stotinki búlgaro", "stotinki bulgare"), + ("Riel cambodgien", "riel cambodgien|khr|៛"), + ("Escudo du cap-vert", "escudo cap-verdien|cve"), + ("Colon du costa rica", "colon du costa rica|colons du costa rica|crc|₡"), + ("Colon du salvador", "colon du salvador|colons du salvador|svc"), + ("Kuna croate", "kuna croate|kunas croate|kn|hrk"), + ("Lipa", "lipa"), + ("Couronne tchèque", "couronne tchèque|couronnes tchèque|czk|Kč"), + ("Haléř", "haléř"), + ("Nakfas érythréens", "nakfas érythréens|nfk|ern|nakfa érythréens"), + ("Birr éthiopien", "birr éthiopien|birrs éthiopien|etb"), + ("Dalasi gambienne", "gmd"), + ("Butut", "bututs|butut"), + ("Lari géorgien", "lari géorgie|lari géorgiens|gel|₾"), + ("Tetri géorgien", "tetri géorgie|tetris géorgiens"), + ("Cedi", "cedi|ghs|cedi ghanéen|gh₵"), + ("Pesewa", "pesewa|pesewas"), + ("Quetzal guatémaltèque", "quetzal guatémaltèque|gtq|quetzal|quetzales"), + ("Gourdes haïtiennes", "gourdes haïtiennes|gourdes|htg|gourde haïtienne"), + ("Lempira hondurien", "lempira hondurien|hnl"), + ("Forint hongrois", "forint hongrois|huf|fg|forints hongrois"), + ("Fillér", "fillér"), + ("Rial iranien", "rial iranien|irr|rials iranien|rials iraniens"), + ("Litas lituanien", "litas lituanien|ltl|lit lithuanien|litas lithuanie"), + ("Yen Japonais", "yen japonais|yen japon|yens|jpy|yen|¥|-yen"), + ("Tenge kazakh", "tenge kazakh|kzt"), + ("Shilling kényan", "shilling kényan|kes|shillings kényans"), + ("Won coréen", "won coréen|won coréens|₩"), + ("Won sud-coréen", "won sud-coréen|won sud coréen|won sud-coréens|krw"), + ("Corée du nord won", "corée du nord won|corée nord won|kpw"), + ("Som Kirghizie", "som kirghizie|kgs"), + ("Sum Ouzbékistan", "sum ouzbékistan|sum ouzbeks|sum ouzbéks|uzs"), + ("Kip laotien", "kip laotien|lak|₭n|₭"), + ("Att", "att"), + ("Loti", "loti|maloti|lsl"), + ("Sente", "sente|lisente"), + ("Rand sud-africain", "rand sud-africain|zar"), + ("Pataca macanais", "pataca macanais|mop$|mop"), + ("Avo", "avos|avo"), + ("Dinar macédonien", "dinar macédonien|mkd|ден"), + ("Deni", "deni"), + ("Ariary malagache", "ariary malagache|mga"), + ("Iraimbilanja", "Iraimbilanja"), + ("Kwacha malawien", "kwacha malawien|mk|mwk"), + ("Tambala", "Tambala"), + ("Ringitt malaisien", "ringitt malaisien|rm|myr|ringitts malaisien"), + ("Ouguiya mauritanienne", "ouguiya|um|mro|ouguiya mauritanien|ouguiya mauritanienne"), + ("Khoums", "khoums"), + ( + "Togrogs mongoles", + "togrogs mongoles|togrogs|tugriks|tögrög|mnt|₮|tögrög mongoles|tögrög mongolie|togrogs mongolie", + ), + ("Metical mozambique", "metical du mozambique|metical mozambique|mt|mzn|meticals mozambique"), + ("Kyat birmanie", "kyat birmanie|ks|mmk"), + ("Pya", "pya"), + ( + "Cordoba nicaraguayen", + "cordoba nicaraguayen|córdoba nicaraguayen|nio|córdoba oro|cordoba oro nicaraguayen", + ), + ("Naira nigérians", "naira nigérians|naira|ngm|₦|nairas nigérians"), + ("Livre turque", "livre turque|try|tl|livre turques"), + ("Kuruş", "kuruş"), + ("Rials omanais", "rials omanais|omr|ر.ع.|rial omanais"), + ("Balboa panaméennes", "balboa panaméennes|balboa|pab"), + ("Kina", "kina|pkg|pgk"), + ("Toea", "toea"), + ("Guaraní paraguayen", "guaraní paraguayen|₲|pyg"), + ("Sol péruvien", "nuevo sol péruvien|soles|sol|sol péruvien"), + ("Złoty polonais", "złoty polonais|złoty|zł|pln|zloty|zloty polonais"), + ("Groxz", "groszy|grosz|grosze"), + ("Riyal qatari", "riyal qatari|qar|riyals qatari"), + ("Riyal saudi", "riyal saudi|sar|riyals saudi"), + ("Riyal", "riyal|riyals|rial|﷼"), + ("Dirham", "dirham|dirhem|dirhm"), + ("Halala", "halalas|halala"), + ("Tala", "tala|tālā|ws$|sat|wst"), + ("Sene", "sene"), + ("Dobra", "dobra|db|std"), + ("Leone", "leone|sll"), + ("Florins Néerlandais", "florins hollandais|florins néerlandais|florins|ang|florin|fl"), + ("Lilangeni", "lilangeni|szl"), + ("Somoni tadjikistan", "somoni tadjikistan|tjs|somoni"), + ("Diram", "dirams|diram"), + ("Baht thaïlandais", "baht thaïlandais|baht thailandais|baht thaï|baht thai|baht|฿|thb"), + ("Satang", "satang|satangs"), + ("Paʻanga", "paʻanga|pa'anga|top"), + ("Hryvnia ukrainien", "hryvnia ukrainien|hyrvnia|uah|₴|hryvnias ukrainien|hryvnia ukrainienne"), + ("Vanuatu vatu", "vanuatu vatu|vatu|vuv"), + ( + "Bolívar vénézuélien", + "bolívar vénézuélien|bolivar venezuelien|bs.f.|vef|bolívars vénézuélien|bolivars venezuelien", + ), + ("Dong vietnamien", "dong vietnamien|dongs vietnamiens|dong|đồng|vnd|dông|dông vietnamiens"), + ("Kwacha de Zambie", "kwacha de zambie|zk|zmw|kwachas"), + ("Dirham marocain", "dirham marocain|mad|د.م."), + ("Dirham des Émirats arabes unis", "dirham des Émirats arabes unis|د.إ|aed"), + ("Manat azerbaïdjanais", "manat azerbaïdjanais|manat azerbaidjanais|azn"), + ("Manat turkmène", "manat turkmène|tmt|manat turkmene"), + ("Manat", "manats|manat"), + ("Qəpik", "qəpik"), + ("Shilling somalien", "shilling somalien|shillings somalien|sos"), + ( + "Shilling tanzanien", + "shilling tanzanien|shillings tanzanien|tzs|tsh|shilling tanzanienne|shillings tanzanienne", + ), + ("Shilling ougandais", "shilling ougandais|shillings ougandais|ugx"), + ("Leu roumain", "leu roumain|lei|leu roumaine|ron"), + ("Leu moldave", "leu meoldave|mdl"), + ("Leu", "leu"), + ("Ban", "bani|-ban|ban"), + ("Roupie népalaise", "roupie népalaise|roupie nepalaise|npr"), + ("Roupie pakistanaise", "roupie pakistanaise|pkr"), + ("Roupie indienne", "roupie indienne|roupies indiennes|inr|roupie indien|inr|₹"), + ("Roupie seychelloise", "roupie seychelloise|scr|sr|sre"), + ("Roupie mauricienne", "roupie mauricienne|mur"), + ("Rufiyaa maldives", "rufiyaa maldives|mvr|.ރ|rf"), + ("Roupie srilankaise", "roupie srilankaise|lrk|රු|ரூ"), + ("Rupiah Indonésie", "rupia indonésie|rupia indonesie|rupiah|rp|idr"), + ("Roupie", "roupie|roupies"), + ("Couronne danoise", "couronne danoise|dkk|couronnes danoise|couronne danemark|couronnes danemark"), + ( + "Couronne norvégienne", + "couronne norvégienne|couronne norvegienne|couronnes norvégienne|couronnes norvegienne|nok", + ), + ("Couronne féroïenne", "couronne féroïenne|couronne feroienne"), + ("Couronne suédoise", "couronne suédoise|couronne suéde|sek|couronnes suédoise|couronne suedoise"), + ("Couronne", "couronne|couronnes"), + ("Øre", "Øre|oyra|eyrir"), + ( + "Franc CFA de l'Afrique de l'Ouest", + "franc cfa de l''afrique de l''ouest|franc cfa ouest africain|franc cfa|francs cfa|fcfa|frs cfa|cfa francs|xof", + ), + ("Franc CFA d'Afrique centrale", "franc cfa d''afrique centrale|franc cfa centrale|frs cfa centrale|xaf"), + ("Franc comorien", "franc comorien|kmf"), + ("Franc congolais", "franc congolais|cdf"), + ("Franc burundais", "franc burundais|bif"), + ("Franc djiboutienne", "franc djiboutienne|djf"), + ("Franc CFP", "franc cfp|xpf"), + ("Franc guinéen", "franc guinéen|gnf"), + ("Franc Suisse", "franc suisse|chf|sfr.|francs suisses"), + ("Franc rwandais", "franc rwandais|rwf|rw|r₣|frw"), + ("Franc belge", "franc belge|bi.|b.fr.|bef"), + ("Rappen", "rappen|-rappen"), + ("Franc", "francs|franc|fr.|fs"), + ("Centimes", "centimes|centime|santim"), + ("Rouble russe", "rouble russe|rub|₽|₽ russe|roubles russe|roubles russes|₽ russes"), + ( + "Nouveau rouble biélorusse", + "nouveau rouble biélorusse|byn|nouveau roubles biélorusse|nouveau rouble bielorusse|nouveau roubles biélorusse", + ), + ("Rouble transnistriens", "rouble transnistriens|prb"), + ("Rouble biélorusses", "rouble biélorusses|roubles biélorusses|rouble bielorusses|roubles bielorusses"), + ("Kopek", "kopek|kopeks"), + ("Kapyeyka", "kapyeyka"), + ("Rouble", "roubles|rouble|br"), + ("Dinar algérien", "dinar algérien|د.ج|dzd|dinars algérien|dinar algerien|dinars algerien"), + ("Dinar de bahreïn", "dinar de bahreïn|bhd|.د.ب|dinar de bahrein"), + ("Santeem", "santeem|santeems"), + ("Dinar iraquien", "dinar iraquien|dinars iraquien|iqd|ع.د|dinar iraquienne|dinars iraquienne"), + ("Dinar jordanien", "dinar jordanien|dinars jordanien|د.ا|jod"), + ("Dinar koweïtien", "dinar koweïtien|dinar koweitien|dinars koweïtien|kwd|د.ك"), + ("Dinar libyen", "dinar libyen|dinars libyen|lyd"), + ("Dinar serbe", "dinar serbe|dinars serbe|rsd|дин."), + ("Dinar tunisien", "dinar tunisien|dinars tunisien|tnd"), + ("Dinar yougoslave", "dinar yougoslave|dinars yougoslave|yun"), + ("Dinar", "dinars|dinar|denar|-dinars|-dinar"), + ("Fils", "fils|fulūs|-fils|-fil"), + ("Para", "para|napa"), + ("Millime", "millimes|millime"), + ("Peso argentin", "peso argentin|ars|pesos argentin|peso argentine|pesos argentine"), + ("Peso chilien", "peso chilien|pesos chilien|clp"), + ("Peso colombien", "peso colombien|pesos colombien|cop|peso colombie|pesos colombien"), + ("Peso cubains convertibles", "peso cubains convertibles|pesos cubains convertibles|cuc"), + ("Peso cubains", "peso cubaines|pesos cubaines|peso cubaine|pesos cubaines|cup"), + ("Peso dominicain", "peso dominicain|pesos dominicain|dop|peso dominicaine|pesos dominicaine"), + ("Peso philippin", "peso philippin|pesos philippin|piso|₱|php"), + ("Peso uruguayen", "peso uruguayen|pesos uruguayen|uyu"), + ("Peso", "pesos|Peso"), + ("Centavo", "centavos|Centavo"), + ("Livre britannique", "livre britannique|livres britannique|gbp|£ britannique"), + ("Livre guernesey", "livre guernesey|£ guernesey|ggp"), + ("Livre ascension", "livre ascension|livres ascension|£ ascension"), + ( + "Livre sainte-hélène", + "livre de sainte-hélène|livre sainte-hélène|livre sainte-helene|livre de sainte hélène|shp", + ), + ("Livre égyptienne", "livre égyptienne|livre egyptienne|egp|ج.م"), + ("Livre des îles falkland", "livre des îles falkland|livre des iles falkland|fkp|£ iles falkland"), + ("Livre gibraltar", "livre gibraltar|livre de gibraltar|£ gibraltar|gip"), + ("Livre manx", "imp|livre manx|£ manx"), + ("Livre jersey", "livre de jersey|livre jersey|jep|£ jersey"), + ("Livre libanaise", "livre libanaise|£ libanaise|livres libanaise|lbp|ل.ل"), + ("Livre des îles malouines", "livre des îles malouines|livre des iles malouines|£ iles malouines"), + ( + "Livre sud-soudanaise", + "livre sud-soudanaise|livre sud soudanaise|livre du soudan du sud|livres sud-soudanaises|livre sud soudan|livre soudan sud", + ), + ("Livre soudanaise", "livre soudanaise|livres soudanaise|sdg|£ soudan|ج.س.|livre soudan|livres soudan"), + ("Livre syrienne", "livre syrienne|ل.س|syp|livre syrie|livres syrie|£ syrie"), + ("Livre", "livre|livres|-livre|-livres|£"), + ("Pence", "pence"), + ("Shilling", "shilling|shillings|sh"), + ("Penny", "penny|sou"), + ( + "Dollar États-Unis", + "dollar américain|$ américain|$ americain|usd|$usd|$ usd|dollar americain|dollar États-Unis|dollar des États-Unis|dollar États Unis|dollar etats unis|dollar etats-unis|$ etats-unis|$ États-Unis", + ), + ( + "Dollar des Caraïbes orientales", + "dollar des caraïbes orientales|dollar des caraibes orientales|xcd|$ caraibes orientales|$ caraïbes orientales", + ), + ( + "Dollar Australien", + "dollar australien|dollars australiens|$ australien|aud|$australien|australien $|$ australie|dollar australie", + ), + ("Dollar des bahamas", "dollar des bahamas|dollar bahamas|$ bahamas|bsd|bahama $|dollar bahama|$ bahamas"), + ("Dollar des bermudes", "dollar des bermudes|dollar bermude|dollar bermudes|$ bermudes|bmd"), + ("Dollar de belize", "dollar de Belize|dollar belizien|bzd|$ belize"), + ( + "Dollar îles Vierges britanniques", + "dollar îles vierges britanniques|dollar iles vierges britanniques|$ iles vierges britanniques", + ), + ("Dollar de brunei", "dollar de brunei|$ brunei|bnd|dollar brunei"), + ("Sen", "sen"), + ("Dollar de Singapour", "dollar de singapour|dollar singapour|$ sinapour|sgd|$s"), + ( + "Dollar Canadien", + "dollar canadien|dollars canadien|$ canadien|cad|$can|$c|$ c|dollar canada|dollar canadienne|$ canada|$cad|cad$", + ), + ( + "Dollar des îles Caïmans", + "dollars des îles caïmanes|dollar des îles caïmanes|dollars des iles caimanes|dollar iles caimanes|kyd|$ci", + ), + ( + "Dollar néo-zélandais", + "dollar néo-zélandais|dollar néo zélandais|dollar neo-zelandais|dollar neo zelandais|$nz|$ néo-zélandais|$ neo zelandais", + ), + ("Dollar îles cook", "dollar îles cook|dollar iles cook|$ iles cook"), + ( + "Dollar des fidji", + "dollar des fidji|$ fidji|dollar fidji|dollar de fidji|dollars des fidji|dollars de fidji", + ), + ("Dollar guyanien", "dollar guyanien|dollar du guyana|dollar dre guyana|$ guayana|gyd|$gy"), + ( + "Dollar de Hong Kong", + "dollar hong kong|dollar hongkong|dollar de hong kong|dollar de hongkong|$hk|$ hk|hkd|hk $|hk$|dollar hk|$hongkong|dollars hongkong|dollars hong kong", + ), + ( + "Dollar jamaïcain", + "dollar jamaïcain|dollars jamaïcain|dollar jamaicain|dollars jamaicain|$j|$ jamaïque|dollar jamaïque|jmd", + ), + ( + "Dollar libérien", + "dollar libérien|dollars libérien|dollar liberien|dollars liberien|lrd|$ libérien|$ liberia|$ liberien", + ), + ( + "Dollar namibien", + "dollar namibien|dollars namibien|$ namibien|nad|$n|dollar namibie|dollars namibie|$ namibie", + ), + ( + "Dollar des îles Salomon", + "dollar des îles Salomon|dollar des iles salomon|$si|sbd|$ iles salomon|$ îles salomon", + ), + ( + "Dollar du suriname", + "dollar du suriname|srd|$ du suriname|$ suriname|dollar suriname|dollars suriname|dollars du suriname", + ), + ("Nouveau dollar de Taïwan", "nouveau dollar de taïwan|nouveau dollar de taiwan|twd|ntd|$nt"), + ("Dollar trinidadien", "dollar trinidadien|dollars trinidadien|ttd|$ trinidadien"), + ("Dollar", "dollar|$|dollars"), + ("Yuan Chinois", "yuan|yuans|yuan chinois|renminbi|cny|rmb|¥"), + ("Fen", "fen"), + ("Jiao", "jiao"), + ("Mark Finlandais", "marks finlandais|mark finlandais|fim|mark"), + ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), + ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), + ("Satoshi", "satoshi|satoshis"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afghan afghani", "AFN"), + ("Euro", "EUR"), + ("Albanian lek", "ALL"), + ("Kwanza angolais", "AOA"), + ("Armenian dram", "AMD"), + ("Florins d'Aruba", "AWG"), + ("Bangladeshi taka", "BDT"), + ("Ngultrum bhoutanais", "BTN"), + ("Boliviano bolivien", "BOB"), + ("Bosnie-Herzégovine mark convertible", "BAM"), + ("Pula", "BWP"), + ("Réal brésilien", "BRL"), + ("Lev bulgare", "BGN"), + ("Riel cambodgien", "KHR"), + ("Escudo du cap-vert", "CVE"), + ("Colon du costa rica", "CRC"), + ("Kuna croate", "HRK"), + ("Couronne tchèque", "CZK"), + ("Nakfas érythréens", "ERN"), + ("Birr éthiopien", "ETB"), + ("Dalasi gambienne", "GMD"), + ("Lari géorgien", "GEL"), + ("Cedi", "GHS"), + ("Quetzal guatémaltèque", "GTQ"), + ("Gourdes haïtiennes", "HTG"), + ("Lempira hondurien", "HNL"), + ("Forint hongrois", "HUF"), + ("Rial iranien", "IRR"), + ("Yemeni rial", "YER"), + ("Israeli new shekel", "ILS"), + ("Yen Japonais", "JPY"), + ("Tenge kazakh", "KZT"), + ("Shilling kényan", "KES"), + ("Corée du nord won", "KPW"), + ("Won sud-coréen", "KRW"), + ("Som Kirghizie", "KGS"), + ("Kip laotien", "LAK"), + ("Loti", "LSL"), + ("Rand sud-africain", "ZAR"), + ("Pataca macanais", "MOP"), + ("Dinar macédonien", "MKD"), + ("Ariary malagache", "MGA"), + ("Kwacha malawien", "MWK"), + ("Ringitt malaisien", "MYR"), + ("Ouguiya mauritanienne", "MRO"), + ("Togrogs mongoles", "MNT"), + ("Metical mozambique", "MZN"), + ("Kyat birmanie", "MMK"), + ("Cordoba nicaraguayen", "NIO"), + ("Nigerian naira", "NGN"), + ("Livre turque", "TRY"), + ("Rials omanais", "OMR"), + ("Balboa panaméennes", "PAB"), + ("Kina", "PGK"), + ("Guaraní paraguayen", "PYG"), + ("Peruvian sol", "PEN"), + ("Złoty polonais", "PLN"), + ("Riyal qatari", "QAR"), + ("Riyal saudi", "SAR"), + ("Tala", "WST"), + ("São Tomé and Príncipe dobra", "STN"), + ("Leone", "SLL"), + ("Lilangeni", "SZL"), + ("Somoni tadjikistan", "TJS"), + ("Baht thaïlandais", "THB"), + ("Hryvnia ukrainien", "UAH"), + ("Vanuatu vatu", "VUV"), + ("Bolívar vénézuélien", "VEF"), + ("Kwacha de Zambie", "ZMW"), + ("Dirham marocain", "MAD"), + ("Dirham des Émirats arabes unis", "AED"), + ("Manat azerbaïdjanais", "AZN"), + ("Manat turkmène", "TMT"), + ("Shilling somalien", "SOS"), + ("Shilling tanzanien", "TZS"), + ("Shilling ougandais", "UGX"), + ("Leu roumain", "RON"), + ("Leu moldave", "MDL"), + ("Roupie népalaise", "NPR"), + ("Roupie pakistanaise", "PKR"), + ("Roupie indienne", "INR"), + ("Roupie seychelloise", "SCR"), + ("Roupie mauricienne", "MUR"), + ("Rufiyaa maldives", "MVR"), + ("Sri Lankan rupee", "LKR"), + ("Rupiah Indonésie", "IDR"), + ("Couronne danoise", "DKK"), + ("Couronne norvégienne", "NOK"), + ("Icelandic króna", "ISK"), + ("Couronne suédoise", "SEK"), + ("Franc CFA de l'Afrique de l'Ouest", "XOF"), + ("Franc CFA d'Afrique centrale", "XAF"), + ("Franc comorien", "KMF"), + ("Franc congolais", "CDF"), + ("Franc burundais", "BIF"), + ("Franc djiboutienne", "DJF"), + ("Franc CFP", "XPF"), + ("Franc guinéen", "GNF"), + ("Franc Suisse", "CHF"), + ("Franc rwandais", "RWF"), + ("Rouble russe", "RUB"), + ("Rouble transnistriens", "PRB"), + ("Nouveau rouble biélorusse", "BYN"), + ("Dinar algérien", "DZD"), + ("Dinar de bahreïn", "BHD"), + ("Dinar iraquien", "IQD"), + ("Dinar jordanien", "JOD"), + ("Dinar koweïtien", "KWD"), + ("Dinar libyen", "LYD"), + ("Dinar serbe", "RSD"), + ("Dinar tunisien", "TND"), + ("Peso argentin", "ARS"), + ("Peso chilien", "CLP"), + ("Peso colombien", "COP"), + ("Peso cubains convertibles", "CUC"), + ("Peso cubains", "CUP"), + ("Peso dominicain", "DOP"), + ("Mexican peso", "MXN"), + ("Peso uruguayen", "UYU"), + ("Livre britannique", "GBP"), + ("Livre sainte-hélène", "SHP"), + ("Livre égyptienne", "EGP"), + ("Livre des îles falkland", "FKP"), + ("Livre gibraltar", "GIP"), + ("Livre manx", "IMP"), + ("Livre jersey", "JEP"), + ("Livre libanaise", "LBP"), + ("South Sudanese pound", "SSP"), + ("Livre soudanaise", "SDG"), + ("Livre syrienne", "SYP"), + ("Dollar États-Unis", "USD"), + ("Dollar Australien", "AUD"), + ("Dollar des bahamas", "BSD"), + ("Dollar barbadien", "BBD"), + ("Dollar de belize", "BZD"), + ("Dollar des bermudes", "BMD"), + ("Dollar de brunei", "BND"), + ("Dollar de Singapour", "SGD"), + ("Dollar Canadien", "CAD"), + ("Dollar des îles Caïmans", "KYD"), + ("Dollar néo-zélandais", "NZD"), + ("Dollar de Fidji", "FJD"), + ("Dollar guyanien", "GYD"), + ("Dollar de Hong Kong", "HKD"), + ("Dollar jamaïcain", "JMD"), + ("Dollar libérien", "LRD"), + ("Dollar namibien", "NAD"), + ("Dollar des îles Salomon", "SBD"), + ("Dollar du suriname", "SRD"), + ("Nouveau dollar de Taïwan", "TWD"), + ("Dollar trinidadien", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Yuan Chinois", "CNY"), + ("Rial", "__RI"), + ("Shiling", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dollar", "__D"), + ("Manat", "__MA"), + ("Rupee", "__R"), + ("Krone", "__K"), + ("Krona", "__K"), + ("Crown", "__K"), + ("Frank", "__F"), + ("Mark", "__M"), + ("Ruble", "__RB"), + ("Peso", "__PE"), + ("Pound", "__P"), + ("Tristan da Cunha pound", "_TP"), + ("South Georgia and the South Sandwich Islands pound", "_SP"), + ("Somaliland shilling", "_SS"), + ("Pitcairn Islands dollar", "_PND"), + ("Palauan dollar", "_PD"), + ("Niue dollar", "_NID"), + ("Nauruan dollar", "_ND"), + ("Micronesian dollar", "_MD"), + ("Kiribati dollar", "_KID"), + ("Guernsey pound", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dollar", "_CKD"), + ("British Virgin Islands dollar", "_BD"), + ("Ascension pound", "_AP"), + ("Alderney pound", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarkë", "QINDARKE"), + ("Penny", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENTAVO"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENTIMO"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '(?et)' + CurrencyPrefixList = dict( + [ + ("Dollar", "$"), + ("Dollar États-Unis", "$us|usd|us$"), + ("Dollar des Caraïbes orientales", "xcd|$ec"), + ("Dollar Australien", "a$|$a|aud"), + ("Dollar des bahamas", "bsd|b$"), + ("Dollar barbadien", "bbd|bds$"), + ("Dollar de belize", "bz$|bzd"), + ("Dollar des bermudes", "bd$|bmd"), + ("Dollar de brunei", "brunei $|bnd"), + ("Dollar de Singapour", "s$|sgd"), + ("Dollar Canadien", "cad|$ ca|$ca|$ c"), + ("Dollar des îles Caïmans", "ci$|kyd"), + ("Dollar néo-zélandais", "nz$|nzd"), + ("Dollar de Fidji", "$fj|fjd"), + ("Dollar guyanien", "g$|gyd"), + ("Dollar de Hong Kong", "hkd|hk$"), + ("Dollar jamaïcain", "j$|jmd"), + ("Dollar libérien", "lrd|l$"), + ("Dollar namibien", "nad|n$"), + ("Dollar des îles Salomon", "$ si|$si|sbd"), + ("Nouveau dollar de Taïwan", "nt$|twd"), + ("Réal brésilien", "r$|brl|reais"), + ("Guaraní paraguayen", "₲|gs.|pyg"), + ("Dollar trinidadien", "ttd|titis"), + ("Yuan Chinois", "cny|rmb|¥|元"), + ("Yen Japonais", "¥|jpy"), + ("Euro", "€|eur"), + ("Livre", "£"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) + AmbiguousCurrencyUnitList = [ + r'din.', + r'kina', + r'lari', + r'taka', + r'tala', + r'vatu', + r'yuan', + r'bob', + r'btn', + r'cop', + r'cup', + r'dop', + r'gip', + r'jod', + r'kgs', + r'lak', + r'mga', + r'mop', + r'nad', + r'omr', + r'sar', + r'sbd', + r'scr', + r'sdg', + r'sek', + r'sos', + r'std', + r'try', + r'yer', + r'livre', + r'ils', + ] + BuildPrefix = '(?<=(\\s|^|\\P{L}))' + BuildSuffix = '(?=(\\s|\\P{L}|$))' ConnectorToken = 'de' - LengthSuffixList = dict([("Kilomètres", "km|kilomètres|kilomètre|kilometres|kilometre|-km"), - ("Hectomètre", "hm|hectomètre|hectomètres|hectometre|hectometres|-hm"), - ("Décamètre", "dam|décamètre|décamètres|decametre|decametres|-dm"), - ("Mètres", "m|mètres|mètre|metres|metre|m.|-m"), - ("Décimètres", "dm|décimètres|décimètre|decimetres|decimetre"), - ("Centimètres", "cm|centimètres|centimètre|centimetres|centimetre"), - ("Millimètres", "mm|millimètres|millimètre|millimetre|millimetres"), - ("Micromètres", "µm|um|micromètres|micromètre|micrometres|micrometre"), - ("Nanomètres", "nm|nanometre|nanometres|nanomètres|nanomètre"), - ("Picomètres", "pm|picomètre|picomètres|picometres|picometre"), - ("Mile", "mi|mile|miles"), - ("Pied", "pied|pieds"), - ("Yard", "yards|yard|yd"), - ("Pouce", "pouce|pouces")]) - AmbiguousLengthUnitList = [r'm.', r'yard', r'yards', r'pm', r'pouce', r'pt', r'pts'] - SpeedSuffixList = dict([("Mètre par seconde", "m/s|metres/seconde|metres par seconde|metre par seconde|metres par secondes|mètre par seconde|mètres par seconde|mètres par secondes"), - ("Kilomètre par heure", "km/h|kilomètre par heure|kilomètres par heure|kilomètres par heures|kilometres par heure|kilometre par heure"), - ("Kilomètre par minute", "km/m|kilomètre par minute|kilomètres par minute|kilomètres par minutes|kilometre par minute|kilometre par minutes"), - ("Kilomètre par seconde", "km/s|km à la seconde|km a la seconde|kilomètre par seconde|kilomètres par seconde|kilometre par seconde|kilometres par seconde"), - ("Miles par heure", "mph|miles par heure|miles à l'heure|miles a l'heure|miles un heure"), - ("Noeuds", "noeud|noeuds|nuds"), - ("Pied par seconde", "ft/s|pied par seconde|pieds par seconde|pied/s|pieds/s"), - ("Pied par minute", "pieds/minute|pied/minute|ft/minute|ft/min|pied/min")]) - AmbiguousSpeedUnitList = [r'noeud', r'noeuds', r'nuds'] - TemperatureSuffixList = dict([("Kelvin", "k|K|kelvin"), - ("F", "°f|° f|degres f|degrés f|deg f|degrés fahrenheit|degres fahrenheit|fahrenheit|deg fahrenheit|degs fahrenheit"), - ("R", "rankine|°r|° r"), - ("C", "°c|° c|degres c|degrés c|deg c|degrés celsius|degres celsius|celsius|deg celsius|degs celsius|centigrade|deg centigrade|degs centigrade|degrés centigrade|degres centigrade|degré centigrade|degre centigrade"), - ("Degré", "degrés|degres|deg.|°|degré|degre|deg|degs")]) - VolumeSuffixList = dict([("Mètre cube", "m3|m^3|m³|mètre cube|mètres cube|metre cube|metres cube"), - ("Centimètre cube", "cm3|cm^3|cm³|centimètre cube|centimètres cube|centimetre cube|centimetres cube"), - ("Millimètre cube", "mm3|mm^3|mm³|millimètre cube|millimètres cube|millimetre cube|millimetres cube"), - ("Kilomètre cube", "km3|km^3|km³|kilomètre cube|kilomètres cube|kilometre cube|kilometres cube"), - ("Pieds cube", "pieds cubes|pieds cube|pied cube|pied cubes"), - ("Litre", "litre|litres|lts|l"), - ("Millilitre", "ml|millilitre|millilitres"), - ("Gallon", "gallon|gallons"), - ("Pintes", "pintes"), - ("Onces", "onces|once|oz"), - ("Décilitre", "dl|décilitre|decilitre|décilitres|decilitres"), - ("Centilitre", "cl|centilitres|centilitre"), - ("Onces liquides", "onces liquides|once liquide|once liquides"), - ("Baril", "baril|barils|bbl")]) - AmbiguousVolumeUnitList = [r'oz', r'l'] - WeightSuffixList = dict([("Kilogramme", "kg|kilogramme|kilogrammes|kilo|kilos"), - ("Gram", "g|gramme|grammes"), - ("Milligramme", "mg|milligramme|milligrammes"), - ("Microgramme", "µg|ug|microgramme|microgrammes"), - ("Tonne métrique", "tonne métrique|tonnes métrique|tonnes métriques|tonne metrique|tonnes metrique"), - ("Tonne", "tonne|tonnes|-tonnes|-tonne"), - ("Livre", "livre|livres")]) - AmbiguousWeightUnitList = [r'g', r'oz'] - AngleSuffixList = dict([("Degree", "degré|degrés|degre|degres|deg|°"), - ("Radian", "radian|radians|rad"), - ("Turn", "tour|tours")]) - AmbiguousAngleUnitList = [r'tour', r'tours'] AmbiguityFiltersDict = dict([("\\bcent\\b", "\\bpour\\s+cent\\b")]) - TemperatureAmbiguityFiltersDict = dict([("\\b(deg(r[eé]s?)?|°)$", "\\b((deg(r[eé]s?)?|°)\\s*(angle|rotation)|(tourn([eé]|er|ant)|rotation|angle)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(deg(r[eé]s?)?\\b|°))")]) - DimensionAmbiguityFiltersDict = dict([("\\b(deg(r[eé]s?)?|°)$", "\\b((deg(r[eé]s?)?|°)\\s*(c(elsius|entigrade)?|f(ah?renheit)?)|(temp[eé]rature)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(deg(r[eé]s?)?\\b|°))")]) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/german_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/german_numeric_with_unit.py index 5516131723..edee290493 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/german_numeric_with_unit.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/german_numeric_with_unit.py @@ -9,668 +9,751 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_numbers import BaseNumbers + # pylint: disable=line-too-long class GermanNumericWithUnit: - AgeSuffixList = dict([("Year", "jahr alt|jahre alt|jahren|jahre|lebensjahr"), - ("Month", "monat alt|monate alt|monaten|monate"), - ("Week", "woche alt|wochen alt|wochen|woche"), - ("Day", "tag alt|tage alt|tagen|tage")]) - AmbiguousAgeUnitList = [r'jahren', r'jahre', r'monaten', r'monate', r'wochen', r'woche', r'tagen', r'tage'] - AreaSuffixList = dict([("Square kilometer", "qkm|quadratkilometer|km^2|km²"), - ("Square hectometer", "qhm|quadrathektometer|hm^2|hm²|hektar"), - ("Square decameter", "quadratdekameter|dam^2|dam²"), - ("Square meter", "qm|quadratmeter|m^2|m²"), - ("Square decimeter", "qdm|quadratdezimeter|dm^2|dm²"), - ("Square centimeter", "qcm|quadratzentimeter|cm^2|cm²"), - ("Square millimeter", "qmm|quadratmillimeter|mm^2|mm²"), - ("Square inch", "sqin|quadratzoll|in^2|in²"), - ("Square foot", "sqft|quadratfuß|fuß^2|fuß²|ft2|ft^2|ft²"), - ("Square mile", "sqmi|quadratmeile|mi^2|mi²"), - ("Square yard", "sqyd|quadratyard|yd^2|yd²"), - ("Acre", "-acre|acre|acres")]) - CurrencySuffixList = dict([("Abkhazian apsar", "abkhazian apsar|apsars"), - ("Afghan afghani", "afghanischer afghani|afghanische afghani|afghanischen afghani|؋|afn|afghani"), - ("Pul", "pul"), - ("Euro", "euro|€|eur"), - ("Cent", "cent|-cent"), - ("Albanian lek", "albaninischer Lek|albanische Lek|albanischen Lek"), - ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), - ("Angolan kwanza", "angolanischer kwanza|angolanische kwanza|angolanischen kwanza|kz|aoa|kwanza|kwanzas"), - ("Armenian dram", "armeninischer dram|armeninische dram|armeninischen dram"), - ("Aruban florin", "Aruba-Florin|ƒ|awg"), - ("Bangladeshi taka", "bangladesischer taka|bengalischer taka|bangladesische taka|bengalische taka|bangladesischen taka|bengalischen taka|৳|bdt|taka"), - ("Paisa", "poisha|paisa"), - ("Bhutanese ngultrum", "bhutanischer ngultrum|bhutanische ngultrum|bhutanischen ngultrum|nu.|btn"), - ("Chetrum", "chetrum"), - ("Bolivian boliviano", "bolivianischer boliviano|bolivianische boliviano|bolivianischen boliviano|bob|bs.|boliviano"), - ("Bosnia and Herzegovina convertible mark", "bosnischer konvertible mark|bosnisch-herzegowinischer konvertible mark|bosnische konvertible mark|bosnisch-herzegowinische konvertible mark|bosnischen konvertible mark|bosnisch-herzegowinischen konvertible mark|konvertible mark|bam"), - ("Fening", "Fening"), - ("Botswana pula", "botswanischer pula|botswanische pula|botswanischen pula|bwp|pula"), - ("Thebe", "thebe"), - ("Brazilian real", "brazilianischer real|brazilianische real|brazilianischen real|r$|brl|real"), - ("Bulgarian lev", "bulgarischer lew|bulgarische lew|bulgarischen lew|bgn|лв|lew"), - ("Stotinka", "stotinki|stotinka"), - ("Cambodian riel", "kambodschanischer riel|kambodschanische riel|kambodschanischen riel|khr|៛|riel"), - ("Cape Verdean escudo", "kap-verde-escudo|cve"), - ("Costa Rican colón", "costa-rica-colón|costa-rica-colon|crc|₡"), - ("Salvadoran colón", "svc|el-salvador-colón|el-salvador-colon"), - ("Céntimo", "céntimo"), - ("Croatian kuna", "kroatischer kuna|kroatische kuna|kroatischen kuna|kn|hrk|kuna"), - ("Lipa", "lipa"), - ("Czech koruna", "tschechische krone|tschechischen kronen|tschechischer kronen|czk|kč"), - ("Haléř", "haléř"), - ("Eritrean nakfa", "eritreischer nakfa|eritreische nakfa|eritreischen nakfa|nfk|ern|nakfa"), - ("Ethiopian birr", "äthiopischer birr|äthiopische birr|äthiopischen birr|etb"), - ("Gambian dalasi", "gambischer dalasi|gambische dalasi|gambischen dalasi|gmd"), - ("Butut", "bututs|butut"), - ("Georgian lari", "georgischer lari|georgische lari|georgischen lari|lari|gel|₾"), - ("Tetri", "tetri"), - ("Ghanaian cedi", "ghanaischer cedi|ghanaische cedi|ghanaischen cedi|Ghana cedi|ghs|₵|gh₵"), - ("Pesewa", "pesewas|pesewa"), - ("Guatemalan quetzal", "guatemaltekischer quetzal|guatemaltekische quetzal|guatemaltekischen quetzal|gtq|quetzal"), - ("Haitian gourde", "haitianischer gourde|haitianische gourde|haitianischen gourde|htg"), - ("Honduran lempira", "honduranischer lempira|honduranische lempira|honduranischen lempira|hnl"), - ("Hungarian forint", "ungarischer forint|ungarische forint|ungarischen forint|huf|ft|forint"), - ("Fillér", "fillér"), - ("Iranian rial", "iranischer rial|iranische rial|iranischen rial|irr"), - ("Yemeni rial", "jemen-rial|yer"), - ("Israeli new shekel", "₪|ils|agora"), - ("Lithuanian litas", "ltl|litauischer litas|litauische litas|litauischen litas"), - ("Japanese yen", "japaneser yen|japanese yen|japanesen yen|jpy|yen|¥"), - ("Kazakhstani tenge", "kasachischer tenge|kasachische tenge|kasachischen tenge|kzt"), - ("Kenyan shilling", "kenia-schilling|kes"), - ("North Korean won", "nordkoreanischer won|nordkoreanische won|nordkoreanischen won|kpw"), - ("South Korean won", "südkoreanischer won|südkoreanische won|südkoreanischen won|krw"), - ("Korean won", "koreanischer won|koreanische won|koreanischen won|₩"), - ("Kyrgyzstani som", "kirgisischer som|kirgisische som|kirgisischen som|kgs"), - ("Uzbekitan som", "usbekischer som|usbekische som|usbekischen som|usbekischer sum|usbekische sum|usbekischen sum|usbekischer so'm|usbekische so'm|usbekischen so'm|usbekischer soum|usbekische soum|usbekischen soum|uzs"), - ("Lao kip", "laotischer kip|laotische kip|laotischen kip|lak|₭n|₭"), - ("Att", "att"), - ("Lesotho loti", "lesothischer loti|lesothische loti|lesothischen loti|lsl|loti"), - ("Sente", "sente|lisente"), - ("South African rand", "südafrikanischer rand|südafrikanische rand|südafrikanischen rand|zar"), - ("Macanese pataca", "macao-pataca|mop$|mop"), - ("Avo", "avos|avo"), - ("Macedonian denar", "mazedonischer denar|mazedonische denar|mazedonischen denar|mkd|ден"), - ("Deni", "deni"), - ("Malagasy ariary", "madagassischer ariary|madagassische ariary|madagassischen ariary|ariary|mga"), - ("Iraimbilanja", "iraimbilanja"), - ("Malawian kwacha", "malawi-kwacha|mk|mwk"), - ("Tambala", "tambala"), - ("Malaysian ringgit", "malaysischer ringgit|malaysische ringgit|malaysischen ringgit|rm|myr"), - ("Mauritanian ouguiya", "mauretanischer ouguiya|mauretanische ouguiya|mauretanischen ouguiya|mro"), - ("Khoums", "khoums"), - ("Mongolian tögrög", "mongolischer tögrög|mongolische tögrög|mongolischen tögrög|mongolischer tugrik|mongolische tugrik|mongolischen tugrik|mnt|₮"), - ("Mozambican metical", "mosambik-metical|mosambik metical|mt|mzn"), - ("Burmese kyat", "myanmar-kyat|myanmar kyat|ks|mmk"), - ("Pya", "pya"), - ("Nicaraguan córdoba", "nicaraguanischer córdoba oro|nicaraguanische córdoba oro|nicaraguanischen córdoba oro|nicaraguanischer córdoba|nicaraguanische córdoba|nicaraguanischen córdoba|nio|córdoba|córdoba oro"), - ("Nigerian naira", "nigerianischer naira|nigerianische naira|nigerianischen naira|naira|ngn|₦|nigeria naira"), - ("Kobo", "kobo"), - ("Turkish lira", "türkischer lira|türkische lira|türkischen lira|tuerkischer lira|tuerkische lira|tuerkischen lira|try|tl"), - ("Kuruş", "kuruş"), - ("Omani rial", "omanischer rial|omanische rial|omanischen rial|omr|ر.ع."), - ("Panamanian balboa", "panamaischer balboa|panamaische balboa|panamaischen balboa|b/.|pab"), - ("Centesimo", "centesimo"), - ("Papua New Guinean kina", "papua-neuguinea-kina|kina|pgk"), - ("Toea", "toea"), - ("Paraguayan guaraní", "paraguayischer guaraní|paraguayische guaraní|paraguayischen guaraní|guaraní|₲|pyg"), - ("Peruvian sol", "peruanischer sol|peruanische sol|peruanischen sol|soles|sol"), - ("Polish złoty", "polnischer złoty|polnische złoty|polnischen złoty|polnischer zloty|polnische zloty|polnischen zloty|zł|pln|złoty|zloty"), - ("Grosz", "groszy|grosz|grosze"), - ("Qatari riyal", "katar-riyal|katar riyal|qatari riyal|qar"), - ("Saudi riyal", "saudi-riyal|sar"), - ("Riyal", "riyal|﷼"), - ("Dirham", "dirham|dirhem|dirhm"), - ("Halala", "halalas|halala"), - ("Samoan tālā", "samoanischer tala|samoanische tala|samoanischen tala|samoanischer tālā|samoanische tālā|samoanischen tālā|tālā|tala|ws$|samoa|wst|samoa-tālā|samoa-tala"), - ("Sene", "sene"), - ("São Tomé and Príncipe dobra", "são-toméischer dobra|são-toméische dobra|são-toméischen dobra|dobra|std"), - ("Sierra Leonean leone", "sierra-leonischer leone|sierra-leonische leone|sierra-leonischen leone|sll|leone|le"), - ("Peseta", "pesetas|peseta"), - ("Netherlands guilder", "florin|antillen-gulden|niederländische-antillen-gulden|antillen gulden|ang|niederländischer gulden|niederländische gulden|niederländischen gulden|gulden|fl"), - ("Swazi lilangeni", "swazi-lilangeni|swazi lilangeni|lilangeni|szl|swazi-emalangeni|swazi emalangeni"), - ("Tajikistani somoni", "tadschikischer somoni|tadschikische somoni|tadschikischen somoni|tadschikistan-somoni|tadschikistan somoni|tajikischer somoni|tajikische somoni|tajikischen somoni|tajikistan-somoni|tajikistan somoni|tjs"), - ("Diram", "dirams|diram"), - ("Thai baht", "thailändischer baht|thailändische baht|thailändischen baht|thailaendischer baht|thailaendische baht|thailaendischen baht|thai baht|thai-baht|฿|thb"), - ("Satang", "satang|satangs"), - ("Tongan paʻanga", "tongaischer paʻanga|tongaische paʻanga|tongaischen paʻanga|paʻanga|tonga paʻanga|tongaischer pa'anga|tongaische pa'anga|tongaischen pa'anga|pa'anga|tonga pa'anga"), - ("Seniti", "seniti"), - ("Ukrainian hryvnia", "ukrainischer hrywnja|ukrainische hrywnja|ukrainischen hrywnja|hrywnja|uah|₴"), - ("Vanuatu vatu", "vanuatu-vatu|vanuatu vatu|vatu|vuv"), - ("Venezuelan bolívar", "venezolanischer bolívar|venezolanische bolívar|venezolanischen bolívar|bs.f.|vef"), - ("Vietnamese dong", "vietnamesischer đồng|vietnamesische đồng|vietnamesischen đồng|vietnamesischer dong|vietnamesische dong|vietnamesischen dong|vnd|đồng"), - ("Zambian kwacha", "sambischer kwacha|sambische kwacha|sambischen kwacha|zk|zmw"), - ("Moroccan dirham", "marokkanischer dirham|marokkanische dirham|marokkanischen dirham|mad|د.م."), - ("United Arab Emirates dirham", "vae dirham|vae-dirham|dirham der vereinigten arabischen emirate|د.إ|aed"), - ("Azerbaijani manat", "aserbaidschan-manat|azn"), - ("Turkmenistan manat", "turkmenistan-manat|tmt"), - ("Manat", "manat|manats"), - ("Qəpik", "qəpik"), - ("Somali shilling", "somalia-schilling|sh.so.|sos"), - ("Somaliland shilling", "somaliland-schilling"), - ("Tanzanian shilling", "tansania-schilling|tsh|tzs"), - ("Ugandan shilling", "uganda-schilling|ugx"), - ("Romanian leu", "rumänischer leu|rumänische leu|rumänischen leu|rumaenischer leu|rumaenische leu|rumaenischen leu|lei|ron"), - ("Moldovan leu", "moldauischer leu|moldauische leu|moldauischen leu|mdl|moldau leu"), - ("Leu", "leu"), - ("Ban", "bani|ban"), - ("Nepalese rupee", "nepalesischer rupie|nepalesische rupie|nepalesischen rupie|nepalesische rupien|nepalesischer rupien|nepalesischen rupien|npr"), - ("Pakistani rupee", "pakistanischer rupie|pakistanische rupie|pakistanischen rupie|pakistanischer rupien|pakistanische rupien|pakistanischen rupien|pkr"), - ("Indian rupee", "indischer rupie|indische rupie|indischen rupie|indischer rupien|indische rupien|indischen rupien|inr|₹"), - ("Seychellois rupee", "seychellen-rupie|seychellen-rupien|scr|sr|sre"), - ("Mauritian rupee", "mauritius-rupie|mauritius-rupien|mur"), - ("Maldivian rufiyaa", "maledivischer rufiyaa|maledivische rufiyaa|maledivischen rufiyaa|mvr|.ރ"), - ("Sri Lankan rupee", "sri-lanka-rupie|sri-lanka-rupien|lkr|රු|ரூ"), - ("Indonesian rupiah", "indonesischer rupiah|indonesische rupiah|indonesischen rupiah|rupiah|perak|rp|idr"), - ("Rupee", "rupie|rupien|rs"), - ("Danish krone", "dänische krone|dänischen krone|dänischer kronen|dänische kronen|dänischen kronen|daenische krone|daenischen krone|daenischer kronen|daenische kronen|daenischen kronen|dkk"), - ("Norwegian krone", "norwegische krone|norwegischen krone|norwegischer kronen|norwegische kronen|norwegischen kronen|nok"), - ("Faroese króna", "färöische króna|färöische krone|färöischen krone|färöischer kronen|färöische kronen|färöischen kronen"), - ("Icelandic króna", "isländische krone|isländischen krone|isländischer kronen|isländische kronen|isländischen kronen|isk"), - ("Swedish krona", "schwedische krone|schwedischen krone|schwedischer kronen|schwedische kronen|schwedischen kronen|sek"), - ("Krone", "krone|kronen|kr|-kr"), - ("Øre", "Øre|oyra|eyrir"), - ("West African CFA franc", "west african cfa franc|xof|westafrikanische cfa franc|westafrikanische-cfa-franc"), - ("Central African CFA franc", "central african cfa franc|xaf|zentralafrikanische cfa franc|zentralafrikanische-cfa-franc"), - ("Comorian franc", "komoren-franc|kmf"), - ("Congolese franc", "kongo-franc|cdf"), - ("Burundian franc", "burundi-franc|bif"), - ("Djiboutian franc", "dschibuti-franc|djf"), - ("CFP franc", "cfp-franc|xpf"), - ("Guinean franc", "franc guinéen|franc-guinéen|gnf"), - ("Swiss franc", "schweizer franken|schweizer-franken|chf|sfr."), - ("Rwandan franc", "ruanda-franc|rwf|rf|r₣|frw"), - ("Belgian franc", "belgischer franken|belgische franken|belgischen franken|bi.|b.fr.|bef"), - ("Rappen", "rappen|-rappen"), - ("Franc", "franc|französischer franc|französische franc|französischen franc|französischer franken|französische franken|französischen franken|franken|fr.|fs"), - ("Centime", "centimes|centime|santim"), - ("Russian ruble", "russischer rubel|russische rubel|russischen rubel|₽|rub"), - ("New Belarusian ruble", "neuer weißrussischer rubel|neue weißrussische rubel|neuen weißrussischen rubel|neuem weißrussischen rubel"), - ("Old Belarusian ruble", "alter weißrussischer rubel|alte weißrussische rubel|alten weißrussischen rubel|altem weißrussischen rubel"), - ("Transnistrian ruble", "transnistrischer rubel|transnistrische rubel|transnistrischen rubel|prb|р."), - ("Belarusian ruble", "weißrussischer rubel|weißrussische rubel|weißrussischen rubel"), - ("Kopek", "kopek|kopeks"), - ("Kapyeyka", "kapyeyka"), - ("Ruble", "rubel|br"), - ("Algerian dinar", "algerischer dinar|algerische dinar|algerischen dinar|د.ج|dzd"), - ("Bahraini dinar", "bahrain-dinar|bhd|.د.ب"), - ("Santeem", "santeem|santeeme"), - ("Iraqi dinar", "irakischer dinar|irakische dinar|irakischen dinar|iqd|ع.د"), - ("Jordanian dinar", "jordanischer dinar|jordanische dinar|jordanischen dinar|د.ا|jod"), - ("Kuwaiti dinar", "kuwait-dinar|kwd|د.ك"), - ("Libyan dinar", "libyscher dinar|libysche dinar|libyschen dinar|lyd"), - ("Serbian dinar", "serbischer dinar|serbische dinar|serbischen dinar|din.|rsd|дин."), - ("Tunisian dinar", "tunesischer dinar|tunesische dinar|tunesischen dinar|tnd"), - ("Yugoslav dinar", "jugoslawischer dinar|jugoslawische dinar|jugoslawischen dinar|yun"), - ("Dinar", "dinar|denar"), - ("Fils", "fils|fulūs"), - ("Para", "para|napa"), - ("Millime", "millime"), - ("Argentine peso", "argentinischer peso|argentinische peso|argentinischen peso|ars"), - ("Chilean peso", "chilenischer peso|chilenische peso|chilenischen peso|clp"), - ("Colombian peso", "kolumbianischer peso|kolumbianische peso|kolumbianischen peso|cop"), - ("Cuban convertible peso", "kubanischer peso convertible|kubanische peso convertible|kubanischen peso convertible|peso convertible|cuc"), - ("Cuban peso", "kubanischer peso|kubanische peso|kubanischen peso|cup"), - ("Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"), - ("Mexican peso", "mexikanischer peso|mexikanische peso|mexikanischen peso|mxn"), - ("Philippine peso", "piso|philippinischer peso|philippinische peso|philippinischen peso|₱|php"), - ("Uruguayan peso", "uruguayischer peso|uruguayische peso|uruguayischen peso|uyu"), - ("Peso", "peso|pesos"), - ("Centavo", "centavos|centavo"), - ("Alderney pound", "alderney pfund|alderney £"), - ("British pound", "britischer pfund|britische pfund|britischen pfund|british £|gbp|pfund sterling"), - ("Guernsey pound", "guernsey-pfund|guernsey £|ggp"), - ("Ascension pound", "ascension-pfund|ascension pound|ascension £"), - ("Saint Helena pound", "st.-helena-pfund|saint helena £|shp"), - ("Egyptian pound", "ägyptisches pfund|ägyptische pfund|ägyptischen pfund|ägyptisches £|egp|ج.م"), - ("Falkland Islands pound", "falkland-pfund|falkland £|fkp|falkland-£"), - ("Gibraltar pound", "gibraltar-pfund|gibraltar £|gibraltar-£|gip"), - ("Manx pound", "isle-of-man-pfund|isle-of-man-£|imp"), - ("Jersey pound", "jersey-pfund|jersey-£|jep"), - ("Lebanese pound", "libanesisches pfund|libanesische pfund|libanesischen pfund|libanesisches-£|lbp|ل.ل"), - ("South Georgia and the South Sandwich Islands pound", "süd-georgien & die südlichen sandwichinseln pfund|süd-georgien & die südlichen sandwichinseln £"), - ("South Sudanese pound", "südsudanesisches pfund|südsudanesische pfund|südsudanesischen pfund|südsudanesisches £|ssp|südsudanesische £"), - ("Sudanese pound", "sudanesisches pfund|sudanesische pfund|sudanesischen pfund|sudanesisches £|ج.س.|sdg|sudanesische £"), - ("Syrian pound", "syrisches pfund|syrische pfund|syrischen pfund|syrisches £|ل.س|syp|syrische £"), - ("Tristan da Cunha pound", "tristan-da-cunha-pfund|tristan-da-cunha-£"), - ("Pound", "pfund|£"), - ("Pence", "pence"), - ("Shilling", "shillings|shilling|shilingi|sh"), - ("Penny", "pennies|penny"), - ("United States dollar", "us-dollar|us$|usd|amerikanischer dollar|amerikanische dollar|amerikanischen dollar"), - ("East Caribbean dollar", "ostkaribischer dollar|ostkaribische dollar|ostkaribischen dollar|ostkaribische $|xcd"), - ("Australian dollar", "australischer dollar|australische dollar|australischen dollar|australische $|aud"), - ("Bahamian dollar", "bahama-dollar|bahama-$|bsd"), - ("Barbadian dollar", "barbados-dollar|barbados-$|bbd"), - ("Belize dollar", "belize-dollar|belize-$|bzd"), - ("Bermudian dollar", "bermuda-dollar|bermuda-$|bmd"), - ("British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"), - ("Brunei dollar", "brunei-dollar|brunei $|bnd"), - ("Sen", "sen"), - ("Singapore dollar", "singapur-dollar|singapur-$|s$|sgd"), - ("Canadian dollar", "kanadischer dollar|kanadische dollar|kanadischen dollar|cad|can$|c$"), - ("Cayman Islands dollar", "kaiman-dollar|kaiman-$|kyd|ci$"), - ("New Zealand dollar", "neuseeland-dollar|neuseeland-$|nz$|nzd|kiwi"), - ("Cook Islands dollar", "cookinseln-dollar|cookinseln-$"), - ("Fijian dollar", "fidschi-dollar|fidschi-$|fjd"), - ("Guyanese dollar", "guyana-dollar|gyd|gy$"), - ("Hong Kong dollar", "hongkong-dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"), - ("Jamaican dollar", "jamaika-dollar|jamaika-$|j$"), - ("Kiribati dollar", "kiribati-dollar|kiribati-$"), - ("Liberian dollar", "liberianischer dollar|liberianische dollar|liberianischen dollar|liberianische $|lrd"), - ("Micronesian dollar", "mikronesischer dollar|mikronesische dollar|mikronesischen dollar|mikronesische $"), - ("Namibian dollar", "namibia-dollar|namibia-$|nad|n$"), - ("Nauruan dollar", "nauru-dollar|nauru-$"), - ("Niue dollar", "niue-dollar|niue-$"), - ("Palauan dollar", "palau-dollar|palau-$"), - ("Pitcairn Islands dollar", "pitcairninseln-dollar|pitcairninseln-$"), - ("Solomon Islands dollar", "salomonen-dollar|salomonen-$|si$|sbd"), - ("Surinamese dollar", "suriname-dollar|suriname-$|srd"), - ("New Taiwan dollar", "neuer taiwan-dollar|neue taiwan-dollar|neuen taiwan-dollar|nt$|twd|ntd"), - ("Trinidad and Tobago dollar", "trinidad-und-tobago-dollar|trinidad-und-tobago-$|ttd"), - ("Tuvaluan dollar", "tuvaluischer dollar|tuvaluische dollar|tuvaluischen dollar|tuvaluische $"), - ("Dollar", "dollar|$"), - ("Chinese yuan", "yuan|chinesischer yuan|chinesische yuan|chinesischen yuan|renminbi|cny|rmb|¥"), - ("Fen", "fen"), - ("Jiao", "jiao"), - ("Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka|finnische mark|finnischen mark"), - ("Penni", "penniä|penni"), - ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), - ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins")]) - CurrencyNameToIsoCodeMap = dict([("Afghan afghani", "AFN"), - ("Euro", "EUR"), - ("Albanian lek", "ALL"), - ("Angolan kwanza", "AOA"), - ("Armenian dram", "AMD"), - ("Aruban florin", "AWG"), - ("Bangladeshi taka", "BDT"), - ("Bhutanese ngultrum", "BTN"), - ("Bolivian boliviano", "BOB"), - ("Bosnia and Herzegovina convertible mark", "BAM"), - ("Botswana pula", "BWP"), - ("Brazilian real", "BRL"), - ("Bulgarian lev", "BGN"), - ("Cambodian riel", "KHR"), - ("Cape Verdean escudo", "CVE"), - ("Costa Rican colón", "CRC"), - ("Croatian kuna", "HRK"), - ("Czech koruna", "CZK"), - ("Eritrean nakfa", "ERN"), - ("Ethiopian birr", "ETB"), - ("Gambian dalasi", "GMD"), - ("Georgian lari", "GEL"), - ("Ghanaian cedi", "GHS"), - ("Guatemalan quetzal", "GTQ"), - ("Haitian gourde", "HTG"), - ("Honduran lempira", "HNL"), - ("Hungarian forint", "HUF"), - ("Iranian rial", "IRR"), - ("Yemeni rial", "YER"), - ("Israeli new shekel", "ILS"), - ("Japanese yen", "JPY"), - ("Kazakhstani tenge", "KZT"), - ("Kenyan shilling", "KES"), - ("North Korean won", "KPW"), - ("South Korean won", "KRW"), - ("Kyrgyzstani som", "KGS"), - ("Lao kip", "LAK"), - ("Lesotho loti", "LSL"), - ("South African rand", "ZAR"), - ("Macanese pataca", "MOP"), - ("Macedonian denar", "MKD"), - ("Malagasy ariary", "MGA"), - ("Malawian kwacha", "MWK"), - ("Malaysian ringgit", "MYR"), - ("Mauritanian ouguiya", "MRO"), - ("Mongolian tögrög", "MNT"), - ("Mozambican metical", "MZN"), - ("Burmese kyat", "MMK"), - ("Nicaraguan córdoba", "NIO"), - ("Nigerian naira", "NGN"), - ("Turkish lira", "TRY"), - ("Omani rial", "OMR"), - ("Panamanian balboa", "PAB"), - ("Papua New Guinean kina", "PGK"), - ("Paraguayan guaraní", "PYG"), - ("Peruvian sol", "PEN"), - ("Polish złoty", "PLN"), - ("Qatari riyal", "QAR"), - ("Saudi riyal", "SAR"), - ("Samoan tālā", "WST"), - ("São Tomé and Príncipe dobra", "STN"), - ("Sierra Leonean leone", "SLL"), - ("Swazi lilangeni", "SZL"), - ("Tajikistani somoni", "TJS"), - ("Thai baht", "THB"), - ("Ukrainian hryvnia", "UAH"), - ("Vanuatu vatu", "VUV"), - ("Venezuelan bolívar", "VEF"), - ("Zambian kwacha", "ZMW"), - ("Moroccan dirham", "MAD"), - ("United Arab Emirates dirham", "AED"), - ("Azerbaijani manat", "AZN"), - ("Turkmenistan manat", "TMT"), - ("Somali shilling", "SOS"), - ("Tanzanian shilling", "TZS"), - ("Ugandan shilling", "UGX"), - ("Romanian leu", "RON"), - ("Moldovan leu", "MDL"), - ("Nepalese rupee", "NPR"), - ("Pakistani rupee", "PKR"), - ("Indian rupee", "INR"), - ("Seychellois rupee", "SCR"), - ("Mauritian rupee", "MUR"), - ("Maldivian rufiyaa", "MVR"), - ("Sri Lankan rupee", "LKR"), - ("Indonesian rupiah", "IDR"), - ("Danish krone", "DKK"), - ("Norwegian krone", "NOK"), - ("Icelandic króna", "ISK"), - ("Swedish krona", "SEK"), - ("West African CFA franc", "XOF"), - ("Central African CFA franc", "XAF"), - ("Comorian franc", "KMF"), - ("Congolese franc", "CDF"), - ("Burundian franc", "BIF"), - ("Djiboutian franc", "DJF"), - ("CFP franc", "XPF"), - ("Guinean franc", "GNF"), - ("Swiss franc", "CHF"), - ("Rwandan franc", "RWF"), - ("Russian ruble", "RUB"), - ("Transnistrian ruble", "PRB"), - ("New Belarusian ruble", "BYN"), - ("Algerian dinar", "DZD"), - ("Bahraini dinar", "BHD"), - ("Iraqi dinar", "IQD"), - ("Jordanian dinar", "JOD"), - ("Kuwaiti dinar", "KWD"), - ("Libyan dinar", "LYD"), - ("Serbian dinar", "RSD"), - ("Tunisian dinar", "TND"), - ("Argentine peso", "ARS"), - ("Chilean peso", "CLP"), - ("Colombian peso", "COP"), - ("Cuban convertible peso", "CUC"), - ("Cuban peso", "CUP"), - ("Dominican peso", "DOP"), - ("Mexican peso", "MXN"), - ("Uruguayan peso", "UYU"), - ("British pound", "GBP"), - ("Saint Helena pound", "SHP"), - ("Egyptian pound", "EGP"), - ("Falkland Islands pound", "FKP"), - ("Gibraltar pound", "GIP"), - ("Manx pound", "IMP"), - ("Jersey pound", "JEP"), - ("Lebanese pound", "LBP"), - ("South Sudanese pound", "SSP"), - ("Sudanese pound", "SDG"), - ("Syrian pound", "SYP"), - ("United States dollar", "USD"), - ("Australian dollar", "AUD"), - ("Bahamian dollar", "BSD"), - ("Barbadian dollar", "BBD"), - ("Belize dollar", "BZD"), - ("Bermudian dollar", "BMD"), - ("Brunei dollar", "BND"), - ("Singapore dollar", "SGD"), - ("Canadian dollar", "CAD"), - ("Cayman Islands dollar", "KYD"), - ("New Zealand dollar", "NZD"), - ("Fijian dollar", "FJD"), - ("Guyanese dollar", "GYD"), - ("Hong Kong dollar", "HKD"), - ("Jamaican dollar", "JMD"), - ("Liberian dollar", "LRD"), - ("Namibian dollar", "NAD"), - ("Solomon Islands dollar", "SBD"), - ("Surinamese dollar", "SRD"), - ("New Taiwan dollar", "TWD"), - ("Trinidad and Tobago dollar", "TTD"), - ("Tuvaluan dollar", "TVD"), - ("Chinese yuan", "CNY"), - ("Rial", "__RI"), - ("Shiling", "__S"), - ("Som", "__SO"), - ("Dirham", "__DR"), - ("Dinar", "_DN"), - ("Dollar", "__D"), - ("Manat", "__MA"), - ("Rupee", "__R"), - ("Krone", "__K"), - ("Krona", "__K"), - ("Crown", "__K"), - ("Frank", "__F"), - ("Mark", "__M"), - ("Ruble", "__RB"), - ("Peso", "__PE"), - ("Pound", "__P"), - ("Tristan da Cunha pound", "_TP"), - ("South Georgia and the South Sandwich Islands pound", "_SP"), - ("Somaliland shilling", "_SS"), - ("Pitcairn Islands dollar", "_PND"), - ("Palauan dollar", "_PD"), - ("Niue dollar", "_NID"), - ("Nauruan dollar", "_ND"), - ("Micronesian dollar", "_MD"), - ("Kiribati dollar", "_KID"), - ("Guernsey pound", "_GGP"), - ("Faroese króna", "_FOK"), - ("Cook Islands dollar", "_CKD"), - ("British Virgin Islands dollar", "_BD"), - ("Ascension pound", "_AP"), - ("Alderney pound", "_ALP"), - ("Abkhazian apsar", "_AA"), - ("Bitcoin", "_XBT")]) - FractionalUnitNameToCodeMap = dict([("Jiao", "JIAO"), - ("Kopek", "KOPEK"), - ("Pul", "PUL"), - ("Cent", "CENT"), - ("Qindarkë", "QINDARKE"), - ("Penny", "PENNY"), - ("Santeem", "SANTEEM"), - ("Cêntimo", "CENTIMO"), - ("Centavo", "CENTAVO"), - ("Luma", "LUMA"), - ("Qəpik", "QƏPIK"), - ("Fils", "FILS"), - ("Poisha", "POISHA"), - ("Kapyeyka", "KAPYEYKA"), - ("Centime", "CENTIME"), - ("Chetrum", "CHETRUM"), - ("Paisa", "PAISA"), - ("Fening", "FENING"), - ("Thebe", "THEBE"), - ("Sen", "SEN"), - ("Stotinka", "STOTINKA"), - ("Fen", "FEN"), - ("Céntimo", "CENTIMO"), - ("Lipa", "LIPA"), - ("Haléř", "HALER"), - ("Øre", "ØRE"), - ("Piastre", "PIASTRE"), - ("Santim", "SANTIM"), - ("Oyra", "OYRA"), - ("Butut", "BUTUT"), - ("Tetri", "TETRI"), - ("Pesewa", "PESEWA"), - ("Fillér", "FILLER"), - ("Eyrir", "EYRIR"), - ("Dinar", "DINAR"), - ("Agora", "AGORA"), - ("Tïın", "TIIN"), - ("Chon", "CHON"), - ("Jeon", "JEON"), - ("Tyiyn", "TYIYN"), - ("Att", "ATT"), - ("Sente", "SENTE"), - ("Dirham", "DIRHAM"), - ("Rappen", "RAPPEN"), - ("Avo", "AVO"), - ("Deni", "DENI"), - ("Iraimbilanja", "IRAIMBILANJA"), - ("Tambala", "TAMBALA"), - ("Laari", "LAARI"), - ("Khoums", "KHOUMS"), - ("Ban", "BAN"), - ("Möngö", "MONGO"), - ("Pya", "PYA"), - ("Kobo", "KOBO"), - ("Kuruş", "KURUS"), - ("Baisa", "BAISA"), - ("Centésimo", "CENTESIMO"), - ("Toea", "TOEA"), - ("Sentimo", "SENTIMO"), - ("Grosz", "GROSZ"), - ("Sene", "SENE"), - ("Halala", "HALALA"), - ("Para", "PARA"), - ("Öre", "ORE"), - ("Diram", "DIRAM"), - ("Satang", "SATANG"), - ("Seniti", "SENITI"), - ("Millime", "MILLIME"), - ("Tennesi", "TENNESI"), - ("Kopiyka", "KOPIYKA"), - ("Tiyin", "TIYIN"), - ("Hào", "HAO"), - ("Ngwee", "NGWEE"), - ("Millibitcoin", "MILLIBITCOIN"), - ("Satoshi", "SATOSHI")]) - CompoundUnitConnectorRegex = f'(?und)' - CurrencyPrefixList = dict([("Dollar", "$"), - ("United States dollar", "united states $|us$|us $|u.s. $|u.s $"), - ("East Caribbean dollar", "east caribbean $"), - ("Australian dollar", "australian $|australia $"), - ("Bahamian dollar", "bahamian $|bahamia $"), - ("Barbadian dollar", "barbadian $|barbadin $"), - ("Belize dollar", "belize $"), - ("Bermudian dollar", "bermudian $"), - ("British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"), - ("Brunei dollar", "brunei $|b$"), - ("Sen", "sen"), - ("Singapore dollar", "singapore $|s$"), - ("Canadian dollar", "canadian $|can$|c$|c $|canada $"), - ("Cayman Islands dollar", "cayman islands $|ci$|cayman island $"), - ("New Zealand dollar", "new zealand $|nz$|nz $"), - ("Cook Islands dollar", "cook islands $|cook island $"), - ("Fijian dollar", "fijian $|fiji $"), - ("Guyanese dollar", "gy$|gy $|g$|g $"), - ("Hong Kong dollar", "hong kong $|hk$|hkd|hk $"), - ("Jamaican dollar", "jamaican $|j$|jamaica $"), - ("Kiribati dollar", "kiribati $"), - ("Liberian dollar", "liberian $|liberia $"), - ("Micronesian dollar", "micronesian $"), - ("Namibian dollar", "namibian $|nad|n$|namibia $"), - ("Nauruan dollar", "nauruan $"), - ("Niue dollar", "niue $"), - ("Palauan dollar", "palauan $"), - ("Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"), - ("Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"), - ("Surinamese dollar", "surinamese $|surinam $"), - ("New Taiwan dollar", "nt$|nt $"), - ("Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"), - ("Tuvaluan dollar", "tuvaluan $"), - ("Samoan tālā", "ws$"), - ("Chinese yuan", "¥"), - ("Japanese yen", "¥"), - ("Euro", "€"), - ("Pound", "£"), - ("Costa Rican colón", "₡"), - ("Turkish lira", "₺"), - ("Bitcoin", "₿|btc|xbt")]) - AmbiguousCurrencyUnitList = [r'din.', r'kiwi', r'kina', r'kobo', r'lari', r'lipa', r'napa', r'para', r'sfr.', r'taka', r'tala', r'toea', r'vatu', r'yuan', r'ang', r'ban', r'bob', r'btn', r'byr', r'cad', r'cop', r'cup', r'dop', r'gip', r'jod', r'kgs', r'lak', r'lei', r'mga', r'mop', r'nad', r'omr', r'pul', r'sar', r'sbd', r'scr', r'sdg', r'sek', r'sen', r'sol', r'sos', r'std', r'try', r'yer', r'yen'] - InformationSuffixList = dict([("Bit", "-bit|bit|bits"), - ("Kilobit", "kilobit|kilobits|kb|kbit"), - ("Megabit", "megabit|megabits|Mb|Mbit"), - ("Gigabit", "gigabit|gigabits|Gb|Gbit"), - ("Terabit", "terabit|terabits|Tb|Tbit"), - ("Petabit", "petabit|petabits|Pb|Pbit"), - ("Byte", "byte|bytes"), - ("Kilobyte", "kilobyte|kB|kilobytes|kilo byte|kilo bytes|kByte"), - ("Megabyte", "megabyte|mB|megabytes|mega byte|mega bytes|MByte"), - ("Gigabyte", "gigabyte|gB|gigabytes|giga byte|giga bytes|GByte"), - ("Terabyte", "terabyte|tB|terabytes|tera byte|tera bytes|TByte"), - ("Petabyte", "petabyte|pB|petabytes|peta byte|peta bytes|PByte")]) - AmbiguousDimensionUnitList = [r'barrel', r'grain', r'gran', r'grän', r'korn', r'pfund', r'stone', r'yard', r'cord', r'dram', r'fuß', r'gill', r'knoten', r'peck', r'cup', r'fps', r'pts', r'in', r'"'] - BuildPrefix = f'(?<=(\\s|^))' - BuildSuffix = f'(?=(\\s|\\W|$))' + CurrencySuffixList = dict( + [ + ("Abkhazian apsar", "abkhazian apsar|apsars"), + ("Afghan afghani", "afghanischer afghani|afghanische afghani|afghanischen afghani|؋|afn|afghani"), + ("Pul", "pul"), + ("Euro", "euro|€|eur"), + ("Cent", "cent|-cent"), + ("Albanian lek", "albaninischer Lek|albanische Lek|albanischen Lek"), + ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), + ("Angolan kwanza", "angolanischer kwanza|angolanische kwanza|angolanischen kwanza|kz|aoa|kwanza|kwanzas"), + ("Armenian dram", "armeninischer dram|armeninische dram|armeninischen dram"), + ("Aruban florin", "Aruba-Florin|ƒ|awg"), + ( + "Bangladeshi taka", + "bangladesischer taka|bengalischer taka|bangladesische taka|bengalische taka|bangladesischen taka|bengalischen taka|৳|bdt|taka", + ), + ("Paisa", "poisha|paisa"), + ("Bhutanese ngultrum", "bhutanischer ngultrum|bhutanische ngultrum|bhutanischen ngultrum|nu.|btn"), + ("Chetrum", "chetrum"), + ( + "Bolivian boliviano", + "bolivianischer boliviano|bolivianische boliviano|bolivianischen boliviano|bob|bs.|boliviano", + ), + ( + "Bosnia and Herzegovina convertible mark", + "bosnischer konvertible mark|bosnisch-herzegowinischer konvertible mark|bosnische konvertible mark|bosnisch-herzegowinische konvertible mark|bosnischen konvertible mark|bosnisch-herzegowinischen konvertible mark|konvertible mark|bam", + ), + ("Fening", "Fening"), + ("Botswana pula", "botswanischer pula|botswanische pula|botswanischen pula|bwp|pula"), + ("Thebe", "thebe"), + ("Brazilian real", "brazilianischer real|brazilianische real|brazilianischen real|r$|brl|real"), + ("Bulgarian lev", "bulgarischer lew|bulgarische lew|bulgarischen lew|bgn|лв|lew"), + ("Stotinka", "stotinki|stotinka"), + ("Cambodian riel", "kambodschanischer riel|kambodschanische riel|kambodschanischen riel|khr|៛|riel"), + ("Cape Verdean escudo", "kap-verde-escudo|cve"), + ("Costa Rican colón", "costa-rica-colón|costa-rica-colon|crc|₡"), + ("Salvadoran colón", "svc|el-salvador-colón|el-salvador-colon"), + ("Céntimo", "céntimo"), + ("Croatian kuna", "kroatischer kuna|kroatische kuna|kroatischen kuna|kn|hrk|kuna"), + ("Lipa", "lipa"), + ("Czech koruna", "tschechische krone|tschechischen kronen|tschechischer kronen|czk|kč"), + ("Haléř", "haléř"), + ("Eritrean nakfa", "eritreischer nakfa|eritreische nakfa|eritreischen nakfa|nfk|ern|nakfa"), + ("Ethiopian birr", "äthiopischer birr|äthiopische birr|äthiopischen birr|etb"), + ("Gambian dalasi", "gambischer dalasi|gambische dalasi|gambischen dalasi|gmd"), + ("Butut", "bututs|butut"), + ("Georgian lari", "georgischer lari|georgische lari|georgischen lari|lari|gel|₾"), + ("Tetri", "tetri"), + ("Ghanaian cedi", "ghanaischer cedi|ghanaische cedi|ghanaischen cedi|Ghana cedi|ghs|₵|gh₵"), + ("Pesewa", "pesewas|pesewa"), + ( + "Guatemalan quetzal", + "guatemaltekischer quetzal|guatemaltekische quetzal|guatemaltekischen quetzal|gtq|quetzal", + ), + ("Haitian gourde", "haitianischer gourde|haitianische gourde|haitianischen gourde|htg"), + ("Honduran lempira", "honduranischer lempira|honduranische lempira|honduranischen lempira|hnl"), + ("Hungarian forint", "ungarischer forint|ungarische forint|ungarischen forint|huf|ft|forint"), + ("Fillér", "fillér"), + ("Iranian rial", "iranischer rial|iranische rial|iranischen rial|irr"), + ("Yemeni rial", "jemen-rial|yer"), + ("Israeli new shekel", "₪|ils|agora"), + ("Lithuanian litas", "ltl|litauischer litas|litauische litas|litauischen litas"), + ("Japanese yen", "japaneser yen|japanese yen|japanesen yen|jpy|yen|¥"), + ("Kazakhstani tenge", "kasachischer tenge|kasachische tenge|kasachischen tenge|kzt"), + ("Kenyan shilling", "kenia-schilling|kes"), + ("North Korean won", "nordkoreanischer won|nordkoreanische won|nordkoreanischen won|kpw"), + ("South Korean won", "südkoreanischer won|südkoreanische won|südkoreanischen won|krw"), + ("Korean won", "koreanischer won|koreanische won|koreanischen won|₩"), + ("Kyrgyzstani som", "kirgisischer som|kirgisische som|kirgisischen som|kgs"), + ( + "Uzbekitan som", + "usbekischer som|usbekische som|usbekischen som|usbekischer sum|usbekische sum|usbekischen sum|usbekischer so'm|usbekische so'm|usbekischen so'm|usbekischer soum|usbekische soum|usbekischen soum|uzs", + ), + ("Lao kip", "laotischer kip|laotische kip|laotischen kip|lak|₭n|₭"), + ("Att", "att"), + ("Lesotho loti", "lesothischer loti|lesothische loti|lesothischen loti|lsl|loti"), + ("Sente", "sente|lisente"), + ("South African rand", "südafrikanischer rand|südafrikanische rand|südafrikanischen rand|zar"), + ("Macanese pataca", "macao-pataca|mop$|mop"), + ("Avo", "avos|avo"), + ("Macedonian denar", "mazedonischer denar|mazedonische denar|mazedonischen denar|mkd|ден"), + ("Deni", "deni"), + ("Malagasy ariary", "madagassischer ariary|madagassische ariary|madagassischen ariary|ariary|mga"), + ("Iraimbilanja", "iraimbilanja"), + ("Malawian kwacha", "malawi-kwacha|mk|mwk"), + ("Tambala", "tambala"), + ("Malaysian ringgit", "malaysischer ringgit|malaysische ringgit|malaysischen ringgit|rm|myr"), + ("Mauritanian ouguiya", "mauretanischer ouguiya|mauretanische ouguiya|mauretanischen ouguiya|mro"), + ("Khoums", "khoums"), + ( + "Mongolian tögrög", + "mongolischer tögrög|mongolische tögrög|mongolischen tögrög|mongolischer tugrik|mongolische tugrik|mongolischen tugrik|mnt|₮", + ), + ("Mozambican metical", "mosambik-metical|mosambik metical|mt|mzn"), + ("Burmese kyat", "myanmar-kyat|myanmar kyat|ks|mmk"), + ("Pya", "pya"), + ( + "Nicaraguan córdoba", + "nicaraguanischer córdoba oro|nicaraguanische córdoba oro|nicaraguanischen córdoba oro|nicaraguanischer córdoba|nicaraguanische córdoba|nicaraguanischen córdoba|nio|córdoba|córdoba oro", + ), + ( + "Nigerian naira", + "nigerianischer naira|nigerianische naira|nigerianischen naira|naira|ngn|₦|nigeria naira", + ), + ("Kobo", "kobo"), + ( + "Turkish lira", + "türkischer lira|türkische lira|türkischen lira|tuerkischer lira|tuerkische lira|tuerkischen lira|try|tl", + ), + ("Kuruş", "kuruş"), + ("Omani rial", "omanischer rial|omanische rial|omanischen rial|omr|ر.ع."), + ("Panamanian balboa", "panamaischer balboa|panamaische balboa|panamaischen balboa|b/.|pab"), + ("Centesimo", "centesimo"), + ("Papua New Guinean kina", "papua-neuguinea-kina|kina|pgk"), + ("Toea", "toea"), + ("Paraguayan guaraní", "paraguayischer guaraní|paraguayische guaraní|paraguayischen guaraní|guaraní|₲|pyg"), + ("Peruvian sol", "peruanischer sol|peruanische sol|peruanischen sol|soles|sol"), + ( + "Polish złoty", + "polnischer złoty|polnische złoty|polnischen złoty|polnischer zloty|polnische zloty|polnischen zloty|zł|pln|złoty|zloty", + ), + ("Grosz", "groszy|grosz|grosze"), + ("Qatari riyal", "katar-riyal|katar riyal|qatari riyal|qar"), + ("Saudi riyal", "saudi-riyal|sar"), + ("Riyal", "riyal|﷼"), + ("Dirham", "dirham|dirhem|dirhm"), + ("Halala", "halalas|halala"), + ( + "Samoan tālā", + "samoanischer tala|samoanische tala|samoanischen tala|samoanischer tālā|samoanische tālā|samoanischen tālā|tālā|tala|ws$|samoa|wst|samoa-tālā|samoa-tala", + ), + ("Sene", "sene"), + ("São Tomé and Príncipe dobra", "são-toméischer dobra|são-toméische dobra|são-toméischen dobra|dobra|std"), + ( + "Sierra Leonean leone", + "sierra-leonischer leone|sierra-leonische leone|sierra-leonischen leone|sll|leone|le", + ), + ("Peseta", "pesetas|peseta"), + ( + "Netherlands guilder", + "florin|antillen-gulden|niederländische-antillen-gulden|antillen gulden|ang|niederländischer gulden|niederländische gulden|niederländischen gulden|gulden|fl", + ), + ("Swazi lilangeni", "swazi-lilangeni|swazi lilangeni|lilangeni|szl|swazi-emalangeni|swazi emalangeni"), + ( + "Tajikistani somoni", + "tadschikischer somoni|tadschikische somoni|tadschikischen somoni|tadschikistan-somoni|tadschikistan somoni|tajikischer somoni|tajikische somoni|tajikischen somoni|tajikistan-somoni|tajikistan somoni|tjs", + ), + ("Diram", "dirams|diram"), + ( + "Thai baht", + "thailändischer baht|thailändische baht|thailändischen baht|thailaendischer baht|thailaendische baht|thailaendischen baht|thai baht|thai-baht|฿|thb", + ), + ("Satang", "satang|satangs"), + ( + "Tongan paʻanga", + "tongaischer paʻanga|tongaische paʻanga|tongaischen paʻanga|paʻanga|tonga paʻanga|tongaischer pa'anga|tongaische pa'anga|tongaischen pa'anga|pa'anga|tonga pa'anga", + ), + ("Seniti", "seniti"), + ("Ukrainian hryvnia", "ukrainischer hrywnja|ukrainische hrywnja|ukrainischen hrywnja|hrywnja|uah|₴"), + ("Vanuatu vatu", "vanuatu-vatu|vanuatu vatu|vatu|vuv"), + ("Venezuelan bolívar", "venezolanischer bolívar|venezolanische bolívar|venezolanischen bolívar|bs.f.|vef"), + ( + "Vietnamese dong", + "vietnamesischer đồng|vietnamesische đồng|vietnamesischen đồng|vietnamesischer dong|vietnamesische dong|vietnamesischen dong|vnd|đồng", + ), + ("Zambian kwacha", "sambischer kwacha|sambische kwacha|sambischen kwacha|zk|zmw"), + ("Moroccan dirham", "marokkanischer dirham|marokkanische dirham|marokkanischen dirham|mad|د.م."), + ("United Arab Emirates dirham", "vae dirham|vae-dirham|dirham der vereinigten arabischen emirate|د.إ|aed"), + ("Azerbaijani manat", "aserbaidschan-manat|azn"), + ("Turkmenistan manat", "turkmenistan-manat|tmt"), + ("Manat", "manat|manats"), + ("Qəpik", "qəpik"), + ("Somali shilling", "somalia-schilling|sh.so.|sos"), + ("Somaliland shilling", "somaliland-schilling"), + ("Tanzanian shilling", "tansania-schilling|tsh|tzs"), + ("Ugandan shilling", "uganda-schilling|ugx"), + ( + "Romanian leu", + "rumänischer leu|rumänische leu|rumänischen leu|rumaenischer leu|rumaenische leu|rumaenischen leu|lei|ron", + ), + ("Moldovan leu", "moldauischer leu|moldauische leu|moldauischen leu|mdl|moldau leu"), + ("Leu", "leu"), + ("Ban", "bani|ban"), + ( + "Nepalese rupee", + "nepalesischer rupie|nepalesische rupie|nepalesischen rupie|nepalesische rupien|nepalesischer rupien|nepalesischen rupien|npr", + ), + ( + "Pakistani rupee", + "pakistanischer rupie|pakistanische rupie|pakistanischen rupie|pakistanischer rupien|pakistanische rupien|pakistanischen rupien|pkr", + ), + ( + "Indian rupee", + "indischer rupie|indische rupie|indischen rupie|indischer rupien|indische rupien|indischen rupien|inr|₹", + ), + ("Seychellois rupee", "seychellen-rupie|seychellen-rupien|scr|sr|sre"), + ("Mauritian rupee", "mauritius-rupie|mauritius-rupien|mur"), + ("Maldivian rufiyaa", "maledivischer rufiyaa|maledivische rufiyaa|maledivischen rufiyaa|mvr|.ރ"), + ("Sri Lankan rupee", "sri-lanka-rupie|sri-lanka-rupien|lkr|රු|ரூ"), + ("Indonesian rupiah", "indonesischer rupiah|indonesische rupiah|indonesischen rupiah|rupiah|perak|rp|idr"), + ("Rupee", "rupie|rupien|rs"), + ( + "Danish krone", + "dänische krone|dänischen krone|dänischer kronen|dänische kronen|dänischen kronen|daenische krone|daenischen krone|daenischer kronen|daenische kronen|daenischen kronen|dkk", + ), + ( + "Norwegian krone", + "norwegische krone|norwegischen krone|norwegischer kronen|norwegische kronen|norwegischen kronen|nok", + ), + ( + "Faroese króna", + "färöische króna|färöische krone|färöischen krone|färöischer kronen|färöische kronen|färöischen kronen", + ), + ( + "Icelandic króna", + "isländische krone|isländischen krone|isländischer kronen|isländische kronen|isländischen kronen|isk", + ), + ( + "Swedish krona", + "schwedische krone|schwedischen krone|schwedischer kronen|schwedische kronen|schwedischen kronen|sek", + ), + ("Krone", "krone|kronen|kr|-kr"), + ("Øre", "Øre|oyra|eyrir"), + ( + "West African CFA franc", + "west african cfa franc|xof|westafrikanische cfa franc|westafrikanische-cfa-franc", + ), + ( + "Central African CFA franc", + "central african cfa franc|xaf|zentralafrikanische cfa franc|zentralafrikanische-cfa-franc", + ), + ("Comorian franc", "komoren-franc|kmf"), + ("Congolese franc", "kongo-franc|cdf"), + ("Burundian franc", "burundi-franc|bif"), + ("Djiboutian franc", "dschibuti-franc|djf"), + ("CFP franc", "cfp-franc|xpf"), + ("Guinean franc", "franc guinéen|franc-guinéen|gnf"), + ("Swiss franc", "schweizer franken|schweizer-franken|chf|sfr."), + ("Rwandan franc", "ruanda-franc|rwf|rf|r₣|frw"), + ("Belgian franc", "belgischer franken|belgische franken|belgischen franken|bi.|b.fr.|bef"), + ("Rappen", "rappen|-rappen"), + ( + "Franc", + "franc|französischer franc|französische franc|französischen franc|französischer franken|französische franken|französischen franken|franken|fr.|fs", + ), + ("Centime", "centimes|centime|santim"), + ("Russian ruble", "russischer rubel|russische rubel|russischen rubel|₽|rub"), + ( + "New Belarusian ruble", + "neuer weißrussischer rubel|neue weißrussische rubel|neuen weißrussischen rubel|neuem weißrussischen rubel", + ), + ( + "Old Belarusian ruble", + "alter weißrussischer rubel|alte weißrussische rubel|alten weißrussischen rubel|altem weißrussischen rubel", + ), + ("Transnistrian ruble", "transnistrischer rubel|transnistrische rubel|transnistrischen rubel|prb|р."), + ("Belarusian ruble", "weißrussischer rubel|weißrussische rubel|weißrussischen rubel"), + ("Kopek", "kopek|kopeks"), + ("Kapyeyka", "kapyeyka"), + ("Ruble", "rubel|br"), + ("Algerian dinar", "algerischer dinar|algerische dinar|algerischen dinar|د.ج|dzd"), + ("Bahraini dinar", "bahrain-dinar|bhd|.د.ب"), + ("Santeem", "santeem|santeeme"), + ("Iraqi dinar", "irakischer dinar|irakische dinar|irakischen dinar|iqd|ع.د"), + ("Jordanian dinar", "jordanischer dinar|jordanische dinar|jordanischen dinar|د.ا|jod"), + ("Kuwaiti dinar", "kuwait-dinar|kwd|د.ك"), + ("Libyan dinar", "libyscher dinar|libysche dinar|libyschen dinar|lyd"), + ("Serbian dinar", "serbischer dinar|serbische dinar|serbischen dinar|din.|rsd|дин."), + ("Tunisian dinar", "tunesischer dinar|tunesische dinar|tunesischen dinar|tnd"), + ("Yugoslav dinar", "jugoslawischer dinar|jugoslawische dinar|jugoslawischen dinar|yun"), + ("Dinar", "dinar|denar"), + ("Fils", "fils|fulūs"), + ("Para", "para|napa"), + ("Millime", "millime"), + ("Argentine peso", "argentinischer peso|argentinische peso|argentinischen peso|ars"), + ("Chilean peso", "chilenischer peso|chilenische peso|chilenischen peso|clp"), + ("Colombian peso", "kolumbianischer peso|kolumbianische peso|kolumbianischen peso|cop"), + ( + "Cuban convertible peso", + "kubanischer peso convertible|kubanische peso convertible|kubanischen peso convertible|peso convertible|cuc", + ), + ("Cuban peso", "kubanischer peso|kubanische peso|kubanischen peso|cup"), + ("Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"), + ("Mexican peso", "mexikanischer peso|mexikanische peso|mexikanischen peso|mxn"), + ("Philippine peso", "piso|philippinischer peso|philippinische peso|philippinischen peso|₱|php"), + ("Uruguayan peso", "uruguayischer peso|uruguayische peso|uruguayischen peso|uyu"), + ("Peso", "peso|pesos"), + ("Centavo", "centavos|centavo"), + ("Alderney pound", "alderney pfund|alderney £"), + ("British pound", "britischer pfund|britische pfund|britischen pfund|british £|gbp|pfund sterling"), + ("Guernsey pound", "guernsey-pfund|guernsey £|ggp"), + ("Ascension pound", "ascension-pfund|ascension pound|ascension £"), + ("Saint Helena pound", "st.-helena-pfund|saint helena £|shp"), + ("Egyptian pound", "ägyptisches pfund|ägyptische pfund|ägyptischen pfund|ägyptisches £|egp|ج.م"), + ("Falkland Islands pound", "falkland-pfund|falkland £|fkp|falkland-£"), + ("Gibraltar pound", "gibraltar-pfund|gibraltar £|gibraltar-£|gip"), + ("Manx pound", "isle-of-man-pfund|isle-of-man-£|imp"), + ("Jersey pound", "jersey-pfund|jersey-£|jep"), + ("Lebanese pound", "libanesisches pfund|libanesische pfund|libanesischen pfund|libanesisches-£|lbp|ل.ل"), + ( + "South Georgia and the South Sandwich Islands pound", + "süd-georgien & die südlichen sandwichinseln pfund|süd-georgien & die südlichen sandwichinseln £", + ), + ( + "South Sudanese pound", + "südsudanesisches pfund|südsudanesische pfund|südsudanesischen pfund|südsudanesisches £|ssp|südsudanesische £", + ), + ( + "Sudanese pound", + "sudanesisches pfund|sudanesische pfund|sudanesischen pfund|sudanesisches £|ج.س.|sdg|sudanesische £", + ), + ("Syrian pound", "syrisches pfund|syrische pfund|syrischen pfund|syrisches £|ل.س|syp|syrische £"), + ("Tristan da Cunha pound", "tristan-da-cunha-pfund|tristan-da-cunha-£"), + ("Pound", "pfund|£"), + ("Pence", "pence"), + ("Shilling", "shillings|shilling|shilingi|sh"), + ("Penny", "pennies|penny"), + ( + "United States dollar", + "us-dollar|us$|usd|amerikanischer dollar|amerikanische dollar|amerikanischen dollar", + ), + ( + "East Caribbean dollar", + "ostkaribischer dollar|ostkaribische dollar|ostkaribischen dollar|ostkaribische $|xcd", + ), + ("Australian dollar", "australischer dollar|australische dollar|australischen dollar|australische $|aud"), + ("Bahamian dollar", "bahama-dollar|bahama-$|bsd"), + ("Barbadian dollar", "barbados-dollar|barbados-$|bbd"), + ("Belize dollar", "belize-dollar|belize-$|bzd"), + ("Bermudian dollar", "bermuda-dollar|bermuda-$|bmd"), + ( + "British Virgin Islands dollar", + "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $", + ), + ("Brunei dollar", "brunei-dollar|brunei $|bnd"), + ("Sen", "sen"), + ("Singapore dollar", "singapur-dollar|singapur-$|s$|sgd"), + ("Canadian dollar", "kanadischer dollar|kanadische dollar|kanadischen dollar|cad|can$|c$"), + ("Cayman Islands dollar", "kaiman-dollar|kaiman-$|kyd|ci$"), + ("New Zealand dollar", "neuseeland-dollar|neuseeland-$|nz$|nzd|kiwi"), + ("Cook Islands dollar", "cookinseln-dollar|cookinseln-$"), + ("Fijian dollar", "fidschi-dollar|fidschi-$|fjd"), + ("Guyanese dollar", "guyana-dollar|gyd|gy$"), + ("Hong Kong dollar", "hongkong-dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"), + ("Jamaican dollar", "jamaika-dollar|jamaika-$|j$"), + ("Kiribati dollar", "kiribati-dollar|kiribati-$"), + ("Liberian dollar", "liberianischer dollar|liberianische dollar|liberianischen dollar|liberianische $|lrd"), + ("Micronesian dollar", "mikronesischer dollar|mikronesische dollar|mikronesischen dollar|mikronesische $"), + ("Namibian dollar", "namibia-dollar|namibia-$|nad|n$"), + ("Nauruan dollar", "nauru-dollar|nauru-$"), + ("Niue dollar", "niue-dollar|niue-$"), + ("Palauan dollar", "palau-dollar|palau-$"), + ("Pitcairn Islands dollar", "pitcairninseln-dollar|pitcairninseln-$"), + ("Solomon Islands dollar", "salomonen-dollar|salomonen-$|si$|sbd"), + ("Surinamese dollar", "suriname-dollar|suriname-$|srd"), + ("New Taiwan dollar", "neuer taiwan-dollar|neue taiwan-dollar|neuen taiwan-dollar|nt$|twd|ntd"), + ("Trinidad and Tobago dollar", "trinidad-und-tobago-dollar|trinidad-und-tobago-$|ttd"), + ("Tuvaluan dollar", "tuvaluischer dollar|tuvaluische dollar|tuvaluischen dollar|tuvaluische $"), + ("Dollar", "dollar|$"), + ("Chinese yuan", "yuan|chinesischer yuan|chinesische yuan|chinesischen yuan|renminbi|cny|rmb|¥"), + ("Fen", "fen"), + ("Jiao", "jiao"), + ( + "Finnish markka", + "suomen markka|finnish markka|finsk mark|fim|markkaa|markka|finnische mark|finnischen mark", + ), + ("Penni", "penniä|penni"), + ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), + ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afghan afghani", "AFN"), + ("Euro", "EUR"), + ("Albanian lek", "ALL"), + ("Angolan kwanza", "AOA"), + ("Armenian dram", "AMD"), + ("Aruban florin", "AWG"), + ("Bangladeshi taka", "BDT"), + ("Bhutanese ngultrum", "BTN"), + ("Bolivian boliviano", "BOB"), + ("Bosnia and Herzegovina convertible mark", "BAM"), + ("Botswana pula", "BWP"), + ("Brazilian real", "BRL"), + ("Bulgarian lev", "BGN"), + ("Cambodian riel", "KHR"), + ("Cape Verdean escudo", "CVE"), + ("Costa Rican colón", "CRC"), + ("Croatian kuna", "HRK"), + ("Czech koruna", "CZK"), + ("Eritrean nakfa", "ERN"), + ("Ethiopian birr", "ETB"), + ("Gambian dalasi", "GMD"), + ("Georgian lari", "GEL"), + ("Ghanaian cedi", "GHS"), + ("Guatemalan quetzal", "GTQ"), + ("Haitian gourde", "HTG"), + ("Honduran lempira", "HNL"), + ("Hungarian forint", "HUF"), + ("Iranian rial", "IRR"), + ("Yemeni rial", "YER"), + ("Israeli new shekel", "ILS"), + ("Japanese yen", "JPY"), + ("Kazakhstani tenge", "KZT"), + ("Kenyan shilling", "KES"), + ("North Korean won", "KPW"), + ("South Korean won", "KRW"), + ("Kyrgyzstani som", "KGS"), + ("Lao kip", "LAK"), + ("Lesotho loti", "LSL"), + ("South African rand", "ZAR"), + ("Macanese pataca", "MOP"), + ("Macedonian denar", "MKD"), + ("Malagasy ariary", "MGA"), + ("Malawian kwacha", "MWK"), + ("Malaysian ringgit", "MYR"), + ("Mauritanian ouguiya", "MRO"), + ("Mongolian tögrög", "MNT"), + ("Mozambican metical", "MZN"), + ("Burmese kyat", "MMK"), + ("Nicaraguan córdoba", "NIO"), + ("Nigerian naira", "NGN"), + ("Turkish lira", "TRY"), + ("Omani rial", "OMR"), + ("Panamanian balboa", "PAB"), + ("Papua New Guinean kina", "PGK"), + ("Paraguayan guaraní", "PYG"), + ("Peruvian sol", "PEN"), + ("Polish złoty", "PLN"), + ("Qatari riyal", "QAR"), + ("Saudi riyal", "SAR"), + ("Samoan tālā", "WST"), + ("São Tomé and Príncipe dobra", "STN"), + ("Sierra Leonean leone", "SLL"), + ("Swazi lilangeni", "SZL"), + ("Tajikistani somoni", "TJS"), + ("Thai baht", "THB"), + ("Ukrainian hryvnia", "UAH"), + ("Vanuatu vatu", "VUV"), + ("Venezuelan bolívar", "VEF"), + ("Zambian kwacha", "ZMW"), + ("Moroccan dirham", "MAD"), + ("United Arab Emirates dirham", "AED"), + ("Azerbaijani manat", "AZN"), + ("Turkmenistan manat", "TMT"), + ("Somali shilling", "SOS"), + ("Tanzanian shilling", "TZS"), + ("Ugandan shilling", "UGX"), + ("Romanian leu", "RON"), + ("Moldovan leu", "MDL"), + ("Nepalese rupee", "NPR"), + ("Pakistani rupee", "PKR"), + ("Indian rupee", "INR"), + ("Seychellois rupee", "SCR"), + ("Mauritian rupee", "MUR"), + ("Maldivian rufiyaa", "MVR"), + ("Sri Lankan rupee", "LKR"), + ("Indonesian rupiah", "IDR"), + ("Danish krone", "DKK"), + ("Norwegian krone", "NOK"), + ("Icelandic króna", "ISK"), + ("Swedish krona", "SEK"), + ("West African CFA franc", "XOF"), + ("Central African CFA franc", "XAF"), + ("Comorian franc", "KMF"), + ("Congolese franc", "CDF"), + ("Burundian franc", "BIF"), + ("Djiboutian franc", "DJF"), + ("CFP franc", "XPF"), + ("Guinean franc", "GNF"), + ("Swiss franc", "CHF"), + ("Rwandan franc", "RWF"), + ("Russian ruble", "RUB"), + ("Transnistrian ruble", "PRB"), + ("New Belarusian ruble", "BYN"), + ("Algerian dinar", "DZD"), + ("Bahraini dinar", "BHD"), + ("Iraqi dinar", "IQD"), + ("Jordanian dinar", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Libyan dinar", "LYD"), + ("Serbian dinar", "RSD"), + ("Tunisian dinar", "TND"), + ("Argentine peso", "ARS"), + ("Chilean peso", "CLP"), + ("Colombian peso", "COP"), + ("Cuban convertible peso", "CUC"), + ("Cuban peso", "CUP"), + ("Dominican peso", "DOP"), + ("Mexican peso", "MXN"), + ("Uruguayan peso", "UYU"), + ("British pound", "GBP"), + ("Saint Helena pound", "SHP"), + ("Egyptian pound", "EGP"), + ("Falkland Islands pound", "FKP"), + ("Gibraltar pound", "GIP"), + ("Manx pound", "IMP"), + ("Jersey pound", "JEP"), + ("Lebanese pound", "LBP"), + ("South Sudanese pound", "SSP"), + ("Sudanese pound", "SDG"), + ("Syrian pound", "SYP"), + ("United States dollar", "USD"), + ("Australian dollar", "AUD"), + ("Bahamian dollar", "BSD"), + ("Barbadian dollar", "BBD"), + ("Belize dollar", "BZD"), + ("Bermudian dollar", "BMD"), + ("Brunei dollar", "BND"), + ("Singapore dollar", "SGD"), + ("Canadian dollar", "CAD"), + ("Cayman Islands dollar", "KYD"), + ("New Zealand dollar", "NZD"), + ("Fijian dollar", "FJD"), + ("Guyanese dollar", "GYD"), + ("Hong Kong dollar", "HKD"), + ("Jamaican dollar", "JMD"), + ("Liberian dollar", "LRD"), + ("Namibian dollar", "NAD"), + ("Solomon Islands dollar", "SBD"), + ("Surinamese dollar", "SRD"), + ("New Taiwan dollar", "TWD"), + ("Trinidad and Tobago dollar", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Chinese yuan", "CNY"), + ("Rial", "__RI"), + ("Shiling", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dollar", "__D"), + ("Manat", "__MA"), + ("Rupee", "__R"), + ("Krone", "__K"), + ("Krona", "__K"), + ("Crown", "__K"), + ("Frank", "__F"), + ("Mark", "__M"), + ("Ruble", "__RB"), + ("Peso", "__PE"), + ("Pound", "__P"), + ("Tristan da Cunha pound", "_TP"), + ("South Georgia and the South Sandwich Islands pound", "_SP"), + ("Somaliland shilling", "_SS"), + ("Pitcairn Islands dollar", "_PND"), + ("Palauan dollar", "_PD"), + ("Niue dollar", "_NID"), + ("Nauruan dollar", "_ND"), + ("Micronesian dollar", "_MD"), + ("Kiribati dollar", "_KID"), + ("Guernsey pound", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dollar", "_CKD"), + ("British Virgin Islands dollar", "_BD"), + ("Ascension pound", "_AP"), + ("Alderney pound", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarkë", "QINDARKE"), + ("Penny", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENTAVO"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENTIMO"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '(?und)' + CurrencyPrefixList = dict( + [ + ("Dollar", "$"), + ("United States dollar", "united states $|us$|us $|u.s. $|u.s $"), + ("East Caribbean dollar", "east caribbean $"), + ("Australian dollar", "australian $|australia $"), + ("Bahamian dollar", "bahamian $|bahamia $"), + ("Barbadian dollar", "barbadian $|barbadin $"), + ("Belize dollar", "belize $"), + ("Bermudian dollar", "bermudian $"), + ( + "British Virgin Islands dollar", + "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $", + ), + ("Brunei dollar", "brunei $|b$"), + ("Sen", "sen"), + ("Singapore dollar", "singapore $|s$"), + ("Canadian dollar", "canadian $|can$|c$|c $|canada $"), + ("Cayman Islands dollar", "cayman islands $|ci$|cayman island $"), + ("New Zealand dollar", "new zealand $|nz$|nz $"), + ("Cook Islands dollar", "cook islands $|cook island $"), + ("Fijian dollar", "fijian $|fiji $"), + ("Guyanese dollar", "gy$|gy $|g$|g $"), + ("Hong Kong dollar", "hong kong $|hk$|hkd|hk $"), + ("Jamaican dollar", "jamaican $|j$|jamaica $"), + ("Kiribati dollar", "kiribati $"), + ("Liberian dollar", "liberian $|liberia $"), + ("Micronesian dollar", "micronesian $"), + ("Namibian dollar", "namibian $|nad|n$|namibia $"), + ("Nauruan dollar", "nauruan $"), + ("Niue dollar", "niue $"), + ("Palauan dollar", "palauan $"), + ("Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"), + ("Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"), + ("Surinamese dollar", "surinamese $|surinam $"), + ("New Taiwan dollar", "nt$|nt $"), + ("Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"), + ("Tuvaluan dollar", "tuvaluan $"), + ("Samoan tālā", "ws$"), + ("Chinese yuan", "¥"), + ("Japanese yen", "¥"), + ("Euro", "€"), + ("Pound", "£"), + ("Costa Rican colón", "₡"), + ("Turkish lira", "₺"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) + AmbiguousCurrencyUnitList = [ + r'din.', + r'kiwi', + r'kina', + r'kobo', + r'lari', + r'lipa', + r'napa', + r'para', + r'sfr.', + r'taka', + r'tala', + r'toea', + r'vatu', + r'yuan', + r'ang', + r'ban', + r'bob', + r'btn', + r'byr', + r'cad', + r'cop', + r'cup', + r'dop', + r'gip', + r'jod', + r'kgs', + r'lak', + r'lei', + r'mga', + r'mop', + r'nad', + r'omr', + r'pul', + r'sar', + r'sbd', + r'scr', + r'sdg', + r'sek', + r'sen', + r'sol', + r'sos', + r'std', + r'try', + r'yer', + r'yen', + ] + BuildPrefix = '(?<=(\\s|^))' + BuildSuffix = '(?=(\\s|\\W|$))' ConnectorToken = '-' - LengthSuffixList = dict([("Kilometer", "km|kilometer|kilometern"), - ("Hectometer", "hm|hektometer|hektometern"), - ("Decameter", "dam|dekameter|dekametern"), - ("Meter", "m|meter|metern"), - ("Decimeter", "dm|dezimeter|dezimetern"), - ("Centimeter", "cm|zentimeter|centimeter|zentimetern|centimetern"), - ("Millimeter", "mm|millimeter|millimetern"), - ("Micrometer", "μm|mikrometer|mikrometern"), - ("Nanometer", "nm|nanometer|nanometern"), - ("Picometer", "pm|pikometer|picometer|pikometern|picometern"), - ("Mile", "meile|meilen"), - ("Yard", "yard|yards"), - ("Inch", "zoll|inch|in|\""), - ("Foot", "fuß|ft"), - ("Light year", "lichtjahr|lichtjahre|lichtjahren"), - ("Pt", "pt|pts")]) - AmbiguousLengthUnitList = [r'm', r'yard', r'yards', r'pm', r'pt', r'pts'] - SpeedSuffixList = dict([("Meter per second", "meter/sekunde|m/s|meter pro sekunde|metern pro sekunde"), - ("Kilometer per hour", "km/h|kilometer/stunde|kilometer pro stunde|kilometern pro stunde"), - ("Kilometer per minute", "km/min|kilometer pro minute|kilometern pro minute"), - ("Kilometer per second", "km/s|kilometer pro sekunde|kilometern pro sekunde"), - ("Mile per hour", "mph|mi/h|meilen pro stunde|meilen/stunde|meile pro stunde"), - ("Knot", "kt|knoten|kn"), - ("Foot per second", "ft/s|fuß/sekunde|fuß pro sekunde|fps"), - ("Foot per minute", "ft/min|fuß/minute|fuß pro minute"), - ("Yard per minute", "yard pro minute|yard/minute|yard/min"), - ("Yard per second", "yard pro sekunde|yard/sekunde|yard/s")]) - TemperatureSuffixList = dict([("F", "grad fahrenheit|°fahrenheit|°f|fahrenheit"), - ("K", "k|K|kelvin|grad kelvin|°kelvin|°k|°K"), - ("R", "rankine|°r"), - ("D", "delisle|°de"), - ("C", "grad celsius|°celsius|°c|celsius"), - ("Degree", "grad|°")]) - AmbiguousTemperatureUnitList = [r'c', r'f', r'k'] - VolumeSuffixList = dict([("Cubic meter", "m3|kubikmeter|m³"), - ("Cubic centimeter", "kubikzentimeter|cm³"), - ("Cubic millimiter", "kubikmillimeter|mm³"), - ("Hectoliter", "hektoliter"), - ("Decaliter", "dekaliter"), - ("Liter", "l|liter"), - ("Deciliter", "dl|deziliter"), - ("Centiliter", "cl|zentiliter"), - ("Milliliter", "ml|mls|milliliter"), - ("Cubic yard", "kubikyard"), - ("Cubic inch", "kubikzoll"), - ("Cubic foot", "kubikfuß"), - ("Cubic mile", "kubikmeile"), - ("Fluid ounce", "fl oz|flüssigunze|fluessigunze"), - ("Teaspoon", "teelöffel|teeloeffel"), - ("Tablespoon", "esslöffel|essloeffel"), - ("Pint", "pinte"), - ("Volume unit", "fluid dram|fluid drachm|flüssigdrachme|gill|quart|minim|cord|peck|beck|scheffel|hogshead|oxhoft")]) - AmbiguousVolumeUnitList = [r'l', r'unze', r'oz', r'cup', r'peck', r'cord', r'gill'] - WeightSuffixList = dict([("Kilogram", "kg|kilogramm|kilo"), - ("Gram", "g|gramm"), - ("Milligram", "mg|milligramm"), - ("Microgram", "μg|mikrogramm"), - ("Barrel", "barrel"), - ("Gallon", "gallone|gallonen"), - ("Metric ton", "metrische tonne|metrische tonnen"), - ("Ton", "tonne|tonnen"), - ("Pound", "pfund|lb"), - ("Ounce", "unze|unzen|oz|ounces"), - ("Weight unit", "pennyweight|grain|british long ton|US short hundredweight|stone|dram")]) - AmbiguousWeightUnitList = [r'g', r'oz', r'stone', r'dram'] - AngleSuffixList = dict([("Degree", "grad|°"), - ("Radian", "radiant|rad"), - ("Turn", "turn")]) - AmbiguousAngleUnitList = [r'turn'] AmbiguityFiltersDict = dict([("null", "null")]) - TemperatureAmbiguityFiltersDict = dict([("\\b(grad|°)$", "\\b((grad|°)\\s*(winkel|dreh(ung|en|t)|gedreht)|(dreh(ung|en|t)|gedreht|winkel)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(grad\\b|°))")]) - DimensionAmbiguityFiltersDict = dict([("\\b(grad|°)$", "\\b((grad|°)\\s*(c(elsius|entigrate)?|f(ah?renheit)?)|(temperatur)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(grad\\b|°))")]) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/italian_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/italian_numeric_with_unit.py index a9a591e451..1ca7f50a33 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/italian_numeric_with_unit.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/italian_numeric_with_unit.py @@ -9,663 +9,744 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_numbers import BaseNumbers + # pylint: disable=line-too-long class ItalianNumericWithUnit: - AgeSuffixList = dict([("Anno", "anni di età|anno di età|anni d'età|anno d'età|anno|anni"), - ("Mese", "mese di età|mesi di età|mese d'età|mesi d'età|mese|mesi"), - ("Settimana", "settimana di età|settimane di età|settimana d'età|settimane d'età|settimana|settimane"), - ("Giorno", "giorni di età|giorno di età|giorni d'età|giorno d'età|giorno|giorni")]) - AreaSuffixList = dict([("Chilometro quadrato", "chilometro quadrato|chilometri quadrati|km quadrato|km quadrati|chilometro quadro|chilometri quadri|km quadro|km quadri|km2|km^2|km²"), - ("Ettometro quadrato", "ettometro quadrato|ettometri quadrati|hm quadrato|hm quadrati|ettometro quadro|ettometri quadri|hm quadro|hm quadri|hm2|hm^2|hm²|ettaro|ettari"), - ("Decametro quadrato", "decametro quadrato|decametri quadrati|dam quadrato|dam quadrati|decametro quadro|decametri quadri|dam quadro|dam quadri|dam2|dam^2|dam²"), - ("Metro quadrato", "metro quadrato|metri quadrati|m quadrato|m quadrati|metro quadro|metri quadri|m quadro|m quadri|m2|m^2|m²"), - ("Decimetro quadrato", "decimetro quadrato|decimetri quadrati|dm quadrato|dm quadrati|decimetro quadro|decimetri quadri|dm quadro|dm quadri|dm2|dm^2|dm²"), - ("Centimetro quadrato", "centimetro quadrato|centimetri quadrati|cm quadrato|cm quadrati|centimetro quadro|centimetri quadri|cm quadro|cm quadri|cm2|cm^2|cm²"), - ("Millimetro quadrato", "millimetro quadrato|millimetri quadrati|mm quadrato|mm quadrati|millimetro quadro|millimetri quadri|mm quadro|mm quadri|mm2|mm^2|mm²"), - ("Pollice quadrato", "pollice quadrato|pollici quadrati|in quadrato|in quadrati|pollice quadro|pollici quadri|in quadro|in quadri|sq in|sq inch|square inch|square inches|in2|in^2|in²"), - ("Piede quadrato", "piede quadrato|piedi quadrati|ft quadrato|ft quadrati|piede quadro|piedi quadri|ft quadro|ft quadri|sqft|sq ft|sq foot|sq feet|square foot|square feet|feet2|feet^2|feet²|ft2|ft^2|ft²"), - ("Miglio quadrato", "miglio quadrato|miglia quadrata|miglia quadrate|mi quadrato|mi quadrati|mi quadrate|miglio quadro|miglia quadre|sq mi|sq mile|sqmiles|square mile|square miles|mi2|mi^2|mi²"), - ("Iarda quadrato", "iarda quadrata|iarda quadra|iarde quadrate|iarde quadre|yd2|yd^2|yd²"), - ("Acro", "acro|acri")]) - CurrencySuffixList = dict([("Abkhazian apsar", "abkhazian apsar|apsars'"), - ("Afghan afghani", "afghani|؋|afn|afghanistan"), - ("Pul", "pul"), - ("Euro", "euros|euro|€|eur"), - ("Cent", "cents|cent|centesimo|-cent|centesimi"), - ("Albanian lek", "lek albanese|lek"), - ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), - ("Angolan kwanza", "kwanza angolano|kwanza angolani|kz|aoa|kwanza"), - ("Armenian dram", "dram armenia|dram armeno|dram armeni"), - ("Aruban florin", "fiorino arubano|fiorini arubani|ƒ|awg"), - ("Bangladeshi taka", "taka bengalese|taka bengalesi|৳|bdt|taka|taka bangladesh"), - ("Paisa", "poisha|paisa"), - ("Bhutanese ngultrum", "ngultrum|nu.|btn|ngultrum butanese|ngultrum bhutanese"), - ("Chetrum", "chetrums|chetrum"), - ("Bolivian boliviano", "boliviano|bob|bs.|boliviano bolivia|boliviani"), - ("Bosnia and Herzegovina convertible mark", "marco bosniaco|marchi bosniaci|bam"), - ("Fening", "fenings|fenings"), - ("Botswana pula", "pula botswana|bwp|pula|pulas|botswana pulas"), - ("Thebe", "thebe"), - ("Brazilian real", "real brasiliano|r$|brl|real|real brasiliani"), - ("Bulgarian lev", "lev bulgaro|lev bulgari|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"), - ("Stotinka", "stotinki|stotinka"), - ("Cambodian riel", "riel|khr|៛|riel cambogiano|riel cambogiani"), - ("Cape Verdean escudo", "escudo capoverdiano|escudi capoverdiani|escudo|cve"), - ("Costa Rican colón", "colón costaricano|crc|₡|colón del costa rica|colón del costarica|colon costaricano|colon del costa rica|colon del costarica"), - ("Salvadoran colón", "svc|colón del salvador|colon del salvador|colón salvadoregno|colon salvadoregni"), - ("Céntimo", "céntimo"), - ("Croatian kuna", "kuna croata|kune croate|kn|hrk|kuna della croazia"), - ("Lipa", "lipa"), - ("Czech koruna", "corona ceca|corone ceche|czk|Kč"), - ("Haléř", "haléř"), - ("Eritrean nakfa", "nakfa eritrea|nakfa eritree|nfk|ern|nafka"), - ("Ethiopian birr", "birr|birr etiope|birr etiopi|etb"), - ("Gambian dalasi", "gmd| dalasi gambiano|dalasi gambiani|galasi del gambia"), - ("Butut", "bututs|butut"), - ("Georgian lari", "lari georgiano|lari georgiani|lari|gel|₾"), - ("Tetri", "tetri"), - ("Ghanaian cedi", "cedi|cedi del ghana|ghs|₵|gh₵"), - ("Pesewa", "pesewas|pesewa"), - ("Guatemalan quetzal", "quetzal|quetzal del guatemala|gtq|guatemala quetzal"), - ("Haitian gourde", "gourde|gourde haitiano|gourde haitiani|htg"), - ("Honduran lempira", "lempira|lempira honduregna|lempira honduregne|hnl"), - ("Hungarian forint", "forino ungherese|fiorini ungheresi|huf|ft"), - ("Fillér", "fillér"), - ("Iranian rial", "rial dell'iran|irr|rial iraniano|rial iraniani"), - ("Yemeni rial", "rial yemenita|yer|rial dello yemen|rial yemeniti"), - ("Israeli new shekel", "nuovo sicli|₪|ils|agora"), - ("Lithuanian litas", "ltl|lita della lituania"), - ("Japanese yen", "yen giapponese|jpy|yen|-yen|¥|yen giapponesi|yen giappone"), - ("Kazakhstani tenge", "tenge del kazakistan|kzt|tenge"), - ("Kenyan shilling", "scellino keniota|kes|scellini kenioti"), - ("North Korean won", "won nordcoreano|won nordcoreani|won nord coreano|won nord coreani|kpw"), - ("South Korean won", "won sudcoreano|won sudcoreani|won sud coreano|won sud coreani|krw"), - ("Korean won", "won coreano|₩|won coreani"), - ("Kyrgyzstani som", "som del kirghizistan|kgs"), - ("Uzbekitan som", "som uzbeko|som uzbeki|som dell'uzbekistan|uzs"), - ("Lao kip", "kip del laos|lak|₭n|₭"), - ("Att", "att"), - ("Lesotho loti", "loti del lesotho|lsl|loti"), - ("Sente", "sente|lisente"), - ("South African rand", "rand sudafricano|rand sud africano|rand sudafricani|rand sud africani|zar"), - ("Macanese pataca", "pataca di macau|mop$|mop"), - ("Avo", "avos|avo"), - ("Macedonian denar", "dinaro macedone|dinari macedoni|dinaro della macedonia|mkd|ден"), - ("Deni", "deni"), - ("Malagasy ariary", "ariary del madagascar|mga"), - ("Iraimbilanja", "iraimbilanja"), - ("Malawian kwacha", "kwacha del malawi|mk|mwk"), - ("Tambala", "tambala"), - ("Malaysian ringgit", "ringgit malesiano|ringgit malesiani|rm|myr|ringgit della malesia"), - ("Mauritanian ouguiya", "ouguiya della mauritania|um|mro"), - ("Khoums", "khoums"), - ("Mongolian tögrög", "tögrög mongolo|tögrög della mongolia|tögrög mongoli|mnt|₮|togrog mongolo|togrog della mongolia|togrog mongoli"), - ("Mozambican metical", "metical mozambicano|metical mozambicani|mt|mzn|metical del mozambico"), - ("Burmese kyat", "kyat birmano|kyat birmani|kyat della birmania|ks|mmk"), - ("Pya", "pya"), - ("Nicaraguan córdoba", "córdoba nicaraguense|córdoba nicaraguensi|cordoba nicaraguense|cordoba nicaraguensi|cordoba del nicaragua|nio"), - ("Nigerian naira", "naira nigeriano|naira nigeriani|naira della nigeria|naira|ngn|₦"), - ("Kobo", "kobo"), - ("Turkish lira", "lira turca|lire turche|nuova lira turca|nuove lire turche|lira della turchia|nuova lira della turchia|try|tl"), - ("Kuruş", "kuruş"), - ("Omani rial", "rial dell'oman|omr|ر.ع."), - ("Panamanian balboa", "balboa panamense|balboa panamensi|balboa del panama|b/.|pab"), - ("Papua New Guinean kina", "kina del papua nuova guinea|kina|pgk"), - ("Toea", "toea"), - ("Paraguayan guaraní", "guaraní paraguaiano|guarani paraguaiano|guaraní paraguaiani|guarani paraguaiani|guaraní del paraguay|guarani del paraguay|₲|pyg"), - ("Peruvian sol", "sol peruviano|sol peruviani|sol del peru|soles|sol|nuevo sol peruviano|nuevo sol peruviani|nuevo sol del peru|"), - ("Polish złoty", "złoty|złoty polacco|złoty polacchi|zł|pln|zloty|zloty polacco|zloty polacchi|złoty della polonia"), - ("Grosz", "groszy|grosz|grosze"), - ("Qatari riyal", "rial del qatar|qar"), - ("Saudi riyal", "rial saudita|rial sauditi|rial dell'arabia saudita|sar"), - ("Riyal", "riyal|riyals|rial|﷼"), - ("Dirham", "dirham|dirhem|dirhm"), - ("Halala", "halalas|halala"), - ("Samoan tālā", "tālā samoano|tālā samoani|tālā|tala|ws$|tālā di samoa|tala samoano|tala samoani|tala di samoa"), - ("Sene", "sene"), - ("São Tomé and Príncipe dobra", "dobra di são tomé|dobra di sao tome|dobras|dobra|std"), - ("Sierra Leonean leone", "leone di sierra leone|leone sierraleonese|sll|leone"), - ("Peseta", "pesetas|peseta"), - ("Netherlands guilder", "fiorino|fiorini|fiorino olandese|fiorini olandesi|fiorino delle antille olandesi|fiorini delle antille olandesi|ang"), - ("Swazi lilangeni", "lilangeni del swaziland|lilangeni|szl|emalangeni"), - ("Tajikistani somoni", "somoni tagiko|somoni del tagikistan|tjs|somoni"), - ("Diram", "dirams|diram"), - ("Thai baht", "baht tailandese|baht tailandesi|baht della tailandia|฿|thb|baht"), - ("Satang", "satang|satangs"), - ("Tongan paʻanga", "paʻanga di tonga|paʻanga|pa anga| pa anga di tonga|pa'anga|pa'anga di tonga"), - ("Seniti", "seniti"), - ("Ukrainian hryvnia", "grivna ucraina|grivna|grivna dell'ucraina|uah|₴"), - ("Vanuatu vatu", "vatu di vanuatu|vatu|vuv"), - ("Venezuelan bolívar", "bolívar forte venezuelano|bolívar venezuelano|bolívar forte venezuelani|bolívar venezuelani|bs.f.|vef|bolívar fuerte|bolivar venezuelano|bolivar venezuelani"), - ("Vietnamese dong", "dong vietnamita|dong vietnamiti|vnd|đồng|dong del vietnam"), - ("Zambian kwacha", "kwacha zambiano|kwacha zambiani|zk|zmw|kwacha dello zambia"), - ("Moroccan dirham", "dirham marocchino|dirham marocchini|dirham del marocco|mad|د.م."), - ("United Arab Emirates dirham", "dirham degli emirati arabi uniti|dirham degli emirati arabi|د.إ|aed"), - ("Azerbaijani manat", "manat azerbaigian|manat dell'azerbaigian|azn"), - ("Turkmenistan manat", "manat turkmeno|manat turkmeni|tmt"), - ("Manat", "manats|manat"), - ("Qəpik", "qəpik"), - ("Somali shilling", "scellino somalo|scellini somali|scellino della somalia|scellini della somalia|sh.so.|sos"), - ("Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"), - ("Tanzanian shilling", "scellino tanzaniano|scellini tanzaniani|scellino della tanzania|scellini della tanzania|tsh|tzs"), - ("Ugandan shilling", "scellino ugandese|scellini ugandesi|scellino dell'uganda|scellini dell'uganda|ugx"), - ("Romanian leu", "leu rumeno|leu rumeni|nuovo leu rumeno|leu della romania|nuovo leu della romania|lei|ron"), - ("Moldovan leu", "leu moldavo|leu moldavi|leu della moldavia|mdl"), - ("Leu", "leu"), - ("Ban", "bani|-ban|ban"), - ("Nepalese rupee", "rupia nepalese|rupie nepalesi|npr"), - ("Pakistani rupee", "rupia pakistana|rupie pakistane|pkr"), - ("Indian rupee", "rupia indiana|rupia indiane|inr|₹"), - ("Seychellois rupee", "rupie delle seychelles|scr|sr|sre"), - ("Mauritian rupee", "rupia mauriziana|rupie mauriziane|rupia delle mauritius|mur"), - ("Maldivian rufiyaa", "rufiyaa|rufiyaa delle maldive|mvr|.ރ|"), - ("Sri Lankan rupee", "rupia singalese|rupie singalesi|rupia dello sri lanka|rupie dello sri lanka|lkr|රු|ரூ"), - ("Indonesian rupiah", "rupia indonesiana|rupie indonesiane|rupia dell'indonesia|rupiah|perak|rp|idr"), - ("Rupee", "rupia|rupie|rupee|rs"), - ("Danish krone", "corona danese|corone danesi|corona della danimarca|corone della danimarca|dkk"), - ("Norwegian krone", "corona norvegese|corone norvegesi|corona della norvegia|corone della norvegia|nok"), - ("Faroese króna", "faroese króna|faroese krona"), - ("Icelandic króna", "corona islandese|corone islandesi|corona dell'islanda|corone dell'islanda|isk"), - ("Swedish krona", "corona svedese|corone svedesi|corona della svezia|corone della svezia|sek"), - ("Krone", "kronor|krona|króna|krone|krones|kr|-kr|corona|corone"), - ("Øre", "Øre|oyra|eyrir"), - ("West African CFA franc", "franco africa occidentale|franchi africa occidentale|cfa (bceao)|xof"), - ("Central African CFA franc", "franco africa orientale|franchi africa orientale|cfa (beac)|xaf"), - ("Comorian franc", "franco delle comore|franchi delle comore|kmf"), - ("Congolese franc", "franco congolese|franchi congolesi|cdf"), - ("Burundian franc", "franco del burundi|franchi del burundi|bif"), - ("Djiboutian franc", "franco gibutiano|franchi gibutiani|djf"), - ("CFP franc", "franco pacifico|franchi pacifici|xpf"), - ("Guinean franc", "franco guineano|franchi guineani|gnf"), - ("Swiss franc", "franco svizzero|franchi svizzeri|swiss franc|chf|sfr."), - ("Rwandan franc", "franco del rwanda|franchi del rwanda|rwf|rf|r₣|frw"), - ("Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"), - ("Rappen", "rappen|-rappen"), - ("Franc", "francs|franc|fr.|fs|franco|franchi"), - ("Centime", "centimes|centime|santim"), - ("Russian ruble", "rublo russo|rubli russi|₽|rub"), - ("New Belarusian ruble", "nuovo rublo bielorusso|nuovi rubli bielorussi|byn"), - ("Transnistrian ruble", "transnistrian ruble|prb|р."), - ("Belarusian ruble", "rublo bielorusso|rubli bielorussi|byr"), - ("Kopek", "kopek|kopeks"), - ("Kapyeyka", "kapyeyka"), - ("Ruble", "rubles|ruble|br|rublo|rubli"), - ("Algerian dinar", "dinaro algerino|dinari algerini|د.ج|dzd"), - ("Bahraini dinar", "dinaro bahrain|dinari bahrain|bhd|.د.ب"), - ("Santeem", "santeem|santeems"), - ("Iraqi dinar", "dinaro iracheno|dinari iracheni|dinari dell'iraq|iqd|ع.د"), - ("Jordanian dinar", "dinaro giordano|dinari giordani|dinaro della giordania|د.ا|jod"), - ("Kuwaiti dinar", "dinaro kuwaitiano|dinari kuwaitiani|dinaro del kuwait|kwd|د.ك"), - ("Libyan dinar", "dinaro libico|dinari libici|dinaro della libia|lyd"), - ("Serbian dinar", "dinaro serbo|dinari serbi|dinaro della serbia|din.|rsd|дин."), - ("Tunisian dinar", "dinaro tunisino|dinari tunisini|dinaro della tunisia|tnd"), - ("Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"), - ("Dinar", "dinars|dinar|denar|-dinars|-dinar|dinaro|dinari"), - ("Fils", "fils|fulūs|-fils|-fil"), - ("Para", "para|napa"), - ("Millime", "millimes|millime"), - ("Argentine peso", "peso argentino|peso argentini|peso dell'argentina|ars"), - ("Chilean peso", "peso cileno|peso cileni|peso del cile|clp"), - ("Colombian peso", "peso colombiano|peso colombiani|peso della colombia|cop"), - ("Cuban convertible peso", "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"), - ("Cuban peso", "peso cubano|peso cubani|peso di cuba|cup"), - ("Dominican peso", "peso dominicano|peso dominicani|peso della repubblica dominicana|dop"), - ("Mexican peso", "peso messicano|peso messicani|peso del messico|mxn"), - ("Philippine peso", "peso filippino|peso filippini|peso delle filippine|₱|php"), - ("Uruguayan peso", "peso uruguaiano|peso uruguaiani|peso dell'uruguay|nuovo peso uruguaiano|nuovo peso uruguaiani|nuovo peso dell'uruguay|uyu"), - ("Peso", "pesos|peso"), - ("Centavo", "centavos|centavo"), - ("Alderney pound", "alderney pounds|alderney pound|alderney £"), - ("British pound", "sterlina inglese|sterline inglesi|sterlina dell'inghilterra|sterlina del regno unito|british £|gbp"), - ("Guernsey pound", "guernsey pounds|guernsey £|ggp"), - ("Ascension pound", "ascension pounds|ascension pound|ascension £"), - ("Saint Helena pound", "sterlina di st helena|sterline di st helena|saint helena £|shp"), - ("Egyptian pound", "sterlina egiziana|sterline egiziane|sterlina dell'egitto|egyptian £|egp|ج.م"), - ("Falkland Islands pound", "sterlina delle isole falkland|sterline delle isole falkland|falkland islands £|fkp"), - ("Gibraltar pound", "sterlina di gibilterra|sterline di gibilterra|gibraltar £|gip"), - ("Manx pound", "manx pounds|manx pound|manx £|imp"), - ("Jersey pound", "jersey pounds|jersey pound|jersey £|jep"), - ("Lebanese pound", "sterlina libanese|sterline libanesi|sterlina del libano|lebanese £|lbp|ل.ل"), - ("South Georgia and the South Sandwich Islands pound", "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"), - ("South Sudanese pound", "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"), - ("Sudanese pound", "sterlina sudanese|sterline sudanesi|sterlina del sudan|sudanese £|ج.س.|sdg"), - ("Syrian pound", "lira siriana|lire siriane|lira della siria|ل.س|syp"), - ("Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"), - ("Pound", "pounds|pound|-pounds|-pound|£|sterlina|sterline"), - ("Pence", "pence"), - ("Shilling", "shillings|shilling|shilingi|shilin|sh|scellino|scellini"), - ("Penny", "pennies|penny"), - ("United States dollar", "dollaro americano|dollari americani|dollaro statunitense|dollari statunitensi|dollaro degli stati uniti|dollari delgi stati uniti|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|us$|us dollar|us dollars|u.s dollar|u.s dollars"), - ("East Caribbean dollar", "dollaro dei caraibi orientali|dollari dei caraibi orientali|east Caribbean $|xcd"), - ("Australian dollar", "dollaro australiano|dollari australiani|dollaro dell australia|australian $|australian$|aud"), - ("Bahamian dollar", "dollaro delle bahamas|dollari delle bahamas|bahamian $|bahamian$|bsd"), - ("Barbadian dollar", "dollaro barbados|dollari barbados|dollaro delle barbados|dollari delle barbados|bbd"), - ("Belize dollar", "dollaro del belize|dollari del belize|belize $|bzd"), - ("Bermudian dollar", "dollaro delle bermuda|dollari delle bermuda|bermudian $|bmd|bermuda $"), - ("British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $|dollaro delle isole vergini britanniche|dollari delle isole vergini britanniche|dollaro isole vergini britanniche|dollari isole vergini britanniche|"), - ("Brunei dollar", "dollaro del brunei|dollari del brunei|brunei $|bnd"), - ("Sen", "sen"), - ("Singapore dollar", "dollaro di singapore|dollari di singapore|singapore dollar|singapore $|s$|sgd"), - ("Canadian dollar", "dollaro canadese|dollari canadesi|dollaro del canada|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada $"), - ("Cayman Islands dollar", "dollaro delle cayman|dollari delle cayman|dollaro delle isole cayman|dollari delle isole cayman|kyd|ci$"), - ("New Zealand dollar", "dollaro neozelandese|dollari neozelandesi|dollaro della nuova zelanda|new zealand $|nz$|nzd|kiwi"), - ("Cook Islands dollar", "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $|dollaro delle isole cook|dollari delle isole cook|dollaro delle cook|dollari delle cook|"), - ("Fijian dollar", "dollaro fiji|dollari fiji|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"), - ("Guyanese dollar", "dollaro guyana|dollari guyana|guyanese dollars|guyanese dollar|gyd|gy$"), - ("Hong Kong dollar", "dollaro di hong kong|dollari di hong kong|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"), - ("Jamaican dollar", "dollaro giamaicano|dollari giamaicani| dollaro della giamaica|jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"), - ("Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $|dollaro di kiribati|dollari di kiribati"), - ("Liberian dollar", "dollaro liberiano|dollari liberiano|dollaro liberia|liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"), - ("Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"), - ("Namibian dollar", "dollaro di namibia|dollari di namibia|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"), - ("Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"), - ("Niue dollar", "niue dollars|niue dollar|niue $"), - ("Palauan dollar", "palauan dollars|palauan dollar|palauan $"), - ("Pitcairn Islands dollar", "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"), - ("Solomon Islands dollar", "dollaro delle salomone|dollari delle salomone|solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"), - ("Surinamese dollar", "dollaro surinamese|dollari surinamese|surinamese dollar|surinamese $|srd"), - ("New Taiwan dollar", "dollaro taiwanese|dollari taiwanesi|new taiwan dollars|new taiwan dollar|nt$|twd|ntd"), - ("Trinidad and Tobago dollar", "dollaro trinidad e tobago|dollari trinidad e tobago|trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"), - ("Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"), - ("Dollar", "dollars|dollar|$|dollaro|dollari"), - ("Chinese yuan", "yuan|yuan cinese|renminbi|cny|rmb|¥"), - ("Fen", "fen"), - ("Jiao", "jiao"), - ("Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka|marco finlandese|marchi finlandesi"), - ("Penni", "penniä|penni"), - ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), - ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), - ("Satoshi", "satoshi|satoshis")]) - CurrencyNameToIsoCodeMap = dict([("Afghan afghani", "AFN"), - ("Euro", "EUR"), - ("Albanian lek", "ALL"), - ("Angolan kwanza", "AOA"), - ("Armenian dram", "AMD"), - ("Aruban florin", "AWG"), - ("Bangladeshi taka", "BDT"), - ("Bhutanese ngultrum", "BTN"), - ("Bolivian boliviano", "BOB"), - ("Bosnia and Herzegovina convertible mark", "BAM"), - ("Botswana pula", "BWP"), - ("Brazilian real", "BRL"), - ("Bulgarian lev", "BGN"), - ("Cambodian riel", "KHR"), - ("Cape Verdean escudo", "CVE"), - ("Costa Rican colón", "CRC"), - ("Croatian kuna", "HRK"), - ("Czech koruna", "CZK"), - ("Eritrean nakfa", "ERN"), - ("Ethiopian birr", "ETB"), - ("Gambian dalasi", "GMD"), - ("Georgian lari", "GEL"), - ("Ghanaian cedi", "GHS"), - ("Guatemalan quetzal", "GTQ"), - ("Haitian gourde", "HTG"), - ("Honduran lempira", "HNL"), - ("Hungarian forint", "HUF"), - ("Iranian rial", "IRR"), - ("Yemeni rial", "YER"), - ("Israeli new shekel", "ILS"), - ("Japanese yen", "JPY"), - ("Kazakhstani tenge", "KZT"), - ("Kenyan shilling", "KES"), - ("North Korean won", "KPW"), - ("South Korean won", "KRW"), - ("Kyrgyzstani som", "KGS"), - ("Lao kip", "LAK"), - ("Lesotho loti", "LSL"), - ("South African rand", "ZAR"), - ("Macanese pataca", "MOP"), - ("Macedonian denar", "MKD"), - ("Malagasy ariary", "MGA"), - ("Malawian kwacha", "MWK"), - ("Malaysian ringgit", "MYR"), - ("Mauritanian ouguiya", "MRO"), - ("Mongolian tögrög", "MNT"), - ("Mozambican metical", "MZN"), - ("Burmese kyat", "MMK"), - ("Nicaraguan córdoba", "NIO"), - ("Nigerian naira", "NGN"), - ("Turkish lira", "TRY"), - ("Omani rial", "OMR"), - ("Panamanian balboa", "PAB"), - ("Papua New Guinean kina", "PGK"), - ("Paraguayan guaraní", "PYG"), - ("Peruvian sol", "PEN"), - ("Polish złoty", "PLN"), - ("Qatari riyal", "QAR"), - ("Saudi riyal", "SAR"), - ("Samoan tālā", "WST"), - ("São Tomé and Príncipe dobra", "STN"), - ("Sierra Leonean leone", "SLL"), - ("Swazi lilangeni", "SZL"), - ("Tajikistani somoni", "TJS"), - ("Thai baht", "THB"), - ("Ukrainian hryvnia", "UAH"), - ("Vanuatu vatu", "VUV"), - ("Venezuelan bolívar", "VEF"), - ("Zambian kwacha", "ZMW"), - ("Moroccan dirham", "MAD"), - ("United Arab Emirates dirham", "AED"), - ("Azerbaijani manat", "AZN"), - ("Turkmenistan manat", "TMT"), - ("Somali shilling", "SOS"), - ("Tanzanian shilling", "TZS"), - ("Ugandan shilling", "UGX"), - ("Romanian leu", "RON"), - ("Moldovan leu", "MDL"), - ("Nepalese rupee", "NPR"), - ("Pakistani rupee", "PKR"), - ("Indian rupee", "INR"), - ("Seychellois rupee", "SCR"), - ("Mauritian rupee", "MUR"), - ("Maldivian rufiyaa", "MVR"), - ("Sri Lankan rupee", "LKR"), - ("Indonesian rupiah", "IDR"), - ("Danish krone", "DKK"), - ("Norwegian krone", "NOK"), - ("Icelandic króna", "ISK"), - ("Swedish krona", "SEK"), - ("West African CFA franc", "XOF"), - ("Central African CFA franc", "XAF"), - ("Comorian franc", "KMF"), - ("Congolese franc", "CDF"), - ("Burundian franc", "BIF"), - ("Djiboutian franc", "DJF"), - ("CFP franc", "XPF"), - ("Guinean franc", "GNF"), - ("Swiss franc", "CHF"), - ("Rwandan franc", "RWF"), - ("Russian ruble", "RUB"), - ("Transnistrian ruble", "PRB"), - ("New Belarusian ruble", "BYN"), - ("Algerian dinar", "DZD"), - ("Bahraini dinar", "BHD"), - ("Iraqi dinar", "IQD"), - ("Jordanian dinar", "JOD"), - ("Kuwaiti dinar", "KWD"), - ("Libyan dinar", "LYD"), - ("Serbian dinar", "RSD"), - ("Tunisian dinar", "TND"), - ("Argentine peso", "ARS"), - ("Chilean peso", "CLP"), - ("Colombian peso", "COP"), - ("Cuban convertible peso", "CUC"), - ("Cuban peso", "CUP"), - ("Dominican peso", "DOP"), - ("Mexican peso", "MXN"), - ("Uruguayan peso", "UYU"), - ("British pound", "GBP"), - ("Saint Helena pound", "SHP"), - ("Egyptian pound", "EGP"), - ("Falkland Islands pound", "FKP"), - ("Gibraltar pound", "GIP"), - ("Manx pound", "IMP"), - ("Jersey pound", "JEP"), - ("Lebanese pound", "LBP"), - ("South Sudanese pound", "SSP"), - ("Sudanese pound", "SDG"), - ("Syrian pound", "SYP"), - ("United States dollar", "USD"), - ("Australian dollar", "AUD"), - ("Bahamian dollar", "BSD"), - ("Barbadian dollar", "BBD"), - ("Belize dollar", "BZD"), - ("Bermudian dollar", "BMD"), - ("Brunei dollar", "BND"), - ("Singapore dollar", "SGD"), - ("Canadian dollar", "CAD"), - ("Cayman Islands dollar", "KYD"), - ("New Zealand dollar", "NZD"), - ("Fijian dollar", "FJD"), - ("Guyanese dollar", "GYD"), - ("Hong Kong dollar", "HKD"), - ("Jamaican dollar", "JMD"), - ("Liberian dollar", "LRD"), - ("Namibian dollar", "NAD"), - ("Solomon Islands dollar", "SBD"), - ("Surinamese dollar", "SRD"), - ("New Taiwan dollar", "TWD"), - ("Trinidad and Tobago dollar", "TTD"), - ("Tuvaluan dollar", "TVD"), - ("Chinese yuan", "CNY"), - ("Rial", "__RI"), - ("Shiling", "__S"), - ("Som", "__SO"), - ("Dirham", "__DR"), - ("Dinar", "_DN"), - ("Dollar", "__D"), - ("Manat", "__MA"), - ("Rupee", "__R"), - ("Krone", "__K"), - ("Krona", "__K"), - ("Crown", "__K"), - ("Frank", "__F"), - ("Mark", "__M"), - ("Ruble", "__RB"), - ("Peso", "__PE"), - ("Pound", "__P"), - ("Tristan da Cunha pound", "_TP"), - ("South Georgia and the South Sandwich Islands pound", "_SP"), - ("Somaliland shilling", "_SS"), - ("Pitcairn Islands dollar", "_PND"), - ("Palauan dollar", "_PD"), - ("Niue dollar", "_NID"), - ("Nauruan dollar", "_ND"), - ("Micronesian dollar", "_MD"), - ("Kiribati dollar", "_KID"), - ("Guernsey pound", "_GGP"), - ("Faroese króna", "_FOK"), - ("Cook Islands dollar", "_CKD"), - ("British Virgin Islands dollar", "_BD"), - ("Ascension pound", "_AP"), - ("Alderney pound", "_ALP"), - ("Abkhazian apsar", "_AA"), - ("Bitcoin", "_XBT")]) - FractionalUnitNameToCodeMap = dict([("Jiao", "JIAO"), - ("Kopek", "KOPEK"), - ("Pul", "PUL"), - ("Cent", "CENT"), - ("Qindarkë", "QINDARKE"), - ("Penny", "PENNY"), - ("Santeem", "SANTEEM"), - ("Cêntimo", "CENTIMO"), - ("Centavo", "CENTAVO"), - ("Luma", "LUMA"), - ("Qəpik", "QƏPIK"), - ("Fils", "FILS"), - ("Poisha", "POISHA"), - ("Kapyeyka", "KAPYEYKA"), - ("Centime", "CENTIME"), - ("Chetrum", "CHETRUM"), - ("Paisa", "PAISA"), - ("Fening", "FENING"), - ("Thebe", "THEBE"), - ("Sen", "SEN"), - ("Stotinka", "STOTINKA"), - ("Fen", "FEN"), - ("Céntimo", "CENTIMO"), - ("Lipa", "LIPA"), - ("Haléř", "HALER"), - ("Øre", "ØRE"), - ("Piastre", "PIASTRE"), - ("Santim", "SANTIM"), - ("Oyra", "OYRA"), - ("Butut", "BUTUT"), - ("Tetri", "TETRI"), - ("Pesewa", "PESEWA"), - ("Fillér", "FILLER"), - ("Eyrir", "EYRIR"), - ("Dinar", "DINAR"), - ("Agora", "AGORA"), - ("Tïın", "TIIN"), - ("Chon", "CHON"), - ("Jeon", "JEON"), - ("Tyiyn", "TYIYN"), - ("Att", "ATT"), - ("Sente", "SENTE"), - ("Dirham", "DIRHAM"), - ("Rappen", "RAPPEN"), - ("Avo", "AVO"), - ("Deni", "DENI"), - ("Iraimbilanja", "IRAIMBILANJA"), - ("Tambala", "TAMBALA"), - ("Laari", "LAARI"), - ("Khoums", "KHOUMS"), - ("Ban", "BAN"), - ("Möngö", "MONGO"), - ("Pya", "PYA"), - ("Kobo", "KOBO"), - ("Kuruş", "KURUS"), - ("Baisa", "BAISA"), - ("Centésimo", "CENTESIMO"), - ("Toea", "TOEA"), - ("Sentimo", "SENTIMO"), - ("Grosz", "GROSZ"), - ("Sene", "SENE"), - ("Halala", "HALALA"), - ("Para", "PARA"), - ("Öre", "ORE"), - ("Diram", "DIRAM"), - ("Satang", "SATANG"), - ("Seniti", "SENITI"), - ("Millime", "MILLIME"), - ("Tennesi", "TENNESI"), - ("Kopiyka", "KOPIYKA"), - ("Tiyin", "TIYIN"), - ("Hào", "HAO"), - ("Ngwee", "NGWEE"), - ("Millibitcoin", "MILLIBITCOIN"), - ("Satoshi", "SATOSHI")]) - CompoundUnitConnectorRegex = f'(?e)' - CurrencyPrefixList = dict([("Dollar", "$"), - ("United States dollar", "$ stati uniti|us$|us $|u.s. $|u.s $"), - ("East Caribbean dollar", "east caribbean $"), - ("Australian dollar", "$ australiano|$ australia"), - ("Bahamian dollar", "bahamas $|$ bahamas"), - ("Barbadian dollar", "barbados $|$ barbados"), - ("Belize dollar", "belize $|$ belize"), - ("Bermudian dollar", "bermuda $|$ bermuda"), - ("British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"), - ("Brunei dollar", "brunei $|b$|$ brunei"), - ("Sen", "sen"), - ("Singapore dollar", "singapore $|s$"), - ("Canadian dollar", "canadian $|can$|c$|c $|canada $"), - ("Cayman Islands dollar", "isole cayman $|ci$|cayman island $"), - ("New Zealand dollar", "nuova zelanda $|nz$|nz $"), - ("Cook Islands dollar", "cook islands $|cook island $"), - ("Fijian dollar", "fiji $|$ fiji"), - ("Guyanese dollar", "gy$|gy $|g$|g $|guyana $|$ guyana"), - ("Hong Kong dollar", "hong kong $|hk$|hkd|hk $"), - ("Jamaican dollar", "giamaica $|j$|$ giamaica"), - ("Kiribati dollar", "kiribati $"), - ("Liberian dollar", "liberia $|$ liberiani|$ liberiano"), - ("Micronesian dollar", "micronesia $"), - ("Namibian dollar", "namibia $|nad|n$|$ namibia"), - ("Nauruan dollar", "nauruan $"), - ("Niue dollar", "niue $"), - ("Palauan dollar", "palauan $"), - ("Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"), - ("Solomon Islands dollar", "isole salomon $|si$|si $|solomon island $"), - ("Surinamese dollar", "suriname $|surinam $"), - ("New Taiwan dollar", "nt$|nt $"), - ("Trinidad and Tobago dollar", "trinidad e tobago $|trinidad $|trinidadian $"), - ("Tuvaluan dollar", "tuvaluan $"), - ("Samoan tālā", "ws$"), - ("Chinese yuan", "¥"), - ("Japanese yen", "¥"), - ("Euro", "€"), - ("Pound", "£"), - ("Costa Rican colón", "₡"), - ("Turkish lira", "₺"), - ("Bitcoin", "₿|btc|xbt")]) - AmbiguousCurrencyUnitList = [r'din.', r'kiwi', r'kina', r'kobo', r'lari', r'lipa', r'napa', r'para', r'sfr.', r'taka', r'tala', r'toea', r'vatu', r'yuan', r'ang', r'ban', r'bob', r'btn', r'byr', r'cad', r'cop', r'cup', r'dop', r'gip', r'jod', r'kgs', r'lak', r'lei', r'mga', r'mop', r'nad', r'omr', r'pul', r'sar', r'sbd', r'scr', r'sdg', r'sek', r'sen', r'sol', r'sos', r'std', r'try', r'yer', r'yen'] - InformationSuffixList = dict([("Bit", "-bit|bit|bits"), - ("Kilobit", "kilobit|kilobits|kb|kbit"), - ("Megabit", "megabit|megabits|Mb|Mbit"), - ("Gigabit", "gigabit|gigabits|Gb|Gbit"), - ("Terabit", "terabit|terabits|Tb|Tbit"), - ("Petabit", "petabit|petabits|Pb|Pbit"), - ("Byte", "-byte|byte|bytes"), - ("Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|kilobytes|kilo byte|kilo bytes|kByte"), - ("Megabyte", "-megabyte|-megabytes|megabyte|mB|megabytes|mega byte|mega bytes|MByte"), - ("Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|gigabytes|giga byte|giga bytes|GByte"), - ("Terabyte", "-terabyte|-terabytes|terabyte|tB|terabytes|tera byte|tera bytes|TByte"), - ("Petabyte", "-petabyte|-petabytes|petabyte|pB|petabytes|peta byte|peta bytes|PByte")]) - AmbiguousDimensionUnitList = [r'barile', r'barili', r'grain', r'pound', r'stone', r'iarde', r'iarda', r'cord', r'dram', r'feet', r'foot', r'piede', r'piedi', r'gill', r'nodo', r'peck', r'tazza', r'fps', r'pts', r'in', r'"'] - BuildPrefix = f'(?<=(\\s|^))' - BuildSuffix = f'(?=(\\s|\\P{{L}}|$))' + CurrencySuffixList = dict( + [ + ("Abkhazian apsar", "abkhazian apsar|apsars'"), + ("Afghan afghani", "afghani|؋|afn|afghanistan"), + ("Pul", "pul"), + ("Euro", "euros|euro|€|eur"), + ("Cent", "cents|cent|centesimo|-cent|centesimi"), + ("Albanian lek", "lek albanese|lek"), + ("Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"), + ("Angolan kwanza", "kwanza angolano|kwanza angolani|kz|aoa|kwanza"), + ("Armenian dram", "dram armenia|dram armeno|dram armeni"), + ("Aruban florin", "fiorino arubano|fiorini arubani|ƒ|awg"), + ("Bangladeshi taka", "taka bengalese|taka bengalesi|৳|bdt|taka|taka bangladesh"), + ("Paisa", "poisha|paisa"), + ("Bhutanese ngultrum", "ngultrum|nu.|btn|ngultrum butanese|ngultrum bhutanese"), + ("Chetrum", "chetrums|chetrum"), + ("Bolivian boliviano", "boliviano|bob|bs.|boliviano bolivia|boliviani"), + ("Bosnia and Herzegovina convertible mark", "marco bosniaco|marchi bosniaci|bam"), + ("Fening", "fenings|fenings"), + ("Botswana pula", "pula botswana|bwp|pula|pulas|botswana pulas"), + ("Thebe", "thebe"), + ("Brazilian real", "real brasiliano|r$|brl|real|real brasiliani"), + ("Bulgarian lev", "lev bulgaro|lev bulgari|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"), + ("Stotinka", "stotinki|stotinka"), + ("Cambodian riel", "riel|khr|៛|riel cambogiano|riel cambogiani"), + ("Cape Verdean escudo", "escudo capoverdiano|escudi capoverdiani|escudo|cve"), + ( + "Costa Rican colón", + "colón costaricano|crc|₡|colón del costa rica|colón del costarica|colon costaricano|colon del costa rica|colon del costarica", + ), + ("Salvadoran colón", "svc|colón del salvador|colon del salvador|colón salvadoregno|colon salvadoregni"), + ("Céntimo", "céntimo"), + ("Croatian kuna", "kuna croata|kune croate|kn|hrk|kuna della croazia"), + ("Lipa", "lipa"), + ("Czech koruna", "corona ceca|corone ceche|czk|Kč"), + ("Haléř", "haléř"), + ("Eritrean nakfa", "nakfa eritrea|nakfa eritree|nfk|ern|nafka"), + ("Ethiopian birr", "birr|birr etiope|birr etiopi|etb"), + ("Gambian dalasi", "gmd| dalasi gambiano|dalasi gambiani|galasi del gambia"), + ("Butut", "bututs|butut"), + ("Georgian lari", "lari georgiano|lari georgiani|lari|gel|₾"), + ("Tetri", "tetri"), + ("Ghanaian cedi", "cedi|cedi del ghana|ghs|₵|gh₵"), + ("Pesewa", "pesewas|pesewa"), + ("Guatemalan quetzal", "quetzal|quetzal del guatemala|gtq|guatemala quetzal"), + ("Haitian gourde", "gourde|gourde haitiano|gourde haitiani|htg"), + ("Honduran lempira", "lempira|lempira honduregna|lempira honduregne|hnl"), + ("Hungarian forint", "forino ungherese|fiorini ungheresi|huf|ft"), + ("Fillér", "fillér"), + ("Iranian rial", "rial dell'iran|irr|rial iraniano|rial iraniani"), + ("Yemeni rial", "rial yemenita|yer|rial dello yemen|rial yemeniti"), + ("Israeli new shekel", "nuovo sicli|₪|ils|agora"), + ("Lithuanian litas", "ltl|lita della lituania"), + ("Japanese yen", "yen giapponese|jpy|yen|-yen|¥|yen giapponesi|yen giappone"), + ("Kazakhstani tenge", "tenge del kazakistan|kzt|tenge"), + ("Kenyan shilling", "scellino keniota|kes|scellini kenioti"), + ("North Korean won", "won nordcoreano|won nordcoreani|won nord coreano|won nord coreani|kpw"), + ("South Korean won", "won sudcoreano|won sudcoreani|won sud coreano|won sud coreani|krw"), + ("Korean won", "won coreano|₩|won coreani"), + ("Kyrgyzstani som", "som del kirghizistan|kgs"), + ("Uzbekitan som", "som uzbeko|som uzbeki|som dell'uzbekistan|uzs"), + ("Lao kip", "kip del laos|lak|₭n|₭"), + ("Att", "att"), + ("Lesotho loti", "loti del lesotho|lsl|loti"), + ("Sente", "sente|lisente"), + ("South African rand", "rand sudafricano|rand sud africano|rand sudafricani|rand sud africani|zar"), + ("Macanese pataca", "pataca di macau|mop$|mop"), + ("Avo", "avos|avo"), + ("Macedonian denar", "dinaro macedone|dinari macedoni|dinaro della macedonia|mkd|ден"), + ("Deni", "deni"), + ("Malagasy ariary", "ariary del madagascar|mga"), + ("Iraimbilanja", "iraimbilanja"), + ("Malawian kwacha", "kwacha del malawi|mk|mwk"), + ("Tambala", "tambala"), + ("Malaysian ringgit", "ringgit malesiano|ringgit malesiani|rm|myr|ringgit della malesia"), + ("Mauritanian ouguiya", "ouguiya della mauritania|um|mro"), + ("Khoums", "khoums"), + ( + "Mongolian tögrög", + "tögrög mongolo|tögrög della mongolia|tögrög mongoli|mnt|₮|togrog mongolo|togrog della mongolia|togrog mongoli", + ), + ("Mozambican metical", "metical mozambicano|metical mozambicani|mt|mzn|metical del mozambico"), + ("Burmese kyat", "kyat birmano|kyat birmani|kyat della birmania|ks|mmk"), + ("Pya", "pya"), + ( + "Nicaraguan córdoba", + "córdoba nicaraguense|córdoba nicaraguensi|cordoba nicaraguense|cordoba nicaraguensi|cordoba del nicaragua|nio", + ), + ("Nigerian naira", "naira nigeriano|naira nigeriani|naira della nigeria|naira|ngn|₦"), + ("Kobo", "kobo"), + ( + "Turkish lira", + "lira turca|lire turche|nuova lira turca|nuove lire turche|lira della turchia|nuova lira della turchia|try|tl", + ), + ("Kuruş", "kuruş"), + ("Omani rial", "rial dell'oman|omr|ر.ع."), + ("Panamanian balboa", "balboa panamense|balboa panamensi|balboa del panama|b/.|pab"), + ("Papua New Guinean kina", "kina del papua nuova guinea|kina|pgk"), + ("Toea", "toea"), + ( + "Paraguayan guaraní", + "guaraní paraguaiano|guarani paraguaiano|guaraní paraguaiani|guarani paraguaiani|guaraní del paraguay|guarani del paraguay|₲|pyg", + ), + ( + "Peruvian sol", + "sol peruviano|sol peruviani|sol del peru|soles|sol|nuevo sol peruviano|nuevo sol peruviani|nuevo sol del peru|", + ), + ( + "Polish złoty", + "złoty|złoty polacco|złoty polacchi|zł|pln|zloty|zloty polacco|zloty polacchi|złoty della polonia", + ), + ("Grosz", "groszy|grosz|grosze"), + ("Qatari riyal", "rial del qatar|qar"), + ("Saudi riyal", "rial saudita|rial sauditi|rial dell'arabia saudita|sar"), + ("Riyal", "riyal|riyals|rial|﷼"), + ("Dirham", "dirham|dirhem|dirhm"), + ("Halala", "halalas|halala"), + ( + "Samoan tālā", + "tālā samoano|tālā samoani|tālā|tala|ws$|tālā di samoa|tala samoano|tala samoani|tala di samoa", + ), + ("Sene", "sene"), + ("São Tomé and Príncipe dobra", "dobra di são tomé|dobra di sao tome|dobras|dobra|std"), + ("Sierra Leonean leone", "leone di sierra leone|leone sierraleonese|sll|leone"), + ("Peseta", "pesetas|peseta"), + ( + "Netherlands guilder", + "fiorino|fiorini|fiorino olandese|fiorini olandesi|fiorino delle antille olandesi|fiorini delle antille olandesi|ang", + ), + ("Swazi lilangeni", "lilangeni del swaziland|lilangeni|szl|emalangeni"), + ("Tajikistani somoni", "somoni tagiko|somoni del tagikistan|tjs|somoni"), + ("Diram", "dirams|diram"), + ("Thai baht", "baht tailandese|baht tailandesi|baht della tailandia|฿|thb|baht"), + ("Satang", "satang|satangs"), + ("Tongan paʻanga", "paʻanga di tonga|paʻanga|pa anga| pa anga di tonga|pa'anga|pa'anga di tonga"), + ("Seniti", "seniti"), + ("Ukrainian hryvnia", "grivna ucraina|grivna|grivna dell'ucraina|uah|₴"), + ("Vanuatu vatu", "vatu di vanuatu|vatu|vuv"), + ( + "Venezuelan bolívar", + "bolívar forte venezuelano|bolívar venezuelano|bolívar forte venezuelani|bolívar venezuelani|bs.f.|vef|bolívar fuerte|bolivar venezuelano|bolivar venezuelani", + ), + ("Vietnamese dong", "dong vietnamita|dong vietnamiti|vnd|đồng|dong del vietnam"), + ("Zambian kwacha", "kwacha zambiano|kwacha zambiani|zk|zmw|kwacha dello zambia"), + ("Moroccan dirham", "dirham marocchino|dirham marocchini|dirham del marocco|mad|د.م."), + ("United Arab Emirates dirham", "dirham degli emirati arabi uniti|dirham degli emirati arabi|د.إ|aed"), + ("Azerbaijani manat", "manat azerbaigian|manat dell'azerbaigian|azn"), + ("Turkmenistan manat", "manat turkmeno|manat turkmeni|tmt"), + ("Manat", "manats|manat"), + ("Qəpik", "qəpik"), + ( + "Somali shilling", + "scellino somalo|scellini somali|scellino della somalia|scellini della somalia|sh.so.|sos", + ), + ("Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"), + ( + "Tanzanian shilling", + "scellino tanzaniano|scellini tanzaniani|scellino della tanzania|scellini della tanzania|tsh|tzs", + ), + ("Ugandan shilling", "scellino ugandese|scellini ugandesi|scellino dell'uganda|scellini dell'uganda|ugx"), + ( + "Romanian leu", + "leu rumeno|leu rumeni|nuovo leu rumeno|leu della romania|nuovo leu della romania|lei|ron", + ), + ("Moldovan leu", "leu moldavo|leu moldavi|leu della moldavia|mdl"), + ("Leu", "leu"), + ("Ban", "bani|-ban|ban"), + ("Nepalese rupee", "rupia nepalese|rupie nepalesi|npr"), + ("Pakistani rupee", "rupia pakistana|rupie pakistane|pkr"), + ("Indian rupee", "rupia indiana|rupia indiane|inr|₹"), + ("Seychellois rupee", "rupie delle seychelles|scr|sr|sre"), + ("Mauritian rupee", "rupia mauriziana|rupie mauriziane|rupia delle mauritius|mur"), + ("Maldivian rufiyaa", "rufiyaa|rufiyaa delle maldive|mvr|.ރ|"), + ( + "Sri Lankan rupee", + "rupia singalese|rupie singalesi|rupia dello sri lanka|rupie dello sri lanka|lkr|රු|ரூ", + ), + ("Indonesian rupiah", "rupia indonesiana|rupie indonesiane|rupia dell'indonesia|rupiah|perak|rp|idr"), + ("Rupee", "rupia|rupie|rupee|rs"), + ("Danish krone", "corona danese|corone danesi|corona della danimarca|corone della danimarca|dkk"), + ("Norwegian krone", "corona norvegese|corone norvegesi|corona della norvegia|corone della norvegia|nok"), + ("Faroese króna", "faroese króna|faroese krona"), + ("Icelandic króna", "corona islandese|corone islandesi|corona dell'islanda|corone dell'islanda|isk"), + ("Swedish krona", "corona svedese|corone svedesi|corona della svezia|corone della svezia|sek"), + ("Krone", "kronor|krona|króna|krone|krones|kr|-kr|corona|corone"), + ("Øre", "Øre|oyra|eyrir"), + ("West African CFA franc", "franco africa occidentale|franchi africa occidentale|cfa (bceao)|xof"), + ("Central African CFA franc", "franco africa orientale|franchi africa orientale|cfa (beac)|xaf"), + ("Comorian franc", "franco delle comore|franchi delle comore|kmf"), + ("Congolese franc", "franco congolese|franchi congolesi|cdf"), + ("Burundian franc", "franco del burundi|franchi del burundi|bif"), + ("Djiboutian franc", "franco gibutiano|franchi gibutiani|djf"), + ("CFP franc", "franco pacifico|franchi pacifici|xpf"), + ("Guinean franc", "franco guineano|franchi guineani|gnf"), + ("Swiss franc", "franco svizzero|franchi svizzeri|swiss franc|chf|sfr."), + ("Rwandan franc", "franco del rwanda|franchi del rwanda|rwf|rf|r₣|frw"), + ("Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"), + ("Rappen", "rappen|-rappen"), + ("Franc", "francs|franc|fr.|fs|franco|franchi"), + ("Centime", "centimes|centime|santim"), + ("Russian ruble", "rublo russo|rubli russi|₽|rub"), + ("New Belarusian ruble", "nuovo rublo bielorusso|nuovi rubli bielorussi|byn"), + ("Transnistrian ruble", "transnistrian ruble|prb|р."), + ("Belarusian ruble", "rublo bielorusso|rubli bielorussi|byr"), + ("Kopek", "kopek|kopeks"), + ("Kapyeyka", "kapyeyka"), + ("Ruble", "rubles|ruble|br|rublo|rubli"), + ("Algerian dinar", "dinaro algerino|dinari algerini|د.ج|dzd"), + ("Bahraini dinar", "dinaro bahrain|dinari bahrain|bhd|.د.ب"), + ("Santeem", "santeem|santeems"), + ("Iraqi dinar", "dinaro iracheno|dinari iracheni|dinari dell'iraq|iqd|ع.د"), + ("Jordanian dinar", "dinaro giordano|dinari giordani|dinaro della giordania|د.ا|jod"), + ("Kuwaiti dinar", "dinaro kuwaitiano|dinari kuwaitiani|dinaro del kuwait|kwd|د.ك"), + ("Libyan dinar", "dinaro libico|dinari libici|dinaro della libia|lyd"), + ("Serbian dinar", "dinaro serbo|dinari serbi|dinaro della serbia|din.|rsd|дин."), + ("Tunisian dinar", "dinaro tunisino|dinari tunisini|dinaro della tunisia|tnd"), + ("Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"), + ("Dinar", "dinars|dinar|denar|-dinars|-dinar|dinaro|dinari"), + ("Fils", "fils|fulūs|-fils|-fil"), + ("Para", "para|napa"), + ("Millime", "millimes|millime"), + ("Argentine peso", "peso argentino|peso argentini|peso dell'argentina|ars"), + ("Chilean peso", "peso cileno|peso cileni|peso del cile|clp"), + ("Colombian peso", "peso colombiano|peso colombiani|peso della colombia|cop"), + ( + "Cuban convertible peso", + "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso", + ), + ("Cuban peso", "peso cubano|peso cubani|peso di cuba|cup"), + ("Dominican peso", "peso dominicano|peso dominicani|peso della repubblica dominicana|dop"), + ("Mexican peso", "peso messicano|peso messicani|peso del messico|mxn"), + ("Philippine peso", "peso filippino|peso filippini|peso delle filippine|₱|php"), + ( + "Uruguayan peso", + "peso uruguaiano|peso uruguaiani|peso dell'uruguay|nuovo peso uruguaiano|nuovo peso uruguaiani|nuovo peso dell'uruguay|uyu", + ), + ("Peso", "pesos|peso"), + ("Centavo", "centavos|centavo"), + ("Alderney pound", "alderney pounds|alderney pound|alderney £"), + ( + "British pound", + "sterlina inglese|sterline inglesi|sterlina dell'inghilterra|sterlina del regno unito|british £|gbp", + ), + ("Guernsey pound", "guernsey pounds|guernsey £|ggp"), + ("Ascension pound", "ascension pounds|ascension pound|ascension £"), + ("Saint Helena pound", "sterlina di st helena|sterline di st helena|saint helena £|shp"), + ("Egyptian pound", "sterlina egiziana|sterline egiziane|sterlina dell'egitto|egyptian £|egp|ج.م"), + ( + "Falkland Islands pound", + "sterlina delle isole falkland|sterline delle isole falkland|falkland islands £|fkp", + ), + ("Gibraltar pound", "sterlina di gibilterra|sterline di gibilterra|gibraltar £|gip"), + ("Manx pound", "manx pounds|manx pound|manx £|imp"), + ("Jersey pound", "jersey pounds|jersey pound|jersey £|jep"), + ("Lebanese pound", "sterlina libanese|sterline libanesi|sterlina del libano|lebanese £|lbp|ل.ل"), + ( + "South Georgia and the South Sandwich Islands pound", + "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £", + ), + ( + "South Sudanese pound", + "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £", + ), + ("Sudanese pound", "sterlina sudanese|sterline sudanesi|sterlina del sudan|sudanese £|ج.س.|sdg"), + ("Syrian pound", "lira siriana|lire siriane|lira della siria|ل.س|syp"), + ("Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"), + ("Pound", "pounds|pound|-pounds|-pound|£|sterlina|sterline"), + ("Pence", "pence"), + ("Shilling", "shillings|shilling|shilingi|shilin|sh|scellino|scellini"), + ("Penny", "pennies|penny"), + ( + "United States dollar", + "dollaro americano|dollari americani|dollaro statunitense|dollari statunitensi|dollaro degli stati uniti|dollari delgi stati uniti|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|us$|us dollar|us dollars|u.s dollar|u.s dollars", + ), + ( + "East Caribbean dollar", + "dollaro dei caraibi orientali|dollari dei caraibi orientali|east Caribbean $|xcd", + ), + ( + "Australian dollar", + "dollaro australiano|dollari australiani|dollaro dell australia|australian $|australian$|aud", + ), + ("Bahamian dollar", "dollaro delle bahamas|dollari delle bahamas|bahamian $|bahamian$|bsd"), + ("Barbadian dollar", "dollaro barbados|dollari barbados|dollaro delle barbados|dollari delle barbados|bbd"), + ("Belize dollar", "dollaro del belize|dollari del belize|belize $|bzd"), + ("Bermudian dollar", "dollaro delle bermuda|dollari delle bermuda|bermudian $|bmd|bermuda $"), + ( + "British Virgin Islands dollar", + "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $|dollaro delle isole vergini britanniche|dollari delle isole vergini britanniche|dollaro isole vergini britanniche|dollari isole vergini britanniche|", + ), + ("Brunei dollar", "dollaro del brunei|dollari del brunei|brunei $|bnd"), + ("Sen", "sen"), + ("Singapore dollar", "dollaro di singapore|dollari di singapore|singapore dollar|singapore $|s$|sgd"), + ( + "Canadian dollar", + "dollaro canadese|dollari canadesi|dollaro del canada|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada $", + ), + ( + "Cayman Islands dollar", + "dollaro delle cayman|dollari delle cayman|dollaro delle isole cayman|dollari delle isole cayman|kyd|ci$", + ), + ( + "New Zealand dollar", + "dollaro neozelandese|dollari neozelandesi|dollaro della nuova zelanda|new zealand $|nz$|nzd|kiwi", + ), + ( + "Cook Islands dollar", + "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $|dollaro delle isole cook|dollari delle isole cook|dollaro delle cook|dollari delle cook|", + ), + ("Fijian dollar", "dollaro fiji|dollari fiji|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"), + ("Guyanese dollar", "dollaro guyana|dollari guyana|guyanese dollars|guyanese dollar|gyd|gy$"), + ( + "Hong Kong dollar", + "dollaro di hong kong|dollari di hong kong|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$", + ), + ( + "Jamaican dollar", + "dollaro giamaicano|dollari giamaicani| dollaro della giamaica|jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd", + ), + ("Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $|dollaro di kiribati|dollari di kiribati"), + ( + "Liberian dollar", + "dollaro liberiano|dollari liberiano|dollaro liberia|liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd", + ), + ("Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"), + ( + "Namibian dollar", + "dollaro di namibia|dollari di namibia|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $", + ), + ("Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"), + ("Niue dollar", "niue dollars|niue dollar|niue $"), + ("Palauan dollar", "palauan dollars|palauan dollar|palauan $"), + ( + "Pitcairn Islands dollar", + "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $", + ), + ( + "Solomon Islands dollar", + "dollaro delle salomone|dollari delle salomone|solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $", + ), + ("Surinamese dollar", "dollaro surinamese|dollari surinamese|surinamese dollar|surinamese $|srd"), + ( + "New Taiwan dollar", + "dollaro taiwanese|dollari taiwanesi|new taiwan dollars|new taiwan dollar|nt$|twd|ntd", + ), + ( + "Trinidad and Tobago dollar", + "dollaro trinidad e tobago|dollari trinidad e tobago|trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd", + ), + ("Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"), + ("Dollar", "dollars|dollar|$|dollaro|dollari"), + ("Chinese yuan", "yuan|yuan cinese|renminbi|cny|rmb|¥"), + ("Fen", "fen"), + ("Jiao", "jiao"), + ( + "Finnish markka", + "suomen markka|finnish markka|finsk mark|fim|markkaa|markka|marco finlandese|marchi finlandesi", + ), + ("Penni", "penniä|penni"), + ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), + ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), + ("Satoshi", "satoshi|satoshis"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afghan afghani", "AFN"), + ("Euro", "EUR"), + ("Albanian lek", "ALL"), + ("Angolan kwanza", "AOA"), + ("Armenian dram", "AMD"), + ("Aruban florin", "AWG"), + ("Bangladeshi taka", "BDT"), + ("Bhutanese ngultrum", "BTN"), + ("Bolivian boliviano", "BOB"), + ("Bosnia and Herzegovina convertible mark", "BAM"), + ("Botswana pula", "BWP"), + ("Brazilian real", "BRL"), + ("Bulgarian lev", "BGN"), + ("Cambodian riel", "KHR"), + ("Cape Verdean escudo", "CVE"), + ("Costa Rican colón", "CRC"), + ("Croatian kuna", "HRK"), + ("Czech koruna", "CZK"), + ("Eritrean nakfa", "ERN"), + ("Ethiopian birr", "ETB"), + ("Gambian dalasi", "GMD"), + ("Georgian lari", "GEL"), + ("Ghanaian cedi", "GHS"), + ("Guatemalan quetzal", "GTQ"), + ("Haitian gourde", "HTG"), + ("Honduran lempira", "HNL"), + ("Hungarian forint", "HUF"), + ("Iranian rial", "IRR"), + ("Yemeni rial", "YER"), + ("Israeli new shekel", "ILS"), + ("Japanese yen", "JPY"), + ("Kazakhstani tenge", "KZT"), + ("Kenyan shilling", "KES"), + ("North Korean won", "KPW"), + ("South Korean won", "KRW"), + ("Kyrgyzstani som", "KGS"), + ("Lao kip", "LAK"), + ("Lesotho loti", "LSL"), + ("South African rand", "ZAR"), + ("Macanese pataca", "MOP"), + ("Macedonian denar", "MKD"), + ("Malagasy ariary", "MGA"), + ("Malawian kwacha", "MWK"), + ("Malaysian ringgit", "MYR"), + ("Mauritanian ouguiya", "MRO"), + ("Mongolian tögrög", "MNT"), + ("Mozambican metical", "MZN"), + ("Burmese kyat", "MMK"), + ("Nicaraguan córdoba", "NIO"), + ("Nigerian naira", "NGN"), + ("Turkish lira", "TRY"), + ("Omani rial", "OMR"), + ("Panamanian balboa", "PAB"), + ("Papua New Guinean kina", "PGK"), + ("Paraguayan guaraní", "PYG"), + ("Peruvian sol", "PEN"), + ("Polish złoty", "PLN"), + ("Qatari riyal", "QAR"), + ("Saudi riyal", "SAR"), + ("Samoan tālā", "WST"), + ("São Tomé and Príncipe dobra", "STN"), + ("Sierra Leonean leone", "SLL"), + ("Swazi lilangeni", "SZL"), + ("Tajikistani somoni", "TJS"), + ("Thai baht", "THB"), + ("Ukrainian hryvnia", "UAH"), + ("Vanuatu vatu", "VUV"), + ("Venezuelan bolívar", "VEF"), + ("Zambian kwacha", "ZMW"), + ("Moroccan dirham", "MAD"), + ("United Arab Emirates dirham", "AED"), + ("Azerbaijani manat", "AZN"), + ("Turkmenistan manat", "TMT"), + ("Somali shilling", "SOS"), + ("Tanzanian shilling", "TZS"), + ("Ugandan shilling", "UGX"), + ("Romanian leu", "RON"), + ("Moldovan leu", "MDL"), + ("Nepalese rupee", "NPR"), + ("Pakistani rupee", "PKR"), + ("Indian rupee", "INR"), + ("Seychellois rupee", "SCR"), + ("Mauritian rupee", "MUR"), + ("Maldivian rufiyaa", "MVR"), + ("Sri Lankan rupee", "LKR"), + ("Indonesian rupiah", "IDR"), + ("Danish krone", "DKK"), + ("Norwegian krone", "NOK"), + ("Icelandic króna", "ISK"), + ("Swedish krona", "SEK"), + ("West African CFA franc", "XOF"), + ("Central African CFA franc", "XAF"), + ("Comorian franc", "KMF"), + ("Congolese franc", "CDF"), + ("Burundian franc", "BIF"), + ("Djiboutian franc", "DJF"), + ("CFP franc", "XPF"), + ("Guinean franc", "GNF"), + ("Swiss franc", "CHF"), + ("Rwandan franc", "RWF"), + ("Russian ruble", "RUB"), + ("Transnistrian ruble", "PRB"), + ("New Belarusian ruble", "BYN"), + ("Algerian dinar", "DZD"), + ("Bahraini dinar", "BHD"), + ("Iraqi dinar", "IQD"), + ("Jordanian dinar", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Libyan dinar", "LYD"), + ("Serbian dinar", "RSD"), + ("Tunisian dinar", "TND"), + ("Argentine peso", "ARS"), + ("Chilean peso", "CLP"), + ("Colombian peso", "COP"), + ("Cuban convertible peso", "CUC"), + ("Cuban peso", "CUP"), + ("Dominican peso", "DOP"), + ("Mexican peso", "MXN"), + ("Uruguayan peso", "UYU"), + ("British pound", "GBP"), + ("Saint Helena pound", "SHP"), + ("Egyptian pound", "EGP"), + ("Falkland Islands pound", "FKP"), + ("Gibraltar pound", "GIP"), + ("Manx pound", "IMP"), + ("Jersey pound", "JEP"), + ("Lebanese pound", "LBP"), + ("South Sudanese pound", "SSP"), + ("Sudanese pound", "SDG"), + ("Syrian pound", "SYP"), + ("United States dollar", "USD"), + ("Australian dollar", "AUD"), + ("Bahamian dollar", "BSD"), + ("Barbadian dollar", "BBD"), + ("Belize dollar", "BZD"), + ("Bermudian dollar", "BMD"), + ("Brunei dollar", "BND"), + ("Singapore dollar", "SGD"), + ("Canadian dollar", "CAD"), + ("Cayman Islands dollar", "KYD"), + ("New Zealand dollar", "NZD"), + ("Fijian dollar", "FJD"), + ("Guyanese dollar", "GYD"), + ("Hong Kong dollar", "HKD"), + ("Jamaican dollar", "JMD"), + ("Liberian dollar", "LRD"), + ("Namibian dollar", "NAD"), + ("Solomon Islands dollar", "SBD"), + ("Surinamese dollar", "SRD"), + ("New Taiwan dollar", "TWD"), + ("Trinidad and Tobago dollar", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Chinese yuan", "CNY"), + ("Rial", "__RI"), + ("Shiling", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dollar", "__D"), + ("Manat", "__MA"), + ("Rupee", "__R"), + ("Krone", "__K"), + ("Krona", "__K"), + ("Crown", "__K"), + ("Frank", "__F"), + ("Mark", "__M"), + ("Ruble", "__RB"), + ("Peso", "__PE"), + ("Pound", "__P"), + ("Tristan da Cunha pound", "_TP"), + ("South Georgia and the South Sandwich Islands pound", "_SP"), + ("Somaliland shilling", "_SS"), + ("Pitcairn Islands dollar", "_PND"), + ("Palauan dollar", "_PD"), + ("Niue dollar", "_NID"), + ("Nauruan dollar", "_ND"), + ("Micronesian dollar", "_MD"), + ("Kiribati dollar", "_KID"), + ("Guernsey pound", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dollar", "_CKD"), + ("British Virgin Islands dollar", "_BD"), + ("Ascension pound", "_AP"), + ("Alderney pound", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarkë", "QINDARKE"), + ("Penny", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENTAVO"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENTIMO"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '(?e)' + CurrencyPrefixList = dict( + [ + ("Dollar", "$|dollari"), + ("United States dollar", "$ stati uniti|us$|us $|u.s. $|u.s $"), + ("East Caribbean dollar", "east caribbean $"), + ("Australian dollar", "$ australiano|$ australia"), + ("Bahamian dollar", "bahamas $|$ bahamas"), + ("Barbadian dollar", "barbados $|$ barbados"), + ("Belize dollar", "belize $|$ belize"), + ("Bermudian dollar", "bermuda $|$ bermuda"), + ( + "British Virgin Islands dollar", + "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $", + ), + ("Brunei dollar", "brunei $|b$|$ brunei"), + ("Sen", "sen"), + ("Singapore dollar", "singapore $|s$"), + ("Canadian dollar", "canadian $|can$|c$|c $|canada $"), + ("Cayman Islands dollar", "isole cayman $|ci$|cayman island $"), + ("New Zealand dollar", "nuova zelanda $|nz$|nz $"), + ("Cook Islands dollar", "cook islands $|cook island $"), + ("Fijian dollar", "fiji $|$ fiji"), + ("Guyanese dollar", "gy$|gy $|g$|g $|guyana $|$ guyana"), + ("Hong Kong dollar", "hong kong $|hk$|hkd|hk $"), + ("Jamaican dollar", "giamaica $|j$|$ giamaica"), + ("Kiribati dollar", "kiribati $"), + ("Liberian dollar", "liberia $|$ liberiani|$ liberiano"), + ("Micronesian dollar", "micronesia $"), + ("Namibian dollar", "namibia $|nad|n$|$ namibia"), + ("Nauruan dollar", "nauruan $"), + ("Niue dollar", "niue $"), + ("Palauan dollar", "palauan $"), + ("Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"), + ("Solomon Islands dollar", "isole salomon $|si$|si $|solomon island $"), + ("Surinamese dollar", "suriname $|surinam $"), + ("New Taiwan dollar", "nt$|nt $"), + ("Trinidad and Tobago dollar", "trinidad e tobago $|trinidad $|trinidadian $"), + ("Tuvaluan dollar", "tuvaluan $"), + ("Samoan tālā", "ws$"), + ("Chinese yuan", "¥"), + ("Japanese yen", "¥"), + ("Euro", "€"), + ("Pound", "£"), + ("Costa Rican colón", "₡"), + ("Turkish lira", "₺"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) + AmbiguousCurrencyUnitList = [ + r'din.', + r'kiwi', + r'kina', + r'kobo', + r'lari', + r'lipa', + r'napa', + r'para', + r'sfr.', + r'taka', + r'tala', + r'toea', + r'vatu', + r'yuan', + r'ang', + r'ban', + r'bob', + r'btn', + r'byr', + r'cad', + r'cop', + r'cup', + r'dop', + r'gip', + r'jod', + r'kgs', + r'lak', + r'lei', + r'mga', + r'mop', + r'nad', + r'omr', + r'pul', + r'sar', + r'sbd', + r'scr', + r'sdg', + r'sek', + r'sen', + r'sol', + r'sos', + r'std', + r'try', + r'yer', + r'yen', + ] + BuildPrefix = '(?<=(\\s|^))' + BuildSuffix = '(?=(\\s|\\P{L}|$))' ConnectorToken = 'di' - LengthSuffixList = dict([("Chilometro", "km|chilometro|chilometri|kilometro|kilometri"), - ("Ettometro", "hm|ettometro|ettometri"), - ("Decametro", "dam|decametro|decametri"), - ("Metro", "m|metro|metri"), - ("Decimetro", "dm|decimetro|decimetri"), - ("Centimetro", "cm|centimetro|centimetri"), - ("Millimetro", "mm|millimetro|millimetri"), - ("Micrometro", "μm|micrometro|micrometri"), - ("Nanometro", "nm|nanometro|nanometri"), - ("Picometro", "pm|picometro|picometri"), - ("Miglio", "miglia|miglio"), - ("Iarda", "iarda|iarde"), - ("Pollice", "pollice|pollici"), - ("Piede", "piede|piedi"), - ("Anno luce", "anni luce|anno luce|anni-luce|anno-luce")]) - AmbiguousLengthUnitList = [r'm', r'iarda', r'iarde'] - SpeedSuffixList = dict([("Metro al secondo", "metro / secondo|metri / secondi|m/s|metri per secondo|metri al secondo|metro per secondo|metro al secondo"), - ("Chilometri all'ora", "km/h|km/ora|kilometro per ora|kilometri per ora|chilometro per ora|chilometri per ora|kilometro all'ora|kilometri all'ora|chilometro all'ora|chilometri all'ora|kilometri orari|chilometri orari"), - ("Chilometri al minuto", "km/min|km/minuto|kilometro per minuto|kilometri per minuto|chilometro per minuto|chilometri per minuto|kilometro al minuto|kilometri al minuto|chilometro al minuto|chilometri al minuto"), - ("Chilometri al secondo", "km/s|km/secondo|kilometro per secondo|kilometri per secondo|chilometro per secondo|chilometri per secondo|kilometro al secondo|kilometri al secondo|chilometro al secondo|chilometri al secondo"), - ("Miglia all'ora", "mph|miglia per ora|miglio per ora|miglia all'ora|miglio all'ora|miglia orarie"), - ("Nodo", "kt|nodo|nodi|kn"), - ("Piede al secondo", "ft/s|foot/s|piede/s|piedi/s|piede per secondo|piedi per secondo|piede al secondo|piedi al secondo"), - ("Piede al minuto", "ft/min|foot/min|piede/min|piedi/min|piede per minuto|piedi per minuti|piede al minuto|piedi al minuto"), - ("Iarda al minuto", "iarda per minuto|iarde per minuto|iarda al minuto|iarde al minuto"), - ("Iarda al secondo", "iarda per secondo|iarde per secondo|iarda al secondo|iarde al secondo")]) - TemperatureSuffixList = dict([("F", "gradi fahrenheit|grado fahrenheit|°f|fahrenheit|f|gradi f|farenheit|gradi farenheit|grado farenheit"), - ("K", "k|K|kelvin"), - ("R", "rankine|°r"), - ("D", "delisle|°de"), - ("C", "gradi celsius|grado celsius|grado centigrado|gradi centigradi|°c|c|celsius|gradi c|centigrado|centigradi"), - ("Degree", "grado|gradi|°")]) - AmbiguousTemperatureUnitList = [r'c', r'f', r'k'] - VolumeSuffixList = dict([("Metro cubo", "m3|m^3|m³|metro cubo|metri cubi|metro cubico|metri cubici"), - ("Centimetro cubo", "cm3|cm^3|cm³|centimetro cubo|centimetri cubi|centimetro cubico|centimetri cubici"), - ("Millimetro cubo", "mm3|mm^3|mm³|millimetro cubo|millimetri cubi|millimetro cubico|millimetri cubici"), - ("Ettolitro", "ettolitro|ettolitri"), - ("Decalitro", "decalitro|decalitri|dekalitro|dekalitri"), - ("Litro", "l|litro|litri"), - ("Decilitro", "dl|decilitro|decilitri"), - ("Centilitro", "cl|centilitro|centilitri"), - ("Millilitro", "ml|millilitro|millilitri"), - ("Iarda cubica", "iarda cubica|iarde cubiche"), - ("Pollice cubo", "pollice cubo|pollice cubico|pollici cubici|pollici cubi"), - ("Piede cubo", "piede cubo|piedi cubi|piede cubico|piedi cubici"), - ("Miglia cubica", "miglio cubo|miglio cubico|miglia cubica|miglia cubiche"), - ("Oncia liquida", "oncia fluida|once fluide|oncia liquida|once liquide"), - ("Cucchiaino", "cucchiaino|cucchiaini"), - ("Cucchiaio", "cucchiaio|cucchiai"), - ("Tazza", "tazza|tazze"), - ("Pinta", "pinta|pinte"), - ("Gallone", "gallone|galloni"), - ("Barile", "barili|barile")]) - AmbiguousVolumeUnitList = [r'dal', r'l', r'oncia', r'tazza', r'cucchiaino', r'cucchiaio'] - WeightSuffixList = dict([("Chilogrammo", "kg|kilogrammo|chilogrammo|chilogrammi|kilogrammi|kilo|kili|chilo|chili"), - ("Grammo", "g|grammo|grammi|gr"), - ("Milligrammo", "mg|milligrammo|milligrammi"), - ("Microgrammo", "μg|microgrammo|microgrammi"), - ("Tonnellata", "tonnellata|tonnellate"), - ("Libbra", "libbra|libbre"), - ("Oncia", "oncia|once")]) - AmbiguousWeightUnitList = [r'g', r'oz'] - AngleSuffixList = dict([("Degree", "grado|gradi|°"), - ("Radian", "radiante|radianti|rad"), - ("Turn", "giro|giri")]) - AmbiguousAngleUnitList = [r'giro', r'giri'] AmbiguityFiltersDict = dict([("\\bl\\b", "l\\s*('|’)")]) - TemperatureAmbiguityFiltersDict = dict([("\\b(grad[oi]|°)$", "\\b((grad[oi]|°)\\s*(angolo|rotazione)|(ruota(re|t[oiae]|ndo)?|angolo|rotazioe)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(grad[oi]\\b|°))")]) - DimensionAmbiguityFiltersDict = dict([("\\b(grad[oi]|°)$", "\\b((grad[oi]|°)\\s*(c(elsius|entigrado)?|f(ah?renheit)?)|(temperatura)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(grad[oi]\\b|°))")]) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/japanese_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/japanese_numeric_with_unit.py new file mode 100644 index 0000000000..f229ca109a --- /dev/null +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/japanese_numeric_with_unit.py @@ -0,0 +1,534 @@ +# ------------------------------------------------------------------------------ +# +# This code was generated by a tool. +# Changes to this file may cause incorrect behavior and will be lost if +# the code is regenerated. +# +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +# ------------------------------------------------------------------------------ + + +# pylint: disable=line-too-long + + +class JapaneseNumericWithUnit: + BuildPrefix = '' + BuildSuffix = '' + ConnectorToken = '' + CheckFirstSuffix = True + CurrencySuffixList = dict( + [ + ("Afghan afghani", "アフガニ"), + ("Pul", "プル"), + ("Euro", "ユーロ"), + ("Cent", "セント"), + ("Albanian lek", "アルバニアレク|アルバニア・レク|レク"), + ("Angolan kwanza", "アンゴラクワンザ|アンゴラ・クワンザ|クワンザ"), + ("Armenian dram", "アルメニアドラム|アルメニア・ドラム|ドラム"), + ("Aruban florin", "アルバ・フロリン|フロリン"), + ("Bangladeshi taka", "タカ|バングラデシュ・タカ"), + ("Paisa", "パイサ"), + ("Bhutanese ngultrum", "ニュルタム|ブータン・ニュルタム|ブータンニュルタム"), + ("Chetrum", "チェルタム"), + ("Bolivian boliviano", "ボリビアーノ"), + ("Bosnia and Herzegovina convertible mark", "兌換マルク"), + ("Botswana pula", "ボツワナ・プラ|ボツワナプラ|プラ"), + ("Thebe", "テベ"), + ("Brazilian real", "ブラジル・レアル|ブラジルレアル|レアル"), + ("Bulgarian lev", "ブルガリア・レフ|ブルガリアレフ|レフ"), + ("Stotinka", "ストティンカ"), + ("Cambodian riel", "カンボジア・リエル|カンボジアリエル|リエル"), + ("Cape Verdean escudo", "カーボベルデ・エスクード"), + ("Croatian kuna", "クロアチアクーナ|クロアチア・クーナ|クーナ"), + ("Lipa", "リパ"), + ("Eritrean nakfa", "エリトリア・ナクファ|エリトリアナクファ|ナクファ"), + ("Ethiopian birr", "エチオピア・ブル|エチオピアブル|ブル"), + ("Gambian dalasi", "ガンビア・ダラシ|ガンビアダラシ|ダラシ"), + ("Butut", "ブトゥツ"), + ("Georgian lari", "ジョージア・ラリ|ジョージアラリ|ラリ"), + ("Tetri", "テトリ"), + ("Ghanaian cedi", "ガーナ・セディ|ガーナセディ|セディ"), + ("Pesewa", "ペセワ"), + ("Guatemalan quetzal", "グアテマラ・ケツァル|グアテマラケツァル|ケツァル"), + ("Haitian gourde", "ハイチ・グールド|ハイチグールド|グールド"), + ("Honduran lempira", "ホンジュラス・レンピラ|ホンジュラスレンピラ|レンピラ"), + ("Hungarian forint", "ハンガリー・フォリント|ハンガリーフォリント|フォリント"), + ("Iranian rial", "イラン・リアル"), + ("Yemeni rial", "イエメン・リアル"), + ("Israeli new shekel", "₪|ils|イスラエル・新シェケル|イスラエル新シェケル"), + ("Japanese yen", "円"), + ("Sen", "銭"), + ("Kazakhstani tenge", "テンゲ|カザフスタン・テンゲ|カザフスタンテンゲ"), + ("Kenyan shilling", "ケニア・シリング"), + ("North Korean won", "北朝鮮ウォン"), + ("South Korean won", "韓国ウォン"), + ("Korean won", "₩"), + ("Kyrgyzstani som", "キルギス・ソム|ソム"), + ("Lao kip", "キップ|ラオス・キップ|ラオスキップ"), + ("Att", "att"), + ("Lesotho loti", "ロチ|レソト・ロチ|レソトロチ"), + ("South African rand", "ランド|南アフリカ・ランド|南アフリカランド"), + ("Macedonian denar", "マケドニア・デナール"), + ("Deni", "デニ"), + ("Malagasy ariary", "アリアリ|マダガスカル・アリアリ|マダガスカルアリアリ"), + ("Iraimbilanja", "イライムビランジャ"), + ("Malawian kwacha", "マラウイ・クワチャ"), + ("Tambala", "タンバラ"), + ("Malaysian ringgit", "リンギット|マレーシア・リンギット"), + ("Mauritanian ouguiya", "ウギア|モーリタニア・ウギア|モーリタニアウギア"), + ("Khoums", "コウム"), + ("Mozambican metical", "メティカル|モザンビーク・メティカル|モザンビークメティカル"), + ("Burmese kyat", "チャット|ミャンマー・チャット|ミャンマーチャット"), + ("Pya", "ピャー"), + ("Nigerian naira", "ナイラ|ナイジェリア・ナイラ|ナイジェリアナイラ"), + ("Kobo", "コボ"), + ("Turkish lira", "トルコリラ"), + ("Kuruş", "クルシュ"), + ("Omani rial", "オマーン・リアル"), + ("Panamanian balboa", "バルボア|パナマ・バルボア|パナマバルボア"), + ("Centesimo", "センテシモ"), + ("Papua New Guinean kina", "キナ|パプア・ニューギニア・キナ"), + ("Toea", "トエア"), + ("Peruvian sol", "ヌエボ・ソル"), + ("Polish złoty", "ズウォティ|ポーランド・ズウォティ|ポーランドズウォティ"), + ("Grosz", "グロシュ"), + ("Qatari riyal", "カタール・リヤル"), + ("Saudi riyal", "サウジアラビア・リヤル"), + ("Riyal", "リヤル"), + ("Dirham", "ディルハム"), + ("Halala", "ハララ"), + ("Samoan tālā", "タラ|サモア・タラ|サモアタラ"), + ("Sierra Leonean leone", "レオン|シエラレオネ・レオン|シエラレオネレオン"), + ("Peseta", "ペセタ"), + ("Swazi lilangeni", "リランゲニ|スワジランド・リランゲニ|スワジランドリランゲニ"), + ("Tajikistani somoni", "ソモニ|タジキスタン・ソモニ|タジキスタンソモニ"), + ("Thai baht", "バーツ|タイ・バーツ|タイバーツ"), + ("Satang", "サタン"), + ("Tongan paʻanga", "パアンガ|トンガ・パアンガ|トンガパアンガ"), + ("Ukrainian hryvnia", "フリヴニャ|ウクライナ・フリヴニャ|ウクライナフリヴニャ"), + ("Vanuatu vatu", "バツ|バヌアツ・バツ|バヌアツバツ"), + ("Vietnamese dong", "ドン|ベトナム・ドン|ベトナムドン"), + ("Indonesian rupiah", "ルピア|インドネシア・ルピア|インドネシアルピア"), + ("Netherlands guilder", "オランダ・ユーロ"), + ("Surinam florin", "スリナムフロリン"), + ("Zambian kwacha", "ザンビア・クワチャ"), + ("Moroccan dirham", "モロッコ・ディルハム"), + ("United Arab Emirates dirham", "UAEディルハム"), + ("Azerbaijani manat", "アゼルバイジャン・マナト"), + ("Turkmenistan manat", "トルクメニスタン・マナト"), + ("Manat", "マナト"), + ("Somali shilling", "ソマリア・シリング"), + ("Somaliland shilling", "ソマリランド・シリング"), + ("Tanzanian shilling", "タンザニア・シリング"), + ("Ugandan shilling", "ウガンダ・シリング"), + ("Romanian leu", "ルーマニア・レウ"), + ("Moldovan leu", "モルドバ・レウ"), + ("Leu", "レウ"), + ("Ban", "バン"), + ("Nepalese rupee", "ネパール・ルピー"), + ("Pakistani rupee", "パキスタン・ルピー"), + ("Indian rupee", "インド・ルピー"), + ("Seychellois rupee", "セーシェル・ルピー"), + ("Mauritian rupee", "モーリシャス・ルピー"), + ("Maldivian rufiyaa", "ルフィヤ|モルディブ・ルフィヤ|モルディブルフィヤ"), + ("Sri Lankan rupee", "スリランカ・ルピー"), + ("Rupee", "ルピー"), + ("Czech koruna", "チェコ・コルナ"), + ("Danish krone", "デンマーク・クローネ"), + ("Norwegian krone", "ノルウェー・クローネ"), + ("Faroese króna", "フェロー・クローネ"), + ("Icelandic króna", "アイスランド・クローナ"), + ("Swedish krona", "スウェーデン・クローナ"), + ("Krone", "クローナ"), + ("Øre", "オーレ"), + ("West African CFA franc", "西アフリカCFAフラン"), + ("Central African CFA franc", "中央アフリカCFAフラン"), + ("Comorian franc", "コモロ・フラン"), + ("Congolese franc", "コンゴ・フラン"), + ("Burundian franc", "ブルンジ・フラン"), + ("Djiboutian franc", "ジブチ・フラン"), + ("CFP franc", "CFPフラン"), + ("Guinean franc", "ギニア・フラン"), + ("Swiss franc", "スイス・フラン|スイスフラン"), + ("Rwandan franc", "ルワンダ・フラン"), + ("Belgian franc", "ベルギー・フラン"), + ("Rappen", "Rappen"), + ("Franc", "フラン"), + ("Centime", "サンチーム"), + ("Russian ruble", "ロシア・ルーブル"), + ("Transnistrian ruble", "沿ドニエストル・ルーブル"), + ("Belarusian ruble", "ベラルーシ・ルーブル"), + ("Kopek", "カペイカ"), + ("Ruble", "ルーブル"), + ("Algerian dinar", "アルジェリア・ディナール"), + ("Bahraini dinar", "バーレーン・ディナール"), + ("Iraqi dinar", "イラク・ディナール"), + ("Jordanian dinar", "ヨルダン・ディナール"), + ("Kuwaiti dinar", "クウェート・ディナール"), + ("Libyan dinar", "リビア・ディナール"), + ("Serbian dinar", "セルビア・ディナール"), + ("Tunisian dinar", "チュニジア・ディナール"), + ("Dinar", "ディナール"), + ("Fils", "フィルス"), + ("Para", "パラ"), + ("Millime", "ミリム"), + ("Argentine peso", "アルゼンチン・ペソ"), + ("Chilean peso", "チリ・ペソ"), + ("Colombian peso", "コロンビア・ペソ"), + ("Cuban peso", "兌換ペソ"), + ("Dominican peso", "ドミニカ・ペソ"), + ("Mexican peso", "メキシコ・ペソ"), + ("Philippine peso", "フィリピン・ペソ"), + ("Uruguayan peso", "ウルグアイ・ペソ"), + ("Peso", "ペソ"), + ("Centavo", "センターボ"), + ("Alderney pound", "オルダニーポンド"), + ("British pound", "UKポンド"), + ("Guernsey pound", "ガーンジー・ポンド"), + ("Saint Helena pound", "セントヘレナ・ポンド"), + ("Egyptian pound", "エジプト・ポンド"), + ("Falkland Islands pound", "フォークランド諸島ポンド"), + ("Gibraltar pound", "ジブラルタル・ポンド"), + ("Manx pound", "マン島ポンド"), + ("Jersey pound", "ジャージー・ポンド"), + ("Lebanese pound", "レバノン・ポンド"), + ("South Sudanese pound", "南スーダン・ポンド"), + ("Sudanese pound", "スーダン・ポンド"), + ("Syrian pound", "シリア・ポンド"), + ("Pound", "ポンド"), + ("Pence", "ペンス"), + ("Shilling", "シリング"), + ("United States dollar", "米ドル|USドル|ドル"), + ("East Caribbean dollar", "東カリブ・ドル"), + ("Australian dollar", "オーストラリア・ドル|オーストラリアドル"), + ("Bahamian dollar", "バハマ・ドル"), + ("Barbadian dollar", "バルバドス・ドル"), + ("Belize dollar", "ベリーズ・ドル"), + ("Bermudian dollar", "バミューダ・ドル"), + ("Brunei dollar", "ブルネイ・ドル"), + ("Singapore dollar", "シンガポール・ドル"), + ("Canadian dollar", "カナダ・ドル"), + ("Cayman Islands dollar", "ケイマン諸島・ドル"), + ("New Zealand dollar", "ニュージーランド・ドル"), + ("Cook Islands dollar", "クックアイランド・ドル"), + ("Fijian dollar", "フィジー・ドル|フィジー・ドル"), + ("Guyanese dollar", "ガイアナ・ドル|ガイアナ・ドル"), + ("Hong Kong dollar", "香港ドル"), + ("Macau Pataca", "マカオ・パタカ|マカオ・パタカ"), + ("New Taiwan dollar", "ニュー台湾ドル|ニュー台湾ドル|台湾ドル"), + ("Jamaican dollar", "ジャマイカ・ドル|ジャマイカドル"), + ("Kiribati dollar", "キリバス・ドル"), + ("Liberian dollar", "リベリア・ドル|リベリアドル"), + ("Namibian dollar", "ナミビア・ドル|ナミビアドル"), + ("Surinamese dollar", "スリナム・ドル|スリナムドル"), + ("Trinidad and Tobago dollar", "トリニダード・トバゴ・ドル|トリニダードトバゴ・ドル"), + ("Tuvaluan dollar", "ツバル・ドル|ツバルドル"), + ("Dollar", "どる|$"), + ("Chinese yuan", "人民元|元"), + ("Fen", "分"), + ("Jiao", "角"), + ("Finnish markka", "フィンランド・マルカ"), + ("Penni", "ペニー"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afghan afghani", "AFN"), + ("Euro", "EUR"), + ("Albanian lek", "ALL"), + ("Angolan kwanza", "AOA"), + ("Armenian dram", "AMD"), + ("Aruban florin", "AWG"), + ("Bangladeshi taka", "BDT"), + ("Bhutanese ngultrum", "BTN"), + ("Bolivian boliviano", "BOB"), + ("Bosnia and Herzegovina convertible mark", "BAM"), + ("Botswana pula", "BWP"), + ("Brazilian real", "BRL"), + ("Bulgarian lev", "BGN"), + ("Cambodian riel", "KHR"), + ("Cape Verdean escudo", "CVE"), + ("Costa Rican colón", "CRC"), + ("Croatian kuna", "HRK"), + ("Czech koruna", "CZK"), + ("Eritrean nakfa", "ERN"), + ("Ethiopian birr", "ETB"), + ("Gambian dalasi", "GMD"), + ("Georgian lari", "GEL"), + ("Ghanaian cedi", "GHS"), + ("Guatemalan quetzal", "GTQ"), + ("Haitian gourde", "HTG"), + ("Honduran lempira", "HNL"), + ("Hungarian forint", "HUF"), + ("Iranian rial", "IRR"), + ("Yemeni rial", "YER"), + ("Israeli new shekel", "ILS"), + ("Japanese yen", "JPY"), + ("Kazakhstani tenge", "KZT"), + ("Kenyan shilling", "KES"), + ("North Korean won", "KPW"), + ("South Korean won", "KRW"), + ("Kyrgyzstani som", "KGS"), + ("Lao kip", "LAK"), + ("Lesotho loti", "LSL"), + ("South African rand", "ZAR"), + ("Macanese pataca", "MOP"), + ("Macedonian denar", "MKD"), + ("Malagasy ariary", "MGA"), + ("Malawian kwacha", "MWK"), + ("Malaysian ringgit", "MYR"), + ("Mauritanian ouguiya", "MRO"), + ("Mongolian tögrög", "MNT"), + ("Mozambican metical", "MZN"), + ("Burmese kyat", "MMK"), + ("Nicaraguan córdoba", "NIO"), + ("Nigerian naira", "NGN"), + ("Turkish lira", "TRY"), + ("Omani rial", "OMR"), + ("Panamanian balboa", "PAB"), + ("Papua New Guinean kina", "PGK"), + ("Paraguayan guaraní", "PYG"), + ("Peruvian sol", "PEN"), + ("Polish złoty", "PLN"), + ("Qatari riyal", "QAR"), + ("Saudi riyal", "SAR"), + ("Samoan tālā", "WST"), + ("São Tomé and Príncipe dobra", "STD"), + ("Sierra Leonean leone", "SLL"), + ("Swazi lilangeni", "SZL"), + ("Tajikistani somoni", "TJS"), + ("Thai baht", "THB"), + ("Ukrainian hryvnia", "UAH"), + ("Vanuatu vatu", "VUV"), + ("Venezuelan bolívar", "VEF"), + ("Zambian kwacha", "ZMW"), + ("Moroccan dirham", "MAD"), + ("United Arab Emirates dirham", "AED"), + ("Azerbaijani manat", "AZN"), + ("Turkmenistan manat", "TMT"), + ("Somali shilling", "SOS"), + ("Tanzanian shilling", "TZS"), + ("Ugandan shilling", "UGX"), + ("Romanian leu", "RON"), + ("Moldovan leu", "MDL"), + ("Nepalese rupee", "NPR"), + ("Pakistani rupee", "PKR"), + ("Indian rupee", "INR"), + ("Seychellois rupee", "SCR"), + ("Mauritian rupee", "MUR"), + ("Maldivian rufiyaa", "MVR"), + ("Sri Lankan rupee", "LKR"), + ("Indonesian rupiah", "IDR"), + ("Danish krone", "DKK"), + ("Norwegian krone", "NOK"), + ("Icelandic króna", "ISK"), + ("Swedish krona", "SEK"), + ("West African CFA franc", "XOF"), + ("Central African CFA franc", "XAF"), + ("Comorian franc", "KMF"), + ("Congolese franc", "CDF"), + ("Burundian franc", "BIF"), + ("Djiboutian franc", "DJF"), + ("CFP franc", "XPF"), + ("Guinean franc", "GNF"), + ("Swiss franc", "CHF"), + ("Rwandan franc", "RWF"), + ("Russian ruble", "RUB"), + ("Transnistrian ruble", "PRB"), + ("Belarusian ruble", "BYN"), + ("Algerian dinar", "DZD"), + ("Bahraini dinar", "BHD"), + ("Iraqi dinar", "IQD"), + ("Jordanian dinar", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Libyan dinar", "LYD"), + ("Serbian dinar", "RSD"), + ("Tunisian dinar", "TND"), + ("Argentine peso", "ARS"), + ("Chilean peso", "CLP"), + ("Colombian peso", "COP"), + ("Cuban convertible peso", "CUC"), + ("Cuban peso", "CUP"), + ("Dominican peso", "DOP"), + ("Mexican peso", "MXN"), + ("Uruguayan peso", "UYU"), + ("British pound", "GBP"), + ("Saint Helena pound", "SHP"), + ("Egyptian pound", "EGP"), + ("Falkland Islands pound", "FKP"), + ("Gibraltar pound", "GIP"), + ("Manx pound", "IMP"), + ("Jersey pound", "JEP"), + ("Lebanese pound", "LBP"), + ("South Sudanese pound", "SSP"), + ("Sudanese pound", "SDG"), + ("Syrian pound", "SYP"), + ("United States dollar", "USD"), + ("Australian dollar", "AUD"), + ("Bahamian dollar", "BSD"), + ("Barbadian dollar", "BBD"), + ("Belize dollar", "BZD"), + ("Bermudian dollar", "BMD"), + ("Brunei dollar", "BND"), + ("Singapore dollar", "SGD"), + ("Canadian dollar", "CAD"), + ("Cayman Islands dollar", "KYD"), + ("New Zealand dollar", "NZD"), + ("Fijian dollar", "FJD"), + ("Guyanese dollar", "GYD"), + ("Hong Kong dollar", "HKD"), + ("Jamaican dollar", "JMD"), + ("Liberian dollar", "LRD"), + ("Namibian dollar", "NAD"), + ("Solomon Islands dollar", "SBD"), + ("Surinamese dollar", "SRD"), + ("New Taiwan dollar", "TWD"), + ("Trinidad and Tobago dollar", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Chinese yuan", "CNY"), + ("Rial", "__RI"), + ("Shiling", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dollar", "__D"), + ("Manat", "__MA"), + ("Rupee", "__R"), + ("Krone", "__K"), + ("Krona", "__K"), + ("Crown", "__K"), + ("Frank", "__F"), + ("Mark", "__M"), + ("Ruble", "__RB"), + ("Peso", "__PE"), + ("Pound", "__P"), + ("Tristan da Cunha pound", "_TP"), + ("South Georgia and the South Sandwich Islands pound", "_SP"), + ("Somaliland shilling", "_SS"), + ("Pitcairn Islands dollar", "_PND"), + ("Palauan dollar", "_PD"), + ("Niue dollar", "_NID"), + ("Nauruan dollar", "_ND"), + ("Micronesian dollar", "_MD"), + ("Kiribati dollar", "_KID"), + ("Guernsey pound", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dollar", "_CKD"), + ("British Virgin Islands dollar", "_BD"), + ("Ascension pound", "_AP"), + ("Alderney pound", "_ALP"), + ("Abkhazian apsar", "_AA"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarkë", "QINDARKE"), + ("Penny", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENTAVO"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENTIMO"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ] + ) + CompoundUnitConnectorRegex = '(?と)' + CurrencyPrefixList = dict( + [ + ("Dollar", "$"), + ("United States dollar", "us$"), + ("British Virgin Islands dollar", "bvi$"), + ("Brunei dollar", "b$"), + ("Sen", "sen"), + ("Singapore dollar", "s$"), + ("Canadian dollar", "can$|c$|c $"), + ("Cayman Islands dollar", "ci$"), + ("New Zealand dollar", "nz$|nz $"), + ("Guyanese dollar", "gy$|gy $|g$|g $"), + ("Hong Kong dollar", "hk$|hkd|hk $"), + ("Jamaican dollar", "j$"), + ("Namibian dollar", "nad|n$|n $"), + ("Solomon Islands dollar", "si$|si $"), + ("New Taiwan dollar", "nt$|nt $"), + ("Samoan tālā", "ws$"), + ("Chinese yuan", "¥|人民元"), + ("Japanese yen", "¥|\\"), + ("Turkish lira", "₺"), + ("Euro", "€"), + ("Pound", "£"), + ("Costa Rican colón", "₡"), + ] + ) + CurrencyAmbiguousValues = [r'円', r'銭', r'分', r'レク', r'プル', r'ブル', r'\\', r'元'] + AmbiguityFiltersDict = dict([("五角", "五角大楼"), ("普尔", "标准普尔")]) + HalfUnitRegex = '半' + + +# pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/portuguese_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/portuguese_numeric_with_unit.py index d2699d98e4..0b0cc7cf53 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/portuguese_numeric_with_unit.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/portuguese_numeric_with_unit.py @@ -9,729 +9,846 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_numbers import BaseNumbers + # pylint: disable=line-too-long class PortugueseNumericWithUnit: - AgeSuffixList = dict([("Ano", "anos|ano"), - ("Mês", "meses|mes|mês"), - ("Semana", "semanas|semana"), - ("Dia", "dias|dia")]) - AmbiguousAgeUnitList = [r'anos', r'ano', r'meses', r'mes', r'mês', r'semanas', r'semana', r'dias', r'dia'] - AreaSuffixList = dict([("Quilômetro quadrado", "quilômetro quadrado|quilómetro quadrado|quilometro quadrado|quilômetros quadrados|quilómetros quadrados|quilomeros quadrados|km2|km^2|km²"), - ("Hectare", "hectômetro quadrado|hectómetro quadrado|hectômetros quadrados|hectómetros cuadrados|hm2|hm^2|hm²|hectare|hectares"), - ("Decâmetro quadrado", "decâmetro quadrado|decametro quadrado|decâmetros quadrados|decametro quadrado|dam2|dam^2|dam²|are|ares"), - ("Metro quadrado", "metro quadrado|metros quadrados|m2|m^2|m²"), - ("Decímetro quadrado", "decímetro quadrado|decimentro quadrado|decímetros quadrados|decimentros quadrados|dm2|dm^2|dm²"), - ("Centímetro quadrado", "centímetro quadrado|centimetro quadrado|centímetros quadrados|centrimetros quadrados|cm2|cm^2|cm²"), - ("Milímetro quadrado", "milímetro quadrado|milimetro quadrado|milímetros quadrados|militmetros quadrados|mm2|mm^2|mm²"), - ("Polegada quadrada", "polegada quadrada|polegadas quadradas|in2|in^2|in²"), - ("Pé quadrado", "pé quadrado|pe quadrado|pés quadrados|pes quadrados|pé2|pé^2|pé²|sqft|sq ft|ft2|ft^2|ft²"), - ("Jarda quadrada", "jarda quadrada|jardas quadradas|yd2|yd^2|yd²"), - ("Milha quadrada", "milha quadrada|milhas quadradas|mi2|mi^2|mi²"), - ("Acre", "acre|acres")]) - CurrencySuffixList = dict([("Dólar", "dólar|dolar|dólares|dolares"), - ("Peso", "peso|pesos"), - ("Coroa", "coroa|coroas"), - ("Rublo", "rublo|rublos"), - ("Libra", "libra|libras"), - ("Florim", "florim|florins|ƒ"), - ("Dinar", "dinar|dinares"), - ("Franco", "franco|francos"), - ("Rupia", "rúpia|rupia|rúpias|rupias"), - ("Escudo", "escudo|escudos"), - ("Xelim", "xelim|xelins|xelims"), - ("Lira", "lira|liras"), - ("Centavo", "centavo|cêntimo|centimo|centavos|cêntimos|centimo"), - ("Centésimo", "centésimo|centésimos"), - ("Pêni", "pêni|péni|peni|penies|pennies"), - ("Manat", "manat|manate|mánate|man|manats|manates|mánates"), - ("Euro", "euro|euros|€|eur"), - ("Centavo de Euro", "centavo de euro|cêntimo de euro|centimo de euro|centavos de euro|cêntimos de euro|centimos de euro"), - ("Dólar do Caribe Oriental", "dólar do Caribe Oriental|dolar do Caribe Oriental|dólares do Caribe Oriental|dolares do Caribe Oriental|dólar das Caraíbas Orientais|dolar das Caraibas Orientais|dólares das Caraíbas Orientais|dolares das Caraibas Orientais|ec$|xcd"), - ("Centavo do Caribe Oriental", "centavo do Caribe Oriental|centavo das Caraíbas Orientais|cêntimo do Caribe Oriental|cêntimo das Caraíbas Orientais|centavos do Caribe Oriental|centavos das Caraíbas Orientais|cêntimos do Caribe Oriental|cêntimos das Caraíbas Orientais"), - ("Franco CFA da África Ocidental", "franco CFA da África Ocidental|franco CFA da Africa Ocidental|francos CFA da África Occidental|francos CFA da Africa Occidental|franco CFA Ocidental|xof"), - ("Centavo de CFA da África Ocidental", "centavo de CFA da Africa Occidental|centavos de CFA da África Ocidental|cêntimo de CFA da Africa Occidental|cêntimos de CFA da África Ocidental"), - ("Franco CFA da África Central", "franco CFA da África Central|franco CFA da Africa Central|francos CFA da África Central|francos CFA da Africa Central|franco CFA central|xaf"), - ("Centavo de CFA da África Central", "centavo de CFA de África Central|centavos de CFA da África Central|cêntimo de CFA de África Central|cêntimos de CFA da África Central"), - ("Apsar abcásio", "apsar abcásio|apsar abecásio|apsar abcasio|apsar|apsares"), - ("Afegani afegão", "afegani afegão|afegane afegão|؋|afn|afegane|afgane|afegâni|afeganis|afeganes|afganes|afegânis"), - ("Pul", "pul|pules|puls"), - ("Lek albanês", "lek|lekë|lekes|lek albanês|leque|leques|all"), - ("Qindarke", "qindarka|qindarkë|qindarke|qindarkas"), - ("Kwanza angolano", "kwanza angolano|kwanzas angolanos|kwanza|kwanzas|aoa|kz"), - ("Cêntimo angolano", "cêntimo angolano"), - ("Florim das Antilhas Holandesas", "florim das antilhas holandesas|florim das antilhas neerlandesas|ang"), - ("Rial saudita", "rial saudita|riais sauditas|riyal saudita|riyals sauditas|riyal|riyals|sar"), - ("Halala saudita", "halala saudita|halala|hallalah"), - ("Dinar argelino", "dinar argelino|dinares argelinos|dzd"), - ("Cêntimo argelino", "centimo argelino|centimos argelinos|cêntimo argelino|cêntimos argelinos|centavo argelino|centavos argelinos"), - ("Peso argentino", "peso argentino|pesos argentinos|ar$|ars"), - ("Centavo argentino", "centavo argentino|centavos argentinos|ctvo.|ctvos."), - ("Dram armênio", "dram armênio|dram armênios|dram arménio|dram arménios|dram armenio|dram armenios|dram|drame|drames|դր."), - ("Luma armênio", "luma armênio|lumas armênios|luma arménio|lumas arménios|luma armenio|lumas armenios|luma|lumas"), - ("Florim arubano", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"), - ("Dólar australiano", "dólar australiano|dólares australianos|dolar australiano|dolares australianos|a$|aud"), - ("Centavo australiano", "centavo australiano|centavos australianos"), - ("Manat azeri", "manat azeri|manats azeris|azn|manat azerbaijanês|manat azerbaijano|manats azerbaijaneses|manats azerbaijanos"), - ("Qəpik azeri", "qəpik azeri|qəpik|qəpiks"), - ("Dólar bahamense", "dólar bahamense|dólares bahamense|dolar bahamense|dolares bahamense|dólar baamiano|dólares baamiano|dolar baamiano|dolares baamiano|b$|bsd"), - ("Centavo bahamense", "centavo bahamense|centavos bahamense"), - ("Dinar bareinita", "dinar bareinita|dinar baremita|dinares bareinitas|dinares baremitas|bhd"), - ("Fil bareinita", "fil bareinita|fil baremita|fils bareinitas|fils baremitas"), - ("Taka bengali", "taka bengali|takas bengalis|taca|tacas|taka|takas|bdt"), - ("Poisha bengali", "poisha bengali|poishas bengalis"), - ("Dólar de Barbados", "dólar de barbados|dólares de barbados|dolar de barbados|dolares de barbados|dólar dos barbados|dólares dos barbados|bbd"), - ("Centavo de Barbados", "centavo de barbados|centavos de barbados|centavo dos barbados|centavos dos barbados"), - ("Dólar de Belize", "dólar de belize|dólares de belize|dolar de belize|dolares de belize|dólar do belize|dólares do belize|dolar do belize|dolares do belize|bz$|bzd"), - ("Centavo de Belize", "centavo de belize|centavos de belize|cêntimo do belize|cêntimos do belize"), - ("Dólar bermudense", "dólar bermudense|dólares bermudenses|bd$|bmd"), - ("Centavo bermudense", "centavo bermudense|centavos bermudenses|cêntimo bermudense| cêntimos bermudenses"), - ("Rublo bielorrusso", "rublo bielorrusso|rublos bielorrussos|byr"), - ("Copeque bielorusso", "copeque bielorrusso|copeques bielorrussos|kopek bielorrusso|kopeks bielorrussos|kap"), - ("Quiate mianmarense", "quiate mianmarense|quiates mianmarenses|kyat mianmarense|kyates mianmarenses|quiate myanmarense|quiates myanmarenses|kyat myanmarense|kyates myanmarenses|quiate birmanês|quite birmanes|quiates birmaneses|kyat birmanês|kyat birmanes|kyates birmaneses|mmk"), - ("Pya mianmarense", "pya mianmarense|pyas mianmarenses|pya myanmarense|pyas myanmarenses|pya birmanês|pya birmanes|pyas birmaneses"), - ("Boliviano", "boliviano|bolivianos|bob|bs"), - ("Centavo Boliviano", "centavo boliviano|centavos bolivianos"), - ("Marco da Bósnia e Herzegovina", "marco conversível|marco conversivel|marco convertível|marco convertivel|marcos conversíveis|marcos conversiveis|marcos convertíveis|marcos convertivies|bam"), - ("Fening da Bósnia e Herzegovina", "fening conversível|fening conversivel|fening convertível|fening convertivel|fenings conversíveis|fenings conversiveis|fenings convertíveis|fenings convertiveis"), - ("Pula", "pula|pulas|bwp"), - ("Thebe", "thebe|thebes"), - ("Real brasileiro", "real brasileiro|real do brasil|real|reais brasileiros|reais do brasil|reais|r$|brl"), - ("Centavo brasileiro", "centavo de real|centavo brasileiro|centavos de real|centavos brasileiros"), - ("Dólar de Brunei", "dólar de brunei|dolar de brunei|dólar do brunei|dolar do brunei|dólares de brunéi|dolares de brunei|dólares do brunei|dolares do brunei|bnd"), - ("Sen de Brunei", "sen de brunei|sen do brunei|sens de brunei|sens do brunei"), - ("Lev búlgaro", "lev búlgaro|leve búlgaro|leves búlgaros|lev bulgaro|leve bulgaro|leves bulgaros|lv|bgn"), - ("Stotinka búlgaro", "stotinka búlgaro|stotinki búlgaros|stotinka bulgaro|stotinki bulgaros"), - ("Franco do Burundi", "franco do burundi|francos do burundi|fbu|fib"), - ("Centavo Burundi", "centavo burundi|cêntimo burundi|centimo burundi|centavos burundi|cêntimo burundi|centimo burundi"), - ("Ngultrum butanês", "ngultrum butanês|ngultrum butanes|ngúltrume butanês|ngultrume butanes|ngultrum butaneses|ngúltrumes butaneses|ngultrumes butaneses|btn"), - ("Chetrum butanês", "chetrum butanês|chetrum butanes|chetrum butaneses"), - ("Escudo cabo-verdiano", "escudo cabo-verdiano|escudos cabo-verdianos|cve"), - ("Riel cambojano", "riel cambojano|riéis cambojanos|rieis cambojanos|khr"), - ("Dólar canadense", "dólar canadense|dolar canadense|dólares canadenses|dolares canadenses|c$|cad"), - ("Centavo canadense", "centavo canadense|centavos canadenses"), - ("Peso chileno", "peso chileno|pesos chilenos|cpl"), - ("Yuan chinês", "yuan chinês|yuan chines|yuans chineses|yuan|yuans|renminbi|rmb|cny|¥"), - ("Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"), - ("Centavo colombiano", "centavo colombiano|centavos colombianos"), - ("Franco comorense", "franco comorense|francos comorenses|kmf|₣"), - ("Franco congolês", "franco congolês|franco congoles|francos congoleses|cdf"), - ("Centavo congolês", "centavo congolês|centavo congoles|centavos congoleses|cêntimo congolês|centimo congoles|cêntimos congoleses|cêntimos congoleses"), - ("Won norte-coreano", "won norte-coreano|wŏn norte-coreano|won norte-coreanos|wŏn norte-coreanos|kpw"), - ("Chon norte-coreano", "chon norte-coreano|chŏn norte-coreano|chŏn norte-coreanos|chon norte-coreanos"), - ("Won sul-coreano", "wŏn sul-coreano|won sul-coreano|wŏnes sul-coreanos|wones sul-coreanos|krw"), - ("Jeon sul-coreano", "jeons sul-coreano|jeons sul-coreanos"), - ("Colón costarriquenho", "colón costarriquenho|colon costarriquenho|colons costarriquenho|colones costarriquenhos|crc"), - ("Kuna croata", "kuna croata|kunas croatas|hrk"), - ("Lipa croata", "lipa croata|lipas croatas"), - ("Peso cubano", "peso cubano|pesos cubanos|cup"), - ("Peso cubano convertível", "peso cubano conversível|pesos cubanos conversíveis|peso cubano conversivel|pesos cubanos conversiveis|peso cubano convertível|pesos cubanos convertíveis|peso cubano convertivel|pesos cubanos convertiveis|cuc"), - ("Coroa dinamarquesa", "coroa dinamarquesa|coroas dinamarquesas|dkk"), - ("Libra egípcia", "libra egípcia|libra egipcia|libras egípcias|libras egipcias|egp|l.e."), - ("Piastra egípcia", "piastra egípcia|piastra egipcia|pisastras egípcias|piastras egipcias"), - ("Dirham dos Emirados Árabes Unidos", "dirham|dirhams|dirham dos emirados arabes unidos|aed|dhs"), - ("Nakfa", "nakfa|nfk|ern"), - ("Centavo de Nakfa", "cêntimo de nakfa|cêntimos de nakfa|centavo de nafka|centavos de nafka"), - ("Peseta", "peseta|pesetas|pts.|ptas.|esp"), - ("Dólar estadunidense", "dólar dos estados unidos|dolar dos estados unidos|dólar estadunidense|dólar americano|dólares dos estados unidos|dolares dos estados unidos|dólares estadunidenses|dólares americanos|dolar estadunidense|dolar americano|dolares estadunidenses|dolares americanos|usd|u$d|us$|usd$"), - ("Coroa estoniana", "coroa estoniana|coroas estonianas|eek"), - ("Senti estoniano", "senti estoniano|senti estonianos"), - ("Birr etíope", "birr etíope|birr etiope|birr etíopes|birr etiopes|br|etb"), - ("Santim etíope", "santim etíope|santim etiope|santim etíopes|santim etiopes"), - ("Peso filipino", "peso filipino|pesos filipinos|php"), - ("Marco finlandês", "marco finlandês|marco finlandes|marcos finlandeses"), - ("Dólar fijiano", "dólar fijiano|dolar fijiano|dólares fijianos|dolares fijianos|fj$|fjd"), - ("Centavo fijiano", "centavo fijiano|centavos fijianos"), - ("Dalasi gambiano", "dalasi|gmd"), - ("Bututs", "butut|bututs"), - ("Lari georgiano", "lari georgiano|lari georgianos|gel"), - ("Tetri georgiano", "tetri georgiano|tetri georgianos"), - ("Cedi", "cedi|ghs|gh₵"), - ("Pesewa", "pesewa"), - ("Libra de Gibraltar", "libra de gibraltar|libras de gibraltar|gip"), - ("Peni de Gibraltar", "peni de gibraltar|penies de gibraltar"), - ("Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"), - ("Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"), - ("Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"), - ("Peni de Guernsey", "peni de Guernsey|penies de Guernsey"), - ("Franco da Guiné", "franco da guiné|franco da guine| franco guineense|francos da guiné|francos da guine|francos guineense|gnf|fg"), - ("Centavo da Guiné", "cêntimo guineense|centimo guineense|centavo guineense|cêntimos guineenses|centimos guineenses|centavos guineenses"), - ("Dólar guianense", "dólar guianense|dólares guianense|dolar guianense|dolares guianense|gyd|gy"), - ("Gurde haitiano", "gurde haitiano|gourde|gurdes haitianos|htg"), - ("Centavo haitiano", "cêntimo haitiano|cêntimos haitianos|centavo haitiano|centavos haitianos"), - ("Lempira hondurenha", "lempira hondurenha|lempiras hondurenhas|lempira|lempiras|hnl"), - ("Centavo hondurenho", "centavo hondurenho|centavos hondurehos|cêntimo hondurenho|cêntimos hondurenhos"), - ("Dólar de Hong Kong", "dólar de hong kong|dolar de hong kong|dólares de hong kong|dolares de hong kong|hk$|hkd"), - ("Florim húngaro", "florim húngaro|florim hungaro|florins húngaros|florins hungaros|forinte|forintes|huf"), - ("Filér húngaro", "fillér|filér|filler|filer"), - ("Rupia indiana", "rúpia indiana|rupia indiana|rupias indianas|inr"), - ("Paisa indiana", "paisa indiana|paisas indianas"), - ("Rupia indonésia", "rupia indonesia|rupia indonésia|rupias indonesias|rupias indonésias|idr"), - ("Sen indonésio", "send indonésio|sen indonesio|sen indonésios|sen indonesios"), - ("Rial iraniano", "rial iraniano|riais iranianos|irr"), - ("Dinar iraquiano", "dinar iraquiano|dinares iraquianos|iqd"), - ("Fil iraquiano", "fil iraquiano|fils iraquianos|files iraquianos"), - ("Libra manesa", "libra manesa|libras manesas|imp"), - ("Peni manês", "peni manes|peni manês|penies maneses"), - ("Coroa islandesa", "coroa islandesa|coroas islandesas|isk|íkr"), - ("Aurar islandês", "aurar islandês|aurar islandes|aurar islandeses|eyrir"), - ("Dólar das Ilhas Cayman", "dólar das ilhas cayman|dolar das ilhas cayman|dólar das ilhas caimão|dólares das ilhas cayman|dolares das ilhas cayman|dólares das ilhas caimão|ci$|kyd"), - ("Dólar das Ilhas Cook", "dólar das ilhas cook|dolar das ilhas cook|dólares das ilhas cook|dolares das ilhas cook"), - ("Coroa feroesa", "coroa feroesa|coroas feroesas|fkr"), - ("Libra das Malvinas", "libra das malvinas|libras das malvinas|fk£|fkp"), - ("Dólar das Ilhas Salomão", "dólar das ilhas salomão|dolar das ilhas salomao|dólares das ilhas salomão|dolares das ilhas salomao|sbd"), - ("Novo shekel israelense", "novo shekel|novos shekeles|novo shequel|novo siclo|novo xéquel|shekeles novos|novos sheqalim|sheqalim novos|ils|₪"), - ("Agora", "agora|agorot"), - ("Dólar jamaicano", "dólar jamaicano|dolar jamaicano|dólares jamaicanos|dolares jamaicanos|j$|ja$|jmd"), - ("Yen", "yen|iene|yenes|ienes|jpy"), - ("Libra de Jersey", "libra de Jersey|libras de Jersey|jep"), - ("Dinar jordaniano", "dinar jordaniano|dinar jordano|dinares jordanianos|dinares jordanos|jd|jod"), - ("Piastra jordaniana", "piastra jordaniana|piastra jordano|piastras jordanianas|piastra jordaniano|piastras jordanianos|piastras jordanos"), - ("Tengue cazaque", "tenge|tengue|tengué|tengue cazaque|kzt"), - ("Tiyin", "tiyin|tiyins"), - ("Xelim queniano", "xelim queniano|xelins quenianos|ksh|kes"), - ("Som quirguiz", "som quirguiz|som quirguizes|soms quirguizes|kgs"), - ("Tyiyn", "tyiyn|tyiyns"), - ("Dólar de Kiribati", "dólar de kiribati|dolar de kiribati|dólares de kiribati|dolares de kiribati"), - ("Dinar kuwaitiano", "dinar kuwaitiano|dinar cuaitiano|dinares kuwaitiano|dinares cuaitianos|kwd"), - ("Quipe laosiano", "quipe|quipes|kipe|kipes|kip|kip laosiano|kip laociano|kips laosianos|kips laocianos|lak"), - ("Att laosiano", "at|att|att laosiano|att laosianos"), - ("Loti do Lesoto", "loti|lóti|maloti|lotis|lótis|lsl"), - ("Sente", "sente|lisente"), - ("Libra libanesa", "libra libanesa|libras libanesas|lbp"), - ("Dólar liberiano", "dólar liberiano|dolar liberiano|dólares liberianos|dolares liberianos|l$|lrd"), - ("Dinar libio", "dinar libio|dinar líbio|dinares libios|dinares líbios|ld|lyd"), - ("Dirham libio", "dirham libio|dirhams libios|dirham líbio|dirhams líbios"), - ("Litas lituana", "litas lituana|litai lituanas|ltl"), - ("Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"), - ("Avo macaense", "avo macaense|avos macaenses"), - ("Ho macaense", "ho macaense|ho macaenses"), - ("Dinar macedônio", "denar macedonio|denare macedonios|denar macedônio|denar macedónio|denare macedônio|denare macedónio|dinar macedonio|dinar macedônio|dinar macedónio|dinares macedonios|dinares macedônios|dinares macedónios|den|mkd"), - ("Deni macedônio", "deni macedonio|deni macedônio|deni macedónio|denis macedonios|denis macedônios|denis macedónios"), - ("Ariary malgaxe", "ariai malgaxe|ariary malgaxe|ariary malgaxes|ariaris|mga"), - ("Iraimbilanja", "iraimbilanja|iraimbilanjas"), - ("Ringuite malaio", "ringgit malaio|ringgit malaios|ringgits malaios|ringuite malaio|ringuites malaios|rm|myr"), - ("Sen malaio", "sen malaio|sen malaios|centavo malaio|centavos malaios|cêntimo malaio|cêntimos malaios"), - ("Kwacha do Malawi", "kwacha|cuacha|quacha|mk|mwk"), - ("Tambala", "tambala|tambalas|tambala malawi"), - ("Rupia maldiva", "rupia maldiva|rupias maldivas|rupia das maldivas| rupias das maldivas|mvr"), - ("Dirame marroquino", "dirame marroquino|dirham marroquinho|dirhams marroquinos|dirames marroquinos|mad"), - ("Rupia maurícia", "rupia maurícia|rupia de Maurício|rupia mauricia|rupia de mauricio|rupias de mauricio|rupias de maurício|rupias mauricias|rupias maurícias|mur"), - ("Uguia", "uguia|uguias|oguia|ouguiya|oguias|mro"), - ("Kume", "kumes|kume|khoums"), - ("Peso mexicano", "peso mexicano|pesos mexicanos|mxn"), - ("Centavo mexicano", "centavo mexicano|centavos mexicanos"), - ("Leu moldávio", "leu moldavo|lei moldavos|leu moldávio|leu moldavio|lei moldávios|lei moldavios|leus moldavos|leus moldavios|leus moldávios|mdl"), - ("Ban moldávio", "ban moldavo|bani moldavos"), - ("Tugrik mongol", "tugrik mongol|tugrik|tugriks mongóis|tugriks mongois|tug|mnt"), - ("Metical moçambicao", "metical|metical moçambicano|metical mocambicano|meticais|meticais moçambicanos|meticais mocambicanos|mtn|mzn"), - ("Dólar namibiano", "dólar namibiano|dólares namibianos|dolar namibio|dolares namibios|n$|nad"), - ("Centavo namibiano", "centavo namibiano|centavos namibianos|centavo namibio|centavos namibianos"), - ("Rupia nepalesa", "rupia nepalesa|rupias nepalesas|npr"), - ("Paisa nepalesa", "paisa nepalesa|paisas nepalesas"), - ("Córdova nicaraguense", "córdova nicaraguense|cordova nicaraguense|cordova nicaraguana|córdoba nicaragüense|córdobas nicaragüenses|cordobas nicaraguenses|córdovas nicaraguenses|cordovas nicaraguenses|córdovas nicaraguanasc$|nio"), - ("Centavo nicaraguense", "centavo nicaragüense|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguanos"), - ("Naira", "naira|ngn"), - ("Kobo", "kobo"), - ("Coroa norueguesa", "coroa norueguesa|coroas norueguesas|nok"), - ("Franco CFP", "franco cfp|francos cfp|xpf"), - ("Dólar neozelandês", "dólar neozelandês|dolar neozelandes|dólares neozelandeses|dolares neozelandeses|dólar da nova zelândia|dolar da nova zelandia|dólares da nova zelândia|dolares da nova zelandia|nz$|nzd"), - ("Centavo neozelandês", "centavo neozelandês|centavo neozelandes|centavo da nova zelandia|centavo da nova zelândia|centavos da nova zelandia|centavos neozelandeses|centavos da nova zelândia"), - ("Rial omanense", "rial omani|riais omanis|rial omanense|riais omanenses|omr"), - ("Baisa omanense", "baisa omani|baisas omanis|baisa omanense|baisas omanenses"), - ("Florim holandês", "florim holandês|florim holandes|florins holandeses|nlg"), - ("Rupia paquistanesa", "rupia paquistanesa|rupias paquistanesas|pkr"), - ("Paisa paquistanesa", "paisa paquistanesa|paisas paquistanesasas"), - ("Balboa panamenho", "balboa panamenho|balboas panamenhos|balboa|pab|balboa panamense|balboas panamenses"), - ("Centavo panamenho", "centavo panamenho|cêntimo panamenho|centavos panamenhos|cêntimos panamenhos|cêntimo panamense|cêntimos panamenses"), - ("Kina", "kina|kina papuásia|kinas|kinas papuásias|pkg|pgk"), - ("Toea", "toea"), - ("Guarani", "guarani|guaranis|gs|pyg"), - ("Novo Sol", "novo sol peruano|novos sóis peruanos|sol|soles|sóis|nuevo sol|pen|s#."), - ("Centavo de sol", "cêntimo de sol|cêntimos de sol|centavo de sol|centavos de sol"), - ("Złoty", "złoty|złotys|zloty|zlotys|zloti|zlotis|zlóti|zlótis|zlote|zł|pln"), - ("Groszy", "groszy|grosz"), - ("Rial catariano", "rial qatari|riais qataris|rial catarense|riais catarenses|rial catariano|riais catarianos|qr|qar"), - ("Dirame catariano", "dirame catariano|dirames catarianos|dirame qatari|dirames qataris|dirame catarense|dirames catarenses|dirham qatari|dirhams qataris|dirham catarense|dirhams catarenses|dirham catariano|dirhams catariano"), - ("Libra esterlina", "libra esterlina|libras esterlinas|gbp"), - ("Coroa checa", "coroa checa|coroas checas|kc|czk"), - ("Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"), - ("Centavo dominicano", "centavo dominicano|centavos dominicanos"), - ("Franco ruandês", "franco ruandês|franco ruandes|francos ruandeses|rf|rwf"), - ("Céntimo ruandês", "cêntimo ruandês|centimo ruandes|centavo ruandês|centavo ruandes|cêntimos ruandeses|centimos ruandeses|centavos ruandeses"), - ("Leu romeno", "leu romeno|lei romenos|leus romenos|ron"), - ("Ban romeno", "ban romeno|bani romeno|bans romenos"), - ("Rublo russo", "rublo russo|rublos russos|rub|р."), - ("Copeque ruso", "copeque russo|copeques russos|kopek ruso|kopeks rusos|copeque|copeques|kopek|kopeks"), - ("Tala samoano", "tala|tālā|talas|tala samonano|talas samoanos|ws$|sat|wst"), - ("Sene samoano", "sene"), - ("Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"), - ("Pêni de Santa Helena", "peni de santa helena|penies de santa helena"), - ("Dobra", "dobra|dobras|db|std"), - ("Dinar sérvio", "dinar sérvio|dinar servio|dinar serbio|dinares sérvios|dinares servios|dinares serbios|rsd"), - ("Para sérvio", "para sérvio|para servio|para serbio|paras sérvios|paras servios|paras serbios"), - ("Rupia seichelense", "rupia de seicheles|rupias de seicheles|rupia seichelense|rupias seichelenses|scr"), - ("Centavo seichelense", "centavo de seicheles|centavos de seicheles|centavo seichelense|centavos seichelenses"), - ("Leone serra-leonino", "leone|leones|leone serra-leonino|leones serra-leoninos|le|sll"), - ("Dólar de Cingapura", "dólar de singapura|dolar de singapura|dórar de cingapura|dolar de cingapura|dólares de singapura|dolares de singapura|dólares de cingapura|dolares de cingapura|sgb"), - ("Centavo de Cingapura", "centavo de singapura|centavos de singapura|centavo de cingapura|centavos de cingapura"), - ("Libra síria", "libra síria|libra siria|libras sírias|libras sirias|s£|syp"), - ("Piastra síria", "piastra siria|piastras sirias|piastra síria|piastras sírias"), - ("Xelim somali", "xelim somali|xelins somalis|xelim somaliano|xelins somalianos|sos"), - ("Centavo somali", "centavo somapli|centavos somalis|centavo somaliano|centavos somalianos"), - ("Xelim da Somalilândia", "xelim da somalilândia|xelins da somalilândia|xelim da somalilandia|xelins da somalilandia"), - ("Centavo da Somalilândia", "centavo da somalilândia|centavos da somalilândia|centavo da somalilandia|centavos da somalilandia"), - ("Rupia do Sri Lanka", "rupia do sri lanka|rupia do sri lanca|rupias do sri lanka|rupias do sri lanca|rupia cingalesa|rupias cingalesas|lkr"), - ("Lilangeni", "lilangeni|lilangenis|emalangeni|szl"), - ("Rand sul-africano", "rand|rand sul-africano|rands|rands sul-africanos|zar"), - ("Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"), - ("Piastra sudanesa", "piastra sudanesa|piastras sudanesas"), - ("Libra sul-sudanesa", "libra sul-sudanesa|libras sul-sudanesas|ssp"), - ("Piastra sul-sudanesa", "piastra sul-sudanesa|piastras sul-sudanesas"), - ("Coroa sueca", "coroa sueca|coroas suecas|sek"), - ("Franco suíço", "franco suíço|franco suico|francos suíços|francos suicos|sfr|chf"), - ("Rappen suíço", "rappen suíço|rappen suico|rappens suíços|rappens suicos"), - ("Dólar surinamês", "dólar surinamês|dolar surinames|dólar do Suriname|dolar do Suriname|dólares surinameses|dolares surinameses|dólares do Suriname|dolares do Suriname|srd"), - ("Centavo surinamês", "centavo surinamês|centavo surinames|centavos surinameses"), - ("Baht tailandês", "baht tailandês|bath tailandes|baht tailandeses|thb"), - ("Satang tailandês", "satang tailandês|satang tailandes|satang tailandeses"), - ("Novo dólar taiwanês", "novo dólar taiwanês|novo dolar taiwanes|dólar taiwanês|dolar taiwanes|dólares taiwaneses|dolares taiwaneses|twd"), - ("Centavo taiwanês", "centavo taiwanês|centavo taiwanes|centavos taiwaneses"), - ("Xelim tanzaniano", "xelim tanzaniano|xelins tanzanianos|tzs"), - ("Centavo tanzaniano", "centavo tanzaniano|centavos tanzanianos"), - ("Somoni tajique", "somoni tajique|somoni|somonis tajiques|somonis|tjs"), - ("Diram tajique", "diram tajique|dirams tajiques|dirames tajiques"), - ("Paʻanga", "paanga|paangas|paʻanga|pa'anga|top"), - ("Seniti", "seniti"), - ("Rublo transdniestriano", "rublo transdniestriano|rublos transdniestriano"), - ("Copeque transdniestriano", "copeque transdniestriano|copeques transdniestriano"), - ("Dólar de Trinidade e Tobago", "dólar de trinidade e tobago|dólares trinidade e tobago|dolar de trinidade e tobago|dolares trinidade e tobago|dólar de trinidad e tobago|dólares trinidad e tobago|ttd"), - ("Centavo de Trinidade e Tobago", "centavo de trinidade e tobago|centavos de trinidade e tobago|centavo de trinidad e tobago|centavos de trinidad e tobago"), - ("Dinar tunisiano", "dinar tunisiano|dinares tunisianos|dinar tunisino|dinares tunisinos|tnd"), - ("Milim tunisiano", "milim tunisiano|milim tunesianos|millime tunisianos|millimes tunisianos|milim tunisino|milim tunisinos|millime tunisinos|millimes tunisinos"), - ("Lira turca", "lira turca|liras turcas|try"), - ("Kuruş turco", "kuruş turco|kuruş turcos"), - ("Manat turcomeno", "manat turcomeno|manats turcomenos|tmt"), - ("Tennesi turcomeno", "tennesi turcomeno|tennesis turcomenos|tenge turcomenos|tenges turcomenos"), - ("Dólar tuvaluano", "dólar tuvaluano|dolar tuvaluano|dólares tuvaluanos|dolares tuvaluanos"), - ("Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"), - ("Grívnia", "grívnia|grivnia|grívnias|grivnias|grivna|grivnas|uah"), - ("Copeque ucraniano", "kopiyka|copeque ucraniano|copeques ucranianos"), - ("Xelim ugandês", "xelim ugandês|xelim ugandes|xelins ugandeses|ugx"), - ("Centavo ugandês", "centavo ugandês|centavo ugandes|centavos ugandeses"), - ("Peso uruguaio", "peso uruguaio|pesos uruguayis|uyu"), - ("Centésimo uruguayo", "centésimo uruguaio|centesimo uruguaio|centésimos uruguaios|centesimos uruguaios"), - ("Som uzbeque", "som uzbeque|som uzbeques|soms uzbeques|somes uzbeques|som usbeque|som usbeques|soms usbeques|somes usbeques|uzs"), - ("Tiyin uzbeque", "tiyin uzbeque|tiyin uzbeques|tiyins uzbeques|tiyin usbeque|tiyin usbeques|tiyins usbeques"), - ("Vatu", "vatu|vatus|vuv"), - ("Bolívar forte venezuelano", "bolívar forte|bolivar forte|bolívar|bolivar|bolívares|bolivares|vef"), - ("Centavo de bolívar", "cêntimo de bolívar|cêntimos de bolívar|centavo de bolívar|centavo de bolivar|centavos de bolívar|centavos de bolivar"), - ("Dongue vietnamita", "dongue vietnamita|Đồng vietnamita|dong vietnamita|dongues vietnamitas|dongs vietnamitas|vnd"), - ("Hào vietnamita", "hào vietnamita|hao vietnamita|hào vietnamitas|hàos vietnamitas|haos vietnamitas"), - ("Rial iemenita", "rial iemenita|riais iemenitas|yer"), - ("Fils iemenita", "fils iemenita|fils iemenitas"), - ("Franco djibutiano", "franco djibutiano|francos djibutianos|franco jibutiano|francos jibutianos|djf"), - ("Dinar iugoslavo", "dinar iugoslavo|dinares iugoslavos|dinar jugoslavo|dinares jugoslavos|yud"), - ("Kwacha zambiano", "kwacha zambiano|kwacha zambianos|kwachas zambianos|zmw"), - ("Ngwee zambiano", "ngwee zambiano|ngwee zambianos|ngwees zambianos"), - ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), - ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), - ("Satoshi", "satoshi|satoshis")]) - CurrencyNameToIsoCodeMap = dict([("Afegani afegão", "AFN"), - ("Euro", "EUR"), - ("Lek albanês", "ALL"), - ("Kwanza angolano", "AOA"), - ("Dram armênio", "AMD"), - ("Florim arubano", "AWG"), - ("Taka bengali", "BDT"), - ("Ngultrum butanês", "BTN"), - ("Boliviano", "BOB"), - ("Marco da Bósnia e Herzegovina", "BAM"), - ("Pula", "BWP"), - ("Real brasileiro", "BRL"), - ("Lev búlgaro", "BGN"), - ("Riel cambojano", "KHR"), - ("Escudo cabo-verdiano", "CVE"), - ("Colón costarriquenho", "CRC"), - ("Kuna croata", "HRK"), - ("Coroa checa", "CZK"), - ("Nakfa", "ERN"), - ("Birr etíope", "ETB"), - ("Dalasi gambiano", "GMD"), - ("Lari georgiano", "GEL"), - ("Cedi", "GHS"), - ("Quetzal guatemalteco", "GTQ"), - ("Gurde haitiano", "HTG"), - ("Lempira hondurenha", "HNL"), - ("Florim húngaro", "HUF"), - ("Rial iraniano", "IRR"), - ("Rial iemenita", "YER"), - ("Novo shekel israelense", "ILS"), - ("Yen", "JPY"), - ("Tengue cazaque", "KZT"), - ("Xelim queniano", "KES"), - ("Won norte-coreano", "KPW"), - ("Won sul-coreano", "KRW"), - ("Som quirguiz", "KGS"), - ("Quipe laosiano", "LAK"), - ("Loti do Lesoto", "LSL"), - ("Rand sul-africano", "ZAR"), - ("Pataca macaense", "MOP"), - ("Dinar macedônio", "MKD"), - ("Ariary malgaxe", "MGA"), - ("Kwacha do Malawi", "MWK"), - ("Ringuite malaio", "MYR"), - ("Uguia", "MRO"), - ("Tugrik mongol", "MNT"), - ("Metical moçambicao", "MZN"), - ("Quiate mianmarense", "MMK"), - ("Córdova nicaraguense", "NIO"), - ("Naira", "NGN"), - ("Lira turca", "TRY"), - ("Rial omanense", "OMR"), - ("Balboa panamenho", "PAB"), - ("Kina", "PGK"), - ("Guarani", "PYG"), - ("Novo Sol", "PEN"), - ("Złoty", "PLN"), - ("Rial catariano", "QAR"), - ("Rial saudita", "SAR"), - ("Tala samoano", "WST"), - ("São Tomé and Príncipe dobra", "STN"), - ("Leone serra-leonino", "SLL"), - ("Lilangeni", "SZL"), - ("Somoni tajique", "TJS"), - ("Baht tailandês", "THB"), - ("Grívnia", "UAH"), - ("Vatu", "VUV"), - ("Bolívar forte venezuelano", "VEF"), - ("Kwacha zambiano", "ZMW"), - ("Dirame marroquino", "MAD"), - ("Dirham dos Emirados Árabes Unidos", "AED"), - ("Manat azeri", "AZN"), - ("Manat turcomeno", "TMT"), - ("Xelim somali", "SOS"), - ("Xelim tanzaniano", "TZS"), - ("Xelim ugandês", "UGX"), - ("Leu romeno", "RON"), - ("Leu moldávio", "MDL"), - ("Rupia nepalesa", "NPR"), - ("Rupia paquistanesa", "PKR"), - ("Rupia indiana", "INR"), - ("Rupia seichelense", "SCR"), - ("Rupia maurícia", "MUR"), - ("Rupia maldiva", "MVR"), - ("Rupia do Sri Lanka", "LKR"), - ("Rupia indonésia", "IDR"), - ("Coroa dinamarquesa", "DKK"), - ("Coroa norueguesa", "NOK"), - ("Coroa islandesa", "ISK"), - ("Coroa sueca", "SEK"), - ("Franco CFA da África Ocidental", "XOF"), - ("Franco CFA da África Central", "XAF"), - ("Franco comorense", "KMF"), - ("Franco congolês", "CDF"), - ("Burundian franc", "BIF"), - ("Franco djibutiano", "DJF"), - ("Franco CFP", "XPF"), - ("Franco da Guiné", "GNF"), - ("Franco suíço", "CHF"), - ("Franco ruandês", "RWF"), - ("Rublo russo", "RUB"), - ("Transnistrian ruble", "PRB"), - ("New Belarusian ruble", "BYN"), - ("Dinar argelino", "DZD"), - ("Dinar bareinita", "BHD"), - ("Dinar iraquiano", "IQD"), - ("Dinar jordaniano", "JOD"), - ("Dinar kuwaitiano", "KWD"), - ("Dinar libio", "LYD"), - ("Dinar sérvio", "RSD"), - ("Dinar tunisiano", "TND"), - ("Peso argentino", "ARS"), - ("Chilean peso", "CLP"), - ("Peso colombiano", "COP"), - ("Peso cubano convertível", "CUC"), - ("Peso cubano", "CUP"), - ("Peso dominicano", "DOP"), - ("Peso mexicano", "MXN"), - ("Peso uruguaio", "UYU"), - ("Libra esterlina", "GBP"), - ("Libra de Santa Helena", "SHP"), - ("Libra egípcia", "EGP"), - ("Libra das Malvinas", "FKP"), - ("Libra de Gibraltar", "GIP"), - ("Libra manesa", "IMP"), - ("Libra de Jersey", "JEP"), - ("Libra libanesa", "LBP"), - ("Libra sul-sudanesa", "SSP"), - ("Libra sudanesa", "SDG"), - ("Libra síria", "SYP"), - ("Dólar estadunidense", "USD"), - ("Dólar australiano", "AUD"), - ("Dólar bahamense", "BSD"), - ("Dólar de Barbados", "BBD"), - ("Dólar de Belize", "BZD"), - ("Dólar bermudense", "BMD"), - ("Dólar de Brunei", "BND"), - ("Dólar de Cingapura", "SGD"), - ("Dólar canadense", "CAD"), - ("Dólar das Ilhas Cayman", "KYD"), - ("Dólar neozelandês", "NZD"), - ("Dólar fijiano", "FJD"), - ("Dólar guianense", "GYD"), - ("Dólar de Hong Kong", "HKD"), - ("Dólar jamaicano", "JMD"), - ("Dólar liberiano", "LRD"), - ("Dólar namibiano", "NAD"), - ("Dólar das Ilhas Salomão", "SBD"), - ("Dólar surinamês", "SRD"), - ("Novo dólar taiwanês", "TWD"), - ("Dólar de Trinidade e Tobago", "TTD"), - ("Tuvaluan dólar", "TVD"), - ("Yuan chinês", "CNY"), - ("Rial", "__RI"), - ("Xelim", "__S"), - ("Som", "__SO"), - ("Dirame", "__DR"), - ("Dinar", "_DN"), - ("Dólar", "__D"), - ("Manat", "__MA"), - ("Rupia", "__R"), - ("Coroa", "__K"), - ("Krona", "__K"), - ("Franco", "__F"), - ("Marco", "__M"), - ("Rublo", "__RB"), - ("Peso", "__PE"), - ("Libra", "__P"), - ("Tristan da Cunha libra", "_TP"), - ("South Georgia and the South Sandwich Islands libra", "_SP"), - ("Somaliland xelim", "_SS"), - ("Pitcairn Islands dólar", "_PND"), - ("Palauan dólar", "_PD"), - ("Niue dólar", "_NID"), - ("Nauruan dólar", "_ND"), - ("Micronesian dólar", "_MD"), - ("Kiribati dólar", "_KID"), - ("Guernsey libra", "_GGP"), - ("Faroese króna", "_FOK"), - ("Cook Islands dólar", "_CKD"), - ("British Virgin Islands dólar", "_BD"), - ("Ascension libra", "_AP"), - ("Alderney libra", "_ALP"), - ("Abkhazian apsar", "_AA"), - ("Bitcoin", "_XBT")]) - FractionalUnitNameToCodeMap = dict([("Jiao", "JIAO"), - ("Kopek", "KOPEK"), - ("Pul", "PUL"), - ("Cent", "CENT"), - ("Qindarke", "QINDARKE"), - ("Peni", "PENNY"), - ("Santeem", "SANTEEM"), - ("Cêntimo", "CENTIMO"), - ("Centavo", "CENT"), - ("Luma", "LUMA"), - ("Qəpik", "QƏPIK"), - ("Fils", "FILS"), - ("Poisha", "POISHA"), - ("Kapyeyka", "KAPYEYKA"), - ("Centime", "CENTIME"), - ("Chetrum", "CHETRUM"), - ("Paisa", "PAISA"), - ("Fening", "FENING"), - ("Thebe", "THEBE"), - ("Sen", "SEN"), - ("Stotinka", "STOTINKA"), - ("Fen", "FEN"), - ("Céntimo", "CENT"), - ("Lipa", "LIPA"), - ("Haléř", "HALER"), - ("Øre", "ØRE"), - ("Piastre", "PIASTRE"), - ("Santim", "SANTIM"), - ("Oyra", "OYRA"), - ("Butut", "BUTUT"), - ("Tetri", "TETRI"), - ("Pesewa", "PESEWA"), - ("Fillér", "FILLER"), - ("Eyrir", "EYRIR"), - ("Dinar", "DINAR"), - ("Agora", "AGORA"), - ("Tïın", "TIIN"), - ("Chon", "CHON"), - ("Jeon", "JEON"), - ("Tyiyn", "TYIYN"), - ("Att", "ATT"), - ("Sente", "SENTE"), - ("Dirham", "DIRHAM"), - ("Rappen", "RAPPEN"), - ("Avo", "AVO"), - ("Deni", "DENI"), - ("Iraimbilanja", "IRAIMBILANJA"), - ("Tambala", "TAMBALA"), - ("Laari", "LAARI"), - ("Khoums", "KHOUMS"), - ("Ban", "BAN"), - ("Möngö", "MONGO"), - ("Pya", "PYA"), - ("Kobo", "KOBO"), - ("Kuruş", "KURUS"), - ("Baisa", "BAISA"), - ("Centésimo", "CENTESIMO"), - ("Toea", "TOEA"), - ("Sentimo", "SENTIMO"), - ("Grosz", "GROSZ"), - ("Sene", "SENE"), - ("Halala", "HALALA"), - ("Para", "PARA"), - ("Öre", "ORE"), - ("Diram", "DIRAM"), - ("Satang", "SATANG"), - ("Seniti", "SENITI"), - ("Millime", "MILLIME"), - ("Tennesi", "TENNESI"), - ("Kopiyka", "KOPIYKA"), - ("Tiyin", "TIYIN"), - ("Hào", "HAO"), - ("Ngwee", "NGWEE"), - ("Millibitcoin", "MILLIBITCOIN"), - ("Satoshi", "SATOSHI")]) - CompoundUnitConnectorRegex = f'\\b(?e|com)\\b' - MultiplierRegex = f'\\s*\\b(mil(h([ãa]o|[õo]es))?|bilh([ãa]o|[õo]es)|trilh([ãa]o|[õo]es)|qua[td]rilh([ãa]o|[õo]es)|quintilh([ãa]o|[õo]es))\\b' - CurrencyPrefixList = dict([("Dólar", "$|dólar|dolar|dólares|dolares"), - ("Dólar estadunidense", "us$|u$d|usd$|usd"), - ("Dólar do Caribe Oriental", "ec$|xcd"), - ("Dólar australiano", "a$|aud"), - ("Dólar bahamense", "b$|bsd"), - ("Dólar de Barbados", "bds$|bbd"), - ("Dólar de Belize", "bz$|bzd"), - ("Dólar bermudense", "bd$|bmd"), - ("Dólar de Brunei", "brunéi $|bnd"), - ("Dólar de Cingapura", "s$|sgd"), - ("Dólar canadense", "c$|can$|cad"), - ("Dólar das Ilhas Cayman", "ci$|kyd"), - ("Dólar neozelandês", "nz$|nzd"), - ("Dólar fijiano", "fj$|fjd"), - ("Dólar guianense", "gy$|gyd"), - ("Dólar de Hong Kong", "hk$|hkd"), - ("Dólar jamaicano", "j$|ja$|jmd"), - ("Dólar liberiano", "l$|lrd"), - ("Dólar namibiano", "n$|nad"), - ("Dólar das Ilhas Salomão", "si$|sbd"), - ("Novo dólar taiwanês", "nt$|twd"), - ("Real brasileiro", "r$|brl"), - ("Guarani", "₲|gs.|pyg"), - ("Dólar de Trinidade e Tobago", "tt$|ttd"), - ("Yuan chinês", "¥|cny|rmb"), - ("Yen", "¥|jpy"), - ("Euro", "€|eur"), - ("Florim", "ƒ"), - ("Libra", "£"), - ("Colón costarriquenho", "₡"), - ("Lira turca", "₺"), - ("Bitcoin", "₿|btc|xbt")]) + CurrencySuffixList = dict( + [ + ("Dólar", "dólar|dolar|dólares|dolares"), + ("Peso", "peso|pesos"), + ("Coroa", "coroa|coroas"), + ("Rublo", "rublo|rublos"), + ("Libra", "libra|libras"), + ("Florim", "florim|florins|ƒ"), + ("Dinar", "dinar|dinares"), + ("Franco", "franco|francos"), + ("Rupia", "rúpia|rupia|rúpias|rupias"), + ("Escudo", "escudo|escudos"), + ("Xelim", "xelim|xelins|xelims"), + ("Lira", "lira|liras"), + ("Centavo", "centavo|cêntimo|centimo|centavos|cêntimos|centimo"), + ("Centésimo", "centésimo|centésimos"), + ("Pêni", "pêni|péni|peni|penies|pennies"), + ("Manat", "manat|manate|mánate|man|manats|manates|mánates"), + ("Euro", "euro|euros|€|eur"), + ( + "Centavo de Euro", + "centavo de euro|cêntimo de euro|centimo de euro|centavos de euro|cêntimos de euro|centimos de euro", + ), + ( + "Dólar do Caribe Oriental", + "dólar do Caribe Oriental|dolar do Caribe Oriental|dólares do Caribe Oriental|dolares do Caribe Oriental|dólar das Caraíbas Orientais|dolar das Caraibas Orientais|dólares das Caraíbas Orientais|dolares das Caraibas Orientais|ec$|xcd", + ), + ( + "Centavo do Caribe Oriental", + "centavo do Caribe Oriental|centavo das Caraíbas Orientais|cêntimo do Caribe Oriental|cêntimo das Caraíbas Orientais|centavos do Caribe Oriental|centavos das Caraíbas Orientais|cêntimos do Caribe Oriental|cêntimos das Caraíbas Orientais", + ), + ( + "Franco CFA da África Ocidental", + "franco CFA da África Ocidental|franco CFA da Africa Ocidental|francos CFA da África Occidental|francos CFA da Africa Occidental|franco CFA Ocidental|xof", + ), + ( + "Centavo de CFA da África Ocidental", + "centavo de CFA da Africa Occidental|centavos de CFA da África Ocidental|cêntimo de CFA da Africa Occidental|cêntimos de CFA da África Ocidental", + ), + ( + "Franco CFA da África Central", + "franco CFA da África Central|franco CFA da Africa Central|francos CFA da África Central|francos CFA da Africa Central|franco CFA central|xaf", + ), + ( + "Centavo de CFA da África Central", + "centavo de CFA de África Central|centavos de CFA da África Central|cêntimo de CFA de África Central|cêntimos de CFA da África Central", + ), + ("Apsar abcásio", "apsar abcásio|apsar abecásio|apsar abcasio|apsar|apsares"), + ( + "Afegani afegão", + "afegani afegão|afegane afegão|؋|afn|afegane|afgane|afegâni|afeganis|afeganes|afganes|afegânis", + ), + ("Pul", "pul|pules|puls"), + ("Lek albanês", "lek|lekë|lekes|lek albanês|leque|leques|all"), + ("Qindarke", "qindarka|qindarkë|qindarke|qindarkas"), + ("Kwanza angolano", "kwanza angolano|kwanzas angolanos|kwanza|kwanzas|aoa|kz"), + ("Cêntimo angolano", "cêntimo angolano"), + ("Florim das Antilhas Holandesas", "florim das antilhas holandesas|florim das antilhas neerlandesas|ang"), + ("Rial saudita", "rial saudita|riais sauditas|riyal saudita|riyals sauditas|riyal|riyals|sar"), + ("Halala saudita", "halala saudita|halala|hallalah"), + ("Dinar argelino", "dinar argelino|dinares argelinos|dzd"), + ( + "Cêntimo argelino", + "centimo argelino|centimos argelinos|cêntimo argelino|cêntimos argelinos|centavo argelino|centavos argelinos", + ), + ("Peso argentino", "peso argentino|pesos argentinos|ar$|ars"), + ("Centavo argentino", "centavo argentino|centavos argentinos|ctvo.|ctvos."), + ( + "Dram armênio", + "dram armênio|dram armênios|dram arménio|dram arménios|dram armenio|dram armenios|dram|drame|drames|դր.", + ), + ( + "Luma armênio", + "luma armênio|lumas armênios|luma arménio|lumas arménios|luma armenio|lumas armenios|luma|lumas", + ), + ("Florim arubano", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"), + ( + "Dólar australiano", + "dólar australiano|dólares australianos|dolar australiano|dolares australianos|a$|aud", + ), + ("Centavo australiano", "centavo australiano|centavos australianos"), + ( + "Manat azeri", + "manat azeri|manats azeris|azn|manat azerbaijanês|manat azerbaijano|manats azerbaijaneses|manats azerbaijanos", + ), + ("Qəpik azeri", "qəpik azeri|qəpik|qəpiks"), + ( + "Dólar bahamense", + "dólar bahamense|dólares bahamense|dolar bahamense|dolares bahamense|dólar baamiano|dólares baamiano|dolar baamiano|dolares baamiano|b$|bsd", + ), + ("Centavo bahamense", "centavo bahamense|centavos bahamense"), + ("Dinar bareinita", "dinar bareinita|dinar baremita|dinares bareinitas|dinares baremitas|bhd"), + ("Fil bareinita", "fil bareinita|fil baremita|fils bareinitas|fils baremitas"), + ("Taka bengali", "taka bengali|takas bengalis|taca|tacas|taka|takas|bdt"), + ("Poisha bengali", "poisha bengali|poishas bengalis"), + ( + "Dólar de Barbados", + "dólar de barbados|dólares de barbados|dolar de barbados|dolares de barbados|dólar dos barbados|dólares dos barbados|bbd", + ), + ( + "Centavo de Barbados", + "centavo de barbados|centavos de barbados|centavo dos barbados|centavos dos barbados", + ), + ( + "Dólar de Belize", + "dólar de belize|dólares de belize|dolar de belize|dolares de belize|dólar do belize|dólares do belize|dolar do belize|dolares do belize|bz$|bzd", + ), + ("Centavo de Belize", "centavo de belize|centavos de belize|cêntimo do belize|cêntimos do belize"), + ("Dólar bermudense", "dólar bermudense|dólares bermudenses|bd$|bmd"), + ("Centavo bermudense", "centavo bermudense|centavos bermudenses|cêntimo bermudense| cêntimos bermudenses"), + ("Rublo bielorrusso", "rublo bielorrusso|rublos bielorrussos|byr"), + ( + "Copeque bielorusso", + "copeque bielorrusso|copeques bielorrussos|kopek bielorrusso|kopeks bielorrussos|kap", + ), + ( + "Quiate mianmarense", + "quiate mianmarense|quiates mianmarenses|kyat mianmarense|kyates mianmarenses|quiate myanmarense|quiates myanmarenses|kyat myanmarense|kyates myanmarenses|quiate birmanês|quite birmanes|quiates birmaneses|kyat birmanês|kyat birmanes|kyates birmaneses|mmk", + ), + ( + "Pya mianmarense", + "pya mianmarense|pyas mianmarenses|pya myanmarense|pyas myanmarenses|pya birmanês|pya birmanes|pyas birmaneses", + ), + ("Boliviano", "boliviano|bolivianos|bob|bs"), + ("Centavo Boliviano", "centavo boliviano|centavos bolivianos"), + ( + "Marco da Bósnia e Herzegovina", + "marco conversível|marco conversivel|marco convertível|marco convertivel|marcos conversíveis|marcos conversiveis|marcos convertíveis|marcos convertivies|bam", + ), + ( + "Fening da Bósnia e Herzegovina", + "fening conversível|fening conversivel|fening convertível|fening convertivel|fenings conversíveis|fenings conversiveis|fenings convertíveis|fenings convertiveis", + ), + ("Pula", "pula|pulas|bwp"), + ("Thebe", "thebe|thebes"), + ("Real brasileiro", "real brasileiro|real do brasil|real|reais brasileiros|reais do brasil|reais|r$|brl"), + ("Centavo brasileiro", "centavo de real|centavo brasileiro|centavos de real|centavos brasileiros"), + ( + "Dólar de Brunei", + "dólar de brunei|dolar de brunei|dólar do brunei|dolar do brunei|dólares de brunéi|dolares de brunei|dólares do brunei|dolares do brunei|bnd", + ), + ("Sen de Brunei", "sen de brunei|sen do brunei|sens de brunei|sens do brunei"), + ("Lev búlgaro", "lev búlgaro|leve búlgaro|leves búlgaros|lev bulgaro|leve bulgaro|leves bulgaros|lv|bgn"), + ("Stotinka búlgaro", "stotinka búlgaro|stotinki búlgaros|stotinka bulgaro|stotinki bulgaros"), + ("Franco do Burundi", "franco do burundi|francos do burundi|fbu|fib"), + ( + "Centavo Burundi", + "centavo burundi|cêntimo burundi|centimo burundi|centavos burundi|cêntimo burundi|centimo burundi", + ), + ( + "Ngultrum butanês", + "ngultrum butanês|ngultrum butanes|ngúltrume butanês|ngultrume butanes|ngultrum butaneses|ngúltrumes butaneses|ngultrumes butaneses|btn", + ), + ("Chetrum butanês", "chetrum butanês|chetrum butanes|chetrum butaneses"), + ("Escudo cabo-verdiano", "escudo cabo-verdiano|escudos cabo-verdianos|cve"), + ("Riel cambojano", "riel cambojano|riéis cambojanos|rieis cambojanos|khr"), + ("Dólar canadense", "dólar canadense|dolar canadense|dólares canadenses|dolares canadenses|c$|cad"), + ("Centavo canadense", "centavo canadense|centavos canadenses"), + ("Peso chileno", "peso chileno|pesos chilenos|cpl"), + ("Yuan chinês", "yuan chinês|yuan chines|yuans chineses|yuan|yuans|renminbi|rmb|cny|¥"), + ("Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"), + ("Centavo colombiano", "centavo colombiano|centavos colombianos"), + ("Franco comorense", "franco comorense|francos comorenses|kmf|₣"), + ("Franco congolês", "franco congolês|franco congoles|francos congoleses|cdf"), + ( + "Centavo congolês", + "centavo congolês|centavo congoles|centavos congoleses|cêntimo congolês|centimo congoles|cêntimos congoleses|cêntimos congoleses", + ), + ("Won norte-coreano", "won norte-coreano|wŏn norte-coreano|won norte-coreanos|wŏn norte-coreanos|kpw"), + ("Chon norte-coreano", "chon norte-coreano|chŏn norte-coreano|chŏn norte-coreanos|chon norte-coreanos"), + ("Won sul-coreano", "wŏn sul-coreano|won sul-coreano|wŏnes sul-coreanos|wones sul-coreanos|krw"), + ("Jeon sul-coreano", "jeons sul-coreano|jeons sul-coreanos"), + ( + "Colón costarriquenho", + "colón costarriquenho|colon costarriquenho|colons costarriquenho|colones costarriquenhos|crc", + ), + ("Kuna croata", "kuna croata|kunas croatas|hrk"), + ("Lipa croata", "lipa croata|lipas croatas"), + ("Peso cubano", "peso cubano|pesos cubanos|cup"), + ( + "Peso cubano convertível", + "peso cubano conversível|pesos cubanos conversíveis|peso cubano conversivel|pesos cubanos conversiveis|peso cubano convertível|pesos cubanos convertíveis|peso cubano convertivel|pesos cubanos convertiveis|cuc", + ), + ("Coroa dinamarquesa", "coroa dinamarquesa|coroas dinamarquesas|dkk"), + ("Libra egípcia", "libra egípcia|libra egipcia|libras egípcias|libras egipcias|egp|l.e."), + ("Piastra egípcia", "piastra egípcia|piastra egipcia|pisastras egípcias|piastras egipcias"), + ("Dirham dos Emirados Árabes Unidos", "dirham|dirhams|dirham dos emirados arabes unidos|aed|dhs"), + ("Nakfa", "nakfa|nfk|ern"), + ("Centavo de Nakfa", "cêntimo de nakfa|cêntimos de nakfa|centavo de nafka|centavos de nafka"), + ("Peseta", "peseta|pesetas|pts.|ptas.|esp"), + ( + "Dólar estadunidense", + "dólar dos estados unidos|dolar dos estados unidos|dólar estadunidense|dólar americano|dólares dos estados unidos|dolares dos estados unidos|dólares estadunidenses|dólares americanos|dolar estadunidense|dolar americano|dolares estadunidenses|dolares americanos|usd|u$d|us$|usd$", + ), + ("Coroa estoniana", "coroa estoniana|coroas estonianas|eek"), + ("Senti estoniano", "senti estoniano|senti estonianos"), + ("Birr etíope", "birr etíope|birr etiope|birr etíopes|birr etiopes|br|etb"), + ("Santim etíope", "santim etíope|santim etiope|santim etíopes|santim etiopes"), + ("Peso filipino", "peso filipino|pesos filipinos|php"), + ("Marco finlandês", "marco finlandês|marco finlandes|marcos finlandeses"), + ("Dólar fijiano", "dólar fijiano|dolar fijiano|dólares fijianos|dolares fijianos|fj$|fjd"), + ("Centavo fijiano", "centavo fijiano|centavos fijianos"), + ("Dalasi gambiano", "dalasi|gmd"), + ("Bututs", "butut|bututs"), + ("Lari georgiano", "lari georgiano|lari georgianos|gel"), + ("Tetri georgiano", "tetri georgiano|tetri georgianos"), + ("Cedi", "cedi|ghs|gh₵"), + ("Pesewa", "pesewa"), + ("Libra de Gibraltar", "libra de gibraltar|libras de gibraltar|gip"), + ("Peni de Gibraltar", "peni de gibraltar|penies de gibraltar"), + ("Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"), + ("Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"), + ("Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"), + ("Peni de Guernsey", "peni de Guernsey|penies de Guernsey"), + ( + "Franco da Guiné", + "franco da guiné|franco da guine| franco guineense|francos da guiné|francos da guine|francos guineense|gnf|fg", + ), + ( + "Centavo da Guiné", + "cêntimo guineense|centimo guineense|centavo guineense|cêntimos guineenses|centimos guineenses|centavos guineenses", + ), + ("Dólar guianense", "dólar guianense|dólares guianense|dolar guianense|dolares guianense|gyd|gy"), + ("Gurde haitiano", "gurde haitiano|gourde|gurdes haitianos|htg"), + ("Centavo haitiano", "cêntimo haitiano|cêntimos haitianos|centavo haitiano|centavos haitianos"), + ("Lempira hondurenha", "lempira hondurenha|lempiras hondurenhas|lempira|lempiras|hnl"), + ("Centavo hondurenho", "centavo hondurenho|centavos hondurehos|cêntimo hondurenho|cêntimos hondurenhos"), + ( + "Dólar de Hong Kong", + "dólar de hong kong|dolar de hong kong|dólares de hong kong|dolares de hong kong|hk$|hkd", + ), + ("Florim húngaro", "florim húngaro|florim hungaro|florins húngaros|florins hungaros|forinte|forintes|huf"), + ("Filér húngaro", "fillér|filér|filler|filer"), + ("Rupia indiana", "rúpia indiana|rupia indiana|rupias indianas|inr"), + ("Paisa indiana", "paisa indiana|paisas indianas"), + ("Rupia indonésia", "rupia indonesia|rupia indonésia|rupias indonesias|rupias indonésias|idr"), + ("Sen indonésio", "send indonésio|sen indonesio|sen indonésios|sen indonesios"), + ("Rial iraniano", "rial iraniano|riais iranianos|irr"), + ("Dinar iraquiano", "dinar iraquiano|dinares iraquianos|iqd"), + ("Fil iraquiano", "fil iraquiano|fils iraquianos|files iraquianos"), + ("Libra manesa", "libra manesa|libras manesas|imp"), + ("Peni manês", "peni manes|peni manês|penies maneses"), + ("Coroa islandesa", "coroa islandesa|coroas islandesas|isk|íkr"), + ("Aurar islandês", "aurar islandês|aurar islandes|aurar islandeses|eyrir"), + ( + "Dólar das Ilhas Cayman", + "dólar das ilhas cayman|dolar das ilhas cayman|dólar das ilhas caimão|dólares das ilhas cayman|dolares das ilhas cayman|dólares das ilhas caimão|ci$|kyd", + ), + ( + "Dólar das Ilhas Cook", + "dólar das ilhas cook|dolar das ilhas cook|dólares das ilhas cook|dolares das ilhas cook", + ), + ("Coroa feroesa", "coroa feroesa|coroas feroesas|fkr"), + ("Libra das Malvinas", "libra das malvinas|libras das malvinas|fk£|fkp"), + ( + "Dólar das Ilhas Salomão", + "dólar das ilhas salomão|dolar das ilhas salomao|dólares das ilhas salomão|dolares das ilhas salomao|sbd", + ), + ( + "Novo shekel israelense", + "novo shekel|novos shekeles|novo shequel|novo siclo|novo xéquel|shekeles novos|novos sheqalim|sheqalim novos|ils|₪", + ), + ("Agora", "agora|agorot"), + ("Dólar jamaicano", "dólar jamaicano|dolar jamaicano|dólares jamaicanos|dolares jamaicanos|j$|ja$|jmd"), + ("Yen", "yen|iene|yenes|ienes|jpy"), + ("Libra de Jersey", "libra de Jersey|libras de Jersey|jep"), + ("Dinar jordaniano", "dinar jordaniano|dinar jordano|dinares jordanianos|dinares jordanos|jd|jod"), + ( + "Piastra jordaniana", + "piastra jordaniana|piastra jordano|piastras jordanianas|piastra jordaniano|piastras jordanianos|piastras jordanos", + ), + ("Tengue cazaque", "tenge|tengue|tengué|tengue cazaque|kzt"), + ("Tiyin", "tiyin|tiyins"), + ("Xelim queniano", "xelim queniano|xelins quenianos|ksh|kes"), + ("Som quirguiz", "som quirguiz|som quirguizes|soms quirguizes|kgs"), + ("Tyiyn", "tyiyn|tyiyns"), + ("Dólar de Kiribati", "dólar de kiribati|dolar de kiribati|dólares de kiribati|dolares de kiribati"), + ("Dinar kuwaitiano", "dinar kuwaitiano|dinar cuaitiano|dinares kuwaitiano|dinares cuaitianos|kwd"), + ( + "Quipe laosiano", + "quipe|quipes|kipe|kipes|kip|kip laosiano|kip laociano|kips laosianos|kips laocianos|lak", + ), + ("Att laosiano", "at|att|att laosiano|att laosianos"), + ("Loti do Lesoto", "loti|lóti|maloti|lotis|lótis|lsl"), + ("Sente", "sente|lisente"), + ("Libra libanesa", "libra libanesa|libras libanesas|lbp"), + ("Dólar liberiano", "dólar liberiano|dolar liberiano|dólares liberianos|dolares liberianos|l$|lrd"), + ("Dinar libio", "dinar libio|dinar líbio|dinares libios|dinares líbios|ld|lyd"), + ("Dirham libio", "dirham libio|dirhams libios|dirham líbio|dirhams líbios"), + ("Litas lituana", "litas lituana|litai lituanas|ltl"), + ("Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"), + ("Avo macaense", "avo macaense|avos macaenses"), + ("Ho macaense", "ho macaense|ho macaenses"), + ( + "Dinar macedônio", + "denar macedonio|denare macedonios|denar macedônio|denar macedónio|denare macedônio|denare macedónio|dinar macedonio|dinar macedônio|dinar macedónio|dinares macedonios|dinares macedônios|dinares macedónios|den|mkd", + ), + ( + "Deni macedônio", + "deni macedonio|deni macedônio|deni macedónio|denis macedonios|denis macedônios|denis macedónios", + ), + ("Ariary malgaxe", "ariai malgaxe|ariary malgaxe|ariary malgaxes|ariaris|mga"), + ("Iraimbilanja", "iraimbilanja|iraimbilanjas"), + ( + "Ringuite malaio", + "ringgit malaio|ringgit malaios|ringgits malaios|ringuite malaio|ringuites malaios|rm|myr", + ), + ("Sen malaio", "sen malaio|sen malaios|centavo malaio|centavos malaios|cêntimo malaio|cêntimos malaios"), + ("Kwacha do Malawi", "kwacha|cuacha|quacha|mk|mwk"), + ("Tambala", "tambala|tambalas|tambala malawi"), + ("Rupia maldiva", "rupia maldiva|rupias maldivas|rupia das maldivas| rupias das maldivas|mvr"), + ("Dirame marroquino", "dirame marroquino|dirham marroquinho|dirhams marroquinos|dirames marroquinos|mad"), + ( + "Rupia maurícia", + "rupia maurícia|rupia de Maurício|rupia mauricia|rupia de mauricio|rupias de mauricio|rupias de maurício|rupias mauricias|rupias maurícias|mur", + ), + ("Uguia", "uguia|uguias|oguia|ouguiya|oguias|mro"), + ("Kume", "kumes|kume|khoums"), + ("Peso mexicano", "peso mexicano|pesos mexicanos|mxn"), + ("Centavo mexicano", "centavo mexicano|centavos mexicanos"), + ( + "Leu moldávio", + "leu moldavo|lei moldavos|leu moldávio|leu moldavio|lei moldávios|lei moldavios|leus moldavos|leus moldavios|leus moldávios|mdl", + ), + ("Ban moldávio", "ban moldavo|bani moldavos"), + ("Tugrik mongol", "tugrik mongol|tugrik|tugriks mongóis|tugriks mongois|tug|mnt"), + ( + "Metical moçambicao", + "metical|metical moçambicano|metical mocambicano|meticais|meticais moçambicanos|meticais mocambicanos|mtn|mzn", + ), + ("Dólar namibiano", "dólar namibiano|dólares namibianos|dolar namibio|dolares namibios|n$|nad"), + ("Centavo namibiano", "centavo namibiano|centavos namibianos|centavo namibio|centavos namibianos"), + ("Rupia nepalesa", "rupia nepalesa|rupias nepalesas|npr"), + ("Paisa nepalesa", "paisa nepalesa|paisas nepalesas"), + ( + "Córdova nicaraguense", + "córdova nicaraguense|cordova nicaraguense|cordova nicaraguana|córdoba nicaragüense|córdobas nicaragüenses|cordobas nicaraguenses|córdovas nicaraguenses|cordovas nicaraguenses|córdovas nicaraguanasc$|nio", + ), + ( + "Centavo nicaraguense", + "centavo nicaragüense|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguanos", + ), + ("Naira", "naira|ngn"), + ("Kobo", "kobo"), + ("Coroa norueguesa", "coroa norueguesa|coroas norueguesas|nok"), + ("Franco CFP", "franco cfp|francos cfp|xpf"), + ( + "Dólar neozelandês", + "dólar neozelandês|dolar neozelandes|dólares neozelandeses|dolares neozelandeses|dólar da nova zelândia|dolar da nova zelandia|dólares da nova zelândia|dolares da nova zelandia|nz$|nzd", + ), + ( + "Centavo neozelandês", + "centavo neozelandês|centavo neozelandes|centavo da nova zelandia|centavo da nova zelândia|centavos da nova zelandia|centavos neozelandeses|centavos da nova zelândia", + ), + ("Rial omanense", "rial omani|riais omanis|rial omanense|riais omanenses|omr"), + ("Baisa omanense", "baisa omani|baisas omanis|baisa omanense|baisas omanenses"), + ("Florim holandês", "florim holandês|florim holandes|florins holandeses|nlg"), + ("Rupia paquistanesa", "rupia paquistanesa|rupias paquistanesas|pkr"), + ("Paisa paquistanesa", "paisa paquistanesa|paisas paquistanesasas"), + ("Balboa panamenho", "balboa panamenho|balboas panamenhos|balboa|pab|balboa panamense|balboas panamenses"), + ( + "Centavo panamenho", + "centavo panamenho|cêntimo panamenho|centavos panamenhos|cêntimos panamenhos|cêntimo panamense|cêntimos panamenses", + ), + ("Kina", "kina|kina papuásia|kinas|kinas papuásias|pkg|pgk"), + ("Toea", "toea"), + ("Guarani", "guarani|guaranis|gs|pyg"), + ("Novo Sol", "novo sol peruano|novos sóis peruanos|sol|soles|sóis|nuevo sol|pen|s#."), + ("Centavo de sol", "cêntimo de sol|cêntimos de sol|centavo de sol|centavos de sol"), + ("Złoty", "złoty|złotys|zloty|zlotys|zloti|zlotis|zlóti|zlótis|zlote|zł|pln"), + ("Groszy", "groszy|grosz"), + ( + "Rial catariano", + "rial qatari|riais qataris|rial catarense|riais catarenses|rial catariano|riais catarianos|qr|qar", + ), + ( + "Dirame catariano", + "dirame catariano|dirames catarianos|dirame qatari|dirames qataris|dirame catarense|dirames catarenses|dirham qatari|dirhams qataris|dirham catarense|dirhams catarenses|dirham catariano|dirhams catariano", + ), + ("Libra esterlina", "libra esterlina|libras esterlinas|gbp"), + ("Coroa checa", "coroa checa|coroas checas|kc|czk"), + ("Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"), + ("Centavo dominicano", "centavo dominicano|centavos dominicanos"), + ("Franco ruandês", "franco ruandês|franco ruandes|francos ruandeses|rf|rwf"), + ( + "Céntimo ruandês", + "cêntimo ruandês|centimo ruandes|centavo ruandês|centavo ruandes|cêntimos ruandeses|centimos ruandeses|centavos ruandeses", + ), + ("Leu romeno", "leu romeno|lei romenos|leus romenos|ron"), + ("Ban romeno", "ban romeno|bani romeno|bans romenos"), + ("Rublo russo", "rublo russo|rublos russos|rub|р."), + ("Copeque ruso", "copeque russo|copeques russos|kopek ruso|kopeks rusos|copeque|copeques|kopek|kopeks"), + ("Tala samoano", "tala|tālā|talas|tala samonano|talas samoanos|ws$|sat|wst"), + ("Sene samoano", "sene"), + ("Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"), + ("Pêni de Santa Helena", "peni de santa helena|penies de santa helena"), + ("Dobra", "dobra|dobras|db|std"), + ( + "Dinar sérvio", + "dinar sérvio|dinar servio|dinar serbio|dinares sérvios|dinares servios|dinares serbios|rsd", + ), + ("Para sérvio", "para sérvio|para servio|para serbio|paras sérvios|paras servios|paras serbios"), + ("Rupia seichelense", "rupia de seicheles|rupias de seicheles|rupia seichelense|rupias seichelenses|scr"), + ( + "Centavo seichelense", + "centavo de seicheles|centavos de seicheles|centavo seichelense|centavos seichelenses", + ), + ("Leone serra-leonino", "leone|leones|leone serra-leonino|leones serra-leoninos|le|sll"), + ( + "Dólar de Cingapura", + "dólar de singapura|dolar de singapura|dórar de cingapura|dolar de cingapura|dólares de singapura|dolares de singapura|dólares de cingapura|dolares de cingapura|sgb", + ), + ( + "Centavo de Cingapura", + "centavo de singapura|centavos de singapura|centavo de cingapura|centavos de cingapura", + ), + ("Libra síria", "libra síria|libra siria|libras sírias|libras sirias|s£|syp"), + ("Piastra síria", "piastra siria|piastras sirias|piastra síria|piastras sírias"), + ("Xelim somali", "xelim somali|xelins somalis|xelim somaliano|xelins somalianos|sos"), + ("Centavo somali", "centavo somapli|centavos somalis|centavo somaliano|centavos somalianos"), + ( + "Xelim da Somalilândia", + "xelim da somalilândia|xelins da somalilândia|xelim da somalilandia|xelins da somalilandia", + ), + ( + "Centavo da Somalilândia", + "centavo da somalilândia|centavos da somalilândia|centavo da somalilandia|centavos da somalilandia", + ), + ( + "Rupia do Sri Lanka", + "rupia do sri lanka|rupia do sri lanca|rupias do sri lanka|rupias do sri lanca|rupia cingalesa|rupias cingalesas|lkr", + ), + ("Lilangeni", "lilangeni|lilangenis|emalangeni|szl"), + ("Rand sul-africano", "rand|rand sul-africano|rands|rands sul-africanos|zar"), + ("Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"), + ("Piastra sudanesa", "piastra sudanesa|piastras sudanesas"), + ("Libra sul-sudanesa", "libra sul-sudanesa|libras sul-sudanesas|ssp"), + ("Piastra sul-sudanesa", "piastra sul-sudanesa|piastras sul-sudanesas"), + ("Coroa sueca", "coroa sueca|coroas suecas|sek"), + ("Franco suíço", "franco suíço|franco suico|francos suíços|francos suicos|sfr|chf"), + ("Rappen suíço", "rappen suíço|rappen suico|rappens suíços|rappens suicos"), + ( + "Dólar surinamês", + "dólar surinamês|dolar surinames|dólar do Suriname|dolar do Suriname|dólares surinameses|dolares surinameses|dólares do Suriname|dolares do Suriname|srd", + ), + ("Centavo surinamês", "centavo surinamês|centavo surinames|centavos surinameses"), + ("Baht tailandês", "baht tailandês|bath tailandes|baht tailandeses|thb"), + ("Satang tailandês", "satang tailandês|satang tailandes|satang tailandeses"), + ( + "Novo dólar taiwanês", + "novo dólar taiwanês|novo dolar taiwanes|dólar taiwanês|dolar taiwanes|dólares taiwaneses|dolares taiwaneses|twd", + ), + ("Centavo taiwanês", "centavo taiwanês|centavo taiwanes|centavos taiwaneses"), + ("Xelim tanzaniano", "xelim tanzaniano|xelins tanzanianos|tzs"), + ("Centavo tanzaniano", "centavo tanzaniano|centavos tanzanianos"), + ("Somoni tajique", "somoni tajique|somoni|somonis tajiques|somonis|tjs"), + ("Diram tajique", "diram tajique|dirams tajiques|dirames tajiques"), + ("Paʻanga", "paanga|paangas|paʻanga|pa'anga|top"), + ("Seniti", "seniti"), + ("Rublo transdniestriano", "rublo transdniestriano|rublos transdniestriano"), + ("Copeque transdniestriano", "copeque transdniestriano|copeques transdniestriano"), + ( + "Dólar de Trinidade e Tobago", + "dólar de trinidade e tobago|dólares trinidade e tobago|dolar de trinidade e tobago|dolares trinidade e tobago|dólar de trinidad e tobago|dólares trinidad e tobago|ttd", + ), + ( + "Centavo de Trinidade e Tobago", + "centavo de trinidade e tobago|centavos de trinidade e tobago|centavo de trinidad e tobago|centavos de trinidad e tobago", + ), + ("Dinar tunisiano", "dinar tunisiano|dinares tunisianos|dinar tunisino|dinares tunisinos|tnd"), + ( + "Milim tunisiano", + "milim tunisiano|milim tunesianos|millime tunisianos|millimes tunisianos|milim tunisino|milim tunisinos|millime tunisinos|millimes tunisinos", + ), + ("Lira turca", "lira turca|liras turcas|try"), + ("Kuruş turco", "kuruş turco|kuruş turcos"), + ("Manat turcomeno", "manat turcomeno|manats turcomenos|tmt"), + ("Tennesi turcomeno", "tennesi turcomeno|tennesis turcomenos|tenge turcomenos|tenges turcomenos"), + ("Dólar tuvaluano", "dólar tuvaluano|dolar tuvaluano|dólares tuvaluanos|dolares tuvaluanos"), + ("Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"), + ("Grívnia", "grívnia|grivnia|grívnias|grivnias|grivna|grivnas|uah"), + ("Copeque ucraniano", "kopiyka|copeque ucraniano|copeques ucranianos"), + ("Xelim ugandês", "xelim ugandês|xelim ugandes|xelins ugandeses|ugx"), + ("Centavo ugandês", "centavo ugandês|centavo ugandes|centavos ugandeses"), + ("Peso uruguaio", "peso uruguaio|pesos uruguayis|uyu"), + ("Centésimo uruguayo", "centésimo uruguaio|centesimo uruguaio|centésimos uruguaios|centesimos uruguaios"), + ( + "Som uzbeque", + "som uzbeque|som uzbeques|soms uzbeques|somes uzbeques|som usbeque|som usbeques|soms usbeques|somes usbeques|uzs", + ), + ( + "Tiyin uzbeque", + "tiyin uzbeque|tiyin uzbeques|tiyins uzbeques|tiyin usbeque|tiyin usbeques|tiyins usbeques", + ), + ("Vatu", "vatu|vatus|vuv"), + ("Bolívar forte venezuelano", "bolívar forte|bolivar forte|bolívar|bolivar|bolívares|bolivares|vef"), + ( + "Centavo de bolívar", + "cêntimo de bolívar|cêntimos de bolívar|centavo de bolívar|centavo de bolivar|centavos de bolívar|centavos de bolivar", + ), + ( + "Dongue vietnamita", + "dongue vietnamita|Đồng vietnamita|dong vietnamita|dongues vietnamitas|dongs vietnamitas|vnd", + ), + ("Hào vietnamita", "hào vietnamita|hao vietnamita|hào vietnamitas|hàos vietnamitas|haos vietnamitas"), + ("Rial iemenita", "rial iemenita|riais iemenitas|yer"), + ("Fils iemenita", "fils iemenita|fils iemenitas"), + ("Franco djibutiano", "franco djibutiano|francos djibutianos|franco jibutiano|francos jibutianos|djf"), + ("Dinar iugoslavo", "dinar iugoslavo|dinares iugoslavos|dinar jugoslavo|dinares jugoslavos|yud"), + ("Kwacha zambiano", "kwacha zambiano|kwacha zambianos|kwachas zambianos|zmw"), + ("Ngwee zambiano", "ngwee zambiano|ngwee zambianos|ngwees zambianos"), + ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), + ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), + ("Satoshi", "satoshi|satoshis"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afegani afegão", "AFN"), + ("Euro", "EUR"), + ("Lek albanês", "ALL"), + ("Kwanza angolano", "AOA"), + ("Dram armênio", "AMD"), + ("Florim arubano", "AWG"), + ("Taka bengali", "BDT"), + ("Ngultrum butanês", "BTN"), + ("Boliviano", "BOB"), + ("Marco da Bósnia e Herzegovina", "BAM"), + ("Pula", "BWP"), + ("Real brasileiro", "BRL"), + ("Lev búlgaro", "BGN"), + ("Riel cambojano", "KHR"), + ("Escudo cabo-verdiano", "CVE"), + ("Colón costarriquenho", "CRC"), + ("Kuna croata", "HRK"), + ("Coroa checa", "CZK"), + ("Nakfa", "ERN"), + ("Birr etíope", "ETB"), + ("Dalasi gambiano", "GMD"), + ("Lari georgiano", "GEL"), + ("Cedi", "GHS"), + ("Quetzal guatemalteco", "GTQ"), + ("Gurde haitiano", "HTG"), + ("Lempira hondurenha", "HNL"), + ("Florim húngaro", "HUF"), + ("Rial iraniano", "IRR"), + ("Rial iemenita", "YER"), + ("Novo shekel israelense", "ILS"), + ("Yen", "JPY"), + ("Tengue cazaque", "KZT"), + ("Xelim queniano", "KES"), + ("Won norte-coreano", "KPW"), + ("Won sul-coreano", "KRW"), + ("Som quirguiz", "KGS"), + ("Quipe laosiano", "LAK"), + ("Loti do Lesoto", "LSL"), + ("Rand sul-africano", "ZAR"), + ("Pataca macaense", "MOP"), + ("Dinar macedônio", "MKD"), + ("Ariary malgaxe", "MGA"), + ("Kwacha do Malawi", "MWK"), + ("Ringuite malaio", "MYR"), + ("Uguia", "MRO"), + ("Tugrik mongol", "MNT"), + ("Metical moçambicao", "MZN"), + ("Quiate mianmarense", "MMK"), + ("Córdova nicaraguense", "NIO"), + ("Naira", "NGN"), + ("Lira turca", "TRY"), + ("Rial omanense", "OMR"), + ("Balboa panamenho", "PAB"), + ("Kina", "PGK"), + ("Guarani", "PYG"), + ("Novo Sol", "PEN"), + ("Złoty", "PLN"), + ("Rial catariano", "QAR"), + ("Rial saudita", "SAR"), + ("Tala samoano", "WST"), + ("São Tomé and Príncipe dobra", "STN"), + ("Leone serra-leonino", "SLL"), + ("Lilangeni", "SZL"), + ("Somoni tajique", "TJS"), + ("Baht tailandês", "THB"), + ("Grívnia", "UAH"), + ("Vatu", "VUV"), + ("Bolívar forte venezuelano", "VEF"), + ("Kwacha zambiano", "ZMW"), + ("Dirame marroquino", "MAD"), + ("Dirham dos Emirados Árabes Unidos", "AED"), + ("Manat azeri", "AZN"), + ("Manat turcomeno", "TMT"), + ("Xelim somali", "SOS"), + ("Xelim tanzaniano", "TZS"), + ("Xelim ugandês", "UGX"), + ("Leu romeno", "RON"), + ("Leu moldávio", "MDL"), + ("Rupia nepalesa", "NPR"), + ("Rupia paquistanesa", "PKR"), + ("Rupia indiana", "INR"), + ("Rupia seichelense", "SCR"), + ("Rupia maurícia", "MUR"), + ("Rupia maldiva", "MVR"), + ("Rupia do Sri Lanka", "LKR"), + ("Rupia indonésia", "IDR"), + ("Coroa dinamarquesa", "DKK"), + ("Coroa norueguesa", "NOK"), + ("Coroa islandesa", "ISK"), + ("Coroa sueca", "SEK"), + ("Franco CFA da África Ocidental", "XOF"), + ("Franco CFA da África Central", "XAF"), + ("Franco comorense", "KMF"), + ("Franco congolês", "CDF"), + ("Burundian franc", "BIF"), + ("Franco djibutiano", "DJF"), + ("Franco CFP", "XPF"), + ("Franco da Guiné", "GNF"), + ("Franco suíço", "CHF"), + ("Franco ruandês", "RWF"), + ("Rublo russo", "RUB"), + ("Transnistrian ruble", "PRB"), + ("New Belarusian ruble", "BYN"), + ("Dinar argelino", "DZD"), + ("Dinar bareinita", "BHD"), + ("Dinar iraquiano", "IQD"), + ("Dinar jordaniano", "JOD"), + ("Dinar kuwaitiano", "KWD"), + ("Dinar libio", "LYD"), + ("Dinar sérvio", "RSD"), + ("Dinar tunisiano", "TND"), + ("Peso argentino", "ARS"), + ("Chilean peso", "CLP"), + ("Peso colombiano", "COP"), + ("Peso cubano convertível", "CUC"), + ("Peso cubano", "CUP"), + ("Peso dominicano", "DOP"), + ("Peso mexicano", "MXN"), + ("Peso uruguaio", "UYU"), + ("Libra esterlina", "GBP"), + ("Libra de Santa Helena", "SHP"), + ("Libra egípcia", "EGP"), + ("Libra das Malvinas", "FKP"), + ("Libra de Gibraltar", "GIP"), + ("Libra manesa", "IMP"), + ("Libra de Jersey", "JEP"), + ("Libra libanesa", "LBP"), + ("Libra sul-sudanesa", "SSP"), + ("Libra sudanesa", "SDG"), + ("Libra síria", "SYP"), + ("Dólar estadunidense", "USD"), + ("Dólar australiano", "AUD"), + ("Dólar bahamense", "BSD"), + ("Dólar de Barbados", "BBD"), + ("Dólar de Belize", "BZD"), + ("Dólar bermudense", "BMD"), + ("Dólar de Brunei", "BND"), + ("Dólar de Cingapura", "SGD"), + ("Dólar canadense", "CAD"), + ("Dólar das Ilhas Cayman", "KYD"), + ("Dólar neozelandês", "NZD"), + ("Dólar fijiano", "FJD"), + ("Dólar guianense", "GYD"), + ("Dólar de Hong Kong", "HKD"), + ("Dólar jamaicano", "JMD"), + ("Dólar liberiano", "LRD"), + ("Dólar namibiano", "NAD"), + ("Dólar das Ilhas Salomão", "SBD"), + ("Dólar surinamês", "SRD"), + ("Novo dólar taiwanês", "TWD"), + ("Dólar de Trinidade e Tobago", "TTD"), + ("Tuvaluan dólar", "TVD"), + ("Yuan chinês", "CNY"), + ("Rial", "__RI"), + ("Xelim", "__S"), + ("Som", "__SO"), + ("Dirame", "__DR"), + ("Dinar", "_DN"), + ("Dólar", "__D"), + ("Manat", "__MA"), + ("Rupia", "__R"), + ("Coroa", "__K"), + ("Krona", "__K"), + ("Franco", "__F"), + ("Marco", "__M"), + ("Rublo", "__RB"), + ("Peso", "__PE"), + ("Libra", "__P"), + ("Tristan da Cunha libra", "_TP"), + ("South Georgia and the South Sandwich Islands libra", "_SP"), + ("Somaliland xelim", "_SS"), + ("Pitcairn Islands dólar", "_PND"), + ("Palauan dólar", "_PD"), + ("Niue dólar", "_NID"), + ("Nauruan dólar", "_ND"), + ("Micronesian dólar", "_MD"), + ("Kiribati dólar", "_KID"), + ("Guernsey libra", "_GGP"), + ("Faroese króna", "_FOK"), + ("Cook Islands dólar", "_CKD"), + ("British Virgin Islands dólar", "_BD"), + ("Ascension libra", "_AP"), + ("Alderney libra", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarke", "QINDARKE"), + ("Peni", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENTIMO"), + ("Centavo", "CENT"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Fening", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENT"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '\\b(?e|com)\\b' + MultiplierRegex = '\\s*\\b(mil(h([ãa]o|[õo]es))?|bilh([ãa]o|[õo]es)|trilh([ãa]o|[õo]es)|qua[td]rilh([ãa]o|[õo]es)|quintilh([ãa]o|[õo]es))\\b' + CurrencyPrefixList = dict( + [ + ("Dólar", "$|dólar|dolar|dólares|dolares"), + ("Dólar estadunidense", "us$|u$d|usd$|usd"), + ("Dólar do Caribe Oriental", "ec$|xcd"), + ("Dólar australiano", "a$|aud"), + ("Dólar bahamense", "b$|bsd"), + ("Dólar de Barbados", "bds$|bbd"), + ("Dólar de Belize", "bz$|bzd"), + ("Dólar bermudense", "bd$|bmd"), + ("Dólar de Brunei", "brunéi $|bnd"), + ("Dólar de Cingapura", "s$|sgd"), + ("Dólar canadense", "c$|can$|cad"), + ("Dólar das Ilhas Cayman", "ci$|kyd"), + ("Dólar neozelandês", "nz$|nzd"), + ("Dólar fijiano", "fj$|fjd"), + ("Dólar guianense", "gy$|gyd"), + ("Dólar de Hong Kong", "hk$|hkd"), + ("Dólar jamaicano", "j$|ja$|jmd"), + ("Dólar liberiano", "l$|lrd"), + ("Dólar namibiano", "n$|nad"), + ("Dólar das Ilhas Salomão", "si$|sbd"), + ("Novo dólar taiwanês", "nt$|twd"), + ("Real brasileiro", "r$|brl"), + ("Guarani", "₲|gs.|pyg"), + ("Dólar de Trinidade e Tobago", "tt$|ttd"), + ("Yuan chinês", "¥|cny|rmb"), + ("Yen", "¥|jpy"), + ("Euro", "€|eur"), + ("Florim", "ƒ"), + ("Libra", "£"), + ("Colón costarriquenho", "₡"), + ("Lira turca", "₺"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) AmbiguousCurrencyUnitList = [r'le', r'agora'] - InformationSuffixList = dict([("bit", "bit|bits"), - ("kilobit", "kilobit|kilobits|kb|kbit"), - ("megabit", "megabit|megabits|Mb|Mbit"), - ("gigabit", "gigabit|gigabits|Gb|Gbit"), - ("terabit", "terabit|terabits|Tb|Tbit"), - ("petabit", "petabit|petabits|Pb|Pbit"), - ("kibibit", "kibibit|kibibits|kib|kibit"), - ("mebibit", "mebibit|mebibits|Mib|Mibit"), - ("gibibit", "gibibit|gibibits|Gib|Gibit"), - ("tebibit", "tebibit|tebibits|Tib|Tibit"), - ("pebibit", "pebibit|pebibits|Pib|Pibit"), - ("byte", "byte|bytes"), - ("kilobyte", "kilobyte|kilobytes|kB|kByte"), - ("megabyte", "megabyte|megabytes|MB|MByte"), - ("gigabyte", "gigabyte|gigabytes|GB|GByte"), - ("terabyte", "terabyte|terabytes|TB|TByte"), - ("petabyte", "petabyte|petabytes|PB|PByte"), - ("kibibyte", "kibibyte|kibibytes|kiB|kiByte"), - ("mebibyte", "mebibyte|mebibytes|MiB|MiByte"), - ("gibibyte", "gibibyte|gibibytes|GiB|GiByte"), - ("tebibyte", "tebibyte|tebibytes|TiB|TiByte"), - ("pebibyte", "pebibyte|pebibytes|PiB|PiByte")]) - AmbiguousDimensionUnitList = [r'ton', r'tonelada', r'área', r'area', r'áreas', r'areas', r'milha', r'milhas', r'"'] - BuildPrefix = f'(?<=(\\s|^|\\P{{L}}))' - BuildSuffix = f'(?=(\\s|\\P{{L}}|$))' + BuildPrefix = '(?<=(\\s|^|\\P{L}))' + BuildSuffix = '(?=(\\s|\\P{L}|$))' ConnectorToken = 'de' - LengthSuffixList = dict([("Quilômetro", "km|quilometro|quilômetro|quilómetro|quilometros|quilômetros|quilómetros"), - ("Hectômetro", "hm|hectometro|hectômetro|hectómetro|hectometros|hectômetros|hectómetros"), - ("Decâmetro", "decametro|decâmetro|decámetro|decametros|decâmetro|decámetros|dam"), - ("Metro", "m|m.|metro|metros"), - ("Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"), - ("Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"), - ("Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"), - ("Micrômetro", "µm|um|micrometro|micrômetro|micrómetro|micrometros|micrômetros|micrómetros|micron|mícron|microns|mícrons|micra"), - ("Nanômetro", "nm|nanometro|nanômetro|nanómetro|nanometros|nanômetros|nanómetros|milimicron|milimícron|milimicrons|milimícrons"), - ("Picômetro", "pm|picometro|picômetro|picómetro|picometros|picômetros|picómetros"), - ("Milha", "mi|milha|milhas"), - ("Jarda", "yd|jarda|jardas"), - ("Polegada", "polegada|polegadas|\"|in"), - ("Pé", "pé|pe|pés|pes|ft"), - ("Ano luz", "ano luz|anos luz|al")]) - AmbiguousLengthUnitList = [r'mi', r'milha', r'milhas', r'"', r'in', r'um'] - SpeedSuffixList = dict([("Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"), - ("Quilômetro por hora", "km/h|quilômetro por hora|quilómetro por hora|quilometro por hora|quilômetros por hora|quilómetros por hora|quilometros por hora|quilômetro/hora|quilómetro/hora|quilometro/hora|quilômetros/hora|quilómetros/hora|quilometros/hora"), - ("Quilômetro por minuto", "km/min|quilômetro por minuto|quilómetro por minuto|quilometro por minuto|quilômetros por minuto|quilómetros por minuto|quilometros por minuto|quilômetro/minuto|quilómetro/minuto|quilometro/minuto|quilômetros/minuto|quilómetros/minuto|quilometros/minuto"), - ("Quilômetro por segundo", "km/seg|quilômetro por segundo|quilómetro por segundo|quilometro por segundo|quilômetros por segundo|quilómetros por segundo|quilometros por segundo|quilômetro/segundo|quilómetro/segundo|quilometro/segundo|quilômetros/segundo|quilómetros/segundo|quilometros/segundo"), - ("Milha por hora", "mph|milha por hora|mi/h|milha/hora|milhas/hora|milhas por hora|mi por hora|mi/hora"), - ("Nó", "kt|nó|nós|kn"), - ("Pé por segundo", "ft/s|pé/s|pe/s|ft/seg|pé/seg|pe/seg|pé por segundo|pe por segundo|pés por segundo|pes por segundo"), - ("Pé por minuto", "ft/min|pé/mind|pe/min|pé por minuto|pe por minuto|pés por minuto|pes por minuto"), - ("Jarda por minuto", "jardas por minuto|jardas/minuto|jardas/min"), - ("Jarda por segundo", "jardas por segundo|jardas/segundo|jardas/seg")]) - AmbiguousSpeedUnitList = [r'nó', r'no', r'nós', r'nos'] - TemperatureSuffixList = dict([("Kelvin", "k|K|kelvin"), - ("Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine"), - ("Grau Celsius", "°c|° c|ºc|º c|grau c|grau celsius|graus c|graus celsius|celsius|grau centígrado|grau centrigrado|graus centígrados|graus centigrados|centígrado|centígrados|centigrado|centigrados"), - ("Grau Fahrenheit", "°f|° f|ºf|º f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"), - ("Grau", "°|graus|grau")]) - VolumeSuffixList = dict([("Quilômetro cúbico", "quilômetro cúbico|quilómetro cúbico|quilometro cubico|quilômetros cúbicos|quilómetros cúbicos|quilometros cubicos|km3|km^3|km³"), - ("Hectômetro cúbico", "hectômetro cúbico|hectómetro cúbico|hectometro cubico|hectômetros cúbicos|hectómetros cúbicos|hectometros cubicos|hm3|hm^3|hm³"), - ("Decâmetro cúbico", "decâmetro cúbico|decámetro cúbico|decametro cubico|decâmetros cúbicos|decámetros cúbicos|decametros cubicosdam3|dam^3|dam³"), - ("Metro cúbico", "metro cúbico|metro cubico|metros cúbicos|metros cubicos|m3|m^3|m³"), - ("Decímetro cúbico", "decímetro cúbico|decimetro cubico|decímetros cúbicos|decimetros cubicos|dm3|dm^3|dm³"), - ("Centímetro cúbico", "centímetro cúbico|centimetro cubico|centímetros cúbicos|centrimetros cubicos|cc|cm3|cm^3|cm³"), - ("Milímetro cúbico", "milímetro cúbico|milimetro cubico|milímetros cúbicos|milimetros cubicos|mm3|mm^3|mm³"), - ("Polegada cúbica", "polegada cúbica|polegada cubica|polegadas cúbicas|polegadas cubicas"), - ("Pé cúbico", "pé cúbico|pe cubico|pés cúbicos|pes cubicos|pé3|pe3|pé^3|pe^3|pé³|pe³|ft3|ft^3|ft³"), - ("Jarda cúbica", "jarda cúbica|jarda cubica|jardas cúbicas|jardas cubicas|yd3|yd^3|yd³"), - ("Hectolitro", "hectolitro|hectolitros|hl"), - ("Litro", "litro|litros|lts|l"), - ("Mililitro", "mililitro|mililitros|ml"), - ("Galão", "galão|galões|galao|galoes"), - ("Pint", "pinta|pintas|pinto|pintos|quartilho|quartilhos|pint|pints"), - ("Barril", "barril|barris|bbl"), - ("Onça líquida", "onça líquida|onca liquida|onças líquidas|oncas liquidas")]) - WeightSuffixList = dict([("Tonelada métrica", "tonelada métrica|tonelada metrica|toneladas métricas|toneladas metricas|t métrica|t metrica|t métricas|t metricas|t.métrica|t.metrica|t.métricas|t.metricas|t. metrica|t. métrica"), - ("Tonelada", "ton|tonelada|toneladas|t"), - ("Quilograma", "kg|quilograma|quilogramas|quilo|quilos|kilo|kilos"), - ("Hectograma", "hg|hectograma|hectogramas"), - ("Decagrama", "dag|decagrama|decagramas"), - ("Grama", "g|grama|gramas"), - ("Decigrama", "dg|decigrama|decigramas"), - ("Centigrama", "cg|centigrama|centigramas"), - ("Miligrama", "mg|miligrama|miligramas"), - ("Micrograma", "µg|ug|micrograma|microgramas"), - ("Nanograma", "ng|nanograma|nanogramas"), - ("Picograma", "pg|picograma|picogramas"), - ("Libra", "lb|libra|libras"), - ("Onça", "oz|onça|onca|onças|oncas"), - ("Grão", "grão|grao|grãos|graos|gr"), - ("Quilate", "ct|quilate|quilates")]) - AmbiguousWeightUnitList = [r'g', r't'] - AngleSuffixList = dict([("Degree", "grau|graus|°"), - ("Radian", "radiano|radianos|rad"), - ("Turn", "volta|voltas")]) - AmbiguousAngleUnitList = [r'volta', r'voltas'] - AmbiguityFiltersDict = dict([("\\b\\d+\\s*\\p{L}+$", "((\\d+(\\s*\\p{L}+[-—–-]|\\p{L}+)\\d+)|(((\\p{L}|\\d)[-—–-]\\d+\\s*|\\p{L}\\d+)\\p{L}+))"), - ("\\bum$", "\\p{L}\\s+um\\b")]) - TemperatureAmbiguityFiltersDict = dict([("\\b(graus?|°)$", "\\b((graus?|°)\\s*(ângulo|rotação)|(gira(r|do|ndo)?|ângulo|rotação)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(graus?\\b|°))")]) - DimensionAmbiguityFiltersDict = dict([("\\b(graus?|°)$", "\\b((graus?|°)\\s*(c(elsius|entígrado)?|f(ah?renheit)?)|(temperatura)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(graus?\\b|°))")]) + AmbiguityFiltersDict = dict( + [ + ( + "\\b\\d+\\s*\\p{L}+$", + "((\\d+(\\s*\\p{L}+[-—–-]|\\p{L}+)\\d+)|(((\\p{L}|\\d)[-—–-]\\d+\\s*|\\p{L}\\d+)\\p{L}+))", + ), + ("\\bum$", "\\p{L}\\s+um\\b"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/spanish_numeric_with_unit.py b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/spanish_numeric_with_unit.py index a9d69eb927..45dd5bda83 100644 --- a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/spanish_numeric_with_unit.py +++ b/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/resources/spanish_numeric_with_unit.py @@ -9,736 +9,658 @@ # Licensed under the MIT License. # ------------------------------------------------------------------------------ -from .base_numbers import BaseNumbers + # pylint: disable=line-too-long class SpanishNumericWithUnit: - AgeSuffixList = dict([("Año", "años|año"), - ("Mes", "meses|mes"), - ("Semana", "semanas|semana"), - ("Día", "dias|días|día|dia")]) - AmbiguousAgeUnitList = [r'años', r'año', r'meses', r'mes', r'semanas', r'semana', r'dias', r'días', r'día', r'dia'] - AreaSuffixList = dict([("Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"), - ("Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"), - ("Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"), - ("Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"), - ("Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"), - ("Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"), - ("Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"), - ("Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"), - ("Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"), - ("Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"), - ("Acre", "acre|acres")]) - AreaAmbiguousValues = [r'área', r'áreas'] - CurrencySuffixList = dict([("Dólar", "dólar|dólares|dolar|dolares"), - ("Peso", "peso|pesos"), - ("Rublo", "rublo|rublos"), - ("Libra", "libra|libras"), - ("Florín", "florín|florines"), - ("Dinar", "dinar|dinares"), - ("Franco", "franco|francos"), - ("Rupia", "rupia|rupias"), - ("Escudo", "escudo|escudos"), - ("Chelín", "chelín|chelines"), - ("Lira", "lira|liras"), - ("Centavo", "centavo|centavos"), - ("Céntimo", "céntimo|céntimos"), - ("Centésimo", "centésimo|centésimos"), - ("Penique", "penique|peniques"), - ("Euro", "euro|euros|€|eur"), - ("Céntimo de Euro", "céntimo de euro|céntimos de euros"), - ("Dólar del Caribe Oriental", "dólar del caribe oriental|dólares del caribe oriental|ec$|xcd"), - ("Centavo del Caribe Oriental", "centavo del caribe oriental|centavos del caribe oriental"), - ("Franco CFA de África Occidental", "franco cfa de África occidental|francos cfa de África occidental|fcfa|xof"), - ("Céntimo de CFA de África Occidental", "céntimo de cfa de África occidental|céntimos de cfa de África occidental"), - ("Franco CFA de África Central", "franco cfa de África central|francos cfa de África central|xaf"), - ("Céntimo de CFA de África Central", "céntimo de cfa de África central|céntimos de cfa de África central"), - ("Apsar", "apsar|apsares"), - ("Afgani afgano", "afgani afgano|؋|afn|afganis|afgani"), - ("Pul", "pul|puls"), - ("Lek albanés", "lek|lekë|lekes|lek albanés"), - ("Qindarka", "qindarka|qindarkë|qindarkas"), - ("Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleños|kwanzas angoleño|kwanzas|aoa|kz"), - ("Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"), - ("Florín antillano neerlandés", "florín antillano neerlandés|florínes antillano neerlandés|ƒ antillano neerlandés|ang|naƒ"), - ("Cent antillano neerlandés", "cent|centen"), - ("Riyal saudí", "riyal saudí|riyales saudí|sar"), - ("Halalá saudí", "halalá saudí|hallalah"), - ("Dinar argelino", "dinar argelino|dinares argelinos|dzd"), - ("Céntimo argelino", "centimo argelino|centimos argelinos"), - ("Peso argentino", "peso argentino|pesos argentinos|ar$|ars"), - ("Centavo argentino", "centavo argentino|centavos argentinos|ctvo.|ctvos."), - ("Dram armenio", "dram armenio|dram armenios|dram|դր."), - ("Luma armenio", "luma armenio|luma armenios"), - ("Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"), - ("Yotin arubeño", "yotin arubeño|yotines arubeños"), - ("Dólar australiano", "dólar australiano|dólares australianos|a$|aud"), - ("Centavo australiano", "centavo australiano|centavos australianos"), - ("Manat azerí", "manat azerí|man|azn"), - ("Qəpik azerí", "qəpik azerí|qəpik"), - ("Dólar bahameño", "dólar bahameño|dólares bahameños|b$|bsd"), - ("Centavo bahameño", "centavo bahameño|centavos bahameños"), - ("Dinar bahreiní", "dinar bahreiní|dinares bahreinies|bhd"), - ("Fil bahreiní", "fil bahreiní|fils bahreinies"), - ("Taka bangladeshí", "taka bangladeshí|takas bangladeshí|bdt"), - ("Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"), - ("Dólar de Barbados", "dólar de barbados|dólares de barbados|bbd"), - ("Centavo de Barbados", "centavo de barbados|centavos de barbados"), - ("Dólar beliceño", "dólar beliceño|dólares beliceños|bz$|bzd"), - ("Centavo beliceño", "centavo beliceño|centavos beliceños"), - ("Dólar bermudeño", "dólar bermudeño|dólares bermudeños|bd$|bmd"), - ("Centavo bermudeño", "centavo bermudeño|centavos bermudeños"), - ("Rublo bielorruso", "rublo bielorruso|rublos bielorrusos|byr"), - ("Kópek bielorruso", "kópek bielorruso|kópeks bielorrusos|kap"), - ("Kyat birmano", "kyat birmano|kyats birmanos|mmk"), - ("Pya birmano", "pya birmano|pyas birmanos"), - ("Boliviano", "boliviano|bolivianos|bob|bs"), - ("Centésimo Boliviano", "centésimo boliviano|centésimos bolivianos"), - ("Marco bosnioherzegovino", "marco convertible|marco bosnioherzegovino|marcos convertibles|marcos bosnioherzegovinos|bam"), - ("Feningas bosnioherzegovino", "feninga convertible|feninga bosnioherzegovina|feningas convertibles"), - ("Pula", "pula|bwp"), - ("Thebe", "thebe"), - ("Real brasileño", "real brasileño|reales brasileños|r$|brl"), - ("Centavo brasileño", "centavo brasileño|centavos brasileños"), - ("Dólar de Brunéi", "dólar de brunei|dólares de brunéi|bnd"), - ("Sen de Brunéi", "sen|sen de brunéi"), - ("Lev búlgaro", "lev búlgaro|leva búlgaros|lv|bgn"), - ("Stotinki búlgaro", "stotinka búlgaro|stotinki búlgaros"), - ("Franco de Burundi", "franco de burundi|francos de burundi|fbu|fib"), - ("Céntimo Burundi", "céntimo burundi|céntimos burundies"), - ("Ngultrum butanés", "ngultrum butanés|ngultrum butaneses|btn"), - ("Chetrum butanés", "chetrum butanés|chetrum butaneses"), - ("Escudo caboverdiano", "escudo caboverdiano|escudos caboverdianos|cve"), - ("Riel camboyano", "riel camboyano|rieles camboyanos|khr"), - ("Dólar canadiense", "dólar canadiense|dólares canadienses|c$|cad"), - ("Centavo canadiense", "centavo canadiense|centavos canadienses"), - ("Peso chileno", "peso chileno|pesos chilenos|cpl"), - ("Yuan chino", "yuan chino|yuanes chinos|yuan|yuanes|renminbi|rmb|cny|¥"), - ("Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"), - ("Centavo colombiano", "centavo colombiano|centavos colombianos"), - ("Franco comorano", "franco comorano|francos comoranos|kmf|₣"), - ("Franco congoleño", "franco congoleño|francos congoleños|cdf"), - ("Céntimo congoleño", "céntimo congoleño|céntimos congoleños"), - ("Won norcoreano", "won norcoreano|wŏn norcoreano|wŏn norcoreanos|kpw"), - ("Chon norcoreano", "chon norcoreano|chŏn norcoreano|chŏn norcoreanos|chon norcoreanos"), - ("Won surcoreano", "wŏn surcoreano|won surcoreano|wŏnes surcoreanos|wones surcoreanos|krw"), - ("Chon surcoreano", "chon surcoreano|chŏn surcoreano|chŏn surcoreanos|chon surcoreanos"), - ("Colón costarricense", "colón costarricense|colones costarricenses|crc"), - ("Kuna croata", "kuna croata|kuna croatas|hrk"), - ("Lipa croata", "lipa croata|lipa croatas"), - ("Peso cubano", "peso cubano|pesos cubanos|cup"), - ("Peso cubano convertible", "peso cubano convertible|pesos cubanos convertible|cuc"), - ("Corona danesa", "corona danesa|coronas danesas|dkk"), - ("Libra egipcia", "libra egipcia|libras egipcias|egp|l.e."), - ("Piastra egipcia", "piastra egipcia|piastras egipcias"), - ("Colón salvadoreño", "colón salvadoreño|colones salvadoreños|svc"), - ("Dirham de los Emiratos Árabes Unidos", "dirham|dirhams|dirham de los emiratos Árabes unidos|aed|dhs"), - ("Nakfa", "nakfa|nfk|ern"), - ("Céntimo de Nakfa", "céntimo de nakfa|céntimos de nakfa"), - ("Peseta", "peseta|pesetas|pts.|ptas.|esp"), - ("Dólar estadounidense", "dólar estadounidense|dólares estadounidenses|usd|u$d|us$"), - ("Corona estonia", "corona estonia|coronas estonias|eek"), - ("Senti estonia", "senti estonia|senti estonias"), - ("Birr etíope", "birr etíope|birr etíopes|br|etb"), - ("Santim etíope", "santim etíope|santim etíopes"), - ("Peso filipino", "peso filipino|pesos filipinos|php"), - ("Marco finlandés", "marco finlandés|marcos finlandeses"), - ("Dólar fiyiano", "dólar fiyiano|dólares fiyianos|fj$|fjd"), - ("Centavo fiyiano", "centavo fiyiano|centavos fiyianos"), - ("Dalasi", "dalasi|gmd"), - ("Bututs", "butut|bututs"), - ("Lari georgiano", "lari georgiano|lari georgianos|gel"), - ("Tetri georgiano", "tetri georgiano|tetri georgianos"), - ("Cedi", "cedi|ghs|gh₵"), - ("Pesewa", "pesewa"), - ("Libra gibraltareña", "libra gibraltareña|libras gibraltareñas|gip"), - ("Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"), - ("Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"), - ("Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"), - ("Libra de Guernsey", "libra de guernsey|libras de guernsey|ggp"), - ("Penique de Guernsey", "penique de guernsey|peniques de guernsey"), - ("Franco guineano", "franco guineano|francos guineanos|gnf|fg"), - ("Céntimo guineano", "céntimo guineano|céntimos guineanos"), - ("Dólar guyanés", "dólar guyanés|dólares guyaneses|gyd|gy"), - ("Gourde haitiano", "gourde haitiano|gourde haitianos|htg"), - ("Céntimo haitiano", "céntimo haitiano|céntimos haitianos"), - ("Lempira hondureño", "lempira hondureño|lempira hondureños|hnl"), - ("Centavo hondureño", "centavo hondureño|centavos hondureño"), - ("Dólar de Hong Kong", "dólar de hong kong|dólares de hong kong|hk$|hkd"), - ("Forinto húngaro", "forinto húngaro|forinto húngaros|huf"), - ("Rupia india", "rupia india|rupias indias|inr"), - ("Paisa india", "paisa india|paise indias"), - ("Rupia indonesia", "rupia indonesia|rupias indonesias|idr"), - ("Sen indonesia", "sen indonesia|sen indonesias"), - ("Rial iraní", "rial iraní|rial iranies|irr"), - ("Dinar iraquí", "dinar iraquí|dinares iraquies|iqd"), - ("Fil iraquí", "fil iraquí|fils iraquies"), - ("Libra manesa", "libra manesa|libras manesas|imp"), - ("Penique manes", "penique manes|peniques maneses"), - ("Corona islandesa", "corona islandesa|coronas islandesas|isk|íkr"), - ("Aurar islandes", "aurar islandes|aurar islandeses"), - ("Dólar de las Islas Caimán", "dólar de las islas caimán|dólares de las islas caimán|ci$|kyd"), - ("Dólar de las Islas Cook", "dólar de las islas cook|dólares de las islas cook"), - ("Corona feroesa", "corona feroesa|coronas feroesas|fkr"), - ("Libra malvinense", "libra malvinense|libras malvinenses|fk£|fkp"), - ("Dólar de las Islas Salomón", "dólar de las islas salomón|dólares de las islas salomón|sbd"), - ("Nuevo shéquel", "nuevo shéquel|nuevos shéquel|ils"), - ("Agorot", "agorot"), - ("Dólar jamaiquino", "dólar jamaiquino|dólares jamaiquinos|j$|ja$|jmd"), - ("Yen", "yen|yenes|jpy"), - ("Libra de Jersey", "libra de jersey|libras de jersey|jep"), - ("Dinar jordano", "dinar jordano|dinares jordanos|jd|jod"), - ("Piastra jordano", "piastra jordano|piastras jordanos"), - ("Tenge kazajo", "tenge|tenge kazajo|kzt"), - ("Chelín keniano", "chelín keniano|chelines kenianos|ksh|kes"), - ("Som kirguís", "som kirguís|kgs"), - ("Tyiyn", "tyiyn"), - ("Dólar de Kiribati", "dólar de kiribati|dólares de kiribati"), - ("Dinar kuwaití", "dinar kuwaití|dinares kuwaití"), - ("Kip laosiano", "kip|kip laosiano|kip laosianos|lak"), - ("Att laosiano", "att|att laosiano|att laosianos"), - ("Loti", "loti|maloti|lsl"), - ("Sente", "sente|lisente"), - ("Libra libanesa", "libra libanesa|libras libanesas|lbp"), - ("Dólar liberiano", "dólar liberiano|dólares liberianos|l$|lrd"), - ("Dinar libio", "dinar libio|dinares libios|ld|lyd"), - ("Dirham libio", "dirham libio|dirhams libios"), - ("Litas lituana", "litas lituana|litai lituanas|ltl"), - ("Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"), - ("Avo macaense", "avo macaense|avos macaenses"), - ("Ho macaense", "ho macaense|ho macaenses"), - ("Denar macedonio", "denar macedonio|denare macedonios|den|mkd"), - ("Deni macedonio", "deni macedonio|deni macedonios"), - ("Ariary malgache", "ariary malgache|ariary malgaches|mga"), - ("Iraimbilanja malgache", "iraimbilanja malgache|iraimbilanja malgaches"), - ("Ringgit malayo", "ringgit malayo|ringgit malayos|rm|myr"), - ("Sen malayo", "sen malayo|sen malayos"), - ("Kwacha malauí", "kwacha malauí|mk|mwk"), - ("Támbala malauí", "támbala malauí"), - ("Rupia de Maldivas", "rupia de maldivas|rupias de maldivas|mvr"), - ("Dirham marroquí", "dirham marroquí|dirhams marroquies|mad"), - ("Rupia de Mauricio", "rupia de Mauricio|rupias de Mauricio|mur"), - ("Uguiya", "uguiya|uguiyas|mro"), - ("Jum", "jum|jums"), - ("Peso mexicano", "peso mexicano|pesos mexicanos|mxn|mxn$|mxn $|mex$"), - ("Centavo mexicano", "centavo mexicano|centavos mexicanos"), - ("Leu moldavo", "leu moldavo|lei moldavos|mdl"), - ("Ban moldavo", "ban moldavo|bani moldavos"), - ("Tugrik mongol", "tugrik mongol|tugrik|tugrik mongoles|tug|mnt"), - ("Metical mozambiqueño", "metical|metical mozambiqueño|meticales|meticales mozambiqueños|mtn|mzn"), - ("Dram de Nagorno Karabaj", "dram de nagorno karabaj|drams de nagorno karabaj"), - ("Luma de Nagorno Karabaj", "luma de nagorno karabaj"), - ("Dólar namibio", "dólar namibio|dólares namibios|n$|nad"), - ("Centavo namibio", "centavo namibio|centavos namibios"), - ("Rupia nepalí", "rupia nepalí|rupias nepalies|npr"), - ("Paisa nepalí", "paisa nepalí|paisas nepalies"), - ("Córdoba nicaragüense", "córdoba nicaragüense|córdobas nicaragüenses|nio"), - ("Centavo nicaragüense", "centavo nicaragüense|centavos nicaragüenses"), - ("Naira", "naira|ngn"), - ("Kobo", "kobo"), - ("Corona noruega", "corona noruega|coronas noruegas|nok"), - ("Franco CFP", "franco cfp|francos cfp|xpf"), - ("Dólar neozelandés", "dólar neozelandés|dólares neozelandeses|dólar de nueva zelanda|dólares de nueva zelanda|nz$|nzd"), - ("Centavo neozelandés", "centavo neozelandés|centavo de nueva zelanda|centavos de nueva zelanda|centavos neozelandeses"), - ("Rial omaní", "rial omaní|riales omanies|omr"), - ("Baisa omaní", "baisa omaní|baisa omanies"), - ("Florín neerlandés", "florín neerlandés|florines neerlandeses|nlg"), - ("Rupia pakistaní", "rupia pakistaní|rupias pakistanies|pkr"), - ("Paisa pakistaní", "paisa pakistaní|paisas pakistanies"), - ("Balboa panameño", "balboa panameño|balboa panameños|pab"), - ("Centésimo panameño", "centésimo panameño|centésimos panameños"), - ("Kina", "kina|pkg|pgk"), - ("Toea", "toea"), - ("Guaraní", "guaraní|guaranies|gs|pyg"), - ("Sol", "sol|soles|nuevo sol|pen|s#."), - ("Céntimo de sol", "céntimo de sol|céntimos de sol"), - ("Złoty", "złoty|esloti|eslotis|zł|pln"), - ("Groszy", "groszy"), - ("Riyal qatarí", "riyal qatarí|riyal qataries|qr|qar"), - ("Dirham qatarí", "dirham qatarí|dirhams qataries"), - ("Libra esterlina", "libra esterlina|libras esterlinas|gbp"), - ("Corona checa", "corona checa|coronas checas|kc|czk"), - ("Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"), - ("Centavo dominicano", "centavo dominicano|centavos dominicanos"), - ("Franco ruandés", "franco ruandés|francos ruandeses|rf|rwf"), - ("Céntimo ruandés", "céntimo ruandés|céntimos ruandeses"), - ("Leu rumano", "leu rumano|lei rumanos|ron"), - ("Ban rumano", "ban rumano|bani rumanos"), - ("Rublo ruso", "rublo ruso|rublos rusos|rub"), - ("Kopek ruso", "kopek ruso|kopeks rusos"), - ("Tala", "tala|tālā|ws$|sat|wst"), - ("Sene", "sene"), - ("Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"), - ("Penique de Santa Helena", "penique de santa helena|peniques de santa helena"), - ("Dobra", "dobra"), - ("Dinar serbio", "dinar serbio|dinares serbios|rsd"), - ("Para serbio", "para serbio|para serbios"), - ("Rupia de Seychelles", "rupia de seychelles|rupias de seychelles|scr"), - ("Centavo de Seychelles", "centavo de seychelles|centavos de seychelles"), - ("Leone", "leone|le|sll"), - ("Dólar de Singapur", "dólar de singapur|dólares de singapur|sgb"), - ("Centavo de Singapur", "centavo de Singapur|centavos de Singapur"), - ("Libra siria", "libra siria|libras sirias|s£|syp"), - ("Piastra siria", "piastra siria|piastras sirias"), - ("Chelín somalí", "chelín somalí|chelines somalies|sos"), - ("Centavo somalí", "centavo somalí|centavos somalies"), - ("Chelín somalilandés", "chelín somalilandés|chelines somalilandeses"), - ("Centavo somalilandés", "centavo somalilandés|centavos somalilandeses"), - ("Rupia de Sri Lanka", "rupia de Sri Lanka|rupias de Sri Lanka|lkr"), - ("Céntimo de Sri Lanka", "céntimo de Sri Lanka|céntimos de Sri Lanka"), - ("Lilangeni", "lilangeni|emalangeni|szl"), - ("Rand sudafricano", "rand|rand sudafricano|zar"), - ("Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"), - ("Piastra sudanesa", "piastra sudanesa|piastras sudanesas"), - ("Libra sursudanesa", "libra sursudanesa|libras sursudanesa|ssp"), - ("Piastra sursudanesa", "piastra sursudanesa|piastras sursudanesas"), - ("Corona sueca", "corona sueca|coronas suecas|sek"), - ("Franco suizo", "franco suizo|francos suizos|sfr|chf"), - ("Rappen suizo", "rappen suizo|rappens suizos"), - ("Dólar surinamés", "óolar surinamés|dólares surinameses|srd"), - ("Centavo surinamés", "centavo surinamés|centavos surinamés"), - ("Baht tailandés", "baht tailandés|baht tailandeses|thb"), - ("Satang tailandés", "satang tailandés|satang tailandeses"), - ("Nuevo dólar taiwanés", "nuevo dólar taiwanés|dólar taiwanés|dólares taiwaneses|twd"), - ("Centavo taiwanés", "centavo taiwanés|centavos taiwaneses"), - ("Chelín tanzano", "chelín tanzano|chelines tanzanos|tzs"), - ("Centavo tanzano", "centavo tanzano|centavos tanzanos"), - ("Somoni tayiko", "somoni tayiko|somoni|tjs"), - ("Diram", "diram|dirams"), - ("Paʻanga", "dólar tongano|dólares tonganos|paʻanga|pa'anga|top"), - ("Seniti", "seniti"), - ("Rublo de Transnistria", "rublo de transnistria|rublos de transnistria"), - ("Kopek de Transnistria", "kopek de transnistria|kopeks de transnistria"), - ("Dólar trinitense", "dólar trinitense|dólares trinitenses|ttd"), - ("Centavo trinitense", "centavo trinitense|centavos trinitenses"), - ("Dinar tunecino", "dinar tunecino|dinares tunecinos|tnd"), - ("Millime tunecino", "millime tunecino|millimes tunecinos"), - ("Lira turca", "lira turca|liras turcas|try"), - ("Kuruş turca", "kuruş turca|kuruş turcas"), - ("Manat turkmeno", "manat turkmeno|manat turkmenos|tmt"), - ("Tennesi turkmeno", "tennesi turkmeno|tenge turkmeno"), - ("Dólar tuvaluano", "dólar tuvaluano|dólares tuvaluanos"), - ("Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"), - ("Grivna", "grivna|grivnas|uah"), - ("Kopiyka", "kopiyka|kópeks"), - ("Chelín ugandés", "chelín ugandés|chelines ugandeses|ugx"), - ("Centavo ugandés", "centavo ugandés|centavos ugandeses"), - ("Peso uruguayo", "peso uruguayo|pesos uruguayos|uyu"), - ("Centésimo uruguayo", "centésimo uruguayo|centésimos uruguayos"), - ("Som uzbeko", "som uzbeko|som uzbekos|uzs"), - ("Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"), - ("Vatu", "vatu|vuv"), - ("Bolívar fuerte", "bolívar fuerte|bolívar|bolívares|vef"), - ("Céntimo de bolívar", "céntimo de bolívar|céntimos de bolívar"), - ("Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamitas|vnd"), - ("Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamitas"), - ("Rial yemení", "rial yemení|riales yemenies|yer"), - ("Fils yemení", "fils yemení|fils yemenies"), - ("Franco yibutiano", "franco yibutiano|francos yibutianos|djf"), - ("Dinar yugoslavo", "dinar yugoslavo|dinares yugoslavos|yud"), - ("Kwacha zambiano", "kwacha zambiano|kwacha zambianos|zmw"), - ("Ngwee zambiano", "ngwee zambiano|ngwee zambianos"), - ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), - ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), - ("Satoshi", "satoshi|satoshis")]) - CurrencyNameToIsoCodeMap = dict([("Afgani afgano", "AFN"), - ("Euro", "EUR"), - ("Lek albanés", "ALL"), - ("Kwanza angoleño", "AOA"), - ("Dram armenio", "AMD"), - ("Florín arubeño", "AWG"), - ("Taka bangladeshí", "BDT"), - ("Ngultrum butanés", "BTN"), - ("Boliviano", "BOB"), - ("Marco bosnioherzegovino", "BAM"), - ("Pula", "BWP"), - ("Real brasileño", "BRL"), - ("Lev búlgaro", "BGN"), - ("Riel camboyano", "KHR"), - ("Escudo caboverdiano", "CVE"), - ("Colón costarricense", "CRC"), - ("Kuna croata", "HRK"), - ("Corona checa", "CZK"), - ("Nakfa", "ERN"), - ("Birr etíope", "ETB"), - ("Dalasi", "GMD"), - ("Lari georgiano", "GEL"), - ("Cedi", "GHS"), - ("Quetzal guatemalteco", "GTQ"), - ("Gourde haitiano", "HTG"), - ("Lempira hondureño", "HNL"), - ("Forinto húngaro", "HUF"), - ("Rial iraní", "IRR"), - ("Rial yemení", "YER"), - ("Nuevo shéquel", "ILS"), - ("Yen", "JPY"), - ("Tenge kazajo", "KZT"), - ("Chelín keniano", "KES"), - ("Won norcoreano", "KPW"), - ("Won surcoreano", "KRW"), - ("Som kirguís", "KGS"), - ("Kip laosiano", "LAK"), - ("Loti", "LSL"), - ("Rand sudafricano", "ZAR"), - ("Pataca macaense", "MOP"), - ("Denar macedonio", "MKD"), - ("Ariary malgache", "MGA"), - ("Kwacha malauí", "MWK"), - ("Ringgit malayo", "MYR"), - ("Uguiya", "MRO"), - ("Tugrik mongol", "MNT"), - ("Metical mozambiqueño", "MZN"), - ("Kyat birmano", "MMK"), - ("Córdoba nicaragüense", "NIO"), - ("Naira", "NGN"), - ("Lira turca", "TRY"), - ("Rial omaní", "OMR"), - ("Balboa panameño", "PAB"), - ("Kina", "PGK"), - ("Guaraní", "PYG"), - ("Sol", "PEN"), - ("Złoty", "PLN"), - ("Riyal qatarí", "QAR"), - ("Riyal saudí", "SAR"), - ("Tala", "WST"), - ("São Tomé and Príncipe dobra", "STN"), - ("Leone", "SLL"), - ("Lilangeni", "SZL"), - ("Somoni tayiko", "TJS"), - ("Baht tailandés", "THB"), - ("Grivna", "UAH"), - ("Vatu", "VUV"), - ("Bolívar fuerte", "VEF"), - ("Kwacha zambiano", "ZMW"), - ("Dirham marroquí", "MAD"), - ("Dirham de los Emiratos Árabes Unidos", "AED"), - ("Manat azerí", "AZN"), - ("Manat turkmeno", "TMT"), - ("Chelín somalí", "SOS"), - ("Chelín tanzano", "TZS"), - ("Chelín ugandés", "UGX"), - ("Leu rumano", "RON"), - ("Leu moldavo", "MDL"), - ("Rupia nepalí", "NPR"), - ("Rupia pakistaní", "PKR"), - ("Rupia india", "INR"), - ("Rupia de Seychelles", "SCR"), - ("Rupia de Mauricio", "MUR"), - ("Rupia de Maldivas", "MVR"), - ("Rupia de Sri Lanka", "LKR"), - ("Rupia indonesia", "IDR"), - ("Corona danesa", "DKK"), - ("Corona noruega", "NOK"), - ("Corona islandesa", "ISK"), - ("Corona sueca", "SEK"), - ("Franco CFA de África Occidental", "XOF"), - ("Franco CFA de África Central", "XAF"), - ("Franco comorano", "KMF"), - ("Franco congoleño", "CDF"), - ("Burundian franc", "BIF"), - ("Franco yibutiano", "DJF"), - ("Franco CFP", "XPF"), - ("Franco guineano", "GNF"), - ("Franco suizo", "CHF"), - ("Franco ruandés", "RWF"), - ("Rublo ruso", "RUB"), - ("Transnistrian ruble", "PRB"), - ("New Belarusian ruble", "BYN"), - ("Dinar argelino", "DZD"), - ("Dinar bahreiní", "BHD"), - ("Dinar iraquí", "IQD"), - ("Dinar jordano", "JOD"), - ("Kuwaiti dinar", "KWD"), - ("Dinar libio", "LYD"), - ("Dinar serbio", "RSD"), - ("Dinar tunecino", "TND"), - ("Peso argentino", "ARS"), - ("Chilean peso", "CLP"), - ("Peso colombiano", "COP"), - ("Peso cubano convertible", "CUC"), - ("Peso cubano", "CUP"), - ("Peso dominicano", "DOP"), - ("Peso mexicano", "MXN"), - ("Peso uruguayo", "UYU"), - ("Libra esterlina", "GBP"), - ("Libra de Santa Helena", "SHP"), - ("Libra egipcia", "EGP"), - ("Libra malvinense", "FKP"), - ("Libra gibraltareña", "GIP"), - ("Libra manesa", "IMP"), - ("Libra de Jersey", "JEP"), - ("Libra libanesa", "LBP"), - ("Libra sursudanesa", "SSP"), - ("Libra sudanesa", "SDG"), - ("Libra siria", "SYP"), - ("Dólar estadounidense", "USD"), - ("Dólar australiano", "AUD"), - ("Dólar bahameño", "BSD"), - ("Dólar de Barbados", "BBD"), - ("Dólar beliceño", "BZD"), - ("Dólar bermudeño", "BMD"), - ("Dólar de Brunéi", "BND"), - ("Dólar de Singapur", "SGD"), - ("Dólar canadiense", "CAD"), - ("Dólar de las Islas Caimán", "KYD"), - ("Dólar neozelandés", "NZD"), - ("Dólar fiyiano", "FJD"), - ("Dólar guyanés", "GYD"), - ("Dólar de Hong Kong", "HKD"), - ("Dólar jamaiquino", "JMD"), - ("Dólar liberiano", "LRD"), - ("Dólar namibio", "NAD"), - ("Dólar de las Islas Salomón", "SBD"), - ("Dólar surinamés", "SRD"), - ("Nuevo dólar taiwanés", "TWD"), - ("Dólar trinitense", "TTD"), - ("Tuvaluan dollar", "TVD"), - ("Yuan chino", "CNY"), - ("Rial", "__RI"), - ("Chelín", "__S"), - ("Som", "__SO"), - ("Dirham", "__DR"), - ("Dinar", "_DN"), - ("Dólar", "__D"), - ("Manat", "__MA"), - ("Rupia", "__R"), - ("Corona", "__K"), - ("Franco", "__F"), - ("Marco", "__M"), - ("Rublo", "__RB"), - ("Peso", "__PE"), - ("Libra", "__P"), - ("Tristan da Cunha libra", "_TP"), - ("South Georgia and the South Sandwich Islands libra", "_SP"), - ("Somaliland chelín", "_SS"), - ("Pitcairn Islands dólar", "_PND"), - ("Palauan dólar", "_PD"), - ("Niue dólar", "_NID"), - ("Nauruan dólar", "_ND"), - ("Micronesian dólar", "_MD"), - ("Kiribati dólar", "_KID"), - ("Guernsey libra", "_GGP"), - ("Faroese corona", "_FOK"), - ("Cook Islands dólar", "_CKD"), - ("British Virgin Islands dólar", "_BD"), - ("Ascension libra", "_AP"), - ("Alderney libra", "_ALP"), - ("Abkhazian apsar", "_AA"), - ("Bitcoin", "_XBT")]) - FractionalUnitNameToCodeMap = dict([("Jiao", "JIAO"), - ("Kópek", "KOPEK"), - ("Kopek", "KOPEK"), - ("Pul", "PUL"), - ("Cent", "CENT"), - ("Qindarka", "QINDARKE"), - ("Penique", "PENNY"), - ("Santeem", "SANTEEM"), - ("Cêntimo", "CENT"), - ("Centavo", "CENT"), - ("Luma", "LUMA"), - ("Qəpik", "QƏPIK"), - ("Fils", "FILS"), - ("Poisha", "POISHA"), - ("Kapyeyka", "KAPYEYKA"), - ("Kopyeyka", "KOPYEYKA"), - ("Centime", "CENTIME"), - ("Chetrum", "CHETRUM"), - ("Paisa", "PAISA"), - ("Feningas", "FENING"), - ("Thebe", "THEBE"), - ("Sen", "SEN"), - ("Stotinka", "STOTINKA"), - ("Fen", "FEN"), - ("Céntimo", "CENT"), - ("Lipa", "LIPA"), - ("Haléř", "HALER"), - ("Øre", "ØRE"), - ("Piastre", "PIASTRE"), - ("Santim", "SANTIM"), - ("Oyra", "OYRA"), - ("Butut", "BUTUT"), - ("Tetri", "TETRI"), - ("Pesewa", "PESEWA"), - ("Fillér", "FILLER"), - ("Eyrir", "EYRIR"), - ("Dinar", "DINAR"), - ("Agora", "AGORA"), - ("Tïın", "TIIN"), - ("Chon", "CHON"), - ("Jeon", "JEON"), - ("Tyiyn", "TYIYN"), - ("Att", "ATT"), - ("Sente", "SENTE"), - ("Dirham", "DIRHAM"), - ("Rappen", "RAPPEN"), - ("Avo", "AVO"), - ("Deni", "DENI"), - ("Iraimbilanja", "IRAIMBILANJA"), - ("Tambala", "TAMBALA"), - ("Laari", "LAARI"), - ("Khoums", "KHOUMS"), - ("Ban", "BAN"), - ("Möngö", "MONGO"), - ("Pya", "PYA"), - ("Kobo", "KOBO"), - ("Kuruş", "KURUS"), - ("Baisa", "BAISA"), - ("Centésimo", "CENTESIMO"), - ("Toea", "TOEA"), - ("Sentimo", "SENTIMO"), - ("Grosz", "GROSZ"), - ("Sene", "SENE"), - ("Halala", "HALALA"), - ("Para", "PARA"), - ("Öre", "ORE"), - ("Diram", "DIRAM"), - ("Satang", "SATANG"), - ("Seniti", "SENITI"), - ("Millime", "MILLIME"), - ("Tennesi", "TENNESI"), - ("Kopiyka", "KOPIYKA"), - ("Tiyin", "TIYIN"), - ("Hào", "HAO"), - ("Ngwee", "NGWEE"), - ("Millibitcoin", "MILLIBITCOIN"), - ("Satoshi", "SATOSHI")]) - CompoundUnitConnectorRegex = f'(?y|con)' - MultiplierRegex = f'\\s*\\b(((mil\\s+)?mi|bi|cuatri|quinti|sexti|septi)ll[oó]n|mil)(es)?\\b' - CurrencyPrefixList = dict([("Dobra", "db|std"), - ("Dólar", "$|dólar|dólares|dolar|dolares"), - ("Dólar estadounidense", "us$|u$d|usd"), - ("Dólar del Caribe Oriental", "ec$|xcd"), - ("Dólar australiano", "a$|aud"), - ("Dólar bahameño", "b$|bsd"), - ("Dólar de Barbados", "bds$|bbd"), - ("Dólar beliceño", "bz$|bzd"), - ("Dólar bermudeño", "bd$|bmd"), - ("Dólar de Brunéi", "brunéi $|bnd"), - ("Dólar de Singapur", "s$|sgd"), - ("Dólar canadiense", "c$|can$|cad"), - ("Dólar de las Islas Caimán", "ci$|kyd"), - ("Dólar neozelandés", "nz$|nzd"), - ("Dólar fiyiano", "fj$|fjd"), - ("Dólar guyanés", "gy$|gyd"), - ("Dólar de Hong Kong", "hk$|hkd"), - ("Dólar jamaiquino", "j$|ja$|jmd"), - ("Dólar liberiano", "l$|lrd"), - ("Dólar namibio", "n$|nad"), - ("Dólar de las Islas Salomón", "si$|sbd"), - ("Nuevo dólar taiwanés", "nt$|twd"), - ("Peso mexicano", "mxn|mxn$|mxn $|mex$"), - ("Real brasileño", "r$|brl"), - ("Guaraní", "₲|gs.|pyg"), - ("Dólar trinitense", "tt$|ttd"), - ("Yuan chino", "¥|cny|rmb"), - ("Yen", "¥|jpy"), - ("Euro", "€|eur"), - ("Florín", "ƒ"), - ("Libra", "£"), - ("Colón costarricense", "₡"), - ("Lira turca", "₺"), - ("Bitcoin", "₿|btc|xbt")]) + CurrencySuffixList = dict( + [ + ("Dólar", "dólar|dólares|dolar|dolares"), + ("Peso", "peso|pesos"), + ("Rublo", "rublo|rublos"), + ("Libra", "libra|libras"), + ("Florín", "florín|florines"), + ("Dinar", "dinar|dinares"), + ("Franco", "franco|francos"), + ("Rupia", "rupia|rupias"), + ("Escudo", "escudo|escudos"), + ("Chelín", "chelín|chelines"), + ("Lira", "lira|liras"), + ("Centavo", "centavo|centavos"), + ("Céntimo", "céntimo|céntimos"), + ("Centésimo", "centésimo|centésimos"), + ("Penique", "penique|peniques"), + ("Euro", "euro|euros|€|eur"), + ("Céntimo de Euro", "céntimo de euro|céntimos de euros"), + ("Dólar del Caribe Oriental", "dólar del caribe oriental|dólares del caribe oriental|ec$|xcd"), + ("Centavo del Caribe Oriental", "centavo del caribe oriental|centavos del caribe oriental"), + ( + "Franco CFA de África Occidental", + "franco cfa de África occidental|francos cfa de África occidental|fcfa|xof", + ), + ( + "Céntimo de CFA de África Occidental", + "céntimo de cfa de África occidental|céntimos de cfa de África occidental", + ), + ("Franco CFA de África Central", "franco cfa de África central|francos cfa de África central|xaf"), + ("Céntimo de CFA de África Central", "céntimo de cfa de África central|céntimos de cfa de África central"), + ("Apsar", "apsar|apsares"), + ("Afgani afgano", "afgani afgano|؋|afn|afganis|afgani"), + ("Pul", "pul|puls"), + ("Lek albanés", "lek|lekë|lekes|lek albanés"), + ("Qindarka", "qindarka|qindarkë|qindarkas"), + ("Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleños|kwanzas angoleño|kwanzas|aoa|kz"), + ("Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"), + ( + "Florín antillano neerlandés", + "florín antillano neerlandés|florínes antillano neerlandés|ƒ antillano neerlandés|ang|naƒ", + ), + ("Cent antillano neerlandés", "cent|centen"), + ("Riyal saudí", "riyal saudí|riyales saudí|sar"), + ("Halalá saudí", "halalá saudí|hallalah"), + ("Dinar argelino", "dinar argelino|dinares argelinos|dzd"), + ("Céntimo argelino", "centimo argelino|centimos argelinos"), + ("Peso argentino", "peso argentino|pesos argentinos|ar$|ars"), + ("Centavo argentino", "centavo argentino|centavos argentinos|ctvo.|ctvos."), + ("Dram armenio", "dram armenio|dram armenios|dram|դր."), + ("Luma armenio", "luma armenio|luma armenios"), + ("Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"), + ("Yotin arubeño", "yotin arubeño|yotines arubeños"), + ("Dólar australiano", "dólar australiano|dólares australianos|a$|aud"), + ("Centavo australiano", "centavo australiano|centavos australianos"), + ("Manat azerí", "manat azerí|man|azn"), + ("Qəpik azerí", "qəpik azerí|qəpik"), + ("Dólar bahameño", "dólar bahameño|dólares bahameños|b$|bsd"), + ("Centavo bahameño", "centavo bahameño|centavos bahameños"), + ("Dinar bahreiní", "dinar bahreiní|dinares bahreinies|bhd"), + ("Fil bahreiní", "fil bahreiní|fils bahreinies"), + ("Taka bangladeshí", "taka bangladeshí|takas bangladeshí|bdt"), + ("Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"), + ("Dólar de Barbados", "dólar de barbados|dólares de barbados|bbd"), + ("Centavo de Barbados", "centavo de barbados|centavos de barbados"), + ("Dólar beliceño", "dólar beliceño|dólares beliceños|bz$|bzd"), + ("Centavo beliceño", "centavo beliceño|centavos beliceños"), + ("Dólar bermudeño", "dólar bermudeño|dólares bermudeños|bd$|bmd"), + ("Centavo bermudeño", "centavo bermudeño|centavos bermudeños"), + ("Rublo bielorruso", "rublo bielorruso|rublos bielorrusos|byr"), + ("Kópek bielorruso", "kópek bielorruso|kópeks bielorrusos|kap"), + ("Kyat birmano", "kyat birmano|kyats birmanos|mmk"), + ("Pya birmano", "pya birmano|pyas birmanos"), + ("Boliviano", "boliviano|bolivianos|bob|bs"), + ("Centésimo Boliviano", "centésimo boliviano|centésimos bolivianos"), + ( + "Marco bosnioherzegovino", + "marco convertible|marco bosnioherzegovino|marcos convertibles|marcos bosnioherzegovinos|bam", + ), + ("Feningas bosnioherzegovino", "feninga convertible|feninga bosnioherzegovina|feningas convertibles"), + ("Pula", "pula|bwp"), + ("Thebe", "thebe"), + ("Real brasileño", "real brasileño|reales brasileños|r$|brl"), + ("Centavo brasileño", "centavo brasileño|centavos brasileños"), + ("Dólar de Brunéi", "dólar de brunei|dólares de brunéi|bnd"), + ("Sen de Brunéi", "sen|sen de brunéi"), + ("Lev búlgaro", "lev búlgaro|leva búlgaros|lv|bgn"), + ("Stotinki búlgaro", "stotinka búlgaro|stotinki búlgaros"), + ("Franco de Burundi", "franco de burundi|francos de burundi|fbu|fib"), + ("Céntimo Burundi", "céntimo burundi|céntimos burundies"), + ("Ngultrum butanés", "ngultrum butanés|ngultrum butaneses|btn"), + ("Chetrum butanés", "chetrum butanés|chetrum butaneses"), + ("Escudo caboverdiano", "escudo caboverdiano|escudos caboverdianos|cve"), + ("Riel camboyano", "riel camboyano|rieles camboyanos|khr"), + ("Dólar canadiense", "dólar canadiense|dólares canadienses|c$|cad"), + ("Centavo canadiense", "centavo canadiense|centavos canadienses"), + ("Peso chileno", "peso chileno|pesos chilenos|cpl"), + ("Yuan chino", "yuan chino|yuanes chinos|yuan|yuanes|renminbi|rmb|cny|¥"), + ("Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"), + ("Centavo colombiano", "centavo colombiano|centavos colombianos"), + ("Franco comorano", "franco comorano|francos comoranos|kmf|₣"), + ("Franco congoleño", "franco congoleño|francos congoleños|cdf"), + ("Céntimo congoleño", "céntimo congoleño|céntimos congoleños"), + ("Won norcoreano", "won norcoreano|wŏn norcoreano|wŏn norcoreanos|kpw"), + ("Chon norcoreano", "chon norcoreano|chŏn norcoreano|chŏn norcoreanos|chon norcoreanos"), + ("Won surcoreano", "wŏn surcoreano|won surcoreano|wŏnes surcoreanos|wones surcoreanos|krw"), + ("Chon surcoreano", "chon surcoreano|chŏn surcoreano|chŏn surcoreanos|chon surcoreanos"), + ("Colón costarricense", "colón costarricense|colones costarricenses|crc"), + ("Kuna croata", "kuna croata|kuna croatas|hrk"), + ("Lipa croata", "lipa croata|lipa croatas"), + ("Peso cubano", "peso cubano|pesos cubanos|cup"), + ("Peso cubano convertible", "peso cubano convertible|pesos cubanos convertible|cuc"), + ("Corona danesa", "corona danesa|coronas danesas|dkk"), + ("Libra egipcia", "libra egipcia|libras egipcias|egp|l.e."), + ("Piastra egipcia", "piastra egipcia|piastras egipcias"), + ("Colón salvadoreño", "colón salvadoreño|colones salvadoreños|svc"), + ("Dirham de los Emiratos Árabes Unidos", "dirham|dirhams|dirham de los emiratos Árabes unidos|aed|dhs"), + ("Nakfa", "nakfa|nfk|ern"), + ("Céntimo de Nakfa", "céntimo de nakfa|céntimos de nakfa"), + ("Peseta", "peseta|pesetas|pts.|ptas.|esp"), + ("Dólar estadounidense", "dólar estadounidense|dólares estadounidenses|usd|u$d|us$"), + ("Corona estonia", "corona estonia|coronas estonias|eek"), + ("Senti estonia", "senti estonia|senti estonias"), + ("Birr etíope", "birr etíope|birr etíopes|br|etb"), + ("Santim etíope", "santim etíope|santim etíopes"), + ("Peso filipino", "peso filipino|pesos filipinos|php"), + ("Marco finlandés", "marco finlandés|marcos finlandeses"), + ("Dólar fiyiano", "dólar fiyiano|dólares fiyianos|fj$|fjd"), + ("Centavo fiyiano", "centavo fiyiano|centavos fiyianos"), + ("Dalasi", "dalasi|gmd"), + ("Bututs", "butut|bututs"), + ("Lari georgiano", "lari georgiano|lari georgianos|gel"), + ("Tetri georgiano", "tetri georgiano|tetri georgianos"), + ("Cedi", "cedi|ghs|gh₵"), + ("Pesewa", "pesewa"), + ("Libra gibraltareña", "libra gibraltareña|libras gibraltareñas|gip"), + ("Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"), + ("Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"), + ("Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"), + ("Libra de Guernsey", "libra de guernsey|libras de guernsey|ggp"), + ("Penique de Guernsey", "penique de guernsey|peniques de guernsey"), + ("Franco guineano", "franco guineano|francos guineanos|gnf|fg"), + ("Céntimo guineano", "céntimo guineano|céntimos guineanos"), + ("Dólar guyanés", "dólar guyanés|dólares guyaneses|gyd|gy"), + ("Gourde haitiano", "gourde haitiano|gourde haitianos|htg"), + ("Céntimo haitiano", "céntimo haitiano|céntimos haitianos"), + ("Lempira hondureño", "lempira hondureño|lempira hondureños|hnl"), + ("Centavo hondureño", "centavo hondureño|centavos hondureño"), + ("Dólar de Hong Kong", "dólar de hong kong|dólares de hong kong|hk$|hkd"), + ("Forinto húngaro", "forinto húngaro|forinto húngaros|huf"), + ("Rupia india", "rupia india|rupias indias|inr"), + ("Paisa india", "paisa india|paise indias"), + ("Rupia indonesia", "rupia indonesia|rupias indonesias|idr"), + ("Sen indonesia", "sen indonesia|sen indonesias"), + ("Rial iraní", "rial iraní|rial iranies|irr"), + ("Dinar iraquí", "dinar iraquí|dinares iraquies|iqd"), + ("Fil iraquí", "fil iraquí|fils iraquies"), + ("Libra manesa", "libra manesa|libras manesas|imp"), + ("Penique manes", "penique manes|peniques maneses"), + ("Corona islandesa", "corona islandesa|coronas islandesas|isk|íkr"), + ("Aurar islandes", "aurar islandes|aurar islandeses"), + ("Dólar de las Islas Caimán", "dólar de las islas caimán|dólares de las islas caimán|ci$|kyd"), + ("Dólar de las Islas Cook", "dólar de las islas cook|dólares de las islas cook"), + ("Corona feroesa", "corona feroesa|coronas feroesas|fkr"), + ("Libra malvinense", "libra malvinense|libras malvinenses|fk£|fkp"), + ("Dólar de las Islas Salomón", "dólar de las islas salomón|dólares de las islas salomón|sbd"), + ("Nuevo shéquel", "nuevo shéquel|nuevos shéquel|ils"), + ("Agorot", "agorot"), + ("Dólar jamaiquino", "dólar jamaiquino|dólares jamaiquinos|j$|ja$|jmd"), + ("Yen", "yen|yenes|jpy"), + ("Libra de Jersey", "libra de jersey|libras de jersey|jep"), + ("Dinar jordano", "dinar jordano|dinares jordanos|jd|jod"), + ("Piastra jordano", "piastra jordano|piastras jordanos"), + ("Tenge kazajo", "tenge|tenge kazajo|kzt"), + ("Chelín keniano", "chelín keniano|chelines kenianos|ksh|kes"), + ("Som kirguís", "som kirguís|kgs"), + ("Tyiyn", "tyiyn"), + ("Dólar de Kiribati", "dólar de kiribati|dólares de kiribati"), + ("Dinar kuwaití", "dinar kuwaití|dinares kuwaití"), + ("Kip laosiano", "kip|kip laosiano|kip laosianos|lak"), + ("Att laosiano", "att|att laosiano|att laosianos"), + ("Loti", "loti|maloti|lsl"), + ("Sente", "sente|lisente"), + ("Libra libanesa", "libra libanesa|libras libanesas|lbp"), + ("Dólar liberiano", "dólar liberiano|dólares liberianos|l$|lrd"), + ("Dinar libio", "dinar libio|dinares libios|ld|lyd"), + ("Dirham libio", "dirham libio|dirhams libios"), + ("Litas lituana", "litas lituana|litai lituanas|ltl"), + ("Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"), + ("Avo macaense", "avo macaense|avos macaenses"), + ("Ho macaense", "ho macaense|ho macaenses"), + ("Denar macedonio", "denar macedonio|denare macedonios|den|mkd"), + ("Deni macedonio", "deni macedonio|deni macedonios"), + ("Ariary malgache", "ariary malgache|ariary malgaches|mga"), + ("Iraimbilanja malgache", "iraimbilanja malgache|iraimbilanja malgaches"), + ("Ringgit malayo", "ringgit malayo|ringgit malayos|rm|myr"), + ("Sen malayo", "sen malayo|sen malayos"), + ("Kwacha malauí", "kwacha malauí|mk|mwk"), + ("Támbala malauí", "támbala malauí"), + ("Rupia de Maldivas", "rupia de maldivas|rupias de maldivas|mvr"), + ("Dirham marroquí", "dirham marroquí|dirhams marroquies|mad"), + ("Rupia de Mauricio", "rupia de Mauricio|rupias de Mauricio|mur"), + ("Uguiya", "uguiya|uguiyas|mro"), + ("Jum", "jum|jums"), + ("Peso mexicano", "peso mexicano|pesos mexicanos|mxn|mxn$|mxn $|mex$"), + ("Centavo mexicano", "centavo mexicano|centavos mexicanos"), + ("Leu moldavo", "leu moldavo|lei moldavos|mdl"), + ("Ban moldavo", "ban moldavo|bani moldavos"), + ("Tugrik mongol", "tugrik mongol|tugrik|tugrik mongoles|tug|mnt"), + ("Metical mozambiqueño", "metical|metical mozambiqueño|meticales|meticales mozambiqueños|mtn|mzn"), + ("Dram de Nagorno Karabaj", "dram de nagorno karabaj|drams de nagorno karabaj"), + ("Luma de Nagorno Karabaj", "luma de nagorno karabaj"), + ("Dólar namibio", "dólar namibio|dólares namibios|n$|nad"), + ("Centavo namibio", "centavo namibio|centavos namibios"), + ("Rupia nepalí", "rupia nepalí|rupias nepalies|npr"), + ("Paisa nepalí", "paisa nepalí|paisas nepalies"), + ("Córdoba nicaragüense", "córdoba nicaragüense|córdobas nicaragüenses|nio"), + ("Centavo nicaragüense", "centavo nicaragüense|centavos nicaragüenses"), + ("Naira", "naira|ngn"), + ("Kobo", "kobo"), + ("Corona noruega", "corona noruega|coronas noruegas|nok"), + ("Franco CFP", "franco cfp|francos cfp|xpf"), + ( + "Dólar neozelandés", + "dólar neozelandés|dólares neozelandeses|dólar de nueva zelanda|dólares de nueva zelanda|nz$|nzd", + ), + ( + "Centavo neozelandés", + "centavo neozelandés|centavo de nueva zelanda|centavos de nueva zelanda|centavos neozelandeses", + ), + ("Rial omaní", "rial omaní|riales omanies|omr"), + ("Baisa omaní", "baisa omaní|baisa omanies"), + ("Florín neerlandés", "florín neerlandés|florines neerlandeses|nlg"), + ("Rupia pakistaní", "rupia pakistaní|rupias pakistanies|pkr"), + ("Paisa pakistaní", "paisa pakistaní|paisas pakistanies"), + ("Balboa panameño", "balboa panameño|balboa panameños|pab"), + ("Centésimo panameño", "centésimo panameño|centésimos panameños"), + ("Kina", "kina|pkg|pgk"), + ("Toea", "toea"), + ("Guaraní", "guaraní|guaranies|gs|pyg"), + ("Sol", "sol|soles|nuevo sol|pen|s#."), + ("Céntimo de sol", "céntimo de sol|céntimos de sol"), + ("Złoty", "złoty|esloti|eslotis|zł|pln"), + ("Groszy", "groszy"), + ("Riyal qatarí", "riyal qatarí|riyal qataries|qr|qar"), + ("Dirham qatarí", "dirham qatarí|dirhams qataries"), + ("Libra esterlina", "libra esterlina|libras esterlinas|gbp"), + ("Corona checa", "corona checa|coronas checas|kc|czk"), + ("Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"), + ("Centavo dominicano", "centavo dominicano|centavos dominicanos"), + ("Franco ruandés", "franco ruandés|francos ruandeses|rf|rwf"), + ("Céntimo ruandés", "céntimo ruandés|céntimos ruandeses"), + ("Leu rumano", "leu rumano|lei rumanos|ron"), + ("Ban rumano", "ban rumano|bani rumanos"), + ("Rublo ruso", "rublo ruso|rublos rusos|rub"), + ("Kopek ruso", "kopek ruso|kopeks rusos"), + ("Tala", "tala|tālā|ws$|sat|wst"), + ("Sene", "sene"), + ("Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"), + ("Penique de Santa Helena", "penique de santa helena|peniques de santa helena"), + ("Dobra", "dobra"), + ("Dinar serbio", "dinar serbio|dinares serbios|rsd"), + ("Para serbio", "para serbio|para serbios"), + ("Rupia de Seychelles", "rupia de seychelles|rupias de seychelles|scr"), + ("Centavo de Seychelles", "centavo de seychelles|centavos de seychelles"), + ("Leone", "leone|le|sll"), + ("Dólar de Singapur", "dólar de singapur|dólares de singapur|sgb"), + ("Centavo de Singapur", "centavo de Singapur|centavos de Singapur"), + ("Libra siria", "libra siria|libras sirias|s£|syp"), + ("Piastra siria", "piastra siria|piastras sirias"), + ("Chelín somalí", "chelín somalí|chelines somalies|sos"), + ("Centavo somalí", "centavo somalí|centavos somalies"), + ("Chelín somalilandés", "chelín somalilandés|chelines somalilandeses"), + ("Centavo somalilandés", "centavo somalilandés|centavos somalilandeses"), + ("Rupia de Sri Lanka", "rupia de Sri Lanka|rupias de Sri Lanka|lkr"), + ("Céntimo de Sri Lanka", "céntimo de Sri Lanka|céntimos de Sri Lanka"), + ("Lilangeni", "lilangeni|emalangeni|szl"), + ("Rand sudafricano", "rand|rand sudafricano|zar"), + ("Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"), + ("Piastra sudanesa", "piastra sudanesa|piastras sudanesas"), + ("Libra sursudanesa", "libra sursudanesa|libras sursudanesa|ssp"), + ("Piastra sursudanesa", "piastra sursudanesa|piastras sursudanesas"), + ("Corona sueca", "corona sueca|coronas suecas|sek"), + ("Franco suizo", "franco suizo|francos suizos|sfr|chf"), + ("Rappen suizo", "rappen suizo|rappens suizos"), + ("Dólar surinamés", "óolar surinamés|dólares surinameses|srd"), + ("Centavo surinamés", "centavo surinamés|centavos surinamés"), + ("Baht tailandés", "baht tailandés|baht tailandeses|thb"), + ("Satang tailandés", "satang tailandés|satang tailandeses"), + ("Nuevo dólar taiwanés", "nuevo dólar taiwanés|dólar taiwanés|dólares taiwaneses|twd"), + ("Centavo taiwanés", "centavo taiwanés|centavos taiwaneses"), + ("Chelín tanzano", "chelín tanzano|chelines tanzanos|tzs"), + ("Centavo tanzano", "centavo tanzano|centavos tanzanos"), + ("Somoni tayiko", "somoni tayiko|somoni|tjs"), + ("Diram", "diram|dirams"), + ("Paʻanga", "dólar tongano|dólares tonganos|paʻanga|pa'anga|top"), + ("Seniti", "seniti"), + ("Rublo de Transnistria", "rublo de transnistria|rublos de transnistria"), + ("Kopek de Transnistria", "kopek de transnistria|kopeks de transnistria"), + ("Dólar trinitense", "dólar trinitense|dólares trinitenses|ttd"), + ("Centavo trinitense", "centavo trinitense|centavos trinitenses"), + ("Dinar tunecino", "dinar tunecino|dinares tunecinos|tnd"), + ("Millime tunecino", "millime tunecino|millimes tunecinos"), + ("Lira turca", "lira turca|liras turcas|try"), + ("Kuruş turca", "kuruş turca|kuruş turcas"), + ("Manat turkmeno", "manat turkmeno|manat turkmenos|tmt"), + ("Tennesi turkmeno", "tennesi turkmeno|tenge turkmeno"), + ("Dólar tuvaluano", "dólar tuvaluano|dólares tuvaluanos"), + ("Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"), + ("Grivna", "grivna|grivnas|uah"), + ("Kopiyka", "kopiyka|kópeks"), + ("Chelín ugandés", "chelín ugandés|chelines ugandeses|ugx"), + ("Centavo ugandés", "centavo ugandés|centavos ugandeses"), + ("Peso uruguayo", "peso uruguayo|pesos uruguayos|uyu"), + ("Centésimo uruguayo", "centésimo uruguayo|centésimos uruguayos"), + ("Som uzbeko", "som uzbeko|som uzbekos|uzs"), + ("Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"), + ("Vatu", "vatu|vuv"), + ("Bolívar fuerte", "bolívar fuerte|bolívar|bolívares|vef"), + ("Céntimo de bolívar", "céntimo de bolívar|céntimos de bolívar"), + ("Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamitas|vnd"), + ("Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamitas"), + ("Rial yemení", "rial yemení|riales yemenies|yer"), + ("Fils yemení", "fils yemení|fils yemenies"), + ("Franco yibutiano", "franco yibutiano|francos yibutianos|djf"), + ("Dinar yugoslavo", "dinar yugoslavo|dinares yugoslavos|yud"), + ("Kwacha zambiano", "kwacha zambiano|kwacha zambianos|zmw"), + ("Ngwee zambiano", "ngwee zambiano|ngwee zambianos"), + ("Bitcoin", "bitcoin|bitcoins|btc|xbt|₿"), + ("Millibitcoin", "millibitcoin|millibitcoins|milibitcoin|milibitcoins"), + ("Satoshi", "satoshi|satoshis"), + ] + ) + CurrencyNameToIsoCodeMap = dict( + [ + ("Afgani afgano", "AFN"), + ("Euro", "EUR"), + ("Lek albanés", "ALL"), + ("Kwanza angoleño", "AOA"), + ("Dram armenio", "AMD"), + ("Florín arubeño", "AWG"), + ("Taka bangladeshí", "BDT"), + ("Ngultrum butanés", "BTN"), + ("Boliviano", "BOB"), + ("Marco bosnioherzegovino", "BAM"), + ("Pula", "BWP"), + ("Real brasileño", "BRL"), + ("Lev búlgaro", "BGN"), + ("Riel camboyano", "KHR"), + ("Escudo caboverdiano", "CVE"), + ("Colón costarricense", "CRC"), + ("Kuna croata", "HRK"), + ("Corona checa", "CZK"), + ("Nakfa", "ERN"), + ("Birr etíope", "ETB"), + ("Dalasi", "GMD"), + ("Lari georgiano", "GEL"), + ("Cedi", "GHS"), + ("Quetzal guatemalteco", "GTQ"), + ("Gourde haitiano", "HTG"), + ("Lempira hondureño", "HNL"), + ("Forinto húngaro", "HUF"), + ("Rial iraní", "IRR"), + ("Rial yemení", "YER"), + ("Nuevo shéquel", "ILS"), + ("Yen", "JPY"), + ("Tenge kazajo", "KZT"), + ("Chelín keniano", "KES"), + ("Won norcoreano", "KPW"), + ("Won surcoreano", "KRW"), + ("Som kirguís", "KGS"), + ("Kip laosiano", "LAK"), + ("Loti", "LSL"), + ("Rand sudafricano", "ZAR"), + ("Pataca macaense", "MOP"), + ("Denar macedonio", "MKD"), + ("Ariary malgache", "MGA"), + ("Kwacha malauí", "MWK"), + ("Ringgit malayo", "MYR"), + ("Uguiya", "MRO"), + ("Tugrik mongol", "MNT"), + ("Metical mozambiqueño", "MZN"), + ("Kyat birmano", "MMK"), + ("Córdoba nicaragüense", "NIO"), + ("Naira", "NGN"), + ("Lira turca", "TRY"), + ("Rial omaní", "OMR"), + ("Balboa panameño", "PAB"), + ("Kina", "PGK"), + ("Guaraní", "PYG"), + ("Sol", "PEN"), + ("Złoty", "PLN"), + ("Riyal qatarí", "QAR"), + ("Riyal saudí", "SAR"), + ("Tala", "WST"), + ("São Tomé and Príncipe dobra", "STN"), + ("Leone", "SLL"), + ("Lilangeni", "SZL"), + ("Somoni tayiko", "TJS"), + ("Baht tailandés", "THB"), + ("Grivna", "UAH"), + ("Vatu", "VUV"), + ("Bolívar fuerte", "VEF"), + ("Kwacha zambiano", "ZMW"), + ("Dirham marroquí", "MAD"), + ("Dirham de los Emiratos Árabes Unidos", "AED"), + ("Manat azerí", "AZN"), + ("Manat turkmeno", "TMT"), + ("Chelín somalí", "SOS"), + ("Chelín tanzano", "TZS"), + ("Chelín ugandés", "UGX"), + ("Leu rumano", "RON"), + ("Leu moldavo", "MDL"), + ("Rupia nepalí", "NPR"), + ("Rupia pakistaní", "PKR"), + ("Rupia india", "INR"), + ("Rupia de Seychelles", "SCR"), + ("Rupia de Mauricio", "MUR"), + ("Rupia de Maldivas", "MVR"), + ("Rupia de Sri Lanka", "LKR"), + ("Rupia indonesia", "IDR"), + ("Corona danesa", "DKK"), + ("Corona noruega", "NOK"), + ("Corona islandesa", "ISK"), + ("Corona sueca", "SEK"), + ("Franco CFA de África Occidental", "XOF"), + ("Franco CFA de África Central", "XAF"), + ("Franco comorano", "KMF"), + ("Franco congoleño", "CDF"), + ("Burundian franc", "BIF"), + ("Franco yibutiano", "DJF"), + ("Franco CFP", "XPF"), + ("Franco guineano", "GNF"), + ("Franco suizo", "CHF"), + ("Franco ruandés", "RWF"), + ("Rublo ruso", "RUB"), + ("Transnistrian ruble", "PRB"), + ("New Belarusian ruble", "BYN"), + ("Dinar argelino", "DZD"), + ("Dinar bahreiní", "BHD"), + ("Dinar iraquí", "IQD"), + ("Dinar jordano", "JOD"), + ("Kuwaiti dinar", "KWD"), + ("Dinar libio", "LYD"), + ("Dinar serbio", "RSD"), + ("Dinar tunecino", "TND"), + ("Peso argentino", "ARS"), + ("Chilean peso", "CLP"), + ("Peso colombiano", "COP"), + ("Peso cubano convertible", "CUC"), + ("Peso cubano", "CUP"), + ("Peso dominicano", "DOP"), + ("Peso mexicano", "MXN"), + ("Peso uruguayo", "UYU"), + ("Libra esterlina", "GBP"), + ("Libra de Santa Helena", "SHP"), + ("Libra egipcia", "EGP"), + ("Libra malvinense", "FKP"), + ("Libra gibraltareña", "GIP"), + ("Libra manesa", "IMP"), + ("Libra de Jersey", "JEP"), + ("Libra libanesa", "LBP"), + ("Libra sursudanesa", "SSP"), + ("Libra sudanesa", "SDG"), + ("Libra siria", "SYP"), + ("Dólar estadounidense", "USD"), + ("Dólar australiano", "AUD"), + ("Dólar bahameño", "BSD"), + ("Dólar de Barbados", "BBD"), + ("Dólar beliceño", "BZD"), + ("Dólar bermudeño", "BMD"), + ("Dólar de Brunéi", "BND"), + ("Dólar de Singapur", "SGD"), + ("Dólar canadiense", "CAD"), + ("Dólar de las Islas Caimán", "KYD"), + ("Dólar neozelandés", "NZD"), + ("Dólar fiyiano", "FJD"), + ("Dólar guyanés", "GYD"), + ("Dólar de Hong Kong", "HKD"), + ("Dólar jamaiquino", "JMD"), + ("Dólar liberiano", "LRD"), + ("Dólar namibio", "NAD"), + ("Dólar de las Islas Salomón", "SBD"), + ("Dólar surinamés", "SRD"), + ("Nuevo dólar taiwanés", "TWD"), + ("Dólar trinitense", "TTD"), + ("Tuvaluan dollar", "TVD"), + ("Yuan chino", "CNY"), + ("Rial", "__RI"), + ("Chelín", "__S"), + ("Som", "__SO"), + ("Dirham", "__DR"), + ("Dinar", "_DN"), + ("Dólar", "__D"), + ("Manat", "__MA"), + ("Rupia", "__R"), + ("Corona", "__K"), + ("Franco", "__F"), + ("Marco", "__M"), + ("Rublo", "__RB"), + ("Peso", "__PE"), + ("Libra", "__P"), + ("Tristan da Cunha libra", "_TP"), + ("South Georgia and the South Sandwich Islands libra", "_SP"), + ("Somaliland chelín", "_SS"), + ("Pitcairn Islands dólar", "_PND"), + ("Palauan dólar", "_PD"), + ("Niue dólar", "_NID"), + ("Nauruan dólar", "_ND"), + ("Micronesian dólar", "_MD"), + ("Kiribati dólar", "_KID"), + ("Guernsey libra", "_GGP"), + ("Faroese corona", "_FOK"), + ("Cook Islands dólar", "_CKD"), + ("British Virgin Islands dólar", "_BD"), + ("Ascension libra", "_AP"), + ("Alderney libra", "_ALP"), + ("Abkhazian apsar", "_AA"), + ("Bitcoin", "_XBT"), + ] + ) + FractionalUnitNameToCodeMap = dict( + [ + ("Jiao", "JIAO"), + ("Kópek", "KOPEK"), + ("Kopek", "KOPEK"), + ("Pul", "PUL"), + ("Cent", "CENT"), + ("Qindarka", "QINDARKE"), + ("Penique", "PENNY"), + ("Santeem", "SANTEEM"), + ("Cêntimo", "CENT"), + ("Centavo", "CENT"), + ("Luma", "LUMA"), + ("Qəpik", "QƏPIK"), + ("Fils", "FILS"), + ("Poisha", "POISHA"), + ("Kapyeyka", "KAPYEYKA"), + ("Kopyeyka", "KOPYEYKA"), + ("Centime", "CENTIME"), + ("Chetrum", "CHETRUM"), + ("Paisa", "PAISA"), + ("Feningas", "FENING"), + ("Thebe", "THEBE"), + ("Sen", "SEN"), + ("Stotinka", "STOTINKA"), + ("Fen", "FEN"), + ("Céntimo", "CENT"), + ("Lipa", "LIPA"), + ("Haléř", "HALER"), + ("Øre", "ØRE"), + ("Piastre", "PIASTRE"), + ("Santim", "SANTIM"), + ("Oyra", "OYRA"), + ("Butut", "BUTUT"), + ("Tetri", "TETRI"), + ("Pesewa", "PESEWA"), + ("Fillér", "FILLER"), + ("Eyrir", "EYRIR"), + ("Dinar", "DINAR"), + ("Agora", "AGORA"), + ("Tïın", "TIIN"), + ("Chon", "CHON"), + ("Jeon", "JEON"), + ("Tyiyn", "TYIYN"), + ("Att", "ATT"), + ("Sente", "SENTE"), + ("Dirham", "DIRHAM"), + ("Rappen", "RAPPEN"), + ("Avo", "AVO"), + ("Deni", "DENI"), + ("Iraimbilanja", "IRAIMBILANJA"), + ("Tambala", "TAMBALA"), + ("Laari", "LAARI"), + ("Khoums", "KHOUMS"), + ("Ban", "BAN"), + ("Möngö", "MONGO"), + ("Pya", "PYA"), + ("Kobo", "KOBO"), + ("Kuruş", "KURUS"), + ("Baisa", "BAISA"), + ("Centésimo", "CENTESIMO"), + ("Toea", "TOEA"), + ("Sentimo", "SENTIMO"), + ("Grosz", "GROSZ"), + ("Sene", "SENE"), + ("Halala", "HALALA"), + ("Para", "PARA"), + ("Öre", "ORE"), + ("Diram", "DIRAM"), + ("Satang", "SATANG"), + ("Seniti", "SENITI"), + ("Millime", "MILLIME"), + ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), + ("Tiyin", "TIYIN"), + ("Hào", "HAO"), + ("Ngwee", "NGWEE"), + ("Millibitcoin", "MILLIBITCOIN"), + ("Satoshi", "SATOSHI"), + ] + ) + CompoundUnitConnectorRegex = '(?y|con)' + MultiplierRegex = '\\s*\\b(((mil\\s+)?mi|bi|cuatri|quinti|sexti|septi)ll[oó]n|mil)(es)?\\b' + CurrencyPrefixList = dict( + [ + ("Dobra", "db|std"), + ("Dólar", "$|dólar|dólares|dolar|dolares"), + ("Dólar estadounidense", "us$|u$d|usd"), + ("Dólar del Caribe Oriental", "ec$|xcd"), + ("Dólar australiano", "a$|aud"), + ("Dólar bahameño", "b$|bsd"), + ("Dólar de Barbados", "bds$|bbd"), + ("Dólar beliceño", "bz$|bzd"), + ("Dólar bermudeño", "bd$|bmd"), + ("Dólar de Brunéi", "brunéi $|bnd"), + ("Dólar de Singapur", "s$|sgd"), + ("Dólar canadiense", "c$|can$|cad"), + ("Dólar de las Islas Caimán", "ci$|kyd"), + ("Dólar neozelandés", "nz$|nzd"), + ("Dólar fiyiano", "fj$|fjd"), + ("Dólar guyanés", "gy$|gyd"), + ("Dólar de Hong Kong", "hk$|hkd"), + ("Dólar jamaiquino", "j$|ja$|jmd"), + ("Dólar liberiano", "l$|lrd"), + ("Dólar namibio", "n$|nad"), + ("Dólar de las Islas Salomón", "si$|sbd"), + ("Nuevo dólar taiwanés", "nt$|twd"), + ("Peso mexicano", "mxn|mxn$|mxn $|mex$"), + ("Real brasileño", "r$|brl"), + ("Guaraní", "₲|gs.|pyg"), + ("Dólar trinitense", "tt$|ttd"), + ("Yuan chino", "¥|cny|rmb"), + ("Yen", "¥|jpy"), + ("Euro", "€|eur"), + ("Florín", "ƒ"), + ("Libra", "£"), + ("Colón costarricense", "₡"), + ("Lira turca", "₺"), + ("Bitcoin", "₿|btc|xbt"), + ] + ) AmbiguousCurrencyUnitList = [r'le', r'db', r'std'] - InformationSuffixList = dict([("bit", "bit|bits"), - ("kilobit", "kilobit|kilobits|kb|kbit"), - ("megabit", "megabit|megabits|Mb|Mbit"), - ("gigabit", "gigabit|gigabits|Gb|Gbit"), - ("terabit", "terabit|terabits|Tb|Tbit"), - ("petabit", "petabit|petabits|Pb|Pbit"), - ("kibibit", "kibibit|kibibits|kib|kibit"), - ("mebibit", "mebibit|mebibits|Mib|Mibit"), - ("gibibit", "gibibit|gibibits|Gib|Gibit"), - ("tebibit", "tebibit|tebibits|Tib|Tibit"), - ("pebibit", "pebibit|pebibits|Pib|Pibit"), - ("byte", "byte|bytes"), - ("kilobyte", "kilobyte|kilobytes|kB|kByte"), - ("megabyte", "megabyte|megabytes|MB|MByte"), - ("gigabyte", "gigabyte|gigabytes|GB|GByte"), - ("terabyte", "terabyte|terabytes|TB|TByte"), - ("petabyte", "petabyte|petabytes|PB|PByte"), - ("kibibyte", "kibibyte|kibibytes|kiB|kiByte"), - ("mebibyte", "mebibyte|mebibytes|MiB|MiByte"), - ("gibibyte", "gibibyte|gibibytes|GiB|GiByte"), - ("tebibyte", "tebibyte|tebibytes|TiB|TiByte"), - ("pebibyte", "pebibyte|pebibytes|PiB|PiByte")]) - AmbiguousDimensionUnitList = [r'al', r'mi', r'área', r'áreas', r'pie', r'pies', r'"'] - LengthSuffixList = dict([("Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"), - ("Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"), - ("Decámetro", "decametro|decámetro|decametros|decámetros|dam"), - ("Metro", "m|m.|metro|metros"), - ("Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"), - ("Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"), - ("Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"), - ("Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"), - ("Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"), - ("Picómetro", "pm|picometro|picómetro|picometros|picómetros"), - ("Milla", "mi|milla|millas"), - ("Yarda", "yd|yarda|yardas"), - ("Pulgada", "pulgada|pulgadas|\""), - ("Pie", "pie|pies|ft"), - ("Año luz", "año luz|años luz|al")]) - AmbiguousLengthUnitList = [r'mi', r'área', r'áreas', r'"'] - BuildPrefix = f'(?<=(\\s|^|\\P{{L}}))' - BuildSuffix = f'(?=(\\s|\\P{{L}}|$))' + BuildPrefix = '(?<=(\\s|^|\\P{L}))' + BuildSuffix = '(?=(\\s|\\P{L}|$))' ConnectorToken = 'de' - SpeedSuffixList = dict([("Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"), - ("Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"), - ("Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"), - ("Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"), - ("Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"), - ("Nudo", "kt|nudo|nudos|kn"), - ("Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"), - ("Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"), - ("Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"), - ("Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg")]) - AmbiguousSpeedUnitList = [r'nudo', r'nudos'] - TemperatureSuffixList = dict([("Kelvin", "k|K|kelvin"), - ("Rankine", "r|rankine"), - ("Grado Celsius", "°c|° c|ºc|º c|grado c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"), - ("Grado Fahrenheit", "°f|° f|ºf|º f|grado f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit"), - ("Grado Réaumur", "°r|°re|grados r|grado réaumur|grados réaumur|réaumur"), - ("Grado Delisle", "°d|grados d|grado delisle|grados delisle|delisle"), - ("Grado", "°|grados|grado")]) - VolumeSuffixList = dict([("Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"), - ("Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"), - ("Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"), - ("Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"), - ("Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"), - ("Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"), - ("Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"), - ("Pulgada cúbica", "pulgada cúbica|pulgadas cúbicas"), - ("Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"), - ("Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"), - ("Hectolitro", "hectolitro|hectolitros|hl"), - ("Litro", "litro|litros|lts|l"), - ("Mililitro", "mililitro|mililitros|ml"), - ("Galón", "galón|galones"), - ("Pinta", "pinta|pintas"), - ("Barril", "barril|barriles|bbl"), - ("Onza líquida", "onza líquida|onzas líquidas")]) - WeightSuffixList = dict([("Tonelada métrica", "tonelada métrica|toneladas métricas|t.métrica|t métrica|t. métrica|tonelada metrica|toneladas metricas|t.metrica|t metrica|t. metrica"), - ("Tonelada", "ton|tonelada|toneladas|t"), - ("Kilogramo", "kg|kilogramo|kilogramos"), - ("Hectogramo", "hg|hectogramo|hectogramos"), - ("Decagramo", "dag|decagramo|decagramos"), - ("Gramo", "g|gr|gramo|gramos"), - ("Decigramo", "dg|decigramo|decigramos"), - ("Centigramo", "cg|centigramo|centigramos"), - ("Miligramo", "mg|miligramo|miligramos"), - ("Microgramo", "µg|ug|microgramo|microgramos"), - ("Nanogramo", "ng|nanogramo|nanogramos"), - ("Picogramo", "pg|picogramo|picogramos"), - ("Libra", "lb|libra|libras"), - ("Onza", "oz|onza|onzas"), - ("Grano", "grano|granos"), - ("Quilate", "ct|quilate|quilates")]) - AmbiguousWeightUnitList = [r'g', r't'] - AngleSuffixList = dict([("Degree", "grado|grados|°"), - ("Radian", "radián|radian|radianes|rad"), - ("Turn", "vuelta|vueltas")]) - AmbiguousAngleUnitList = [r'vuelta', r'vueltas'] AmbiguityFiltersDict = dict([("null", "null")]) - TemperatureAmbiguityFiltersDict = dict([("\\b(grados?|°)$", "\\b((grados?|°)\\s*(angolo|rotaci[oó]n)|(gira(r|do|torio)?|angolo|rotaci[oó]n)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(grados?\\b|°))")]) - DimensionAmbiguityFiltersDict = dict([("\\b(grados?|°)$", "\\b((grados?|°)\\s*(c(elsius|entígrado)?|f(ah?renheit)?)|(temperatura)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(grados?\\b|°))")]) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number-with-unit/resource-definitions.json b/Python/libraries/recognizers-number-with-unit/resource-definitions.json index 7d54b7a36d..95a7a27388 100644 --- a/Python/libraries/recognizers-number-with-unit/resource-definitions.json +++ b/Python/libraries/recognizers-number-with-unit/resource-definitions.json @@ -129,6 +129,18 @@ "class DutchNumericWithUnit:" ], "footer": [ "# pylint: enable=line-too-long" ] + }, + { + "input": [ "Japanese", "Japanese-NumbersWithUnit" ], + "output": "japanese_numeric_with_unit", + "header": [ + "from .base_numbers import BaseNumbers", + "# pylint: disable=line-too-long", + "", + "", + "class JapaneseNumericWithUnit:" + ], + "footer": [ "# pylint: enable=line-too-long" ] } ] } diff --git a/Python/libraries/recognizers-number-with-unit/setup.py b/Python/libraries/recognizers-number-with-unit/setup.py index 4870dbdba9..f7ff33cee1 100644 --- a/Python/libraries/recognizers-number-with-unit/setup.py +++ b/Python/libraries/recognizers-number-with-unit/setup.py @@ -2,16 +2,17 @@ # Licensed under the MIT License. import os -from setuptools import setup, find_packages + +from setuptools import find_packages, setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -NAME = "recognizers-text-number-with-unit" -VERSION = "1.0.0.a0" -REQUIRES = ['recognizers-text', 'recognizers-text-number', 'regex'] +NAME = "recognizers-text-number-with-unit-genesys" +VERSION = "1.1.43" +REQUIRES = ['recognizers-text-genesys', 'recognizers-text-number-genesys', 'regex'] setup( name=NAME, @@ -19,8 +20,7 @@ def read(fname): url='https://github.com/Microsoft/Recognizers-Text', author='Microsoft', description='recognizers-text-number-with-unit README', - keywords=['nlp', 'nlp-entity-extraction', - 'entity-extraction', 'parser-library'], + keywords=['nlp', 'nlp-entity-extraction', 'entity-extraction', 'parser-library'], long_description=read('README.rst'), license='MIT', packages=find_packages(), @@ -32,5 +32,5 @@ def read(fname): 'Operating System :: OS Independent', 'Development Status :: 3 - Alpha', 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] + ], ) diff --git a/Python/libraries/recognizers-number/recognizers_number/culture.py b/Python/libraries/recognizers-number/recognizers_number/culture.py index 2ab7a448f0..2b6f802967 100644 --- a/Python/libraries/recognizers-number/recognizers_number/culture.py +++ b/Python/libraries/recognizers-number/recognizers_number/culture.py @@ -2,11 +2,14 @@ # Licensed under the MIT License. from recognizers_text.culture import BaseCultureInfo, Culture + from .number import LongFormatMode, LongFormatType + SUPPORTED_CULTURES = { Culture.English: LongFormatMode.DOUBLE_COMMA_DOT, Culture.Chinese: None, + Culture.Catalan: LongFormatMode.DOUBLE_DOT_COMMA, Culture.SpanishMexican: LongFormatMode.DOUBLE_COMMA_DOT, Culture.Spanish: LongFormatMode.DOUBLE_DOT_COMMA, Culture.German: LongFormatMode.DOUBLE_DOT_COMMA, @@ -34,8 +37,7 @@ def format(self, value: object) -> str: result = 'E+'.join(parts) long_format = SUPPORTED_CULTURES.get(self.code) if long_format: - result = ''.join( - map(lambda x: self.change_mark(x, long_format), result)) + result = ''.join(map(lambda x: self.change_mark(x, long_format), result)) return result def change_mark(self, source: str, long_format: LongFormatType) -> str: diff --git a/Python/libraries/recognizers-number/recognizers_number/number/__init__.py b/Python/libraries/recognizers-number/recognizers_number/number/__init__.py index b5a15da061..9315f4bb97 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/__init__.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/__init__.py @@ -13,6 +13,8 @@ from .japanese import * from .italian import * from .portuguese import * +from .catalan import * +from .arabic import * from .number_recognizer import * from .parser_factory import * from .utilities import * diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/german/__init__.py b/Python/libraries/recognizers-number/recognizers_number/number/arabic/__init__.py similarity index 100% rename from Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/german/__init__.py rename to Python/libraries/recognizers-number/recognizers_number/number/arabic/__init__.py diff --git a/Python/libraries/recognizers-number/recognizers_number/number/arabic/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/arabic/extractors.py new file mode 100644 index 0000000000..6c11a3634c --- /dev/null +++ b/Python/libraries/recognizers-number/recognizers_number/number/arabic/extractors.py @@ -0,0 +1,251 @@ +from re import Pattern +from typing import List, Optional + +import regex + +from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseMergedNumberExtractor, BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.arabic_numeric import ArabicNumeric +from recognizers_text.utilities import RegExpUtility + + +class ArabicNumberExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM + + @property + def ambiguity_filters_dict(self) -> List[ReRe]: + # Do not filter the ambiguous number cases like 'that one' in NumberWithUnit, otherwise they can't be resolved. + _ambiguity_filters_dict: List[ReRe] = [] + + if self.mode is not NumberMode.Unit: + for key, value in ArabicNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict + + @property + def ambiguous_fraction_connectors(self) -> Pattern: + return RegExpUtility.get_safe_reg_exp(ArabicNumeric.AmbiguousFractionConnectorsRegex) + + @property + def regexes(self) -> List[ReVal]: + _regexes: List[ReVal] = [] + + cardinal_ex: Optional[ArabicCardinalExtractor] = None + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = ArabicCardinalExtractor(ArabicNumeric.PlaceHolderDefault) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.CurrencyRegex), val='IntegerNum')) + + cardinal_ex = cardinal_ex or ArabicCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + fraction_ex = ArabicFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes + + @property + def relative_reference(self) -> Pattern: + return RegExpUtility.get_safe_reg_exp(ArabicNumeric.RelativeOrdinalRegex) + + @property + def _negative_number_terms(self) -> Pattern: + return RegExpUtility.get_safe_reg_exp(ArabicNumeric.NegativeNumberTermsRegex) + + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self.mode = mode + + +class ArabicCardinalExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_CARDINAL + + @property + def regexes(self) -> List[ReVal]: + return ArabicIntegerExtractor(self.placeholder).regexes + ArabicDoubleExtractor(self.placeholder).regexes + + def __init__(self, placeholder: str = ArabicNumeric.PlaceHolderDefault): + self.placeholder = placeholder + + +class ArabicIntegerExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_INTEGER + + @property + def regexes(self) -> List[ReVal]: + return [ + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.NumbersWithPlaceHolder(self.placeholder)), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.NumbersWithSuffix, regex.S), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.RoundNumberIntegerRegexWithLocks), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.NumbersWithDozenSuffix), val='IntegerNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.AllIntRegexWithLocks), + val=f'Integer{ArabicNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.AllIntRegexWithDozenSuffixLocks), + val=f'Integer{ArabicNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp( + self._generate_format_regex(LongFormatMode.INTEGER_COMMA, self.placeholder) + ), + val='IntegerNum', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp( + self._generate_format_regex(LongFormatMode.INTEGER_DOT, self.placeholder) + ), + val='IntegerNum', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp( + self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder) + ), + val='IntegerNum', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp( + self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder) + ), + val='IntegerNum', + ), + ] + + def __init__(self, placeholder: str = ArabicNumeric.PlaceHolderDefault): + self.placeholder = placeholder + + +class ArabicDoubleExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_DOUBLE + + @property + def regexes(self) -> List[ReVal]: + return [ + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.DoubleDecimalPointRegex(self.placeholder)), + val='DoubleNum', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.DoubleWithoutIntegralRegex(self.placeholder)), + val='DoubleNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.DoubleWithMultiplierRegex), val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.DoubleWithRoundNumber), val='DoubleNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.DoubleAllFloatRegex), + val=f'Double{ArabicNumeric.LangMarker}', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.DoubleExponentialNotationRegex), val='DoubleNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.DoubleCaretExponentialNotationRegex), val='DoubleNum' + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp( + self._generate_format_regex(LongFormatMode.DOUBLE_COMMA_DOT, self.placeholder) + ), + val='DoubleNum', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp( + self._generate_format_regex(LongFormatMode.DOUBLE_NUM_BLANK_DOT, self.placeholder) + ), + val='DoubleNum', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp( + self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_DOT, self.placeholder) + ), + val='DoubleNum', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.DoubleWithThousandMarkRegex(self.placeholder)), + val='DoubleNum', + ), + ] + + def __init__(self, placeholder: str): + self.placeholder = placeholder + + +class ArabicFractionExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_FRACTION + + @property + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionNotationWithSpacesRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionNotationWithSpacesRegex2), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionNotationRegex), val='FracNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionNounRegex), + val=f'Frac{ArabicNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionNounWithArticleRegex), + val=f'Frac{ArabicNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionWithOrdinalPrefix), + val=f'Frac{ArabicNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionWithPartOfPrefix), + val=f'Frac{ArabicNumeric.LangMarker}', + ), + ] + # Not add FractionPrepositionRegex when the mode is Unit to avoid wrong recognize cases like "$1000 over 3" + if self.mode is not NumberMode.Unit: + _regexes.append( + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionPrepositionRegex), + val=f'Frac{ArabicNumeric.LangMarker}', + ) + ) + return _regexes + + def __init__(self, mode): + self.mode = mode + + +class ArabicOrdinalExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_ORDINAL + + @property + def ambiguous_fraction_connectors(self): + return RegExpUtility.get_safe_reg_exp(ArabicNumeric.AmbiguousFractionConnectorsRegex) + + @property + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.OrdinalNumericRegex), val='OrdinalNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.OrdinalEnglishRegex), + val=f'Ordinal{ArabicNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ArabicNumeric.OrdinalRoundNumberRegex), + val=f'Ordinal{ArabicNumeric.LangMarker}', + ), + ] + + @property + def relative_reference(self): + return RegExpUtility.get_safe_reg_exp(ArabicNumeric.RelativeOrdinalRegex) + + +class ArabicMergedNumberExtractor(BaseMergedNumberExtractor): + + @property + def _round_number_integer_regex_with_locks(self) -> Pattern: + return RegExpUtility.get_safe_reg_exp(ArabicNumeric.RoundNumberIntegerRegexWithLocks) + + @property + def _connector_regex(self) -> Pattern: + return RegExpUtility.get_safe_reg_exp(ArabicNumeric.ConnectorRegex) + + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self._number_extractor = ArabicNumberExtractor(mode) diff --git a/Python/libraries/recognizers-number/recognizers_number/number/arabic/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/arabic/parsers.py new file mode 100644 index 0000000000..82b3ca8155 --- /dev/null +++ b/Python/libraries/recognizers-number/recognizers_number/number/arabic/parsers.py @@ -0,0 +1,57 @@ +from re import Pattern +from typing import Dict, List, Optional + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.parsers import BaseNumberParserConfiguration +from recognizers_number.resources.arabic_numeric import ArabicNumeric +from recognizers_text.culture import Culture +from recognizers_text.utilities import RegExpUtility + + +class ArabicNumberParserConfiguration(BaseNumberParserConfiguration): + + lang_marker: str = ArabicNumeric.LangMarker + is_compound_number_language: bool = ArabicNumeric.CompoundNumberLanguage + is_multi_decimal_separator_culture: bool = ArabicNumeric.MultiDecimalSeparatorCulture + + decimal_separator_char: str = ArabicNumeric.DecimalSeparatorChar + fraction_marker_token: str = ArabicNumeric.FractionMarkerToken + non_decimal_separator_char: str = ArabicNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = ArabicNumeric.HalfADozenText + word_separator_token: str = ArabicNumeric.WordSeparatorToken + non_standard_separator_variants: List[str] = [] + non_decimal_separator_text: str = '' + + written_decimal_separator_texts: List[str] = ArabicNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = ArabicNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = ArabicNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = ArabicNumeric.WrittenFractionSeparatorTexts + + cardinal_number_map: Dict[str, int] = ArabicNumeric.CardinalNumberMap + ordinal_number_map: Dict[str, int] = ArabicNumeric.OrdinalNumberMap + relative_reference_offset_map: Dict[str, str] = ArabicNumeric.RelativeReferenceOffsetMap + relative_reference_relative_to_map: Dict[str, str] = ArabicNumeric.RelativeReferenceRelativeToMap + round_number_map: Dict[str, int] = ArabicNumeric.RoundNumberMap + + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicNumeric.DigitalNumberRegex) + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicNumeric.NegativeNumberSignRegex) + fraction_preposition_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicNumeric.FractionPrepositionRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(ArabicNumeric.RoundMultiplierRegex) + + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.Arabic) + super().__init__(culture_info) + + def get_lang_specific_int_value(self, match_strs: List[str]) -> (bool, int): + result = (False, 0) + + # @TODO "و" should be moved to Arabic YAML file. + + # Workaround to solve "و" which means "and" before rounded number in Arabic. + # ألف و مائة = one thousand and one hundred # + # But in Arabic there is no integer before hundred, because it's 100 by default. + if len(match_strs) == 1 and match_strs[0] == "و": + result = (True, 1) + + return result diff --git a/Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/italian/__init__.py b/Python/libraries/recognizers-number/recognizers_number/number/catalan/__init__.py similarity index 100% rename from Python/libraries/recognizers-number-with-unit/recognizers_number_with_unit/number_with_unit/italian/__init__.py rename to Python/libraries/recognizers-number/recognizers_number/number/catalan/__init__.py diff --git a/Python/libraries/recognizers-number/recognizers_number/number/catalan/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/catalan/extractors.py new file mode 100644 index 0000000000..0ad2baea17 --- /dev/null +++ b/Python/libraries/recognizers-number/recognizers_number/number/catalan/extractors.py @@ -0,0 +1,142 @@ +from typing import List + +from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.catalan_numeric import CatalanNumeric +from recognizers_text.utilities import RegExpUtility + + +class CatalanNumberExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM + + @property + def regexes(self) -> List[ReVal]: + _regexes: List[ReVal] = [] + cardinal_ex: CatalanCardinalExtractor = None + + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = CatalanCardinalExtractor(CatalanNumeric.PlaceHolderPureNumber) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=CatalanNumeric.CurrencyRegex, val='IntegerNum')) + + cardinal_ex = cardinal_ex or CatalanCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + + fraction_ex = CatalanFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes + + @property + def ambiguity_filters_dict(self) -> List[ReRe]: + _ambiguity_filters_dict: List[ReRe] = [] + + if self.mode != NumberMode.Unit: + for key, value in CatalanNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict + + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self.mode = mode + + +class CatalanCardinalExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_CARDINAL + + @property + def regexes(self) -> List[ReVal]: + return CatalanIntegerExtractor(self.placeholder).regexes + CatalanDoubleExtractor(self.placeholder).regexes + + def __init__(self, placeholder: str = CatalanNumeric.PlaceHolderDefault): + self.placeholder = placeholder + + +class CatalanIntegerExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_INTEGER + + @property + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=CatalanNumeric.NumbersWithPlaceHolder(self.placeholder), val='IntegerNum'), + ReVal(re=CatalanNumeric.NumbersWithSuffix, val='IntegerNum'), + ReVal(re=self._generate_format_regex(LongFormatMode.INTEGER_DOT, self.placeholder), val='IntegerNum'), + ReVal(re=self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder), val='IntegerNum'), + ReVal( + re=self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder), + val='IntegerNum', + ), + ReVal(re=CatalanNumeric.RoundNumberIntegerRegexWithLocks, val='IntegerNum'), + ReVal(re=CatalanNumeric.NumbersWithDozenSuffix, val='IntegerNum'), + ReVal(re=CatalanNumeric.AllIntRegexWithLocks, val='IntegerCat'), + ] + + def __init__(self, placeholder: str = CatalanNumeric.PlaceHolderDefault): + self.placeholder = placeholder + + +class CatalanDoubleExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_DOUBLE + + @property + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=CatalanNumeric.DoubleDecimalPointRegex(self.placeholder), val='DoubleNum'), + ReVal(re=CatalanNumeric.DoubleWithoutIntegralRegex(self.placeholder), val='DoubleNum'), + ReVal(re=CatalanNumeric.DoubleWithMultiplierRegex, val='DoubleNum'), + ReVal(re=CatalanNumeric.DoubleWithRoundNumber, val='DoubleNum'), + ReVal(re=CatalanNumeric.DoubleAllFloatRegex, val='DoubleCat'), + ReVal(re=CatalanNumeric.DoubleExponentialNotationRegex, val='DoublePow'), + ReVal(re=CatalanNumeric.DoubleCaretExponentialNotationRegex, val='DoublePow'), + ReVal(re=self._generate_format_regex(LongFormatMode.DOUBLE_DOT_COMMA, self.placeholder), val='DoubleNum'), + ReVal( + re=self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, self.placeholder), + val='DoubleNum', + ), + ] + + def __init__(self, placeholder: str = CatalanNumeric.PlaceHolderDefault): + self.placeholder = placeholder + + +class CatalanFractionExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_FRACTION + + @property + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(CatalanNumeric.FractionNotationWithSpacesRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(CatalanNumeric.FractionNotationRegex), val='FracNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(CatalanNumeric.FractionNounRegex), + val=f'Frac{CatalanNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(CatalanNumeric.FractionNounWithArticleRegex), + val=f'Frac{CatalanNumeric.LangMarker}', + ), + ] + + if self.mode != NumberMode.Unit: + _regexes.append( + ReVal( + re=RegExpUtility.get_safe_reg_exp(CatalanNumeric.FractionPrepositionRegex), + val=f'Frac{CatalanNumeric.LangMarker}', + ) + ) + return _regexes + + def __init__(self, mode): + self.mode = mode + + +class CatalanOrdinalExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_ORDINAL + + @property + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=CatalanNumeric.OrdinalSuffixRegex, val='OrdinalNum'), + ReVal(re=CatalanNumeric.SuffixRoundNumberOrdinalRegex, val='OrdCat'), + ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/catalan/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/catalan/parsers.py new file mode 100644 index 0000000000..3e97a6f755 --- /dev/null +++ b/Python/libraries/recognizers-number/recognizers_number/number/catalan/parsers.py @@ -0,0 +1,59 @@ +from typing import Dict, List, Optional, Pattern + +from recognizers_number.culture import CultureInfo +from recognizers_number.number.parsers import BaseNumberParserConfiguration +from recognizers_number.resources.catalan_numeric import CatalanNumeric +from recognizers_text.culture import Culture +from recognizers_text.parser import ParseResult +from recognizers_text.utilities import RegExpUtility + + +class CatalanNumberParserConfiguration(BaseNumberParserConfiguration): + + lang_marker: str = CatalanNumeric.LangMarker + is_multi_decimal_separator_culture: bool = CatalanNumeric.MultiDecimalSeparatorCulture + + decimal_separator_char: str = CatalanNumeric.DecimalSeparatorChar + fraction_marker_token: str = CatalanNumeric.FractionMarkerToken + non_decimal_separator_char: str = CatalanNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = CatalanNumeric.HalfADozenText + word_separator_token: str = CatalanNumeric.WordSeparatorToken + + written_decimal_separator_texts: List[str] = CatalanNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = CatalanNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = CatalanNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = CatalanNumeric.WrittenFractionSeparatorTexts + non_standard_separator_variants: List[str] = CatalanNumeric.NonStandardSeparatorVariants + + ordinal_number_map: Dict[str, int] = CatalanNumeric.OrdinalNumberMap + cardinal_number_map: Dict[str, int] = CatalanNumeric.CardinalNumberMap + round_number_map: Dict[str, int] = CatalanNumeric.RoundNumberMap + + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(CatalanNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(CatalanNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(CatalanNumeric.DigitalNumberRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(CatalanNumeric.RoundMultiplierRegex) + + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.Catalan) + super().__init__(culture_info) + + def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: + frac_words: List[str] = super().normalize_token_set(tokens, context) + + # The following piece of code is needed to compute the fraction pattern number+'i mig' and 'un quart de' + # e.g. 'dos i mig' ('two and a half') where the numerator is omitted in Catalan and 'un quart de milió' + # It works by inserting the numerator 'un' ('a') in the catalan numbers regex + # so that the pattern is correctly processed. + if len(frac_words) >= 2: + if ( + frac_words[-1] in CatalanNumeric.FractionalTokens + and frac_words[-2] == CatalanNumeric.WordSeparatorToken + ): + frac_words.insert(-1, CatalanNumeric.FractionWithoutNumeratorToken) + elif ( + frac_words[-1] in CatalanNumeric.WrittenFractionSeparatorTexts + and frac_words[-2] in CatalanNumeric.FractionalTokens + ): + frac_words.pop(-1) + return frac_words diff --git a/Python/libraries/recognizers-number/recognizers_number/number/chinese/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/chinese/extractors.py index b9a89eb686..b9d38d6b9f 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/chinese/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/chinese/extractors.py @@ -1,14 +1,14 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List from enum import Enum +from typing import List -from recognizers_number.number.extractors import ReVal, ReRe, BaseNumberExtractor -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.constants import Constants -from recognizers_number.resources.chinese_numeric import ChineseNumeric +from recognizers_number.number.extractors import BaseNumberExtractor, ReRe, ReVal from recognizers_number.number.models import NumberMode +from recognizers_number.resources.chinese_numeric import ChineseNumeric +from recognizers_text.utilities import RegExpUtility class ChineseNumberExtractorMode(Enum): @@ -17,299 +17,129 @@ class ChineseNumberExtractorMode(Enum): class ChineseNumberExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM @property - def _extract_type(self) -> str: - return Constants.SYS_NUM + def regexes(self) -> List[ReVal]: + return ChineseCardinalExtractor(self.mode).regexes + ChineseFractionExtractor().regexes @property - def ambiguity_filters_dict(self) -> List[ReRe]: - return self.__ambiguity_filters_dict + def ambiguity_filters_dict(self): + _ambiguity_filters_dict: List[ReRe] = [] + if self.mode != NumberMode.Unit: + for key, value in ChineseNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict def __init__(self, mode: ChineseNumberExtractorMode = ChineseNumberExtractorMode.DEFAULT): - self.__regexes: List[ReVal] = list() - - cardinal_ex = ChineseCardinalExtractor(mode) - self.__regexes.extend(cardinal_ex.regexes) - - fraction_ex = ChineseFractionExtractor() - self.__regexes.extend(fraction_ex.regexes) - - ambiguity_filters_dict: List[ReRe] = list() - - if mode != NumberMode.Unit: - for key, value in ChineseNumeric.AmbiguityFiltersDict.items(): - ambiguity_filters_dict.append(ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), - reVal=RegExpUtility.get_safe_reg_exp(value))) - self.__ambiguity_filters_dict = ambiguity_filters_dict + self.mode = mode class ChineseCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return ChineseIntegerExtractor(self.mode).regexes + ChineseDoubleExtractor().regexes def __init__(self, mode: ChineseNumberExtractorMode = ChineseNumberExtractorMode.DEFAULT): - self.__regexes: List[ReVal] = list() - - integer_ex = ChineseIntegerExtractor(mode) - self.__regexes.extend(integer_ex.regexes) - - double_ex = ChineseDoubleExtractor() - self.__regexes.extend(double_ex.regexes) + self.mode = mode class ChineseIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER - - def __init__(self, mode: ChineseNumberExtractorMode = ChineseNumberExtractorMode.DEFAULT): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersSpecialsChars), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersSpecialsCharsWithSuffix), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DottedNumbersSpecialsChar), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersWithHalfDozen), - val=f'Integer{ChineseNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersWithDozen), - val=f'Integer{ChineseNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.HalfUnitRegex), - val=f'Integer{ChineseNumeric.LangMarker}') + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.NumbersSpecialsChars), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.NumbersSpecialsCharsWithSuffix), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.DottedNumbersSpecialsChar), val='IntegerNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.NumbersWithHalfDozen), + val=f'Integer{ChineseNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.NumbersWithDozen), + val=f'Integer{ChineseNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.HalfUnitRegex), + val=f'Integer{ChineseNumeric.LangMarker}', + ), ] - if mode == ChineseNumberExtractorMode.DEFAULT: - self.__regexes.append( + if self.mode == ChineseNumberExtractorMode.DEFAULT: + _regexes.append( ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersWithAllowListRegex), - val=f'Integer{ChineseNumeric.LangMarker}' + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.NumbersWithAllowListRegex), + val=f'Integer{ChineseNumeric.LangMarker}', ) ) - elif mode == ChineseNumberExtractorMode.EXTRACT_ALL: - self.__regexes.append( + elif self.mode == ChineseNumberExtractorMode.EXTRACT_ALL: + _regexes.append( ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersAggressiveRegex), - val=f'Integer{ChineseNumeric.LangMarker}' + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.NumbersAggressiveRegex), + val=f'Integer{ChineseNumeric.LangMarker}', ) ) + return _regexes + + def __init__(self, mode: ChineseNumberExtractorMode = ChineseNumberExtractorMode.DEFAULT): + self.mode = mode class ChineseDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE - - def __init__(self): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DoubleSpecialsChars), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DoubleSpecialsCharsWithNegatives), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SimpleDoubleSpecialsChars), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DoubleWithMultiplierRegex), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DoubleWithThousandsRegex), - val=f'Double{ChineseNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DoubleAllFloatRegex), - val=f'Double{ChineseNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DoubleExponentialNotationRegex), - val='DoublePow'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DoubleScientificNotationRegex), - val='DoublePow') + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.DoubleSpecialsChars), val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.DoubleSpecialsCharsWithNegatives), val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.SimpleDoubleSpecialsChars), val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.DoubleWithMultiplierRegex), val='DoubleNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.DoubleWithThousandsRegex), + val=f'Double{ChineseNumeric.LangMarker}', + ), + ReVal( + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.DoubleAllFloatRegex), + val=f'Double{ChineseNumeric.LangMarker}', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.DoubleExponentialNotationRegex), val='DoublePow'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.DoubleScientificNotationRegex), val='DoublePow'), ] class ChineseFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.FractionNotationSpecialsCharsRegex), - val='FracNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.FractionNotationRegex), - val='FracNum'), + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.FractionNotationSpecialsCharsRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.FractionNotationRegex), val='FracNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.AllFractionNumber), - val=f'Frac{ChineseNumeric.LangMarker}') + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.AllFractionNumber), + val=f'Frac{ChineseNumeric.LangMarker}', + ), ] class ChineseOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL - @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.OrdinalRegex), - val=f'Ordinal{ChineseNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.OrdinalNumbersRegex), - val=f'Ordinal{ChineseNumeric.LangMarker}') - ] - - -class ChinesePercentageExtractor(BaseNumberExtractor): @property def regexes(self) -> List[ReVal]: - return self.__regexes - - @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_PERCENTAGE - - def __init__(self): - self.__regexes = [ + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.PercentagePointRegex), - val=f'Per{ChineseNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SimplePercentageRegex), - val=f'Per{ChineseNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersPercentagePointRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersPercentageWithSeparatorRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersPercentageWithMultiplierRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.FractionPercentagePointRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.FractionPercentageWithSeparatorRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.FractionPercentageWithMultiplierRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SimpleNumbersPercentageRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SimpleNumbersPercentageWithMultiplierRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SimpleNumbersPercentagePointRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.IntegerPercentageRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.IntegerPercentageWithMultiplierRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersFractionPercentageRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SimpleIntegerPercentageRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersFoldsPercentageRegex), - val='PerSpe'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.FoldsPercentageRegex), - val='PerSpe'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SimpleFoldsPercentageRegex), - val='PerSpe'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SpecialsPercentageRegex), - val='PerSpe'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NumbersSpecialsPercentageRegex), - val='PerSpe'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SimpleSpecialsPercentageRegex), - val='PerSpe'), + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.OrdinalRegex), + val=f'Ordinal{ChineseNumeric.LangMarker}', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SpecialsFoldsPercentageRegex), - val='PerSpe') + re=RegExpUtility.get_safe_reg_exp(ChineseNumeric.OrdinalNumbersRegex), + val=f'Ordinal{ChineseNumeric.LangMarker}', + ), ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/chinese/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/chinese/parsers.py index 297c51ddf9..4f42751d8f 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/chinese/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/chinese/parsers.py @@ -1,222 +1,64 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Pattern, Optional -from collections import namedtuple -from decimal import Decimal, getcontext -import copy -import regex +from typing import Dict, List, Optional, Pattern -from recognizers_text.utilities import RegExpUtility +from recognizers_number.culture import CultureInfo +from recognizers_number.number.parsers import BaseNumberParserConfiguration +from recognizers_number.resources.chinese_numeric import ChineseNumeric from recognizers_text.culture import Culture -from recognizers_text.extractor import ExtractResult from recognizers_text.parser import ParseResult -from recognizers_number.resources.chinese_numeric import ChineseNumeric -from recognizers_number.number.cjk_parsers import CJKNumberParser -from recognizers_number.number.parsers import BaseNumberParser, NumberParserConfiguration -from recognizers_number.culture import CultureInfo - - -class ChineseNumberParserConfiguration(NumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return dict() - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return dict() - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self) -> CultureInfo: - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return None - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def zero_char(self) -> str: - return self._zero_char - - @property - def pair_char(self) -> str: - return self._pair_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def written_decimal_separator_texts(self) -> List[str]: - return list() - - @property - def written_group_separator_texts(self) -> List[str]: - return list() - - @property - def written_integer_separator_texts(self) -> List[str]: - return list() - - @property - def written_fraction_separator_texts(self) -> List[str]: - return list() - - @property - def zero_to_nine_map(self) -> Dict[str, int]: - return self._zero_to_nine_map - - @property - def round_number_map_char(self) -> Dict[str, int]: - return self._round_number_map_char - - @property - def full_to_half_map(self) -> Dict[str, int]: - return self._full_to_half_map - - @property - def trato_sim_map(self) -> Dict[str, int]: - return self._trato_sim_map - - @property - def unit_map(self) -> Dict[str, int]: - return self._unit_map - - @property - def round_direct_list(self) -> List[str]: - return self._round_direct_list - - @property - def ten_chars(self) -> List[str]: - return self._ten_chars - - @property - def digit_num_regex(self) -> Pattern: - return self._digit_num_regex - - @property - def dozen_regex(self) -> Pattern: - return self._dozen_regex - - @property - def percentage_regex(self) -> Pattern: - return self._percentage_regex - - @property - def percentage_num_regex(self) -> Pattern: - return self._percentage_num_regex - - @property - def double_and_round_regex(self) -> Pattern: - return self._double_and_round_regex - - @property - def frac_split_regex(self) -> Pattern: - return self._frac_split_regex - - @property - def point_regex(self) -> Pattern: - return self._point_regex - - @property - def spe_get_number_regex(self) -> Pattern: - return self._spe_get_number_regex - - @property - def pair_regex(self) -> Pattern: - return self._pair_regex - - @property - def round_number_integer_regex(self) -> Pattern: - return self._round_number_integer_regex - - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants - - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture - - @property - def round_multiplier_regex(self) -> None: - return None - - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.Chinese) - - self._culture_info = culture_info - self._lang_marker = ChineseNumeric.LangMarker - self._decimal_separator_char = ChineseNumeric.DecimalSeparatorChar - self._fraction_marker_token = ChineseNumeric.FractionMarkerToken - self._non_decimal_separator_char = ChineseNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = ChineseNumeric.HalfADozenText - self._word_separator_token = ChineseNumeric.WordSeparatorToken - self._zero_char = ChineseNumeric.ZeroChar - self._pair_char = ChineseNumeric.PairChar - self._non_standard_separator_variants = [] - self._is_multi_decimal_separator_culture = ChineseNumeric.MultiDecimalSeparatorCulture - - self._round_number_map = ChineseNumeric.RoundNumberMap - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DigitalNumberRegex) +from recognizers_text.utilities import RegExpUtility - self._zero_to_nine_map = ChineseNumeric.ZeroToNineMap - self._round_number_map_char = ChineseNumeric.RoundNumberMapChar - self._full_to_half_map = ChineseNumeric.FullToHalfMap - self._trato_sim_map = ChineseNumeric.TratoSimMap - self._unit_map = ChineseNumeric.UnitMap - self._round_direct_list = ChineseNumeric.RoundDirectList - self._ten_chars = ChineseNumeric.TenChars - self._digit_num_regex = ChineseNumeric.DigitNumRegex - self._dozen_regex = ChineseNumeric.DozenRegex - self._percentage_regex = ChineseNumeric.PercentageRegex - self._percentage_num_regex = ChineseNumeric.PercentageNumRegex - self._double_and_round_regex = RegExpUtility.get_safe_reg_exp( - ChineseNumeric.DoubleAndRoundRegex) - self._frac_split_regex = RegExpUtility.get_safe_reg_exp( - ChineseNumeric.FracSplitRegex) - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - ChineseNumeric.NegativeNumberSignRegex) - self._point_regex = ChineseNumeric.PointRegex - self._spe_get_number_regex = RegExpUtility.get_safe_reg_exp( - ChineseNumeric.SpeGetNumberRegex) - self._pair_regex = RegExpUtility.get_safe_reg_exp( - ChineseNumeric.PairRegex) +class ChineseNumberParserConfiguration(BaseNumberParserConfiguration): + + lang_marker: str = ChineseNumeric.LangMarker + is_multi_decimal_separator_culture: bool = ChineseNumeric.MultiDecimalSeparatorCulture + + decimal_separator_char: str = ChineseNumeric.DecimalSeparatorChar + fraction_marker_token: str = ChineseNumeric.FractionMarkerToken + non_decimal_separator_char: str = ChineseNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = ChineseNumeric.HalfADozenText + word_separator_token: str = ChineseNumeric.WordSeparatorToken + zero_char: str = ChineseNumeric.ZeroChar + pair_char: str = ChineseNumeric.PairChar + + written_decimal_separator_texts: List[str] = [] + written_group_separator_texts: List[str] = [] + written_integer_separator_texts: List[str] = [] + written_fraction_separator_texts: List[str] = [] + non_standard_separator_variants: List[str] = [] + + cardinal_number_map: Dict[str, int] = {} + ordinal_number_map: Dict[str, int] = {} + round_number_map: Dict[str, int] = ChineseNumeric.RoundNumberMap + zero_to_nine_map: Dict[str, int] = ChineseNumeric.ZeroToNineMap + round_number_map_char: Dict[str, int] = ChineseNumeric.RoundNumberMapChar + full_to_half_map: Dict[str, str] = ChineseNumeric.FullToHalfMap + unit_map: Dict[str, str] = ChineseNumeric.UnitMap + trato_sim_map: Dict[str, str] = ChineseNumeric.TratoSimMap + + round_direct_list: List[str] = ChineseNumeric.RoundDirectList + ten_chars: List[str] = ChineseNumeric.TenChars + + negative_number_sign_regex = RegExpUtility.get_safe_reg_exp(ChineseNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Optional[Pattern] = None + digital_number_regex = RegExpUtility.get_safe_reg_exp(ChineseNumeric.DigitalNumberRegex) + round_multiplier_regex: Optional[Pattern] = None + double_and_round_regex: Pattern = RegExpUtility.get_safe_reg_exp(ChineseNumeric.DoubleAndRoundRegex) + frac_split_regex: Pattern = RegExpUtility.get_safe_reg_exp(ChineseNumeric.FracSplitRegex) + spe_get_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(ChineseNumeric.SpeGetNumberRegex) + pair_regex: Pattern = RegExpUtility.get_safe_reg_exp(ChineseNumeric.PairRegex) + digit_num_regex: str = ChineseNumeric.DigitNumRegex + dozen_regex: str = ChineseNumeric.DozenRegex + percentage_regex: str = ChineseNumeric.PercentageRegex + percentage_num_regex: str = ChineseNumeric.PercentageNumRegex + point_regex: str = ChineseNumeric.PointRegex + + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.Chinese) + super().__init__(culture_info) def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: return tokens diff --git a/Python/libraries/recognizers-number/recognizers_number/number/cjk_parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/cjk_parsers.py index 4241cd4a53..d517deeb9d 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/cjk_parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/cjk_parsers.py @@ -1,24 +1,24 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +import copy from abc import abstractmethod -from typing import List, Dict, Pattern, Optional from collections import namedtuple from decimal import Decimal, getcontext -import copy +from typing import Dict, List, Optional, Pattern + import regex -from recognizers_text.utilities import RegExpUtility +from recognizers_number.number.parsers import BaseNumberParser, BaseNumberParserConfiguration from recognizers_text.culture import Culture from recognizers_text.extractor import ExtractResult from recognizers_text.parser import ParseResult -from recognizers_number.number.parsers import BaseNumberParser, NumberParserConfiguration -from recognizers_number.culture import CultureInfo + getcontext().prec = 15 -class CJKNumberParserConfiguration(NumberParserConfiguration): +class CJKNumberParserConfiguration(BaseNumberParserConfiguration): @property @abstractmethod def zero_to_nine_map(self) -> Dict[str, int]: @@ -132,15 +132,13 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: if 'Per' in extra: result = self.per_parse(simplified_source) elif 'Num' in extra: - simplified_source.text = self.replace_full_with_half( - simplified_source.text) + simplified_source.text = self.replace_full_with_half(simplified_source.text) result = self._digit_number_parse(simplified_source) if regex.search(self.config.negative_number_sign_regex, simplified_source.text) and result.value > 0: result.value = result.value * -1 result.resolution_str = self.__format(result.value) elif 'Pow' in extra: - simplified_source.text = self.replace_full_with_half( - simplified_source.text) + simplified_source.text = self.replace_full_with_half(simplified_source.text) result = self._power_number_parse(simplified_source) result.resolution_str = self.__format(result.value) elif 'Frac' in extra: @@ -172,7 +170,7 @@ def replace_full_with_half(self, source: str) -> str: def replace_unit(self, source: str) -> str: if source is None or not source.strip(): return source - for (k, v) in self.config.unit_map.items(): + for k, v in self.config.unit_map.items(): source = source.replace(k, v) return source @@ -190,8 +188,7 @@ def per_parse(self, source: ExtractResult) -> ParseResult: elif source_text == '10成' or source_text == '10割' or source_text == '十割': result.value = 100 else: - matches = list(regex.finditer( - self.config.spe_get_number_regex, source_text)) + matches = list(regex.finditer(self.config.spe_get_number_regex, source_text)) int_number: int if len(matches) == 2: int_number_char = matches[0].group()[0] @@ -221,8 +218,7 @@ def per_parse(self, source: ExtractResult) -> ParseResult: int_number = self.config.zero_to_nine_map[int_number_char] - result.value = ( - int_number + point_number + dot_number) * 10 + result.value = (int_number + point_number + dot_number) * 10 else: int_number_char = matches[0].group()[0] if int_number_char == self.config.pair_char: @@ -234,8 +230,7 @@ def per_parse(self, source: ExtractResult) -> ParseResult: result.value = int_number * 10 elif 'Num' in source.data: - double_match = regex.search( - self.config.percentage_regex, source_text) + double_match = regex.search(self.config.percentage_regex, source_text) double_text = double_match.group() if any(x for x in ['k', 'K', 'k', 'K'] if x in double_text): @@ -249,8 +244,7 @@ def per_parse(self, source: ExtractResult) -> ParseResult: result.value = self.get_digit_value(double_text, power) else: - double_match = regex.search( - self.config.percentage_regex, source_text) + double_match = regex.search(self.config.percentage_regex, source_text) double_text = self.replace_unit(double_match.group()) split_result = regex.split(self.config.point_regex, double_text) @@ -270,7 +264,7 @@ def per_parse(self, source: ExtractResult) -> ParseResult: split_result = regex.search(self.config.percentage_num_regex, source_text).group() split_result = regex.split(self.config.frac_split_regex, split_result) demo_value = self.get_value_from_part(split_result[0]) - result.value /= (demo_value / 100) + result.value /= demo_value / 100 result.resolution_str = self.__format(result.value) + '%' return result @@ -286,17 +280,9 @@ def frac_parse(self, source: ExtractResult) -> ParseResult: result_part: parts if len(split_result) == 3: - result_part = parts( - intval=split_result[0], - demo=split_result[1], - num=split_result[2] - ) + result_part = parts(intval=split_result[0], demo=split_result[1], num=split_result[2]) else: - result_part = parts( - intval=self.config.zero_char, - demo=split_result[0], - num=split_result[1] - ) + result_part = parts(intval=self.config.zero_char, demo=split_result[0], num=split_result[1]) int_value = Decimal(self.get_value_from_part(result_part.intval)) num_value = Decimal(self.get_value_from_part(result_part.num)) @@ -331,11 +317,9 @@ def dou_parse(self, source: ExtractResult) -> ParseResult: if split_result[0] == '': split_result[0] = self.config.zero_char if regex.search(self.config.negative_number_sign_regex, split_result[0]) is not None: - result.value = self.get_int_value( - split_result[0]) - self.get_point_value(split_result[1]) + result.value = self.get_int_value(split_result[0]) - self.get_point_value(split_result[1]) else: - result.value = self.get_int_value( - split_result[0]) + self.get_point_value(split_result[1]) + result.value = self.get_int_value(split_result[0]) + self.get_point_value(split_result[1]) result.resolution_str = self.__format(result.value) return result @@ -348,12 +332,12 @@ def int_parse(self, source: ExtractResult) -> ParseResult: def ord_parse(self, source: ExtractResult) -> ParseResult: result = ParseResult(source) - source_text = source.text[1:] + # source_text = source.text[1:] - if regex.search(self.config.digit_num_regex, source_text) is not None: - result.value = self.get_digit_value(source_text, 1) + if regex.search(self.config.digit_num_regex, source.text) is not None: + result.value = self.get_digit_value(source.text, 1) else: - result.value = self.get_int_value(source_text) + result.value = self.get_int_value(source.text) result.resolution_str = self.__format(result.value) return result @@ -367,7 +351,7 @@ def get_digit_value(self, source: str, power: float) -> float: result_str = self.replace_full_with_half(result_str) result = float(super()._get_digital_value(result_str, power)) if negative: - result = - result + result = -result return result def get_int_value(self, source: str) -> float: @@ -418,15 +402,17 @@ def get_int_value(self, source: str) -> float: is_round_before = True part_value += before_value * round_recent round_before = round_recent - if i == len(result_str)-1 or c in self.config.round_direct_list: + if i == len(result_str) - 1 or c in self.config.round_direct_list: int_value += part_value part_value = 0 round_default = round_recent / 10 elif c in self.config.zero_to_nine_map: - if i != len(result_str)-1: - is_not_round_next = result_str[i + 1] in self.config.ten_chars or result_str[ - i + 1] not in self.config.round_number_map_char + if i != len(result_str) - 1: + is_not_round_next = ( + result_str[i + 1] in self.config.ten_chars + or result_str[i + 1] not in self.config.round_number_map_char + ) if c == self.config.zero_char and is_not_round_next: before_value = 1 round_default = 1 @@ -453,7 +439,7 @@ def get_int_value(self, source: str) -> float: part_value = 0 has_previous_digits = c.isdigit() if negative: - int_value = - int_value + int_value = -int_value if dozen: int_value = int_value * 12 if pair: @@ -470,6 +456,8 @@ def get_point_value(self, source: str) -> float: return result def is_digit(self, source: str) -> bool: - return (source is not None - and len(source.strip()) > 0 - and regex.search(self.config.digit_num_regex, source) is not None) + return ( + source is not None + and len(source.strip()) > 0 + and regex.search(self.config.digit_num_regex, source) is not None + ) diff --git a/Python/libraries/recognizers-number/recognizers_number/number/constants.py b/Python/libraries/recognizers-number/recognizers_number/number/constants.py index accfe34ce2..873ab04b09 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/constants.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/constants.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class Constants: SYS_NUM_CARDINAL: str = 'builtin.num.cardinal' SYS_NUM_DOUBLE: str = 'builtin.num.double' @@ -8,7 +9,6 @@ class Constants: SYS_NUM_INTEGER: str = 'builtin.num.integer' SYS_NUM: str = 'builtin.num' SYS_NUM_ORDINAL: str = 'builtin.num.ordinal' - SYS_NUM_PERCENTAGE: str = 'builtin.num.percentage' # NARROW NO-BREAK SPACE NO_BREAK_SPACE: chr = '\u202f' diff --git a/Python/libraries/recognizers-number/recognizers_number/number/dutch/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/dutch/extractors.py index 6e680aec63..b60f016f00 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/dutch/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/dutch/extractors.py @@ -1,255 +1,188 @@ -from recognizers_number.resources.dutch_numeric import DutchNumeric -from typing import Pattern, List, NamedTuple +from typing import List, Optional, Pattern + import regex -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.models import NumberMode, LongFormatMode -from recognizers_number.number.extractors import ReVal, ReRe, BaseNumberExtractor, BasePercentageExtractor, \ - BaseMergedNumberExtractor + from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseMergedNumberExtractor, BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.dutch_numeric import DutchNumeric +from recognizers_text.utilities import RegExpUtility class DutchNumberExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM + @property def regexes(self) -> List[ReVal]: - return self.__regexes + _regexes: List[ReVal] = list() + cardinal_ex: Optional[DutchCardinalExtractor] = None + + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = DutchCardinalExtractor(DutchNumeric.PlaceHolderPureNumber) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.CurrencyRegex), val='IntegerNum')) + + cardinal_ex = cardinal_ex or DutchCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + + fraction_ex = DutchFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes @property def ambiguity_filters_dict(self) -> List[ReRe]: - return self.__ambiguity_filters_dict + _ambiguity_filters_dict: List[ReRe] = [] - @property - def _extract_type(self) -> str: - return Constants.SYS_NUM + if self.mode != NumberMode.Unit: + for key, value in DutchNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict @property def _negative_number_terms(self) -> Pattern: - return self.__negative_number_terms + return RegExpUtility.get_safe_reg_exp(DutchNumeric.NegativeNumberTermsRegex) def __init__(self, mode: NumberMode = NumberMode.DEFAULT): - self.__negative_number_terms = RegExpUtility.get_safe_reg_exp( - DutchNumeric.NegativeNumberTermsRegex) - self.__regexes: List[ReVal] = list() - cardinal_ex: DutchCardinalExtractor = None - - if mode is NumberMode.PURE_NUMBER: - cardinal_ex = DutchCardinalExtractor( - DutchNumeric.PlaceHolderPureNumber) - elif mode is NumberMode.CURRENCY: - self.__regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.CurrencyRegex), val='IntegerNum')) - - if cardinal_ex is None: - cardinal_ex = DutchCardinalExtractor() - - self.__regexes.extend(cardinal_ex.regexes) - - fraction_ex = DutchFractionExtractor(mode) - self.__regexes.extend(fraction_ex.regexes) - - ambiguity_filters_dict: List[ReRe] = list() - - if mode != NumberMode.Unit: - for key, value in DutchNumeric.AmbiguityFiltersDict.items(): - ambiguity_filters_dict.append(ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), - reVal=RegExpUtility.get_safe_reg_exp(value))) - self.__ambiguity_filters_dict = ambiguity_filters_dict + self.mode = mode class DutchCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return DutchIntegerExtractor(self.placeholder).regexes + DutchDoubleExtractor(self.placeholder).regexes def __init__(self, placeholder: str = DutchNumeric.PlaceHolderDefault): - self.__regexes: List[ReVal] = list() - - # Add integer regexes - integer_ex = DutchIntegerExtractor(placeholder) - self.__regexes.extend(integer_ex.regexes) - - # Add double regexes - double_ex = DutchDoubleExtractor(placeholder) - self.__regexes.extend(double_ex.regexes) + self.placeholder = placeholder class DutchIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER - - def __init__(self, placeholder: str = DutchNumeric.PlaceHolderDefault): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.NumbersWithPlaceHolder(placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.NumbersWithSuffix, regex.S), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_COMMA, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_BLANK, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_NO_BREAK_SPACE, placeholder)), - val='IntegerNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.RoundNumberIntegerRegexWithLocks), - val='IntegerNum'), + re=RegExpUtility.get_safe_reg_exp(DutchNumeric.NumbersWithPlaceHolder(self.placeholder)), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.NumbersWithSuffix, regex.S), val='IntegerNum'), ReVal( re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.NumbersWithDozenSuffix), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_COMMA, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.AllIntRegexWithLocks), - val='IntegerDut'), + self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.AllIntRegexWithDozenSuffixLocks), - val='IntegerDut') + self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder) + ), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.RoundNumberIntegerRegexWithLocks), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.NumbersWithDozenSuffix), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.AllIntRegexWithLocks), val='IntegerDut'), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.AllIntRegexWithDozenSuffixLocks), val='IntegerDut'), ] + def __init__(self, placeholder: str = DutchNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class DutchDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE - - def __init__(self, placeholder): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.DoubleDecimalPointRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.DoubleWithoutIntegralRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_DOT_COMMA, placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, placeholder)), - val='DoubleNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_NUM_BLANK_COMMA, placeholder)), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(DutchNumeric.DoubleDecimalPointRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( - re=DutchNumeric.DoubleWithMultiplierRegex, - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(DutchNumeric.DoubleWithoutIntegralRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.DoubleWithRoundNumber), - val='DoubleNum'), + self._generate_format_regex(LongFormatMode.DOUBLE_DOT_COMMA, self.placeholder) + ), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.DoubleAllFloatRegex), - val=f'Double{DutchNumeric.LangMarker}'), + self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, self.placeholder) + ), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.DoubleExponentialNotationRegex), - val='DoublePow'), + self._generate_format_regex(LongFormatMode.DOUBLE_NUM_BLANK_COMMA, self.placeholder) + ), + val='DoubleNum', + ), + ReVal(re=DutchNumeric.DoubleWithMultiplierRegex, val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.DoubleWithRoundNumber), val='DoubleNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.DoubleCaretExponentialNotationRegex), - val='DoublePow') + re=RegExpUtility.get_safe_reg_exp(DutchNumeric.DoubleAllFloatRegex), + val=f'Double{DutchNumeric.LangMarker}', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.DoubleExponentialNotationRegex), val='DoublePow'), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.DoubleCaretExponentialNotationRegex), val='DoublePow'), ] + def __init__(self, placeholder): + self.placeholder = placeholder + class DutchFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self, mode): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.FractionNotationWithSpacesRegex), - val='FracNum'), + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.FractionNotationWithSpacesRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(DutchNumeric.FractionNotationRegex), val='FracNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.FractionNotationRegex), - val='FracNum'), + re=RegExpUtility.get_safe_reg_exp(DutchNumeric.FractionNounRegex), val=f'Frac{DutchNumeric.LangMarker}' + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.FractionNounRegex), - val=f'Frac{DutchNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.FractionNounWithArticleRegex), - val=f'Frac{DutchNumeric.LangMarker}') + re=RegExpUtility.get_safe_reg_exp(DutchNumeric.FractionNounWithArticleRegex), + val=f'Frac{DutchNumeric.LangMarker}', + ), ] - - if mode != NumberMode.Unit: - self.__regexes.append( + if self.mode != NumberMode.Unit: + _regexes.append( ReVal( - re=RegExpUtility.get_safe_reg_exp( - DutchNumeric.FractionPrepositionRegex), - val=f'Frac{DutchNumeric.LangMarker}')) + re=RegExpUtility.get_safe_reg_exp(DutchNumeric.FractionPrepositionRegex), + val=f'Frac{DutchNumeric.LangMarker}', + ) + ) + return _regexes + + def __init__(self, mode): + self.mode = mode class DutchOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ - ReVal( - re=DutchNumeric.OrdinalSuffixRegex, - val='OrdinalNum'), - ReVal( - re=DutchNumeric.OrdinalNumericRegex, - val='OrdinalNum'), - ReVal( - re=DutchNumeric.OrdinalDutchRegex, - val='OrdDut'), - ReVal( - re=DutchNumeric.OrdinalRoundNumberRegex, - val='OrdDut') - ] - - -class DutchPercentageExtractor(BasePercentageExtractor): - def __init__(self): - super().__init__(DutchNumberExtractor(NumberMode.DEFAULT)) - - def get_definitions(self) -> List[str]: + def regexes(self) -> List[ReVal]: return [ - DutchNumeric.NumberWithSuffixPercentage, - DutchNumeric.NumberWithPrefixPercentage + ReVal(re=DutchNumeric.OrdinalSuffixRegex, val='OrdinalNum'), + ReVal(re=DutchNumeric.OrdinalNumericRegex, val='OrdinalNum'), + ReVal(re=DutchNumeric.OrdinalDutchRegex, val='OrdDut'), + ReVal(re=DutchNumeric.OrdinalRoundNumberRegex, val='OrdDut'), ] @@ -265,4 +198,3 @@ def _connector_regex(self) -> Pattern: def __init__(self, mode: NumberMode = NumberMode.DEFAULT): self._number_extractor = DutchNumberExtractor(mode) - \ No newline at end of file diff --git a/Python/libraries/recognizers-number/recognizers_number/number/dutch/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/dutch/parsers.py index 4e18b30844..e53bb0fc88 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/dutch/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/dutch/parsers.py @@ -1,156 +1,51 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict, Pattern, List +from typing import Dict, List, Optional, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.culture import Culture -from recognizers_text.parser import ParseResult from recognizers_number.culture import CultureInfo -from recognizers_number.number.parsers import NumberParserConfiguration +from recognizers_number.number.parsers import BaseNumberParserConfiguration from recognizers_number.resources.dutch_numeric import DutchNumeric +from recognizers_text.culture import Culture +from recognizers_text.parser import ParseResult +from recognizers_text.utilities import RegExpUtility -class DutchNumberParserConfiguration(NumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return self._cardinal_number_map - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return self._ordinal_number_map - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self): - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return self._half_a_dozen_regex - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def written_decimal_separator_texts(self) -> List[str]: - return self._written_decimal_separator_texts - - @property - def written_group_separator_texts(self) -> List[str]: - return self._written_group_separator_texts - - @property - def written_integer_separator_texts(self) -> List[str]: - return self._written_integer_separator_texts - - @property - def written_fraction_separator_texts(self) -> List[str]: - return self._written_fraction_separator_texts - - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants +class DutchNumberParserConfiguration(BaseNumberParserConfiguration): - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture + lang_marker: str = DutchNumeric.LangMarker + is_multi_decimal_separator_culture: bool = DutchNumeric.MultiDecimalSeparatorCulture - @property - def round_multiplier_regex(self) -> Pattern: - return self._round_multiplier_regex + decimal_separator_char: str = DutchNumeric.DecimalSeparatorChar + fraction_marker_token: str = DutchNumeric.FractionMarkerToken + non_decimal_separator_char: str = DutchNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = DutchNumeric.HalfADozenText + word_separator_token: str = DutchNumeric.WordSeparatorToken - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.Dutch) + written_decimal_separator_texts: List[str] = DutchNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = DutchNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = DutchNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = DutchNumeric.WrittenFractionSeparatorTexts + non_standard_separator_variants: List[str] = [] - self._culture_info = culture_info - self._lang_marker = DutchNumeric.LangMarker - self._decimal_separator_char = DutchNumeric.DecimalSeparatorChar - self._fraction_marker_token = DutchNumeric.FractionMarkerToken - self._non_decimal_separator_char = DutchNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = DutchNumeric.HalfADozenText - self._word_separator_token = DutchNumeric.WordSeparatorToken - self._non_standard_separator_variants = [] - self._is_multi_decimal_separator_culture = DutchNumeric.MultiDecimalSeparatorCulture + cardinal_number_map: Dict[str, int] = DutchNumeric.CardinalNumberMap + ordinal_number_map: Dict[str, int] = DutchNumeric.OrdinalNumberMap + round_number_map: Dict[str, int] = DutchNumeric.RoundNumberMap - self._written_decimal_separator_texts = DutchNumeric.WrittenDecimalSeparatorTexts - self._written_group_separator_texts = DutchNumeric.WrittenGroupSeparatorTexts - self._written_integer_separator_texts = DutchNumeric.WrittenIntegerSeparatorTexts - self._written_fraction_separator_texts = DutchNumeric.WrittenFractionSeparatorTexts + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchNumeric.DigitalNumberRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchNumeric.RoundMultiplierRegex) + fraction_units_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchNumeric.FractionUnitsRegex) + fraction_half_regex: Pattern = RegExpUtility.get_safe_reg_exp(DutchNumeric.FractionHalfRegex) - self._cardinal_number_map = DutchNumeric.CardinalNumberMap - self._ordinal_number_map = DutchNumeric.OrdinalNumberMap - self._round_number_map = DutchNumeric.RoundNumberMap - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - DutchNumeric.NegativeNumberSignRegex) - self._half_a_dozen_regex = RegExpUtility.get_safe_reg_exp( - DutchNumeric.HalfADozenRegex) - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - DutchNumeric.DigitalNumberRegex) - self._round_multiplier_regex = RegExpUtility.get_safe_reg_exp( - DutchNumeric.RoundMultiplierRegex) - self._fraction_units_regex = RegExpUtility.get_safe_reg_exp( - DutchNumeric.FractionUnitsRegex) - self._fraction_half_regex = RegExpUtility.get_safe_reg_exp( - DutchNumeric.FractionHalfRegex) + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.Dutch) + super().__init__(culture_info) # Same behavior as the base but also handles numbers such as tweeënhalf and tweeëneenhalf def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: - frac_words: List[str] = list() - tokens_len = len(tokens) - i = 0 - while i < tokens_len: - if '-' in tokens[i]: - splited_tokens = tokens[i].split('-') - if len(splited_tokens) == 2 and splited_tokens[1] in self.ordinal_number_map: - frac_words.append(splited_tokens[0]) - frac_words.append(splited_tokens[1]) - else: - frac_words.append(tokens[i]) - elif i < tokens_len - 2 and tokens[i + 1] == '-': - if tokens[i + 2] in self.ordinal_number_map: - frac_words.append(tokens[i]) - frac_words.append(tokens[i + 2]) - else: - frac_words.append( - tokens[i] + tokens[i + 1] + tokens[i + 2]) - i += 2 - else: - frac_words.append(tokens[i]) - i += 1 + frac_words: List[str] = super().normalize_token_set(tokens, context) # The following piece of code is needed to compute the fraction pattern number+'ënhalf' # e.g. 'tweeënhalf' ('two and a half'). Similarly for "ëneenhalf", e.g. tweeëneenhalf. @@ -160,48 +55,33 @@ def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[s except ValueError: pass for idx, word in enumerate(frac_words): - if self._fraction_half_regex.search(word): - frac_words[idx] = word[0:(len(word) - 6)] - frac_words.append(self._written_fraction_separator_texts[0]) + if self.fraction_half_regex.search(word): + frac_words[idx] = word[0 : (len(word) - 6)] + frac_words.append(self.written_fraction_separator_texts[0]) frac_words.append(DutchNumeric.OneHalfTokens[0]) frac_words.append(DutchNumeric.OneHalfTokens[1]) length = 4 - elif self._fraction_units_regex.search(word): - m = self._fraction_units_regex.search(word) + elif m := self.fraction_units_regex.search(word): if m.group("onehalf"): frac_words[idx] = DutchNumeric.OneHalfTokens[0] - frac_words.append(self._written_fraction_separator_texts[0]) + frac_words.append(self.written_fraction_separator_texts[0]) frac_words.append(DutchNumeric.OneHalfTokens[0]) frac_words.append(DutchNumeric.OneHalfTokens[1]) length = 4 if m.group("quarter"): - frac_words[idx] = word[0:len("drie")] - frac_words.append(self._written_fraction_separator_texts[0]) - frac_words.append(word[len(frac_words[idx]):len("kwartaal") + len(frac_words[idx])]) + frac_words[idx] = word[0 : len("drie")] + frac_words.append(self.written_fraction_separator_texts[0]) + frac_words.append(word[len(frac_words[idx]) : len("kwartaal") + len(frac_words[idx])]) length = 3 fracLen = len(frac_words) if fracLen > length and frac_words[fracLen - length - 1] != DutchNumeric.WordSeparatorToken: - if not (all(i in frac_words for i in ["op", "de"]) or all(i in frac_words for i in ["van", "de"]) - or all(i in frac_words for i in ["uit", "de"])): + if not ( + all(i in frac_words for i in ["op", "de"]) + or all(i in frac_words for i in ["van", "de"]) + or all(i in frac_words for i in ["uit", "de"]) + ): frac_words.insert(fracLen - length, DutchNumeric.WordSeparatorToken) return frac_words - - def resolve_composite_number(self, number_str: str) -> int: - if '-' in number_str: - numbers = number_str.split('-') - ret = 0 - for num in numbers: - if num in self.ordinal_number_map: - ret += self.ordinal_number_map[num] - elif num in self.cardinal_number_map: - ret += self.cardinal_number_map[num] - return ret - elif number_str in self.ordinal_number_map: - return self.ordinal_number_map[number_str] - elif number_str in self.cardinal_number_map: - return self.cardinal_number_map[number_str] - - return 0 diff --git a/Python/libraries/recognizers-number/recognizers_number/number/english/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/english/extractors.py index b9246f0ed1..f45ca531a1 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/english/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/english/extractors.py @@ -1,256 +1,177 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, NamedTuple +from typing import List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.models import NumberMode, LongFormatMode -from recognizers_number.resources import BaseNumbers -from recognizers_number.resources.english_numeric import EnglishNumeric -from recognizers_number.number.extractors import ReVal, ReRe, BaseNumberExtractor, BasePercentageExtractor, BaseMergedNumberExtractor from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseMergedNumberExtractor, BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.english_numeric import EnglishNumeric +from recognizers_text.utilities import RegExpUtility class EnglishNumberExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM + @property def regexes(self) -> List[ReVal]: - return self.__regexes + _regexes: List[ReVal] = [] + cardinal_ex: EnglishCardinalExtractor = None - @property - def ambiguity_filters_dict(self) -> List[ReRe]: - return self.__ambiguity_filters_dict + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = EnglishCardinalExtractor(EnglishNumeric.PlaceHolderPureNumber) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.CurrencyRegex), val='IntegerNum')) + + cardinal_ex = cardinal_ex or EnglishCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + + fraction_ex = EnglishFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes @property - def _extract_type(self) -> str: - return Constants.SYS_NUM + def ambiguity_filters_dict(self) -> List[ReRe]: + _ambiguity_filters_dict: List[ReRe] = [] + if self.mode != NumberMode.Unit: + for key, value in EnglishNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict @property def _negative_number_terms(self) -> Pattern: - return self.__negative_number_terms + return RegExpUtility.get_safe_reg_exp(EnglishNumeric.NegativeNumberTermsRegex) def __init__(self, mode: NumberMode = NumberMode.DEFAULT): - self.__negative_number_terms = RegExpUtility.get_safe_reg_exp( - EnglishNumeric.NegativeNumberTermsRegex) - self.__regexes: List[ReVal] = list() - cardinal_ex: EnglishCardinalExtractor = None - - if mode is NumberMode.PURE_NUMBER: - cardinal_ex = EnglishCardinalExtractor( - EnglishNumeric.PlaceHolderPureNumber) - elif mode is NumberMode.CURRENCY: - self.__regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.CurrencyRegex), val='IntegerNum')) - - if cardinal_ex is None: - cardinal_ex = EnglishCardinalExtractor() - - self.__regexes.extend(cardinal_ex.regexes) - - fraction_ex = EnglishFractionExtractor(mode) - self.__regexes.extend(fraction_ex.regexes) - - ambiguity_filters_dict: List[ReRe] = list() - - if mode != NumberMode.Unit: - for key, value in EnglishNumeric.AmbiguityFiltersDict.items(): - ambiguity_filters_dict.append(ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), - reVal=RegExpUtility.get_safe_reg_exp(value))) - self.__ambiguity_filters_dict = ambiguity_filters_dict + self.mode = mode class EnglishCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return EnglishIntegerExtractor(self.placeholder).regexes + EnglishDoubleExtractor(self.placeholder).regexes def __init__(self, placeholder: str = EnglishNumeric.PlaceHolderDefault): - self.__regexes: List[ReVal] = list() - - # Add integer regexes - integer_ex = EnglishIntegerExtractor(placeholder) - self.__regexes.extend(integer_ex.regexes) - - # Add double regexes - double_ex = EnglishDoubleExtractor(placeholder) - self.__regexes.extend(double_ex.regexes) + self.placeholder = placeholder class EnglishIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER - - def __init__(self, placeholder: str = EnglishNumeric.PlaceHolderDefault): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.NumbersWithPlaceHolder(placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.NumbersWithSuffix, regex.S), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_COMMA, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_BLANK, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_NO_BREAK_SPACE, placeholder)), - val='IntegerNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.RoundNumberIntegerRegexWithLocks), - val='IntegerNum'), + re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.NumbersWithPlaceHolder(self.placeholder)), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.NumbersWithSuffix, regex.S), val='IntegerNum'), ReVal( re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.NumbersWithDozenSuffix), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_COMMA, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.AllIntRegexWithLocks), - val='IntegerEng'), + self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.AllIntRegexWithDozenSuffixLocks), - val='IntegerEng') + self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder) + ), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.RoundNumberIntegerRegexWithLocks), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.NumbersWithDozenSuffix), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.AllIntRegexWithLocks), val='IntegerEng'), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.AllIntRegexWithDozenSuffixLocks), val='IntegerEng'), ] + def __init__(self, placeholder: str = EnglishNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class EnglishDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE - - def __init__(self, placeholder): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.DoubleDecimalPointRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.DoubleWithoutIntegralRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_COMMA_DOT, placeholder)), - val='DoubleNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_NO_BREAK_SPACE_DOT, placeholder)), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.DoubleDecimalPointRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.DoubleWithMultiplierRegex, regex.S), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.DoubleWithoutIntegralRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.DoubleWithRoundNumber), - val='DoubleNum'), + self._generate_format_regex(LongFormatMode.DOUBLE_COMMA_DOT, self.placeholder) + ), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.DoubleAllFloatRegex), - val='DoubleEng'), + self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_DOT, self.placeholder) + ), + val='DoubleNum', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.DoubleExponentialNotationRegex), - val='DoublePow'), + re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.DoubleWithMultiplierRegex, regex.S), val='DoubleNum' + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.DoubleWithRoundNumber), val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.DoubleAllFloatRegex), val='DoubleEng'), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.DoubleExponentialNotationRegex), val='DoublePow'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.DoubleCaretExponentialNotationRegex), - val='DoublePow') + re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.DoubleCaretExponentialNotationRegex), val='DoublePow' + ), ] + def __init__(self, placeholder: str = EnglishNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class EnglishFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self, mode): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.FractionNotationWithSpacesRegex), - val='FracNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.FractionNotationRegex), - val='FracNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.FractionNounRegex), - val='FracEng'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.FractionNounWithArticleRegex), - val='FracEng') + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.FractionNotationWithSpacesRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.FractionNotationRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.FractionNounRegex), val='FracEng'), + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.FractionNounWithArticleRegex), val='FracEng'), ] + if self.mode != NumberMode.Unit: + _regexes.append( + ReVal(re=RegExpUtility.get_safe_reg_exp(EnglishNumeric.FractionPrepositionRegex), val='FracEng') + ) + return _regexes - if mode != NumberMode.Unit: - self.__regexes.append( - ReVal( - re=RegExpUtility.get_safe_reg_exp( - EnglishNumeric.FractionPrepositionRegex), - val='FracEng')) + def __init__(self, mode: NumberMode): + self.mode = mode class EnglishOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ - ReVal( - re=EnglishNumeric.OrdinalSuffixRegex, - val='OrdinalNum'), - ReVal( - re=EnglishNumeric.OrdinalNumericRegex, - val='OrdinalNum'), - ReVal( - re=EnglishNumeric.OrdinalEnglishRegex, - val='OrdEng'), - ReVal( - re=EnglishNumeric.OrdinalRoundNumberRegex, - val='OrdEng') - ] - - -class EnglishPercentageExtractor(BasePercentageExtractor): - def __init__(self): - super().__init__(EnglishNumberExtractor(NumberMode.DEFAULT)) - - def get_definitions(self) -> List[str]: + def regexes(self) -> List[ReVal]: return [ - EnglishNumeric.NumberWithSuffixPercentage, - EnglishNumeric.NumberWithPrefixPercentage + ReVal(re=EnglishNumeric.OrdinalSuffixRegex, val='OrdinalNum'), + ReVal(re=EnglishNumeric.OrdinalNumericRegex, val='OrdinalNum'), + ReVal(re=EnglishNumeric.OrdinalEnglishRegex, val='OrdEng'), + ReVal(re=EnglishNumeric.OrdinalRoundNumberRegex, val='OrdEng'), ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/english/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/english/parsers.py index cdf4e798f0..9bdd06948d 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/english/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/english/parsers.py @@ -1,167 +1,41 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict, Pattern, List +from typing import Dict, List, Optional, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.culture import Culture -from recognizers_text.parser import ParseResult from recognizers_number.culture import CultureInfo -from recognizers_number.number.parsers import NumberParserConfiguration +from recognizers_number.number.parsers import BaseNumberParserConfiguration from recognizers_number.resources.english_numeric import EnglishNumeric +from recognizers_text.culture import Culture +from recognizers_text.utilities import RegExpUtility -class EnglishNumberParserConfiguration(NumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return self._cardinal_number_map - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return self._ordinal_number_map - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self): - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return self._half_a_dozen_regex - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def written_decimal_separator_texts(self) -> List[str]: - return self._written_decimal_separator_texts - - @property - def written_group_separator_texts(self) -> List[str]: - return self._written_group_separator_texts - - @property - def written_integer_separator_texts(self) -> List[str]: - return self._written_integer_separator_texts - - @property - def written_fraction_separator_texts(self) -> List[str]: - return self._written_fraction_separator_texts - - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants - - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture - - @property - def round_multiplier_regex(self) -> Pattern: - return self._round_multiplier_regex - - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.English) - - self._culture_info = culture_info - self._lang_marker = EnglishNumeric.LangMarker - self._decimal_separator_char = EnglishNumeric.DecimalSeparatorChar - self._fraction_marker_token = EnglishNumeric.FractionMarkerToken - self._non_decimal_separator_char = EnglishNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = EnglishNumeric.HalfADozenText - self._word_separator_token = EnglishNumeric.WordSeparatorToken +class EnglishNumberParserConfiguration(BaseNumberParserConfiguration): - self._written_decimal_separator_texts = EnglishNumeric.WrittenDecimalSeparatorTexts - self._written_group_separator_texts = EnglishNumeric.WrittenGroupSeparatorTexts - self._written_integer_separator_texts = EnglishNumeric.WrittenIntegerSeparatorTexts - self._written_fraction_separator_texts = EnglishNumeric.WrittenFractionSeparatorTexts - self._non_standard_separator_variants = EnglishNumeric.NonStandardSeparatorVariants - self._is_multi_decimal_separator_culture = EnglishNumeric.MultiDecimalSeparatorCulture + lang_marker: str = EnglishNumeric.LangMarker + is_multi_decimal_separator_culture: bool = EnglishNumeric.MultiDecimalSeparatorCulture - self._cardinal_number_map = EnglishNumeric.CardinalNumberMap - self._ordinal_number_map = EnglishNumeric.OrdinalNumberMap - self._round_number_map = EnglishNumeric.RoundNumberMap - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - EnglishNumeric.NegativeNumberSignRegex) - self._half_a_dozen_regex = RegExpUtility.get_safe_reg_exp( - EnglishNumeric.HalfADozenRegex) - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - EnglishNumeric.DigitalNumberRegex) - self._round_multiplier_regex = RegExpUtility.get_safe_reg_exp( - EnglishNumeric.RoundMultiplierRegex) + decimal_separator_char: str = EnglishNumeric.DecimalSeparatorChar + fraction_marker_token: str = EnglishNumeric.FractionMarkerToken + non_decimal_separator_char: str = EnglishNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = EnglishNumeric.HalfADozenText + word_separator_token: str = EnglishNumeric.WordSeparatorToken - def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: - frac_words: List[str] = list() - tokens_len = len(tokens) - i = 0 - while i < tokens_len: - if '-' in tokens[i]: - splited_tokens = tokens[i].split('-') - if len(splited_tokens) == 2 and splited_tokens[1] in self.ordinal_number_map: - frac_words.append(splited_tokens[0]) - frac_words.append(splited_tokens[1]) - else: - frac_words.append(tokens[i]) - elif i < tokens_len - 2 and tokens[i + 1] == '-': - if tokens[i + 2] in self.ordinal_number_map: - frac_words.append(tokens[i]) - frac_words.append(tokens[i + 2]) - else: - frac_words.append( - tokens[i] + tokens[i + 1] + tokens[i + 2]) - i += 2 - else: - frac_words.append(tokens[i]) - i += 1 + written_decimal_separator_texts: List[str] = EnglishNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = EnglishNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = EnglishNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = EnglishNumeric.WrittenFractionSeparatorTexts + non_standard_separator_variants: List[str] = EnglishNumeric.NonStandardSeparatorVariants - return frac_words + cardinal_number_map: Dict[str, int] = EnglishNumeric.CardinalNumberMap + ordinal_number_map: Dict[str, int] = EnglishNumeric.OrdinalNumberMap + round_number_map: Dict[str, int] = EnglishNumeric.RoundNumberMap - def resolve_composite_number(self, number_str: str) -> int: - if '-' in number_str: - numbers = number_str.split('-') - ret = 0 - for num in numbers: - if num in self.ordinal_number_map: - ret += self.ordinal_number_map[num] - elif num in self.cardinal_number_map: - ret += self.cardinal_number_map[num] - return ret - elif number_str in self.ordinal_number_map: - return self.ordinal_number_map[number_str] - elif number_str in self.cardinal_number_map: - return self.cardinal_number_map[number_str] + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishNumeric.DigitalNumberRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(EnglishNumeric.RoundMultiplierRegex) - return 0 + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.English) + super().__init__(culture_info) diff --git a/Python/libraries/recognizers-number/recognizers_number/number/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/extractors.py index 4f7c7b2d5b..e8e8dc0cc5 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/extractors.py @@ -2,16 +2,16 @@ # Licensed under the MIT License. import copy from abc import abstractmethod -from typing import List, Pattern, Dict, Match from collections import namedtuple +from typing import List, Match, Optional, Pattern + import regex -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import Extractor, ExtractResult -from recognizers_number.resources.base_numbers import BaseNumbers -from recognizers_number.resources.english_numeric import EnglishNumeric -from recognizers_number.number.models import LongFormatType from recognizers_number.number.constants import Constants +from recognizers_number.number.models import LongFormatType +from recognizers_number.resources.base_numbers import BaseNumbers +from recognizers_text.extractor import Extractor, ExtractResult + ReVal = namedtuple('ReVal', ['re', 'val']) ReRe = namedtuple('ReRe', ['reKey', 'reVal']) @@ -19,6 +19,9 @@ class BaseNumberExtractor(Extractor): + + extract_type: str + @property @abstractmethod def regexes(self) -> List[ReVal]: @@ -26,27 +29,22 @@ def regexes(self) -> List[ReVal]: @property def ambiguity_filters_dict(self) -> List[ReRe]: - pass + return [] @property - @abstractmethod - def _extract_type(self) -> str: - raise NotImplementedError - - @property - def _negative_number_terms(self) -> Pattern: - pass + def _negative_number_terms(self) -> Optional[Pattern]: + return None def extract(self, source: str) -> List[ExtractResult]: - if source is None or len(source.strip()) is 0: + if source is None or len(source.strip()) == 0: return list() result: List[ExtractResult] = list() match_source = dict() matched: List[bool] = [False] * len(source) - matches_list = list(map( - lambda x: MatchesVal(matches=list(regex.finditer(x.re, source)), - val=x.val), self.regexes)) + matches_list = list( + map(lambda x: MatchesVal(matches=list(regex.finditer(x.re, source)), val=x.val), self.regexes) + ) matches_list = list(filter(lambda x: len(x.matches) > 0, matches_list)) for ml in matches_list: for m in ml.matches: @@ -63,26 +61,26 @@ def extract(self, source: str) -> List[ExtractResult]: if i + 1 == len(source) or not matched[i + 1]: start = last + 1 length = i - last - substr = source[start:start + length].strip() - src_match = next((x for x in iter(match_source) if ( - x.start() == start and ( - x.end() - x.start()) == length)), None) + substr = source[start : start + length] + src_match = next( + (x for x in iter(match_source) if (x.start() == start and (x.end() - x.start()) == length)), + None, + ) # extract negative numbers if self._negative_number_terms is not None: - match = regex.search(self._negative_number_terms, - source[0:start]) + match = regex.search(self._negative_number_terms, source[0:start]) if match is not None: start = match.start() length = length + match.end() - match.start() - substr = source[start:start + length].strip() + substr = source[start : start + length] if src_match is not None: value = ExtractResult() value.start = start value.length = length value.text = substr - value.type = self._extract_type + value.type = self.extract_type value.data = match_source.get(src_match, None) result.append(value) @@ -105,175 +103,22 @@ def _filter_item(self, er: ExtractResult, matches: List[Match]) -> bool: return True - def _generate_format_regex(self, format_type: LongFormatType, - placeholder: str = None) -> Pattern: + def _generate_format_regex(self, format_type: LongFormatType, placeholder: str = None) -> str: if placeholder is None: placeholder = BaseNumbers.PlaceHolderDefault if format_type.decimals_mark is None: - re_definition = BaseNumbers.IntegerRegexDefinition(placeholder, - regex.escape( - format_type.thousands_mark)) + re_definition = BaseNumbers.IntegerRegexDefinition(placeholder, regex.escape(format_type.thousands_mark)) else: - re_definition = BaseNumbers.DoubleRegexDefinition(placeholder, - regex.escape( - format_type.thousands_mark), - regex.escape( - format_type.decimals_mark)) + re_definition = BaseNumbers.DoubleRegexDefinition( + placeholder, + regex.escape(format_type.thousands_mark), + regex.escape(format_type.decimals_mark), + ) return re_definition -SourcePositionResults = namedtuple('SourcePositionResults', - ['source', 'position', 'results']) - - -class BasePercentageExtractor(Extractor): - @property - def regexes(self) -> List[Pattern]: - return self._regexes - - @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_PERCENTAGE - - def __init__(self, number_extractor: BaseNumberExtractor): - self.number_extractor = number_extractor - self._regexes = self.generate_regexes() - - @property - @abstractmethod - def get_definitions(self) -> List[str]: - raise NotImplementedError - - def generate_regexes(self, ignore_case: bool = False) -> List[Pattern]: - definitions = self.get_definitions() - options = regex.DOTALL | (regex.IGNORECASE if ignore_case else 0) - return list(map(lambda d: RegExpUtility.get_safe_reg_exp(d, options), - definitions)) - - def extract(self, source: str) -> List[ExtractResult]: - origin = source - - # preprocess the source sentence via extracting and replacing the numbers in it - preprocess = self.__preprocess_with_number_extracted(origin) - source = preprocess.source - positionmap = preprocess.position - extractresults = preprocess.results - - allmatches = list( - map(lambda p: list(regex.finditer(p, source)), self.regexes)) - matched: List[bool] = [False] * len(source) - - for matches in allmatches: - for match in matches: - for j in range(len(match.group())): - matched[match.start() + j] = True - - results = list() - - # get index of each matched results - last = -1 - for i in range(len(source)): - if not matched[i]: - last = i - else: - if (i + 1) == len(source) or not matched[i + 1]: - start = last + 1 - length = i - last - substr = source[start:start + length].strip() - value = ExtractResult() - value.start = start - value.length = length - value.text = substr - value.type = self._extract_type - results.append(value) - - # post-processing, restoring the extracted numbers - results = self.__post_processing(results, origin, positionmap, - extractresults) - - return results - - def __preprocess_with_number_extracted(self, - source: str) -> SourcePositionResults: - position_map = dict() - extract_results = self.number_extractor.extract(source) - - dummy_token = BaseNumbers.NumberReplaceToken - match: List[int] = [-1] * len(source) - string_parts = list() - - for i in range(len(extract_results)): - extract_result = extract_results[i] - start = extract_result.start - end = extract_result.end + 1 - for j in range(start, end): - if match[j] == -1: - match[j] = i - - start = 0 - for i in range(1, len(source)): - if match[i] != match[i - 1]: - string_parts.append([start, i - 1]) - start = i - - string_parts.append([start, len(source) - 1]) - - string_result = '' - index = 0 - for part in string_parts: - start = part[0] - end = part[1] - val_type = match[start] - if val_type == -1: - string_result += source[start:end + 1] - for i in range(start, end + 1): - position_map[index] = i - index += 1 - else: - string_result += dummy_token - for i in range(0, len(dummy_token)): - position_map[index] = start - index += 1 - - position_map[index] = len(source) - index += 1 - - return SourcePositionResults(source=string_result, - position=position_map, - results=extract_results) - - def __post_processing(self, results: List[ExtractResult], source: str, - positionmap: Dict[int, int], - extractresults: List[ExtractResult]) -> List[ - ExtractResult]: - dummy_token = BaseNumbers.NumberReplaceToken - for i in range(len(results)): - start = results[i].start - end = results[i].start + results[i].length - text = results[i].text - if start in positionmap and end in positionmap: - original_start = positionmap[start] - original_length = positionmap[end] - original_start - results[i].start = original_start - results[i].length = original_length - results[i].text = source[ - original_start:original_start + original_length].strip() - num_start = text.find(dummy_token) - if num_start != -1: - num_original_start = start + num_start - if num_start in positionmap: - num_original_end = num_original_start + len( - dummy_token) - data_key = source[ - positionmap[num_original_start]:positionmap[ - num_original_end]] - for j in range(i, len(extractresults)): - if results[i].start == extractresults[j].start and \ - extractresults[j].text in results[i].text: - results[i].data = [data_key, extractresults[j]] - break - return results +SourcePositionResults = namedtuple('SourcePositionResults', ['source', 'position', 'results']) class BaseMergedNumberExtractor(Extractor): diff --git a/Python/libraries/recognizers-number/recognizers_number/number/french/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/french/extractors.py index c4b0c85432..a9922b6633 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/french/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/french/extractors.py @@ -1,249 +1,193 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, NamedTuple +from typing import List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.models import NumberMode, LongFormatMode -from recognizers_number.resources import BaseNumbers -from recognizers_number.resources.french_numeric import FrenchNumeric -from recognizers_number.number.extractors import ReVal, ReRe, BaseNumberExtractor, BasePercentageExtractor from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.french_numeric import FrenchNumeric +from recognizers_text.utilities import RegExpUtility class FrenchNumberExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM + @property def regexes(self) -> List[ReVal]: - return self.__regexes + _regexes: List[ReVal] = [] + cardinal_ex: FrenchCardinalExtractor = None - @property - def ambiguity_filters_dict(self) -> List[ReRe]: - return self.__ambiguity_filters_dict + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = FrenchCardinalExtractor(FrenchNumeric.PlaceHolderPureNumber) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.CurrencyRegex), val='IntegerNum')) + + cardinal_ex = cardinal_ex or FrenchCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + + fraction_ex = FrenchFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes @property - def _extract_type(self) -> str: - return Constants.SYS_NUM + def ambiguity_filters_dict(self) -> List[ReRe]: + _ambiguity_filters_dict: List[ReRe] = list() + if self.mode != NumberMode.Unit: + for key, value in FrenchNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict @property def _negative_number_terms(self) -> Pattern: - return self.__negative_number_terms + return RegExpUtility.get_safe_reg_exp(FrenchNumeric.NegativeNumberTermsRegex) def __init__(self, mode: NumberMode = NumberMode.DEFAULT): - self.__negative_number_terms = RegExpUtility.get_safe_reg_exp( - FrenchNumeric.NegativeNumberTermsRegex) - self.__regexes: List[ReVal] = list() - cardinal_ex: FrenchCardinalExtractor = None - - if mode is NumberMode.PURE_NUMBER: - cardinal_ex = FrenchCardinalExtractor( - FrenchNumeric.PlaceHolderPureNumber) - elif mode is NumberMode.CURRENCY: - self.__regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.CurrencyRegex), val='IntegerNum')) - - if cardinal_ex is None: - cardinal_ex = FrenchCardinalExtractor() - - self.__regexes.extend(cardinal_ex.regexes) - - fraction_ex = FrenchFractionExtractor(mode) - self.__regexes.extend(fraction_ex.regexes) - - ambiguity_filters_dict: List[ReRe] = list() - - if mode != NumberMode.Unit: - for key, value in FrenchNumeric.AmbiguityFiltersDict.items(): - ambiguity_filters_dict.append(ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), - reVal=RegExpUtility.get_safe_reg_exp(value))) - self.__ambiguity_filters_dict = ambiguity_filters_dict + self.mode = mode class FrenchCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return FrenchIntegerExtractor(self.placeholder).regexes + FrenchDoubleExtractor(self.placeholder).regexes def __init__(self, placeholder: str = FrenchNumeric.PlaceHolderDefault): - self.__regexes: List[ReVal] = list() - - # Add integer regexes - integer_ex = FrenchIntegerExtractor(placeholder) - self.__regexes.extend(integer_ex.regexes) - - # Add double regexes - double_ex = FrenchDoubleExtractor(placeholder) - self.__regexes.extend(double_ex.regexes) + self.placeholder = placeholder class FrenchIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER - - def __init__(self, placeholder: str = FrenchNumeric.PlaceHolderDefault): - self.__regexes = [ + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.NumbersWithPlaceHolder(placeholder), regex.I), - val='IntegerNum'), + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.NumbersWithPlaceHolder(self.placeholder), regex.I), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.NumbersWithSuffix, regex.S), val='IntegerNum'), ReVal( re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.NumbersWithSuffix, regex.S), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_DOT, placeholder), regex.V1), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_BLANK, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_NO_BREAK_SPACE, placeholder)), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_DOT, self.placeholder), regex.V1 + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.RoundNumberIntegerRegexWithLocks), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.NumbersWithDozenSuffix), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder) + ), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.RoundNumberIntegerRegexWithLocks), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.NumbersWithDozenSuffix), val='IntegerNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.AllIntRegexWithLocks), - val=f'Integer{FrenchNumeric.LangMarker}'), + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.AllIntRegexWithLocks), + val=f'Integer{FrenchNumeric.LangMarker}', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.AllIntRegexWithDozenSuffixLocks), - val=f'Integer{FrenchNumeric.LangMarker}') + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.AllIntRegexWithDozenSuffixLocks), + val=f'Integer{FrenchNumeric.LangMarker}', + ), ] + def __init__(self, placeholder: str = FrenchNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class FrenchDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE - - def __init__(self, placeholder): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.DoubleDecimalPointRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.DoubleWithoutIntegralRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_DOT_COMMA, placeholder)), - val='DoubleNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, placeholder)), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.DoubleDecimalPointRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( - re=FrenchNumeric.DoubleWithMultiplierRegex, - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.DoubleWithoutIntegralRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.DoubleWithRoundNumber), - val='DoubleNum'), + self._generate_format_regex(LongFormatMode.DOUBLE_DOT_COMMA, self.placeholder) + ), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.DoubleAllFloatRegex), - val=f'Double{FrenchNumeric.LangMarker}'), + self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, self.placeholder) + ), + val='DoubleNum', + ), + ReVal(re=FrenchNumeric.DoubleWithMultiplierRegex, val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.DoubleWithRoundNumber), val='DoubleNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.DoubleExponentialNotationRegex), - val='DoublePow'), + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.DoubleAllFloatRegex), + val=f'Double{FrenchNumeric.LangMarker}', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.DoubleExponentialNotationRegex), val='DoublePow'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.DoubleCaretExponentialNotationRegex), - val='DoublePow') + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.DoubleCaretExponentialNotationRegex), val='DoublePow' + ), ] + def __init__(self, placeholder: str = FrenchNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class FrenchFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self, mode): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.FractionNotationWithSpacesRegex), - val='FracNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.FractionNotationRegex), - val='FracNum'), + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.FractionNotationWithSpacesRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.FractionNotationRegex), val='FracNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.FractionNounRegex), - val=f'Frac{FrenchNumeric.LangMarker}'), + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.FractionNounRegex), + val=f'Frac{FrenchNumeric.LangMarker}', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.FractionNounWithArticleRegex), - val=f'Frac{FrenchNumeric.LangMarker}') + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.FractionNounWithArticleRegex), + val=f'Frac{FrenchNumeric.LangMarker}', + ), ] - if mode != NumberMode.Unit: - self.__regexes.append( + if self.mode != NumberMode.Unit: + _regexes.append( ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.FractionPrepositionRegex), - val=f'Frac{FrenchNumeric.LangMarker}')) + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.FractionPrepositionRegex), + val=f'Frac{FrenchNumeric.LangMarker}', + ) + ) + return _regexes + + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self.mode = mode class FrenchOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.OrdinalSuffixRegex), - val='OrdinalNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - FrenchNumeric.OrdinalFrenchRegex), - val=f'Ord{FrenchNumeric.LangMarker}') - ] - - -class FrenchPercentageExtractor(BasePercentageExtractor): - def __init__(self): - super().__init__(FrenchNumberExtractor(NumberMode.DEFAULT)) - - def get_definitions(self) -> List[str]: + def regexes(self) -> List[ReVal]: return [ - FrenchNumeric.NumberWithSuffixPercentage, - FrenchNumeric.NumberWithPrefixPercentage + ReVal(re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.OrdinalSuffixRegex), val='OrdinalNum'), + ReVal( + re=RegExpUtility.get_safe_reg_exp(FrenchNumeric.OrdinalFrenchRegex), + val=f'Ord{FrenchNumeric.LangMarker}', + ), ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/french/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/french/parsers.py index f39dfe6d76..c5afa4023a 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/french/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/french/parsers.py @@ -1,160 +1,58 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict, Pattern, List -import regex +from typing import Dict, List, Optional, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.culture import Culture -from recognizers_text.parser import ParseResult from recognizers_number.culture import CultureInfo -from recognizers_number.number.parsers import NumberParserConfiguration +from recognizers_number.number.parsers import BaseNumberParserConfiguration from recognizers_number.resources.french_numeric import FrenchNumeric +from recognizers_text.culture import Culture +from recognizers_text.parser import ParseResult +from recognizers_text.utilities import RegExpUtility + +class FrenchNumberParserConfiguration(BaseNumberParserConfiguration): -class FrenchNumberParserConfiguration(NumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return self._cardinal_number_map - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return self._ordinal_number_map - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self): - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return self._half_a_dozen_regex - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def written_decimal_separator_texts(self) -> List[str]: - return self._written_decimal_separator_texts - - @property - def written_group_separator_texts(self) -> List[str]: - return self._written_group_separator_texts - - @property - def written_integer_separator_texts(self) -> List[str]: - return self._written_integer_separator_texts - - @property - def written_fraction_separator_texts(self) -> List[str]: - return self._written_fraction_separator_texts - - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants - - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture - - @property - def round_multiplier_regex(self) -> Pattern: - return self._round_multiplier_regex - - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.French) - - self._culture_info = culture_info - self._lang_marker = FrenchNumeric.LangMarker - self._decimal_separator_char = FrenchNumeric.DecimalSeparatorChar - self._fraction_marker_token = FrenchNumeric.FractionMarkerToken - self._non_decimal_separator_char = FrenchNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = FrenchNumeric.HalfADozenText - self._word_separator_token = FrenchNumeric.WordSeparatorToken - self._non_standard_separator_variants = [] - self._is_multi_decimal_separator_culture = FrenchNumeric.MultiDecimalSeparatorCulture - - self._written_decimal_separator_texts = FrenchNumeric.WrittenDecimalSeparatorTexts - self._written_group_separator_texts = FrenchNumeric.WrittenGroupSeparatorTexts - self._written_integer_separator_texts = FrenchNumeric.WrittenIntegerSeparatorTexts - self._written_fraction_separator_texts = FrenchNumeric.WrittenFractionSeparatorTexts - - self._cardinal_number_map = FrenchNumeric.CardinalNumberMap - self._ordinal_number_map = FrenchNumeric.OrdinalNumberMap - self._round_number_map = FrenchNumeric.RoundNumberMap - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - FrenchNumeric.NegativeNumberSignRegex) - self._half_a_dozen_regex = RegExpUtility.get_safe_reg_exp( - FrenchNumeric.HalfADozenRegex) - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - FrenchNumeric.DigitalNumberRegex) - self._round_multiplier_regex = RegExpUtility.get_safe_reg_exp( - FrenchNumeric.RoundMultiplierRegex) + lang_marker: str = FrenchNumeric.LangMarker + is_multi_decimal_separator_culture: bool = FrenchNumeric.MultiDecimalSeparatorCulture + + decimal_separator_char: str = FrenchNumeric.DecimalSeparatorChar + fraction_marker_token: str = FrenchNumeric.FractionMarkerToken + non_decimal_separator_char: str = FrenchNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = FrenchNumeric.HalfADozenText + word_separator_token: str = FrenchNumeric.WordSeparatorToken + + written_decimal_separator_texts: List[str] = FrenchNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = FrenchNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = FrenchNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = FrenchNumeric.WrittenFractionSeparatorTexts + non_standard_separator_variants: List[str] = [] + + cardinal_number_map: Dict[str, int] = FrenchNumeric.CardinalNumberMap + ordinal_number_map: Dict[str, int] = FrenchNumeric.OrdinalNumberMap + round_number_map: Dict[str, int] = FrenchNumeric.RoundNumberMap + + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchNumeric.DigitalNumberRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(FrenchNumeric.RoundMultiplierRegex) + + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.French) + super().__init__(culture_info) def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: - frac_words: List[str] = list() - tokens_len = len(tokens) - i = 0 - while i < tokens_len: - if '-' in tokens[i]: - splited_tokens = tokens[i].split('-') - if len(splited_tokens) == 2 and splited_tokens[1] in self.ordinal_number_map: - frac_words.append(splited_tokens[0]) - frac_words.append(splited_tokens[1]) - else: - frac_words.append(tokens[i]) - elif i < tokens_len - 2 and tokens[i + 1] == '-': - if tokens[i + 2] in self.ordinal_number_map: - frac_words.append(tokens[i]) - frac_words.append(tokens[i + 2]) - else: - frac_words.append( - tokens[i] + tokens[i + 1] + tokens[i + 2]) - i += 2 - else: - frac_words.append(tokens[i]) - i += 1 + frac_words: List[str] = super().normalize_token_set(tokens, context) # The following piece of code is needed to compute the fraction pattern number+'et demi' # e.g. 'deux et demi' ('two and a half') where the numerator is omitted in French. # It works by inserting the numerator 'un' ('a') in the list frac_words # if len(frac_words) > 2: - if frac_words[len(frac_words) - 1] == FrenchNumeric.OneHalfTokens[1] and \ - frac_words[len(frac_words) - 2] == FrenchNumeric.WordSeparatorToken: + if ( + frac_words[len(frac_words) - 1] == FrenchNumeric.OneHalfTokens[1] + and frac_words[len(frac_words) - 2] == FrenchNumeric.WordSeparatorToken + ): frac_words.insert(len(frac_words) - 1, FrenchNumeric.OneHalfTokens[0]) return frac_words @@ -172,8 +70,7 @@ def resolve_composite_number(self, number_str: str) -> int: i = 0 while i < len(number_str): str_builder += number_str[i] - if (str_builder in self.cardinal_number_map - and self.cardinal_number_map[str_builder] > value): + if str_builder in self.cardinal_number_map and self.cardinal_number_map[str_builder] > value: last_good_char = i value = self.cardinal_number_map[str_builder] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/german/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/german/extractors.py index b80b31b0f5..cb36d84d06 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/german/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/german/extractors.py @@ -1,256 +1,175 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, NamedTuple +from typing import List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.models import NumberMode, LongFormatMode -from recognizers_number.resources import BaseNumbers -from recognizers_number.resources.german_numeric import GermanNumeric -from recognizers_number.number.extractors import ReVal, ReRe, BaseNumberExtractor, BasePercentageExtractor, BaseMergedNumberExtractor from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseMergedNumberExtractor, BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.german_numeric import GermanNumeric +from recognizers_text.utilities import RegExpUtility class GermanNumberExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM + @property def regexes(self) -> List[ReVal]: - return self.__regexes + _regexes: List[ReVal] = list() + cardinal_ex: GermanCardinalExtractor = None - @property - def ambiguity_filters_dict(self) -> List[ReRe]: - return self.__ambiguity_filters_dict + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = GermanCardinalExtractor(GermanNumeric.PlaceHolderPureNumber) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.CurrencyRegex), val='IntegerNum')) + + cardinal_ex = cardinal_ex or GermanCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + fraction_ex = GermanFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes @property - def _extract_type(self) -> str: - return Constants.SYS_NUM + def ambiguity_filters_dict(self) -> List[ReRe]: + _ambiguity_filters_dict: List[ReRe] = list() + if self.mode != NumberMode.Unit: + for key, value in GermanNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict @property def _negative_number_terms(self) -> Pattern: - return self.__negative_number_terms + return RegExpUtility.get_safe_reg_exp(GermanNumeric.NegativeNumberTermsRegex) def __init__(self, mode: NumberMode = NumberMode.DEFAULT): - self.__negative_number_terms = RegExpUtility.get_safe_reg_exp( - GermanNumeric.NegativeNumberTermsRegex) - self.__regexes: List[ReVal] = list() - cardinal_ex: GermanCardinalExtractor = None - - if mode is NumberMode.PURE_NUMBER: - cardinal_ex = GermanCardinalExtractor( - GermanNumeric.PlaceHolderPureNumber) - elif mode is NumberMode.CURRENCY: - self.__regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.CurrencyRegex), val='IntegerNum')) - - if cardinal_ex is None: - cardinal_ex = GermanCardinalExtractor() - - self.__regexes.extend(cardinal_ex.regexes) - - fraction_ex = GermanFractionExtractor(mode) - self.__regexes.extend(fraction_ex.regexes) - - ambiguity_filters_dict: List[ReRe] = list() - - if mode != NumberMode.Unit: - for key, value in GermanNumeric.AmbiguityFiltersDict.items(): - ambiguity_filters_dict.append(ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), - reVal=RegExpUtility.get_safe_reg_exp(value))) - self.__ambiguity_filters_dict = ambiguity_filters_dict + self.mode = mode class GermanCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return GermanIntegerExtractor(self.placeholder).regexes + GermanDoubleExtractor(self.placeholder).regexes def __init__(self, placeholder: str = GermanNumeric.PlaceHolderDefault): - self.__regexes: List[ReVal] = list() - - # Add integer regexes - integer_ex = GermanIntegerExtractor(placeholder) - self.__regexes.extend(integer_ex.regexes) - - # Add double regexes - double_ex = GermanDoubleExtractor(placeholder) - self.__regexes.extend(double_ex.regexes) + self.placeholder = placeholder class GermanIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER - - def __init__(self, placeholder: str = GermanNumeric.PlaceHolderDefault): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.NumbersWithPlaceHolder(placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.NumbersWithSuffix, regex.S), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_COMMA, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_BLANK, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_NO_BREAK_SPACE, placeholder)), - val='IntegerNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.RoundNumberIntegerRegexWithLocks), - val='IntegerNum'), + re=RegExpUtility.get_safe_reg_exp(GermanNumeric.NumbersWithPlaceHolder(self.placeholder)), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.NumbersWithSuffix, regex.S), val='IntegerNum'), ReVal( re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.NumbersWithDozenSuffix), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_COMMA, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.AllIntRegexWithLocks), - val='IntegerGer'), + self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.AllIntRegexWithDozenSuffixLocks), - val='IntegerGer') + self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder) + ), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.RoundNumberIntegerRegexWithLocks), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.NumbersWithDozenSuffix), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.AllIntRegexWithLocks), val='IntegerGer'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.AllIntRegexWithDozenSuffixLocks), val='IntegerGer'), ] + def __init__(self, placeholder: str = GermanNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class GermanDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE - - def __init__(self, placeholder): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.DoubleDecimalPointRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.DoubleWithoutIntegralRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_COMMA_DOT, placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_NO_BREAK_SPACE_DOT, placeholder)), - val='DoubleNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.DoubleWithMultiplierRegex, regex.S), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(GermanNumeric.DoubleDecimalPointRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.DoubleWithRoundNumber), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(GermanNumeric.DoubleWithoutIntegralRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.DoubleAllFloatRegex), - val='DoubleGer'), + self._generate_format_regex(LongFormatMode.DOUBLE_COMMA_DOT, self.placeholder) + ), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.DoubleExponentialNotationRegex), - val='DoublePow'), + self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_DOT, self.placeholder) + ), + val='DoubleNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.DoubleWithMultiplierRegex, regex.S), val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.DoubleWithRoundNumber), val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.DoubleAllFloatRegex), val='DoubleGer'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.DoubleExponentialNotationRegex), val='DoublePow'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.DoubleCaretExponentialNotationRegex), - val='DoublePow') + re=RegExpUtility.get_safe_reg_exp(GermanNumeric.DoubleCaretExponentialNotationRegex), val='DoublePow' + ), ] + def __init__(self, placeholder: str = GermanNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class GermanFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self, mode): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.FractionNotationWithSpacesRegex), - val='FracNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.FractionNotationRegex), - val='FracNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.FractionNounRegex), - val='FracGer'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.FractionNounWithArticleRegex), - val='FracGer') + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.FractionNotationWithSpacesRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.FractionNotationRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.FractionNounRegex), val='FracGer'), + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.FractionNounWithArticleRegex), val='FracGer'), ] - if mode != NumberMode.Unit: - self.__regexes.append( - ReVal( - re=RegExpUtility.get_safe_reg_exp( - GermanNumeric.FractionPrepositionRegex), - val='FracGer')) + if self.mode != NumberMode.Unit: + _regexes.append( + ReVal(re=RegExpUtility.get_safe_reg_exp(GermanNumeric.FractionPrepositionRegex), val='FracGer') + ) + return _regexes + + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self.mode = mode class GermanOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ - ReVal( - re=GermanNumeric.OrdinalSuffixRegex, - val='OrdinalNum'), - ReVal( - re=GermanNumeric.OrdinalNumericRegex, - val='OrdinalNum'), - ReVal( - re=GermanNumeric.OrdinalGermanRegex, - val='OrdGer'), - ReVal( - re=GermanNumeric.OrdinalRoundNumberRegex, - val='OrdGer') - ] - - -class GermanPercentageExtractor(BasePercentageExtractor): - def __init__(self): - super().__init__(GermanNumberExtractor(NumberMode.DEFAULT)) - - def get_definitions(self) -> List[str]: + def regexes(self) -> List[ReVal]: return [ - GermanNumeric.NumberWithSuffixPercentage, - GermanNumeric.NumberWithPrefixPercentage + ReVal(re=GermanNumeric.OrdinalSuffixRegex, val='OrdinalNum'), + ReVal(re=GermanNumeric.OrdinalNumericRegex, val='OrdinalNum'), + ReVal(re=GermanNumeric.OrdinalGermanRegex, val='OrdGer'), + ReVal(re=GermanNumeric.OrdinalRoundNumberRegex, val='OrdGer'), ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/german/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/german/parsers.py index 3a1d243d00..5924d375be 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/german/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/german/parsers.py @@ -1,155 +1,50 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict, Pattern, List +from typing import Dict, List, Optional, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.culture import Culture -from recognizers_text.parser import ParseResult from recognizers_number.culture import CultureInfo -from recognizers_number.number.parsers import NumberParserConfiguration +from recognizers_number.number.parsers import BaseNumberParserConfiguration from recognizers_number.resources.german_numeric import GermanNumeric +from recognizers_text.culture import Culture +from recognizers_text.parser import ParseResult +from recognizers_text.utilities import RegExpUtility -class GermanNumberParserConfiguration(NumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return self._cardinal_number_map - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return self._ordinal_number_map - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self): - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return self._half_a_dozen_regex - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def written_decimal_separator_texts(self) -> List[str]: - return self._written_decimal_separator_texts - - @property - def written_group_separator_texts(self) -> List[str]: - return self._written_group_separator_texts - - @property - def written_integer_separator_texts(self) -> List[str]: - return self._written_integer_separator_texts - - @property - def written_fraction_separator_texts(self) -> List[str]: - return self._written_fraction_separator_texts - - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants +class GermanNumberParserConfiguration(BaseNumberParserConfiguration): - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture + lang_marker: str = GermanNumeric.LangMarker + is_multi_decimal_separator_culture: bool = GermanNumeric.MultiDecimalSeparatorCulture - @property - def round_multiplier_regex(self) -> Pattern: - return self._round_multiplier_regex + decimal_separator_char: str = GermanNumeric.DecimalSeparatorChar + fraction_marker_token: str = GermanNumeric.FractionMarkerToken + non_decimal_separator_char: str = GermanNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = GermanNumeric.HalfADozenText + word_separator_token: str = GermanNumeric.WordSeparatorToken - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.German) + written_decimal_separator_texts: List[str] = GermanNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = GermanNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = GermanNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = GermanNumeric.WrittenFractionSeparatorTexts + non_standard_separator_variants: List[str] = [] - self._culture_info = culture_info - self._lang_marker = GermanNumeric.LangMarker - self._decimal_separator_char = GermanNumeric.DecimalSeparatorChar - self._fraction_marker_token = GermanNumeric.FractionMarkerToken - self._non_decimal_separator_char = GermanNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = GermanNumeric.HalfADozenText - self._word_separator_token = GermanNumeric.WordSeparatorToken - self._non_standard_separator_variants = [] - self._is_multi_decimal_separator_culture = GermanNumeric.MultiDecimalSeparatorCulture + cardinal_number_map: Dict[str, int] = GermanNumeric.CardinalNumberMap + ordinal_number_map: Dict[str, int] = GermanNumeric.OrdinalNumberMap + round_number_map: Dict[str, int] = GermanNumeric.RoundNumberMap - self._written_decimal_separator_texts = GermanNumeric.WrittenDecimalSeparatorTexts - self._written_group_separator_texts = GermanNumeric.WrittenGroupSeparatorTexts - self._written_integer_separator_texts = GermanNumeric.WrittenIntegerSeparatorTexts - self._written_fraction_separator_texts = GermanNumeric.WrittenFractionSeparatorTexts + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanNumeric.DigitalNumberRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanNumeric.RoundMultiplierRegex) + fraction_units_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanNumeric.FractionUnitsRegex) + fraction_half_regex: Pattern = RegExpUtility.get_safe_reg_exp(GermanNumeric.FractionHalfRegex) - self._cardinal_number_map = GermanNumeric.CardinalNumberMap - self._ordinal_number_map = GermanNumeric.OrdinalNumberMap - self._round_number_map = GermanNumeric.RoundNumberMap - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - GermanNumeric.NegativeNumberSignRegex) - self._half_a_dozen_regex = RegExpUtility.get_safe_reg_exp( - GermanNumeric.HalfADozenRegex) - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - GermanNumeric.DigitalNumberRegex) - self._round_multiplier_regex = RegExpUtility.get_safe_reg_exp( - GermanNumeric.RoundMultiplierRegex) - self._fraction_units_regex = RegExpUtility.get_safe_reg_exp( - GermanNumeric.FractionUnitsRegex) - self._fraction_half_regex = RegExpUtility.get_safe_reg_exp( - GermanNumeric.FractionHalfRegex) + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.German) + super().__init__(culture_info) def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: - frac_words: List[str] = list() - tokens_len = len(tokens) - i = 0 - while i < tokens_len: - if '-' in tokens[i]: - splited_tokens = tokens[i].split('-') - if len(splited_tokens) == 2 and splited_tokens[1] in self.ordinal_number_map: - frac_words.append(splited_tokens[0]) - frac_words.append(splited_tokens[1]) - else: - frac_words.append(tokens[i]) - elif i < tokens_len - 2 and tokens[i + 1] == '-': - if tokens[i + 2] in self.ordinal_number_map: - frac_words.append(tokens[i]) - frac_words.append(tokens[i + 2]) - else: - frac_words.append( - tokens[i] + tokens[i + 1] + tokens[i + 2]) - i += 2 - else: - frac_words.append(tokens[i]) - i += 1 + frac_words: List[str] = super().normalize_token_set(tokens, context) # The following piece of code is needed to compute the fraction pattern number+'einhalb' # e.g. 'zweieinhalb' ('two and a half'). @@ -158,38 +53,20 @@ def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[s except ValueError: pass for idx, word in enumerate(frac_words): - if self._fraction_half_regex.search(word): # zweieinhalb, dreienhalb etc. case - frac_words[idx] = word[0:(len(word)-7)] - frac_words.append(self._written_fraction_separator_texts[0]) + if self.fraction_half_regex.search(word): # zweieinhalb, dreienhalb etc. case + frac_words[idx] = word[0 : (len(word) - 7)] + frac_words.append(self.written_fraction_separator_texts[0]) frac_words.append(GermanNumeric.OneHalfTokens[0]) frac_words.append(GermanNumeric.OneHalfTokens[1]) - elif self._fraction_units_regex.search(word): - m = self._fraction_units_regex.search(word) + elif m := self.fraction_units_regex.search(word): if m.group("onehalf"): # 'einundhalb' case frac_words[idx] = GermanNumeric.OneHalfTokens[0] - frac_words.append(self._written_fraction_separator_texts[0]) + frac_words.append(self.written_fraction_separator_texts[0]) frac_words.append(GermanNumeric.OneHalfTokens[0]) frac_words.append(GermanNumeric.OneHalfTokens[1]) if m.group("quarter"): # 'dreiviertal' case - frac_words[idx] = word[0:len("drei")] - frac_words.append(self._written_fraction_separator_texts[0]) - frac_words.append(word[len(frac_words[idx]):len("viertel")+len(frac_words[idx])]) + frac_words[idx] = word[0 : len("drei")] + frac_words.append(self.written_fraction_separator_texts[0]) + frac_words.append(word[len(frac_words[idx]) : len("viertel") + len(frac_words[idx])]) return frac_words - - def resolve_composite_number(self, number_str: str) -> int: - if '-' in number_str: - numbers = number_str.split('-') - ret = 0 - for num in numbers: - if num in self.ordinal_number_map: - ret += self.ordinal_number_map[num] - elif num in self.cardinal_number_map: - ret += self.cardinal_number_map[num] - return ret - elif number_str in self.ordinal_number_map: - return self.ordinal_number_map[number_str] - elif number_str in self.cardinal_number_map: - return self.cardinal_number_map[number_str] - - return 0 diff --git a/Python/libraries/recognizers-number/recognizers_number/number/italian/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/italian/extractors.py index 773c1459de..1316ed3a4f 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/italian/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/italian/extractors.py @@ -1,257 +1,196 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, NamedTuple +from typing import List, Pattern + import regex -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.models import NumberMode, LongFormatMode -from recognizers_number.resources import BaseNumbers -from recognizers_number.resources.italian_numeric import ItalianNumeric -from recognizers_number.number.extractors import ReVal, ReRe, BaseNumberExtractor, BasePercentageExtractor, \ - BaseMergedNumberExtractor from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseMergedNumberExtractor, BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.italian_numeric import ItalianNumeric +from recognizers_text.utilities import RegExpUtility class ItalianNumberExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM + @property def regexes(self) -> List[ReVal]: - return self.__regexes + _regexes: List[ReVal] = [] + cardinal_ex: ItalianCardinalExtractor = None + + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = ItalianCardinalExtractor(ItalianNumeric.PlaceHolderPureNumber) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.CurrencyRegex), val='IntegerNum')) + + cardinal_ex = cardinal_ex or ItalianCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + fraction_ex = ItalianFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes @property def ambiguity_filters_dict(self) -> List[ReRe]: - return self.__ambiguity_filters_dict + _ambiguity_filters_dict: List[ReRe] = [] - @property - def _extract_type(self) -> str: - return Constants.SYS_NUM + if self.mode != NumberMode.Unit: + for key, value in ItalianNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict @property def _negative_number_terms(self) -> Pattern: - return self.__negative_number_terms + return RegExpUtility.get_safe_reg_exp(ItalianNumeric.NegativeNumberTermsRegex) def __init__(self, mode: NumberMode = NumberMode.DEFAULT): - self.__negative_number_terms = RegExpUtility.get_safe_reg_exp( - ItalianNumeric.NegativeNumberTermsRegex) - self.__regexes: List[ReVal] = list() - cardinal_ex: ItalianCardinalExtractor = None - - if mode is NumberMode.PURE_NUMBER: - cardinal_ex = ItalianCardinalExtractor( - ItalianNumeric.PlaceHolderPureNumber) - elif mode is NumberMode.CURRENCY: - self.__regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.CurrencyRegex), val='IntegerNum')) - - if cardinal_ex is None: - cardinal_ex = ItalianCardinalExtractor() - - self.__regexes.extend(cardinal_ex.regexes) - - fraction_ex = ItalianFractionExtractor(mode) - self.__regexes.extend(fraction_ex.regexes) - - ambiguity_filters_dict: List[ReRe] = list() - - if mode != NumberMode.Unit: - for key, value in ItalianNumeric.AmbiguityFiltersDict.items(): - ambiguity_filters_dict.append(ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), - reVal=RegExpUtility.get_safe_reg_exp(value))) - self.__ambiguity_filters_dict = ambiguity_filters_dict + self.mode = mode class ItalianCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return ItalianIntegerExtractor(self.placeholder).regexes + ItalianDoubleExtractor(self.placeholder).regexes def __init__(self, placeholder: str = ItalianNumeric.PlaceHolderDefault): - self.__regexes: List[ReVal] = list() - - # Add integer regexes - integer_ex = ItalianIntegerExtractor(placeholder) - self.__regexes.extend(integer_ex.regexes) - - # Add double regexes - double_ex = ItalianDoubleExtractor(placeholder) - self.__regexes.extend(double_ex.regexes) + self.placeholder = placeholder class ItalianIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER - - def __init__(self, placeholder: str = ItalianNumeric.PlaceHolderDefault): - self.__regexes = [ + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.NumbersWithPlaceHolder(placeholder)), - val='IntegerNum'), + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.NumbersWithPlaceHolder(self.placeholder)), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.NumbersWithSuffix, regex.S), val='IntegerNum'), ReVal( re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.NumbersWithSuffix, regex.S), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_DOT, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_BLANK, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_NO_BREAK_SPACE, placeholder)), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_DOT, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.RoundNumberIntegerRegexWithLocks), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.NumbersWithDozenSuffix), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder) + ), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.RoundNumberIntegerRegexWithLocks), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.NumbersWithDozenSuffix), val='IntegerNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.AllIntRegexWithLocks), - val=f'Integer{ItalianNumeric.LangMarker}'), + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.AllIntRegexWithLocks), + val=f'Integer{ItalianNumeric.LangMarker}', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.AllIntRegexWithDozenSuffixLocks), - val=f'Integer{ItalianNumeric.LangMarker}') + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.AllIntRegexWithDozenSuffixLocks), + val=f'Integer{ItalianNumeric.LangMarker}', + ), ] + def __init__(self, placeholder: str = ItalianNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class ItalianDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE - - def __init__(self, placeholder): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.DoubleDecimalPointRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.DoubleWithoutIntegralRegex(placeholder)), - val='DoubleNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_COMMA_DOT, placeholder)), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.DoubleDecimalPointRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_NO_BREAK_SPACE_DOT, placeholder)), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.DoubleWithoutIntegralRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.DoubleWithMultiplierRegex, regex.S), - val='DoubleNum'), + self._generate_format_regex(LongFormatMode.DOUBLE_COMMA_DOT, self.placeholder) + ), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.DoubleWithRoundNumber), - val='DoubleNum'), + self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_DOT, self.placeholder) + ), + val='DoubleNum', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.DoubleAllFloatRegex), - val=f'Double{ItalianNumeric.LangMarker}'), + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.DoubleWithMultiplierRegex, regex.S), val='DoubleNum' + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.DoubleWithRoundNumber), val='DoubleNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.DoubleExponentialNotationRegex), - val='DoublePow'), + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.DoubleAllFloatRegex), + val=f'Double{ItalianNumeric.LangMarker}', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.DoubleExponentialNotationRegex), val='DoublePow'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.DoubleCaretExponentialNotationRegex), - val='DoublePow') + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.DoubleCaretExponentialNotationRegex), val='DoublePow' + ), ] + def __init__(self, placeholder: str = ItalianNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class ItalianFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self, mode): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.FractionNotationWithSpacesRegex), - val='FracNum'), + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.FractionNotationWithSpacesRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.FractionNotationRegex), val='FracNum'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.FractionNotationRegex), - val='FracNum'), + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.FractionNounRegex), + val=f'Frac{ItalianNumeric.LangMarker}', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.FractionNounRegex), - val=f'Frac{ItalianNumeric.LangMarker}'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.FractionNounWithArticleRegex), - val=f'Frac{ItalianNumeric.LangMarker}') + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.FractionNounWithArticleRegex), + val=f'Frac{ItalianNumeric.LangMarker}', + ), ] - if mode != NumberMode.Unit: - self.__regexes.append( + if self.mode != NumberMode.Unit: + _regexes.append( ReVal( - re=RegExpUtility.get_safe_reg_exp( - ItalianNumeric.FractionPrepositionRegex), - val=f'Frac{ItalianNumeric.LangMarker}')) + re=RegExpUtility.get_safe_reg_exp(ItalianNumeric.FractionPrepositionRegex), + val=f'Frac{ItalianNumeric.LangMarker}', + ) + ) + return _regexes + + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self.mode = mode class ItalianOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ - ReVal( - re=ItalianNumeric.OrdinalSuffixRegex, - val='OrdinalNum'), - ReVal( - re=ItalianNumeric.OrdinalNumericRegex, - val='OrdinalNum'), - ReVal( - re=ItalianNumeric.OrdinalItalianRegex, - val=f'Ord{ItalianNumeric.LangMarker}'), - ReVal( - re=ItalianNumeric.OrdinalRoundNumberRegex, - val=f'Ord{ItalianNumeric.LangMarker}') - ] - - -class ItalianPercentageExtractor(BasePercentageExtractor): - def __init__(self): - super().__init__(ItalianNumberExtractor(NumberMode.DEFAULT)) - - def get_definitions(self) -> List[str]: + def regexes(self) -> List[ReVal]: return [ - ItalianNumeric.NumberWithSuffixPercentage, - ItalianNumeric.NumberWithPrefixPercentage + ReVal(re=ItalianNumeric.OrdinalSuffixRegex, val='OrdinalNum'), + ReVal(re=ItalianNumeric.OrdinalNumericRegex, val='OrdinalNum'), + ReVal(re=ItalianNumeric.OrdinalItalianRegex, val=f'Ord{ItalianNumeric.LangMarker}'), + ReVal(re=ItalianNumeric.OrdinalRoundNumberRegex, val=f'Ord{ItalianNumeric.LangMarker}'), ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/italian/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/italian/parsers.py index ad18d68770..30a0ba3f80 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/italian/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/italian/parsers.py @@ -1,177 +1,59 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict, Pattern, List +from typing import Dict, List, Optional, Pattern -from recognizers_text.utilities import RegExpUtility -from recognizers_text.culture import Culture -from recognizers_text.parser import ParseResult from recognizers_number.culture import CultureInfo -from recognizers_number.number.parsers import NumberParserConfiguration +from recognizers_number.number.parsers import BaseNumberParserConfiguration from recognizers_number.resources.italian_numeric import ItalianNumeric +from recognizers_text.culture import Culture +from recognizers_text.parser import ParseResult +from recognizers_text.utilities import RegExpUtility -class ItalianNumberParserConfiguration(NumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return self._cardinal_number_map - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return self._ordinal_number_map - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self): - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return self._half_a_dozen_regex - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def written_decimal_separator_texts(self) -> List[str]: - return self._written_decimal_separator_texts - - @property - def written_group_separator_texts(self) -> List[str]: - return self._written_group_separator_texts - - @property - def written_integer_separator_texts(self) -> List[str]: - return self._written_integer_separator_texts - - @property - def written_fraction_separator_texts(self) -> List[str]: - return self._written_fraction_separator_texts - - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants +class ItalianNumberParserConfiguration(BaseNumberParserConfiguration): - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture + lang_marker: str = ItalianNumeric.LangMarker + is_multi_decimal_separator_culture: bool = ItalianNumeric.MultiDecimalSeparatorCulture - @property - def round_multiplier_regex(self) -> Pattern: - return self._round_multiplier_regex + decimal_separator_char: str = ItalianNumeric.DecimalSeparatorChar + fraction_marker_token: str = ItalianNumeric.FractionMarkerToken + non_decimal_separator_char: str = ItalianNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = ItalianNumeric.HalfADozenText + word_separator_token: str = ItalianNumeric.WordSeparatorToken - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.Italian) + written_decimal_separator_texts: List[str] = ItalianNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = ItalianNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = ItalianNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = ItalianNumeric.WrittenFractionSeparatorTexts + non_standard_separator_variants: List[str] = [] - self._culture_info = culture_info - self._lang_marker = ItalianNumeric.LangMarker - self._decimal_separator_char = ItalianNumeric.DecimalSeparatorChar - self._fraction_marker_token = ItalianNumeric.FractionMarkerToken - self._non_decimal_separator_char = ItalianNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = ItalianNumeric.HalfADozenText - self._word_separator_token = ItalianNumeric.WordSeparatorToken - self._non_standard_separator_variants = [] - self._is_multi_decimal_separator_culture = ItalianNumeric.MultiDecimalSeparatorCulture + cardinal_number_map: Dict[str, int] = ItalianNumeric.CardinalNumberMap + ordinal_number_map: Dict[str, int] = ItalianNumeric.OrdinalNumberMap + round_number_map: Dict[str, int] = ItalianNumeric.RoundNumberMap - self._written_decimal_separator_texts = ItalianNumeric.WrittenDecimalSeparatorTexts - self._written_group_separator_texts = ItalianNumeric.WrittenGroupSeparatorTexts - self._written_integer_separator_texts = ItalianNumeric.WrittenIntegerSeparatorTexts - self._written_fraction_separator_texts = ItalianNumeric.WrittenFractionSeparatorTexts + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianNumeric.DigitalNumberRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(ItalianNumeric.RoundMultiplierRegex) - self._cardinal_number_map = ItalianNumeric.CardinalNumberMap - self._ordinal_number_map = ItalianNumeric.OrdinalNumberMap - self._round_number_map = ItalianNumeric.RoundNumberMap - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - ItalianNumeric.NegativeNumberSignRegex) - self._half_a_dozen_regex = RegExpUtility.get_safe_reg_exp( - ItalianNumeric.HalfADozenRegex) - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - ItalianNumeric.DigitalNumberRegex) - self._round_multiplier_regex = RegExpUtility.get_safe_reg_exp( - ItalianNumeric.RoundMultiplierRegex) + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.Italian) + super().__init__(culture_info) def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: - frac_words: List[str] = list() - tokens_len = len(tokens) - i = 0 - while i < tokens_len: - if '-' in tokens[i]: - splited_tokens = tokens[i].split('-') - if len(splited_tokens) == 2 and splited_tokens[1] in self.ordinal_number_map: - frac_words.append(splited_tokens[0]) - frac_words.append(splited_tokens[1]) - else: - frac_words.append(tokens[i]) - elif i < tokens_len - 2 and tokens[i + 1] == '-': - if tokens[i + 2] in self.ordinal_number_map: - frac_words.append(tokens[i]) - frac_words.append(tokens[i + 2]) - else: - frac_words.append( - tokens[i] + tokens[i + 1] + tokens[i + 2]) - i += 2 - else: - frac_words.append(tokens[i]) - i += 1 + frac_words: List[str] = super().normalize_token_set(tokens, context) # The following piece of code is needed to compute the fraction pattern number+'e mezzo' # e.g. 'due e mezzo' ('two and a half') where the numerator is omitted in Italian. # It works by inserting the numerator 'un' ('a') in the list frac_words # so that the pattern is correctly processed. if len(frac_words) > 2: - if frac_words[len(frac_words) - 1] == ItalianNumeric.OneHalfTokens[1] and \ - frac_words[len(frac_words) - 2] == ItalianNumeric.WordSeparatorToken: + if ( + frac_words[len(frac_words) - 1] == ItalianNumeric.OneHalfTokens[1] + and frac_words[len(frac_words) - 2] == ItalianNumeric.WordSeparatorToken + ): frac_words[len(frac_words) - 2] = ItalianNumeric.WrittenFractionSeparatorTexts[0] frac_words.insert(len(frac_words) - 1, ItalianNumeric.OneHalfTokens[0]) return frac_words - - def resolve_composite_number(self, number_str: str) -> int: - if '-' in number_str: - numbers = number_str.split('-') - ret = 0 - for num in numbers: - if num in self.ordinal_number_map: - ret += self.ordinal_number_map[num] - elif num in self.cardinal_number_map: - ret += self.cardinal_number_map[num] - return ret - elif number_str in self.ordinal_number_map: - return self.ordinal_number_map[number_str] - elif number_str in self.cardinal_number_map: - return self.cardinal_number_map[number_str] - - return 0 diff --git a/Python/libraries/recognizers-number/recognizers_number/number/japanese/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/japanese/extractors.py index a118498b26..793fe8b1de 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/japanese/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/japanese/extractors.py @@ -1,14 +1,13 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List from enum import Enum +from typing import List -from recognizers_number.number.extractors import ReVal, BaseNumberExtractor -from recognizers_number.number.models import NumberMode -from recognizers_text.utilities import RegExpUtility from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseNumberExtractor, ReVal from recognizers_number.resources.japanese_numeric import JapaneseNumeric +from recognizers_text.utilities import RegExpUtility class JapaneseNumberExtractorMode(Enum): @@ -17,278 +16,107 @@ class JapaneseNumberExtractorMode(Enum): class JapaneseNumberExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM @property - def _extract_type(self) -> str: - return Constants.SYS_NUM + def regexes(self) -> List[ReVal]: + return JapaneseCardinalExtractor(self.mode).regexes + JapaneseFractionExtractor().regexes def __init__(self, mode: JapaneseNumberExtractorMode = JapaneseNumberExtractorMode.DEFAULT): - self.__regexes: List[ReVal] = list() - - cardinal_ex = JapaneseCardinalExtractor(mode) - self.__regexes.extend(cardinal_ex.regexes) - - fraction_ex = JapaneseFractionExtractor() - self.__regexes.extend(fraction_ex.regexes) + self.mode = mode class JapaneseCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return JapaneseIntegerExtractor(self.mode).regexes + JapaneseDoubleExtractor().regexes def __init__(self, mode: JapaneseNumberExtractorMode = JapaneseNumberExtractorMode.DEFAULT): - self.__regexes: List[ReVal] = list() - - integer_ex = JapaneseIntegerExtractor(mode) - self.__regexes.extend(integer_ex.regexes) - - double_ex = JapaneseDoubleExtractor() - self.__regexes.extend(double_ex.regexes) + self.mode = mode class JapaneseIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER - - def __init__(self, mode: JapaneseNumberExtractorMode = JapaneseNumberExtractorMode.DEFAULT): - self.__regexes = [ + def regexes(self) -> List[ReVal]: + _regexes = [ # 123456, -123456 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersSpecialsChars), - val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.NumbersSpecialsChars), val='IntegerNum'), # 15k, 16 G - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersSpecialsCharsWithSuffix), - val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.NumbersSpecialsCharsWithSuffix), val='IntegerNum'), # 1,234, 2,332,111 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DottedNumbersSpecialsChar), - val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DottedNumbersSpecialsChar), val='IntegerNum'), # 半百 半ダース - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersWithHalfDozen), - val='IntegerJpn'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.NumbersWithHalfDozen), val='IntegerJpn'), # 一ダース 五十ダース - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersWithDozen), - val='IntegerJpn') + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.NumbersWithDozen), val='IntegerJpn'), ] - if mode == JapaneseNumberExtractorMode.DEFAULT: - self.__regexes.append( + if self.mode == JapaneseNumberExtractorMode.DEFAULT: + _regexes.append( # 一百五十五, 负一亿三百二十二. Uses an allow list to avoid extracting "西九条" from "九" - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersWithAllowListRegex), - val='IntegerJpn' - ) + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.NumbersWithAllowListRegex), val='IntegerJpn') ) - elif mode == JapaneseNumberExtractorMode.EXTRACT_ALL: - self.__regexes.append( + elif self.mode == JapaneseNumberExtractorMode.EXTRACT_ALL: + _regexes.append( # 一百五十五, 负一亿三百二十二, "西九条" from "九". Uses no allow lists and extracts all potential integers (useful in Units, for example). - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersAggressiveRegex), - val='IntegerJpn' - ) + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.NumbersAggressiveRegex), val='IntegerJpn') ) + return _regexes + + def __init__(self, mode: JapaneseNumberExtractorMode = JapaneseNumberExtractorMode.DEFAULT): + self.mode = mode class JapaneseDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE - - def __init__(self): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DoubleSpecialsChars), - val='DoubleNum'), + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DoubleSpecialsChars), val='DoubleNum'), # (-)2.5, can avoid cases like ip address xx.xx.xx.xx - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DoubleSpecialsCharsWithNegatives), - val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DoubleSpecialsCharsWithNegatives), val='DoubleNum'), # (-).2 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SimpleDoubleSpecialsChars), - val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.SimpleDoubleSpecialsChars), val='DoubleNum'), # 1.0 K - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DoubleWithMultiplierRegex), - val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DoubleWithMultiplierRegex), val='DoubleNum'), # 15.2万 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DoubleWithThousandsRegex), - val='DoubleJpn'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DoubleWithThousandsRegex), val='DoubleJpn'), # 2e6, 21.2e0 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DoubleExponentialNotationRegex), - val='DoublePow'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DoubleExponentialNotationRegex), val='DoublePow'), # 2^5 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DoubleScientificNotationRegex), - val='DoublePow') + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DoubleScientificNotationRegex), val='DoublePow'), ] class JapaneseFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self): - self.__regexes = [ + def regexes(self) -> List[ReVal]: + return [ # -4 5/2, 4 6/3 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.FractionNotationSpecialsCharsRegex), - val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.FractionNotationSpecialsCharsRegex), val='FracNum'), # 8/3 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.FractionNotationRegex), - val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.FractionNotationRegex), val='FracNum'), # 五分の二 七分の三 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.AllFractionNumber), - val='FracJpn') + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.AllFractionNumber), val='FracJpn'), ] class JapaneseOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ + def regexes(self) -> List[ReVal]: + return [ # だい一百五十四 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.OrdinalRegex), - val='OrdinalJpn'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.AllOrdinalRegex), val='OrdinalJpn'), # だい2565 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.OrdinalNumbersRegex), - val='OrdinalJpn'), + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.OrdinalNumbersRegex), val='OrdinalJpn'), # 2折 2.5折 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersFoldsPercentageRegex), - val='OrdinalJpn') - ] - - -class JapanesePercentageExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes - - @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_PERCENTAGE - - def __init__(self): - self.__regexes = [ - # 百パーセント 十五パーセント - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SimplePercentageRegex), - val='PerJpn'), - # 19パーセント 1パーセント - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersPercentagePointRegex), - val='PerNum'), - # 3,000パーセント 1,123パーセント - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersPercentageWithSeparatorRegex), - val='PerNum'), - # 3.2 k パーセント - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersPercentageWithMultiplierRegex), - val='PerNum'), - # 15kパーセント - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SimpleNumbersPercentageWithMultiplierRegex), - val='PerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SimpleIntegerPercentageRegex), - val='PerNum'), - # 2割引 2.5割引 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersFoldsPercentageRegex), - val='PerSpe'), - # 三割引 六点五折 七五折 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.FoldsPercentageRegex), - val='PerSpe'), - # 5割 7割半 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SimpleFoldsPercentageRegex), - val='PerSpe'), - # 七割半 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SpecialsPercentageRegex), - val='PerSpe'), - # 2割 2.5割 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NumbersSpecialsPercentageRegex), - val='PerSpe'), - # 三割 - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SimpleSpecialsPercentageRegex), - val='PerSpe'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SpecialsFoldsPercentageRegex), - val='PerSpe') + ReVal(re=RegExpUtility.get_safe_reg_exp(JapaneseNumeric.NumbersFoldsPercentageRegex), val='OrdinalJpn'), ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/japanese/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/japanese/parsers.py index 323d21d539..34fd8787c4 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/japanese/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/japanese/parsers.py @@ -1,218 +1,64 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List, Dict, Pattern, Optional -from collections import namedtuple -from decimal import Decimal -import copy -import regex +from typing import Dict, List, Optional, Pattern -from recognizers_text.utilities import RegExpUtility +from recognizers_number.culture import CultureInfo +from recognizers_number.number.cjk_parsers import CJKNumberParserConfiguration +from recognizers_number.resources.japanese_numeric import JapaneseNumeric from recognizers_text.culture import Culture -from recognizers_text.extractor import ExtractResult from recognizers_text.parser import ParseResult -from recognizers_number.resources.japanese_numeric import JapaneseNumeric -from recognizers_number.number.cjk_parsers import CJKNumberParserConfiguration -from recognizers_number.number.parsers import BaseNumberParser, NumberParserConfiguration -from recognizers_number.culture import CultureInfo +from recognizers_text.utilities import RegExpUtility class JapaneseNumberParserConfiguration(CJKNumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return dict() - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return dict() - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self) -> CultureInfo: - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return None - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def zero_char(self) -> str: - return self._zero_char - - @property - def pair_char(self) -> str: - return self._pair_char - - @property - def written_decimal_separator_texts(self) -> List[str]: - return list() - - @property - def written_group_separator_texts(self) -> List[str]: - return list() - - @property - def written_integer_separator_texts(self) -> List[str]: - return list() - - @property - def written_fraction_separator_texts(self) -> List[str]: - return list() - - @property - def zero_to_nine_map(self) -> Dict[str, int]: - return self._zero_to_nine_map - - @property - def round_number_map_char(self) -> Dict[str, int]: - return self._round_number_map_char - - @property - def full_to_half_map(self) -> Dict[str, int]: - return self._full_to_half_map - - @property - def trato_sim_map(self) -> Dict[str, int]: - return None - - @property - def unit_map(self) -> Dict[str, int]: - return self._unit_map - - @property - def round_direct_list(self) -> List[str]: - return self._round_direct_list - - @property - def ten_chars(self) -> List[str]: - return self._ten_chars - - @property - def digit_num_regex(self) -> Pattern: - return self._digit_num_regex - - @property - def dozen_regex(self) -> Pattern: - return self._dozen_regex - - @property - def percentage_regex(self) -> Pattern: - return self._percentage_regex - - @property - def double_and_round_regex(self) -> Pattern: - return self._double_and_round_regex - - @property - def frac_split_regex(self) -> Pattern: - return self._frac_split_regex - - @property - def point_regex(self) -> Pattern: - return self._point_regex - - @property - def spe_get_number_regex(self) -> Pattern: - return self._spe_get_number_regex - - @property - def pair_regex(self) -> Pattern: - return self._pair_regex - - @property - def round_number_integer_regex(self) -> Pattern: - return self._round_number_integer_regex - - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants - - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture - - @property - def round_multiplier_regex(self) -> None: - return None - - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.Japanese) - - self._culture_info = culture_info - - self._lang_marker = JapaneseNumeric.LangMarker - self._decimal_separator_char = JapaneseNumeric.DecimalSeparatorChar - self._fraction_marker_token = JapaneseNumeric.FractionMarkerToken - self._non_decimal_separator_char = JapaneseNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = JapaneseNumeric.HalfADozenText - self._word_separator_token = JapaneseNumeric.WordSeparatorToken - self._zero_char = JapaneseNumeric.ZeroChar - self._pair_char = JapaneseNumeric.PairChar - self._non_standard_separator_variants = [] - self._is_multi_decimal_separator_culture = JapaneseNumeric.MultiDecimalSeparatorCulture - - self._round_number_map = JapaneseNumeric.RoundNumberMap - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DigitalNumberRegex) - self._zero_to_nine_map = JapaneseNumeric.ZeroToNineMap - self._round_number_map_char = JapaneseNumeric.RoundNumberMapChar - self._full_to_half_map = JapaneseNumeric.FullToHalfMap - self._unit_map = JapaneseNumeric.UnitMap - self._round_direct_list = JapaneseNumeric.RoundDirectList - self._ten_chars = JapaneseNumeric.TenChars - self._digit_num_regex = JapaneseNumeric.DigitNumRegex - self._dozen_regex = JapaneseNumeric.DozenRegex - self._percentage_regex = JapaneseNumeric.PercentageRegex - self._double_and_round_regex = RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.DoubleAndRoundRegex) - self._frac_split_regex = RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.FracSplitRegex) - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.NegativeNumberSignRegex) - self._point_regex = JapaneseNumeric.PointRegex - self._spe_get_number_regex = RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.SpeGetNumberRegex) - self._pair_regex = RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.PairRegex) - self._round_number_integer_regex = RegExpUtility.get_safe_reg_exp( - JapaneseNumeric.RoundNumberIntegerRegex) + lang_marker: str = JapaneseNumeric.LangMarker + is_multi_decimal_separator_culture: bool = JapaneseNumeric.MultiDecimalSeparatorCulture + + decimal_separator_char: str = JapaneseNumeric.DecimalSeparatorChar + fraction_marker_token: str = JapaneseNumeric.FractionMarkerToken + non_decimal_separator_char: str = JapaneseNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = JapaneseNumeric.HalfADozenText + word_separator_token: str = JapaneseNumeric.WordSeparatorToken + zero_char: str = JapaneseNumeric.ZeroChar + pair_char: str = JapaneseNumeric.PairChar + + written_decimal_separator_texts: List[str] = [] + written_group_separator_texts: List[str] = [] + written_integer_separator_texts: List[str] = [] + written_fraction_separator_texts: List[str] = [] + non_standard_separator_variants: List[str] = [] + + cardinal_number_map: Dict[str, int] = {} + ordinal_number_map: Dict[str, int] = {} + round_number_map: Dict[str, int] = JapaneseNumeric.RoundNumberMap + zero_to_nine_map: Dict[str, int] = JapaneseNumeric.ZeroToNineMap + round_number_map_char: Dict[str, int] = JapaneseNumeric.RoundNumberMapChar + full_to_half_map: Dict[str, str] = JapaneseNumeric.FullToHalfMap + unit_map: Dict[str, str] = JapaneseNumeric.UnitMap + trato_sim_map: Dict[str, int] = None + + round_direct_list: List[str] = JapaneseNumeric.RoundDirectList + ten_chars: List[str] = JapaneseNumeric.TenChars + + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(JapaneseNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Optional[Pattern] = None + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DigitalNumberRegex) + round_multiplier_regex: Optional[Pattern] = None + double_and_round_regex: Pattern = RegExpUtility.get_safe_reg_exp(JapaneseNumeric.DoubleAndRoundRegex) + frac_split_regex: Pattern = RegExpUtility.get_safe_reg_exp(JapaneseNumeric.FracSplitRegex) + point_regex = JapaneseNumeric.PointRegex + spe_get_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(JapaneseNumeric.SpeGetNumberRegex) + pair_regex: Pattern = RegExpUtility.get_safe_reg_exp(JapaneseNumeric.PairRegex) + round_number_integer_regex: Pattern = RegExpUtility.get_safe_reg_exp(JapaneseNumeric.RoundNumberIntegerRegex) + digit_num_regex: str = JapaneseNumeric.DigitNumRegex + dozen_regex: str = JapaneseNumeric.DozenRegex + percentage_regex: str = JapaneseNumeric.PercentageRegex + + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.Japanese) + super().__init__(culture_info) def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: return tokens diff --git a/Python/libraries/recognizers-number/recognizers_number/number/models.py b/Python/libraries/recognizers-number/recognizers_number/number/models.py index ef38904046..17fc1d027a 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/models.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/models.py @@ -2,15 +2,15 @@ # Licensed under the MIT License. from abc import abstractmethod -from typing import List, Optional -from enum import Enum from collections import namedtuple +from enum import Enum +from typing import List, Optional +from recognizers_number.number.constants import Constants from recognizers_text import Model, ModelResult from recognizers_text.extractor import Extractor, ExtractResult from recognizers_text.parser import Parser from recognizers_text.utilities import QueryProcessor -from recognizers_number.number.constants import Constants class NumberMode(Enum): @@ -20,23 +20,21 @@ class NumberMode(Enum): Unit = 3 -LongFormatType = namedtuple( - 'LongFormatType', ['thousands_mark', 'decimals_mark']) +LongFormatType = namedtuple('LongFormatType', ['thousands_mark', 'decimals_mark']) class LongFormatMode: INTEGER_COMMA = LongFormatType(thousands_mark=',', decimals_mark=None) INTEGER_DOT = LongFormatType(thousands_mark='.', decimals_mark=None) INTEGER_BLANK = LongFormatType(thousands_mark=' ', decimals_mark=None) - INTEGER_NO_BREAK_SPACE = LongFormatType( - thousands_mark=Constants.NO_BREAK_SPACE, decimals_mark=None) + INTEGER_NO_BREAK_SPACE = LongFormatType(thousands_mark=Constants.NO_BREAK_SPACE, decimals_mark=None) DOUBLE_COMMA_DOT = LongFormatType(thousands_mark=',', decimals_mark='.') - DOUBLE_NO_BREAK_SPACE_DOT = LongFormatType( - thousands_mark=Constants.NO_BREAK_SPACE, decimals_mark='.') + DOUBLE_NO_BREAK_SPACE_DOT = LongFormatType(thousands_mark=Constants.NO_BREAK_SPACE, decimals_mark='.') DOUBLE_DOT_COMMA = LongFormatType(thousands_mark='.', decimals_mark=',') - DOUBLE_NO_BREAK_SPACE_COMMA = LongFormatType( - thousands_mark=Constants.NO_BREAK_SPACE, decimals_mark=',') + DOUBLE_NO_BREAK_SPACE_COMMA = LongFormatType(thousands_mark=Constants.NO_BREAK_SPACE, decimals_mark=',') + DOUBLE_NO_BREAK_SPACE_DOT = LongFormatType(thousands_mark=Constants.NO_BREAK_SPACE, decimals_mark='.') DOUBLE_NUM_BLANK_COMMA = LongFormatType(thousands_mark=' ', decimals_mark=',') + DOUBLE_NUM_BLANK_DOT = LongFormatType(thousands_mark=' ', decimals_mark='.') class AbstractNumberModel(Model): @@ -85,9 +83,3 @@ class OrdinalModel(AbstractNumberModel): @property def model_type_name(self) -> str: return 'ordinal' - - -class PercentModel(AbstractNumberModel): - @property - def model_type_name(self) -> str: - return 'percentage' diff --git a/Python/libraries/recognizers-number/recognizers_number/number/number_options.py b/Python/libraries/recognizers-number/recognizers_number/number/number_options.py index c5603b3125..a36d4358a1 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/number_options.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/number_options.py @@ -6,7 +6,6 @@ class NumberOptions(IntFlag): NONE = 0 - PERCENTAGE_MODE = 1 SUPPRESS_EXTENDED_TYPES = 2097152 EXPERIMENTAL_MODE = 4194304 ENABLE_PREVIEW = 8388608 diff --git a/Python/libraries/recognizers-number/recognizers_number/number/number_recognizer.py b/Python/libraries/recognizers-number/recognizers_number/number/number_recognizer.py index 403c27f6a4..8c04fab537 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/number_recognizer.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/number_recognizer.py @@ -4,29 +4,32 @@ from enum import IntFlag from typing import List -from recognizers_text import Culture, Recognizer, Model from recognizers_number.culture import CultureInfo -from recognizers_number.number.models import NumberMode, NumberModel, OrdinalModel, PercentModel, ModelResult -from recognizers_number.number.parser_factory import ParserType, AgnosticNumberParserFactory -from recognizers_number.number.english.extractors import EnglishNumberExtractor, EnglishOrdinalExtractor, \ - EnglishPercentageExtractor, EnglishMergedNumberExtractor -from recognizers_number.number.english.parsers import EnglishNumberParserConfiguration -from recognizers_number.number.spanish.extractors import SpanishNumberExtractor, SpanishOrdinalExtractor, SpanishPercentageExtractor -from recognizers_number.number.chinese.extractors import ChineseNumberExtractor, ChineseOrdinalExtractor, ChinesePercentageExtractor +from recognizers_number.number.arabic.extractors import ArabicMergedNumberExtractor, ArabicOrdinalExtractor +from recognizers_number.number.arabic.parsers import ArabicNumberParserConfiguration +from recognizers_number.number.catalan.extractors import CatalanNumberExtractor, CatalanOrdinalExtractor +from recognizers_number.number.catalan.parsers import CatalanNumberParserConfiguration +from recognizers_number.number.chinese.extractors import ChineseNumberExtractor, ChineseOrdinalExtractor from recognizers_number.number.chinese.parsers import ChineseNumberParserConfiguration -from recognizers_number.number.dutch.extractors import DutchOrdinalExtractor, DutchPercentageExtractor, DutchMergedNumberExtractor +from recognizers_number.number.dutch.extractors import DutchMergedNumberExtractor, DutchOrdinalExtractor from recognizers_number.number.dutch.parsers import DutchNumberParserConfiguration -from recognizers_number.number.japanese.extractors import JapaneseNumberExtractor, JapaneseOrdinalExtractor, JapanesePercentageExtractor -from recognizers_number.number.japanese.parsers import JapaneseNumberParserConfiguration -from recognizers_number.number.spanish.parsers import SpanishNumberParserConfiguration -from recognizers_number.number.portuguese.extractors import PortugueseNumberExtractor, PortugueseOrdinalExtractor, PortuguesePercentageExtractor -from recognizers_number.number.portuguese.parsers import PortugueseNumberParserConfiguration -from recognizers_number.number.french.extractors import FrenchNumberExtractor, FrenchOrdinalExtractor, FrenchPercentageExtractor +from recognizers_number.number.english.extractors import EnglishMergedNumberExtractor, EnglishOrdinalExtractor +from recognizers_number.number.english.parsers import EnglishNumberParserConfiguration +from recognizers_number.number.french.extractors import FrenchNumberExtractor, FrenchOrdinalExtractor from recognizers_number.number.french.parsers import FrenchNumberParserConfiguration -from recognizers_number.number.german.extractors import GermanMergedNumberExtractor, GermanOrdinalExtractor, GermanPercentageExtractor +from recognizers_number.number.german.extractors import GermanMergedNumberExtractor, GermanOrdinalExtractor from recognizers_number.number.german.parsers import GermanNumberParserConfiguration -from recognizers_number.number.italian.extractors import ItalianMergedNumberExtractor, ItalianOrdinalExtractor, ItalianPercentageExtractor +from recognizers_number.number.italian.extractors import ItalianMergedNumberExtractor, ItalianOrdinalExtractor from recognizers_number.number.italian.parsers import ItalianNumberParserConfiguration +from recognizers_number.number.japanese.extractors import JapaneseNumberExtractor, JapaneseOrdinalExtractor +from recognizers_number.number.japanese.parsers import JapaneseNumberParserConfiguration +from recognizers_number.number.models import ModelResult, NumberMode, NumberModel, OrdinalModel +from recognizers_number.number.parser_factory import AgnosticNumberParserFactory, ParserType +from recognizers_number.number.portuguese.extractors import PortugueseNumberExtractor, PortugueseOrdinalExtractor +from recognizers_number.number.portuguese.parsers import PortugueseNumberParserConfiguration +from recognizers_number.number.spanish.extractors import SpanishNumberExtractor, SpanishOrdinalExtractor +from recognizers_number.number.spanish.parsers import SpanishNumberParserConfiguration +from recognizers_text import Culture, Model, Recognizer class NumberOptions(IntFlag): @@ -34,190 +37,244 @@ class NumberOptions(IntFlag): class NumberRecognizer(Recognizer[NumberOptions]): - def __init__(self, target_culture: str = None, options: NumberOptions = NumberOptions.NONE, lazy_initialization: bool = True): + def __init__( + self, target_culture: str = None, options: NumberOptions = NumberOptions.NONE, lazy_initialization: bool = True + ): if options < NumberOptions.NONE or options > NumberOptions.NONE: raise ValueError() super().__init__(target_culture, options, lazy_initialization) def initialize_configuration(self): # region English - self.register_model('NumberModel', Culture.English, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, EnglishNumberParserConfiguration()), - EnglishMergedNumberExtractor(NumberMode.PURE_NUMBER) - )) - self.register_model('OrdinalModel', Culture.English, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, EnglishNumberParserConfiguration()), - EnglishOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.English, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, EnglishNumberParserConfiguration()), - EnglishPercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.English, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, EnglishNumberParserConfiguration()), + EnglishMergedNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.English, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, EnglishNumberParserConfiguration()), + EnglishOrdinalExtractor(), + ), + ) # endregion # region German - self.register_model('NumberModel', Culture.German, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, GermanNumberParserConfiguration()), - GermanMergedNumberExtractor(NumberMode.PURE_NUMBER) - )) - self.register_model('OrdinalModel', Culture.German, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, GermanNumberParserConfiguration()), - GermanOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.German, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, GermanNumberParserConfiguration()), - GermanPercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.German, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, GermanNumberParserConfiguration()), + GermanMergedNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.German, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, GermanNumberParserConfiguration()), + GermanOrdinalExtractor(), + ), + ) # endregion # region Dutch - self.register_model('NumberModel', Culture.Dutch, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, DutchNumberParserConfiguration()), - DutchMergedNumberExtractor(NumberMode.PURE_NUMBER) - )) - self.register_model('OrdinalModel', Culture.Dutch, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, DutchNumberParserConfiguration()), - DutchOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.Dutch, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, DutchNumberParserConfiguration()), - DutchPercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.Dutch, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, DutchNumberParserConfiguration()), + DutchMergedNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.Dutch, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, DutchNumberParserConfiguration()), + DutchOrdinalExtractor(), + ), + ) # endregion # region Chinese - self.register_model('NumberModel', Culture.Chinese, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, ChineseNumberParserConfiguration()), - ChineseNumberExtractor() - )) - self.register_model('OrdinalModel', Culture.Chinese, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, ChineseNumberParserConfiguration()), - ChineseOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.Chinese, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, ChineseNumberParserConfiguration()), - ChinesePercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.Chinese, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, ChineseNumberParserConfiguration()), + ChineseNumberExtractor(), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.Chinese, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, ChineseNumberParserConfiguration()), + ChineseOrdinalExtractor(), + ), + ) # endregion # region Japanese - self.register_model('NumberModel', Culture.Japanese, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, JapaneseNumberParserConfiguration()), - JapaneseNumberExtractor() - )) - self.register_model('OrdinalModel', Culture.Japanese, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, JapaneseNumberParserConfiguration()), - JapaneseOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.Japanese, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, JapaneseNumberParserConfiguration()), - JapanesePercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.Japanese, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, JapaneseNumberParserConfiguration()), + JapaneseNumberExtractor(), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.Japanese, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, JapaneseNumberParserConfiguration()), + JapaneseOrdinalExtractor(), + ), + ) # endregion # region Spanish - self.register_model('NumberModel', Culture.Spanish, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, SpanishNumberParserConfiguration()), - SpanishNumberExtractor(NumberMode.PURE_NUMBER) - )) - self.register_model('OrdinalModel', Culture.Spanish, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, SpanishNumberParserConfiguration()), - SpanishOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.Spanish, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, SpanishNumberParserConfiguration()), - SpanishPercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.Spanish, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, SpanishNumberParserConfiguration()), + SpanishNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.Spanish, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, SpanishNumberParserConfiguration()), + SpanishOrdinalExtractor(), + ), + ) # endregion # region Spanish Mexican - self.register_model('NumberModel', Culture.SpanishMexican, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, SpanishNumberParserConfiguration(CultureInfo(Culture.SpanishMexican))), - SpanishNumberExtractor(NumberMode.PURE_NUMBER) - )) - self.register_model('OrdinalModel', Culture.SpanishMexican, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, SpanishNumberParserConfiguration(CultureInfo(Culture.SpanishMexican))), - SpanishOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.SpanishMexican, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, SpanishNumberParserConfiguration(CultureInfo(Culture.SpanishMexican))), - SpanishPercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.SpanishMexican, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser( + ParserType.NUMBER, SpanishNumberParserConfiguration(CultureInfo(Culture.SpanishMexican)) + ), + SpanishNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.SpanishMexican, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser( + ParserType.ORDINAL, SpanishNumberParserConfiguration(CultureInfo(Culture.SpanishMexican)) + ), + SpanishOrdinalExtractor(), + ), + ) # endregion # region Portuguese - self.register_model('NumberModel', Culture.Portuguese, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, PortugueseNumberParserConfiguration()), - PortugueseNumberExtractor(NumberMode.PURE_NUMBER) - )) - self.register_model('OrdinalModel', Culture.Portuguese, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, PortugueseNumberParserConfiguration()), - PortugueseOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.Portuguese, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, PortugueseNumberParserConfiguration()), - PortuguesePercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.Portuguese, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, PortugueseNumberParserConfiguration()), + PortugueseNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.Portuguese, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, PortugueseNumberParserConfiguration()), + PortugueseOrdinalExtractor(), + ), + ) # endregion # region French - self.register_model('NumberModel', Culture.French, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, FrenchNumberParserConfiguration()), - FrenchNumberExtractor(NumberMode.PURE_NUMBER) - )) - self.register_model('OrdinalModel', Culture.French, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, FrenchNumberParserConfiguration()), - FrenchOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.French, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, FrenchNumberParserConfiguration()), - FrenchPercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.French, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, FrenchNumberParserConfiguration()), + FrenchNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.French, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, FrenchNumberParserConfiguration()), + FrenchOrdinalExtractor(), + ), + ) # endregion # region Italian - self.register_model('NumberModel', Culture.Italian, lambda options: NumberModel( - AgnosticNumberParserFactory.get_parser( - ParserType.NUMBER, ItalianNumberParserConfiguration()), - ItalianMergedNumberExtractor(NumberMode.PURE_NUMBER) - )) - self.register_model('OrdinalModel', Culture.Italian, lambda options: OrdinalModel( - AgnosticNumberParserFactory.get_parser( - ParserType.ORDINAL, ItalianNumberParserConfiguration()), - ItalianOrdinalExtractor() - )) - self.register_model('PercentModel', Culture.Italian, lambda options: PercentModel( - AgnosticNumberParserFactory.get_parser( - ParserType.PERCENTAGE, ItalianNumberParserConfiguration()), - ItalianPercentageExtractor() - )) + self.register_model( + 'NumberModel', + Culture.Italian, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, ItalianNumberParserConfiguration()), + ItalianMergedNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.Italian, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, ItalianNumberParserConfiguration()), + ItalianOrdinalExtractor(), + ), + ) + # endregion + + # region Catalan + self.register_model( + 'NumberModel', + Culture.Catalan, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, CatalanNumberParserConfiguration()), + CatalanNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.Catalan, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, CatalanNumberParserConfiguration()), + CatalanOrdinalExtractor(), + ), + ) + # endregion + + # region Arabic + self.register_model( + 'NumberModel', + Culture.Arabic, + lambda options: NumberModel( + AgnosticNumberParserFactory.get_parser(ParserType.NUMBER, ArabicNumberParserConfiguration()), + ArabicMergedNumberExtractor(NumberMode.PURE_NUMBER), + ), + ) + self.register_model( + 'OrdinalModel', + Culture.Arabic, + lambda options: OrdinalModel( + AgnosticNumberParserFactory.get_parser(ParserType.ORDINAL, ArabicNumberParserConfiguration()), + ArabicOrdinalExtractor(), + ), + ) # endregion def get_number_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: @@ -226,24 +283,18 @@ def get_number_model(self, culture: str = None, fallback_to_default_culture: boo def get_ordinal_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: return self.get_model('OrdinalModel', culture, fallback_to_default_culture) - def get_percentage_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: - return self.get_model('PercentModel', culture, fallback_to_default_culture) - -def recognize_number(query: str, culture: str, options: NumberOptions = NumberOptions.NONE, fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_number( + query: str, culture: str, options: NumberOptions = NumberOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = NumberRecognizer(culture, options) model = recognizer.get_number_model(culture, fallback_to_default_culture) return model.parse(query) -def recognize_ordinal(query: str, culture: str, options: NumberOptions = NumberOptions.NONE, fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_ordinal( + query: str, culture: str, options: NumberOptions = NumberOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = NumberRecognizer(culture, options) model = recognizer.get_ordinal_model(culture, fallback_to_default_culture) return model.parse(query) - - -def recognize_percentage(query: str, culture: str, options: NumberOptions = NumberOptions.NONE, fallback_to_default_culture: bool = True) -> List[ModelResult]: - recognizer = NumberRecognizer(culture, options) - model = recognizer.get_percentage_model( - culture, fallback_to_default_culture) - return model.parse(query) diff --git a/Python/libraries/recognizers-number/recognizers_number/number/parser_factory.py b/Python/libraries/recognizers-number/recognizers_number/number/parser_factory.py index ca0e077557..207ceb35af 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/parser_factory.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/parser_factory.py @@ -3,11 +3,11 @@ from enum import Enum -from recognizers_number.number.parsers import NumberParserConfiguration, BaseNumberParser, BasePercentageParser -from recognizers_number.number.constants import Constants -from recognizers_number.number.cjk_parsers import CJKNumberParser from recognizers_number.number.chinese.parsers import ChineseNumberParserConfiguration +from recognizers_number.number.cjk_parsers import CJKNumberParser +from recognizers_number.number.constants import Constants from recognizers_number.number.japanese.parsers import JapaneseNumberParserConfiguration +from recognizers_number.number.parsers import BaseNumberParser, NumberParserConfiguration class ParserType(Enum): @@ -17,7 +17,6 @@ class ParserType(Enum): FRACTION = 3 INTEGER = 4 ORDINAL = 5 - PERCENTAGE = 6 class AgnosticNumberParserFactory: @@ -26,8 +25,7 @@ def get_parser(parser_type: ParserType, language_config: NumberParserConfigurati parser = BaseNumberParser(language_config) chinese = isinstance(language_config, ChineseNumberParserConfiguration) - japanese = isinstance( - language_config, JapaneseNumberParserConfiguration) + japanese = isinstance(language_config, JapaneseNumberParserConfiguration) if chinese: parser = CJKNumberParser(language_config) @@ -35,11 +33,7 @@ def get_parser(parser_type: ParserType, language_config: NumberParserConfigurati parser = CJKNumberParser(language_config) if parser_type is ParserType.CARDINAL: - parser.supported_types = [ - Constants.SYS_NUM_CARDINAL, - Constants.SYS_NUM_INTEGER, - Constants.SYS_NUM_DOUBLE - ] + parser.supported_types = [Constants.SYS_NUM_CARDINAL, Constants.SYS_NUM_INTEGER, Constants.SYS_NUM_DOUBLE] elif parser_type is ParserType.DOUBLE: parser.supported_types = [Constants.SYS_NUM_DOUBLE] elif parser_type is ParserType.FRACTION: @@ -48,7 +42,5 @@ def get_parser(parser_type: ParserType, language_config: NumberParserConfigurati parser.supported_types = [Constants.SYS_NUM_INTEGER] elif parser_type is ParserType.ORDINAL: parser.supported_types = [Constants.SYS_NUM_ORDINAL] - elif parser_type is ParserType.PERCENTAGE and not chinese: - parser = BasePercentageParser(language_config) return parser diff --git a/Python/libraries/recognizers-number/recognizers_number/number/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/parsers.py index ea2573e297..69373d7a57 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/parsers.py @@ -1,130 +1,110 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import sys -from abc import ABC, abstractmethod -from typing import Dict, Pattern, Optional, List from decimal import Decimal, getcontext +from typing import Dict, List, Optional, Pattern + import regex -from recognizers_text.culture import Culture -from recognizers_text.utilities import RegExpUtility -from recognizers_text.extractor import ExtractResult -from recognizers_text.parser import Parser, ParseResult -from recognizers_text.meta_data import MetaData + from recognizers_number.culture import CultureInfo from recognizers_number.number.constants import Constants from recognizers_number.number.utilities import precision +from recognizers_text.culture import Culture +from recognizers_text.extractor import ExtractResult +from recognizers_text.meta_data import MetaData +from recognizers_text.parser import Parser, ParseResult +from recognizers_text.utilities import RegExpUtility -class NumberParserConfiguration(ABC): - @property - @abstractmethod - def cardinal_number_map(self) -> Dict[str, int]: - pass - - @property - @abstractmethod - def ordinal_number_map(self) -> Dict[str, int]: - pass - - @property - @abstractmethod - def round_number_map(self) -> Dict[str, int]: - pass +class NumberParserConfiguration: - @property - @abstractmethod - def culture_info(self) -> CultureInfo: - pass + culture_info: CultureInfo + lang_marker: str + is_multi_decimal_separator_culture: bool - @property - @abstractmethod - def digital_number_regex(self) -> Pattern: - pass + decimal_separator_char: str + fraction_marker_token: str + non_decimal_separator_char: str + half_a_dozen_text: str + word_separator_token: str + non_standard_separator_variants: List[str] - @property - @abstractmethod - def fraction_marker_token(self) -> str: - pass + written_decimal_separator_texts: List[str] + written_group_separator_texts: List[str] + written_integer_separator_texts: List[str] + written_fraction_separator_texts: List[str] - @property - @abstractmethod - def negative_number_sign_regex(self) -> Pattern: - pass + cardinal_number_map: Dict[str, int] + ordinal_number_map: Dict[str, int] + round_number_map: Dict[str, int] - @property - @abstractmethod - def half_a_dozen_regex(self) -> Pattern: - pass + half_a_dozen_regex: Pattern + digital_number_regex: Pattern + negative_number_sign_regex: Pattern + round_multiplier_regex: Pattern - @property - @abstractmethod - def half_a_dozen_text(self) -> str: + def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: pass - @property - @abstractmethod - def lang_marker(self) -> str: + def resolve_composite_number(self, number_str: str) -> int: pass - @property - @abstractmethod - def non_decimal_separator_char(self) -> str: + def get_lang_specific_int_value(self, match_strs: List[str]): pass - @property - @abstractmethod - def decimal_separator_char(self) -> str: - pass + def __init__(self, culture_info: Optional[CultureInfo] = None): + self.culture_info = culture_info - @property - @abstractmethod - def word_separator_token(self) -> str: - pass - @property - @abstractmethod - def written_decimal_separator_texts(self) -> List[str]: - pass +class BaseNumberParserConfiguration(NumberParserConfiguration): - @property - @abstractmethod - def written_group_separator_texts(self) -> List[str]: - pass + def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: + frac_words: List[str] = [] + tokens_len = len(tokens) + i = 0 + while i < tokens_len: + if '-' in tokens[i]: + split_tokens = tokens[i].split('-') + if len(split_tokens) == 2 and split_tokens[1] in self.ordinal_number_map: + frac_words.append(split_tokens[0]) + frac_words.append(split_tokens[1]) + else: + frac_words.append(tokens[i]) + elif i < tokens_len - 2 and tokens[i + 1] == '-': + if tokens[i + 2] in self.ordinal_number_map: + frac_words.append(tokens[i]) + frac_words.append(tokens[i + 2]) + else: + frac_words.append(tokens[i] + tokens[i + 1] + tokens[i + 2]) + i += 2 + else: + frac_words.append(tokens[i]) + i += 1 - @property - @abstractmethod - def written_integer_separator_texts(self) -> List[str]: - pass + return frac_words - @property - @abstractmethod - def written_fraction_separator_texts(self) -> List[str]: - pass + def resolve_composite_number(self, number_str: str) -> int: + if "-" in number_str: + numbers = number_str.split('-') + ret = 0 + for number in numbers: + if number in self.ordinal_number_map: + ret += self.ordinal_number_map[number] + elif number in self.cardinal_number_map: + ret += self.cardinal_number_map[number] - @property - @abstractmethod - def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: - pass + return ret - @property - @abstractmethod - def resolve_composite_number(self, number_str: str) -> int: - pass + if number_str in self.ordinal_number_map: + return self.ordinal_number_map[number_str] - @property - @abstractmethod - def non_standard_separator_variants(self) -> List[str]: - pass + if number_str in self.cardinal_number_map: + return self.cardinal_number_map[number_str] - @property - @abstractmethod - def is_multi_decimal_separator_culture(self) -> bool: - pass + return 0 - @property - @abstractmethod - def round_multiplier_regex(self) -> Pattern: - pass + def get_lang_specific_int_value(self, match_strs: List[str]) -> (bool, int): + return False, 0 class BaseNumberParser(Parser): @@ -134,12 +114,11 @@ def __init__(self, config: NumberParserConfiguration): single_int_frac = f'{self.config.word_separator_token}| -|{self._get_key_regex(self.config.cardinal_number_map.keys())}|{self._get_key_regex(self.config.ordinal_number_map.keys())}|\\d+' self.text_number_regex: Pattern = self._get_text_number_regex(single_int_frac) - self.arabic_number_regex: Pattern = RegExpUtility.get_safe_reg_exp( - r'\d+', flags=regex.I | regex.S) - self.round_number_set: List[str] = list( - self.config.round_number_map.keys()) - self.is_non_standard_separator_variant = self.config.culture_info.code in \ - self.config.non_standard_separator_variants + self.arabic_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(r'\d+', flags=regex.I | regex.S) + self.round_number_set: List[str] = list(self.config.round_number_map.keys()) + self.is_non_standard_separator_variant = ( + self.config.culture_info.code in self.config.non_standard_separator_variants + ) def parse(self, source: ExtractResult) -> Optional[ParseResult]: # Check if the parser is configured to support specific types @@ -155,12 +134,11 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: # Resolve symbol prefix is_negative = False - match_negative = regex.search( - self.config.negative_number_sign_regex, source.text) + match_negative = regex.search(self.config.negative_number_sign_regex, source.text) if match_negative: is_negative = True - source.text = source.text[len(match_negative[1]):] + source.text = source.text[len(match_negative[1]) :] if isinstance(source.data, List): ers = source.data @@ -172,8 +150,9 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: for idx in range(len(inner_prs)): val += inner_prs[idx].value - if (idx + 1 >= len(inner_prs)) or not self.__is_mergeable(float(str(inner_prs[idx].value)), - float(str(inner_prs[idx + 1].value))): + if (idx + 1 >= len(inner_prs)) or not self.__is_mergeable( + float(str(inner_prs[idx].value)), float(str(inner_prs[idx + 1].value)) + ): start = ers[idx - count].start length = ers[idx].start + ers[idx].length - start @@ -181,7 +160,7 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: parsed_result.start = start parsed_result.length = length parsed_result.value = val - parsed_result.text = source.text[start - source.start:length] + parsed_result.text = source.text[start - source.start : length] parsed_result.type = source.type parsed_result.data = None @@ -220,8 +199,9 @@ def parse(self, source: ExtractResult) -> Optional[ParseResult]: ret.text = match_negative[1] + source.text ret.value = ret.value * -1 # Use culture_info to format values - ret.resolution_str = self.config.culture_info.format( - ret.value) if self.config.culture_info is not None else repr(ret.value) + ret.resolution_str = ( + self.config.culture_info.format(ret.value) if self.config.culture_info is not None else repr(ret.value) + ) ret.resolution_str = self._get_resolution_string(ret.value) ret.text = ret.text.lower() @@ -255,8 +235,7 @@ def _digit_number_parse(self, ext_result: ExtractResult) -> ParseResult: start_index = 0 handle = ext_result.text.lower() - matches = list(regex.finditer( - self.config.digital_number_regex, handle)) + matches = list(regex.finditer(self.config.digital_number_regex, handle)) if matches: for match in matches: rep = self.config.round_number_map.get(match.group()) @@ -267,7 +246,7 @@ def _digit_number_parse(self, ext_result: ExtractResult) -> ParseResult: while tmp_index >= 0: front = handle[0:tmp_index].rstrip() start_index = len(front) - handle = front + handle[tmp_index + len(match):] + handle = front + handle[tmp_index + len(match) :] tmp_index = handle.find(match.group(), start_index) # Scale used in the calculate of double @@ -290,12 +269,17 @@ def _frac_like_number_parse(self, ext_result: ExtractResult) -> ParseResult: if regex.search(self.config.fraction_marker_token, result_text): over_index = result_text.find(self.config.fraction_marker_token) small_part = result_text[0:over_index].strip() - big_part = result_text[over_index + - len(self.config.fraction_marker_token):len(result_text)].strip() - small_value = self._get_digital_value(small_part, 1) if self._is_digit( - small_part[0]) else self.__get_int_value(self.__get_matches(small_part)) - big_value = self._get_digital_value(big_part, 1) if self._is_digit( - big_part[0]) else self.__get_int_value(self.__get_matches(big_part)) + big_part = result_text[over_index + len(self.config.fraction_marker_token) : len(result_text)].strip() + small_value = ( + self._get_digital_value(small_part, 1) + if self._is_digit(small_part[0]) + else self.__get_int_value(self.__get_matches(small_part)) + ) + big_value = ( + self._get_digital_value(big_part, 1) + if self._is_digit(big_part[0]) + else self.__get_int_value(self.__get_matches(big_part)) + ) result.value = small_value / big_value else: @@ -313,8 +297,7 @@ def _frac_like_number_parse(self, ext_result: ExtractResult) -> ParseResult: # Split fraction with integer split_index = len(frac_words) - 1 - current_value = self.config.resolve_composite_number( - frac_words[split_index]) + current_value = self.config.resolve_composite_number(frac_words[split_index]) round_value = 1 # for case like "half" @@ -323,22 +306,24 @@ def _frac_like_number_parse(self, ext_result: ExtractResult) -> ParseResult: return result for split_index in range(len(frac_words) - 2, -1, -1): - if (frac_words[split_index] in self.config.written_fraction_separator_texts - or frac_words[split_index] in self.config.written_integer_separator_texts): + if ( + frac_words[split_index] in self.config.written_fraction_separator_texts + or frac_words[split_index] in self.config.written_integer_separator_texts + ): continue previous_value = current_value - current_value = self.config.resolve_composite_number( - frac_words[split_index]) + current_value = self.config.resolve_composite_number(frac_words[split_index]) sm_hundreds = 100 # previous: hundred # current: one - if ((previous_value >= sm_hundreds and previous_value > current_value) - or (previous_value < sm_hundreds and self.__is_composable(current_value, previous_value))): - if (previous_value < sm_hundreds and current_value >= round_value): + if (previous_value >= sm_hundreds and previous_value > current_value) or ( + previous_value < sm_hundreds and self.__is_composable(current_value, previous_value) + ): + if previous_value < sm_hundreds and current_value >= round_value: round_value = current_value - elif (previous_value < sm_hundreds and current_value < round_value): + elif previous_value < sm_hundreds and current_value < round_value: split_index += 1 break @@ -349,10 +334,11 @@ def _frac_like_number_parse(self, ext_result: ExtractResult) -> ParseResult: while split_index <= len(frac_words) - 2: # e.g. one hundred thousand # frac[i+1] % 100 and frac[i] % 100 = 0 - if (self.config.resolve_composite_number(frac_words[split_index]) >= sm_hundreds - and not frac_words[split_index + 1] in self.config.written_fraction_separator_texts - and self.config.resolve_composite_number( - frac_words[split_index + 1]) < sm_hundreds): + if ( + self.config.resolve_composite_number(frac_words[split_index]) >= sm_hundreds + and frac_words[split_index + 1] not in self.config.written_fraction_separator_texts + and self.config.resolve_composite_number(frac_words[split_index + 1]) < sm_hundreds + ): split_index += 1 break split_index += 1 @@ -381,10 +367,9 @@ def _frac_like_number_parse(self, ext_result: ExtractResult) -> ParseResult: mixed_index = len(frac_words) for i in range(len(frac_words) - 1, -1, -1): - if (i < len(frac_words) - 1 and frac_words[i] in self.config.written_fraction_separator_texts): - numer_str = ' '.join(frac_words[i + 1:len(frac_words)]) - numer_value = self.__get_int_value( - self.__get_matches(numer_str)) + if i < len(frac_words) - 1 and frac_words[i] in self.config.written_fraction_separator_texts: + numer_str = ' '.join(frac_words[i + 1 : len(frac_words)]) + numer_value = self.__get_int_value(self.__get_matches(numer_str)) mixed_index = i + 1 break @@ -393,8 +378,11 @@ def _frac_like_number_parse(self, ext_result: ExtractResult) -> ParseResult: # Find mixed number if mixed_index != len(frac_words) and numer_value < denomi_value: - result.value = (int_value + (numer_value / denomi_value)) * multiplier if is_fraction_multiplier else \ - int_value + (multiplier * numer_value / denomi_value) + result.value = ( + (int_value + (numer_value / denomi_value)) * multiplier + if is_fraction_multiplier + else int_value + (multiplier * numer_value / denomi_value) + ) else: result.value = multiplier * (int_value + numer_value) / denomi_value @@ -405,23 +393,25 @@ def _frac_like_number_parse(self, ext_result: ExtractResult) -> ParseResult: def _text_number_parse(self, ext_result: ExtractResult) -> ParseResult: result = ParseResult(ext_result) - handle = regex.sub(self.config.half_a_dozen_regex, - self.config.half_a_dozen_text, ext_result.text.lower()) - num_group = self.__split_multi(handle, list( - filter(lambda x: x is not None, self.config.written_decimal_separator_texts))) + handle = regex.sub(self.config.half_a_dozen_regex, self.config.half_a_dozen_text, ext_result.text.lower()) + num_group = self.__split_multi( + handle, list(filter(lambda x: x is not None, self.config.written_decimal_separator_texts)) + ) int_part = num_group[0] - matches = list(map(lambda x: x.group().lower(), list(regex.finditer( - self.text_number_regex, int_part)))) if int_part else list() + matches = ( + list(map(lambda x: x.group().lower(), list(regex.finditer(self.text_number_regex, int_part)))) + if int_part + else list() + ) int_part_real = self.__get_int_value(matches) point_part_real = Decimal(0) if len(num_group) == 2: point_part = num_group[1] - matches = list(map(lambda x: x.group().lower(), list( - regex.finditer(self.text_number_regex, point_part)))) + matches = list(map(lambda x: x.group().lower(), list(regex.finditer(self.text_number_regex, point_part)))) point_part_real += self.__get_point_value(matches) result.value = int_part_real + Decimal(point_part_real) @@ -445,7 +435,9 @@ def _power_number_parse(self, ext_result: ExtractResult) -> ParseResult: for i in range(len(handle)): c = handle[i] if c in ['^', 'E']: - if negative: + if tmp == 0: + call_stack.append(Decimal('0')) + elif negative: call_stack.append(-tmp) else: call_stack.append(tmp) @@ -474,7 +466,10 @@ def _power_number_parse(self, ext_result: ExtractResult) -> ParseResult: result_value = 0 a = Decimal(call_stack.pop(0)) b = Decimal(call_stack.pop(0)) - if exponent: + + if a == Decimal('0'): + result_value = Decimal('0') + elif exponent: result_value = getcontext().multiply(a, getcontext().power(Decimal(10), b)) else: result_value = getcontext().power(a, b) @@ -496,8 +491,12 @@ def __get_matches(self, source: str) -> List[str]: return list(filter(None, map(lambda m: m.group().lower(), matches))) def __is_mergeable(self, former: float, later: float) -> bool: - return (abs(former % 1) < sys.float_info.epsilon) and (abs(later % 1) < sys.float_info.epsilon) and \ - former > later > 0 and len(str(int(former))) > len(str(int(later))) + return ( + (abs(former % 1) < sys.float_info.epsilon) + and (abs(later % 1) < sys.float_info.epsilon) + and former > later > 0 + and len(str(int(former))) > len(str(int(later))) + ) # Test if big and combine with small. # e.g. 'hundred' can combine with 'thirty' but 'twenty' can't combine with 'thirty'. @@ -506,6 +505,10 @@ def __is_composable(self, big: int, small: int) -> bool: return big % base_num == 0 and big / base_num >= 1 def __get_int_value(self, matches: List[str]) -> Decimal: + special_case, value = self.config.get_lang_specific_int_value(matches) + if special_case: + return value + is_end = [False] * len(matches) tmp_val = 0 @@ -527,11 +530,9 @@ def __get_int_value(self, matches: List[str]) -> Decimal: cardinal = match in self.config.cardinal_number_map ordinal = match in self.config.ordinal_number_map if cardinal or ordinal: - match_value = self.config.cardinal_number_map.get( - match, None) + match_value = self.config.cardinal_number_map.get(match, None) if match_value is None: - match_value = self.config.ordinal_number_map.get( - match, None) + match_value = self.config.ordinal_number_map.get(match, None) # This is just for ordinal now. Not for fraction ever. if ordinal: @@ -578,15 +579,13 @@ def __get_int_value(self, matches: List[str]) -> Decimal: mul_value = self.config.round_number_map[matches[i]] part_value = 1 if i != 0: - part_value = self.__get_int_value( - matches[last_index:i]) + part_value = self.__get_int_value(matches[last_index:i]) tmp_val += mul_value * part_value last_index = i + 1 # Calculate the part like 'thirty-one' mul_value = 1 if last_index != len(is_end): - part_value = self.__get_int_value( - matches[last_index:len(is_end)]) + part_value = self.__get_int_value(matches[last_index : len(is_end)]) tmp_val += mul_value * part_value return Decimal(tmp_val) @@ -600,14 +599,14 @@ def __get_point_value(self, matches: List[str]) -> Decimal: else: scale = Decimal(0.1) for match in matches: - result += scale * \ - Decimal(self.config.cardinal_number_map[match]) + result += scale * Decimal(self.config.cardinal_number_map[match]) scale *= Decimal(0.1) return result - def __skip_non_decimal_separator(self, ch: str, distance_end, distance_start, - has_single_separator, prev_char, non_decimal_separator) -> bool: + def __skip_non_decimal_separator( + self, ch: str, distance_end, distance_start, has_single_separator, prev_char, non_decimal_separator + ) -> bool: result = False decimal_length: int = 1 + 3 @@ -660,14 +659,16 @@ def _get_digital_value(self, digits_str: str, power: int) -> Decimal: if first_non_decimal_separator == sys.maxsize: first_non_decimal_separator = i - if (((last_decimal_separator < 0 <= last_non_decimal_separator) or ( - last_non_decimal_separator < 0 <= last_decimal_separator)) - and first_non_decimal_separator == last_non_decimal_separator): + if ( + (last_decimal_separator < 0 <= last_non_decimal_separator) + or (last_non_decimal_separator < 0 <= last_decimal_separator) + ) and first_non_decimal_separator == last_non_decimal_separator: has_single_separator = True - elif ((last_decimal_separator < last_non_decimal_separator) and - not (last_decimal_separator == -1 or last_non_decimal_separator == -1)): + elif (last_decimal_separator < last_non_decimal_separator) and not ( + last_decimal_separator == -1 or last_non_decimal_separator == -1 + ): temp_sep = decimal_separator decimal_separator = non_decimal_separator @@ -680,7 +681,8 @@ def _get_digital_value(self, digits_str: str, power: int) -> Decimal: prev_char = digits_str[i - 1] if i > 0 else '\0' skippable_non_decimal = self.__skip_non_decimal_separator( - c, str_length - i, i, has_single_separator, prev_char, non_decimal_separator) + c, str_length - i, i, has_single_separator, prev_char, non_decimal_separator + ) index += 1 if not fraction and (c == ' ' or c == Constants.NO_BREAK_SPACE or skippable_non_decimal): @@ -695,7 +697,11 @@ def _get_digital_value(self, digits_str: str, power: int) -> Decimal: scale = getcontext().multiply(scale, Decimal(0.1)) else: tmp = getcontext().add(getcontext().multiply(tmp, scale), Decimal(c)) - elif c == decimal_separator or (not skippable_non_decimal and c == non_decimal_separator): + elif ( + c == decimal_separator + or (not skippable_non_decimal and c == non_decimal_separator) + or c in self.config.written_decimal_separator_texts + ): has_decimal_separator = True scale = Decimal(0.1) elif c == '-': @@ -719,31 +725,12 @@ def _get_digital_value(self, digits_str: str, power: int) -> Decimal: def _get_text_number_regex(self, single_int_frac: str) -> Pattern: culture_code = self.config.culture_info.code - source = fr'(?=\b)({single_int_frac})(?=\b)' + source = fr'(?<=\b)({single_int_frac})(?=\b)' if culture_code in (Culture.Italian, Culture.German, Culture.Dutch): source = fr'((?=\b)({single_int_frac})(?=\b))|({single_int_frac})' + elif culture_code in (Culture.Arabic,): + source = f'((?<=\\b)|(?<=و))({single_int_frac})(?=\\b)' pattern = RegExpUtility.get_safe_reg_exp(source, flags=regex.I | regex.S) return pattern - - -class BasePercentageParser(BaseNumberParser): - def parse(self, source: ExtractResult) -> Optional[ParseResult]: - original = source.text - - # do replace text & data from extended info - if isinstance(source.data, list): - source.text = source.data[0] - source.data = source.data[1].data - - result: ParseResult = super().parse(source) - - if not result.resolution_str is None and result.resolution_str: - if not result.resolution_str.strip().endswith('%'): - result.resolution_str = result.resolution_str.strip() + '%' - - result.data = source.text - result.text = original - - return result diff --git a/Python/libraries/recognizers-number/recognizers_number/number/portuguese/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/portuguese/extractors.py index c369193b11..3945d7f143 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/portuguese/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/portuguese/extractors.py @@ -1,248 +1,177 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +from typing import List, Optional, Pattern + import regex -from typing import Pattern, List, NamedTuple -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.models import NumberMode, LongFormatMode -from recognizers_number.resources import BaseNumbers -from recognizers_number.resources.portuguese_numeric import PortugueseNumeric -from recognizers_number.number.extractors import ReVal, ReRe, BaseNumberExtractor, BasePercentageExtractor from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.portuguese_numeric import PortugueseNumeric +from recognizers_text.utilities import RegExpUtility class PortugueseNumberExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM + @property def regexes(self) -> List[ReVal]: - return self.__regexes + _regexes: List[ReVal] = [] + cardinal_ex: Optional[PortugueseCardinalExtractor] = None - @property - def ambiguity_filters_dict(self) -> List[ReRe]: - return self.__ambiguity_filters_dict + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = PortugueseCardinalExtractor(PortugueseNumeric.PlaceHolderPureNumber) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.CurrencyRegex), val='IntegerNum')) + + cardinal_ex = cardinal_ex or PortugueseCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + fraction_ex = PortugueseFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes @property - def _extract_type(self) -> str: - return Constants.SYS_NUM + def ambiguity_filters_dict(self) -> List[ReRe]: + _ambiguity_filters_dict: List[ReRe] = list() + if self.mode != NumberMode.Unit: + for key, value in PortugueseNumeric.AmbiguityFiltersDict.items(): + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict @property def _negative_number_terms(self) -> Pattern: - return self.__negative_number_terms + return RegExpUtility.get_safe_reg_exp(PortugueseNumeric.NegativeNumberTermsRegex) def __init__(self, mode: NumberMode = NumberMode.DEFAULT): - self.__negative_number_terms = RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.NegativeNumberTermsRegex) - self.__regexes: List[ReVal] = list() - cardinal_ex: PortugueseCardinalExtractor = None - - if mode is NumberMode.PURE_NUMBER: - cardinal_ex = PortugueseCardinalExtractor( - PortugueseNumeric.PlaceHolderPureNumber) - elif mode is NumberMode.CURRENCY: - self.__regexes.append(ReVal(re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.CurrencyRegex), val='IntegerNum')) - - if cardinal_ex is None: - cardinal_ex = PortugueseCardinalExtractor() - - self.__regexes.extend(cardinal_ex.regexes) - - fraction_ex = PortugueseFractionExtractor(mode) - self.__regexes.extend(fraction_ex.regexes) - - ambiguity_filters_dict: List[ReRe] = list() - - if mode != NumberMode.Unit: - for key, value in PortugueseNumeric.AmbiguityFiltersDict.items(): - ambiguity_filters_dict.append(ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), - reVal=RegExpUtility.get_safe_reg_exp(value))) - self.__ambiguity_filters_dict = ambiguity_filters_dict + self.mode = mode class PortugueseCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return ( + PortugueseIntegerExtractor(self.placeholder).regexes + PortugueseDoubleExtractor(self.placeholder).regexes + ) def __init__(self, placeholder: str = PortugueseNumeric.PlaceHolderDefault): - self.__regexes: List[ReVal] = list() - - # Add integer regexes - integer_ex = PortugueseIntegerExtractor(placeholder) - self.__regexes.extend(integer_ex.regexes) - - # Add double regexes - double_ex = PortugueseDoubleExtractor(placeholder) - self.__regexes.extend(double_ex.regexes) + self.placeholder = placeholder class PortugueseIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER - - def __init__(self, placeholder: str = PortugueseNumeric.PlaceHolderDefault): - self.__regexes = [ + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.NumbersWithPlaceHolder(placeholder)), - val='IntegerNum'), + re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.NumbersWithPlaceHolder(self.placeholder)), + val='IntegerNum', + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.NumbersWithSuffix, regex.S), val='IntegerNum'), ReVal( re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.NumbersWithSuffix, regex.S), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_DOT, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_BLANK, placeholder)), - val='IntegerNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.INTEGER_NO_BREAK_SPACE, placeholder)), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_DOT, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.RoundNumberIntegerRegexWithLocks), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder) + ), + val='IntegerNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.NumbersWithDozenSuffix), - val='IntegerNum'), + self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder) + ), + val='IntegerNum', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.AllIntRegexWithLocks), - val='IntegerPor'), + re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.RoundNumberIntegerRegexWithLocks), val='IntegerNum' + ), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.NumbersWithDozenSuffix), val='IntegerNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.AllIntRegexWithLocks), val='IntegerPor'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.AllIntRegexWithDozenSuffixLocks), - val='IntegerPor') + re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.AllIntRegexWithDozenSuffixLocks), val='IntegerPor' + ), ] + def __init__(self, placeholder: str = PortugueseNumeric.PlaceHolderDefault): + self.placeholder = placeholder -class PortugueseDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes +class PortugueseDoubleExtractor(BaseNumberExtractor): + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE - - def __init__(self, placeholder): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.DoubleDecimalPointRegex(placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.DoubleWithoutIntegralRegex(placeholder)), - val='DoubleNum'), + def regexes(self) -> List[ReVal]: + return [ ReVal( - re=PortugueseNumeric.DoubleWithMultiplierRegex, - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.DoubleDecimalPointRegex(self.placeholder)), + val='DoubleNum', + ), ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.DoubleWithRoundNumber), - val='DoubleNum'), + re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.DoubleWithoutIntegralRegex(self.placeholder)), + val='DoubleNum', + ), + ReVal(re=PortugueseNumeric.DoubleWithMultiplierRegex, val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.DoubleWithRoundNumber), val='DoubleNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.DoubleAllFloatRegex), val='DoublePor'), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.DoubleExponentialNotationRegex), val='DoublePow'), ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.DoubleAllFloatRegex), - val='DoublePor'), + re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.DoubleCaretExponentialNotationRegex), + val='DoublePow', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.DoubleExponentialNotationRegex), - val='DoublePow'), + self._generate_format_regex(LongFormatMode.DOUBLE_DOT_COMMA, self.placeholder) + ), + val='DoubleNum', + ), ReVal( re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.DoubleCaretExponentialNotationRegex), - val='DoublePow'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_DOT_COMMA, placeholder)), - val='DoubleNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp(self._generate_format_regex( - LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, placeholder)), - val='DoubleNum') + self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, self.placeholder) + ), + val='DoubleNum', + ), ] + def __init__(self, placeholder: str = PortugueseNumeric.PlaceHolderDefault): + self.placeholder = placeholder + class PortugueseFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self, mode): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.FractionNotationWithSpacesRegex), - val='FracNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.FractionNotationRegex), - val='FracNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.FractionNounRegex), - val='FracPor'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.FractionNounWithArticleRegex), - val='FracPor') + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.FractionNotationWithSpacesRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.FractionNotationRegex), val='FracNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.FractionNounRegex), val='FracPor'), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.FractionNounWithArticleRegex), val='FracPor'), ] + if self.mode != NumberMode.Unit: + _regexes.append( + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.FractionPrepositionRegex), val='FracPor') + ) + return _regexes - if mode != NumberMode.Unit: - self.__regexes.append(ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.FractionPrepositionRegex), - val='FracPor')) + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self.mode = mode class PortugueseOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ - ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.OrdinalSuffixRegex), - val='OrdinalNum'), - ReVal( - re=RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.OrdinalEnglishRegex), - val='OrdinalPor') - ] - - -class PortuguesePercentageExtractor(BasePercentageExtractor): - def __init__(self): - super().__init__(PortugueseNumberExtractor(NumberMode.DEFAULT)) - - def get_definitions(self) -> List[str]: + def regexes(self) -> List[ReVal]: return [ - PortugueseNumeric.NumberWithSuffixPercentage + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.OrdinalSuffixRegex), val='OrdinalNum'), + ReVal(re=RegExpUtility.get_safe_reg_exp(PortugueseNumeric.OrdinalEnglishRegex), val='OrdinalPor'), ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/portuguese/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/portuguese/parsers.py index eda1f9a5a3..2069b96bfa 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/portuguese/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/portuguese/parsers.py @@ -1,128 +1,47 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict, Pattern, List +from typing import Dict, List, Optional, Pattern + import regex -from recognizers_text.utilities import RegExpUtility -from recognizers_text.culture import Culture -from recognizers_text.parser import ParseResult from recognizers_number.culture import CultureInfo -from recognizers_number.number.parsers import NumberParserConfiguration +from recognizers_number.number.parsers import BaseNumberParserConfiguration from recognizers_number.resources.portuguese_numeric import PortugueseNumeric +from recognizers_text.culture import Culture +from recognizers_text.parser import ParseResult +from recognizers_text.utilities import RegExpUtility + + +class PortugueseNumberParserConfiguration(BaseNumberParserConfiguration): + + lang_marker: str = PortugueseNumeric.LangMarker + is_multi_decimal_separator_culture: bool = PortugueseNumeric.MultiDecimalSeparatorCulture + + decimal_separator_char: str = PortugueseNumeric.DecimalSeparatorChar + fraction_marker_token: str = PortugueseNumeric.FractionMarkerToken + non_decimal_separator_char: str = PortugueseNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = PortugueseNumeric.HalfADozenText + word_separator_token: str = PortugueseNumeric.WordSeparatorToken + + written_decimal_separator_texts: List[str] = PortugueseNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = PortugueseNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = PortugueseNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = PortugueseNumeric.WrittenFractionSeparatorTexts + non_standard_separator_variants: List[str] = [] + + cardinal_number_map: Dict[str, int] = PortugueseNumeric.CardinalNumberMap + ordinal_number_map: Dict[str, int] = PortugueseNumeric.OrdinalNumberMap + round_number_map: Dict[str, int] = PortugueseNumeric.RoundNumberMap + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseNumeric.DigitalNumberRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(PortugueseNumeric.RoundMultiplierRegex) -class PortugueseNumberParserConfiguration(NumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return self._cardinal_number_map - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return self._ordinal_number_map - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self): - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return self._half_a_dozen_regex - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def written_decimal_separator_texts(self) -> List[str]: - return self._written_decimal_separator_texts - - @property - def written_group_separator_texts(self) -> List[str]: - return self._written_group_separator_texts - - @property - def written_integer_separator_texts(self) -> List[str]: - return self._written_integer_separator_texts - - @property - def written_fraction_separator_texts(self) -> List[str]: - return self._written_fraction_separator_texts - - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants - - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture - - @property - def round_multiplier_regex(self) -> Pattern: - return self._round_multiplier_regex - - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.Portuguese) - - self._culture_info = culture_info - self._lang_marker = PortugueseNumeric.LangMarker - self._decimal_separator_char = PortugueseNumeric.DecimalSeparatorChar - self._fraction_marker_token = PortugueseNumeric.FractionMarkerToken - self._non_decimal_separator_char = PortugueseNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = PortugueseNumeric.HalfADozenText - self._word_separator_token = PortugueseNumeric.WordSeparatorToken - self._non_standard_separator_variants = [] - self._is_multi_decimal_separator_culture = PortugueseNumeric.MultiDecimalSeparatorCulture - - self._written_decimal_separator_texts = PortugueseNumeric.WrittenDecimalSeparatorTexts - self._written_group_separator_texts = PortugueseNumeric.WrittenGroupSeparatorTexts - self._written_integer_separator_texts = PortugueseNumeric.WrittenIntegerSeparatorTexts - self._written_fraction_separator_texts = PortugueseNumeric.WrittenFractionSeparatorTexts - - self._cardinal_number_map = PortugueseNumeric.CardinalNumberMap - self._ordinal_number_map = PortugueseNumeric.OrdinalNumberMap - self._round_number_map = PortugueseNumeric.RoundNumberMap - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.NegativeNumberSignRegex) - self._half_a_dozen_regex = RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.HalfADozenRegex) - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.DigitalNumberRegex) - self._round_multiplier_regex = RegExpUtility.get_safe_reg_exp( - PortugueseNumeric.RoundMultiplierRegex) + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.Portuguese) + super().__init__(culture_info) def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: result = [] @@ -137,14 +56,14 @@ def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[s if any(suffix for suffix in PortugueseNumeric.WrittenFractionSuffix if temp_word.endswith(suffix)): orig_temp_word = temp_word new_length = len(orig_temp_word) - temp_word = orig_temp_word[0:new_length - 3] + temp_word = orig_temp_word[0 : new_length - 3] if not temp_word: break elif temp_word in self.cardinal_number_map: result.append(temp_word) break else: - temp_word = orig_temp_word[0:new_length - 2] + temp_word = orig_temp_word[0 : new_length - 2] if temp_word in self.cardinal_number_map: result.append(temp_word) break @@ -155,8 +74,10 @@ def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[s # It works by inserting the numerator 'um' ('a') in the list result # so that the pattern is correctly processed. if len(result) > 2: - if result[len(result) - 1] == PortugueseNumeric.OneHalfTokens[1] and \ - result[len(result) - 2] == PortugueseNumeric.WordSeparatorToken: + if ( + result[len(result) - 1] == PortugueseNumeric.OneHalfTokens[1] + and result[len(result) - 2] == PortugueseNumeric.WordSeparatorToken + ): result[len(result) - 2] = PortugueseNumeric.WrittenFractionSeparatorTexts[0] result.insert(len(result) - 1, PortugueseNumeric.OneHalfTokens[0]) diff --git a/Python/libraries/recognizers-number/recognizers_number/number/spanish/extractors.py b/Python/libraries/recognizers-number/recognizers_number/number/spanish/extractors.py index 6a46e106db..6004940a86 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/spanish/extractors.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/spanish/extractors.py @@ -1,227 +1,132 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Pattern, List, NamedTuple +from typing import List -from recognizers_text.utilities import RegExpUtility -from recognizers_number.number.models import NumberMode, LongFormatMode -from recognizers_number.resources import BaseNumbers -from recognizers_number.resources.spanish_numeric import SpanishNumeric -from recognizers_number.number.extractors import ReVal, ReRe, BaseNumberExtractor, BasePercentageExtractor from recognizers_number.number.constants import Constants +from recognizers_number.number.extractors import BaseNumberExtractor, ReRe, ReVal +from recognizers_number.number.models import LongFormatMode, NumberMode +from recognizers_number.resources.spanish_numeric import SpanishNumeric +from recognizers_text.utilities import RegExpUtility class SpanishNumberExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes - - @property - def ambiguity_filters_dict(self) -> List[ReRe]: - return self.__ambiguity_filters_dict + extract_type: str = Constants.SYS_NUM @property - def _extract_type(self) -> str: - return Constants.SYS_NUM - - def __init__(self, mode: NumberMode = NumberMode.DEFAULT): - self.__regexes: List[ReVal] = list() + def regexes(self) -> List[ReVal]: + _regexes: List[ReVal] = [] cardinal_ex: SpanishCardinalExtractor = None - if mode is NumberMode.PURE_NUMBER: - cardinal_ex = SpanishCardinalExtractor( - SpanishNumeric.PlaceHolderPureNumber) - elif mode is NumberMode.CURRENCY: - self.__regexes.append( - ReVal(re=SpanishNumeric.CurrencyRegex, val='IntegerNum')) - - if cardinal_ex is None: - cardinal_ex = SpanishCardinalExtractor() - - self.__regexes.extend(cardinal_ex.regexes) + if self.mode is NumberMode.PURE_NUMBER: + cardinal_ex = SpanishCardinalExtractor(SpanishNumeric.PlaceHolderPureNumber) + elif self.mode is NumberMode.CURRENCY: + _regexes.append(ReVal(re=SpanishNumeric.CurrencyRegex, val='IntegerNum')) - fraction_ex = SpanishFractionExtractor(mode) - self.__regexes.extend(fraction_ex.regexes) + cardinal_ex = cardinal_ex or SpanishCardinalExtractor() + _regexes.extend(cardinal_ex.regexes) + fraction_ex = SpanishFractionExtractor(self.mode) + _regexes.extend(fraction_ex.regexes) + return _regexes - ambiguity_filters_dict: List[ReRe] = list() - - if mode != NumberMode.Unit: + @property + def ambiguity_filters_dict(self) -> List[ReRe]: + _ambiguity_filters_dict: List[ReRe] = list() + if self.mode != NumberMode.Unit: for key, value in SpanishNumeric.AmbiguityFiltersDict.items(): - ambiguity_filters_dict.append(ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), - reVal=RegExpUtility.get_safe_reg_exp(value))) - self.__ambiguity_filters_dict = ambiguity_filters_dict + _ambiguity_filters_dict.append( + ReRe(reKey=RegExpUtility.get_safe_reg_exp(key), reVal=RegExpUtility.get_safe_reg_exp(value)) + ) + return _ambiguity_filters_dict + + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self.mode = mode class SpanishCardinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ReVal]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_CARDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_CARDINAL + def regexes(self) -> List[ReVal]: + return SpanishIntegerExtractor(self.placeholder).regexes + SpanishDoubleExtractor(self.placeholder).regexes def __init__(self, placeholder: str = SpanishNumeric.PlaceHolderDefault): - self.__regexes: List[ReVal] = list() - - # Add integer regexes - integer_ex = SpanishIntegerExtractor(placeholder) - self.__regexes.extend(integer_ex.regexes) - - # Add double regexes - double_ex = SpanishDoubleExtractor(placeholder) - self.__regexes.extend(double_ex.regexes) + self.placeholder = placeholder class SpanishIntegerExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ - NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_INTEGER @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_INTEGER + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=SpanishNumeric.NumbersWithPlaceHolder(self.placeholder), val='IntegerNum'), + ReVal(re=SpanishNumeric.NumbersWithSuffix, val='IntegerNum'), + ReVal(re=self._generate_format_regex(LongFormatMode.INTEGER_DOT, self.placeholder), val='IntegerNum'), + ReVal(re=self._generate_format_regex(LongFormatMode.INTEGER_BLANK, self.placeholder), val='IntegerNum'), + ReVal( + re=self._generate_format_regex(LongFormatMode.INTEGER_NO_BREAK_SPACE, self.placeholder), + val='IntegerNum', + ), + ReVal(re=SpanishNumeric.RoundNumberIntegerRegexWithLocks, val='IntegerNum'), + ReVal(re=SpanishNumeric.NumbersWithDozenSuffix, val='IntegerNum'), + ReVal(re=SpanishNumeric.AllIntRegexWithLocks, val='IntegerSpa'), + ReVal(re=SpanishNumeric.AllIntRegexWithDozenSuffixLocks, val='IntegerSpa'), + ] def __init__(self, placeholder: str = SpanishNumeric.PlaceHolderDefault): - self.__regexes = [ - ReVal( - re=SpanishNumeric.NumbersWithPlaceHolder(placeholder), - val='IntegerNum'), - ReVal( - re=SpanishNumeric.NumbersWithSuffix, - val='IntegerNum'), - ReVal( - re=self._generate_format_regex(LongFormatMode.INTEGER_DOT, - placeholder), - val='IntegerNum'), - ReVal( - re=self._generate_format_regex(LongFormatMode.INTEGER_BLANK, - placeholder), - val='IntegerNum'), - ReVal( - re=self._generate_format_regex( - LongFormatMode.INTEGER_NO_BREAK_SPACE, placeholder), - val='IntegerNum'), - ReVal( - re=SpanishNumeric.RoundNumberIntegerRegexWithLocks, - val='IntegerNum'), - ReVal( - re=SpanishNumeric.NumbersWithDozenSuffix, - val='IntegerNum'), - ReVal( - re=SpanishNumeric.AllIntRegexWithLocks, - val='IntegerSpa'), - ReVal( - re=SpanishNumeric.AllIntRegexWithDozenSuffixLocks, - val='IntegerSpa') - ] + self.placeholder = placeholder class SpanishDoubleExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ - NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_DOUBLE @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_DOUBLE + def regexes(self) -> List[ReVal]: + return [ + ReVal(re=SpanishNumeric.DoubleDecimalPointRegex(self.placeholder), val='DoubleNum'), + ReVal(re=SpanishNumeric.DoubleWithoutIntegralRegex(self.placeholder), val='DoubleNum'), + ReVal(re=SpanishNumeric.DoubleWithMultiplierRegex, val='DoubleNum'), + ReVal(re=SpanishNumeric.DoubleWithRoundNumber, val='DoubleNum'), + ReVal(re=SpanishNumeric.DoubleAllFloatRegex, val='DoubleSpa'), + ReVal(re=SpanishNumeric.DoubleExponentialNotationRegex, val='DoublePow'), + ReVal(re=SpanishNumeric.DoubleCaretExponentialNotationRegex, val='DoublePow'), + ReVal(re=self._generate_format_regex(LongFormatMode.DOUBLE_DOT_COMMA, self.placeholder), val='DoubleNum'), + ReVal( + re=self._generate_format_regex(LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, self.placeholder), + val='DoubleNum', + ), + ] def __init__(self, placeholder: str = SpanishNumeric.PlaceHolderDefault): - self.__regexes = [ - ReVal( - re=SpanishNumeric.DoubleDecimalPointRegex(placeholder), - val='DoubleNum'), - ReVal( - re=SpanishNumeric.DoubleWithoutIntegralRegex(placeholder), - val='DoubleNum'), - ReVal( - re=SpanishNumeric.DoubleWithMultiplierRegex, - val='DoubleNum'), - ReVal( - re=SpanishNumeric.DoubleWithRoundNumber, - val='DoubleNum'), - ReVal( - re=SpanishNumeric.DoubleAllFloatRegex, - val='DoubleSpa'), - ReVal( - re=SpanishNumeric.DoubleExponentialNotationRegex, - val='DoublePow'), - ReVal( - re=SpanishNumeric.DoubleCaretExponentialNotationRegex, - val='DoublePow'), - ReVal( - re=self._generate_format_regex(LongFormatMode.DOUBLE_DOT_COMMA, - placeholder), - val='DoubleNum'), - ReVal( - re=self._generate_format_regex( - LongFormatMode.DOUBLE_NO_BREAK_SPACE_COMMA, - placeholder), - val='DoubleNum') - ] + self.placeholder = placeholder class SpanishFractionExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ - NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_FRACTION @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_FRACTION - - def __init__(self, mode): - self.__regexes = [ - ReVal( - re=SpanishNumeric.FractionNotationRegex, - val='FracNum'), - ReVal( - re=SpanishNumeric.FractionNotationWithSpacesRegex, - val='FracNum'), - ReVal( - re=SpanishNumeric.FractionNounRegex, - val='FracSpa'), - ReVal( - re=SpanishNumeric.FractionNounWithArticleRegex, - val='FracSpa') + def regexes(self) -> List[ReVal]: + _regexes = [ + ReVal(re=SpanishNumeric.FractionNotationRegex, val='FracNum'), + ReVal(re=SpanishNumeric.FractionNotationWithSpacesRegex, val='FracNum'), + ReVal(re=SpanishNumeric.FractionNounRegex, val='FracSpa'), + ReVal(re=SpanishNumeric.FractionNounWithArticleRegex, val='FracSpa'), ] + if self.mode != NumberMode.Unit: + _regexes.append(ReVal(re=SpanishNumeric.FractionPrepositionRegex, val='FracSpa')) + return _regexes - if mode != NumberMode.Unit: - self.__regexes.append( - ReVal( - re=SpanishNumeric.FractionPrepositionRegex, - val='FracSpa')) + def __init__(self, mode: NumberMode = NumberMode.DEFAULT): + self.mode = mode class SpanishOrdinalExtractor(BaseNumberExtractor): - @property - def regexes(self) -> List[ - NamedTuple('re_val', [('re', Pattern), ('val', str)])]: - return self.__regexes + extract_type: str = Constants.SYS_NUM_ORDINAL @property - def _extract_type(self) -> str: - return Constants.SYS_NUM_ORDINAL - - def __init__(self): - self.__regexes = [ - ReVal( - re=SpanishNumeric.OrdinalSuffixRegex, - val='OrdinalNum'), - ReVal( - re=SpanishNumeric.OrdinalNounRegex, - val='OrdSpa') - ] - - -class SpanishPercentageExtractor(BasePercentageExtractor): - def __init__(self): - super().__init__(SpanishNumberExtractor()) - - def get_definitions(self) -> List[str]: + def regexes(self) -> List[ReVal]: return [ - SpanishNumeric.NumberWithPrefixPercentage + ReVal(re=SpanishNumeric.OrdinalSuffixRegex, val='OrdinalNum'), + ReVal(re=SpanishNumeric.OrdinalNounRegex, val='OrdSpa'), ] diff --git a/Python/libraries/recognizers-number/recognizers_number/number/spanish/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/spanish/parsers.py index 9179a7ce2c..bc4fec8808 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/spanish/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/spanish/parsers.py @@ -1,137 +1,57 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict, Pattern, List +from typing import Dict, List, Optional, Pattern + import regex -from recognizers_text.utilities import RegExpUtility -from recognizers_text.culture import Culture -from recognizers_text.parser import ParseResult from recognizers_number.culture import CultureInfo -from recognizers_number.number.parsers import NumberParserConfiguration +from recognizers_number.number.parsers import BaseNumberParserConfiguration from recognizers_number.resources.spanish_numeric import SpanishNumeric +from recognizers_text.culture import Culture +from recognizers_text.parser import ParseResult +from recognizers_text.utilities import RegExpUtility -class SpanishNumberParserConfiguration(NumberParserConfiguration): - @property - def cardinal_number_map(self) -> Dict[str, int]: - return self._cardinal_number_map - - @property - def ordinal_number_map(self) -> Dict[str, int]: - return self._ordinal_number_map - - @property - def round_number_map(self) -> Dict[str, int]: - return self._round_number_map - - @property - def culture_info(self): - return self._culture_info - - @property - def digital_number_regex(self) -> Pattern: - return self._digital_number_regex - - @property - def fraction_marker_token(self) -> str: - return self._fraction_marker_token - - @property - def negative_number_sign_regex(self) -> Pattern: - return self._negative_number_sign_regex - - @property - def half_a_dozen_regex(self) -> Pattern: - return self._half_a_dozen_regex - - @property - def half_a_dozen_text(self) -> str: - return self._half_a_dozen_text - - @property - def lang_marker(self) -> str: - return self._lang_marker - - @property - def non_decimal_separator_char(self) -> str: - return self._non_decimal_separator_char - - @property - def decimal_separator_char(self) -> str: - return self._decimal_separator_char - - @property - def word_separator_token(self) -> str: - return self._word_separator_token - - @property - def written_decimal_separator_texts(self) -> List[str]: - return self._written_decimal_separator_texts +class SpanishNumberParserConfiguration(BaseNumberParserConfiguration): - @property - def written_group_separator_texts(self) -> List[str]: - return self._written_group_separator_texts + lang_marker: str = SpanishNumeric.LangMarker + is_multi_decimal_separator_culture: bool = SpanishNumeric.MultiDecimalSeparatorCulture - @property - def written_integer_separator_texts(self) -> List[str]: - return self._written_integer_separator_texts + decimal_separator_char: str = SpanishNumeric.DecimalSeparatorChar + fraction_marker_token: str = SpanishNumeric.FractionMarkerToken + non_decimal_separator_char: str = SpanishNumeric.NonDecimalSeparatorChar + half_a_dozen_text: str = SpanishNumeric.HalfADozenText + word_separator_token: str = SpanishNumeric.WordSeparatorToken - @property - def written_fraction_separator_texts(self) -> List[str]: - return self._written_fraction_separator_texts + written_decimal_separator_texts: List[str] = SpanishNumeric.WrittenDecimalSeparatorTexts + written_group_separator_texts: List[str] = SpanishNumeric.WrittenGroupSeparatorTexts + written_integer_separator_texts: List[str] = SpanishNumeric.WrittenIntegerSeparatorTexts + written_fraction_separator_texts: List[str] = SpanishNumeric.WrittenFractionSeparatorTexts + non_standard_separator_variants: List[str] = SpanishNumeric.NonStandardSeparatorVariants - @property - def non_standard_separator_variants(self) -> List[str]: - return self._non_standard_separator_variants + cardinal_number_map: Dict[str, int] = SpanishNumeric.CardinalNumberMap + round_number_map: Dict[str, int] = SpanishNumeric.RoundNumberMap - @property - def is_multi_decimal_separator_culture(self) -> bool: - return self._is_multi_decimal_separator_culture + negative_number_sign_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishNumeric.NegativeNumberSignRegex) + half_a_dozen_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishNumeric.HalfADozenRegex) + digital_number_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishNumeric.DigitalNumberRegex) + round_multiplier_regex: Pattern = RegExpUtility.get_safe_reg_exp(SpanishNumeric.RoundMultiplierRegex) @property - def round_multiplier_regex(self) -> Pattern: - return self._round_multiplier_regex - - def __init__(self, culture_info=None): - if culture_info is None: - culture_info = CultureInfo(Culture.Spanish) - - self._culture_info = culture_info - self._lang_marker = SpanishNumeric.LangMarker - self._decimal_separator_char = SpanishNumeric.DecimalSeparatorChar - self._fraction_marker_token = SpanishNumeric.FractionMarkerToken - self._non_decimal_separator_char = SpanishNumeric.NonDecimalSeparatorChar - self._half_a_dozen_text = SpanishNumeric.HalfADozenText - self._word_separator_token = SpanishNumeric.WordSeparatorToken - - self._written_decimal_separator_texts = SpanishNumeric.WrittenDecimalSeparatorTexts - self._written_group_separator_texts = SpanishNumeric.WrittenGroupSeparatorTexts - self._written_integer_separator_texts = SpanishNumeric.WrittenIntegerSeparatorTexts - self._written_fraction_separator_texts = SpanishNumeric.WrittenFractionSeparatorTexts - self._non_standard_separator_variants = SpanishNumeric.NonStandardSeparatorVariants - self._is_multi_decimal_separator_culture = SpanishNumeric.MultiDecimalSeparatorCulture - - ordinal_number_map: Dict[str, int] = dict( - SpanishNumeric.OrdinalNumberMap) + def ordinal_number_map(self) -> Dict[str, int]: + _ordinal_number_map: Dict[str, int] = SpanishNumeric.OrdinalNumberMap for prefix_key in SpanishNumeric.PrefixCardinalMap: for suffix_key in SpanishNumeric.SuffixOrdinalMap: - if not prefix_key+suffix_key in ordinal_number_map: + if prefix_key + suffix_key not in _ordinal_number_map: prefix_value = SpanishNumeric.PrefixCardinalMap[prefix_key] suffix_value = SpanishNumeric.SuffixOrdinalMap[suffix_key] - ordinal_number_map[prefix_key + - suffix_key] = prefix_value*suffix_value - self._cardinal_number_map = SpanishNumeric.CardinalNumberMap - self._ordinal_number_map = ordinal_number_map - self._round_number_map = SpanishNumeric.RoundNumberMap - self._negative_number_sign_regex = RegExpUtility.get_safe_reg_exp( - SpanishNumeric.NegativeNumberSignRegex) - self._half_a_dozen_regex = RegExpUtility.get_safe_reg_exp( - SpanishNumeric.HalfADozenRegex) - self._digital_number_regex = RegExpUtility.get_safe_reg_exp( - SpanishNumeric.DigitalNumberRegex) - self._round_multiplier_regex = RegExpUtility.get_safe_reg_exp( - SpanishNumeric.RoundMultiplierRegex) + _ordinal_number_map[prefix_key + suffix_key] = prefix_value * suffix_value + return _ordinal_number_map + + def __init__(self, culture_info: Optional[CultureInfo] = None): + culture_info = culture_info or CultureInfo(Culture.Spanish) + super().__init__(culture_info) def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[str]: result: List[str] = list() @@ -144,12 +64,12 @@ def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[s if temp_word.endswith('avo') or temp_word.endswith('ava'): oringinal_temp_word = temp_word new_length = len(temp_word) - temp_word = oringinal_temp_word[0:new_length-3] + temp_word = oringinal_temp_word[0 : new_length - 3] if temp_word in self.cardinal_number_map: result.append(temp_word) continue else: - temp_word = oringinal_temp_word[0:new_length-2] + temp_word = oringinal_temp_word[0 : new_length - 2] if temp_word in self.cardinal_number_map: result.append(temp_word) continue @@ -160,8 +80,10 @@ def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[s # It works by inserting the numerator 'un' ('a') in the list result # so that the pattern is correctly processed. if len(result) > 2: - if result[len(result) - 1] == SpanishNumeric.OneHalfTokens[1] and \ - result[len(result) - 2] == SpanishNumeric.WordSeparatorToken: + if ( + result[len(result) - 1] == SpanishNumeric.OneHalfTokens[1] + and result[len(result) - 2] == SpanishNumeric.WordSeparatorToken + ): result[len(result) - 2] = SpanishNumeric.WrittenFractionSeparatorTexts[0] result.insert(len(result) - 1, SpanishNumeric.OneHalfTokens[0]) @@ -182,11 +104,10 @@ def resolve_composite_number(self, number_str: str) -> int: i = 0 while i < number_str_len: str_builder += number_str[i] - if (str_builder in self.cardinal_number_map and - self.cardinal_number_map[str_builder] > 0): + if str_builder in self.cardinal_number_map and self.cardinal_number_map[str_builder] > 0: last_good_char = i value = self.cardinal_number_map[str_builder] - if i+1 == number_str_len: + if i + 1 == number_str_len: final_value += value str_builder = '' last_good_char += 1 diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/__init__.py b/Python/libraries/recognizers-number/recognizers_number/resources/__init__.py index 392efc1765..c288dd0c96 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/__init__.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/__init__.py @@ -2,12 +2,13 @@ # Licensed under the MIT License. from .base_numbers import BaseNumbers +from .catalan_numeric import CatalanNumeric from .chinese_numeric import ChineseNumeric +from .dutch_numeric import DutchNumeric from .english_numeric import EnglishNumeric +from .french_numeric import FrenchNumeric from .german_numeric import GermanNumeric -from .dutch_numeric import DutchNumeric from .italian_numeric import ItalianNumeric -from .french_numeric import FrenchNumeric +from .japanese_numeric import JapaneseNumeric from .portuguese_numeric import PortugueseNumeric from .spanish_numeric import SpanishNumeric -from .japanese_numeric import JapaneseNumeric diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/arabic_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/arabic_numeric.py new file mode 100644 index 0000000000..cdfb7de798 --- /dev/null +++ b/Python/libraries/recognizers-number/recognizers_number/resources/arabic_numeric.py @@ -0,0 +1,574 @@ +# ------------------------------------------------------------------------------ +# +# This code was generated by a tool. +# Changes to this file may cause incorrect behavior and will be lost if +# the code is regenerated. +# +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +# ------------------------------------------------------------------------------ + +from .base_numbers import BaseNumbers + + +# pylint: disable=line-too-long + + +class ArabicNumeric: + LangMarker = 'Ara' + CompoundNumberLanguage = False + MultiDecimalSeparatorCulture = True + ArabicAndRegex = '(و\\s?)?' + RoundNumberIntegerRegex = '(?:الفا|أحد عشر|ألفاً|الاف|الدستات|الاثنين|الاثنان|الصفر|التريليون|المليار|وتسعمائة|وثمانمائة|وسبعمائة|وستمائة|وخمسمائة|وأربعمائة|أربعمائة|وثلاثمائة|ومائتان|وثلاثون|اثنى عشر|إحدى عشر|ألفان|ثمانمائة|ثلاثمائة|ومائة|المليون|مليونًا|مائتان|مائة|مائتين|ثلاثمائه|أربعة مئة|خمسمائة|ستمائة|سبعمائة|ثمان مائة|تسعمائة|تريليون|ترليون|آلاف|تريليونين|تريليونات|مليار|ملياري|مليارات|مليون|مليونان|ملايين|ألف|مليونين|ألفين|مئة|الف|ومائتين|الفين|بألفي|بألفين|مئتان|الآف)' + ZeroToNineIntegerRegex = '(وخمسة|و خمسة|بإثنان|وواحد|و واحد|واحد|وأربعة|و أربعة|واثنان|اثنان|إثنان|وثلاثة|و ثلاثة|ثلاثة|واربعة|أربع|أربعة|خمسة|وستة|و ستة|بستة|ستة|وسبعة|و سبعة|سبعة|وثمانية|و ثمانية|ثمانية|ثمانٍ|وتسعة|و تسعة|تسع|أحد|اثني|إثني|ثلاث|صفر|سبع|ست|اربع|أربع|السادس|الثامنة|تسعة|اثنين|واحدُ|وإثنين|وواحدُ|الواحد:?)' + TwoToNineIntegerRegex = '(?:ثلاث|ثلاثة|سبعة|ثمان|ثمانية|أربع|أربعة|خمسة|تسعة|اثنان|اثنتان|اثنين|اثتنين|اثنتان|إثنان|إثنتان|إثنين|إثتنين|إثنتان|ست|بستة|ستة)' + NegativeNumberTermsRegex = '(?(سالب|ناقص)(\\s+)?)' + NegativeNumberSignRegex = f'^{NegativeNumberTermsRegex}.*' + AnIntRegex = '(واحد|أحد)(?=\\s)' + TenToNineteenIntegerRegex = '(?:((ثلاث|ثلاثة|سبعة|ثمان|ثمانية|أربع|أربعة|خمسة|تسعة|اثنان|اثنان|اثنين|اثتنين|اثنتان|إثنان|إثنتان|إثنين|إثتنين|إثنتان|ستة|أحد|أربعة|إثني|اثني)\\s(عشر|عشرة)))' + TensNumberIntegerRegex = '(عشرة|عشرون|ثلاثون|أربعون|خمسون|ستون|سبعون|ثمانون|تسعين|وعشرين|و عشرين|وثلاثين|و ثلاثين|وأربعين|و أربعين|وخمسين|و خمسين|وستين|وستين|وسبعين|و سبعين|وثمانين|و ثمانين|وتسعين|وتسعين|وعشرون|ثلاثون|وأربعون|و أربعون|وخمسون|و خمسون|وستون|و ستون|وسبعون|و سبعون|وثمانون|و ثمانون|وتسعون|و تسعون|عشرين|ثلاثين|أربعين|خمسين|ستين|سبعين|ثمانين|تسعون|العشرون:?)' + SeparaIntRegex = f'(?:((({RoundNumberIntegerRegex}\\s{RoundNumberIntegerRegex})|{TenToNineteenIntegerRegex}|({ZeroToNineIntegerRegex}(((و)?)\\s+(و)?|\\s*-\\s*){TensNumberIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{RoundNumberIntegerRegex})(\\s+{RoundNumberIntegerRegex})*))|((({RoundNumberIntegerRegex})+))' + AllIntRegex = f'(?:({SeparaIntRegex})((\\s*(و)\\s*)({SeparaIntRegex})(\\s+{RoundNumberIntegerRegex})?)*|((({TenToNineteenIntegerRegex}|({TensNumberIntegerRegex}(\\s+(و)?|\\s*-\\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex})?({RoundNumberIntegerRegex})+)\\s+(و)?)*{SeparaIntRegex})' + PlaceHolderPureNumber = '\\b' + PlaceHolderDefault = '\\D|\\b' + + def NumbersWithPlaceHolder(placeholder): + return f'(((?(الواحد\\s)?((السابق|السابقة|الثانية الى|((الذي)\\s*(قبل|قبلا)\\s*)?(الأخير)|قبل|بعد|سبق|سبقت|التالي|الحالي|الذي|اخر)(\\s))?((تالي|الحالي|السابقة|سابق|قادم|التالي|((الذي)\\s*(قبل|قبلا)\\s*)?(الأخير)|آخر|أخير|حالي|اخر|الاخير|الأولى)(ة)?)|(الاخر|الاول|الأول|اول|الأولى|((الذي)\\s*(قبل|قبلا)\\s*)?(الأخير)|السابق|التالي|أخر|الثاني والعشرون))' + BasicOrdinalRegex = f'({NumberOrdinalRegex}|{RelativeOrdinalRegex})' + SuffixBasicOrdinalRegex = f'(?:(((({TensNumberIntegerRegex}(\\s+(و)?|\\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|({RoundNumberIntegerRegex}|المئة(\\s+(و)?)))((\\s+{RoundNumberIntegerRegex}|المئة)+|({BasicOrdinalRegex})))\\s+(و)?)*({TensNumberIntegerRegex}(\\s+|\\s*))?{BasicOrdinalRegex}|({TensNumberIntegerRegex}))' + SuffixRoundNumberOrdinalRegex = f'(?:({AllIntRegex}\\s+){RoundNumberOrdinalRegex})' + AllOrdinalRegex = f'(?:{SuffixBasicOrdinalRegex}|{SuffixRoundNumberOrdinalRegex})' + OrdinalNumericRegex = '(?<=\\b)(?:\\d{1,3}(\\s*,\\s*\\d{3})*\\s*th)(?=\\b)' + OrdinalRoundNumberRegex = f'({RoundNumberOrdinalRegex})' + OrdinalEnglishRegex = f'(?<=\\b){AllOrdinalRegex}(?=\\b)' + FractionNotationWithSpacesRegex = '(((?<={?[\\u0600-\\u06ff]}|^)-\\s*)|(?<=\\b))\\d+\\s+\\d+[/]\\d+(?=(\\b[^/]|$))' + FractionNotationWithSpacesRegex2 = ( + '(((?<={?[\\u0600-\\u06ff]}|^)-\\s*)|(?({AllIntRegex})|((?({AllIntRegex})|(\\d+)(?![.,]))(?=\\b)' + FractionPrepositionWithinPercentModeRegex = f'(?({AllIntRegex})|((?({AllIntRegex})|(\\d+)(?![.,]))(?=\\b)' + FractionWithOrdinalPrefix = f'({AllOrdinalRegex})(?=\\s*({FractionOrdinalPrefix}))' + FractionWithPartOfPrefix = f'((جزء من)\\s+)({AllIntRegexWithLocks})' + FractionMultiplierRegex = ( + f'(?\\s+{ArabicAndRegex}\\s(أ|واحد|{TwoToNineIntegerRegex})\\s+({ArabicPartOfItem}))' + ) + RoundMultiplierWithFraction = f'(?<=(?(?:مليون|مليار|تريليون|ملايين|المليارات|تريليونات))(?={FractionMultiplierRegex}?$)' + RoundMultiplierRegex = f'\\s*\\b({RoundMultiplierWithFraction}|(?(?:مائة|ألف|مئات|الآلاف))$)' + AllPointRegex = f'((\\s+{ZeroToNineIntegerRegex})+|(\\s+{SeparaIntRegex}))' + AllFloatRegex = f'{AllIntRegex}(\\s+(نقطة|جزء|جزء من|فاصلة|نقاط|فاصل)){AllPointRegex}' + DoubleWithMultiplierRegex = f'(((?و)' + TillRegex = '(الى|إلى|خلال|--|-|—|——|~|–)' + MoreRegex = '(?:(اكثر|فوق|أكبر|أعظم|أطول|يتجاوز|تفوق|أعلى|أكثر)|(?)' + LessRegex = '(?:(أقل|اقل|اصغر|أصغر|أخفض|ادنى)(\\s*من)?|تحت|(?|=)<)' + EqualRegex = '(يساوي|(?)=)' + MoreOrEqualPrefix = f'(((ليس|لا)\\s+{LessRegex})|(على\\s+الأقل))' + MoreOrEqual = f'(?:(({MoreRegex}(\\s+من)?)\\s+(أو|او)?\\s+{EqualRegex})|(({MoreOrEqualPrefix}|(تفوق))(\\s+(أو|او)?\\s+{EqualRegex})?)|(({EqualRegex}\\s+(أو|او)?\\s+)?({MoreOrEqualPrefix}|تفوق))|>\\s*=)' + MoreOrEqualSuffix = '((أو|او)\\s+(((أكبر|أعظم|أطول|فوق|اكثر|اكثر|اكبر|أكثر)((?!\\s+من)|(\\s+من(?!(\\s*\\d+)))))|((فوق|أكبر|أطول|اكثر)(?!\\s+من))))' + LessOrEqualPrefix = f'((ليس\\s+{MoreRegex})|(at\\s+most)|(بحد أقصى)|(يصل الى))' + LessOrEqual = f'(((لا\\s*)?{LessRegex}\\s+(أو|او)?\\s+{EqualRegex})|({EqualRegex}\\s+(أو|او)?\\s+(((أقل|اقل|أدنى|اصغر|أصغر|ادنى)(\\s+من))|تحت|(?|=)<))|({LessOrEqualPrefix}(\\s+(أو|او)?\\s+{EqualRegex})?)|(({EqualRegex}\\s+(أو|او)?\\s+)?{LessOrEqualPrefix})|<\\s*=)' + LessOrEqualSuffix = '((أ|ا)?و\\s+(أقل)((?!\\s+من)|(\\s+من(?!(\\s*\\d+)))))' + NumberSplitMark = '(?![.،](?!\\d+))' + MoreRegexNoNumberSucceed = ( + '((أكبر|أعظم|أطول|فوق|اكثر)((?!\\s+من)|\\s+(من(?!(\\s*\\d+))))|(فوق|أكبر|أعظم)(?!(\\s*\\d+)))' + ) + LessRegexNoNumberSucceed = ( + '((أقل|أصغر)((?!\\s+من)|\\s+(من(?!(\\s*\\d+))))|(تحت|اقل|أقل|أصغر)(?!((\\s*\\d+)|\\s*من)))' + ) + EqualRegexNoNumberSucceed = '((يساوي)(?!(\\s*\\d+)))' + OneNumberRangeMoreRegex1 = f'({MoreOrEqual})\\s*(ال)?(?({NumberSplitMark}.)+)|({EqualRegex}\\s*(أو|او)?\\s+({MoreRegex}))(\\s+(من))\\s*(?({NumberSplitMark}.)+)|({EqualRegex}\\s+(أو|او)?\\s+({MoreRegex}))\\s*(?({NumberSplitMark}.)+)|({MoreRegex})(\\s+(من))\\s*(?({NumberSplitMark}.)+)|({MoreRegex})\\s*(?({NumberSplitMark}.)+)' + OneNumberRangeMoreRegex3 = f'(?({NumberSplitMark}.)+)\\s*(و|أو)\\s*({MoreRegex})' + OneNumberRangeMoreRegex2 = f'(?({NumberSplitMark}.)+)\\s*{MoreOrEqualSuffix}' + OneNumberRangeMoreSeparateRegex = f'({MoreRegex}\\s*(من)\\s+(?({NumberSplitMark}.)+)\\s+(أو|او)\\s+{EqualRegexNoNumberSucceed})|({EqualRegex}\\s+(?({NumberSplitMark}.)+)(\\s+(أو|او)\\s+){MoreRegexNoNumberSucceed})|({MoreRegex}\\s+(?({NumberSplitMark}.)+)(\\s+(أو|او)\\s+){EqualRegexNoNumberSucceed})' + OneNumberRangeLessRegex1 = f'(({LessOrEqual})\\s*(ال)?(?({NumberSplitMark}.)+))|(لا\\s*)?((((أقل|اقل|أدنى|اصغر|أصغر|ادنى)(\\s+من))|تحت|(?|=)<))\\s*(ال)?(?({NumberSplitMark}.)+)|(لا\\s*)?(({LessRegex})\\s*(ال)?(?({NumberSplitMark}.)+))' + OneNumberRangeLessRegex2 = f'(?({NumberSplitMark}.)+)\\s*{LessOrEqualSuffix}' + OneNumberRangeLessSeparateRegex = f'({EqualRegex}\\s+(?({NumberSplitMark}.)+)\\s*(أو|او)\\s+{LessRegexNoNumberSucceed})|(((((أقل|اقل|أدنى|اصغر|أصغر|ادنى)(\\s+من))|تحت|(?|=)<))\\s+(?({NumberSplitMark}.)+)(\\s+(أو|او)\\s+){EqualRegexNoNumberSucceed})' + OneNumberRangeEqualRegex = f'{EqualRegex}\\s*(ال)?(?({NumberSplitMark}.)+)' + TwoNumberRangeRegex1 = ( + f'بين\\s*(ال)?(?({NumberSplitMark}.)+)\\s*و\\s*(ال)?(?({NumberSplitMark}.)+)' + ) + TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})\\s*(،)?\\s*((أ|ا)?و|لكن|,)\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})' + TwoNumberRangeRegex3 = f'({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})\\s*(،)?\\s*((أ|ا)?و|لكن|,)\\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})' + TwoNumberRangeRegex4 = f'((من\\s)(?({NumberSplitMark}(?!\\bمن\\b).)+)\\s*{TillRegex}\\s*(ال\\s+)?(?({NumberSplitMark}.)+))|((من\\s)?(?({NumberSplitMark}(?!\\bمن\\b).)+)\\s*{TillRegex}\\s*(ال\\s+)?(?({NumberSplitMark}.)+))' + AmbiguousFractionConnectorsRegex = '(\\bمن|بين|من|بين\\b)' + DecimalSeparatorChar = '.' + FractionMarkerToken = 'أكثر' + NonDecimalSeparatorChar = ',' + HalfADozenText = 'ستة' + WordSeparatorToken = 'و' + WrittenDecimalSeparatorTexts = [r'فاصلة', r'فاصل', r'نقاط', r'نقطة', r'٫'] + WrittenGroupSeparatorTexts = [r'punto'] + WrittenIntegerSeparatorTexts = [r'و'] + WrittenFractionSeparatorTexts = [r'و'] + HalfADozenRegex = 'نصف?\\sدستة' + DigitalNumberRegex = f'((?<=\\b)(مائة|مائتان|دست|دستات|ألف|ألفين|مائتين|ألفين|ثلاثمائة|أربعمائة|خمسمائة|ستمائة|سبعمائة|تسعمائة|ثمانمائة|مليون|آلاف|مليار|ترليون)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' + CardinalNumberMap = dict( + [ + ("الصفر", 0), + ("صفر", 0), + ("واحد", 1), + ("الواحد", 1), + ("الاثنان", 2), + ("اثنان", 2), + ("اثنين", 2), + ("الاثنين", 2), + ("إثنان", 2), + ("الثلاثة", 3), + ("ثلاث", 3), + ("ثلاثة", 3), + ("الأربعة", 4), + ("أربعة", 4), + ("الخمسة", 5), + ("خمسة", 5), + ("الستة", 6), + ("ستة", 6), + ("بستة", 6), + ("السبعة", 7), + ("سبعة", 7), + ("الثمانية", 8), + ("ثمانية", 8), + ("التسعة", 9), + ("تسعة", 9), + ("العشرة", 10), + ("عشرة", 10), + ("الإحدى عشر", 11), + ("إحدى عشر", 11), + ("أحد عشر", 11), + ("الاثنى عشر", 12), + ("الدستة", 12), + ("الدستات", 12), + ("اثنى عشر", 12), + ("اثني عشر", 12), + ("دستة", 12), + ("دستات", 12), + ("الثلاثة عشر", 13), + ("ثلاثة عشر", 13), + ("الأربعة عشر", 14), + ("أربعة عشر", 14), + ("الخمسة عشر", 15), + ("خمسة عشر", 15), + ("الستة عشر", 16), + ("ستة عشر", 16), + ("السبعة عشر", 17), + ("سبعة عشر", 17), + ("الثمانية عشر", 18), + ("ثمانية عشر", 18), + ("تسعة عشر", 19), + ("التسعة عشر", 19), + ("العشرون", 20), + ("عشرون", 20), + ("عشرين", 20), + ("وعشرون", 20), + ("ثلاثون", 30), + ("ثلاثين", 30), + ("وثلاثون", 30), + ("الثلاثون", 30), + ("الأربعون", 40), + ("أربعون", 40), + ("أربعين", 40), + ("وأربعون", 40), + ("خمسون", 50), + ("وخمسون", 50), + ("الخمسون", 50), + ("الستون", 60), + ("ستون", 60), + ("ستين", 60), + ("وستون", 60), + ("سبعون", 70), + ("وسبعون", 70), + ("السبعون", 70), + ("الثمانون", 80), + ("ثمانون", 80), + ("وثمانون", 80), + ("تسعون", 90), + ("تسعين", 90), + ("وتسعون", 90), + ("التسعون", 90), + ("المائة", 100), + ("مائة", 100), + ("مئة", 100), + ("ومائة", 100), + ("مائتان", 200), + ("مئتان", 200), + ("ومائتان", 200), + ("مائتين", 200), + ("ومائتين", 200), + ("المائتين", 200), + ("المائتان", 200), + ("الثلاثمائة", 300), + ("ثلاثمائة", 300), + ("ثلاثمائه", 300), + ("وثلاثمائة", 300), + ("أربعمائة", 400), + ("أربعة مئة", 400), + ("وأربعمائة", 400), + ("الأربعمائة", 400), + ("الخمسمائة", 500), + ("خمسمائة", 500), + ("وخمسمائة", 500), + ("ستمائة", 600), + ("وستمائة", 600), + ("الستمائة", 600), + ("السبعمائة", 700), + ("سبعمائة", 700), + ("وسبعمائة", 700), + ("ثمانمائة", 800), + ("وثمانمائة", 800), + ("الثمانمائة", 800), + ("التسعمائة", 900), + ("تسعمائة", 900), + ("وتسعمائة", 900), + ("ألف", 1000), + ("آلاف", 1000), + ("الآف", 1000), + ("الاف", 1000), + ("ألفاً", 1000), + ("الفا", 1000), + ("الف", 1000), + ("الألف", 1000), + ("الآلاف", 1000), + ("ألفين", 2000), + ("بألفي", 2000), + ("الألفين", 2000), + ("ألفان", 2000), + ("المليون", 1000000), + ("مليون", 1000000), + ("مليونًا", 1000000), + ("مليار", 1000000000), + ("المليار", 1000000000), + ("تريليون", 1000000000000), + ("التريليون", 1000000000000), + ] + ) + OrdinalNumberMap = dict( + [ + ("أول", 1), + ("أوائل", 1), + ("أولى", 1), + ("الأول", 1), + ("الأولى", 1), + ("ثاني", 2), + ("ثانية", 2), + ("الثاني", 2), + ("الثانية", 2), + ("أنصاف", 2), + ("ثان", 2), + ("النصف", 2), + ("نصف", 2), + ("ثلث", 3), + ("أثلاث", 3), + ("الثالث", 3), + ("الثالثة", 3), + ("ثالث", 3), + ("ثالثة", 3), + ("الربع", 4), + ("أرباع", 4), + ("ربع", 4), + ("الرابع", 4), + ("الرابعة", 4), + ("رابع", 4), + ("رابعة", 4), + ("خمس", 5), + ("أخماس", 5), + ("الخامس", 5), + ("الخامسة", 5), + ("خامس", 5), + ("خامسة", 5), + ("سدس", 6), + ("أسداس", 6), + ("السادس", 6), + ("السادسة", 6), + ("سادس", 6), + ("سادسة", 6), + ("سبع", 7), + ("أسباع", 7), + ("السابع", 7), + ("السابعة", 7), + ("سابع", 7), + ("سابعة", 7), + ("ثمن", 8), + ("الثامن", 8), + ("الثامنة", 8), + ("ثامن", 8), + ("أثمان", 8), + ("ثامنة", 8), + ("تسع", 9), + ("التاسع", 9), + ("أتساع", 9), + ("تاسع", 9), + ("تاسعة", 9), + ("التاسعة", 10), + ("واحد من عشرة", 10), + ("أعشار", 10), + ("العاشر", 10), + ("واحد من إحدى عشر", 11), + ("الحادية عشرة", 11), + ("الحادي عشر", 11), + ("واحد من إثنى عشر", 12), + ("الثانية عشرة", 12), + ("الثاني عشر", 12), + ("ثاني عشر", 12), + ("واحد من ثلاثة عشر", 13), + ("الثالثة عشرة", 13), + ("الثالث عشر", 13), + ("واحد من أربعة عشر", 14), + ("الرابعة عشرة", 14), + ("الرابع عشر", 14), + ("واحد من خمسة عشر", 15), + ("الخامسة عشرة", 15), + ("الخامس عشر", 15), + ("واحد من ستة عشر", 16), + ("السادسة عشرة", 16), + ("السادس عشر", 16), + ("واحد من سبعة عشر", 17), + ("السابعة عشرة", 17), + ("السابع عشر", 17), + ("واحد من ثمانية عشر", 18), + ("الثامنة عشرة", 18), + ("الثامن عشر", 18), + ("واحد من تسعة عشر", 19), + ("التاسع عشر", 19), + ("واحد من عشرين", 20), + ("عشرينات", 20), + ("العشرون", 20), + ("العشرين", 20), + ("الحادي والعشرين", 21), + ("الحادي والعشرون", 21), + ("الثاني والعشرين", 22), + ("عشرين ثانية", 22), + ("الثاني والعشرون", 22), + ("الثالث والعشرين", 23), + ("الثالث والعشرون", 23), + ("الرابع والعشرين", 24), + ("الرابع والعشرون", 24), + ("الخامس والعشرين", 25), + ("الخامس والعشرون", 25), + ("خمسة و عشرون", 25), + ("السادس والعشرين", 26), + ("السادس والعشرون", 26), + ("السابع والعشرين", 27), + ("السابع والعشرون", 27), + ("الثامن والعشرين", 28), + ("الثامن والعشرون", 28), + ("التاسع والعشرين", 29), + ("التاسع والعشرون", 29), + ("واحد من ثلاثين", 30), + ("الثلاثون", 30), + ("الثلاثين", 30), + ("ثلاثينات", 30), + ("الحادي والثلاثين", 31), + ("الحادي والثلاثون", 31), + ("واحد من أربعين", 40), + ("أربعينات", 40), + ("الأربعون", 40), + ("الأربعين", 40), + ("واحد من خمسين", 50), + ("خمسينات", 50), + ("الخمسون", 50), + ("الخمسين", 50), + ("واحد من ستين", 60), + ("ستينات", 60), + ("الستون", 60), + ("الستين", 60), + ("واحد من سبعين", 70), + ("سبعينات", 70), + ("السبعون", 70), + ("السبعين", 70), + ("واحد من ثمانين", 80), + ("ثمانينات", 80), + ("الثمانون", 80), + ("الثمانين", 80), + ("واحد من تسعين", 90), + ("تسعينات", 90), + ("التسعون", 90), + ("التسعين", 90), + ("واحد من مائة", 100), + ("مئات", 100), + ("المائة", 100), + ("التسعمائة", 100), + ("المائتان", 200), + ("المائتين", 200), + ("الثلاثمائة", 300), + ("الأربعمائة", 400), + ("الخمسمائة", 500), + ("الستمائة", 600), + ("السبعمائة", 700), + ("الثمانمائة", 800), + ("الألف", 1000), + ("ألوف", 1000), + ("واحد من ألف", 1000), + ("واحد من مليون", 1000000), + ("ملايين", 1000000), + ("المليون", 1000000), + ("مليارات", 1000000000), + ("واحد من مليار", 1000000000), + ("المليار", 1000000000), + ("واحد من تريليون", 1000000000000), + ("التريليون", 1000000000000), + ("تريليون", 1000000000000), + ] + ) + RoundNumberMap = dict( + [ + ("دستة", 12), + ("دستات", 12), + ("الدستة", 12), + ("الدستات", 12), + ("مائة", 100), + ("ومائة", 100), + ("مئة", 100), + ("المائة", 100), + ("مائتين", 200), + ("ومائتان", 200), + ("ومائتين", 200), + ("مائتان", 200), + ("المائتين", 200), + ("المائتان", 200), + ("ثلاثمائة", 300), + ("الثلاثمائة", 300), + ("وثلاثمائة", 300), + ("أربعمائة", 400), + ("الأربعمائة", 400), + ("خمسمائة", 500), + ("وخمسمائة", 500), + ("الخمسمائة", 500), + ("ستمائة", 600), + ("وستمائة", 600), + ("الستمائة", 600), + ("سبعمائة", 700), + ("وسبعمائة", 700), + ("السبعمائة", 700), + ("الثمانمائة", 800), + ("ثمانمائة", 800), + ("تسعمائة", 900), + ("التسعمائة", 900), + ("ألف", 1000), + ("آلاف", 1000), + ("الآف", 1000), + ("الاف", 1000), + ("ألفاً", 1000), + ("الفا", 1000), + ("الف", 1000), + ("الألف", 1000), + ("ألفين", 2000), + ("الألفين", 2000), + ("مليون", 1000000), + ("ملايين", 1000000), + ("المليون", 1000000), + ("مليونًا", 1000000), + ("مليار", 1000000000), + ("المليار", 1000000000), + ("مليارات", 1000000000), + ("تريليون", 1000000000000), + ("ترليون", 1000000000000), + ("التريليون", 1000000000000), + ] + ) + AmbiguityFiltersDict = dict([("\\bواحد\\b", "\\b(الذي|هذا|ذلك|ذاك|أي)\\s+(واحد)\\b")]) + RelativeReferenceOffsetMap = dict( + [ + ("الاخر", "0"), + ("آخر", "0"), + ("اخر", "0"), + ("الأخيرة", "0"), + ("الأخير", "0"), + ("سبقت الأخيرة", "-1"), + ("سبقت الأخير", "-1"), + ("قبل الأخير", "-1"), + ("قبل الأخيرة", "-1"), + ("القبل الأخير", "-1"), + ("قبلا الأخي", "-1"), + ("التالي", "1"), + ("بعد التالي", "2"), + ("قادم", "1"), + ("قادمة", "1"), + ("القادم", "1"), + ("القادمة", "1"), + ("السابقة", "-1"), + ("الحالي", "0"), + ("الحالية", "0"), + ("قبل الاخير", "-1"), + ("الواحد قبل الاخير", "-1"), + ("الثانية الى الاخير", "-1"), + ("الذي قبلا الأخير", "-1"), + ("الذي قبل الأخير", "-1"), + ("الذي قبلا الأخي", "-1"), + ("السابق", "-1"), + ("أخر", "0"), + ("الاخير", "0"), + ("اول", "1"), + ("الاول", "1"), + ("التالية", "-1"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("اول", "current"), + ("التالية", "current"), + ("الاول", "current"), + ("الاخر", "end"), + ("الاخير", "end"), + ("أخر", "end"), + ("آخر", "end"), + ("اخر", "end"), + ("الأخيرة", "end"), + ("الأخير", "end"), + ("سبقت الأخيرة", "current"), + ("سبقت الأخير", "current"), + ("قبل الأخير", "end"), + ("قبل الأخيرة", "current"), + ("القبل الأخير", "current"), + ("الذي قبلا الأخي", "end"), + ("التالي", "current"), + ("بعد التالي", "current"), + ("قادم", "current"), + ("قادمة", "current"), + ("القادم", "current"), + ("القادمة", "current"), + ("السابقة", "current"), + ("الحالي", "current"), + ("قبلا الأخي", "current"), + ("الحالية", "end"), + ("قبل الاخير", "end"), + ("الواحد قبل الاخير", "end"), + ("الذي قبل الأخير", "end"), + ("الذي قبلا الأخير", "end"), + ("الثانية الى الاخير", "end"), + ("السابق", "current"), + ] + ) + + +# pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/base_numbers.py b/Python/libraries/recognizers-number/recognizers_number/resources/base_numbers.py index 7d7d25186f..240f032d4b 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/base_numbers.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/base_numbers.py @@ -18,15 +18,21 @@ class BaseNumbers: def IntegerRegexDefinition(placeholder, thousandsmark): return f'(((?(menys|negatiu)\\s+)' + NegativeNumberSignRegex = f'^{NegativeNumberTermsRegex}.*' + TenToNineteenIntegerRegex = '(?:disset|tretze|catorze|divuit anys|dinou|quinze|setze|onze|dotze|deu)' + TensNumberIntegerRegex = '(?:setanta|vint|trenta|vuitanta|noranta|quaranta|cinquanta|seixanta)' + TwentiesIntegerRegex = f'(vint(\\s?-\\s?|\\s)i(\\s?-\\s?|\\s)({TwoToNineIntegerRegex}|u(n)?))' + BelowHundredsRegex = f'(({TenToNineteenIntegerRegex}|{TwentiesIntegerRegex}|({TensNumberIntegerRegex}((\\s?-\\s?|\\s)({TwoToNineIntegerRegex}|u))?)|{ZeroToNineIntegerRegex}))' + HundredsNumberIntegerRegex = f'(({TwoToNineIntegerRegex}(\\s?-\\s?|\\s))?cent(s?))' + BelowThousandsRegex = f'({HundredsNumberIntegerRegex}(\\s+{BelowHundredsRegex})?|{BelowHundredsRegex})' + SupportThousandsRegex = ( + f'(({BelowThousandsRegex}|{BelowHundredsRegex})\\s+{RoundNumberIntegerRegex}(\\s+{RoundNumberIntegerRegex})?)' + ) + SeparaIntRegex = ( + f'({SupportThousandsRegex}(\\s+{SupportThousandsRegex})*(\\s+{BelowThousandsRegex})?|{BelowThousandsRegex})' + ) + AllIntRegex = f'({SeparaIntRegex}|mil(\\s+{BelowThousandsRegex})?|{RoundNumberIntegerRegex})' + PlaceHolderPureNumber = '\\b' + PlaceHolderDefault = '(?=\\D)|\\b' + PlaceHolderMixed = '\\D|\\b' + DigitsNumberRegex = '\\d|\\d{1,3}(\\.\\d{3})' + + def NumbersWithPlaceHolder(placeholder): + return f'(((?(\\s+(i|un)\\s+)(i|un(a)?|dues|{TwoToNineIntegerRegex}\\s+)?(mig|quarts?|terç|cinquè|sisè|setena|vuitè|vuitena|novè|desè)s?(\\s+(de|d\'))?)' + RoundMultiplierWithFraction = f'(?<=(?(?:cent|mil|mili[óo]|milion|bili[óo]|mil milions)s?)(?={FractionMultiplierRegex}?$)' + RoundMultiplierRegex = ( + f'\\b\\s*((de\\s+)?a\\s+)?({RoundMultiplierWithFraction}|(?(?:cent|mil|milers)s?)$)' + ) + FractionNounRegex = f'(?<=\\b)({AllIntRegex}\\s+(i\\s+)?)?({AllIntRegex}(\\s+((i)\\s)?)(({AllOrdinalNumberRegex}s?|{RoundNumberOrdinalRegex}s?)|(mig|meitats?|terç(os)?|quarts?))|(un\\s+)?(mig|meitats?|terç(os)?|quarts?)(\\s+(de\\s+)?|\\s*-\\s*){RoundNumberIntegerRegex})(?=\\b)' + FractionNounWithArticleRegex = f'(?<=\\b)(({AllIntRegex}|{RoundNumberIntegerRegexWithLocks})\\s+((i|con)\\s+)?)?((un|i)(\\s+)(({AllOrdinalNumberRegex}))|(i\\s+)?mig|meitats?|quarts?)(?=\\b)' + FractionPrepositionRegex = f'(?({AllIntRegex})|((?en|de))\\s+(?({AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)' + AllPointRegex = f'((\\s+{ZeroToNineIntegerRegex})+|(\\s+{SeparaIntRegex}))' + AllFloatRegex = f'{AllIntRegex}(\\s+coma){AllPointRegex}' + + def DoubleDecimalPointRegex(placeholder): + return f'(((?)' - LessRegex = f'(小于|少于|低于|小於|少於|低於|不到|不足|<)' - EqualRegex = f'(等于|等於|=)' + FractionNotationRegex = ( + f'({NegativeNumberTermsRegexNum}\\s*)?{ZeroToNineFullHalfRegex}+[//]{ZeroToNineFullHalfRegex}+' + ) + SpeicalCharBeforeNumber = '(有|是|为)' + TillRegex = '(到|至|--|-|—|——|~|–)' + MoreRegex = '((大于|多于|高于|超过|大於|多於|高於|超過|超过)了?|过|>)' + LessRegex = '(小于|少于|低于|小於|少於|低於|不到|不足|<)' + EqualRegex = '(等于|等於|=)' MoreOrEqual = f'(({MoreRegex}\\s*(或|或者)?\\s*{EqualRegex})|(至少|最少){SpeicalCharBeforeNumber}?|不{LessRegex}|≥)' - MoreOrEqualSuffix = f'(或|或者)\\s*(次?以上|之上|更[大多高])' + MoreOrEqualSuffix = '(或|或者)\\s*(次?以上|之上|更[大多高])' LessOrEqual = f'(({LessRegex}\\s*(或|或者)?\\s*{EqualRegex})|(至多|最多){SpeicalCharBeforeNumber}?|不{MoreRegex}|≤)' - LessOrEqualSuffix = f'(或|或者)\\s*(以下|之下|更[小少低])' - OneNumberRangeMoreRegex1 = f'({MoreOrEqual}|{MoreRegex})\\s*(?((?!([并且而並的同時时]|([,,](?!\\d+))|。)).)+)' - OneNumberRangeMoreRegex2 = f'比\\s*(?((?!(([,,](?!\\d+))|。)).)+)\\s*更?[大多高]' - OneNumberRangeMoreRegex3 = f'(?((?!(([,,](?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*([多几余幾餘]|次?以上|之上|更[大多高])([万亿萬億]{{0,2}})' - OneNumberRangeLessRegex1 = f'({LessOrEqual}|{LessRegex})\\s*(?((?!([并且而並的同時时]|([,,](?!\\d+))|。)).)+)' - OneNumberRangeLessRegex2 = f'比\\s*(?((?!(([,,](?!\\d+))|。)).)+)\\s*更?[小少低]' - OneNumberRangeLessRegex3 = f'(?((?!(([,,](?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*(以下|之下|更[小少低])' - OneNumberRangeMoreSeparateRegex = f'^[.]' - OneNumberRangeLessSeparateRegex = f'^[.]' + LessOrEqualSuffix = '(或|或者)\\s*(以下|之下|更[小少低])' + OneNumberRangeMoreRegex1 = ( + f'({MoreOrEqual}|{MoreRegex})\\s*(?((?!([并且而並的同時时]|([,,](?!\\d+))|。)).)+)' + ) + OneNumberRangeMoreRegex2 = '比\\s*(?((?!(([,,](?!\\d+))|。)).)+)\\s*更?[大多高]' + OneNumberRangeMoreRegex3 = '(?((?!(([,,](?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*([多几余幾餘]|次?以上|之上|更[大多高])([万亿萬億]{0,2})' + OneNumberRangeLessRegex1 = ( + f'({LessOrEqual}|{LessRegex})\\s*(?((?!([并且而並的同時时]|([,,](?!\\d+))|。)).)+)' + ) + OneNumberRangeLessRegex2 = '比\\s*(?((?!(([,,](?!\\d+))|。)).)+)\\s*更?[小少低]' + OneNumberRangeLessRegex3 = '(?((?!(([,,](?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*(以下|之下|更[小少低])' + OneNumberRangeMoreSeparateRegex = '^[.]' + OneNumberRangeLessSeparateRegex = '^[.]' OneNumberRangeEqualRegex = f'{EqualRegex}\\s*(?((?!(([,,](?!\\d+))|。)).)+)' TwoNumberRangeRegex1 = f'((位于|在|位於)|(?=(\\d|\\+|\\-)))\\s*(?((?!(([,,](?!\\d+))|。)).)+)\\s*(和|与|與|{TillRegex})\\s*(?((?!(([,,](?!\\d+))|。))[^之])+)\\s*(之)?(间|間)' TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2}|{OneNumberRangeMoreRegex3})\\s*(且|(并|並)且?|而且|((的)?同時)|((的)?同时)|[,,])?\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2}|{OneNumberRangeLessRegex3})' TwoNumberRangeRegex3 = f'({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2}|{OneNumberRangeLessRegex3})\\s*(且|(并|並)且?|而且|((的)?同時)|((的)?同时)|[,,])?\\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2}|{OneNumberRangeMoreRegex3})' - TwoNumberRangeRegex4 = f'(?((?!(([,,](?!\\d+))|。)).)+)\\s*{TillRegex}\\s*(?((?!(([,,](?!\\d+))|。)).)+)' - AmbiguityFiltersDict = dict([("十", "十足"), - ("伍", "队伍"), - ("肆", "放肆|肆意|肆无忌惮"), - ("陆", "大陆|陆地|登陆|海陆"), - ("拾", "拾取|拾起|收拾|拾到|朝花夕拾")]) - AmbiguousFractionConnectorsRegex = f'^[.]' + TwoNumberRangeRegex4 = ( + f'(?((?!(([,,](?!\\d+))|。)).)+)\\s*{TillRegex}\\s*(?((?!(([,,](?!\\d+))|。)).)+)' + ) + AmbiguityFiltersDict = dict( + [ + ("十", "十足"), + ("伍", "队伍|入伍|退伍|伍仁"), + ("肆", "放肆|肆意|肆无忌惮"), + ("陆", "大陆|陆地|登陆|海陆"), + ("拾", "拾取|拾起|收拾|拾到|朝花夕拾"), + ] + ) + AmbiguousFractionConnectorsRegex = '^[.]' RelativeReferenceOffsetMap = dict([("", "")]) RelativeReferenceRelativeToMap = dict([("", "")]) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/dutch_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/dutch_numeric.py index 2cc7dcba6a..81c62e3fb5 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/dutch_numeric.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/dutch_numeric.py @@ -10,6 +10,8 @@ # ------------------------------------------------------------------------------ from .base_numbers import BaseNumbers + + # pylint: disable=line-too-long @@ -17,43 +19,46 @@ class DutchNumeric: LangMarker = 'Dut' CompoundNumberLanguage = True MultiDecimalSeparatorCulture = False - DigitsNumberRegex = f'-?(\\d+|\\d{{1,3}}(\\.\\d{{3}})*)' - RoundNumberIntegerRegex = f'(honderd|duizend|miljoen|miljard|biljoen)' - ZeroToNineIntegerRegex = f'(((een)(?!\\s+((honderdste|duizendste|miljoenste|miljardste|biljoenste)|(nulde|eende|eerste|tweede|derde|vierde|vijfd(e|en)|zesde|zevende|achtst(e|en)|negende|tiend(e|en)|elfde|twaalfde|dertiende|veertiende|vijftiende|zestiende|zeventiende|achttiende|negentiende|twintigste|dertigste|veertigste|vijftigste|zestigste|zeventigste|tachtigste|negentigste))))|(één|drie|zeven|acht|vier|vijf|nul|negen|twee|zes))' - TwoToNineIntegerRegex = f'(drie|zeven|acht|vier|vijf|negen|twee|zes)' - NegativeNumberTermsRegex = f'(?(min|negatief)\\s+)' + DigitsNumberRegex = '-?(\\d+|\\d{1,3}(\\.\\d{3})*)' + RoundNumberIntegerRegex = '(honderd|duizend|miljoen|miljard|biljoen)' + ZeroToNineIntegerRegex = '(((een)(?!\\s+((honderdste|duizendste|miljoenste|miljardste|biljoenste)|(nulde|eende|eerste|tweede|derde|vierde|vijfd(e|en)|zesde|zevende|achtst(e|en)|negende|tiend(e|en)|elfde|twaalfde|dertiende|veertiende|vijftiende|zestiende|zeventiende|achttiende|negentiende|twintigste|dertigste|veertigste|vijftigste|zestigste|zeventigste|tachtigste|negentigste))))|(één|drie|zeven|acht|vier|vijf|nul|negen|twee|zes))' + TwoToNineIntegerRegex = '(drie|zeven|acht|vier|vijf|negen|twee|zes)' + NegativeNumberTermsRegex = '(?(min|negatief)\\s+)' NegativeNumberSignRegex = f'^{NegativeNumberTermsRegex}.*' - AnIntRegex = f'(een|één)(?=\\s)' - TenToNineteenIntegerRegex = f'(zeventien|dertien|veertien|achttien|negentien|vijftien|zestien|elf|twaalf|tien)' - TensNumberIntegerRegex = f'(zeventig|twintig|dertig|tachtig|negentig|veertig|vijftig|zestig)' + AnIntRegex = '(een|één)(?=\\s)' + TenToNineteenIntegerRegex = '(zeventien|dertien|veertien|achttien|negentien|vijftien|zestien|elf|twaalf|tien)' + TensNumberIntegerRegex = '(zeventig|twintig|dertig|tachtig|negentig|veertig|vijftig|zestig)' SeparaIntRegex = f'((({TenToNineteenIntegerRegex}|({ZeroToNineIntegerRegex}(en|ën){TensNumberIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{RoundNumberIntegerRegex})(\\s*{RoundNumberIntegerRegex})*))|{RoundNumberIntegerRegex}|(({AnIntRegex}(\\s*{RoundNumberIntegerRegex})+))' AllIntRegex = f'(((({TenToNineteenIntegerRegex}|({ZeroToNineIntegerRegex}(en|ën){TensNumberIntegerRegex})|{TensNumberIntegerRegex}|({ZeroToNineIntegerRegex}|{AnIntRegex}))?(\\s*{RoundNumberIntegerRegex}))\\s*((en|ën)\\s*)?)*{SeparaIntRegex})' - PlaceHolderPureNumber = f'\\b' - PlaceHolderDefault = f'\\D|\\b' + PlaceHolderPureNumber = '\\b' + PlaceHolderDefault = '\\D|\\b' def NumbersWithPlaceHolder(placeholder): return f'(((?volgende|vorige?|huidige|laatste?|(de\\s+op\\s+één\\s+na\\s+|de\\s+een\\s+voor\\s+de\\s+|die\\s+voor\\s+de\\s+|twee\\s+na\\s+|voor)laatste)' + GrossRegex = '(een\\s+)?gros' + AllIntRegexWithDozenSuffixLocks = ( + f'(?<=\\b)(((een\\s+)?half\\s+dozijn)|({AllIntRegex}\\s+dozijn(en)?)|{GrossRegex})(?=\\b)' + ) + RoundNumberOrdinalRegex = '(honderdste|duizendste|miljoenste|miljardste|biljoenste)' + BasicOrdinalRegex = '(nulde|eende|eerste|tweede|derde|vierde|vijfd(e|en)|zesde|zevende|achtst(e|en)|negende|tiend(e|en)|elfde|twaalfde|dertiende|veertiende|vijftiende|zestiende|zeventiende|achttiende|negentiende|twintigste|vijfentwintigste|vijventwintigste|dertigste|veertigste|vijftigste|zestigste|zeventigste|tachtigste|negentigste)' + RelativeOrdinalRegex = '(?volgende|vorige?|huidige|laatste?|(de\\s+op\\s+één\\s+na\\s+|de\\s+een\\s+voor\\s+de\\s+|die\\s+voor\\s+de\\s+|twee\\s+na\\s+|voor)laatste)' SuffixBasicOrdinalRegex = f'(((({ZeroToNineIntegerRegex}{RoundNumberIntegerRegex})|({RoundNumberIntegerRegex}{ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{RoundNumberIntegerRegex})\\s*)*((en|ën)\\s*)*{BasicOrdinalRegex})' SuffixRoundNumberOrdinalRegex = f'(({AllIntRegex}\\s*){RoundNumberOrdinalRegex})' AllOrdinalNumberRegex = f'(?:{SuffixBasicOrdinalRegex}|{SuffixRoundNumberOrdinalRegex})' AllOrdinalRegex = f'(?:{AllOrdinalNumberRegex}|{RelativeOrdinalRegex})' - OrdinalSuffixRegex = f'(?<=\\b)((\\d+\\s*e)|[18]\\s*ste|[092-7]\\s*de|([0-9]*1[0-9]\\s*de)|([0-9]*[2-9][0-9]\\s*ste)|([0-9]*[0]([18]\\s*ste|[092-7]\\s*de)))(?=\\b)' - OrdinalNumericRegex = f'(?<=\\b)(\\d{{1,3}}(\\s*.\\s*\\d{{3}})*\\s*e)(?=\\b)' + OrdinalSuffixRegex = '(?<=\\b)((\\d+\\s*e)|[18]\\s*ste|[092-7]\\s*de|([0-9]*1[0-9]\\s*de)|([0-9]*[2-9][0-9]\\s*ste)|([0-9]*[0]([18]\\s*ste|[092-7]\\s*de)))(?=\\b)' + OrdinalNumericRegex = '(?<=\\b)(\\d{1,3}(\\s*.\\s*\\d{3})*\\s*e)(?=\\b)' OrdinalRoundNumberRegex = f'(?anderhalve|anderhalf)|(?driekwart)|half|halve|helft|kwart)' - FractionHalfRegex = f'([eë]nhalf|[eë]nhalve|ëneenhal(f|ve))$' + FractionUnitsRegex = '((?anderhalve|anderhalf)|(?driekwart)|half|halve|helft|kwart)' + FractionHalfRegex = '([eë]nhalf|[eë]nhalve|ëneenhal(f|ve))$' OneHalfTokens = [r'een', r'half'] FractionMultiplierRegex = f'(?((\\s+en\\s+)?(anderhalve|anderhalf|driekwart)|\\s+en\\s+(een|{TwoToNineIntegerRegex})\\s+(half|derde|kwart|vierde|vijfd(e|en)|zesde|zevende|achtst(e|en)|negende|tiend(e|en))))' RoundMultiplierWithFraction = f'(?<=(?(miljoen|miljard|biljoen))(?={FractionMultiplierRegex}?$)' @@ -64,37 +69,46 @@ def NumbersWithPlaceHolder(placeholder): FractionPrepositionWithinPercentModeRegex = f'(?({AllIntRegex})|((?({AllIntRegex})|(\\d+)(?!,))(?=\\b)' AllPointRegex = f'((\\s+{ZeroToNineIntegerRegex})+|(\\s+{SeparaIntRegex}))' AllFloatRegex = f'{AllIntRegex}(\\s+komma){AllPointRegex}' - DoubleWithMultiplierRegex = f'(((?en)' - NumberWithSuffixPercentage = f'(?en)' FractionNumberWithSuffixPercentage = f'(({BaseNumbers.FractionNumberReplaceToken})\\s+van)' - NumberWithPrefixPercentage = f'(percentage van)(\\s*)({BaseNumbers.NumberReplaceToken})' - NumberWithPrepositionPercentage = f'({BaseNumbers.NumberReplaceToken})\\s*(uit|in|van|van\\s+de)\\s*({BaseNumbers.NumberReplaceToken})' - TillRegex = f'(tot|--|-|—|——|~)' - IncludeTillRegex = f'(tot en met)' - MoreRegex = f'((groter|hoger|meer)((\\s+is)?(\\s+dan|\\s+als))?|boven|over|>)' - LessRegex = f'((minder|lager|kleiner)(\\s+dan|\\s+als)?|beneden|onder|<)' - EqualRegex = f'(gelijk(\\s+(aan|tot|als|dan))?|(?)=)' + NumberWithPrepositionPercentage = ( + f'({BaseNumbers.NumberReplaceToken})\\s*(uit|in|van|van\\s+de)\\s*({BaseNumbers.NumberReplaceToken})' + ) + TillRegex = '(tot|--|-|—|——|~)' + IncludeTillRegex = '(tot en met)' + MoreRegex = '((groter|hoger|meer)((\\s+is)?(\\s+dan|\\s+als))?|boven|over|>)' + LessRegex = '((minder|lager|kleiner)(\\s+dan|\\s+als)?|beneden|onder|<)' + EqualRegex = '(gelijk(\\s+(aan|tot|als|dan))?|(?)=)' MoreOrEqualPrefix = f'((niet\\s+{LessRegex})|(tenminste|op zijn minst|minstens))' MoreOrEqual = f'(({MoreRegex}\\s+of\\s+{EqualRegex})|({EqualRegex}\\s+of\\s+{MoreRegex})|{MoreOrEqualPrefix}(\\s+(of)?\\s+{EqualRegex})?|niet\\s+{LessRegex}|>\\s*=)' - MoreOrEqualSuffix = f'((en|of)\\s+(meer|groter|hoger|grotere)((?!\\s+(dan|als))|(\\s+(dan|als)(?!(\\s*\\d+)))))' + MoreOrEqualSuffix = '((en|of)\\s+(meer|groter|hoger|grotere)((?!\\s+(dan|als))|(\\s+(dan|als)(?!(\\s*\\d+)))))' LessOrEqualPrefix = f'((niet\\s+{MoreRegex})|(hooguit|op zijn hoogst|op zijn meest))' - LessOrEqual = f'(({LessRegex}\\s+of\\s+{EqualRegex})|({EqualRegex}\\s+of\\s+{LessRegex})|maximum|niet\\s+{MoreRegex}|<\\s*=)' - LessOrEqualSuffix = f'((en|of)\\s+(minder|lager|kleiner)((?!\\s+(dan|als))|(\\s+(dan|als)(?!(\\s*\\d+)))))' - NumberSplitMark = f'(?![,.](?!\\d+))' - MoreRegexNoNumberSucceed = f'((groter|hoger|meer)((?!\\s+dan)|\\s+(dan(?!(\\s*\\d+))))|(boven|over)(?!(\\s*\\d+)))' - LessRegexNoNumberSucceed = f'((minder|lager|kleiner)((?!\\s+dan)|\\s+(dan(?!(\\s*\\d+))))|(beneden|onder)(?!(\\s*\\d+)))' - EqualRegexNoNumberSucceed = f'(gelijk((?!\\s+(aan|tot))|(\\s+(aan|tot)(?!(\\s*\\d+))))|evenveel(?!(\\s*\\d+)))' + LessOrEqual = ( + f'(({LessRegex}\\s+of\\s+{EqualRegex})|({EqualRegex}\\s+of\\s+{LessRegex})|maximum|niet\\s+{MoreRegex}|<\\s*=)' + ) + LessOrEqualSuffix = '((en|of)\\s+(minder|lager|kleiner)((?!\\s+(dan|als))|(\\s+(dan|als)(?!(\\s*\\d+)))))' + NumberSplitMark = '(?![,.](?!\\d+))' + MoreRegexNoNumberSucceed = '((groter|hoger|meer)((?!\\s+dan)|\\s+(dan(?!(\\s*\\d+))))|(boven|over)(?!(\\s*\\d+)))' + LessRegexNoNumberSucceed = ( + '((minder|lager|kleiner)((?!\\s+dan)|\\s+(dan(?!(\\s*\\d+))))|(beneden|onder)(?!(\\s*\\d+)))' + ) + EqualRegexNoNumberSucceed = '(gelijk((?!\\s+(aan|tot))|(\\s+(aan|tot)(?!(\\s*\\d+))))|evenveel(?!(\\s*\\d+)))' OneNumberRangeMoreRegex1 = f'({MoreOrEqual}|{MoreRegex})\\s*(de\\s+)?(?({NumberSplitMark}.)+)' OneNumberRangeMoreRegex2 = f'(?({NumberSplitMark}.)+)\\s*{MoreOrEqualSuffix}' OneNumberRangeMoreSeparateRegex = f'({EqualRegex}\\s+(?({NumberSplitMark}.)+)(\\s+of\\s+){MoreRegexNoNumberSucceed})|({MoreRegex}\\s+(?({NumberSplitMark}.)+)(\\s+of\\s+){EqualRegexNoNumberSucceed})' @@ -102,12 +116,14 @@ def DoubleWithoutIntegralRegex(placeholder): OneNumberRangeLessRegex2 = f'(?({NumberSplitMark}.)+)\\s*{LessOrEqualSuffix}' OneNumberRangeLessSeparateRegex = f'({EqualRegex}\\s+(?({NumberSplitMark}.)+)(\\s+of\\s+){LessRegexNoNumberSucceed})|({LessRegex}\\s+(?({NumberSplitMark}.)+)(\\s+of\\s+){EqualRegexNoNumberSucceed})' OneNumberRangeEqualRegex = f'{EqualRegex}\\s*(de\\s+)?(?({NumberSplitMark}.)+)' - TwoNumberRangeRegex1 = f'tussen\\s*(de\\s+)?(?({NumberSplitMark}.)+)\\s+en\\s+(de\\s+)?(?({NumberSplitMark}.)+)' + TwoNumberRangeRegex1 = ( + f'tussen\\s*(de\\s+)?(?({NumberSplitMark}.)+)\\s+en\\s+(de\\s+)?(?({NumberSplitMark}.)+)' + ) TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})\\s*(en|(,\\s*)?maar|,)\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})' TwoNumberRangeRegex3 = f'({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})\\s*(en|maar|,)\\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})' TwoNumberRangeRegex4 = f'(van\\s+)?(?({AllIntRegex}|{AllFloatRegex}|{AllOrdinalRegex}|{DigitsNumberRegex}))\\s*{TillRegex}\\s*(de\\s+)?(?({AllIntRegex}|{AllFloatRegex}|{AllOrdinalRegex}|{DigitsNumberRegex}))' TwoNumberRangeRegex5 = f'(van\\s+)?(?({AllIntRegex}|{AllFloatRegex}|{AllOrdinalRegex}|{DigitsNumberRegex}))\\s*{IncludeTillRegex}\\s*(de\\s+)?(?({AllIntRegex}|{AllFloatRegex}|{AllOrdinalRegex}|{DigitsNumberRegex}))' - AmbiguousFractionConnectorsRegex = f'^[.]' + AmbiguousFractionConnectorsRegex = '^[.]' DecimalSeparatorChar = ',' FractionMarkerToken = 'van de' NonDecimalSeparatorChar = '.' @@ -117,145 +133,167 @@ def DoubleWithoutIntegralRegex(placeholder): WrittenGroupSeparatorTexts = [r'punt'] WrittenIntegerSeparatorTexts = [r'en', r'ën'] WrittenFractionSeparatorTexts = [r'uit', r'van de', r'op de', r'en'] - HalfADozenRegex = f'(een\\s+)?half\\s+dozijn' + HalfADozenRegex = '(een\\s+)?half\\s+dozijn' DigitalNumberRegex = f'((?<=\\b)(honderd|duizend|miljoen|miljard|biljoen|dozijn?)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' - CardinalNumberMap = dict([("nul", 0), - ("een", 1), - ("één", 1), - ("twee", 2), - ("drie", 3), - ("vier", 4), - ("vijf", 5), - ("zes", 6), - ("zeven", 7), - ("acht", 8), - ("negen", 9), - ("tien", 10), - ("elf", 11), - ("twaalf", 12), - ("dozijn", 12), - ("dertien", 13), - ("veertien", 14), - ("vijftien", 15), - ("zestien", 16), - ("zeventien", 17), - ("achttien", 18), - ("negentien", 19), - ("twintig", 20), - ("dertig", 30), - ("veertig", 40), - ("vijftig", 50), - ("zestig", 60), - ("zeventig", 70), - ("tachtig", 80), - ("negentig", 90), - ("honderd", 100), - ("gros", 144), - ("duizend", 1000), - ("miljoen", 1000000), - ("miljard", 1000000000), - ("biljoen", 1000000000000)]) - OrdinalNumberMap = dict([("nulde", 0), - ("eerste", 1), - ("eende", 1), - ("tweede", 2), - ("secundair", 2), - ("half", 2), - ("halve", 2), - ("helft", 2), - ("derde", 3), - ("vierde", 4), - ("kwart", 4), - ("vijfde", 5), - ("vijfden", 5), - ("zesde", 6), - ("zevende", 7), - ("achtste", 8), - ("achtsten", 8), - ("negende", 9), - ("tiende", 10), - ("tienden", 10), - ("elfde", 11), - ("twaalfde", 12), - ("dertiende", 13), - ("veertiende", 14), - ("vijftiende", 15), - ("zestiende", 16), - ("zeventiende", 17), - ("achttiende", 18), - ("negentiende", 19), - ("twintigste", 20), - ("eenentwintigste", 21), - ("vijfentwintigste", 25), - ("vijventwintigste", 25), - ("dertigste", 30), - ("vijfendertigste", 35), - ("veertigste", 40), - ("vijfenveertigste", 45), - ("vijftigste", 50), - ("vijfenvijftigste", 55), - ("zestigste", 60), - ("vijfenzestigste", 65), - ("zeventigste", 70), - ("vijfenzeventigste", 75), - ("tachtigste", 80), - ("vijfentachtigste", 85), - ("negentigste", 90), - ("vijfennegentigste", 95), - ("honderdste", 100), - ("duizendste", 1000), - ("miljoenste", 1000000), - ("miljardste", 1000000000), - ("biljoenste", 1000000000000), - ("biljardste", 1000000000000000), - ("triljoenste", 1000000000000000000)]) - RoundNumberMap = dict([("honderd", 100), - ("duizend", 1000), - ("miljoen", 1000000), - ("miljard", 1000000000), - ("biljoen", 1000000000000), - ("biljard", 1000000000000000), - ("triljard", 1000000000000000000), - ("honderdste", 100), - ("duizendste", 1000), - ("miljoenste", 1000000), - ("miljardste", 1000000000), - ("biljoenste", 1000000000000), - ("biljardste", 1000000000000000), - ("triljoenste", 1000000000000000000), - ("honderdsten", 100), - ("duizendsten", 1000), - ("miljoensten", 1000000), - ("miljardsten", 1000000000), - ("biljoensten", 1000000000000), - ("dozijn", 12), - ("gros", 144), - ("k", 1000), - ("m", 1000000), - ("g", 1000000000), - ("b", 1000000000), - ("t", 1000000000000)]) + CardinalNumberMap = dict( + [ + ("nul", 0), + ("een", 1), + ("één", 1), + ("twee", 2), + ("drie", 3), + ("vier", 4), + ("vijf", 5), + ("zes", 6), + ("zeven", 7), + ("acht", 8), + ("negen", 9), + ("tien", 10), + ("elf", 11), + ("twaalf", 12), + ("dozijn", 12), + ("dertien", 13), + ("veertien", 14), + ("vijftien", 15), + ("zestien", 16), + ("zeventien", 17), + ("achttien", 18), + ("negentien", 19), + ("twintig", 20), + ("dertig", 30), + ("veertig", 40), + ("vijftig", 50), + ("zestig", 60), + ("zeventig", 70), + ("tachtig", 80), + ("negentig", 90), + ("honderd", 100), + ("gros", 144), + ("duizend", 1000), + ("miljoen", 1000000), + ("miljard", 1000000000), + ("biljoen", 1000000000000), + ] + ) + OrdinalNumberMap = dict( + [ + ("nulde", 0), + ("eerste", 1), + ("eende", 1), + ("tweede", 2), + ("secundair", 2), + ("half", 2), + ("halve", 2), + ("helft", 2), + ("derde", 3), + ("vierde", 4), + ("kwart", 4), + ("vijfde", 5), + ("vijfden", 5), + ("zesde", 6), + ("zevende", 7), + ("achtste", 8), + ("achtsten", 8), + ("negende", 9), + ("tiende", 10), + ("tienden", 10), + ("elfde", 11), + ("twaalfde", 12), + ("dertiende", 13), + ("veertiende", 14), + ("vijftiende", 15), + ("zestiende", 16), + ("zeventiende", 17), + ("achttiende", 18), + ("negentiende", 19), + ("twintigste", 20), + ("eenentwintigste", 21), + ("vijfentwintigste", 25), + ("vijventwintigste", 25), + ("dertigste", 30), + ("vijfendertigste", 35), + ("veertigste", 40), + ("vijfenveertigste", 45), + ("vijftigste", 50), + ("vijfenvijftigste", 55), + ("zestigste", 60), + ("vijfenzestigste", 65), + ("zeventigste", 70), + ("vijfenzeventigste", 75), + ("tachtigste", 80), + ("vijfentachtigste", 85), + ("negentigste", 90), + ("vijfennegentigste", 95), + ("honderdste", 100), + ("duizendste", 1000), + ("miljoenste", 1000000), + ("miljardste", 1000000000), + ("biljoenste", 1000000000000), + ("biljardste", 1000000000000000), + ("triljoenste", 1000000000000000000), + ] + ) + RoundNumberMap = dict( + [ + ("honderd", 100), + ("duizend", 1000), + ("miljoen", 1000000), + ("miljard", 1000000000), + ("biljoen", 1000000000000), + ("biljard", 1000000000000000), + ("triljard", 1000000000000000000), + ("honderdste", 100), + ("duizendste", 1000), + ("miljoenste", 1000000), + ("miljardste", 1000000000), + ("biljoenste", 1000000000000), + ("biljardste", 1000000000000000), + ("triljoenste", 1000000000000000000), + ("honderdsten", 100), + ("duizendsten", 1000), + ("miljoensten", 1000000), + ("miljardsten", 1000000000), + ("biljoensten", 1000000000000), + ("dozijn", 12), + ("gros", 144), + ("k", 1000), + ("m", 1000000), + ("g", 1000000000), + ("b", 1000000000), + ("t", 1000000000000), + ] + ) AmbiguityFiltersDict = dict([("^[.]", "")]) - RelativeReferenceOffsetMap = dict([("laatst", "0"), - ("laatste", "0"), - ("volgende", "1"), - ("huidige", "0"), - ("vorige", "-1"), - ("vorig", "-1"), - ("de op één na laatste", "-1"), - ("de een voor de laatste", "-1"), - ("die voor de laatste", "-1"), - ("voorlaatste", "-1"), - ("twee na laatste", "-2")]) - RelativeReferenceRelativeToMap = dict([("laatst", "end"), - ("laatste", "end"), - ("volgende", "current"), - ("huidige", "current"), - ("vorige", "current"), - ("vorig", "current"), - ("de op één na laatste", "end"), - ("de een voor de laatste", "end"), - ("die voor de laatste", "end"), - ("voorlaatste", "end"), - ("twee na laatste", "end")]) + RelativeReferenceOffsetMap = dict( + [ + ("laatst", "0"), + ("laatste", "0"), + ("volgende", "1"), + ("huidige", "0"), + ("vorige", "-1"), + ("vorig", "-1"), + ("de op één na laatste", "-1"), + ("de een voor de laatste", "-1"), + ("die voor de laatste", "-1"), + ("voorlaatste", "-1"), + ("twee na laatste", "-2"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("laatst", "end"), + ("laatste", "end"), + ("volgende", "current"), + ("huidige", "current"), + ("vorige", "current"), + ("vorig", "current"), + ("de op één na laatste", "end"), + ("de een voor de laatste", "end"), + ("die voor de laatste", "end"), + ("voorlaatste", "end"), + ("twee na laatste", "end"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/english_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/english_numeric.py index fb6532bc78..60c57bd673 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/english_numeric.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/english_numeric.py @@ -10,6 +10,8 @@ # ------------------------------------------------------------------------------ from .base_numbers import BaseNumbers + + # pylint: disable=line-too-long @@ -18,44 +20,49 @@ class EnglishNumeric: CompoundNumberLanguage = False MultiDecimalSeparatorCulture = True NonStandardSeparatorVariants = [r'en-za', r'en-na', r'en-zw'] - RoundNumberIntegerRegex = f'(?:hundred|thousand|million|mln|billion|bln|trillion|tln|lakh|crore)s?' - ZeroToNineIntegerRegex = f'(?:three|seven|eight|four|five|zero|n[ao]ught|nine|one|two|six)' - TwoToNineIntegerRegex = f'(?:three|seven|eight|four|five|nine|two|six)' - NegativeNumberTermsRegex = f'(?(minus|negative)\\s+)' + RoundNumberIntegerRegex = '(?:hundred|thousand|million|mln|billion|bln|trillion|tln|lakh|crore)s?' + ZeroToNineIntegerRegex = '(?:three|seven|eight|four|five|zero|n[ao]ught|nine|one|two|six)' + TwoToNineIntegerRegex = '(?:three|seven|eight|four|five|nine|two|six)' + NegativeNumberTermsRegex = '(?(minus|negative)\\s+)' NegativeNumberSignRegex = f'^{NegativeNumberTermsRegex}.*' - AnIntRegex = f'(an?)(?=\\s)' - TenToNineteenIntegerRegex = f'(?:seventeen|thirteen|fourteen|eighteen|nineteen|fifteen|sixteen|eleven|twelve|ten)' - TensNumberIntegerRegex = f'(?:seventy|twenty|thirty|eighty|ninety|forty|fifty|sixty)' + AnIntRegex = '(an?)(?=\\s)' + TenToNineteenIntegerRegex = '(?:seventeen|thirteen|fourteen|eighteen|nineteen|fifteen|sixteen|eleven|twelve|ten)' + TensNumberIntegerRegex = '(?:seventy|twenty|thirty|eighty|ninety|forty|fifty|sixty)' SeparaIntRegex = f'(?:(({TenToNineteenIntegerRegex}|({TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex})(\\s+{RoundNumberIntegerRegex})*))|(({AnIntRegex}(\\s+{RoundNumberIntegerRegex})+))' AllIntRegex = f'(?:((({TenToNineteenIntegerRegex}|({TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{AnIntRegex})(\\s+{RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*{SeparaIntRegex})' - PlaceHolderPureNumber = f'\\b' - PlaceHolderDefault = f'(?=\\D)|\\b' - PlaceHolderMixed = f'\\D|\\b' + PlaceHolderPureNumber = '\\b' + PlaceHolderDefault = '(?=\\D)|\\b' + PlaceHolderMixed = '\\D|\\b' def NumbersWithPlaceHolder(placeholder): return f'(((?(next|previous|current)\\s+one|(the\\s+second|next)\\s+to\\s+last|the\\s+one\\s+before\\s+the\\s+last(\\s+one)?|the\\s+last\\s+but\\s+one|(ante)?penultimate|last|next|previous|current)' + RoundNumberOrdinalRegex = '(?:hundredth|thousandth|millionth|billionth|trillionth)' + NumberOrdinalRegex = '(?:first|second|third|fourth|fifth|sixth|seventh|eighth|nine?th|tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|thirtieth|fortieth|fiftieth|sixtieth|seventieth|eightieth|ninetieth)' + RelativeOrdinalRegex = '(?(next|previous|current)\\s+one|(the\\s+second|next)\\s+to\\s+last|the\\s+one\\s+before\\s+the\\s+last(\\s+one)?|the\\s+last\\s+but\\s+one|(ante)?penultimate|last|next|previous|current)' SuffixBasicOrdinalRegex = f'(?:(((({TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{AnIntRegex})(\\s+{RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*({TensNumberIntegerRegex}(\\s+|\\s*-\\s*))?{NumberOrdinalRegex})' SuffixRoundNumberOrdinalRegex = f'(?:({AllIntRegex}\\s+){RoundNumberOrdinalRegex})' AllOrdinalNumberRegex = f'(?:{SuffixBasicOrdinalRegex}|{SuffixRoundNumberOrdinalRegex})' AllOrdinalRegex = f'(?:{AllOrdinalNumberRegex}|{RelativeOrdinalRegex})' - OrdinalSuffixRegex = f'(?<=\\b)(?:(\\d*(1st|2nd|3rd|[4-90]th))|(1[1-2]th))(?=\\b)' - OrdinalNumericRegex = f'(?<=\\b)(?:\\d{{1,3}}(\\s*,\\s*\\d{{3}})*\\s*th)(?=\\b)' + OrdinalSuffixRegex = '(?<=\\b)(?:(\\d*(1st|2nd|3rd|[4-90]th))|(1[1-2]th))(?=\\b)' + OrdinalNumericRegex = '(?<=\\b)(?:\\d{1,3}(\\s*,\\s*\\d{3})*\\s*th)(?=\\b)' OrdinalRoundNumberRegex = f'(?\\s+and\\s+(a|one|{TwoToNineIntegerRegex})\\s+(half|quarter|third|fourth|fifth|sixth|seventh|eighth|nine?th|tenth)s?)' RoundMultiplierWithFraction = f'(?<=(?(?:million|mln|billion|bln|trillion|tln)s?)(?={FractionMultiplierRegex}?$)' - RoundMultiplierRegex = f'\\b\\s*((of\\s+)?a\\s+)?({RoundMultiplierWithFraction}|(?(?:hundred|thousand|lakh|crore)s?)$)' + RoundMultiplierRegex = ( + f'\\b\\s*((of\\s+)?a\\s+)?({RoundMultiplierWithFraction}|(?(?:hundred|thousand|lakh|crore)s?)$)' + ) FractionNounRegex = f'(?<=\\b)({AllIntRegex}\\s+(and\\s+)?)?(({AllIntRegex})(\\s+|\\s*-\\s*)((({AllOrdinalNumberRegex})|({RoundNumberOrdinalRegex}))s|halves|quarters)((\\s+of\\s+a)?\\s+{RoundNumberIntegerRegex})?|(half(\\s+a)?|quarter(\\s+of\\s+a)?)\\s+{RoundNumberIntegerRegex})(?=\\b)' FractionNounWithArticleRegex = f'(?<=\\b)(((({AllIntRegex}|{RoundNumberIntegerRegexWithLocks})\\s+(and\\s+)?)?(an?|one)(\\s+|\\s*-\\s*)(?!\\bfirst\\b|\\bsecond\\b)(({AllOrdinalNumberRegex})|({RoundNumberOrdinalRegex})|(half|quarter)(((\\s+of)?\\s+a)?\\s+{RoundNumberIntegerRegex})?))|(half))(?=\\b)' FractionPrepositionRegex = f'(?({AllIntRegex})|((?in|out\\s+of))\\s+(?({AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)' @@ -68,31 +75,37 @@ def NumbersWithPlaceHolder(placeholder): def DoubleDecimalPointRegex(placeholder): return f'(((?and)' - NumberWithSuffixPercentage = f'(?and)' FractionNumberWithSuffixPercentage = f'(({BaseNumbers.FractionNumberReplaceToken})\\s+of)' - NumberWithPrefixPercentage = f'(per\\s*cents?\\s+of)(\\s*)({BaseNumbers.NumberReplaceToken})' - NumberWithPrepositionPercentage = f'({BaseNumbers.NumberReplaceToken})\\s*(in|out\\s+of)\\s*({BaseNumbers.NumberReplaceToken})' - TillRegex = f'((?)' - LessRegex = f'(?:(less|lower|smaller|fewer)(\\s+than)?|below|under|(?|=)<)' - EqualRegex = f'(equal(s|ing)?(\\s+(to|than))?|(?)=)' + NumberWithPrepositionPercentage = ( + f'({BaseNumbers.NumberReplaceToken})\\s*(in|out\\s+of)\\s*({BaseNumbers.NumberReplaceToken})' + ) + TillRegex = '((?)' + LessRegex = '(?:(less|lower|smaller|fewer)(\\s+than)?|below|under|(?|=)<)' + EqualRegex = '(equal(s|ing)?(\\s+(to|than))?|(?)=)' MoreOrEqualPrefix = f'((no\\s+{LessRegex})|(at\\s+least))' MoreOrEqual = f'(?:({MoreRegex}\\s+(or)?\\s+{EqualRegex})|({EqualRegex}\\s+(or)?\\s+{MoreRegex})|{MoreOrEqualPrefix}(\\s+(or)?\\s+{EqualRegex})?|({EqualRegex}\\s+(or)?\\s+)?{MoreOrEqualPrefix}|>\\s*=|≥)' - MoreOrEqualSuffix = f'((and|or)\\s+(((more|greater|higher|larger|bigger)((?!\\s+than)|(\\s+than(?!((\\s+or\\s+equal\\s+to)?\\s*\\d+)))))|((over|above)(?!\\s+than))))' + MoreOrEqualSuffix = '((and|or)\\s+(((more|greater|higher|larger|bigger)((?!\\s+than)|(\\s+than(?!((\\s+or\\s+equal\\s+to)?\\s*\\d+)))))|((over|above)(?!\\s+than))))' LessOrEqualPrefix = f'((no\\s+{MoreRegex})|(at\\s+most)|(up\\s+to))' LessOrEqual = f'(({LessRegex}\\s+(or)?\\s+{EqualRegex})|({EqualRegex}\\s+(or)?\\s+{LessRegex})|{LessOrEqualPrefix}(\\s+(or)?\\s+{EqualRegex})?|({EqualRegex}\\s+(or)?\\s+)?{LessOrEqualPrefix}|<\\s*=|≤)' - LessOrEqualSuffix = f'((and|or)\\s+(less|lower|smaller|fewer)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))' + LessOrEqualSuffix = '((and|or)\\s+(less|lower|smaller|fewer)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))' NumberSplitMark = f'(?![,.](?!\\d+))(?!\\s*\\b(and\\s+({LessRegex}|{MoreRegex})|but|or|to)\\b)' - MoreRegexNoNumberSucceed = f'((bigger|greater|more|higher|larger)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(above|over)(?!(\\s*\\d+)))' - LessRegexNoNumberSucceed = f'((less|lower|smaller|fewer)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(below|under)(?!(\\s*\\d+)))' - EqualRegexNoNumberSucceed = f'(equal(s|ing)?((?!\\s+(to|than))|(\\s+(to|than)(?!(\\s*\\d+)))))' + MoreRegexNoNumberSucceed = ( + '((bigger|greater|more|higher|larger)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(above|over)(?!(\\s*\\d+)))' + ) + LessRegexNoNumberSucceed = ( + '((less|lower|smaller|fewer)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(below|under)(?!(\\s*\\d+)))' + ) + EqualRegexNoNumberSucceed = '(equal(s|ing)?((?!\\s+(to|than))|(\\s+(to|than)(?!(\\s*\\d+)))))' OneNumberRangeMoreRegex1 = f'({MoreOrEqual}|{MoreRegex})\\s*(the\\s+)?(?({NumberSplitMark}.)+)' OneNumberRangeMoreRegex1LB = f'(?({NumberSplitMark}.)+)\\s*{MoreOrEqualSuffix}' @@ -102,11 +115,13 @@ def DoubleWithoutIntegralRegex(placeholder): OneNumberRangeLessRegex2 = f'(?({NumberSplitMark}.)+)\\s*{LessOrEqualSuffix}' OneNumberRangeLessSeparateRegex = f'({EqualRegex}\\s+(?({NumberSplitMark}.)+)(\\s+or\\s+){LessRegexNoNumberSucceed})|({LessRegex}\\s+(?({NumberSplitMark}.)+)(\\s+or\\s+){EqualRegexNoNumberSucceed})' OneNumberRangeEqualRegex = f'(?({NumberSplitMark}.)+)' - TwoNumberRangeRegex1 = f'between\\s*(the\\s+)?(?({NumberSplitMark}.)+)\\s*and\\s*(the\\s+)?(?({NumberSplitMark}.)+)' + TwoNumberRangeRegex1 = ( + f'between\\s*(the\\s+)?(?({NumberSplitMark}.)+)\\s*and\\s*(the\\s+)?(?({NumberSplitMark}.)+)' + ) TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})\\s*(and|but|,)\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})' TwoNumberRangeRegex3 = f'({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})\\s*(and|but|,)\\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})' TwoNumberRangeRegex4 = f'(from\\s+)?(?({NumberSplitMark}(?!\\bfrom\\b).)+)\\s*{TillRegex}\\s*(the\\s+)?(?({NumberSplitMark}.)+)' - AmbiguousFractionConnectorsRegex = f'(\\bin\\b)' + AmbiguousFractionConnectorsRegex = '(\\bin\\b)' DecimalSeparatorChar = '.' FractionMarkerToken = 'over' NonDecimalSeparatorChar = ',' @@ -116,200 +131,222 @@ def DoubleWithoutIntegralRegex(placeholder): WrittenGroupSeparatorTexts = [r'punto'] WrittenIntegerSeparatorTexts = [r'and'] WrittenFractionSeparatorTexts = [r'and'] - HalfADozenRegex = f'half\\s+a\\s+dozen' + HalfADozenRegex = 'half\\s+a\\s+dozen' DigitalNumberRegex = f'((?<=\\b)(hundred|thousand|[mb]illion|trillion|[mbt]ln|lakh|crore|(doz(en)?|dz)s?)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' - CardinalNumberMap = dict([("a", 1), - ("zero", 0), - ("naught", 0), - ("nought", 0), - ("an", 1), - ("one", 1), - ("two", 2), - ("three", 3), - ("four", 4), - ("five", 5), - ("six", 6), - ("seven", 7), - ("eight", 8), - ("nine", 9), - ("ten", 10), - ("eleven", 11), - ("twelve", 12), - ("dozen", 12), - ("dozens", 12), - ("dz", 12), - ("doz", 12), - ("dzs", 12), - ("dozs", 12), - ("thirteen", 13), - ("fourteen", 14), - ("fifteen", 15), - ("sixteen", 16), - ("seventeen", 17), - ("eighteen", 18), - ("nineteen", 19), - ("twenty", 20), - ("thirty", 30), - ("forty", 40), - ("fifty", 50), - ("sixty", 60), - ("seventy", 70), - ("eighty", 80), - ("ninety", 90), - ("hundred", 100), - ("thousand", 1000), - ("million", 1000000), - ("mln", 1000000), - ("billion", 1000000000), - ("bln", 1000000000), - ("trillion", 1000000000000), - ("tln", 1000000000000), - ("lakh", 100000), - ("crore", 10000000), - ("hundreds", 100), - ("thousands", 1000), - ("millions", 1000000), - ("billions", 1000000000), - ("trillions", 1000000000000), - ("lakhs", 100000), - ("crores", 10000000)]) - OrdinalNumberMap = dict([("first", 1), - ("second", 2), - ("secondary", 2), - ("half", 2), - ("third", 3), - ("fourth", 4), - ("quarter", 4), - ("fifth", 5), - ("sixth", 6), - ("seventh", 7), - ("eighth", 8), - ("ninth", 9), - ("nineth", 9), - ("tenth", 10), - ("eleventh", 11), - ("twelfth", 12), - ("thirteenth", 13), - ("fourteenth", 14), - ("fifteenth", 15), - ("sixteenth", 16), - ("seventeenth", 17), - ("eighteenth", 18), - ("nineteenth", 19), - ("twentieth", 20), - ("thirtieth", 30), - ("fortieth", 40), - ("fiftieth", 50), - ("sixtieth", 60), - ("seventieth", 70), - ("eightieth", 80), - ("ninetieth", 90), - ("hundredth", 100), - ("thousandth", 1000), - ("millionth", 1000000), - ("billionth", 1000000000), - ("trillionth", 1000000000000), - ("firsts", 1), - ("halves", 2), - ("thirds", 3), - ("fourths", 4), - ("quarters", 4), - ("fifths", 5), - ("sixths", 6), - ("sevenths", 7), - ("eighths", 8), - ("ninths", 9), - ("nineths", 9), - ("tenths", 10), - ("elevenths", 11), - ("twelfths", 12), - ("thirteenths", 13), - ("fourteenths", 14), - ("fifteenths", 15), - ("sixteenths", 16), - ("seventeenths", 17), - ("eighteenths", 18), - ("nineteenths", 19), - ("twentieths", 20), - ("thirtieths", 30), - ("fortieths", 40), - ("fiftieths", 50), - ("sixtieths", 60), - ("seventieths", 70), - ("eightieths", 80), - ("ninetieths", 90), - ("hundredths", 100), - ("thousandths", 1000), - ("millionths", 1000000), - ("billionths", 1000000000), - ("trillionths", 1000000000000)]) - RoundNumberMap = dict([("hundred", 100), - ("thousand", 1000), - ("million", 1000000), - ("mln", 1000000), - ("billion", 1000000000), - ("bln", 1000000000), - ("trillion", 1000000000000), - ("tln", 1000000000000), - ("lakh", 100000), - ("crore", 10000000), - ("hundreds", 100), - ("thousands", 1000), - ("millions", 1000000), - ("billions", 1000000000), - ("trillions", 1000000000000), - ("lakhs", 100000), - ("crores", 10000000), - ("hundredth", 100), - ("thousandth", 1000), - ("millionth", 1000000), - ("billionth", 1000000000), - ("trillionth", 1000000000000), - ("hundredths", 100), - ("thousandths", 1000), - ("millionths", 1000000), - ("billionths", 1000000000), - ("trillionths", 1000000000000), - ("dozen", 12), - ("dozens", 12), - ("dz", 12), - ("doz", 12), - ("dzs", 12), - ("dozs", 12), - ("k", 1000), - ("m", 1000000), - ("mm", 1000000), - ("mil", 1000000), - ("g", 1000000000), - ("b", 1000000000), - ("t", 1000000000000)]) + CardinalNumberMap = dict( + [ + ("a", 1), + ("zero", 0), + ("naught", 0), + ("nought", 0), + ("an", 1), + ("one", 1), + ("two", 2), + ("three", 3), + ("four", 4), + ("five", 5), + ("six", 6), + ("seven", 7), + ("eight", 8), + ("nine", 9), + ("ten", 10), + ("eleven", 11), + ("twelve", 12), + ("dozen", 12), + ("dozens", 12), + ("dz", 12), + ("doz", 12), + ("dzs", 12), + ("dozs", 12), + ("thirteen", 13), + ("fourteen", 14), + ("fifteen", 15), + ("sixteen", 16), + ("seventeen", 17), + ("eighteen", 18), + ("nineteen", 19), + ("twenty", 20), + ("thirty", 30), + ("forty", 40), + ("fifty", 50), + ("sixty", 60), + ("seventy", 70), + ("eighty", 80), + ("ninety", 90), + ("hundred", 100), + ("thousand", 1000), + ("million", 1000000), + ("mln", 1000000), + ("billion", 1000000000), + ("bln", 1000000000), + ("trillion", 1000000000000), + ("tln", 1000000000000), + ("lakh", 100000), + ("crore", 10000000), + ("hundreds", 100), + ("thousands", 1000), + ("millions", 1000000), + ("billions", 1000000000), + ("trillions", 1000000000000), + ("lakhs", 100000), + ("crores", 10000000), + ] + ) + OrdinalNumberMap = dict( + [ + ("first", 1), + ("second", 2), + ("secondary", 2), + ("half", 2), + ("third", 3), + ("fourth", 4), + ("quarter", 4), + ("fifth", 5), + ("sixth", 6), + ("seventh", 7), + ("eighth", 8), + ("ninth", 9), + ("nineth", 9), + ("tenth", 10), + ("eleventh", 11), + ("twelfth", 12), + ("thirteenth", 13), + ("fourteenth", 14), + ("fifteenth", 15), + ("sixteenth", 16), + ("seventeenth", 17), + ("eighteenth", 18), + ("nineteenth", 19), + ("twentieth", 20), + ("thirtieth", 30), + ("fortieth", 40), + ("fiftieth", 50), + ("sixtieth", 60), + ("seventieth", 70), + ("eightieth", 80), + ("ninetieth", 90), + ("hundredth", 100), + ("thousandth", 1000), + ("millionth", 1000000), + ("billionth", 1000000000), + ("trillionth", 1000000000000), + ("firsts", 1), + ("halves", 2), + ("thirds", 3), + ("fourths", 4), + ("quarters", 4), + ("fifths", 5), + ("sixths", 6), + ("sevenths", 7), + ("eighths", 8), + ("ninths", 9), + ("nineths", 9), + ("tenths", 10), + ("elevenths", 11), + ("twelfths", 12), + ("thirteenths", 13), + ("fourteenths", 14), + ("fifteenths", 15), + ("sixteenths", 16), + ("seventeenths", 17), + ("eighteenths", 18), + ("nineteenths", 19), + ("twentieths", 20), + ("thirtieths", 30), + ("fortieths", 40), + ("fiftieths", 50), + ("sixtieths", 60), + ("seventieths", 70), + ("eightieths", 80), + ("ninetieths", 90), + ("hundredths", 100), + ("thousandths", 1000), + ("millionths", 1000000), + ("billionths", 1000000000), + ("trillionths", 1000000000000), + ] + ) + RoundNumberMap = dict( + [ + ("hundred", 100), + ("thousand", 1000), + ("million", 1000000), + ("mln", 1000000), + ("billion", 1000000000), + ("bln", 1000000000), + ("trillion", 1000000000000), + ("tln", 1000000000000), + ("lakh", 100000), + ("crore", 10000000), + ("hundreds", 100), + ("thousands", 1000), + ("millions", 1000000), + ("billions", 1000000000), + ("trillions", 1000000000000), + ("lakhs", 100000), + ("crores", 10000000), + ("hundredth", 100), + ("thousandth", 1000), + ("millionth", 1000000), + ("billionth", 1000000000), + ("trillionth", 1000000000000), + ("hundredths", 100), + ("thousandths", 1000), + ("millionths", 1000000), + ("billionths", 1000000000), + ("trillionths", 1000000000000), + ("dozen", 12), + ("dozens", 12), + ("dz", 12), + ("doz", 12), + ("dzs", 12), + ("dozs", 12), + ("k", 1000), + ("m", 1000000), + ("mm", 1000000), + ("mil", 1000000), + ("g", 1000000000), + ("b", 1000000000), + ("t", 1000000000000), + ] + ) AmbiguityFiltersDict = dict([("\\bone\\b", "\\b(the|this|that|which)\\s+(one)\\b")]) - RelativeReferenceOffsetMap = dict([("last", "0"), - ("next one", "1"), - ("current", "0"), - ("current one", "0"), - ("previous one", "-1"), - ("the second to last", "-1"), - ("the one before the last one", "-1"), - ("the one before the last", "-1"), - ("next to last", "-1"), - ("penultimate", "-1"), - ("the last but one", "-1"), - ("antepenultimate", "-2"), - ("next", "1"), - ("previous", "-1")]) - RelativeReferenceRelativeToMap = dict([("last", "end"), - ("next one", "current"), - ("previous one", "current"), - ("current", "current"), - ("current one", "current"), - ("the second to last", "end"), - ("the one before the last one", "end"), - ("the one before the last", "end"), - ("next to last", "end"), - ("penultimate", "end"), - ("the last but one", "end"), - ("antepenultimate", "end"), - ("next", "current"), - ("previous", "current")]) + RelativeReferenceOffsetMap = dict( + [ + ("last", "0"), + ("next one", "1"), + ("current", "0"), + ("current one", "0"), + ("previous one", "-1"), + ("the second to last", "-1"), + ("the one before the last one", "-1"), + ("the one before the last", "-1"), + ("next to last", "-1"), + ("penultimate", "-1"), + ("the last but one", "-1"), + ("antepenultimate", "-2"), + ("next", "1"), + ("previous", "-1"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("last", "end"), + ("next one", "current"), + ("previous one", "current"), + ("current", "current"), + ("current one", "current"), + ("the second to last", "end"), + ("the one before the last one", "end"), + ("the one before the last", "end"), + ("next to last", "end"), + ("penultimate", "end"), + ("the last but one", "end"), + ("antepenultimate", "end"), + ("next", "current"), + ("previous", "current"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/french_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/french_numeric.py index 14fdcf4371..941a276c41 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/french_numeric.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/french_numeric.py @@ -10,6 +10,8 @@ # ------------------------------------------------------------------------------ from .base_numbers import BaseNumbers + + # pylint: disable=line-too-long @@ -17,51 +19,62 @@ class FrenchNumeric: LangMarker = 'Fre' CompoundNumberLanguage = False MultiDecimalSeparatorCulture = True - RoundNumberIntegerRegex = f'(cent|mille|millions?|milliards?|billions?)' - ZeroToNineIntegerRegex = f'(une?|deux|trois|quatre|cinq|six|sept|huit|neuf|z[ée]ro)' - TwoToNineIntegerRegex = f'(deux|trois|quatre|cinq|six|sept|huit|neuf)' - TenToNineteenIntegerRegex = f'((seize|quinze|quatorze|treize|douze|onze)|dix(\\Wneuf|\\Whuit|\\Wsept)?)' - TensNumberIntegerRegex = f'(quatre\\Wvingt(s|\\Wdix)?|soixante(\\Wdix)?|vingt|trente|quarante|cinquante|septante|octante|huitante|nonante)' - DigitsNumberRegex = f'\\d|\\d{{1,3}}(\\.\\d{{3}})' - NegativeNumberTermsRegex = f'^[.]' + RoundNumberIntegerRegex = '(cent|mille|mil|millions?|milliards?|billions?)' + ZeroToNineIntegerRegex = '(une?|deux|trois|quatre|cinq|six|sept|huit|neuf|z[ée]ro)' + TwoToNineIntegerRegex = '(deux|trois|quatre|cinq|six|sept|huit|neuf)' + TenToNineteenIntegerRegex = '((seize|quinze|quatorze|treize|douze|onze)|dix(\\Wneuf|\\Whuit|\\Wsept)?)' + TensNumberIntegerRegex = '(quatre\\Wvingt(s|\\Wdix)?|soixante(\\Wdix)?|vingt|trente|quarante|cinquante|septante|octante|huitante|nonante)' + DigitsNumberRegex = '\\d|\\d{1,3}(\\.\\d{3})' + NegativeNumberTermsRegex = '^[.]' NegativeNumberSignRegex = f'^({NegativeNumberTermsRegex}\\s+).*' - HundredsNumberIntegerRegex = f'(({ZeroToNineIntegerRegex}(\\s+cent))|cent|((\\s+cent\\s)+{TensNumberIntegerRegex}))' - BelowHundredsRegex = f'(({TenToNineteenIntegerRegex}|({TensNumberIntegerRegex}((-|(\\s+et)?\\s+)({TenToNineteenIntegerRegex}|{ZeroToNineIntegerRegex}))?))|{ZeroToNineIntegerRegex})' - BelowThousandsRegex = f'(({HundredsNumberIntegerRegex}(\\s+{BelowHundredsRegex})?|{BelowHundredsRegex}|{TenToNineteenIntegerRegex})|cent\\s+{TenToNineteenIntegerRegex})' - SupportThousandsRegex = f'(({BelowThousandsRegex}|{BelowHundredsRegex})\\s+{RoundNumberIntegerRegex}(\\s+{RoundNumberIntegerRegex})?)' - SeparaIntRegex = f'({SupportThousandsRegex}(\\s+{SupportThousandsRegex})*(\\s+{BelowThousandsRegex})?|{BelowThousandsRegex})' - AllIntRegex = f'({SeparaIntRegex}|mille(\\s+{BelowThousandsRegex})?)' + HundredsNumberIntegerRegex = ( + f'(({ZeroToNineIntegerRegex}((\\s+|-)cents?))|cent|((\\s+cents?(\\s|-))+{TensNumberIntegerRegex}))' + ) + BelowHundredsRegex = f'(({TenToNineteenIntegerRegex}|({TensNumberIntegerRegex}((((\\s+|-)et)?(\\s+|-)|-)({TenToNineteenIntegerRegex}|{ZeroToNineIntegerRegex}))?))|{ZeroToNineIntegerRegex})' + BelowThousandsRegex = f'(({HundredsNumberIntegerRegex}((((\\s+|-)et)?(\\s+|-)|-)?{BelowHundredsRegex})?|{BelowHundredsRegex}|{TenToNineteenIntegerRegex})|cents?(\\s+|\\-){TenToNineteenIntegerRegex})' + SupportThousandsRegex = ( + f'(({BelowThousandsRegex}|{BelowHundredsRegex})\\s+{RoundNumberIntegerRegex}(\\s+{RoundNumberIntegerRegex})?)' + ) + SeparaIntRegex = ( + f'({SupportThousandsRegex}(\\s+{SupportThousandsRegex})*(\\s+{BelowThousandsRegex})?|{BelowThousandsRegex})' + ) + AllIntRegex = f'({SeparaIntRegex}|(mille|mil)(\\s+{BelowThousandsRegex})?)' def NumbersWithPlaceHolder(placeholder): return f'(((?prochain[es]?|pr[eé]c[eé]dent[es]?|(l[’\'])?actuel(le)?(\\s+une?)?|(l[’\'])?avant(\\s+|-)derniere?|(ant[eé])?p[eé]nulti[eè]me|derni[eè]r[es]?|suivant[es]?|courant[es]?|cel(le|ui)\\s+d[\'’]avant\\s+l[ae]\\s+derni[èe]re?)' + RelativeOrdinalRegex = '(?prochain[es]?|pr[eé]c[eé]dent[es]?|(l[’\'])?actuel(le)?(\\s+une?)?|(l[’\'])?avant(\\s+|-)derniere?|(ant[eé])?p[eé]nulti[eè]me|derni[eè]r[es]?|suivant[es]?|courant[es]?|cel(le|ui)\\s+d[\'’]avant\\s+l[ae]\\s+derni[èe]re?)' ComplexOrdinalRegex = f'(({OverThousandOrdinalRegex}(\\s)?)?{UnderThousandOrdinalRegex}|{OverThousandOrdinalRegex}|{UnderHundredOrdinalRegex})' SuffixOrdinalRegex = f'(({AllIntRegex})({SimpleRoundOrdinalRegex}))' ComplexRoundOrdinalRegex = f'((({SuffixOrdinalRegex}(\\s)?)?{ComplexOrdinalRegex})|{SuffixOrdinalRegex})' AllOrdinalNumberRegex = f'({ComplexOrdinalRegex}|{SimpleRoundOrdinalRegex}|{ComplexRoundOrdinalRegex})' AllOrdinalRegex = f'(?:{AllOrdinalNumberRegex}|{RelativeOrdinalRegex})' - PlaceHolderPureNumber = f'\\b' - PlaceHolderDefault = f'\\D|\\b' - OrdinalSuffixRegex = f'(?<=\\b)((\\d*(11e(me)?|1[eè]re?|[02-9]e(me)?)))(?=\\b)' + PlaceHolderPureNumber = '\\b' + PlaceHolderDefault = '\\D|\\b' + OrdinalSuffixRegex = '(?<=\\b)((\\d*(11e(me)?|1[eè]re?|[02-9]e(me)?)))(?=\\b)' OrdinalFrenchRegex = f'(?<=\\b){AllOrdinalRegex}(?=\\b)' - FractionNotationWithSpacesRegex = f'(((?<=\\W|^)-\\s*)|(?<=\\b))\\d+\\s+\\d+[/]\\d+(?=(\\b[^/]|$))' + FractionNotationWithSpacesRegex = '(((?<=\\W|^)-\\s*)|(?<=\\b))\\d+\\s+\\d+[/]\\d+(?=(\\b[^/]|$))' FractionNotationRegex = f'{BaseNumbers.FractionNotationRegex}' FractionMultiplierRegex = f'(?\\s+et\\s+(demi[es]?|(une?|{TwoToNineIntegerRegex})\\s+(demie?|tier|quart|(cinqui|sixi|septi|hui[tr]i|neuvi|dixi)[eè]me)s?))' RoundMultiplierWithFraction = f'(?(millions?|milliards?|billions?))(?={FractionMultiplierRegex}?$)' - RoundMultiplierRegex = f'\\b\\s*({RoundMultiplierWithFraction}|(?(cent|mille))$)' + RoundMultiplierRegex = f'\\b\\s*({RoundMultiplierWithFraction}|(?(cent|mille|mil))$)' FractionNounRegex = f'(?<=\\b)({AllIntRegex}\\s+((et)\\s+)?)?({AllIntRegex}(\\s+((et)\\s)?)(({AllOrdinalNumberRegex}s?|{SuffixOrdinalRegex}s?)|(demi[es]?|tiers?|quarts?))|(un\\s+)?(demi|tier|quart)(\\s+(de\\s+)?|\\s*-\\s*){RoundNumberIntegerRegex})(?=\\b)' FractionNounWithArticleRegex = f'(?<=\\b)(({AllIntRegex}|{RoundNumberIntegerRegexWithLocks})\\s+(et\\s+)?)?((une?)(\\s+)(({AllOrdinalNumberRegex})|({SuffixOrdinalRegex})|(et\\s+)?demi[es]?)|demi[es]?)(?=\\b)' FractionPrepositionRegex = f'(?({AllIntRegex})|((?({AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)' @@ -73,27 +86,32 @@ def DoubleDecimalPointRegex(placeholder): def DoubleWithoutIntegralRegex(placeholder): return f'(?<=\\s|^)(?)' - LessRegex = f'(?:(less|plus\\s+(bas|petit|jeune)|moins|inf[ée]rieure?s?)(\\s+([àa]|d[e\'’]|que))?|((en )?dessous)\\s+de|under|(?|=)<)' - EqualRegex = f'(([ée]ga(l(es)?|ux)|au\\s+nombre)(\\s+([àa]|d[e\'’]))?|(?)=)' + DoubleExponentialNotationRegex = ( + '(((?)' + LessRegex = '(?:(less|plus\\s+(bas|petit|jeune)|moins|inf[ée]rieure?s?)(\\s+([àa]|d[e\'’]|que))?|((en )?dessous)\\s+de|under|(?|=)<)' + EqualRegex = '(([ée]ga(l(es)?|ux)|au\\s+nombre)(\\s+([àa]|d[e\'’]))?|(?)=)' MoreOrEqualPrefix = f'((pas\\s+{LessRegex})|(au\\s+moins|[àa] partir d[e\'’]))' MoreOrEqual = f'(?:({MoreRegex}\\s+(ou)?\\s+{EqualRegex})|({EqualRegex}\\s+(ou)?\\s+{MoreRegex})|{MoreOrEqualPrefix}(\\s+(ou)?\\s+{EqualRegex})?|({EqualRegex}\\s+(ou)?\\s+)?{MoreOrEqualPrefix}|>\\s*=|≥)' - MoreOrEqualSuffix = f'((et|ou)\\s+(((more|greater|higher|plus(\\s+grand)?|sup[ée]rieure?s?)((?!\\s+([àa]|que))|(\\s+([àa]|que)(?!((\\s+ou\\s+[èe]ga(l(es)?|ux)\\s+[àa])?\\s*\\d+)))))|((a plus|au-dessus)\\s+d[e\'’](?!\\s+than))))' + MoreOrEqualSuffix = '((et|ou)\\s+(((more|greater|higher|plus(\\s+grand)?|sup[ée]rieure?s?)((?!\\s+([àa]|que))|(\\s+([àa]|que)(?!((\\s+ou\\s+[èe]ga(l(es)?|ux)\\s+[àa])?\\s*\\d+)))))|((a plus|au-dessus)\\s+d[e\'’](?!\\s+than))))' LessOrEqualPrefix = f'((pas\\s+{MoreRegex})|(au\\s+plus)|(jusqu\'[àa]))' LessOrEqual = f'(({LessRegex}\\s+(ou)?\\s+{EqualRegex})|({EqualRegex}\\s+(ou)?\\s+{LessRegex})|{LessOrEqualPrefix}(\\s+(ou)?\\s+{EqualRegex})?|({EqualRegex}\\s+(ou)?\\s+)?{LessOrEqualPrefix}|<\\s*=|≤)' - LessOrEqualSuffix = f'((et|ou)\\s+(less|lower|plus petit|moins|inf[ée]rieure?s?)((?!\\s+([àa]|de|que))|(\\s+([àa]|d[e\'’]|que)(?!(\\s*\\d+)))))' + LessOrEqualSuffix = '((et|ou)\\s+(less|lower|plus petit|moins|inf[ée]rieure?s?)((?!\\s+([àa]|de|que))|(\\s+([àa]|d[e\'’]|que)(?!(\\s*\\d+)))))' NumberSplitMark = f'(?![,.](?!\\d+))(?!\\s*\\b(et\\s+({LessRegex}|{MoreRegex})|mais|ou|to)\\b)' - MoreRegexNoNumberSucceed = f'((bigger|greater|more|plus(\\s+grand)?|sup[ée]rieure?s?)((?!\\s+([àa]|que))|\\s+(([àa]|que)(?!(\\s*\\d+))))|((au-dessus|a plus)\\s+d[e\'’])(?!(\\s*\\d+)))' - LessRegexNoNumberSucceed = f'((less|lower|plus petit|moins|inf[ée]rieure?s?)((?!\\s+([àa]|d[e\'’]|que))|\\s+(([àa]|d[e\'’]|que)(?!(\\s*\\d+))))|(((en )?dessous)\\s+d[e\'’]|under)(?!(\\s*\\d+)))' - EqualRegexNoNumberSucceed = f'([èe]ga(l(es)?|ux)((?!\\s+([àa]))|(\\s+([àa]|que)(?!(\\s*\\d+)))))' + MoreRegexNoNumberSucceed = '((bigger|greater|more|plus(\\s+grand)?|sup[ée]rieure?s?)((?!\\s+([àa]|que))|\\s+(([àa]|que)(?!(\\s*\\d+))))|((au-dessus|a plus)\\s+d[e\'’])(?!(\\s*\\d+)))' + LessRegexNoNumberSucceed = '((less|lower|plus petit|moins|inf[ée]rieure?s?)((?!\\s+([àa]|d[e\'’]|que))|\\s+(([àa]|d[e\'’]|que)(?!(\\s*\\d+))))|(((en )?dessous)\\s+d[e\'’]|under)(?!(\\s*\\d+)))' + EqualRegexNoNumberSucceed = '([èe]ga(l(es)?|ux)((?!\\s+([àa]))|(\\s+([àa]|que)(?!(\\s*\\d+)))))' OneNumberRangeMoreRegex1 = f'({MoreOrEqual}|{MoreRegex})\\s*(l[ae]\\s+)?(?({NumberSplitMark}.)+)' OneNumberRangeMoreRegex1LB = f'(?({NumberSplitMark}.)+)\\s*{MoreOrEqualSuffix}' @@ -102,8 +120,12 @@ def DoubleWithoutIntegralRegex(placeholder): OneNumberRangeLessRegex1LB = f'(?({NumberSplitMark}.)+)\\s*{LessOrEqualSuffix}' OneNumberRangeLessSeparateRegex = f'({EqualRegex}\\s+(?({NumberSplitMark}.)+)(\\s+ou\\s+){LessRegexNoNumberSucceed})|({LessRegex}\\s+(?({NumberSplitMark}.)+)(\\s+ou\\s+){EqualRegexNoNumberSucceed})' - OneNumberRangeEqualRegex = f'(?({NumberSplitMark}.)+)' - TwoNumberRangeRegex1 = f'entre\\s*(l[ae]\\s+)?(?({NumberSplitMark}.)+)\\s*et\\s*(l[ae]\\s+)?(?({NumberSplitMark}.)+)' + OneNumberRangeEqualRegex = ( + f'(?({NumberSplitMark}.)+)' + ) + TwoNumberRangeRegex1 = ( + f'entre\\s*(l[ae]\\s+)?(?({NumberSplitMark}.)+)\\s*et\\s*(l[ae]\\s+)?(?({NumberSplitMark}.)+)' + ) TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})\\s*(et|mais|,)\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})' TwoNumberRangeRegex3 = f'({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})\\s*(et|mais|,)\\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})' TwoNumberRangeRegex4 = f'(de\\s+)?(?({NumberSplitMark}(?!\\bde\\b).)+)\\s*{TillRegex}\\s*(l[ae]\\s+)?(?({NumberSplitMark}.)+)' @@ -117,399 +139,434 @@ def DoubleWithoutIntegralRegex(placeholder): WrittenIntegerSeparatorTexts = [r'et', r'-'] WrittenFractionSeparatorTexts = [r'et', r'sur'] OneHalfTokens = [r'un', r'demi'] - HalfADozenRegex = f'(?<=\\b)demie?\\s+douzaine' - DigitalNumberRegex = f'((?<=\\b)(cent|mille|millions?|milliards?|billions?|douzaines?)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' - AmbiguousFractionConnectorsRegex = f'^[.]' - CardinalNumberMap = dict([("zéro", 0), - ("zero", 0), - ("un", 1), - ("une", 1), - ("deux", 2), - ("trois", 3), - ("quatre", 4), - ("cinq", 5), - ("six", 6), - ("sept", 7), - ("huit", 8), - ("neuf", 9), - ("dix", 10), - ("onze", 11), - ("douze", 12), - ("douzaine", 12), - ("douzaines", 12), - ("treize", 13), - ("quatorze", 14), - ("quinze", 15), - ("seize", 16), - ("dix-sept", 17), - ("dix-huit", 18), - ("dix-huir", 18), - ("dix-neuf", 19), - ("vingt", 20), - ("trente", 30), - ("quarante", 40), - ("cinquante", 50), - ("soixante", 60), - ("soixante-dix", 70), - ("septante", 70), - ("quatre-vingts", 80), - ("quatre-vingt", 80), - ("quatre vingts", 80), - ("quatre vingt", 80), - ("quatre-vingt-dix", 90), - ("quatre-vingt dix", 90), - ("quatre vingt dix", 90), - ("quatre-vingts-dix", 90), - ("quatre-vingts-onze", 91), - ("quatre-vingt-onze", 91), - ("quatre-vingts-douze", 92), - ("quatre-vingt-douze", 92), - ("quatre-vingts-treize", 93), - ("quatre-vingt-treize", 93), - ("quatre-vingts-quatorze", 94), - ("quatre-vingt-quatorze", 94), - ("quatre-vingts-quinze", 95), - ("quatre-vingt-quinze", 95), - ("quatre-vingts-seize", 96), - ("quatre-vingt-seize", 96), - ("huitante", 80), - ("octante", 80), - ("nonante", 90), - ("cent", 100), - ("mille", 1000), - ("un million", 1000000), - ("million", 1000000), - ("millions", 1000000), - ("un milliard", 1000000000), - ("milliard", 1000000000), - ("milliards", 1000000000), - ("un mille milliards", 1000000000000), - ("un billion", 1000000000000)]) - OrdinalNumberMap = dict([("premier", 1), - ("première", 1), - ("premiere", 1), - ("unième", 1), - ("unieme", 1), - ("deuxième", 2), - ("deuxieme", 2), - ("second", 2), - ("seconde", 2), - ("troisième", 3), - ("demi", 2), - ("demie", 2), - ("tiers", 3), - ("tierce", 3), - ("quart", 4), - ("quarts", 4), - ("troisieme", 3), - ("quatrième", 4), - ("quatrieme", 4), - ("cinquième", 5), - ("cinquieme", 5), - ("sixième", 6), - ("sixieme", 6), - ("septième", 7), - ("septieme", 7), - ("huitième", 8), - ("huitieme", 8), - ("huirième", 8), - ("huirieme", 8), - ("neuvième", 9), - ("neuvieme", 9), - ("dixième", 10), - ("dixieme", 10), - ("dizième", 10), - ("dizieme", 10), - ("onzième", 11), - ("onzieme", 11), - ("douzième", 12), - ("douzieme", 12), - ("treizième", 13), - ("treizieme", 13), - ("quatorzième", 14), - ("quatorzieme", 14), - ("quinzième", 15), - ("quinzieme", 15), - ("seizième", 16), - ("seizieme", 16), - ("dix-septième", 17), - ("dix-septieme", 17), - ("dix-huitième", 18), - ("dix-huitieme", 18), - ("dix-huirième", 18), - ("dix-huirieme", 18), - ("dix-neuvième", 19), - ("dix-neuvieme", 19), - ("vingtième", 20), - ("vingtieme", 20), - ("trentième", 30), - ("trentieme", 30), - ("quarantième", 40), - ("quarantieme", 40), - ("cinquantième", 50), - ("cinquantieme", 50), - ("soixantième", 60), - ("soixantieme", 60), - ("soixante-dixième", 70), - ("soixante-dixieme", 70), - ("septantième", 70), - ("septantieme", 70), - ("quatre-vingtième", 80), - ("quatre-vingtieme", 80), - ("huitantième", 80), - ("huitantieme", 80), - ("octantième", 80), - ("octantieme", 80), - ("quatre-vingt-dixième", 90), - ("quatre-vingt-dixieme", 90), - ("nonantième", 90), - ("nonantieme", 90), - ("centième", 100), - ("centieme", 100), - ("millième", 1000), - ("millieme", 1000), - ("millionième", 1000000), - ("millionieme", 1000000), - ("milliardième", 1000000000), - ("milliardieme", 1000000000), - ("billionieme", 1000000000000), - ("billionième", 1000000000000), - ("trillionième", 1000000000000000000), - ("trillionieme", 1000000000000000000)]) - PrefixCardinalMap = dict([("deux", 2), - ("trois", 3), - ("quatre", 4), - ("cinq", 5), - ("six", 6), - ("sept", 7), - ("huit", 8), - ("neuf", 9), - ("dix", 10), - ("onze", 11), - ("douze", 12), - ("treize", 13), - ("quatorze", 14), - ("quinze", 15), - ("seize", 16), - ("dix sept", 17), - ("dix-sept", 17), - ("dix-huit", 18), - ("dix huit", 18), - ("dix-neuf", 19), - ("dix neuf", 19), - ("vingt", 20), - ("vingt-et-un", 21), - ("vingt et un", 21), - ("vingt-deux", 21), - ("vingt deux", 22), - ("vingt-trois", 23), - ("vingt trois", 23), - ("vingt-quatre", 24), - ("vingt quatre", 24), - ("vingt-cinq", 25), - ("vingt cinq", 25), - ("vingt-six", 26), - ("vingt six", 26), - ("vingt-sept", 27), - ("vingt sept", 27), - ("vingt-huit", 28), - ("vingt huit", 28), - ("vingt-neuf", 29), - ("vingt neuf", 29), - ("trente", 30), - ("quarante", 40), - ("cinquante", 50), - ("soixante", 60), - ("soixante-dix", 70), - ("soixante dix", 70), - ("septante", 70), - ("quatre-vingt", 80), - ("quatre vingt", 80), - ("huitante", 80), - ("octante", 80), - ("nonante", 90), - ("quatre vingt dix", 90), - ("quatre-vingt-dix", 90), - ("cent", 100), - ("deux cent", 200), - ("trois cents", 300), - ("quatre cents", 400), - ("cinq cent", 500), - ("six cent", 600), - ("sept cent", 700), - ("huit cent", 800), - ("neuf cent", 900)]) - SuffixOrdinalMap = dict([("millième", 1000), - ("million", 1000000), - ("milliardième", 1000000000000)]) - RoundNumberMap = dict([("cent", 100), - ("mille", 1000), - ("million", 1000000), - ("millions", 1000000), - ("milliard", 1000000000), - ("milliards", 1000000000), - ("billion", 1000000000000), - ("billions", 1000000000000), - ("centieme", 100), - ("centième", 100), - ("millieme", 1000), - ("millième", 1000), - ("millionième", 1000000), - ("millionieme", 1000000), - ("milliardième", 1000000000), - ("milliardieme", 1000000000), - ("billionième", 1000000000000), - ("billionieme", 1000000000000), - ("centiemes", 100), - ("centièmes", 100), - ("millièmes", 1000), - ("milliemes", 1000), - ("millionièmes", 1000000), - ("millioniemes", 1000000), - ("milliardièmes", 1000000000), - ("milliardiemes", 1000000000), - ("billionièmes", 1000000000000), - ("billioniemes", 1000000000000), - ("douzaine", 12), - ("douzaines", 12), - ("k", 1000), - ("m", 1000000), - ("g", 1000000000), - ("b", 1000000000), - ("t", 1000000000000)]) + HalfADozenRegex = '(?<=\\b)demie?\\s+douzaine' + DigitalNumberRegex = f'((?<=\\b)(cents?|mille|mil|millions?|milliards?|billions?|douzaines?)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' + AmbiguousFractionConnectorsRegex = '^[.]' + CardinalNumberMap = dict( + [ + ("zéro", 0), + ("zero", 0), + ("un", 1), + ("une", 1), + ("deux", 2), + ("trois", 3), + ("quatre", 4), + ("cinq", 5), + ("six", 6), + ("sept", 7), + ("huit", 8), + ("neuf", 9), + ("dix", 10), + ("onze", 11), + ("douze", 12), + ("douzaine", 12), + ("douzaines", 12), + ("treize", 13), + ("quatorze", 14), + ("quinze", 15), + ("seize", 16), + ("dix-sept", 17), + ("dix-huit", 18), + ("dix-huir", 18), + ("dix-neuf", 19), + ("vingt", 20), + ("trente", 30), + ("quarante", 40), + ("cinquante", 50), + ("soixante", 60), + ("soixante-dix", 70), + ("septante", 70), + ("quatre-vingts", 80), + ("quatre-vingt", 80), + ("quatre vingts", 80), + ("quatre vingt", 80), + ("quatre-vingt-dix", 90), + ("quatre-vingt dix", 90), + ("quatre vingt dix", 90), + ("quatre-vingts-dix", 90), + ("quatre-vingts-onze", 91), + ("quatre-vingt-onze", 91), + ("quatre-vingts-douze", 92), + ("quatre-vingt-douze", 92), + ("quatre-vingts-treize", 93), + ("quatre-vingt-treize", 93), + ("quatre-vingts-quatorze", 94), + ("quatre-vingt-quatorze", 94), + ("quatre-vingts-quinze", 95), + ("quatre-vingt-quinze", 95), + ("quatre-vingts-seize", 96), + ("quatre-vingt-seize", 96), + ("huitante", 80), + ("octante", 80), + ("nonante", 90), + ("cent", 100), + ("deux-cents", 200), + ("trois-cents", 300), + ("quatre-cents", 400), + ("cinq-cents", 500), + ("six-cents", 600), + ("sept-cents", 700), + ("huit-cents", 800), + ("neuf-cents", 900), + ("neuf cent", 900), + ("mille", 1000), + ("mil", 1000), + ("un million", 1000000), + ("million", 1000000), + ("millions", 1000000), + ("un milliard", 1000000000), + ("milliard", 1000000000), + ("milliards", 1000000000), + ("un mille milliards", 1000000000000), + ("un billion", 1000000000000), + ] + ) + OrdinalNumberMap = dict( + [ + ("premier", 1), + ("première", 1), + ("premiere", 1), + ("unième", 1), + ("unieme", 1), + ("deuxième", 2), + ("deuxieme", 2), + ("second", 2), + ("seconde", 2), + ("troisième", 3), + ("demi", 2), + ("demie", 2), + ("tiers", 3), + ("tierce", 3), + ("quart", 4), + ("quarts", 4), + ("troisieme", 3), + ("quatrième", 4), + ("quatrieme", 4), + ("cinquième", 5), + ("cinquieme", 5), + ("sixième", 6), + ("sixieme", 6), + ("septième", 7), + ("septieme", 7), + ("huitième", 8), + ("huitieme", 8), + ("huirième", 8), + ("huirieme", 8), + ("neuvième", 9), + ("neuvieme", 9), + ("dixième", 10), + ("dixieme", 10), + ("dizième", 10), + ("dizieme", 10), + ("onzième", 11), + ("onzieme", 11), + ("douzième", 12), + ("douzieme", 12), + ("treizième", 13), + ("treizieme", 13), + ("quatorzième", 14), + ("quatorzieme", 14), + ("quinzième", 15), + ("quinzieme", 15), + ("seizième", 16), + ("seizieme", 16), + ("dix-septième", 17), + ("dix-septieme", 17), + ("dix-huitième", 18), + ("dix-huitieme", 18), + ("dix-huirième", 18), + ("dix-huirieme", 18), + ("dix-neuvième", 19), + ("dix-neuvieme", 19), + ("vingtième", 20), + ("vingtieme", 20), + ("trentième", 30), + ("trentieme", 30), + ("quarantième", 40), + ("quarantieme", 40), + ("cinquantième", 50), + ("cinquantieme", 50), + ("soixantième", 60), + ("soixantieme", 60), + ("soixante-dixième", 70), + ("soixante-dixieme", 70), + ("septantième", 70), + ("septantieme", 70), + ("quatre-vingtième", 80), + ("quatre-vingtieme", 80), + ("huitantième", 80), + ("huitantieme", 80), + ("octantième", 80), + ("octantieme", 80), + ("quatre-vingt-dixième", 90), + ("quatre-vingt-dixieme", 90), + ("nonantième", 90), + ("nonantieme", 90), + ("centième", 100), + ("centieme", 100), + ("millième", 1000), + ("millieme", 1000), + ("millionième", 1000000), + ("millionieme", 1000000), + ("milliardième", 1000000000), + ("milliardieme", 1000000000), + ("billionieme", 1000000000000), + ("billionième", 1000000000000), + ("trillionième", 1000000000000000000), + ("trillionieme", 1000000000000000000), + ] + ) + PrefixCardinalMap = dict( + [ + ("deux", 2), + ("trois", 3), + ("quatre", 4), + ("cinq", 5), + ("six", 6), + ("sept", 7), + ("huit", 8), + ("neuf", 9), + ("dix", 10), + ("onze", 11), + ("douze", 12), + ("treize", 13), + ("quatorze", 14), + ("quinze", 15), + ("seize", 16), + ("dix sept", 17), + ("dix-sept", 17), + ("dix-huit", 18), + ("dix huit", 18), + ("dix-neuf", 19), + ("dix neuf", 19), + ("vingt", 20), + ("vingt-et-un", 21), + ("vingt et un", 21), + ("vingt-deux", 21), + ("vingt deux", 22), + ("vingt-trois", 23), + ("vingt trois", 23), + ("vingt-quatre", 24), + ("vingt quatre", 24), + ("vingt-cinq", 25), + ("vingt cinq", 25), + ("vingt-six", 26), + ("vingt six", 26), + ("vingt-sept", 27), + ("vingt sept", 27), + ("vingt-huit", 28), + ("vingt huit", 28), + ("vingt-neuf", 29), + ("vingt neuf", 29), + ("trente", 30), + ("quarante", 40), + ("cinquante", 50), + ("soixante", 60), + ("soixante-dix", 70), + ("soixante dix", 70), + ("septante", 70), + ("quatre-vingt", 80), + ("quatre vingt", 80), + ("huitante", 80), + ("octante", 80), + ("nonante", 90), + ("quatre vingt dix", 90), + ("quatre-vingt-dix", 90), + ("cent", 100), + ("deux cent", 200), + ("trois cents", 300), + ("quatre cents", 400), + ("cinq cent", 500), + ("six cent", 600), + ("sept cent", 700), + ("huit cent", 800), + ("neuf cent", 900), + ] + ) + SuffixOrdinalMap = dict([("millième", 1000), ("million", 1000000), ("milliardième", 1000000000000)]) + RoundNumberMap = dict( + [ + ("cent", 100), + ("mil", 1000), + ("mille", 1000), + ("million", 1000000), + ("millions", 1000000), + ("milliard", 1000000000), + ("milliards", 1000000000), + ("billion", 1000000000000), + ("billions", 1000000000000), + ("centieme", 100), + ("centième", 100), + ("millieme", 1000), + ("millième", 1000), + ("millionième", 1000000), + ("millionieme", 1000000), + ("milliardième", 1000000000), + ("milliardieme", 1000000000), + ("billionième", 1000000000000), + ("billionieme", 1000000000000), + ("centiemes", 100), + ("centièmes", 100), + ("millièmes", 1000), + ("milliemes", 1000), + ("millionièmes", 1000000), + ("millioniemes", 1000000), + ("milliardièmes", 1000000000), + ("milliardiemes", 1000000000), + ("billionièmes", 1000000000000), + ("billioniemes", 1000000000000), + ("douzaine", 12), + ("douzaines", 12), + ("k", 1000), + ("m", 1000000), + ("g", 1000000000), + ("b", 1000000000), + ("t", 1000000000000), + ] + ) AmbiguityFiltersDict = dict([("^[.]", "")]) - RelativeReferenceOffsetMap = dict([("prochain", "1"), - ("prochaine", "1"), - ("prochains", "1"), - ("precedent", "-1"), - ("precedente", "-1"), - ("precédent", "-1"), - ("precédente", "-1"), - ("précedent", "-1"), - ("précedente", "-1"), - ("précédent", "-1"), - ("précédente", "-1"), - ("actuel", "0"), - ("actuelle", "0"), - ("actuel un", "0"), - ("actuelle une", "0"), - ("l'actuel", "0"), - ("l'actuelle", "0"), - ("l’actuel", "0"), - ("l’actuelle", "0"), - ("l'actuel un", "0"), - ("l'actuelle une", "0"), - ("l’actuel un", "0"), - ("l’actuelle une", "0"), - ("avant dernier", "-1"), - ("avant derniere", "-1"), - ("avant-dernier", "-1"), - ("avant-derniere", "-1"), - ("l'avant dernier", "-1"), - ("l'avant derniere", "-1"), - ("l'avant-dernier", "-1"), - ("l'avant-derniere", "-1"), - ("l’avant dernier", "-1"), - ("l’avant derniere", "-1"), - ("l’avant-dernier", "-1"), - ("l’avant-derniere", "-1"), - ("celle d'avant la dernière", "-1"), - ("celui d'avant le dernièr", "-1"), - ("celle d'avant la derniere", "-1"), - ("celui d'avant le dernier", "-1"), - ("celle d’avant la dernière", "-1"), - ("celui d’avant le dernièr", "-1"), - ("celle d’avant la derniere", "-1"), - ("celui d’avant le dernier", "-1"), - ("penultieme", "-1"), - ("penultième", "-1"), - ("pénultieme", "-1"), - ("pénultième", "-1"), - ("antepenultieme", "-2"), - ("antépenultieme", "-2"), - ("antepenultième", "-2"), - ("antépenultième", "-2"), - ("antepénultieme", "-2"), - ("antépénultieme", "-2"), - ("antepénultième", "-2"), - ("antépénultième", "-2"), - ("dernier", "0"), - ("dernièr", "0"), - ("derniere", "0"), - ("derniers", "0"), - ("dernière", "0"), - ("dernièrs", "0"), - ("suivant", "1"), - ("suivante", "1"), - ("suivants", "1"), - ("courant", "0"), - ("courante", "0"), - ("courants", "0")]) - RelativeReferenceRelativeToMap = dict([("prochain", "current"), - ("prochaine", "current"), - ("prochains", "current"), - ("precedent", "current"), - ("precedente", "current"), - ("precédent", "current"), - ("precédente", "current"), - ("précedent", "current"), - ("précedente", "current"), - ("précédent", "current"), - ("précédente", "current"), - ("actuel", "current"), - ("actuelle", "current"), - ("actuel un", "current"), - ("actuelle une", "current"), - ("l'actuel", "current"), - ("l'actuelle", "current"), - ("l’actuel", "current"), - ("l’actuelle", "current"), - ("l'actuel un", "current"), - ("l'actuelle une", "current"), - ("l’actuel un", "current"), - ("l’actuelle une", "current"), - ("avant dernier", "end"), - ("avant-dernier", "end"), - ("avant derniere", "end"), - ("avant-derniere", "end"), - ("l'avant dernier", "end"), - ("l'avant-dernier", "end"), - ("l'avant derniere", "end"), - ("l'avant-derniere", "end"), - ("l’avant dernier", "end"), - ("l’avant-dernier", "end"), - ("l’avant derniere", "end"), - ("l’avant-derniere", "end"), - ("celle d'avant la dernière", "end"), - ("celui d'avant le dernièr", "end"), - ("celle d'avant la derniere", "end"), - ("celui d'avant le dernier", "end"), - ("celle d’avant la dernière", "end"), - ("celui d’avant le dernièr", "end"), - ("celle d’avant la derniere", "end"), - ("celui d’avant le dernier", "end"), - ("penultieme", "end"), - ("penultième", "end"), - ("pénultieme", "end"), - ("pénultième", "end"), - ("antepenultieme", "end"), - ("antépenultieme", "end"), - ("antepenultième", "end"), - ("antépenultième", "end"), - ("antepénultieme", "end"), - ("antépénultieme", "end"), - ("antepénultième", "end"), - ("antépénultième", "end"), - ("dernier", "end"), - ("dernièr", "end"), - ("derniere", "end"), - ("derniers", "end"), - ("dernière", "end"), - ("dernièrs", "end"), - ("suivant", "current"), - ("suivante", "current"), - ("suivants", "current"), - ("courant", "current"), - ("courante", "current"), - ("courants", "current")]) + RelativeReferenceOffsetMap = dict( + [ + ("prochain", "1"), + ("prochaine", "1"), + ("prochains", "1"), + ("precedent", "-1"), + ("precedente", "-1"), + ("precédent", "-1"), + ("precédente", "-1"), + ("précedent", "-1"), + ("précedente", "-1"), + ("précédent", "-1"), + ("précédente", "-1"), + ("actuel", "0"), + ("actuelle", "0"), + ("actuel un", "0"), + ("actuelle une", "0"), + ("l'actuel", "0"), + ("l'actuelle", "0"), + ("l’actuel", "0"), + ("l’actuelle", "0"), + ("l'actuel un", "0"), + ("l'actuelle une", "0"), + ("l’actuel un", "0"), + ("l’actuelle une", "0"), + ("avant dernier", "-1"), + ("avant derniere", "-1"), + ("avant-dernier", "-1"), + ("avant-derniere", "-1"), + ("l'avant dernier", "-1"), + ("l'avant derniere", "-1"), + ("l'avant-dernier", "-1"), + ("l'avant-derniere", "-1"), + ("l’avant dernier", "-1"), + ("l’avant derniere", "-1"), + ("l’avant-dernier", "-1"), + ("l’avant-derniere", "-1"), + ("celle d'avant la dernière", "-1"), + ("celui d'avant le dernièr", "-1"), + ("celle d'avant la derniere", "-1"), + ("celui d'avant le dernier", "-1"), + ("celle d’avant la dernière", "-1"), + ("celui d’avant le dernièr", "-1"), + ("celle d’avant la derniere", "-1"), + ("celui d’avant le dernier", "-1"), + ("penultieme", "-1"), + ("penultième", "-1"), + ("pénultieme", "-1"), + ("pénultième", "-1"), + ("antepenultieme", "-2"), + ("antépenultieme", "-2"), + ("antepenultième", "-2"), + ("antépenultième", "-2"), + ("antepénultieme", "-2"), + ("antépénultieme", "-2"), + ("antepénultième", "-2"), + ("antépénultième", "-2"), + ("dernier", "0"), + ("dernièr", "0"), + ("derniere", "0"), + ("derniers", "0"), + ("dernière", "0"), + ("dernièrs", "0"), + ("suivant", "1"), + ("suivante", "1"), + ("suivants", "1"), + ("courant", "0"), + ("courante", "0"), + ("courants", "0"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("prochain", "current"), + ("prochaine", "current"), + ("prochains", "current"), + ("precedent", "current"), + ("precedente", "current"), + ("precédent", "current"), + ("precédente", "current"), + ("précedent", "current"), + ("précedente", "current"), + ("précédent", "current"), + ("précédente", "current"), + ("actuel", "current"), + ("actuelle", "current"), + ("actuel un", "current"), + ("actuelle une", "current"), + ("l'actuel", "current"), + ("l'actuelle", "current"), + ("l’actuel", "current"), + ("l’actuelle", "current"), + ("l'actuel un", "current"), + ("l'actuelle une", "current"), + ("l’actuel un", "current"), + ("l’actuelle une", "current"), + ("avant dernier", "end"), + ("avant-dernier", "end"), + ("avant derniere", "end"), + ("avant-derniere", "end"), + ("l'avant dernier", "end"), + ("l'avant-dernier", "end"), + ("l'avant derniere", "end"), + ("l'avant-derniere", "end"), + ("l’avant dernier", "end"), + ("l’avant-dernier", "end"), + ("l’avant derniere", "end"), + ("l’avant-derniere", "end"), + ("celle d'avant la dernière", "end"), + ("celui d'avant le dernièr", "end"), + ("celle d'avant la derniere", "end"), + ("celui d'avant le dernier", "end"), + ("celle d’avant la dernière", "end"), + ("celui d’avant le dernièr", "end"), + ("celle d’avant la derniere", "end"), + ("celui d’avant le dernier", "end"), + ("penultieme", "end"), + ("penultième", "end"), + ("pénultieme", "end"), + ("pénultième", "end"), + ("antepenultieme", "end"), + ("antépenultieme", "end"), + ("antepenultième", "end"), + ("antépenultième", "end"), + ("antepénultieme", "end"), + ("antépénultieme", "end"), + ("antepénultième", "end"), + ("antépénultième", "end"), + ("dernier", "end"), + ("dernièr", "end"), + ("derniere", "end"), + ("derniers", "end"), + ("dernière", "end"), + ("dernièrs", "end"), + ("suivant", "current"), + ("suivante", "current"), + ("suivants", "current"), + ("courant", "current"), + ("courante", "current"), + ("courants", "current"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/german_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/german_numeric.py index 25c314545d..839a8e7fbd 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/german_numeric.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/german_numeric.py @@ -10,6 +10,8 @@ # ------------------------------------------------------------------------------ from .base_numbers import BaseNumbers + + # pylint: disable=line-too-long @@ -17,41 +19,50 @@ class GermanNumeric: LangMarker = 'Ger' CompoundNumberLanguage = True MultiDecimalSeparatorCulture = False - ZeroToNineIntegerRegex = f'(drei|sieben|acht|vier|fuenf|fünf|null|neun|eins|(ein(?!($|\\.|,|!|\\?)))|eine[rn]?|zwei|zwo|sechs)' - TwoToNineIntegerRegex = f'(drei|sieben|acht|vier|fuenf|fünf|neun|zwei|zwo|sechs)' - RoundNumberIntegerRegex = f'((ein)?hundert|tausend|((million(en)?|mio|milliarden?|mrd|billion(en)?)))' - AnIntRegex = f'(eine?)(?=\\s)' - TenToNineteenIntegerRegex = f'(siebzehn|dreizehn|vierzehn|achtzehn|neunzehn|fünfzehn|fuenfzehn|sechzehn|elf|zwoelf|zwölf|zehn)' - TensNumberIntegerRegex = f'(siebzig|zwanzig|dreißig|achtzig|neunzig|vierzig|fuenfzig|fünfzig|sechzig|hundert|tausend)' - NegativeNumberTermsRegex = f'^[.]' + ZeroToNineIntegerRegex = ( + '(drei|sieben|acht|vier|fuenf|fünf|null|neun|eins|(ein(?!($|\\.|,|!|\\?)))|eine[rn]?|zwei|zwo|sechs)' + ) + TwoToNineIntegerRegex = '(drei|sieben|acht|vier|fuenf|fünf|neun|zwei|zwo|sechs)' + RoundNumberIntegerRegex = '((ein)?hundert|tausend|((million(en)?|mio|milliarden?|mrd|billion(en)?)))' + AnIntRegex = '(eine?)(?=\\s)' + TenToNineteenIntegerRegex = ( + '(siebzehn|dreizehn|vierzehn|achtzehn|neunzehn|fünfzehn|fuenfzehn|sechzehn|elf|zwoelf|zwölf|zehn)' + ) + TensNumberIntegerRegex = ( + '(siebzig|zwanzig|dreißig|achtzig|neunzig|vierzig|fuenfzig|fünfzig|sechzig|hundert|tausend)' + ) + NegativeNumberTermsRegex = '^[.]' NegativeNumberSignRegex = f'^({NegativeNumberTermsRegex}\\s+).*' SeparaIntRegex = f'((({TenToNineteenIntegerRegex}|({ZeroToNineIntegerRegex}und{TensNumberIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex})(\\s*{RoundNumberIntegerRegex})*))|(({AnIntRegex}(\\s*{RoundNumberIntegerRegex})+))' AllIntRegex = f'(((({TenToNineteenIntegerRegex}|({ZeroToNineIntegerRegex}und{TensNumberIntegerRegex})|{TensNumberIntegerRegex}|({ZeroToNineIntegerRegex}|{AnIntRegex}))?(\\s*{RoundNumberIntegerRegex}\\s*)))*{SeparaIntRegex})' - PlaceHolderPureNumber = f'\\b' - PlaceHolderDefault = f'\\D|\\b' + PlaceHolderPureNumber = '\\b' + PlaceHolderDefault = '\\D|\\b' def NumbersWithPlaceHolder(placeholder): return f'(((?(nächste|vorherige|aktuelle|jetzige|(vor|dritt)?letzte)[nr]?|zuletzt|früher)' - BasicOrdinalRegex = f'(zuerst|erst(er|es|en|e)|zweit(er|es|en|e)?|dritt(er|es|en|el|e)?|viert(er|es|en|el|e)?|fünft(er|es|en|el|e)?|fuenft(er|es|en|el|e)?|sechst(er|es|en|el|e)?|siebt(er|es|en|el|e)?|acht(er|es|en|el|e)?|neunt(er|es|en|el|e)?|zehnt(er|es|en|el|e)?|elft(er|es|en|el|e)?|zwölft(er|es|en|el|e)?|zwoelft(er|es|en|el|e)?|dreizehnt(er|es|en|el|e)?|vierzehnt(er|es|en|el|e)?|fünfzehnt(er|es|en|el|e)?|fuenfzehnt(er|es|en|el|e)?|sechzehnt(er|es|en|el|e)?|siebzehnt(er|es|en|el|e)?|achtzehnt(er|es|en|el|e)?|neunzehnt(er|es|en|el|e)?|zwanzigst(er|es|en|el|e)?|dreißigst(er|es|en|el|e)?|vierziegt(er|es|en|el|e)?|fünfzigst(er|es|en|el|e)?|fuenfzigst(er|es|en|el|e)?|sechzigst(er|es|en|el|e)?|siebzigst(er|es|en|el|e)?|achtzigst(er|es|en|el|e)?|neunzigst(er|es|en|el|e)?)' + RoundNumberOrdinalRegex = '(hundertst(er|es|en|el|e)?|tausendst(er|es|en|el|e)?|millionst(er|es|en|el|e)?|milliardst(er|es|en|el|e)?|billionst(er|es|en|el|e)?)' + RelativeOrdinalRegex = ( + '(?(nächste|vorherige|aktuelle|jetzige|(vor|dritt)?letzte)[nr]?|zuletzt|früher)' + ) + BasicOrdinalRegex = '(zuerst|erst(er|es|en|e)|zweit(er|es|en|e)?|dritt(er|es|en|el|e)?|viert(er|es|en|el|e)?|fünft(er|es|en|el|e)?|fuenft(er|es|en|el|e)?|sechst(er|es|en|el|e)?|siebt(er|es|en|el|e)?|acht(er|es|en|el|e)?|neunt(er|es|en|el|e)?|zehnt(er|es|en|el|e)?|elft(er|es|en|el|e)?|zwölft(er|es|en|el|e)?|zwoelft(er|es|en|el|e)?|dreizehnt(er|es|en|el|e)?|vierzehnt(er|es|en|el|e)?|fünfzehnt(er|es|en|el|e)?|fuenfzehnt(er|es|en|el|e)?|sechzehnt(er|es|en|el|e)?|siebzehnt(er|es|en|el|e)?|achtzehnt(er|es|en|el|e)?|neunzehnt(er|es|en|el|e)?|zwanzigst(er|es|en|el|e)?|dreißigst(er|es|en|el|e)?|vierziegt(er|es|en|el|e)?|fünfzigst(er|es|en|el|e)?|fuenfzigst(er|es|en|el|e)?|sechzigst(er|es|en|el|e)?|siebzigst(er|es|en|el|e)?|achtzigst(er|es|en|el|e)?|neunzigst(er|es|en|el|e)?)' SuffixBasicOrdinalRegex = f'({BasicOrdinalRegex}|({ZeroToNineIntegerRegex}(und|\\s){BasicOrdinalRegex}))' SuffixRoundNumberOrdinalRegex = f'(({AllIntRegex}\\s*){RoundNumberOrdinalRegex})' AllOrdinalNumberRegex = f'(({AllIntRegex}\\s*)*{SuffixBasicOrdinalRegex}|{SuffixRoundNumberOrdinalRegex})' AllOrdinalRegex = f'(?:{AllOrdinalNumberRegex}|{RelativeOrdinalRegex})' - OrdinalSuffixRegex = f'^[\\.]' - OrdinalNumericRegex = f'(?<=\\b)(\\d{{1,3}}\\.)(?=(\\s+|^))' + OrdinalSuffixRegex = '^[\\.]' + OrdinalNumericRegex = '(?<=\\b)(\\d{1,3}\\.)(?=(\\s+|^))' OrdinalRoundNumberRegex = f'(?anderthalb|einundhalb)|(?dreiviertel))' - FractionHalfRegex = f'(einhalb(es)?)$' + FractionUnitsRegex = '((?anderthalb|einundhalb)|(?dreiviertel))' + FractionHalfRegex = '(einhalb(es)?)$' OneHalfTokens = [r'ein', r'halb', r'halbes'] FractionMultiplierRegex = f'(?(\\s+und\\s+)?(anderthalb|einundhalb|dreiviertel)|(\\s+und\\s+)?(eine?|{TwoToNineIntegerRegex})\\s*(halbe?|(dritt|viert|fünft|fuenft|sechst|siebt|acht|neunt|zehnt)(er|es|en|el|e)?))' RoundMultiplierWithFraction = f'(?<=(?(million(en)?|mio|milliarden?|mrd|billion(en)?))(?={FractionMultiplierRegex}?$)' @@ -61,34 +72,47 @@ def NumbersWithPlaceHolder(placeholder): FractionPrepositionRegex = f'(?({AllIntRegex})|((?({AllIntRegex})|(\\d+)(?!\\.))(?=\\b)' AllPointRegex = f'((\\s*{ZeroToNineIntegerRegex})+|(\\s*{SeparaIntRegex}))' AllFloatRegex = f'({AllIntRegex}(\\s*komma\\s*){AllPointRegex})' - DoubleWithMultiplierRegex = f'(((?und)' - NumberWithSuffixPercentage = f'(?)' - LessRegex = f'(?:(weniger|winziger|kleiner|wenig)(\\s+als)?|darunter|unter|(?|=)<)' - EqualRegex = f'(gleich(\\s+(als|zu))?|(?)=)' + ConnectorRegex = '(?und)' + TillRegex = '(bis(\\s+zu)?|--|-|—|——|~|–)' + MoreRegex = '(?:(größer|höher|mehr)(\\s+als)?|über|darüber(hinaus)?|(?)' + LessRegex = '(?:(weniger|winziger|kleiner|wenig)(\\s+als)?|darunter|unter|(?|=)<)' + EqualRegex = '(gleich(\\s+(als|zu))?|(?)=)' MoreOrEqualPrefix = f'((nicht\\s+{LessRegex})|(als\\s+letzte(r)?))' MoreOrEqual = f'(?:({MoreRegex}\\s+(oder)?\\s+{EqualRegex})|({EqualRegex}\\s+(oder)?\\s+{MoreRegex})|{MoreOrEqualPrefix}(\\s+(oder)?\\s+{EqualRegex})?|({EqualRegex}\\s+(oder)?\\s+)?{MoreOrEqualPrefix}|>\\s*=|≥)' - MoreOrEqualSuffix = f'((und|oder)\\s+(((mehr|größer|höher)((?!\\s+als)|(\\s+als(?!(\\s*\\d+)))))|((über|darüber)(?!\\s+als))))' + MoreOrEqualSuffix = ( + '((und|oder)\\s+(((mehr|größer|höher)((?!\\s+als)|(\\s+als(?!(\\s*\\d+)))))|((über|darüber)(?!\\s+als))))' + ) LessOrEqualPrefix = f'((nicht\\s+{MoreRegex})|(at\\s+viele)|(bis\\s+zu))' LessOrEqual = f'(({LessRegex}\\s+(oder)?\\s+{EqualRegex})|({EqualRegex}\\s+(oder)?\\s+{LessRegex})|{LessOrEqualPrefix}(\\s+(oder)?\\s+{EqualRegex})?|({EqualRegex}\\s+(oder)?\\s+)?{LessOrEqualPrefix}|<\\s*=|≤)' - LessOrEqualSuffix = f'((und|oder)\\s+(weniger|geringer|kleiner|winziger)((?!\\s+als)|(\\s+als(?!(\\s*\\d+)))))' - NumberSplitMark = f'(?![,.](?!\\d+))' - MoreRegexNoNumberSucceed = f'((größer|mehr|höhrer|breiter)((?!\\s+als)|\\s+(als(?!(\\s*\\d+))))|((dar)?über)(?!(\\s*\\d+)))' - LessRegexNoNumberSucceed = f'((kleiner|weniger|winziger)((?!\\s+als)|\\s+(als(?!(\\s*\\d+))))|((dar)?unter)(?!(\\s*\\d+)))' - EqualRegexNoNumberSucceed = f'(gleich(s|ing)?((?!\\s+(zu|als))|(\\s+(zu|als)(?!(\\s*\\d+)))))' + LessOrEqualSuffix = '((und|oder)\\s+(weniger|geringer|kleiner|winziger)((?!\\s+als)|(\\s+als(?!(\\s*\\d+)))))' + NumberSplitMark = '(?![,.](?!\\d+))' + MoreRegexNoNumberSucceed = ( + '((größer|mehr|höhrer|breiter)((?!\\s+als)|\\s+(als(?!(\\s*\\d+))))|((dar)?über)(?!(\\s*\\d+)))' + ) + LessRegexNoNumberSucceed = ( + '((kleiner|weniger|winziger)((?!\\s+als)|\\s+(als(?!(\\s*\\d+))))|((dar)?unter)(?!(\\s*\\d+)))' + ) + EqualRegexNoNumberSucceed = '(gleich(s|ing)?((?!\\s+(zu|als))|(\\s+(zu|als)(?!(\\s*\\d+)))))' OneNumberRangeMoreRegex1 = f'({MoreOrEqual}|{MoreRegex})\\s*(der\\s+)?(?({NumberSplitMark}.)+)' OneNumberRangeMoreRegex2 = f'(?({NumberSplitMark}.)+)\\s*{MoreOrEqualSuffix}' OneNumberRangeMoreSeparateRegex = f'({EqualRegex}\\s+(?({NumberSplitMark}.)+)(\\s+or\\s+){MoreRegexNoNumberSucceed})|({MoreRegex}\\s+(?({NumberSplitMark}.)+)(\\s+oder\\s+){EqualRegexNoNumberSucceed})' @@ -96,11 +120,13 @@ def DoubleWithoutIntegralRegex(placeholder): OneNumberRangeLessRegex2 = f'(?({NumberSplitMark}.)+)\\s*{LessOrEqualSuffix}' OneNumberRangeLessSeparateRegex = f'({EqualRegex}\\s+(?({NumberSplitMark}.)+)(\\s+or\\s+){LessRegexNoNumberSucceed})|({LessRegex}\\s+(?({NumberSplitMark}.)+)(\\s+oder\\s+){EqualRegexNoNumberSucceed})' OneNumberRangeEqualRegex = f'{EqualRegex}\\s*(the\\s+)?(?({NumberSplitMark}.)+)' - TwoNumberRangeRegex1 = f'zwischen\\s*(der\\s+)?(?({NumberSplitMark}.)+)\\s*und\\s*(der\\s+)?(?({NumberSplitMark}.)+)' + TwoNumberRangeRegex1 = ( + f'zwischen\\s*(der\\s+)?(?({NumberSplitMark}.)+)\\s*und\\s*(der\\s+)?(?({NumberSplitMark}.)+)' + ) TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})\\s*(und|aber|,)\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})' TwoNumberRangeRegex3 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})\\s*(und|aber|,)\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})' TwoNumberRangeRegex4 = f'(von\\s+)?(?({NumberSplitMark}(?!\\bvon\\b).)+)\\s*{TillRegex}\\s*(der\\s+)?(?({NumberSplitMark}.)+)' - AmbiguousFractionConnectorsRegex = f'^[.]' + AmbiguousFractionConnectorsRegex = '^[.]' DecimalSeparatorChar = ',' FractionMarkerToken = 'over' NonDecimalSeparatorChar = '.' @@ -110,345 +136,374 @@ def DoubleWithoutIntegralRegex(placeholder): WrittenGroupSeparatorTexts = [r'punkt'] WrittenIntegerSeparatorTexts = [r'und'] WrittenFractionSeparatorTexts = [r'durch', r'und'] - HalfADozenRegex = f'ein\\s+halbes\\s+dutzend' + HalfADozenRegex = 'ein\\s+halbes\\s+dutzend' DigitalNumberRegex = f'((?<=\\b)(hundert|tausend|million(en)?|mio|milliarde(n)?|mrd|billion(en)?|dutzend(e)?)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' - CardinalNumberMap = dict([("ein", 1), - ("null", 0), - ("eine", 1), - ("eins", 1), - ("einer", 1), - ("einen", 1), - ("beiden", 2), - ("zwei", 2), - ("zwo", 2), - ("drei", 3), - ("vier", 4), - ("fünf", 5), - ("fuenf", 5), - ("sechs", 6), - ("sieben", 7), - ("acht", 8), - ("neun", 9), - ("zehn", 10), - ("elf", 11), - ("zwölf", 12), - ("zwoelf", 12), - ("dutzend", 12), - ("dreizehn", 13), - ("vierzehn", 14), - ("fünfzehn", 15), - ("fuenfzehn", 15), - ("sechzehn", 16), - ("siebzehn", 17), - ("achtzehn", 18), - ("neunzehn", 19), - ("zwanzig", 20), - ("dreißig", 30), - ("vierzig", 40), - ("fünfzig", 50), - ("fuenfzig", 50), - ("sechzig", 60), - ("siebzig", 70), - ("achtzig", 80), - ("neunzig", 90), - ("hundert", 100), - ("tausend", 1000), - ("million", 1000000), - ("mio", 1000000), - ("millionen", 1000000), - ("milliard", 100000000), - ("milliarde", 1000000000), - ("mrd", 1000000000), - ("milliarden", 1000000000), - ("billion", 1000000000000), - ("billionen", 1000000000000)]) - OrdinalNumberMap = dict([("zuerst", 1), - ("erst", 1), - ("erster", 1), - ("erste", 1), - ("erstes", 1), - ("ersten", 1), - ("zweit", 2), - ("zweiter", 2), - ("zweite", 2), - ("zweites", 2), - ("zweiten", 2), - ("halb", 2), - ("halbe", 2), - ("halbes", 2), - ("hälfte", 2), - ("haelfte", 2), - ("dritt", 3), - ("dritter", 3), - ("dritte", 3), - ("drittes", 3), - ("dritten", 3), - ("drittel", 3), - ("viert", 4), - ("vierter", 4), - ("vierte", 4), - ("viertes", 4), - ("vierten", 4), - ("viertel", 4), - ("fünft", 5), - ("fünfter", 5), - ("fünfte", 5), - ("fünftes", 5), - ("fünften", 5), - ("fuenft", 5), - ("fuenfter", 5), - ("fuenfte", 5), - ("fuenftes", 5), - ("fuenften", 5), - ("fünftel", 5), - ("fuenftel", 5), - ("sechst", 6), - ("sechster", 6), - ("sechste", 6), - ("sechstes", 6), - ("sechsten", 6), - ("sechstel", 6), - ("siebt", 7), - ("siebter", 7), - ("siebte", 7), - ("siebtes", 7), - ("siebten", 7), - ("siebtel", 7), - ("acht", 8), - ("achter", 8), - ("achte", 8), - ("achtes", 8), - ("achten", 8), - ("achtel", 8), - ("neunt", 9), - ("neunter", 9), - ("neunte", 9), - ("neuntes", 9), - ("neunten", 9), - ("neuntel", 9), - ("zehnt", 10), - ("zehnter", 10), - ("zehnte", 10), - ("zehntes", 10), - ("zehnten", 10), - ("zehntel", 10), - ("elft", 11), - ("elfter", 11), - ("elfte", 11), - ("elftes", 11), - ("elften", 11), - ("elftel", 11), - ("zwölft", 12), - ("zwölfter", 12), - ("zwölfte", 12), - ("zwölftes", 12), - ("zwölften", 12), - ("zwoelft", 12), - ("zwoelfter", 12), - ("zwoelfte", 12), - ("zwoelftes", 12), - ("zwoelften", 12), - ("zwölftel", 12), - ("zwoelftel", 12), - ("dreizehnt", 13), - ("dreizehnter", 13), - ("dreizehnte", 13), - ("dreizehntes", 13), - ("dreizehnten", 13), - ("dreizehntel", 13), - ("vierzehnt", 14), - ("vierzehnter", 14), - ("vierzehnte", 14), - ("vierzehntes", 14), - ("vierzehnten", 14), - ("vierzehntel", 14), - ("fünfzehnt", 15), - ("fünfzehnter", 15), - ("fünfzehnte", 15), - ("fünfzehntes", 15), - ("fünfzehnten", 15), - ("fünfzehntel", 15), - ("fuenfzehnt", 15), - ("fuenfzehnter", 15), - ("fuenfzehnte", 15), - ("fuenfzehntes", 15), - ("fuenfzehnten", 15), - ("fuenfzehntel", 15), - ("sechzehnt", 16), - ("sechzehnter", 16), - ("sechzehnte", 16), - ("sechzehntes", 16), - ("sechzehnten", 16), - ("sechzehntel", 16), - ("siebzehnt", 17), - ("siebzehnter", 17), - ("siebzehnte", 17), - ("siebzehntes", 17), - ("siebzehnten", 17), - ("siebzehntel", 17), - ("achtzehnt", 18), - ("achtzehnter", 18), - ("achtzehnte", 18), - ("achtzehntes", 18), - ("achtzehnten", 18), - ("achtzehntel", 18), - ("neunzehnt", 19), - ("neunzehnter", 19), - ("neunzehnte", 19), - ("neunzehntes", 19), - ("neunzehnten", 19), - ("neunzehntel", 19), - ("zwanzigst", 20), - ("zwanzigster", 20), - ("zwanzigste", 20), - ("zwanzigstes", 20), - ("zwanzigsten", 20), - ("zwangtigstel", 20), - ("dreißigst", 30), - ("dreißigster", 30), - ("dreißigste", 30), - ("dreißigstes", 30), - ("dreißigsten", 30), - ("dreißigstel", 30), - ("vierzigst", 40), - ("vierzigster", 40), - ("vierzigste", 40), - ("vierzigstes", 40), - ("vierzigsten", 40), - ("vierzigstel", 40), - ("fünfzigst", 50), - ("fünfzigster", 50), - ("fünfzigste", 50), - ("fünfzigsten", 50), - ("fünfzigstes", 50), - ("fünfzigstel", 50), - ("fuenfzigst", 50), - ("fuenfzigster", 50), - ("fuenfzigste", 50), - ("fuenfzigstes", 50), - ("fuenfzigsten", 50), - ("fuenfzigstel", 50), - ("sechzigst", 60), - ("sechzigster", 60), - ("sechzigste", 60), - ("sechzigstes", 60), - ("sechzigsten", 60), - ("sechzigstel", 60), - ("siebzigst", 70), - ("siebzigster", 70), - ("siebzigste", 70), - ("siebzigstes", 70), - ("siebzigsten", 70), - ("siebzigstel", 70), - ("achtzigst", 80), - ("achtzigster", 80), - ("achtzigste", 80), - ("achtzigstes", 80), - ("achtzigsten", 80), - ("achtzigstel", 80), - ("neunzigst", 90), - ("neunzigster", 90), - ("neunzigste", 90), - ("neunzigstes", 90), - ("neunzigsten", 90), - ("neunzigstel", 90), - ("hundertst", 100), - ("hundertster", 100), - ("hundertste", 100), - ("hundertstes", 100), - ("hundertsten", 100), - ("hundertstel", 100), - ("tausendst", 1000), - ("tausendster", 1000), - ("tausendste", 1000), - ("tausendstes", 1000), - ("tausendsten", 1000), - ("tausendstel", 1000), - ("millionst", 1000000), - ("millionster", 1000000), - ("millionste", 1000000), - ("millionstes", 1000000), - ("millionsten", 1000000), - ("millionstel", 1000000), - ("milliardster", 1000000000), - ("milliardste", 1000000000), - ("milliardstes", 1000000000), - ("milliardsten", 1000000000), - ("milliardstel", 1000000000), - ("billionster", 1000000000000), - ("billionste", 1000000000000), - ("billionstes", 1000000000000), - ("billionsten", 1000000000000), - ("billionstel", 1000000000000)]) - RoundNumberMap = dict([("hundert", 100), - ("tausend", 1000), - ("million", 1000000), - ("millionen", 1000000), - ("mio", 1000000), - ("milliard", 1000000000), - ("milliarde", 1000000000), - ("milliarden", 1000000000), - ("mrd", 1000000000), - ("billion", 1000000000000), - ("billionen", 1000000000000), - ("hundertstel", 100), - ("tausendstel", 1000), - ("millionstel", 1000000), - ("milliardstel", 1000000000), - ("billionstel", 1000000000000), - ("hundredths", 100), - ("dutzend", 12), - ("dutzende", 12), - ("k", 1000), - ("m", 1000000), - ("g", 1000000000), - ("b", 1000000000), - ("t", 1000000000000)]) - AmbiguityFiltersDict = dict([("^(tausend|hundert)$", "(ed(ward(\\s+m(\\.)?)?)?|mary(\\s+c(\\.)?)?|joachim|claudia|franz|maria|klaus|prof(\\.|essor)?|dr(\\.)?|herr|fr[äa]u(lein)?|frl?\\.)\\s+(tausend|hundert)")]) - RelativeReferenceOffsetMap = dict([("letzte", "0"), - ("letzten", "0"), - ("letzter", "0"), - ("nächste", "1"), - ("nächsten", "1"), - ("nächster", "1"), - ("vorherige", "-1"), - ("vorherigen", "-1"), - ("vorheriger", "-1"), - ("aktuelle", "0"), - ("aktuellen", "0"), - ("aktueller", "0"), - ("jetzige", "0"), - ("jetzigen", "0"), - ("jetziger", "0"), - ("vorletzte", "-1"), - ("vorletzten", "-1"), - ("vorletzter", "-1"), - ("drittletzte", "-2"), - ("drittletzten", "-2"), - ("drittletzter", "-2"), - ("zuletzt", "0"), - ("früher", "-1")]) - RelativeReferenceRelativeToMap = dict([("letzte", "end"), - ("letzten", "end"), - ("letzter", "end"), - ("nächste", "current"), - ("nächsten", "current"), - ("nächster", "current"), - ("vorherige", "current"), - ("vorherigen", "current"), - ("vorheriger", "current"), - ("aktuelle", "current"), - ("aktuellen", "current"), - ("aktueller", "current"), - ("jetzige", "current"), - ("jetzigen", "current"), - ("jetziger", "current"), - ("vorletzte", "end"), - ("vorletzten", "end"), - ("vorletzter", "end"), - ("drittletzte", "end"), - ("drittletzten", "end"), - ("drittletzter", "end"), - ("zuletzt", "end"), - ("früher", "current")]) + CardinalNumberMap = dict( + [ + ("ein", 1), + ("null", 0), + ("eine", 1), + ("eins", 1), + ("einer", 1), + ("einen", 1), + ("beiden", 2), + ("zwei", 2), + ("zwo", 2), + ("drei", 3), + ("vier", 4), + ("fünf", 5), + ("fuenf", 5), + ("sechs", 6), + ("sieben", 7), + ("acht", 8), + ("neun", 9), + ("zehn", 10), + ("elf", 11), + ("zwölf", 12), + ("zwoelf", 12), + ("dutzend", 12), + ("dreizehn", 13), + ("vierzehn", 14), + ("fünfzehn", 15), + ("fuenfzehn", 15), + ("sechzehn", 16), + ("siebzehn", 17), + ("achtzehn", 18), + ("neunzehn", 19), + ("zwanzig", 20), + ("dreißig", 30), + ("vierzig", 40), + ("fünfzig", 50), + ("fuenfzig", 50), + ("sechzig", 60), + ("siebzig", 70), + ("achtzig", 80), + ("neunzig", 90), + ("hundert", 100), + ("tausend", 1000), + ("million", 1000000), + ("mio", 1000000), + ("millionen", 1000000), + ("milliard", 100000000), + ("milliarde", 1000000000), + ("mrd", 1000000000), + ("milliarden", 1000000000), + ("billion", 1000000000000), + ("billionen", 1000000000000), + ] + ) + OrdinalNumberMap = dict( + [ + ("zuerst", 1), + ("erst", 1), + ("erster", 1), + ("erste", 1), + ("erstes", 1), + ("ersten", 1), + ("zweit", 2), + ("zweiter", 2), + ("zweite", 2), + ("zweites", 2), + ("zweiten", 2), + ("halb", 2), + ("halbe", 2), + ("halbes", 2), + ("hälfte", 2), + ("haelfte", 2), + ("dritt", 3), + ("dritter", 3), + ("dritte", 3), + ("drittes", 3), + ("dritten", 3), + ("drittel", 3), + ("viert", 4), + ("vierter", 4), + ("vierte", 4), + ("viertes", 4), + ("vierten", 4), + ("viertel", 4), + ("fünft", 5), + ("fünfter", 5), + ("fünfte", 5), + ("fünftes", 5), + ("fünften", 5), + ("fuenft", 5), + ("fuenfter", 5), + ("fuenfte", 5), + ("fuenftes", 5), + ("fuenften", 5), + ("fünftel", 5), + ("fuenftel", 5), + ("sechst", 6), + ("sechster", 6), + ("sechste", 6), + ("sechstes", 6), + ("sechsten", 6), + ("sechstel", 6), + ("siebt", 7), + ("siebter", 7), + ("siebte", 7), + ("siebtes", 7), + ("siebten", 7), + ("siebtel", 7), + ("acht", 8), + ("achter", 8), + ("achte", 8), + ("achtes", 8), + ("achten", 8), + ("achtel", 8), + ("neunt", 9), + ("neunter", 9), + ("neunte", 9), + ("neuntes", 9), + ("neunten", 9), + ("neuntel", 9), + ("zehnt", 10), + ("zehnter", 10), + ("zehnte", 10), + ("zehntes", 10), + ("zehnten", 10), + ("zehntel", 10), + ("elft", 11), + ("elfter", 11), + ("elfte", 11), + ("elftes", 11), + ("elften", 11), + ("elftel", 11), + ("zwölft", 12), + ("zwölfter", 12), + ("zwölfte", 12), + ("zwölftes", 12), + ("zwölften", 12), + ("zwoelft", 12), + ("zwoelfter", 12), + ("zwoelfte", 12), + ("zwoelftes", 12), + ("zwoelften", 12), + ("zwölftel", 12), + ("zwoelftel", 12), + ("dreizehnt", 13), + ("dreizehnter", 13), + ("dreizehnte", 13), + ("dreizehntes", 13), + ("dreizehnten", 13), + ("dreizehntel", 13), + ("vierzehnt", 14), + ("vierzehnter", 14), + ("vierzehnte", 14), + ("vierzehntes", 14), + ("vierzehnten", 14), + ("vierzehntel", 14), + ("fünfzehnt", 15), + ("fünfzehnter", 15), + ("fünfzehnte", 15), + ("fünfzehntes", 15), + ("fünfzehnten", 15), + ("fünfzehntel", 15), + ("fuenfzehnt", 15), + ("fuenfzehnter", 15), + ("fuenfzehnte", 15), + ("fuenfzehntes", 15), + ("fuenfzehnten", 15), + ("fuenfzehntel", 15), + ("sechzehnt", 16), + ("sechzehnter", 16), + ("sechzehnte", 16), + ("sechzehntes", 16), + ("sechzehnten", 16), + ("sechzehntel", 16), + ("siebzehnt", 17), + ("siebzehnter", 17), + ("siebzehnte", 17), + ("siebzehntes", 17), + ("siebzehnten", 17), + ("siebzehntel", 17), + ("achtzehnt", 18), + ("achtzehnter", 18), + ("achtzehnte", 18), + ("achtzehntes", 18), + ("achtzehnten", 18), + ("achtzehntel", 18), + ("neunzehnt", 19), + ("neunzehnter", 19), + ("neunzehnte", 19), + ("neunzehntes", 19), + ("neunzehnten", 19), + ("neunzehntel", 19), + ("zwanzigst", 20), + ("zwanzigster", 20), + ("zwanzigste", 20), + ("zwanzigstes", 20), + ("zwanzigsten", 20), + ("zwangtigstel", 20), + ("dreißigst", 30), + ("dreißigster", 30), + ("dreißigste", 30), + ("dreißigstes", 30), + ("dreißigsten", 30), + ("dreißigstel", 30), + ("vierzigst", 40), + ("vierzigster", 40), + ("vierzigste", 40), + ("vierzigstes", 40), + ("vierzigsten", 40), + ("vierzigstel", 40), + ("fünfzigst", 50), + ("fünfzigster", 50), + ("fünfzigste", 50), + ("fünfzigsten", 50), + ("fünfzigstes", 50), + ("fünfzigstel", 50), + ("fuenfzigst", 50), + ("fuenfzigster", 50), + ("fuenfzigste", 50), + ("fuenfzigstes", 50), + ("fuenfzigsten", 50), + ("fuenfzigstel", 50), + ("sechzigst", 60), + ("sechzigster", 60), + ("sechzigste", 60), + ("sechzigstes", 60), + ("sechzigsten", 60), + ("sechzigstel", 60), + ("siebzigst", 70), + ("siebzigster", 70), + ("siebzigste", 70), + ("siebzigstes", 70), + ("siebzigsten", 70), + ("siebzigstel", 70), + ("achtzigst", 80), + ("achtzigster", 80), + ("achtzigste", 80), + ("achtzigstes", 80), + ("achtzigsten", 80), + ("achtzigstel", 80), + ("neunzigst", 90), + ("neunzigster", 90), + ("neunzigste", 90), + ("neunzigstes", 90), + ("neunzigsten", 90), + ("neunzigstel", 90), + ("hundertst", 100), + ("hundertster", 100), + ("hundertste", 100), + ("hundertstes", 100), + ("hundertsten", 100), + ("hundertstel", 100), + ("tausendst", 1000), + ("tausendster", 1000), + ("tausendste", 1000), + ("tausendstes", 1000), + ("tausendsten", 1000), + ("tausendstel", 1000), + ("millionst", 1000000), + ("millionster", 1000000), + ("millionste", 1000000), + ("millionstes", 1000000), + ("millionsten", 1000000), + ("millionstel", 1000000), + ("milliardster", 1000000000), + ("milliardste", 1000000000), + ("milliardstes", 1000000000), + ("milliardsten", 1000000000), + ("milliardstel", 1000000000), + ("billionster", 1000000000000), + ("billionste", 1000000000000), + ("billionstes", 1000000000000), + ("billionsten", 1000000000000), + ("billionstel", 1000000000000), + ] + ) + RoundNumberMap = dict( + [ + ("hundert", 100), + ("tausend", 1000), + ("million", 1000000), + ("millionen", 1000000), + ("mio", 1000000), + ("milliard", 1000000000), + ("milliarde", 1000000000), + ("milliarden", 1000000000), + ("mrd", 1000000000), + ("billion", 1000000000000), + ("billionen", 1000000000000), + ("hundertstel", 100), + ("tausendstel", 1000), + ("millionstel", 1000000), + ("milliardstel", 1000000000), + ("billionstel", 1000000000000), + ("hundredths", 100), + ("dutzend", 12), + ("dutzende", 12), + ("k", 1000), + ("m", 1000000), + ("g", 1000000000), + ("b", 1000000000), + ("t", 1000000000000), + ] + ) + AmbiguityFiltersDict = dict( + [ + ( + "^(tausend|hundert)$", + "(ed(ward(\\s+m(\\.)?)?)?|mary(\\s+c(\\.)?)?|joachim|claudia|franz|maria|klaus|prof(\\.|essor)?|dr(\\.)?|herr|fr[äa]u(lein)?|frl?\\.)\\s+(tausend|hundert)", + ) + ] + ) + RelativeReferenceOffsetMap = dict( + [ + ("letzte", "0"), + ("letzten", "0"), + ("letzter", "0"), + ("nächste", "1"), + ("nächsten", "1"), + ("nächster", "1"), + ("vorherige", "-1"), + ("vorherigen", "-1"), + ("vorheriger", "-1"), + ("aktuelle", "0"), + ("aktuellen", "0"), + ("aktueller", "0"), + ("jetzige", "0"), + ("jetzigen", "0"), + ("jetziger", "0"), + ("vorletzte", "-1"), + ("vorletzten", "-1"), + ("vorletzter", "-1"), + ("drittletzte", "-2"), + ("drittletzten", "-2"), + ("drittletzter", "-2"), + ("zuletzt", "0"), + ("früher", "-1"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("letzte", "end"), + ("letzten", "end"), + ("letzter", "end"), + ("nächste", "current"), + ("nächsten", "current"), + ("nächster", "current"), + ("vorherige", "current"), + ("vorherigen", "current"), + ("vorheriger", "current"), + ("aktuelle", "current"), + ("aktuellen", "current"), + ("aktueller", "current"), + ("jetzige", "current"), + ("jetzigen", "current"), + ("jetziger", "current"), + ("vorletzte", "end"), + ("vorletzten", "end"), + ("vorletzter", "end"), + ("drittletzte", "end"), + ("drittletzten", "end"), + ("drittletzter", "end"), + ("zuletzt", "end"), + ("früher", "current"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/italian_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/italian_numeric.py index acc9361404..d692e6fd85 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/italian_numeric.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/italian_numeric.py @@ -10,6 +10,8 @@ # ------------------------------------------------------------------------------ from .base_numbers import BaseNumbers + + # pylint: disable=line-too-long @@ -17,45 +19,54 @@ class ItalianNumeric: LangMarker = 'Ita' CompoundNumberLanguage = True MultiDecimalSeparatorCulture = False - DigitsNumberRegex = f'\\d|\\d{{1,3}}(\\.\\d{{3}})' - RoundNumberIntegerRegex = f'(cent(o|(?!\\b)|(?=\'))|mill(e|(?!\\b)|(?=\'))|mila|miliard([oi]|(?!\\b)|(?=\'))|(milion|bilion|trilion)([ei]|(?!\\b)|(?=\')))' - ZeroToNineIntegerRegex = f'(un[oa]?|due|tre|quattro|cinque|sei|sette|otto|nove|zero)' - TwoToNineIntegerRegex = f'(due|tre|quattro|cinque|sei|sette|otto|nove)' - NegativeNumberTermsRegex = f'(?meno\\s+)' + DigitsNumberRegex = '\\d|\\d{1,3}(\\.\\d{3})' + RoundNumberIntegerRegex = '(cent(o|(?!\\b)|(?=\'))|mill(e|(?!\\b)|(?=\'))|mila|miliard([oi]|(?!\\b)|(?=\'))|(milion|bilion|trilion)([ei]|(?!\\b)|(?=\')))' + ZeroToNineIntegerRegex = '(un[oa]?|due|tre|quattro|cinque|sei|sette|otto|nove|zero)' + TwoToNineIntegerRegex = '(due|tre|quattro|cinque|sei|sette|otto|nove)' + NegativeNumberTermsRegex = '(?meno\\s+)' NegativeNumberSignRegex = f'^{NegativeNumberTermsRegex}.*' - AnIntRegex = f'(un)(?=\\s)' - TenToNineteenIntegerRegex = f'(diciott(o|(?!\\b)|(?=\'))|(diciassett|diciannov)(e|(?!\\b)|(?=\'))|(tredic|quattordic|quindic|sedic|undic|dodic|diec)(i|(?!\\b)|(?=\')))' - TensNumberIntegerRegex = f'(vent(i|(?!\\b)|(?=\'))|(settant|trent|ottant|novant|quarant|cinquant|sessant)(a|(?!\\b)|(?=\')))' + AnIntRegex = '(un)(?=\\s)' + TenToNineteenIntegerRegex = '(diciott(o|(?!\\b)|(?=\'))|(diciassett|diciannov)(e|(?!\\b)|(?=\'))|(tredic|quattordic|quindic|sedic|undic|dodic|diec)(i|(?!\\b)|(?=\')))' + TensNumberIntegerRegex = ( + '(vent(i|(?!\\b)|(?=\'))|(settant|trent|ottant|novant|quarant|cinquant|sessant)(a|(?!\\b)|(?=\')))' + ) SeparaIntRegex = f'((({TenToNineteenIntegerRegex}|({TensNumberIntegerRegex}{ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex})(\\s*{RoundNumberIntegerRegex})*))|((({AnIntRegex})?(\\s*{RoundNumberIntegerRegex})+))' AllIntRegex = f'(((({TenToNineteenIntegerRegex}|({TensNumberIntegerRegex}{ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|({AnIntRegex})?)(\\s*{RoundNumberIntegerRegex})+)\\s*(e\\s+)?)*{SeparaIntRegex})' - PlaceHolderPureNumber = f'\\b' - PlaceHolderDefault = f'\\D|\\b' + PlaceHolderPureNumber = '\\b' + PlaceHolderDefault = '\\D|\\b' def NumbersWithPlaceHolder(placeholder): return f'(((?<=\\W|^)-\\s*)|(?<=\\b))\\d+(?!(,\\d+[a-zA-Z]))(?={placeholder})' + NumbersWithSuffix = f'(((?<=\\W|^)-\\s*)|(?<=\\b))\\d+\\s*{BaseNumbers.NumberMultiplierRegex}(?=\\b)' RoundNumberIntegerRegexWithLocks = f'(?<=\\b)({DigitsNumberRegex})+\\s+{RoundNumberIntegerRegex}(?=\\b)' - NumbersWithDozenSuffix = f'(((?precedent[ei]|seguent[ei]|prossim[aoei]|corrent[ei]|successiv[aoei]|penultim[oaei]|terzultim[oaei]|(l\')?(ultim[oaei]|attual[ei])|quell[ao]\\s+prima\\s+dell\'ultim[ao])' + RoundNumberOrdinalRegex = ( + '(centesim[oaie]|millesim[oaie]|milionesim[oaie]|miliardesim[oaie]|bilionesim[oaie]|trilionesim[oaie])' + ) + OneToNineOrdinalRegex = ( + '(prim[oaie]|second[oaie]|terz[oaie]|quart[oaie]|quint[oaie]|sest[oaie]|settim[oaie]|ottav[oaie]|non[oaie])' + ) + NumberOrdinalRegex = '(prim[oaie]|second[oaie]|terz[oaie]|quart[oaie]|quint[oaie]|sest[oaie]|settim[oaie]|ottav[oaie]|non[oaie]|decim[oaie]|undicesim[oaie]|dodicesim[oaie]|tredicesim[oaie]|quattordicesim[oaie]|quindicesim[oaie]|sedicesim[oaie]|diciassettesim[oaie]|diciottesim[oaie]|diciannovesim[oaie]|ventesim[oaie]|trentesim[oaie]|quarantesim[oaie]|cinquantesim[oaie]|sessantesim[oaie]|settantesim[oaie]|ottantesim[oaie]|novantesim[oaie])' + OneToNineOrdinalCompoundRegex = '(un|du|tre|quattr|cinqu|sei|sett|ott|nov)esim[oaie]' + RelativeOrdinalRegex = '(?precedent[ei]|seguent[ei]|prossim[aoei]|corrent[ei]|successiv[aoei]|penultim[oaei]|terzultim[oaei]|(l\')?(ultim[oaei]|attual[ei])|quell[ao]\\s+prima\\s+dell\'ultim[ao])' BasicOrdinalRegex = f'({NumberOrdinalRegex}(?!\\s*({TwoToNineIntegerRegex}|([2-9]+))\\b))' SuffixBasicOrdinalRegex = f'((((({TensNumberIntegerRegex}{ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|({AnIntRegex})|{RoundNumberIntegerRegex})(\\s*{RoundNumberIntegerRegex})*)\\s*(e\\s+)?)*({TensNumberIntegerRegex}?{OneToNineOrdinalCompoundRegex}|{BasicOrdinalRegex}))' SuffixRoundNumberOrdinalRegex = f'(({AllIntRegex}\\s*)?{RoundNumberOrdinalRegex})' AllOrdinalNumberRegex = f'({SuffixRoundNumberOrdinalRegex}|{SuffixBasicOrdinalRegex})' AllOrdinalRegex = f'(?:{AllOrdinalNumberRegex}|{RelativeOrdinalRegex})' - OrdinalSuffixRegex = f'(?<=\\b)(\\d+(°|(esi)?m[oaie]))' - OrdinalNumericRegex = f'(?<=\\b)(\\d{{1,3}}(\\s*,\\s*\\d{{3}})*(°|(esi)?m[oaie]))' + OrdinalSuffixRegex = '(?<=\\b)(\\d+(°|(esi)?m[oaie]))' + OrdinalNumericRegex = '(?<=\\b)(\\d{1,3}(\\s*,\\s*\\d{3})*(°|(esi)?m[oaie]))' OrdinalRoundNumberRegex = f'(?\\s+e\\s+(mezzo|(un|{TwoToNineIntegerRegex})\\s+(mezz[oi]|quart[oi]|terz[oi]|quint[oi]|sest[oi]|settim[oi]|ottav[oi]|non[oi]|decim[oi])))' - RoundMultiplierWithFraction = f'(?(?:milion[ei]|miliard[oi]|bilion[ei]|trillion[ei]))(?={FractionMultiplierRegex}?$)' + RoundMultiplierWithFraction = ( + f'(?(?:milion[ei]|miliard[oi]|bilion[ei]|trillion[ei]))(?={FractionMultiplierRegex}?$)' + ) RoundMultiplierRegex = f'\\b\\s*({RoundMultiplierWithFraction}|(?(cento|mille|mila))$)' FractionNounRegex = f'(?<=\\b)({AllIntRegex}\\s+(e\\s+)?)?(({AllIntRegex})(\\s+|\\s*-\\s*)(?!\\bprimo\\b|\\bsecondo\\b)(mezzi|({AllOrdinalNumberRegex})|({RoundNumberOrdinalRegex}))|(mezzo|un\\s+quarto\\s+di)\\s+{RoundNumberIntegerRegex})(?=\\b)' FractionNounWithArticleRegex = f'(?<=\\b)((({AllIntRegex}|{RoundNumberIntegerRegexWithLocks})\\s+(e\\s+)?)?((un)(\\s+|\\s*-\\s*)(?!\\bprimo\\b|\\bsecondo\\b)({AllOrdinalNumberRegex}|{RoundNumberOrdinalRegex})|(un\\s+)?mezzo))(?=\\b)' @@ -68,28 +79,33 @@ def DoubleDecimalPointRegex(placeholder): def DoubleWithoutIntegralRegex(placeholder): return f'(?<=\\s|^)(?e)' - DoubleExponentialNotationRegex = f'(((?)' - LessRegex = f'((meno|più\\s+(in\\s+)?bass[oi]|più\\s+piccol[oi]|minor[ei]|al\\s+di\\s+sotto)(\\s+di)?|sotto(\\s+i)?|inferior[ei](\\s+a)?|(?|=)<)' - EqualRegex = f'(ugual[ei](\\s+a)?|(?)=)' + ConnectorRegex = '(?e)' + DoubleExponentialNotationRegex = '(((?)' + LessRegex = '((meno|più\\s+(in\\s+)?bass[oi]|più\\s+piccol[oi]|minor[ei]|al\\s+di\\s+sotto)(\\s+di)?|sotto(\\s+i)?|inferior[ei](\\s+a)?|(?|=)<)' + EqualRegex = '(ugual[ei](\\s+a)?|(?)=)' MoreOrEqualPrefix = f'((non\\s+((è|sono)\\s+)?{LessRegex})|(almeno))' MoreOrEqual = f'(({MoreRegex}\\s+(o)?\\s+{EqualRegex})|({EqualRegex}\\s+(o)?\\s+{MoreRegex})|{MoreOrEqualPrefix}(\\s+(o)?\\s+{EqualRegex})?|({EqualRegex}\\s+(o)?\\s+)?{MoreOrEqualPrefix}|>\\s*=)' - MoreOrEqualSuffix = f'((e|o)\\s+(((più\\s+grand[ei]|più\\s+(in\\s+)?alt[oi]|maggior[ei]|al\\s+di\\s+sopra|più)((?!\\s+di)|(\\s+di(?!(\\s*\\d+)))))|((superior[ei])((?!\\s+a)|(\\s+a(?!(\\s*\\d+)))))))' + MoreOrEqualSuffix = '((e|o)\\s+(((più\\s+grand[ei]|più\\s+(in\\s+)?alt[oi]|maggior[ei]|al\\s+di\\s+sopra|più)((?!\\s+di)|(\\s+di(?!(\\s*\\d+)))))|((superior[ei])((?!\\s+a)|(\\s+a(?!(\\s*\\d+)))))))' LessOrEqualPrefix = f'((non\\s+((è|sono)\\s+)?{MoreRegex})|(al\\s+più))' LessOrEqual = f'(({LessRegex}\\s+(o)?\\s+{EqualRegex})|({EqualRegex}\\s+(o)?\\s+{LessRegex})|{LessOrEqualPrefix}(\\s+(o)?\\s+{EqualRegex})?|({EqualRegex}\\s+(o)?\\s+)?{LessOrEqualPrefix}|<\\s*=)' - LessOrEqualSuffix = f'((e|o)\\s+(((meno|più\\s+(in\\s+)?bass[oi]|più\\s+piccol[oi]|minor[ei]|al\\s+di\\s+sotto)((?!\\s+di)|(\\s+di(?!(\\s*\\d+)))))|((meno|inferior[ei])((?!\\s+a)|(\\s+a(?!(\\s*\\d+)))))))' - NumberSplitMark = f'(?![,.](?!\\d+))' - MoreRegexNoNumberSucceed = f'((più\\s+grand[ei]|più\\s+(in\\s+)?alt[oi]|maggior[ei]|al\\s+di\\s+sopra|più)((?!\\s+di)|\\s+(di(?!(\\s*\\d+))))|(sopra(\\s+i)?|superior[ei](\\s+a)?)(?!(\\s*\\d+)))' - LessRegexNoNumberSucceed = f'((meno|più\\s+(in\\s+)?bass[oi]|più\\s+piccol[oi]|minor[ei]|al\\s+di\\s+sotto)((?!\\s+di)|\\s+(di(?!(\\s*\\d+))))|(sotto(\\s+i)?|inferior[ei](\\s+a)?)(?!(\\s*\\d+)))' - EqualRegexNoNumberSucceed = f'(ugual[ei]((?!\\s+a)|(\\s+a(?!(\\s*\\d+)))))' + LessOrEqualSuffix = '((e|o)\\s+(((meno|più\\s+(in\\s+)?bass[oi]|più\\s+piccol[oi]|minor[ei]|al\\s+di\\s+sotto)((?!\\s+di)|(\\s+di(?!(\\s*\\d+)))))|((meno|inferior[ei])((?!\\s+a)|(\\s+a(?!(\\s*\\d+)))))))' + NumberSplitMark = '(?![,.](?!\\d+))' + MoreRegexNoNumberSucceed = '((più\\s+grand[ei]|più\\s+(in\\s+)?alt[oi]|maggior[ei]|al\\s+di\\s+sopra|più)((?!\\s+di)|\\s+(di(?!(\\s*\\d+))))|(sopra(\\s+i)?|superior[ei](\\s+a)?)(?!(\\s*\\d+)))' + LessRegexNoNumberSucceed = '((meno|più\\s+(in\\s+)?bass[oi]|più\\s+piccol[oi]|minor[ei]|al\\s+di\\s+sotto)((?!\\s+di)|\\s+(di(?!(\\s*\\d+))))|(sotto(\\s+i)?|inferior[ei](\\s+a)?)(?!(\\s*\\d+)))' + EqualRegexNoNumberSucceed = '(ugual[ei]((?!\\s+a)|(\\s+a(?!(\\s*\\d+)))))' OneNumberRangeMoreRegex1 = f'({MoreOrEqual}|{MoreRegex})\\s*((il?|de[li])\\s+)?(?({NumberSplitMark}.)+)' OneNumberRangeMoreRegex2 = f'(?({NumberSplitMark}.)+)\\s*{MoreOrEqualSuffix}' OneNumberRangeMoreSeparateRegex = f'({EqualRegex}\\s+(?({NumberSplitMark}.)+)(\\s+or\\s+){MoreRegexNoNumberSucceed})|({MoreRegex}\\s+(?({NumberSplitMark}.)+)(\\s+or\\s+){EqualRegexNoNumberSucceed})' @@ -111,357 +127,379 @@ def DoubleWithoutIntegralRegex(placeholder): WrittenIntegerSeparatorTexts = [r'e', r'-'] WrittenFractionSeparatorTexts = [r'e'] OneHalfTokens = [r'un', r'mezzo'] - HalfADozenRegex = f'mezza\\s+dozzina' + HalfADozenRegex = 'mezza\\s+dozzina' DigitalNumberRegex = f'((?<=\\b)(cento|mille|milione|milioni|miliardo|miliardi|bilione|bilioni|trilione|trilioni|dozzina|dozzine)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' - AmbiguousFractionConnectorsRegex = f'(\\bnel\\b)' - CardinalNumberMap = dict([("zero", 0), - ("un", 1), - ("una", 1), - ("uno", 1), - ("due", 2), - ("tre", 3), - ("quattro", 4), - ("cinque", 5), - ("sei", 6), - ("sette", 7), - ("otto", 8), - ("tto", 8), - ("nove", 9), - ("dieci", 10), - ("undici", 11), - ("dodici", 12), - ("dozzina", 12), - ("dozzine", 12), - ("tredici", 13), - ("quattordici", 14), - ("quindici", 15), - ("sedici", 16), - ("diciassette", 17), - ("diciotto", 18), - ("diciannove", 19), - ("venti", 20), - ("vent", 20), - ("trenta", 30), - ("trent", 30), - ("quaranta", 40), - ("quarant", 40), - ("cinquanta", 50), - ("cinquant", 50), - ("sessanta", 60), - ("sessant", 60), - ("settanta", 70), - ("settant", 70), - ("ottanta", 80), - ("ottant", 80), - ("ttanta", 80), - ("ttant", 80), - ("novanta", 90), - ("novant", 90), - ("cento", 100), - ("cent", 100), - ("mille", 1000), - ("mila", 1000), - ("milione", 1000000), - ("milioni", 1000000), - ("miliardo", 1000000000), - ("miliardi", 1000000000), - ("bilione", 1000000000000), - ("bilioni", 1000000000000), - ("trilione", 1000000000000000000), - ("trilioni", 1000000000000000000)]) - OrdinalNumberMap = dict([("primo", 1), - ("prima", 1), - ("secondo", 2), - ("seconda", 2), - ("metà", 2), - ("mezzo", 2), - ("mezza", 2), - ("terzo", 3), - ("terza", 3), - ("quarto", 4), - ("quarta", 4), - ("quinto", 5), - ("quinta", 5), - ("sesto", 6), - ("sesta", 6), - ("settimo", 7), - ("settima", 7), - ("ottavo", 8), - ("ottava", 8), - ("ttavo", 8), - ("ttava", 8), - ("nono", 9), - ("nona", 9), - ("decimo", 10), - ("decima", 10), - ("undicesimo", 11), - ("undicesima", 11), - ("dodicesimo", 12), - ("dodicesima", 12), - ("tredicesimo", 13), - ("tredicesima", 13), - ("quattordicesimo", 14), - ("quattordicesima", 14), - ("quindicesimo", 15), - ("quindicesima", 15), - ("sedicesimo", 16), - ("sedicesima", 16), - ("diciassettesimo", 17), - ("diciassettesima", 17), - ("diciottesimo", 18), - ("diciottesima", 18), - ("diciannovesimo", 19), - ("diciannovesima", 19), - ("ventesimo", 20), - ("ventesima", 20), - ("ventunesimo", 21), - ("ventunesima", 21), - ("trentesimo", 30), - ("trentesima", 30), - ("quarantesimo", 40), - ("quarantesima", 40), - ("cinquantesimo", 50), - ("cinquantesima", 50), - ("sessantesimo", 60), - ("sessantesima", 60), - ("settantesimo", 70), - ("settantesima", 70), - ("ottantesimo", 80), - ("ottantesima", 80), - ("ttantesimo", 80), - ("ttantesima", 80), - ("novantesimo", 90), - ("novantesima", 90), - ("centesimo", 100), - ("centesima", 100), - ("millesimo", 1000), - ("millesima", 1000), - ("milionesimo", 1000000), - ("milionesima", 1000000), - ("miliardesimo", 1000000000), - ("miliardesima", 1000000000), - ("bilionesimo", 1000000000000), - ("bilionesima", 1000000000000), - ("trilionesimo", 1000000000000000000), - ("trilionesima", 1000000000000000000), - ("primi", 1), - ("prime", 1), - ("secondi", 2), - ("seconde", 2), - ("mezzi", 2), - ("mezze", 2), - ("terzi", 3), - ("terze", 3), - ("quarti", 4), - ("quarte", 4), - ("quinti", 5), - ("quinte", 5), - ("sesti", 6), - ("seste", 6), - ("settimi", 7), - ("settime", 7), - ("ottavi", 8), - ("ottave", 8), - ("noni", 9), - ("none", 9), - ("unesimo", 1), - ("unesima", 1), - ("unesime", 1), - ("unesimi", 1), - ("duesimo", 2), - ("duesima", 2), - ("duesime", 2), - ("duesimi", 2), - ("treesimo", 3), - ("treesima", 3), - ("treesime", 3), - ("treesimi", 3), - ("quattresimo", 4), - ("quattresima", 4), - ("quattresime", 4), - ("quattresimi", 4), - ("cinquesimo", 5), - ("cinquesima", 5), - ("cinquesime", 5), - ("cinquesimi", 5), - ("seiesimo", 6), - ("seiesima", 6), - ("seiesime", 6), - ("seiesimi", 6), - ("settesimo", 7), - ("settesima", 7), - ("settesime", 7), - ("settesimi", 7), - ("ottesimo", 8), - ("ottesima", 8), - ("ottesime", 8), - ("ottesimi", 8), - ("novesimo", 9), - ("novesima", 9), - ("novesime", 9), - ("novesimi", 9), - ("decimi", 10), - ("decime", 10), - ("undicesimi", 11), - ("undicesime", 11), - ("dodicesimi", 12), - ("dodicesime", 12), - ("tredicesimi", 13), - ("tredicesime", 13), - ("quattordicesimi", 14), - ("quattordicesime", 14), - ("quindicesimi", 15), - ("quindicesime", 15), - ("sedicesimi", 16), - ("sedicesime", 16), - ("diciassettesimi", 17), - ("diciassettesime", 17), - ("diciottesimi", 18), - ("diciottesime", 18), - ("diciannovesimi", 19), - ("diciannovesime", 19), - ("ventesimi", 20), - ("ventesime", 20), - ("trentesimi", 30), - ("trentesime", 30), - ("quarantesimi", 40), - ("quarantesime", 40), - ("cinquantesimi", 50), - ("cinquantesime", 50), - ("sessantesimi", 60), - ("sessantesime", 60), - ("settantesimi", 70), - ("settantesime", 70), - ("ottantesimi", 80), - ("ottantesime", 80), - ("ttantesimi", 80), - ("ttantesime", 80), - ("novantesimi", 90), - ("novantesime", 90), - ("centesimi", 100), - ("centesime", 100), - ("millesimi", 1000), - ("millesime", 1000), - ("milionesimi", 1000000), - ("milionesime", 1000000), - ("miliardesimi", 1000000000), - ("miliardesime", 1000000000), - ("bilionesimi", 1000000000000), - ("bilionesime", 1000000000000), - ("trilionesimi", 1000000000000000000), - ("trilionesime", 1000000000000000000)]) - RoundNumberMap = dict([("cento", 100), - ("mille", 1000), - ("mila", 1000), - ("milione", 1000000), - ("milioni", 1000000), - ("miliardo", 1000000000), - ("miliardi", 1000000000), - ("bilione", 1000000000000), - ("bilioni", 1000000000000), - ("trilione", 1000000000000000000), - ("trilioni", 1000000000000000000), - ("centinaio", 100), - ("centinai", 100), - ("centinaie", 100), - ("millesimo", 1000), - ("milionesimo", 1000000), - ("miliardesimo", 1000000000), - ("bilionesimo", 1000000000000), - ("trilionesimo", 1000000000000000000), - ("millesima", 1000), - ("milionesima", 1000000), - ("miliardesima", 1000000000), - ("bilionesima", 1000000000000), - ("trilionesima", 1000000000000000000), - ("millesimi", 1000), - ("milionesimi", 1000000), - ("miliardesimi", 1000000000), - ("bilionesimi", 1000000000000), - ("trilionesimi", 1000000000000000000), - ("millesime", 1000), - ("milionesime", 1000000), - ("miliardesime", 1000000000), - ("bilionesime", 1000000000000), - ("trilionesime", 1000000000000000000), - ("centinaia", 100), - ("migliaia", 1000), - ("milionata", 1000000), - ("miliardata", 1000000000), - ("bilionata", 1000000000000), - ("trilionata", 1000000000000000000), - ("dozzina", 12), - ("dozzine", 12), - ("k", 1000), - ("m", 1000000), - ("g", 1000000000), - ("b", 1000000000), - ("t", 1000000000000)]) + AmbiguousFractionConnectorsRegex = '(\\bnel\\b)' + CardinalNumberMap = dict( + [ + ("zero", 0), + ("un", 1), + ("una", 1), + ("uno", 1), + ("due", 2), + ("tre", 3), + ("quattro", 4), + ("cinque", 5), + ("sei", 6), + ("sette", 7), + ("otto", 8), + ("tto", 8), + ("nove", 9), + ("dieci", 10), + ("undici", 11), + ("dodici", 12), + ("dozzina", 12), + ("dozzine", 12), + ("tredici", 13), + ("quattordici", 14), + ("quindici", 15), + ("sedici", 16), + ("diciassette", 17), + ("diciotto", 18), + ("diciannove", 19), + ("venti", 20), + ("vent", 20), + ("trenta", 30), + ("trent", 30), + ("quaranta", 40), + ("quarant", 40), + ("cinquanta", 50), + ("cinquant", 50), + ("sessanta", 60), + ("sessant", 60), + ("settanta", 70), + ("settant", 70), + ("ottanta", 80), + ("ottant", 80), + ("ttanta", 80), + ("ttant", 80), + ("novanta", 90), + ("novant", 90), + ("cento", 100), + ("cent", 100), + ("mille", 1000), + ("mila", 1000), + ("milione", 1000000), + ("milioni", 1000000), + ("miliardo", 1000000000), + ("miliardi", 1000000000), + ("bilione", 1000000000000), + ("bilioni", 1000000000000), + ("trilione", 1000000000000000000), + ("trilioni", 1000000000000000000), + ] + ) + OrdinalNumberMap = dict( + [ + ("primo", 1), + ("prima", 1), + ("secondo", 2), + ("seconda", 2), + ("metà", 2), + ("mezzo", 2), + ("mezza", 2), + ("terzo", 3), + ("terza", 3), + ("quarto", 4), + ("quarta", 4), + ("quinto", 5), + ("quinta", 5), + ("sesto", 6), + ("sesta", 6), + ("settimo", 7), + ("settima", 7), + ("ottavo", 8), + ("ottava", 8), + ("ttavo", 8), + ("ttava", 8), + ("nono", 9), + ("nona", 9), + ("decimo", 10), + ("decima", 10), + ("undicesimo", 11), + ("undicesima", 11), + ("dodicesimo", 12), + ("dodicesima", 12), + ("tredicesimo", 13), + ("tredicesima", 13), + ("quattordicesimo", 14), + ("quattordicesima", 14), + ("quindicesimo", 15), + ("quindicesima", 15), + ("sedicesimo", 16), + ("sedicesima", 16), + ("diciassettesimo", 17), + ("diciassettesima", 17), + ("diciottesimo", 18), + ("diciottesima", 18), + ("diciannovesimo", 19), + ("diciannovesima", 19), + ("ventesimo", 20), + ("ventesima", 20), + ("ventunesimo", 21), + ("ventunesima", 21), + ("trentesimo", 30), + ("trentesima", 30), + ("quarantesimo", 40), + ("quarantesima", 40), + ("cinquantesimo", 50), + ("cinquantesima", 50), + ("sessantesimo", 60), + ("sessantesima", 60), + ("settantesimo", 70), + ("settantesima", 70), + ("ottantesimo", 80), + ("ottantesima", 80), + ("ttantesimo", 80), + ("ttantesima", 80), + ("novantesimo", 90), + ("novantesima", 90), + ("centesimo", 100), + ("centesima", 100), + ("millesimo", 1000), + ("millesima", 1000), + ("milionesimo", 1000000), + ("milionesima", 1000000), + ("miliardesimo", 1000000000), + ("miliardesima", 1000000000), + ("bilionesimo", 1000000000000), + ("bilionesima", 1000000000000), + ("trilionesimo", 1000000000000000000), + ("trilionesima", 1000000000000000000), + ("primi", 1), + ("prime", 1), + ("secondi", 2), + ("seconde", 2), + ("mezzi", 2), + ("mezze", 2), + ("terzi", 3), + ("terze", 3), + ("quarti", 4), + ("quarte", 4), + ("quinti", 5), + ("quinte", 5), + ("sesti", 6), + ("seste", 6), + ("settimi", 7), + ("settime", 7), + ("ottavi", 8), + ("ottave", 8), + ("noni", 9), + ("none", 9), + ("unesimo", 1), + ("unesima", 1), + ("unesime", 1), + ("unesimi", 1), + ("duesimo", 2), + ("duesima", 2), + ("duesime", 2), + ("duesimi", 2), + ("treesimo", 3), + ("treesima", 3), + ("treesime", 3), + ("treesimi", 3), + ("quattresimo", 4), + ("quattresima", 4), + ("quattresime", 4), + ("quattresimi", 4), + ("cinquesimo", 5), + ("cinquesima", 5), + ("cinquesime", 5), + ("cinquesimi", 5), + ("seiesimo", 6), + ("seiesima", 6), + ("seiesime", 6), + ("seiesimi", 6), + ("settesimo", 7), + ("settesima", 7), + ("settesime", 7), + ("settesimi", 7), + ("ottesimo", 8), + ("ottesima", 8), + ("ottesime", 8), + ("ottesimi", 8), + ("novesimo", 9), + ("novesima", 9), + ("novesime", 9), + ("novesimi", 9), + ("decimi", 10), + ("decime", 10), + ("undicesimi", 11), + ("undicesime", 11), + ("dodicesimi", 12), + ("dodicesime", 12), + ("tredicesimi", 13), + ("tredicesime", 13), + ("quattordicesimi", 14), + ("quattordicesime", 14), + ("quindicesimi", 15), + ("quindicesime", 15), + ("sedicesimi", 16), + ("sedicesime", 16), + ("diciassettesimi", 17), + ("diciassettesime", 17), + ("diciottesimi", 18), + ("diciottesime", 18), + ("diciannovesimi", 19), + ("diciannovesime", 19), + ("ventesimi", 20), + ("ventesime", 20), + ("trentesimi", 30), + ("trentesime", 30), + ("quarantesimi", 40), + ("quarantesime", 40), + ("cinquantesimi", 50), + ("cinquantesime", 50), + ("sessantesimi", 60), + ("sessantesime", 60), + ("settantesimi", 70), + ("settantesime", 70), + ("ottantesimi", 80), + ("ottantesime", 80), + ("ttantesimi", 80), + ("ttantesime", 80), + ("novantesimi", 90), + ("novantesime", 90), + ("centesimi", 100), + ("centesime", 100), + ("millesimi", 1000), + ("millesime", 1000), + ("milionesimi", 1000000), + ("milionesime", 1000000), + ("miliardesimi", 1000000000), + ("miliardesime", 1000000000), + ("bilionesimi", 1000000000000), + ("bilionesime", 1000000000000), + ("trilionesimi", 1000000000000000000), + ("trilionesime", 1000000000000000000), + ] + ) + RoundNumberMap = dict( + [ + ("cento", 100), + ("mille", 1000), + ("mila", 1000), + ("milione", 1000000), + ("milioni", 1000000), + ("miliardo", 1000000000), + ("miliardi", 1000000000), + ("bilione", 1000000000000), + ("bilioni", 1000000000000), + ("trilione", 1000000000000000000), + ("trilioni", 1000000000000000000), + ("centinaio", 100), + ("centinai", 100), + ("centinaie", 100), + ("millesimo", 1000), + ("milionesimo", 1000000), + ("miliardesimo", 1000000000), + ("bilionesimo", 1000000000000), + ("trilionesimo", 1000000000000000000), + ("millesima", 1000), + ("milionesima", 1000000), + ("miliardesima", 1000000000), + ("bilionesima", 1000000000000), + ("trilionesima", 1000000000000000000), + ("millesimi", 1000), + ("milionesimi", 1000000), + ("miliardesimi", 1000000000), + ("bilionesimi", 1000000000000), + ("trilionesimi", 1000000000000000000), + ("millesime", 1000), + ("milionesime", 1000000), + ("miliardesime", 1000000000), + ("bilionesime", 1000000000000), + ("trilionesime", 1000000000000000000), + ("centinaia", 100), + ("migliaia", 1000), + ("milionata", 1000000), + ("miliardata", 1000000000), + ("bilionata", 1000000000000), + ("trilionata", 1000000000000000000), + ("dozzina", 12), + ("dozzine", 12), + ("k", 1000), + ("m", 1000000), + ("g", 1000000000), + ("b", 1000000000), + ("t", 1000000000000), + ] + ) AmbiguityFiltersDict = dict([("^[.]", "")]) - RelativeReferenceOffsetMap = dict([("precedente", "-1"), - ("precedenti", "-1"), - ("seguente", "1"), - ("seguenti", "1"), - ("prossima", "1"), - ("prossimo", "1"), - ("prossime", "1"), - ("prossimi", "1"), - ("corrente", "0"), - ("correnti", "0"), - ("attuale", "0"), - ("attuali", "0"), - ("l'attuale", "0"), - ("successiva", "1"), - ("successivo", "1"), - ("successive", "1"), - ("successivi", "1"), - ("penultima", "-1"), - ("penultimo", "-1"), - ("penultime", "-1"), - ("penultimi", "-1"), - ("quello prima dell'ultimo", "-1"), - ("quella prima dell'ultima", "-1"), - ("terzultima", "-2"), - ("terzultimo", "-2"), - ("terzultime", "-2"), - ("terzultimi", "-2"), - ("ultima", "0"), - ("ultimo", "0"), - ("ultime", "0"), - ("ultimi", "0"), - ("l'ultima", "0"), - ("l'ultimo", "0")]) - RelativeReferenceRelativeToMap = dict([("precedente", "current"), - ("precedenti", "current"), - ("seguente", "current"), - ("seguenti", "current"), - ("prossima", "current"), - ("prossimo", "current"), - ("prossime", "current"), - ("prossimi", "current"), - ("corrente", "current"), - ("correnti", "current"), - ("attuale", "current"), - ("attuali", "current"), - ("l'attuale", "current"), - ("successiva", "current"), - ("successivo", "current"), - ("successive", "current"), - ("successivi", "current"), - ("penultima", "end"), - ("penultimo", "end"), - ("penultime", "end"), - ("penultimi", "end"), - ("quello prima dell'ultimo", "end"), - ("quella prima dell'ultima", "end"), - ("terzultima", "end"), - ("terzultimo", "end"), - ("terzultime", "end"), - ("terzultimi", "end"), - ("ultima", "end"), - ("ultimo", "end"), - ("ultime", "end"), - ("ultimi", "end"), - ("l'ultima", "end"), - ("l'ultimo", "end")]) + RelativeReferenceOffsetMap = dict( + [ + ("precedente", "-1"), + ("precedenti", "-1"), + ("seguente", "1"), + ("seguenti", "1"), + ("prossima", "1"), + ("prossimo", "1"), + ("prossime", "1"), + ("prossimi", "1"), + ("corrente", "0"), + ("correnti", "0"), + ("attuale", "0"), + ("attuali", "0"), + ("l'attuale", "0"), + ("successiva", "1"), + ("successivo", "1"), + ("successive", "1"), + ("successivi", "1"), + ("penultima", "-1"), + ("penultimo", "-1"), + ("penultime", "-1"), + ("penultimi", "-1"), + ("quello prima dell'ultimo", "-1"), + ("quella prima dell'ultima", "-1"), + ("terzultima", "-2"), + ("terzultimo", "-2"), + ("terzultime", "-2"), + ("terzultimi", "-2"), + ("ultima", "0"), + ("ultimo", "0"), + ("ultime", "0"), + ("ultimi", "0"), + ("l'ultima", "0"), + ("l'ultimo", "0"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("precedente", "current"), + ("precedenti", "current"), + ("seguente", "current"), + ("seguenti", "current"), + ("prossima", "current"), + ("prossimo", "current"), + ("prossime", "current"), + ("prossimi", "current"), + ("corrente", "current"), + ("correnti", "current"), + ("attuale", "current"), + ("attuali", "current"), + ("l'attuale", "current"), + ("successiva", "current"), + ("successivo", "current"), + ("successive", "current"), + ("successivi", "current"), + ("penultima", "end"), + ("penultimo", "end"), + ("penultime", "end"), + ("penultimi", "end"), + ("quello prima dell'ultimo", "end"), + ("quella prima dell'ultima", "end"), + ("terzultima", "end"), + ("terzultimo", "end"), + ("terzultime", "end"), + ("terzultimi", "end"), + ("ultima", "end"), + ("ultimo", "end"), + ("ultime", "end"), + ("ultimi", "end"), + ("l'ultima", "end"), + ("l'ultimo", "end"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/japanese_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/japanese_numeric.py index 0c15c93c79..68bf48fdf5 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/japanese_numeric.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/japanese_numeric.py @@ -10,6 +10,8 @@ # ------------------------------------------------------------------------------ from .base_numbers import BaseNumbers + + # pylint: disable=line-too-long @@ -24,131 +26,150 @@ class JapaneseNumeric: WordSeparatorToken = '' ZeroChar = '零' PairChar = '対' - RoundNumberMap = dict([("k", 1000), - ("m", 1000000), - ("g", 1000000000), - ("t", 1000000000000), - ("b", 1000000000)]) - RoundNumberMapChar = dict([("十", 10), - ("百", 100), - ("千", 1000), - ("万", 10000), - ("億", 100000000), - ("兆", 1000000000000)]) - ZeroToNineMap = dict([("零", 0), - ("〇", 0), - ("一", 1), - ("二", 2), - ("三", 3), - ("四", 4), - ("五", 5), - ("六", 6), - ("七", 7), - ("八", 8), - ("九", 9), - ("0", 0), - ("1", 1), - ("2", 2), - ("3", 3), - ("4", 4), - ("5", 5), - ("6", 6), - ("7", 7), - ("8", 8), - ("9", 9), - ("半", 0.5)]) - FullToHalfMap = dict([("0", "0"), - ("1", "1"), - ("2", "2"), - ("3", "3"), - ("4", "4"), - ("5", "5"), - ("6", "6"), - ("7", "7"), - ("8", "8"), - ("9", "9"), - ("/", "/"), - ("-", "-"), - (",", "'"), - ("、", "'"), - ("G", "G"), - ("M", "M"), - ("T", "T"), - ("K", "K"), - ("k", "k"), - (".", ".")]) - UnitMap = dict([("万万", "億"), - ("億万", "兆"), - ("万億", "兆"), - (" ", ""), - ("れい", "〇"), - ("ゼロ", "〇"), - ("マル", "〇"), - ("いち", "一"), - ("いっ", "一"), - ("に", "二"), - ("さん", "三"), - ("し", "四"), - ("よん", "四"), - ("ご", "五"), - ("ろく", "六"), - ("ろっ", "六"), - ("しち", "七"), - ("なな", "七"), - ("はち", "八"), - ("はっ", "八"), - ("きゅう", "九"), - ("く", "九"), - ("じゅう", "十"), - ("ひゃく", "百"), - ("ぴゃく", "百"), - ("びゃく", "百"), - ("せん", "千"), - ("ぜん", "千"), - ("まん", "万"), - ("ひゃくまん", "百万"), - ("ぴゃくまん", "百万"), - ("びゃくまん", "百万"), - ("せんまん", "千万"), - ("ぜんまん", "千万")]) + RoundNumberMap = dict([("k", 1000), ("m", 1000000), ("g", 1000000000), ("t", 1000000000000), ("b", 1000000000)]) + RoundNumberMapChar = dict( + [("十", 10), ("百", 100), ("千", 1000), ("万", 10000), ("億", 100000000), ("兆", 1000000000000)] + ) + ZeroToNineMap = dict( + [ + ("零", 0), + ("〇", 0), + ("一", 1), + ("二", 2), + ("三", 3), + ("四", 4), + ("五", 5), + ("六", 6), + ("七", 7), + ("八", 8), + ("九", 9), + ("0", 0), + ("1", 1), + ("2", 2), + ("3", 3), + ("4", 4), + ("5", 5), + ("6", 6), + ("7", 7), + ("8", 8), + ("9", 9), + ("半", 0.5), + ] + ) + FullToHalfMap = dict( + [ + ("0", "0"), + ("1", "1"), + ("2", "2"), + ("3", "3"), + ("4", "4"), + ("5", "5"), + ("6", "6"), + ("7", "7"), + ("8", "8"), + ("9", "9"), + ("/", "/"), + ("-", "-"), + (",", "'"), + ("、", "'"), + ("G", "G"), + ("M", "M"), + ("T", "T"), + ("K", "K"), + ("k", "k"), + (".", "."), + ] + ) + UnitMap = dict( + [ + ("万万", "億"), + ("億万", "兆"), + ("万億", "兆"), + (" ", ""), + ("れい", "〇"), + ("ゼロ", "〇"), + ("マル", "〇"), + ("いち", "一"), + ("いっ", "一"), + ("に", "二"), + ("さん", "三"), + ("し", "四"), + ("よん", "四"), + ("ご", "五"), + ("ろく", "六"), + ("ろっ", "六"), + ("しち", "七"), + ("なな", "七"), + ("はち", "八"), + ("はっ", "八"), + ("きゅう", "九"), + ("く", "九"), + ("じゅう", "十"), + ("ひゃく", "百"), + ("ぴゃく", "百"), + ("びゃく", "百"), + ("せん", "千"), + ("ぜん", "千"), + ("まん", "万"), + ("ひゃくまん", "百万"), + ("ぴゃくまん", "百万"), + ("びゃくまん", "百万"), + ("せんまん", "千万"), + ("ぜんまん", "千万"), + ] + ) RoundDirectList = [r'万', r'億', r'兆'] TenChars = [r'十'] - RoundNumberIntegerRegex = f'(十|百|千|万(?!万)|億|兆)' - RoundNumberIntegerHiraganaRegex = f'(じゅう|[ひぴび]ゃく|[せぜ]ん|まん|[ひぴび]ゃくまん|[せぜ]んまん)' - AllMultiplierLookupRegex = f'({BaseNumbers.MultiplierLookupRegex}|ミリリットル(入れら)?|キロメートル|メートル|ミリメート)' + RoundNumberIntegerRegex = '(十|百|千|万(?!万)|億|兆)' + RoundNumberIntegerHiraganaRegex = '(じゅう|[ひぴび]ゃく|[せぜ]ん|まん|[ひぴび]ゃくまん|[せぜ]んまん)' + AllMultiplierLookupRegex = ( + f'({BaseNumbers.MultiplierLookupRegex}|ミリリットル(入れら)?|キロメートル|メートル|ミリメート)' + ) DigitalNumberRegex = f'((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' - ZeroToNineFullHalfRegex = f'[\\d]' + ZeroToNineFullHalfRegex = '[\\d]' DigitNumRegex = f'{ZeroToNineFullHalfRegex}+' - DozenRegex = f'.*ダース$' - PercentageSymbol = f'(パ\\s*ー\\s*セ\\s*ン\\s*ト|[%%])' - PercentageRegex = f'.+(?=パ\\s*ー\\s*セ\\s*ン\\s*ト)|.*(?=[%%])' - DoubleAndRoundRegex = f'{ZeroToNineFullHalfRegex}+(\\.{ZeroToNineFullHalfRegex}+)?\\s*{RoundNumberIntegerRegex}{{1,2}}(\\s*(以上))?' - FracSplitRegex = f'[はと]|分\\s*の' - ZeroToNineIntegerRegex = f'[零〇一二三四五六七八九]' - ZeroToNineIntegerHiraganaRegex = f'(れい|ゼロ|マル|い[ちっ]|に|さん|し|よん|ご|ろ[くっ]|しち|なな|は[ちっ]|きゅう|く)' - HalfUnitRegex = f'半' - NegativeNumberTermsRegex = f'(マ\\s*イ\\s*ナ\\s*ス)' + DozenRegex = '.*ダース$' + PercentageSymbol = '(パ\\s*ー\\s*セ\\s*ン\\s*ト|[%%])' + PercentageRegex = '.+(?=パ\\s*ー\\s*セ\\s*ン\\s*ト)|.*(?=[%%])' + DoubleAndRoundRegex = ( + f'{ZeroToNineFullHalfRegex}+(\\.{ZeroToNineFullHalfRegex}+)?\\s*{RoundNumberIntegerRegex}{{1,2}}(\\s*(以上))?' + ) + FracSplitRegex = '[はと]|分\\s*の' + ZeroToNineIntegerRegex = '[零〇一二三四五六七八九]' + ZeroToNineIntegerHiraganaRegex = ( + '(れい|ゼロ|マル|い[ちっ]|に|さん|し|よん|ご|ろ[くっ]|しち|なな|は[ちっ]|きゅう|く)' + ) + HalfUnitRegex = '半' + NegativeNumberTermsRegex = '(マ\\s*イ\\s*ナ\\s*ス)' NegativeNumberTermsRegexNum = f'((?((最後)(から1つ前のこと|から(3|2|1)番目|(から1つ前)(のもの)|から三番目|から二番目|(から(一|1)つ前)(のもの|のこと)?|(から1つ)?(前))?|(次のもの)(前)?|(前(?=の))(のもの)?|(現在)(のこと)?|次|二位))' + RelativeOrdinalRegex = '(?((最後)(から1つ前のこと|から(3|2|1)番目|(から1つ前)(のもの)|から三番目|から二番目|(から(一|1)つ前)(のもの|のこと)?|(から1つ)?(前))?|(次のもの)(前)?|(前(?=の))(のもの)?|(現在)(のこと)?|次|二位))' AllOrdinalRegex = f'({OrdinalRegex}|{RelativeOrdinalRegex})' AllFractionNumber = f'((({NegativeNumberTermsRegex}{{0,1}})|{NegativeNumberTermsRegexNum})(({ZeroToNineFullHalfRegex}+|{AllIntRegex})\\s*[はと]{{0,1}}\\s*)?{NegativeNumberTermsRegex}{{0,1}}({ZeroToNineFullHalfRegex}+|{AllIntRegex})\\s*分\\s*の\\s*{NegativeNumberTermsRegex}{{0,1}}({ZeroToNineFullHalfRegex}+|{AllIntRegex})+)|半(分|数)' FractionNotationSpecialsCharsRegex = f'({NegativeNumberTermsRegexNum}\\s*)?{ZeroToNineFullHalfRegex}+\\s+{ZeroToNineFullHalfRegex}+[//]{ZeroToNineFullHalfRegex}+' - FractionNotationRegex = f'({NegativeNumberTermsRegexNum}\\s*)?{ZeroToNineFullHalfRegex}+[//]{ZeroToNineFullHalfRegex}+' + FractionNotationRegex = ( + f'({NegativeNumberTermsRegexNum}\\s*)?{ZeroToNineFullHalfRegex}+[//]{ZeroToNineFullHalfRegex}+' + ) PercentagePointRegex = f'(?)' - LessRegex = f'(小なり|小さい|低い|(?|=)<)' - EqualRegex = f'(等しい|イコール|(?)=)' - MoreOrEqualPrefixRegex = f'(少なくとも)' - LessOrEqualPrefixRegex = f'(多くて)' + IntegerPercentageWithMultiplierRegex = ( + f'{ZeroToNineFullHalfRegex}+\\s*{BaseNumbers.NumberMultiplierRegex}\\s*(パ\\s*ー\\s*セ\\s*ン\\s*ト|[%])' + ) + NumbersFractionPercentageRegex = ( + f'{ZeroToNineFullHalfRegex}{{1,3}}([,,]{ZeroToNineFullHalfRegex}{{3}})+\\s*(パ\\s*ー\\s*セ\\s*ン\\s*ト|[%])' + ) + NumbersFoldsPercentageRegex = ( + f'{ZeroToNineFullHalfRegex}(([\\..]?|\\s*){ZeroToNineFullHalfRegex})?\\s*[の]*\\s*割引' + ) + TillRegex = '(から|--|-|—|——|~)' + MoreRegex = '(大なり|を超える|大きい|高い|大きく|(?)' + LessRegex = '(小なり|小さい|低い|(?|=)<)' + EqualRegex = '(等しい|イコール|(?)=)' + MoreOrEqualPrefixRegex = '(少なくとも)' + LessOrEqualPrefixRegex = '(多くて)' MoreOrEqual = f'(({MoreRegex}(か){EqualRegex})|小さくない|以上|最低)' - MoreOrEqualSuffix = f'(より(大なりイコール|小さくない))' + MoreOrEqualSuffix = '(より(大なりイコール|小さくない))' LessOrEqual = f'(({LessRegex}\\s*(或|或者)?\\s*{EqualRegex})|({LessRegex}(か){EqualRegex})|大さくない|以下|最大)' - LessOrEqualSuffix = f'(小なりイコール|大さくない)' + LessOrEqualSuffix = '(小なりイコール|大さくない)' OneNumberRangeMoreRegex1 = f'(?(((?!((,(?!\\d+))|。|は)).)+))\\s*((より)\\s*(({MoreOrEqual}|{MoreRegex})))|(?((?!((,(?!\\d+))|。|は)).)+)\\s*({MoreRegex})' - OneNumberRangeMoreRegex3 = f'(?((?!((,(?!\\d+))|。)).)+)\\s*(以上|最低)(?![万億]{{1,2}})' - OneNumberRangeMoreRegex4 = f'({MoreOrEqualPrefixRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|(,(?!\\d+))|。)).)*)' - OneNumberRangeMoreRegex5 = f'(?((?!((,(?!\\d+))|。)).)+)\\s*((もしくはそれ)(以上)(?![万億]{{1,2}}))' - OneNumberRangeMoreSeparateRegex = f'^[.]' - OneNumberRangeLessSeparateRegex = f'^[.]' + OneNumberRangeMoreRegex3 = '(?((?!((,(?!\\d+))|。)).)+)\\s*(以上|最低)(?![万億]{1,2})' + OneNumberRangeMoreRegex4 = ( + f'({MoreOrEqualPrefixRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|(,(?!\\d+))|。)).)*)' + ) + OneNumberRangeMoreRegex5 = '(?((?!((,(?!\\d+))|。)).)+)\\s*((もしくはそれ)(以上)(?![万億]{1,2}))' + OneNumberRangeMoreSeparateRegex = '^[.]' + OneNumberRangeLessSeparateRegex = '^[.]' OneNumberRangeLessRegex1 = f'(?(((?!(((,)(?!\\d+))|。|(\\D)))|(?:[-]|(分の))).)+)\\s*(より)\\s*({LessOrEqual}|{LessRegex})|(?((?!((,(?!\\d+))|。)).)+)\\s*(小な)' - OneNumberRangeLessRegex3 = f'(?(((?!((,(?!\\d+))|。)).)+))\\s*(以下|未満)(の間)?(?![万億]{{1,2}})' + OneNumberRangeLessRegex3 = '(?(((?!((,(?!\\d+))|。)).)+))\\s*(以下|未満)(の間)?(?![万億]{1,2})' OneNumberRangeLessRegex4 = f'({LessOrEqual}|{LessRegex}|{LessOrEqualPrefixRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|の|,|(,(?!\\d+))|。)).)+)' OneNumberRangeEqualRegex = f'(((?((?!((,(?!\\d+))|。)).)+)\\s*(に)\\s*{EqualRegex})|({EqualRegex}\\s*(?((?!((,(?!\\d+))|。)).)+)))' TwoNumberRangeMoreSuffix = f'({MoreOrEqualPrefixRegex}\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|(,(?!\\d+))|。)).)*))(,{LessOrEqualPrefixRegex})' TwoNumberRangeRegex1 = f'(?((?!((,(?!\\d+))|。)).)+)\\s*(と|{TillRegex})\\s*(?((?!((,(?!\\d+))|。)).)+)\\s*(の間|未満)' TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex3}|{OneNumberRangeMoreRegex4})\\s*(と|((と)?同時に)|((と)?そして)|が|,)?\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex3}|{OneNumberRangeLessRegex4})' TwoNumberRangeRegex3 = f'({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex3}|{OneNumberRangeLessRegex4})\\s*(と|((と)?同時に)|((と)?そして)|が|,)?\\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex3}|{OneNumberRangeMoreRegex4})' - TwoNumberRangeRegex4 = f'(?((?!((,(?!\\d+))|。)).)+)\\s*{TillRegex}\\s*(?((?!((,(?!\\d+))|。)).)+)' - AmbiguousFractionConnectorsRegex = f'^[.]' - RelativeReferenceOffsetMap = dict([("前", "-1"), - ("現在", "0"), - ("次", "1"), - ("最後", "0"), - ("最後から三番目", "-2"), - ("最後から二番目", "-1"), - ("最後から一つ前", "-1"), - ("最後から一つ前のもの", "-1"), - ("最後から一つ前のこと", "-1"), - ("最後から1つ前のこと", "-1"), - ("最後から1つ前のもの", "-1"), - ("最後から1つ前", "-1"), - ("現在のこと", "0"), - ("前のもの", "-1"), - ("次のもの", "1"), - ("最後から3番目", "-2"), - ("最後から2番目", "-1")]) - RelativeReferenceRelativeToMap = dict([("前", "current"), - ("現在", "current"), - ("次", "current"), - ("最後", "end"), - ("最後から三番目", "end"), - ("最後から二番目", "end"), - ("最後から一つ前", "end"), - ("最後から一つ前のもの", "end"), - ("最後から一つ前のこと", "end"), - ("現在のこと", "current"), - ("最後から1つ前のこと", "end"), - ("最後から1つ前のもの", "end"), - ("最後から1つ前", "end"), - ("前のもの", "current"), - ("次のもの", "current"), - ("最後から3番目", "end"), - ("最後から2番目", "end")]) + TwoNumberRangeRegex4 = ( + f'(?((?!((,(?!\\d+))|。)).)+)\\s*{TillRegex}\\s*(?((?!((,(?!\\d+))|。)).)+)' + ) + AmbiguousFractionConnectorsRegex = '^[.]' + RelativeReferenceOffsetMap = dict( + [ + ("前", "-1"), + ("現在", "0"), + ("次", "1"), + ("最後", "0"), + ("最後から三番目", "-2"), + ("最後から二番目", "-1"), + ("最後から一つ前", "-1"), + ("最後から一つ前のもの", "-1"), + ("最後から一つ前のこと", "-1"), + ("最後から1つ前のこと", "-1"), + ("最後から1つ前のもの", "-1"), + ("最後から1つ前", "-1"), + ("現在のこと", "0"), + ("前のもの", "-1"), + ("次のもの", "1"), + ("最後から3番目", "-2"), + ("最後から2番目", "-1"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("前", "current"), + ("現在", "current"), + ("次", "current"), + ("最後", "end"), + ("最後から三番目", "end"), + ("最後から二番目", "end"), + ("最後から一つ前", "end"), + ("最後から一つ前のもの", "end"), + ("最後から一つ前のこと", "end"), + ("現在のこと", "current"), + ("最後から1つ前のこと", "end"), + ("最後から1つ前のもの", "end"), + ("最後から1つ前", "end"), + ("前のもの", "current"), + ("次のもの", "current"), + ("最後から3番目", "end"), + ("最後から2番目", "end"), + ] + ) AmbiguityFiltersDict = dict([("^に$", "に")]) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/portuguese_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/portuguese_numeric.py index c860e83064..afb80f5c42 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/portuguese_numeric.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/portuguese_numeric.py @@ -10,6 +10,8 @@ # ------------------------------------------------------------------------------ from .base_numbers import BaseNumbers + + # pylint: disable=line-too-long @@ -17,51 +19,62 @@ class PortugueseNumeric: LangMarker = 'Por' CompoundNumberLanguage = False MultiDecimalSeparatorCulture = False - HundredsNumberIntegerRegex = f'(quatrocent[ao]s|trezent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|duzent[ao]s|quinhent[ao]s|cem|(?pr[oó]xim[ao]s?|[uú]ltim[ao]\\s+mas\\s+um|anterior\\s+ao\\s+últim[ao]|(pen)?[uú]ltim[ao]s?|antepen[uú]ltim[ao]s?|seguintes?|anterior(es)?|atua(l|is))' + RelativeOrdinalRegex = '(?pr[oó]xim[ao]s?|[uú]ltim[ao]\\s+mas\\s+um|anterior\\s+ao\\s+últim[ao]|(pen)?[uú]ltim[ao]s?|antepen[uú]ltim[ao]s?|seguintes?|anterior(es)?|atua(l|is))' ComplexOrdinalRegex = f'(({OverThousandOrdinalRegex}(\\s)?)?{UnderThousandOrdinalRegex}|{OverThousandOrdinalRegex})' SuffixRoundOrdinalRegex = f'(({AllIntRegex})({SimpleRoundOrdinalRegex}))' ComplexRoundOrdinalRegex = f'((({SuffixRoundOrdinalRegex}(\\s)?)?{ComplexOrdinalRegex})|{SuffixRoundOrdinalRegex})' AllOrdinalNumberRegex = f'{ComplexOrdinalRegex}|{SimpleRoundOrdinalRegex}|{ComplexRoundOrdinalRegex}' AllOrdinalRegex = f'(?:{AllOrdinalNumberRegex}|{RelativeOrdinalRegex})' - OrdinalSuffixRegex = f'(?<=\\b)(\\d*((1|2|3|4|5|6|7|8|9|0)[oaºª]|(1|2|3|4|5|6|7|8|9)(\\.[ºª])))(?=\\b)' + OrdinalSuffixRegex = '(?<=\\b)(\\d*((1|2|3|4|5|6|7|8|9|0)[oaºª]|(1|2|3|4|5|6|7|8|9)(\\.[ºª])))(?=\\b)' OrdinalEnglishRegex = f'(?<=\\b){AllOrdinalRegex}(?=\\b)' FractionNotationRegex = f'{BaseNumbers.FractionNotationRegex}' - FractionNotationWithSpacesRegex = f'(((?<=\\W|^)-\\s*)|(?<=\\b))\\d+\\s+\\d+[/]\\d+(?=(\\b[^/]|$))' + FractionNotationWithSpacesRegex = '(((?<=\\W|^)-\\s*)|(?<=\\b))\\d+\\s+\\d+[/]\\d+(?=(\\b[^/]|$))' FractionMultiplierRegex = f'(?\\s+(e|com)\\s+(meio|(um|{TwoToNineIntegerRegex})\\s+(meio|terç[oa]|quart[oa]|quint[oa]|sext[oa]|s[eé]tim[oa]|oitav[oa]|non[oa]|d[eé]cim[oa])s?))' RoundMultiplierWithFraction = f'(?(?:(mil(h([ãa]o|[õo]es))|bilh([ãa]o|[õo]es)|trilh([ãa]o|[õo]es)|qua[td]rilh([ãa]o|[õo]es)|quintilh([ãa]o|[õo]es))))(?={FractionMultiplierRegex}?$)' RoundMultiplierRegex = f'\\b\\s*({RoundMultiplierWithFraction}|(?(mil))$)' @@ -69,32 +82,42 @@ def NumbersWithPlaceHolder(placeholder): FractionNounWithArticleRegex = f'(?<=\\b)(({AllIntRegex}|{RoundNumberIntegerRegexWithLocks})\\s+(e\\s+)?)?((um|um[as])(\\s+)(({AllOrdinalNumberRegex})|({SuffixRoundOrdinalRegex})|(e\\s+)?mei[oa]?)|mei[oa]?)(?=\\b)' FractionPrepositionRegex = f'(?({AllIntRegex})|((?({AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)' AllFloatRegex = f'(?)' - LessRegex = f'(mais\\s+baix[oa]\\s+que|(meno(s|r(es)?)|inferior(es)?|abaixo)(\\s+(que|de|a)|(?=\\s+ou\\b))|(?|=)<)' - EqualRegex = f'((igua(l|is)|equivalente(s)?|equivale(ndo)?)(\\s+(ao?|que|d[eao]))?|(?)=)' + TillRegex = '(\\b[aà]\\b|at[eé]h?|--|-|—|——|~|–)' + MoreRegex = '(mais\\s+(alt[oa]s?|grandes?)\\s+que|(mais|maior(es)?|superior(es)?|acima)\\b((\\s+(que|de|a))|(?=\\s+ou\\b))|(?)' + LessRegex = ( + '(mais\\s+baix[oa]\\s+que|(meno(s|r(es)?)|inferior(es)?|abaixo)(\\s+(que|de|a)|(?=\\s+ou\\b))|(?|=)<)' + ) + EqualRegex = '((igua(l|is)|equivalente(s)?|equivale(ndo)?)(\\s+(ao?|que|d[eao]))?|(?)=)' MoreOrEqualPrefix = f'((n[ãa]o\\s+{LessRegex})|((pelo|ao)\\s+menos|(como(\\s+o)?|no)\\s+m[íi]nimo))' MoreOrEqual = f'(({MoreRegex}\\s+(ou)?\\s+{EqualRegex})|({EqualRegex}\\s+(ou|e)\\s+{MoreRegex})|{MoreOrEqualPrefix}(\\s+(ou)\\s+{EqualRegex})?|({EqualRegex}\\s+(ou)\\s+)?{MoreOrEqualPrefix}|>\\s*=)' - MoreOrEqualSuffix = f'((\\b(e|ou)\\b\\s+(mais|maior(es)?|superior(es)?)((?!\\s+(alt[oa]|baix[oa]|que|d[eao]|ao?))|(\\s+(que|d[eao]|ao?)(?!(\\s*\\d+)))))|(como(\\s+o)?|no)\\s+m[íi]nimo|(pelo|ao)\\s+menos)\\b' + MoreOrEqualSuffix = '((\\b(e|ou)\\b\\s+(mais|maior(es)?|superior(es)?)((?!\\s+(alt[oa]|baix[oa]|que|d[eao]|ao?))|(\\s+(que|d[eao]|ao?)(?!(\\s*\\d+)))))|(como(\\s+o)?|no)\\s+m[íi]nimo|(pelo|ao)\\s+menos)\\b' LessOrEqualPrefix = f'((n[ãa]o\\s+{MoreRegex})|((como(\\s+o)?|no)\\s+m[aá]ximo))' LessOrEqual = f'(({LessRegex}\\s+(ou)?\\s+{EqualRegex})|({EqualRegex}\\s+(ou)?\\s+{LessRegex})|{LessOrEqualPrefix}(\\s+(ou)?\\s+{EqualRegex})?|({EqualRegex}\\s+(ou)?\\s+)?{LessOrEqualPrefix}|<\\s*=)' - LessOrEqualSuffix = f'((\\b(e|ou)\\b\\s+(meno(s|r(es)?|inferior(es)?))((?!\\s+(alt[oa]|baix[oa]|que|d[eao]|ao?))|(\\s+(que|d[eao]|ao?)(?!(\\s*\\d+)))))|(como(\\s+o)?|no)\\s+m[áa]ximo)\\b' - NumberSplitMark = f'(?![,.](?!\\d+))(?!\\s*\\b(((e)\\s+)?({LessRegex}|{MoreRegex}|{EqualRegex}|n[ãa]o|d[eao])|mas|[ao])\\b)' - MoreRegexNoNumberSucceed = f'(\\b(mais|maior(es)?|superior(es)?)((?!\\s+(que|d[eao]|ao?))|\\s+((que|d[eao])(?!(\\s*\\d+))))|((por\\s+|a)cima)(?!(\\s*\\d+)))\\b' - LessRegexNoNumberSucceed = f'(\\b(meno(s|r(es)?)|inferior(es)?)((?!\\s+(que|d[eao]|ao?))|\\s+((que|d[eao]|ao?)(?!(\\s*\\d+))))|((por\\s+|a)baixo)(?!(\\s*\\d+)))\\b' - EqualRegexNoNumberSucceed = f'(\\b(igua(l|is)|equivalentes?|equivale(ndo)?)((?!\\s+(ao?|que|d[eao]))|(\\s+(ao?|que|d[eao])(?!(\\s*\\d+)))))\\b' + LessOrEqualSuffix = '((\\b(e|ou)\\b\\s+(meno(s|r(es)?|inferior(es)?))((?!\\s+(alt[oa]|baix[oa]|que|d[eao]|ao?))|(\\s+(que|d[eao]|ao?)(?!(\\s*\\d+)))))|(como(\\s+o)?|no)\\s+m[áa]ximo)\\b' + NumberSplitMark = ( + f'(?![,.](?!\\d+))(?!\\s*\\b(((e)\\s+)?({LessRegex}|{MoreRegex}|{EqualRegex}|n[ãa]o|d[eao])|mas|[ao])\\b)' + ) + MoreRegexNoNumberSucceed = '(\\b(mais|maior(es)?|superior(es)?)((?!\\s+(que|d[eao]|ao?))|\\s+((que|d[eao])(?!(\\s*\\d+))))|((por\\s+|a)cima)(?!(\\s*\\d+)))\\b' + LessRegexNoNumberSucceed = '(\\b(meno(s|r(es)?)|inferior(es)?)((?!\\s+(que|d[eao]|ao?))|\\s+((que|d[eao]|ao?)(?!(\\s*\\d+))))|((por\\s+|a)baixo)(?!(\\s*\\d+)))\\b' + EqualRegexNoNumberSucceed = '(\\b(igua(l|is)|equivalentes?|equivale(ndo)?)((?!\\s+(ao?|que|d[eao]))|(\\s+(ao?|que|d[eao])(?!(\\s*\\d+)))))\\b' OneNumberRangeMoreRegex1 = f'({MoreOrEqual}|{MoreRegex})\\s*(([ao]s?)\\s+)?(?({NumberSplitMark}.)+)' OneNumberRangeMoreRegex1LB = f'(?({NumberSplitMark}.)+)\\s*{MoreOrEqualSuffix}' @@ -108,7 +131,7 @@ def DoubleWithoutIntegralRegex(placeholder): TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})\\s*(\\be\\b|mas|,)\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})' TwoNumberRangeRegex3 = f'({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})\\s*(\\be\\b|mas|,)\\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})' TwoNumberRangeRegex4 = f'(\\bde(sde)?\\s+)?(\\b[ao]s?\\s+)?\\b(?!\\s+)(?({NumberSplitMark}(?!\\b(entre|de(sde)?|es)\\b).)+)\\b\\s*{TillRegex}\\s*([ao]s?\\s+)?\\b(?!\\s+)(?({NumberSplitMark}.)+)\\b' - AmbiguousFractionConnectorsRegex = f'(\\b(em|de)\\b)' + AmbiguousFractionConnectorsRegex = '(\\b(em|de)\\b)' DecimalSeparatorChar = ',' FractionMarkerToken = 'sobre' NonDecimalSeparatorChar = '.' @@ -121,387 +144,412 @@ def DoubleWithoutIntegralRegex(placeholder): WrittenFractionSuffix = [r'avo', r'ava'] OneHalfTokens = [r'um', r'meio'] PluralSuffix = 's' - HalfADozenRegex = f'meia\\s+d[uú]zia' + HalfADozenRegex = 'meia\\s+d[uú]zia' DigitalNumberRegex = f'((?<=\\b)(mil(hares)?|ce(m|ntenas?)|[bmt]ilh([aã]o|[oõ]es)|dezenas?)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' - CardinalNumberMap = dict([("zero", 0), - ("hum", 1), - ("um", 1), - ("uma", 1), - ("dois", 2), - ("duas", 2), - ("meia", 2), - ("meio", 2), - ("tres", 3), - ("três", 3), - ("quatro", 4), - ("cinco", 5), - ("seis", 6), - ("sete", 7), - ("oito", 8), - ("nove", 9), - ("dez", 10), - ("dezena", 10), - ("déz", 10), - ("onze", 11), - ("doze", 12), - ("dúzia", 12), - ("duzia", 12), - ("dúzias", 12), - ("duzias", 12), - ("treze", 13), - ("catorze", 14), - ("quatorze", 14), - ("quinze", 15), - ("dezesseis", 16), - ("dezasseis", 16), - ("dezessete", 17), - ("dezassete", 17), - ("dezoito", 18), - ("dezenove", 19), - ("dezanove", 19), - ("vinte", 20), - ("trinta", 30), - ("quarenta", 40), - ("cinquenta", 50), - ("cincoenta", 50), - ("sessenta", 60), - ("setenta", 70), - ("oitenta", 80), - ("noventa", 90), - ("cem", 100), - ("cento", 100), - ("duzentos", 200), - ("duzentas", 200), - ("trezentos", 300), - ("trezentas", 300), - ("quatrocentos", 400), - ("quatrocentas", 400), - ("quinhentos", 500), - ("quinhentas", 500), - ("seiscentos", 600), - ("seiscentas", 600), - ("setecentos", 700), - ("setecentas", 700), - ("oitocentos", 800), - ("oitocentas", 800), - ("novecentos", 900), - ("novecentas", 900), - ("mil", 1000), - ("milhão", 1000000), - ("milhao", 1000000), - ("milhões", 1000000), - ("milhoes", 1000000), - ("bilhão", 1000000000), - ("bilhao", 1000000000), - ("bilhões", 1000000000), - ("bilhoes", 1000000000), - ("trilhão", 1000000000000), - ("trilhao", 1000000000000), - ("trilhões", 1000000000000), - ("trilhoes", 1000000000000)]) - OrdinalNumberMap = dict([("primeiro", 1), - ("primeira", 1), - ("segundo", 2), - ("segunda", 2), - ("terceiro", 3), - ("terceira", 3), - ("terço", 3), - ("terça", 3), - ("quarto", 4), - ("quarta", 4), - ("quinto", 5), - ("quinta", 5), - ("sexto", 6), - ("sexta", 6), - ("sétimo", 7), - ("setimo", 7), - ("sétima", 7), - ("setima", 7), - ("oitavo", 8), - ("oitava", 8), - ("nono", 9), - ("nona", 9), - ("décimo", 10), - ("decimo", 10), - ("décima", 10), - ("decima", 10), - ("undécimo", 11), - ("undecimo", 11), - ("undécima", 11), - ("undecima", 11), - ("duodécimo", 11), - ("duodecimo", 11), - ("duodécima", 11), - ("duodecima", 11), - ("vigésimo", 20), - ("vigesimo", 20), - ("vigésima", 20), - ("vigesima", 20), - ("trigésimo", 30), - ("trigesimo", 30), - ("trigésima", 30), - ("trigesima", 30), - ("quadragésimo", 40), - ("quadragesimo", 40), - ("quadragésima", 40), - ("quadragesima", 40), - ("quinquagésimo", 50), - ("quinquagesimo", 50), - ("quinquagésima", 50), - ("quinquagesima", 50), - ("sexagésimo", 60), - ("sexagesimo", 60), - ("sexagésima", 60), - ("sexagesima", 60), - ("septuagésimo", 70), - ("septuagesimo", 70), - ("septuagésima", 70), - ("septuagesima", 70), - ("setuagésimo", 70), - ("setuagesimo", 70), - ("setuagésima", 70), - ("setuagesima", 70), - ("octogésimo", 80), - ("octogesimo", 80), - ("octogésima", 80), - ("octogesima", 80), - ("nonagésimo", 90), - ("nonagesimo", 90), - ("nonagésima", 90), - ("nonagesima", 90), - ("centesimo", 100), - ("centésimo", 100), - ("centesima", 100), - ("centésima", 100), - ("ducentésimo", 200), - ("ducentesimo", 200), - ("ducentésima", 200), - ("ducentesima", 200), - ("tricentésimo", 300), - ("tricentesimo", 300), - ("tricentésima", 300), - ("tricentesima", 300), - ("trecentésimo", 300), - ("trecentesimo", 300), - ("trecentésima", 300), - ("trecentesima", 300), - ("quadringentésimo", 400), - ("quadringentesimo", 400), - ("quadringentésima", 400), - ("quadringentesima", 400), - ("quadrigentésimo", 400), - ("quadrigentesimo", 400), - ("quadrigentésima", 400), - ("quadrigentesima", 400), - ("quingentésimo", 500), - ("quingentesimo", 500), - ("quingentésima", 500), - ("quingentesima", 500), - ("sexcentésimo", 600), - ("sexcentesimo", 600), - ("sexcentésima", 600), - ("sexcentesima", 600), - ("seiscentésimo", 600), - ("seiscentesimo", 600), - ("seiscentésima", 600), - ("seiscentesima", 600), - ("septingentésimo", 700), - ("septingentesimo", 700), - ("septingentésima", 700), - ("septingentesima", 700), - ("setingentésimo", 700), - ("setingentesimo", 700), - ("setingentésima", 700), - ("setingentesima", 700), - ("octingentésimo", 800), - ("octingentesimo", 800), - ("octingentésima", 800), - ("octingentesima", 800), - ("noningentésimo", 900), - ("noningentesimo", 900), - ("noningentésima", 900), - ("noningentesima", 900), - ("nongentésimo", 900), - ("nongentesimo", 900), - ("nongentésima", 900), - ("nongentesima", 900), - ("milésimo", 1000), - ("milesimo", 1000), - ("milésima", 1000), - ("milesima", 1000), - ("milionésimo", 1000000), - ("milionesimo", 1000000), - ("milionésima", 1000000), - ("milionesima", 1000000), - ("bilionésimo", 1000000000), - ("bilionesimo", 1000000000), - ("bilionésima", 1000000000), - ("bilionesima", 1000000000)]) - PrefixCardinalMap = dict([("hum", 1), - ("um", 1), - ("dois", 2), - ("tres", 3), - ("três", 3), - ("quatro", 4), - ("cinco", 5), - ("seis", 6), - ("sete", 7), - ("oito", 8), - ("nove", 9), - ("dez", 10), - ("onze", 11), - ("doze", 12), - ("treze", 13), - ("catorze", 14), - ("quatorze", 14), - ("quinze", 15), - ("dezesseis", 16), - ("dezasseis", 16), - ("dezessete", 17), - ("dezassete", 17), - ("dezoito", 18), - ("dezenove", 19), - ("dezanove", 19), - ("vinte", 20), - ("trinta", 30), - ("quarenta", 40), - ("cinquenta", 50), - ("cincoenta", 50), - ("sessenta", 60), - ("setenta", 70), - ("oitenta", 80), - ("noventa", 90), - ("cem", 100), - ("duzentos", 200), - ("trezentos", 300), - ("quatrocentos", 400), - ("quinhentos", 500), - ("seiscentos", 600), - ("setecentos", 700), - ("oitocentos", 800), - ("novecentos", 900)]) - SuffixOrdinalMap = dict([("milesimo", 1000), - ("milionesimo", 1000000), - ("bilionesimo", 1000000000), - ("trilionesimo", 1000000000000)]) - RoundNumberMap = dict([("mil", 1000), - ("milesimo", 1000), - ("milhão", 1000000), - ("milhao", 1000000), - ("milhões", 1000000), - ("milhoes", 1000000), - ("milionésimo", 1000000), - ("milionesimo", 1000000), - ("bilhão", 1000000000), - ("bilhao", 1000000000), - ("bilhões", 1000000000), - ("bilhoes", 1000000000), - ("bilionésimo", 1000000000), - ("bilionesimo", 1000000000), - ("trilhão", 1000000000000), - ("trilhao", 1000000000000), - ("trilhões", 1000000000000), - ("trilhoes", 1000000000000), - ("trilionésimo", 1000000000000), - ("trilionesimo", 1000000000000), - ("dezena", 10), - ("dezenas", 10), - ("dúzia", 12), - ("duzia", 12), - ("dúzias", 12), - ("duzias", 12), - ("k", 1000), - ("m", 1000000), - ("g", 1000000000), - ("b", 1000000000), - ("t", 1000000000000)]) + CardinalNumberMap = dict( + [ + ("zero", 0), + ("hum", 1), + ("um", 1), + ("uma", 1), + ("dois", 2), + ("duas", 2), + ("meia", 2), + ("meio", 2), + ("tres", 3), + ("três", 3), + ("quatro", 4), + ("cinco", 5), + ("seis", 6), + ("sete", 7), + ("oito", 8), + ("nove", 9), + ("dez", 10), + ("dezena", 10), + ("déz", 10), + ("onze", 11), + ("doze", 12), + ("dúzia", 12), + ("duzia", 12), + ("dúzias", 12), + ("duzias", 12), + ("treze", 13), + ("catorze", 14), + ("quatorze", 14), + ("quinze", 15), + ("dezesseis", 16), + ("dezasseis", 16), + ("dezessete", 17), + ("dezassete", 17), + ("dezoito", 18), + ("dezenove", 19), + ("dezanove", 19), + ("vinte", 20), + ("trinta", 30), + ("quarenta", 40), + ("cinquenta", 50), + ("cincoenta", 50), + ("sessenta", 60), + ("setenta", 70), + ("oitenta", 80), + ("noventa", 90), + ("cem", 100), + ("cento", 100), + ("duzentos", 200), + ("duzentas", 200), + ("trezentos", 300), + ("trezentas", 300), + ("quatrocentos", 400), + ("quatrocentas", 400), + ("quinhentos", 500), + ("quinhentas", 500), + ("seiscentos", 600), + ("seiscentas", 600), + ("setecentos", 700), + ("setecentas", 700), + ("oitocentos", 800), + ("oitocentas", 800), + ("novecentos", 900), + ("novecentas", 900), + ("mil", 1000), + ("milhão", 1000000), + ("milhao", 1000000), + ("milhões", 1000000), + ("milhoes", 1000000), + ("bilhão", 1000000000), + ("bilhao", 1000000000), + ("bilhões", 1000000000), + ("bilhoes", 1000000000), + ("trilhão", 1000000000000), + ("trilhao", 1000000000000), + ("trilhões", 1000000000000), + ("trilhoes", 1000000000000), + ] + ) + OrdinalNumberMap = dict( + [ + ("primeiro", 1), + ("primeira", 1), + ("segundo", 2), + ("segunda", 2), + ("terceiro", 3), + ("terceira", 3), + ("terço", 3), + ("terça", 3), + ("quarto", 4), + ("quarta", 4), + ("quinto", 5), + ("quinta", 5), + ("sexto", 6), + ("sexta", 6), + ("sétimo", 7), + ("setimo", 7), + ("sétima", 7), + ("setima", 7), + ("oitavo", 8), + ("oitava", 8), + ("nono", 9), + ("nona", 9), + ("décimo", 10), + ("decimo", 10), + ("décima", 10), + ("decima", 10), + ("undécimo", 11), + ("undecimo", 11), + ("undécima", 11), + ("undecima", 11), + ("duodécimo", 11), + ("duodecimo", 11), + ("duodécima", 11), + ("duodecima", 11), + ("vigésimo", 20), + ("vigesimo", 20), + ("vigésima", 20), + ("vigesima", 20), + ("trigésimo", 30), + ("trigesimo", 30), + ("trigésima", 30), + ("trigesima", 30), + ("quadragésimo", 40), + ("quadragesimo", 40), + ("quadragésima", 40), + ("quadragesima", 40), + ("quinquagésimo", 50), + ("quinquagesimo", 50), + ("quinquagésima", 50), + ("quinquagesima", 50), + ("sexagésimo", 60), + ("sexagesimo", 60), + ("sexagésima", 60), + ("sexagesima", 60), + ("septuagésimo", 70), + ("septuagesimo", 70), + ("septuagésima", 70), + ("septuagesima", 70), + ("setuagésimo", 70), + ("setuagesimo", 70), + ("setuagésima", 70), + ("setuagesima", 70), + ("octogésimo", 80), + ("octogesimo", 80), + ("octogésima", 80), + ("octogesima", 80), + ("nonagésimo", 90), + ("nonagesimo", 90), + ("nonagésima", 90), + ("nonagesima", 90), + ("centesimo", 100), + ("centésimo", 100), + ("centesima", 100), + ("centésima", 100), + ("ducentésimo", 200), + ("ducentesimo", 200), + ("ducentésima", 200), + ("ducentesima", 200), + ("tricentésimo", 300), + ("tricentesimo", 300), + ("tricentésima", 300), + ("tricentesima", 300), + ("trecentésimo", 300), + ("trecentesimo", 300), + ("trecentésima", 300), + ("trecentesima", 300), + ("quadringentésimo", 400), + ("quadringentesimo", 400), + ("quadringentésima", 400), + ("quadringentesima", 400), + ("quadrigentésimo", 400), + ("quadrigentesimo", 400), + ("quadrigentésima", 400), + ("quadrigentesima", 400), + ("quingentésimo", 500), + ("quingentesimo", 500), + ("quingentésima", 500), + ("quingentesima", 500), + ("sexcentésimo", 600), + ("sexcentesimo", 600), + ("sexcentésima", 600), + ("sexcentesima", 600), + ("seiscentésimo", 600), + ("seiscentesimo", 600), + ("seiscentésima", 600), + ("seiscentesima", 600), + ("septingentésimo", 700), + ("septingentesimo", 700), + ("septingentésima", 700), + ("septingentesima", 700), + ("setingentésimo", 700), + ("setingentesimo", 700), + ("setingentésima", 700), + ("setingentesima", 700), + ("octingentésimo", 800), + ("octingentesimo", 800), + ("octingentésima", 800), + ("octingentesima", 800), + ("noningentésimo", 900), + ("noningentesimo", 900), + ("noningentésima", 900), + ("noningentesima", 900), + ("nongentésimo", 900), + ("nongentesimo", 900), + ("nongentésima", 900), + ("nongentesima", 900), + ("milésimo", 1000), + ("milesimo", 1000), + ("milésima", 1000), + ("milesima", 1000), + ("milionésimo", 1000000), + ("milionesimo", 1000000), + ("milionésima", 1000000), + ("milionesima", 1000000), + ("bilionésimo", 1000000000), + ("bilionesimo", 1000000000), + ("bilionésima", 1000000000), + ("bilionesima", 1000000000), + ] + ) + PrefixCardinalMap = dict( + [ + ("hum", 1), + ("um", 1), + ("dois", 2), + ("tres", 3), + ("três", 3), + ("quatro", 4), + ("cinco", 5), + ("seis", 6), + ("sete", 7), + ("oito", 8), + ("nove", 9), + ("dez", 10), + ("onze", 11), + ("doze", 12), + ("treze", 13), + ("catorze", 14), + ("quatorze", 14), + ("quinze", 15), + ("dezesseis", 16), + ("dezasseis", 16), + ("dezessete", 17), + ("dezassete", 17), + ("dezoito", 18), + ("dezenove", 19), + ("dezanove", 19), + ("vinte", 20), + ("trinta", 30), + ("quarenta", 40), + ("cinquenta", 50), + ("cincoenta", 50), + ("sessenta", 60), + ("setenta", 70), + ("oitenta", 80), + ("noventa", 90), + ("cem", 100), + ("duzentos", 200), + ("trezentos", 300), + ("quatrocentos", 400), + ("quinhentos", 500), + ("seiscentos", 600), + ("setecentos", 700), + ("oitocentos", 800), + ("novecentos", 900), + ] + ) + SuffixOrdinalMap = dict( + [("milesimo", 1000), ("milionesimo", 1000000), ("bilionesimo", 1000000000), ("trilionesimo", 1000000000000)] + ) + RoundNumberMap = dict( + [ + ("mil", 1000), + ("milesimo", 1000), + ("milhão", 1000000), + ("milhao", 1000000), + ("milhões", 1000000), + ("milhoes", 1000000), + ("milionésimo", 1000000), + ("milionesimo", 1000000), + ("bilhão", 1000000000), + ("bilhao", 1000000000), + ("bilhões", 1000000000), + ("bilhoes", 1000000000), + ("bilionésimo", 1000000000), + ("bilionesimo", 1000000000), + ("trilhão", 1000000000000), + ("trilhao", 1000000000000), + ("trilhões", 1000000000000), + ("trilhoes", 1000000000000), + ("trilionésimo", 1000000000000), + ("trilionesimo", 1000000000000), + ("dezena", 10), + ("dezenas", 10), + ("dúzia", 12), + ("duzia", 12), + ("dúzias", 12), + ("duzias", 12), + ("k", 1000), + ("m", 1000000), + ("g", 1000000000), + ("b", 1000000000), + ("t", 1000000000000), + ] + ) AmbiguityFiltersDict = dict([("^[.]", "")]) - RelativeReferenceOffsetMap = dict([("proxima", "1"), - ("proximo", "1"), - ("próxima", "1"), - ("próximo", "1"), - ("proximas", "1"), - ("proximos", "1"), - ("próximas", "1"), - ("próximos", "1"), - ("ultima", "0"), - ("ultimo", "0"), - ("última", "0"), - ("último", "0"), - ("ultimas", "0"), - ("ultimos", "0"), - ("últimas", "0"), - ("últimos", "0"), - ("penultima", "-1"), - ("penultimo", "-1"), - ("penúltima", "-1"), - ("penúltimo", "-1"), - ("penultimas", "-1"), - ("penultimos", "-1"), - ("penúltimas", "-1"), - ("penúltimos", "-1"), - ("ultima mas um", "-1"), - ("ultimo mas um", "-1"), - ("última mas um", "-1"), - ("último mas um", "-1"), - ("anterior ao último", "-1"), - ("anterior ao última", "-1"), - ("antepenultima", "-2"), - ("antepenultimo", "-2"), - ("antepenúltima", "-2"), - ("antepenúltimo", "-2"), - ("antepenultimas", "-2"), - ("antepenultimos", "-2"), - ("antepenúltimas", "-2"), - ("antepenúltimos", "-2"), - ("seguinte", "1"), - ("seguintes", "1"), - ("anterior", "-1"), - ("anteriores", "-1"), - ("atual", "0"), - ("atuais", "0")]) - RelativeReferenceRelativeToMap = dict([("proxima", "current"), - ("proximo", "current"), - ("próxima", "current"), - ("próximo", "current"), - ("proximas", "current"), - ("proximos", "current"), - ("próximas", "current"), - ("próximos", "current"), - ("ultima", "end"), - ("ultimo", "end"), - ("última", "end"), - ("último", "end"), - ("ultimas", "end"), - ("ultimos", "end"), - ("últimas", "end"), - ("últimos", "end"), - ("penultima", "end"), - ("penultimo", "end"), - ("penúltima", "end"), - ("penúltimo", "end"), - ("penultimas", "end"), - ("penultimos", "end"), - ("penúltimas", "end"), - ("penúltimos", "end"), - ("ultima mas um", "end"), - ("ultimo mas um", "end"), - ("última mas um", "end"), - ("último mas um", "end"), - ("anterior ao último", "end"), - ("anterior ao última", "end"), - ("antepenultima", "end"), - ("antepenultimo", "end"), - ("antepenúltima", "end"), - ("antepenúltimo", "end"), - ("antepenultimas", "end"), - ("antepenultimos", "end"), - ("antepenúltimas", "end"), - ("antepenúltimos", "end"), - ("seguinte", "current"), - ("seguintes", "current"), - ("anterior", "current"), - ("anteriores", "current"), - ("atual", "current"), - ("atuais", "current")]) + RelativeReferenceOffsetMap = dict( + [ + ("proxima", "1"), + ("proximo", "1"), + ("próxima", "1"), + ("próximo", "1"), + ("proximas", "1"), + ("proximos", "1"), + ("próximas", "1"), + ("próximos", "1"), + ("ultima", "0"), + ("ultimo", "0"), + ("última", "0"), + ("último", "0"), + ("ultimas", "0"), + ("ultimos", "0"), + ("últimas", "0"), + ("últimos", "0"), + ("penultima", "-1"), + ("penultimo", "-1"), + ("penúltima", "-1"), + ("penúltimo", "-1"), + ("penultimas", "-1"), + ("penultimos", "-1"), + ("penúltimas", "-1"), + ("penúltimos", "-1"), + ("ultima mas um", "-1"), + ("ultimo mas um", "-1"), + ("última mas um", "-1"), + ("último mas um", "-1"), + ("anterior ao último", "-1"), + ("anterior ao última", "-1"), + ("antepenultima", "-2"), + ("antepenultimo", "-2"), + ("antepenúltima", "-2"), + ("antepenúltimo", "-2"), + ("antepenultimas", "-2"), + ("antepenultimos", "-2"), + ("antepenúltimas", "-2"), + ("antepenúltimos", "-2"), + ("seguinte", "1"), + ("seguintes", "1"), + ("anterior", "-1"), + ("anteriores", "-1"), + ("atual", "0"), + ("atuais", "0"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("proxima", "current"), + ("proximo", "current"), + ("próxima", "current"), + ("próximo", "current"), + ("proximas", "current"), + ("proximos", "current"), + ("próximas", "current"), + ("próximos", "current"), + ("ultima", "end"), + ("ultimo", "end"), + ("última", "end"), + ("último", "end"), + ("ultimas", "end"), + ("ultimos", "end"), + ("últimas", "end"), + ("últimos", "end"), + ("penultima", "end"), + ("penultimo", "end"), + ("penúltima", "end"), + ("penúltimo", "end"), + ("penultimas", "end"), + ("penultimos", "end"), + ("penúltimas", "end"), + ("penúltimos", "end"), + ("ultima mas um", "end"), + ("ultimo mas um", "end"), + ("última mas um", "end"), + ("último mas um", "end"), + ("anterior ao último", "end"), + ("anterior ao última", "end"), + ("antepenultima", "end"), + ("antepenultimo", "end"), + ("antepenúltima", "end"), + ("antepenúltimo", "end"), + ("antepenultimas", "end"), + ("antepenultimos", "end"), + ("antepenúltimas", "end"), + ("antepenúltimos", "end"), + ("seguinte", "current"), + ("seguintes", "current"), + ("anterior", "current"), + ("anteriores", "current"), + ("atual", "current"), + ("atuais", "current"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/recognizers_number/resources/spanish_numeric.py b/Python/libraries/recognizers-number/recognizers_number/resources/spanish_numeric.py index ebfafebfe7..ecb1f46012 100644 --- a/Python/libraries/recognizers-number/recognizers_number/resources/spanish_numeric.py +++ b/Python/libraries/recognizers-number/recognizers_number/resources/spanish_numeric.py @@ -10,6 +10,8 @@ # ------------------------------------------------------------------------------ from .base_numbers import BaseNumbers + + # pylint: disable=line-too-long @@ -18,51 +20,64 @@ class SpanishNumeric: CompoundNumberLanguage = False MultiDecimalSeparatorCulture = True NonStandardSeparatorVariants = [r'es-mx', r'es-do', r'es-sv', r'es-gt', r'es-hn', r'es-ni', r'es-pa', r'es-pr'] - HundredsNumberIntegerRegex = f'(cuatrocient[ao]s|trescient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|doscient[ao]s|quinient[ao]s|(?(?(?(antes\\s+de|anterior\\s+a)(l|\\s+la)\\s+[uú]ltim[ao]|((ante)?pen)?[uú]ltim[ao]s?|pr[oó]xim[ao]s?|anterior(es)?|actual(es)?|siguientes?)' + RelativeOrdinalRegex = '(?(antes\\s+de|anterior\\s+a)(l|\\s+la)\\s+[uú]ltim[ao]|((ante)?pen)?[uú]ltim[ao]s?|pr[oó]xim[ao]s?|anterior(es)?|actual(es)?|siguientes?)' ComplexOrdinalRegex = f'(({OverThousandOrdinalRegex}(\\s)?)?{UnderThousandOrdinalRegex}|{OverThousandOrdinalRegex})' SufixRoundOrdinalRegex = f'(({AllIntRegex})({SimpleRoundOrdinalRegex}))' ComplexRoundOrdinalRegex = f'((({SufixRoundOrdinalRegex}(\\s)?)?{ComplexOrdinalRegex})|{SufixRoundOrdinalRegex})' AllOrdinalNumberRegex = f'{ComplexOrdinalRegex}|{SimpleRoundOrdinalRegex}|{ComplexRoundOrdinalRegex}' AllOrdinalRegex = f'(?:{AllOrdinalNumberRegex}s?|{RelativeOrdinalRegex})' - OrdinalSuffixRegex = f'(?<=\\b)(\\d*((1(er|r[oa])|2d[oa]|3r[oa]|4t[oa]|5t[oa]|6t[oa]|7m[oa]|8v[oa]|9n[oa]|0m[oa]|11[vm][oa]|12[vm][oa])|\\d\\.?[ºª]))(?=\\b)' + OrdinalSuffixRegex = '(?<=\\b)(\\d*((1(er|r[oa])|2d[oa]|3r[oa]|4t[oa]|5t[oa]|6t[oa]|7m[oa]|8v[oa]|9n[oa]|0m[oa]|11[vm][oa]|12[vm][oa])|\\d\\.?[ºª]))(?=\\b)' OrdinalNounRegex = f'(?<=\\b){AllOrdinalRegex}(?=\\b)' SpecialFractionInteger = f'((({AllIntRegex})i?({ZeroToNineIntegerRegex})|({AllIntRegex}))a?v[oa]s?)' FractionNotationRegex = f'{BaseNumbers.FractionNotationRegex}' - FractionNotationWithSpacesRegex = f'(((?<=\\W|^)-\\s*)|(?<=\\b))\\d+\\s+\\d+[/]\\d+(?=(\\b[^/]|$))' + FractionNotationWithSpacesRegex = '(((?<=\\W|^)-\\s*)|(?<=\\b))\\d+\\s+\\d+[/]\\d+(?=(\\b[^/]|$))' FractionMultiplierRegex = f'(?\\s+(y|con)\\s+(medio|(un|{TwoToNineIntegerRegex})\\s+(medio|terci[oa]?|cuart[oa]|quint[oa]|sext[oa]|s[eé]ptim[oa]|octav[oa]|noven[oa]|d[eé]cim[oa])s?))' RoundMultiplierWithFraction = f'(?(?:(mil\\s+millones|mill[oó]n(es)?|bill[oó]n(es)?|trill[oó]n(es)?|cuatrill[oó]n(es)?|quintill[oó]n(es)?|sextill[oó]n(es)?|septill[oó]n(es)?)))(?={FractionMultiplierRegex}?$)' RoundMultiplierRegex = f'\\b\\s*({RoundMultiplierWithFraction}|(?(mil))$)' @@ -77,26 +92,36 @@ def DoubleDecimalPointRegex(placeholder): def DoubleWithoutIntegralRegex(placeholder): return f'(?<=\\s|^)(?)' - LessRegex = f'((meno(s|r(es)?)|inferior(es)?|por\\s+debajo)((\\s+(que|del?|al?)|(?=\\s+o\\b)))|más\\s+baj[oa]\\s+que|(?|=)<)' - EqualRegex = f'((igual(es)?|equivalente(s)?|equivalen?)(\\s+(al?|que|del?))?|(?)=)' + DoubleExponentialNotationRegex = ( + '(((?)' + LessRegex = '((meno(s|r(es)?)|inferior(es)?|por\\s+debajo)((\\s+(que|del?|al?)|(?=\\s+o\\b)))|más\\s+baj[oa]\\s+que|(?|=)<)' + EqualRegex = '((igual(es)?|equivalente(s)?|equivalen?)(\\s+(al?|que|del?))?|(?)=)' MoreOrEqualPrefix = f'((no\\s+{LessRegex})|(por\\s+lo\\s+menos|como\\s+m[íi]nimo|al\\s+menos))' MoreOrEqual = f'(({MoreRegex}\\s+(o)?\\s+{EqualRegex})|({EqualRegex}\\s+(o|y)\\s+{MoreRegex})|{MoreOrEqualPrefix}(\\s+(o)\\s+{EqualRegex})?|({EqualRegex}\\s+(o)\\s+)?{MoreOrEqualPrefix}|>\\s*=)' - MoreOrEqualSuffix = f'((\\b(y|o)\\b\\s+(m[áa]s|mayor(es)?|superior(es)?)((?!\\s+(alt[oa]|baj[oa]|que|del?|al?))|(\\s+(que|del?|al?)(?!(\\s*\\d+)))))|como\\s+m[íi]nimo|por\\s+lo\\s+menos|al\\s+menos)\\b' + MoreOrEqualSuffix = '((\\b(y|o)\\b\\s+(m[áa]s|mayor(es)?|superior(es)?)((?!\\s+(alt[oa]|baj[oa]|que|del?|al?))|(\\s+(que|del?|al?)(?!(\\s*\\d+)))))|como\\s+m[íi]nimo|por\\s+lo\\s+menos|al\\s+menos)\\b' LessOrEqualPrefix = f'((no\\s+{MoreRegex})|(como\\s+(m[aá]ximo|mucho)))' LessOrEqual = f'(({LessRegex}\\s+(o)?\\s+{EqualRegex})|({EqualRegex}\\s+(o)?\\s+{LessRegex})|{LessOrEqualPrefix}(\\s+(o)?\\s+{EqualRegex})?|({EqualRegex}\\s+(o)?\\s+)?{LessOrEqualPrefix}|<\\s*=)' - LessOrEqualSuffix = f'((\\b(y|o)\\b\\s+(meno(s|r(es)?|inferior(es)?))((?!\\s+(alt[oa]|baj[oa]|que|del?|al?))|(\\s+(que|del?|al?)(?!(\\s*\\d+)))))|como\\s+m[áa]ximo)\\b' - NumberSplitMark = f'(?![,.](?!\\d+))(?!\\s*\\b(((y|e)\\s+)?({LessRegex}|{MoreRegex}|{EqualRegex}|no|de)|pero|o|a)\\b)' - MoreRegexNoNumberSucceed = f'(\\b(m[áa]s|mayor(es)?|superior(es)?)((?!\\s+(que|del?|al?))|\\s+((que|del?)(?!(\\s*\\d+))))|(por encima)(?!(\\s*\\d+)))\\b' - LessRegexNoNumberSucceed = f'(\\b(meno(s|r(es)?)|inferior(es)?)((?!\\s+(que|del?|al?))|\\s+((que|del?|al?)(?!(\\s*\\d+))))|(por debajo)(?!(\\s*\\d+)))\\b' - EqualRegexNoNumberSucceed = f'(\\b(igual(es)?|equivalentes?|equivalen?)((?!\\s+(al?|que|del?))|(\\s+(al?|que|del?)(?!(\\s*\\d+)))))\\b' + LessOrEqualSuffix = '((\\b(y|o)\\b\\s+(meno(s|r(es)?|inferior(es)?))((?!\\s+(alt[oa]|baj[oa]|que|del?|al?))|(\\s+(que|del?|al?)(?!(\\s*\\d+)))))|como\\s+m[áa]ximo)\\b' + NumberSplitMark = ( + f'(?![,.](?!\\d+))(?!\\s*\\b(((y|e)\\s+)?({LessRegex}|{MoreRegex}|{EqualRegex}|no|de)|pero|o|a)\\b)' + ) + MoreRegexNoNumberSucceed = '(\\b(m[áa]s|mayor(es)?|superior(es)?)((?!\\s+(que|del?|al?))|\\s+((que|del?)(?!(\\s*\\d+))))|(por encima)(?!(\\s*\\d+)))\\b' + LessRegexNoNumberSucceed = '(\\b(meno(s|r(es)?)|inferior(es)?)((?!\\s+(que|del?|al?))|\\s+((que|del?|al?)(?!(\\s*\\d+))))|(por debajo)(?!(\\s*\\d+)))\\b' + EqualRegexNoNumberSucceed = ( + '(\\b(igual(es)?|equivalentes?|equivalen?)((?!\\s+(al?|que|del?))|(\\s+(al?|que|del?)(?!(\\s*\\d+)))))\\b' + ) OneNumberRangeMoreRegex1 = f'({MoreOrEqual}|{MoreRegex})\\s*((el|las?|los)\\s+)?(?({NumberSplitMark}.)+)' OneNumberRangeMoreRegex1LB = f'(?({NumberSplitMark}.)+)\\s*{MoreOrEqualSuffix}' @@ -110,7 +135,7 @@ def DoubleWithoutIntegralRegex(placeholder): TwoNumberRangeRegex2 = f'({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})\\s*(\\by\\b|\\be\\b|pero|,)\\s*({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})' TwoNumberRangeRegex3 = f'({OneNumberRangeLessRegex1}|{OneNumberRangeLessRegex2})\\s*(\\by\\b|\\be\\b|pero|,)\\s*({OneNumberRangeMoreRegex1}|{OneNumberRangeMoreRegex2})' TwoNumberRangeRegex4 = f'(\\bde(sde)?\\s+)?(\\b(el|las?|los)\\s+)?\\b(?!\\s+)(?({NumberSplitMark}(?!\\b(entre|de(sde)?|es)\\b).)+)\\b\\s*{TillRegex}\\s*((el|las?|los)\\s+)?\\b(?!\\s+)(?({NumberSplitMark}.)+)\\b' - AmbiguousFractionConnectorsRegex = f'(\\b(en|de)\\b)' + AmbiguousFractionConnectorsRegex = '(\\b(en|de)\\b)' DecimalSeparatorChar = ',' FractionMarkerToken = 'sobre' NonDecimalSeparatorChar = '.' @@ -121,515 +146,539 @@ def DoubleWithoutIntegralRegex(placeholder): WrittenIntegerSeparatorTexts = [r'y'] WrittenFractionSeparatorTexts = [r'con'] OneHalfTokens = [r'un', r'medio'] - HalfADozenRegex = f'media\\s+docena' + HalfADozenRegex = 'media\\s+docena' DigitalNumberRegex = f'((?<=\\b)(mil(l[oó]n(es)?)?|bill[oó]n(es)?|trill[oó]n(es)?|(docena|dz|doz)s?)(?=\\b))|((?<=(\\d|\\b)){BaseNumbers.MultiplierLookupRegex}(?=\\b))' - CardinalNumberMap = dict([("cero", 0), - ("un", 1), - ("una", 1), - ("uno", 1), - ("dos", 2), - ("tres", 3), - ("cuatro", 4), - ("cinco", 5), - ("seis", 6), - ("siete", 7), - ("ocho", 8), - ("nueve", 9), - ("diez", 10), - ("once", 11), - ("doce", 12), - ("docena", 12), - ("docenas", 12), - ("dz", 12), - ("doz", 12), - ("dzs", 12), - ("dozs", 12), - ("trece", 13), - ("catorce", 14), - ("quince", 15), - ("dieciseis", 16), - ("dieciséis", 16), - ("diecisiete", 17), - ("dieciocho", 18), - ("diecinueve", 19), - ("veinte", 20), - ("ventiuna", 21), - ("ventiuno", 21), - ("veintiun", 21), - ("veintiún", 21), - ("veintiuno", 21), - ("veintiuna", 21), - ("veintidos", 22), - ("veintidós", 22), - ("veintitres", 23), - ("veintitrés", 23), - ("veinticuatro", 24), - ("veinticinco", 25), - ("veintiseis", 26), - ("veintiséis", 26), - ("veintisiete", 27), - ("veintiocho", 28), - ("veintinueve", 29), - ("treinta", 30), - ("cuarenta", 40), - ("cincuenta", 50), - ("sesenta", 60), - ("setenta", 70), - ("ochenta", 80), - ("noventa", 90), - ("cien", 100), - ("ciento", 100), - ("doscientas", 200), - ("doscientos", 200), - ("trescientas", 300), - ("trescientos", 300), - ("cuatrocientas", 400), - ("cuatrocientos", 400), - ("quinientas", 500), - ("quinientos", 500), - ("seiscientas", 600), - ("seiscientos", 600), - ("setecientas", 700), - ("setecientos", 700), - ("ochocientas", 800), - ("ochocientos", 800), - ("novecientas", 900), - ("novecientos", 900), - ("mil", 1000), - ("millon", 1000000), - ("millón", 1000000), - ("millones", 1000000), - ("billon", 1000000000000), - ("billón", 1000000000000), - ("billones", 1000000000000), - ("trillon", 1000000000000000000), - ("trillón", 1000000000000000000), - ("trillones", 1000000000000000000)]) - OrdinalNumberMap = dict([("primero", 1), - ("primera", 1), - ("primer", 1), - ("segundo", 2), - ("segunda", 2), - ("medio", 2), - ("media", 2), - ("mitad", 2), - ("tercero", 3), - ("tercera", 3), - ("tercer", 3), - ("tercio", 3), - ("cuarto", 4), - ("cuarta", 4), - ("quinto", 5), - ("quinta", 5), - ("sexto", 6), - ("sexta", 6), - ("septimo", 7), - ("septima", 7), - ("séptimo", 7), - ("séptima", 7), - ("octavo", 8), - ("octava", 8), - ("noveno", 9), - ("novena", 9), - ("decimo", 10), - ("décimo", 10), - ("decima", 10), - ("décima", 10), - ("undecimo", 11), - ("undecima", 11), - ("undécimo", 11), - ("undécima", 11), - ("duodecimo", 12), - ("duodecima", 12), - ("duodécimo", 12), - ("duodécima", 12), - ("decimotercero", 13), - ("decimotercera", 13), - ("decimocuarto", 14), - ("decimocuarta", 14), - ("decimoquinto", 15), - ("decimoquinta", 15), - ("decimosexto", 16), - ("decimosexta", 16), - ("decimoseptimo", 17), - ("decimoseptima", 17), - ("decimoctavo", 18), - ("decimoctava", 18), - ("decimonoveno", 19), - ("decimonovena", 19), - ("vigesimo", 20), - ("vigesima", 20), - ("vigésimo", 20), - ("vigésima", 20), - ("trigesimo", 30), - ("trigesima", 30), - ("trigésimo", 30), - ("trigésima", 30), - ("cuadragesimo", 40), - ("cuadragesima", 40), - ("cuadragésimo", 40), - ("cuadragésima", 40), - ("quincuagesimo", 50), - ("quincuagesima", 50), - ("quincuagésimo", 50), - ("quincuagésima", 50), - ("sexagesimo", 60), - ("sexagesima", 60), - ("sexagésimo", 60), - ("sexagésima", 60), - ("septuagesimo", 70), - ("septuagesima", 70), - ("septuagésimo", 70), - ("septuagésima", 70), - ("octogesimo", 80), - ("octogesima", 80), - ("octogésimo", 80), - ("octogésima", 80), - ("nonagesimo", 90), - ("nonagesima", 90), - ("nonagésimo", 90), - ("nonagésima", 90), - ("centesimo", 100), - ("centesima", 100), - ("centésimo", 100), - ("centésima", 100), - ("ducentesimo", 200), - ("ducentesima", 200), - ("ducentésimo", 200), - ("ducentésima", 200), - ("tricentesimo", 300), - ("tricentesima", 300), - ("tricentésimo", 300), - ("tricentésima", 300), - ("cuadringentesimo", 400), - ("cuadringentesima", 400), - ("cuadringentésimo", 400), - ("cuadringentésima", 400), - ("quingentesimo", 500), - ("quingentesima", 500), - ("quingentésimo", 500), - ("quingentésima", 500), - ("sexcentesimo", 600), - ("sexcentesima", 600), - ("sexcentésimo", 600), - ("sexcentésima", 600), - ("septingentesimo", 700), - ("septingentesima", 700), - ("septingentésimo", 700), - ("septingentésima", 700), - ("octingentesimo", 800), - ("octingentesima", 800), - ("octingentésimo", 800), - ("octingentésima", 800), - ("noningentesimo", 900), - ("noningentesima", 900), - ("noningentésimo", 900), - ("noningentésima", 900), - ("milesimo", 1000), - ("milesima", 1000), - ("milésimo", 1000), - ("milésima", 1000), - ("millonesimo", 1000000), - ("millonesima", 1000000), - ("millonésimo", 1000000), - ("millonésima", 1000000), - ("billonesimo", 1000000000000), - ("billonesima", 1000000000000), - ("billonésimo", 1000000000000), - ("billonésima", 1000000000000), - ("primeros", 1), - ("primeras", 1), - ("segundos", 2), - ("segundas", 2), - ("terceros", 3), - ("terceras", 3), - ("tercios", 3), - ("cuartos", 4), - ("cuartas", 4), - ("quintos", 5), - ("quintas", 5), - ("sextos", 6), - ("sextas", 6), - ("septimos", 7), - ("septimas", 7), - ("séptimos", 7), - ("séptimas", 7), - ("octavos", 8), - ("octavas", 8), - ("novenos", 9), - ("novenas", 9), - ("decimos", 10), - ("décimos", 10), - ("decimas", 10), - ("décimas", 10), - ("undecimos", 11), - ("undecimas", 11), - ("undécimos", 11), - ("undécimas", 11), - ("duodecimos", 12), - ("duodecimas", 12), - ("duodécimos", 12), - ("duodécimas", 12), - ("decimoterceros", 13), - ("decimoterceras", 13), - ("decimocuartos", 14), - ("decimocuartas", 14), - ("decimoquintos", 15), - ("decimoquintas", 15), - ("decimosextos", 16), - ("decimosextas", 16), - ("decimoseptimos", 17), - ("decimoseptimas", 17), - ("decimoctavos", 18), - ("decimoctavas", 18), - ("decimonovenos", 19), - ("decimonovenas", 19), - ("vigesimos", 20), - ("vigesimas", 20), - ("vigésimos", 20), - ("vigésimas", 20), - ("trigesimos", 30), - ("trigesimas", 30), - ("trigésimos", 30), - ("trigésimas", 30), - ("cuadragesimos", 40), - ("cuadragesimas", 40), - ("cuadragésimos", 40), - ("cuadragésimas", 40), - ("quincuagesimos", 50), - ("quincuagesimas", 50), - ("quincuagésimos", 50), - ("quincuagésimas", 50), - ("sexagesimos", 60), - ("sexagesimas", 60), - ("sexagésimos", 60), - ("sexagésimas", 60), - ("septuagesimos", 70), - ("septuagesimas", 70), - ("septuagésimos", 70), - ("septuagésimas", 70), - ("octogesimos", 80), - ("octogesimas", 80), - ("octogésimos", 80), - ("octogésimas", 80), - ("nonagesimos", 90), - ("nonagesimas", 90), - ("nonagésimos", 90), - ("nonagésimas", 90), - ("centesimos", 100), - ("centesimas", 100), - ("centésimos", 100), - ("centésimas", 100), - ("ducentesimos", 200), - ("ducentesimas", 200), - ("ducentésimos", 200), - ("ducentésimas", 200), - ("tricentesimos", 300), - ("tricentesimas", 300), - ("tricentésimos", 300), - ("tricentésimas", 300), - ("cuadringentesimos", 400), - ("cuadringentesimas", 400), - ("cuadringentésimos", 400), - ("cuadringentésimas", 400), - ("quingentesimos", 500), - ("quingentesimas", 500), - ("quingentésimos", 500), - ("quingentésimas", 500), - ("sexcentesimos", 600), - ("sexcentesimas", 600), - ("sexcentésimos", 600), - ("sexcentésimas", 600), - ("septingentesimos", 700), - ("septingentesimas", 700), - ("septingentésimos", 700), - ("septingentésimas", 700), - ("octingentesimos", 800), - ("octingentesimas", 800), - ("octingentésimos", 800), - ("octingentésimas", 800), - ("noningentesimos", 900), - ("noningentesimas", 900), - ("noningentésimos", 900), - ("noningentésimas", 900), - ("milesimos", 1000), - ("milesimas", 1000), - ("milésimos", 1000), - ("milésimas", 1000), - ("millonesimos", 1000000), - ("millonesimas", 1000000), - ("millonésimos", 1000000), - ("millonésimas", 1000000), - ("billonesimos", 1000000000000), - ("billonesimas", 1000000000000), - ("billonésimos", 1000000000000), - ("billonésimas", 1000000000000)]) - PrefixCardinalMap = dict([("dos", 2), - ("tres", 3), - ("cuatro", 4), - ("cinco", 5), - ("seis", 6), - ("siete", 7), - ("ocho", 8), - ("nueve", 9), - ("diez", 10), - ("once", 11), - ("doce", 12), - ("trece", 13), - ("catorce", 14), - ("quince", 15), - ("dieciseis", 16), - ("dieciséis", 16), - ("diecisiete", 17), - ("dieciocho", 18), - ("diecinueve", 19), - ("veinte", 20), - ("ventiuna", 21), - ("veintiun", 21), - ("veintiún", 21), - ("veintidos", 22), - ("veintitres", 23), - ("veinticuatro", 24), - ("veinticinco", 25), - ("veintiseis", 26), - ("veintisiete", 27), - ("veintiocho", 28), - ("veintinueve", 29), - ("treinta", 30), - ("cuarenta", 40), - ("cincuenta", 50), - ("sesenta", 60), - ("setenta", 70), - ("ochenta", 80), - ("noventa", 90), - ("cien", 100), - ("doscientos", 200), - ("trescientos", 300), - ("cuatrocientos", 400), - ("quinientos", 500), - ("seiscientos", 600), - ("setecientos", 700), - ("ochocientos", 800), - ("novecientos", 900)]) - SuffixOrdinalMap = dict([("milesimo", 1000), - ("millonesimo", 1000000), - ("billonesimo", 1000000000000)]) - RoundNumberMap = dict([("mil", 1000), - ("milesimo", 1000), - ("millon", 1000000), - ("millón", 1000000), - ("millones", 1000000), - ("millonesimo", 1000000), - ("billon", 1000000000000), - ("billón", 1000000000000), - ("billones", 1000000000000), - ("billonesimo", 1000000000000), - ("trillon", 1000000000000000000), - ("trillón", 1000000000000000000), - ("trillones", 1000000000000000000), - ("trillonesimo", 1000000000000000000), - ("docena", 12), - ("docenas", 12), - ("dz", 12), - ("doz", 12), - ("dzs", 12), - ("dozs", 12), - ("k", 1000), - ("m", 1000000), - ("g", 1000000000), - ("b", 1000000000), - ("t", 1000000000000)]) + CardinalNumberMap = dict( + [ + ("cero", 0), + ("un", 1), + ("una", 1), + ("uno", 1), + ("dos", 2), + ("tres", 3), + ("cuatro", 4), + ("cinco", 5), + ("seis", 6), + ("siete", 7), + ("ocho", 8), + ("nueve", 9), + ("diez", 10), + ("once", 11), + ("doce", 12), + ("docena", 12), + ("docenas", 12), + ("dz", 12), + ("doz", 12), + ("dzs", 12), + ("dozs", 12), + ("trece", 13), + ("catorce", 14), + ("quince", 15), + ("dieciseis", 16), + ("dieciséis", 16), + ("diecisiete", 17), + ("dieciocho", 18), + ("diecinueve", 19), + ("veinte", 20), + ("ventiuna", 21), + ("ventiuno", 21), + ("veintiun", 21), + ("veintiún", 21), + ("veintiuno", 21), + ("veintiuna", 21), + ("veintidos", 22), + ("veintidós", 22), + ("veintitres", 23), + ("veintitrés", 23), + ("veinticuatro", 24), + ("veinticinco", 25), + ("veintiseis", 26), + ("veintiséis", 26), + ("veintisiete", 27), + ("veintiocho", 28), + ("veintinueve", 29), + ("treinta", 30), + ("cuarenta", 40), + ("cincuenta", 50), + ("sesenta", 60), + ("setenta", 70), + ("ochenta", 80), + ("noventa", 90), + ("cien", 100), + ("ciento", 100), + ("doscientas", 200), + ("doscientos", 200), + ("trescientas", 300), + ("trescientos", 300), + ("cuatrocientas", 400), + ("cuatrocientos", 400), + ("quinientas", 500), + ("quinientos", 500), + ("seiscientas", 600), + ("seiscientos", 600), + ("setecientas", 700), + ("setecientos", 700), + ("ochocientas", 800), + ("ochocientos", 800), + ("novecientas", 900), + ("novecientos", 900), + ("mil", 1000), + ("millon", 1000000), + ("millón", 1000000), + ("millones", 1000000), + ("billon", 1000000000000), + ("billón", 1000000000000), + ("billones", 1000000000000), + ("trillon", 1000000000000000000), + ("trillón", 1000000000000000000), + ("trillones", 1000000000000000000), + ] + ) + OrdinalNumberMap = dict( + [ + ("primero", 1), + ("primera", 1), + ("primer", 1), + ("segundo", 2), + ("segunda", 2), + ("medio", 2), + ("media", 2), + ("mitad", 2), + ("tercero", 3), + ("tercera", 3), + ("tercer", 3), + ("tercio", 3), + ("cuarto", 4), + ("cuarta", 4), + ("quinto", 5), + ("quinta", 5), + ("sexto", 6), + ("sexta", 6), + ("septimo", 7), + ("septima", 7), + ("séptimo", 7), + ("séptima", 7), + ("octavo", 8), + ("octava", 8), + ("noveno", 9), + ("novena", 9), + ("decimo", 10), + ("décimo", 10), + ("decima", 10), + ("décima", 10), + ("undecimo", 11), + ("undecima", 11), + ("undécimo", 11), + ("undécima", 11), + ("duodecimo", 12), + ("duodecima", 12), + ("duodécimo", 12), + ("duodécima", 12), + ("decimotercero", 13), + ("decimotercera", 13), + ("decimocuarto", 14), + ("decimocuarta", 14), + ("decimoquinto", 15), + ("decimoquinta", 15), + ("decimosexto", 16), + ("decimosexta", 16), + ("decimoseptimo", 17), + ("decimoseptima", 17), + ("decimoctavo", 18), + ("decimoctava", 18), + ("decimonoveno", 19), + ("decimonovena", 19), + ("vigesimo", 20), + ("vigesima", 20), + ("vigésimo", 20), + ("vigésima", 20), + ("trigesimo", 30), + ("trigesima", 30), + ("trigésimo", 30), + ("trigésima", 30), + ("cuadragesimo", 40), + ("cuadragesima", 40), + ("cuadragésimo", 40), + ("cuadragésima", 40), + ("quincuagesimo", 50), + ("quincuagesima", 50), + ("quincuagésimo", 50), + ("quincuagésima", 50), + ("sexagesimo", 60), + ("sexagesima", 60), + ("sexagésimo", 60), + ("sexagésima", 60), + ("septuagesimo", 70), + ("septuagesima", 70), + ("septuagésimo", 70), + ("septuagésima", 70), + ("octogesimo", 80), + ("octogesima", 80), + ("octogésimo", 80), + ("octogésima", 80), + ("nonagesimo", 90), + ("nonagesima", 90), + ("nonagésimo", 90), + ("nonagésima", 90), + ("centesimo", 100), + ("centesima", 100), + ("centésimo", 100), + ("centésima", 100), + ("ducentesimo", 200), + ("ducentesima", 200), + ("ducentésimo", 200), + ("ducentésima", 200), + ("tricentesimo", 300), + ("tricentesima", 300), + ("tricentésimo", 300), + ("tricentésima", 300), + ("cuadringentesimo", 400), + ("cuadringentesima", 400), + ("cuadringentésimo", 400), + ("cuadringentésima", 400), + ("quingentesimo", 500), + ("quingentesima", 500), + ("quingentésimo", 500), + ("quingentésima", 500), + ("sexcentesimo", 600), + ("sexcentesima", 600), + ("sexcentésimo", 600), + ("sexcentésima", 600), + ("septingentesimo", 700), + ("septingentesima", 700), + ("septingentésimo", 700), + ("septingentésima", 700), + ("octingentesimo", 800), + ("octingentesima", 800), + ("octingentésimo", 800), + ("octingentésima", 800), + ("noningentesimo", 900), + ("noningentesima", 900), + ("noningentésimo", 900), + ("noningentésima", 900), + ("milesimo", 1000), + ("milesima", 1000), + ("milésimo", 1000), + ("milésima", 1000), + ("millonesimo", 1000000), + ("millonesima", 1000000), + ("millonésimo", 1000000), + ("millonésima", 1000000), + ("billonesimo", 1000000000000), + ("billonesima", 1000000000000), + ("billonésimo", 1000000000000), + ("billonésima", 1000000000000), + ("primeros", 1), + ("primeras", 1), + ("segundos", 2), + ("segundas", 2), + ("terceros", 3), + ("terceras", 3), + ("tercios", 3), + ("cuartos", 4), + ("cuartas", 4), + ("quintos", 5), + ("quintas", 5), + ("sextos", 6), + ("sextas", 6), + ("septimos", 7), + ("septimas", 7), + ("séptimos", 7), + ("séptimas", 7), + ("octavos", 8), + ("octavas", 8), + ("novenos", 9), + ("novenas", 9), + ("decimos", 10), + ("décimos", 10), + ("decimas", 10), + ("décimas", 10), + ("undecimos", 11), + ("undecimas", 11), + ("undécimos", 11), + ("undécimas", 11), + ("duodecimos", 12), + ("duodecimas", 12), + ("duodécimos", 12), + ("duodécimas", 12), + ("decimoterceros", 13), + ("decimoterceras", 13), + ("decimocuartos", 14), + ("decimocuartas", 14), + ("decimoquintos", 15), + ("decimoquintas", 15), + ("decimosextos", 16), + ("decimosextas", 16), + ("decimoseptimos", 17), + ("decimoseptimas", 17), + ("decimoctavos", 18), + ("decimoctavas", 18), + ("decimonovenos", 19), + ("decimonovenas", 19), + ("vigesimos", 20), + ("vigesimas", 20), + ("vigésimos", 20), + ("vigésimas", 20), + ("trigesimos", 30), + ("trigesimas", 30), + ("trigésimos", 30), + ("trigésimas", 30), + ("cuadragesimos", 40), + ("cuadragesimas", 40), + ("cuadragésimos", 40), + ("cuadragésimas", 40), + ("quincuagesimos", 50), + ("quincuagesimas", 50), + ("quincuagésimos", 50), + ("quincuagésimas", 50), + ("sexagesimos", 60), + ("sexagesimas", 60), + ("sexagésimos", 60), + ("sexagésimas", 60), + ("septuagesimos", 70), + ("septuagesimas", 70), + ("septuagésimos", 70), + ("septuagésimas", 70), + ("octogesimos", 80), + ("octogesimas", 80), + ("octogésimos", 80), + ("octogésimas", 80), + ("nonagesimos", 90), + ("nonagesimas", 90), + ("nonagésimos", 90), + ("nonagésimas", 90), + ("centesimos", 100), + ("centesimas", 100), + ("centésimos", 100), + ("centésimas", 100), + ("ducentesimos", 200), + ("ducentesimas", 200), + ("ducentésimos", 200), + ("ducentésimas", 200), + ("tricentesimos", 300), + ("tricentesimas", 300), + ("tricentésimos", 300), + ("tricentésimas", 300), + ("cuadringentesimos", 400), + ("cuadringentesimas", 400), + ("cuadringentésimos", 400), + ("cuadringentésimas", 400), + ("quingentesimos", 500), + ("quingentesimas", 500), + ("quingentésimos", 500), + ("quingentésimas", 500), + ("sexcentesimos", 600), + ("sexcentesimas", 600), + ("sexcentésimos", 600), + ("sexcentésimas", 600), + ("septingentesimos", 700), + ("septingentesimas", 700), + ("septingentésimos", 700), + ("septingentésimas", 700), + ("octingentesimos", 800), + ("octingentesimas", 800), + ("octingentésimos", 800), + ("octingentésimas", 800), + ("noningentesimos", 900), + ("noningentesimas", 900), + ("noningentésimos", 900), + ("noningentésimas", 900), + ("milesimos", 1000), + ("milesimas", 1000), + ("milésimos", 1000), + ("milésimas", 1000), + ("millonesimos", 1000000), + ("millonesimas", 1000000), + ("millonésimos", 1000000), + ("millonésimas", 1000000), + ("billonesimos", 1000000000000), + ("billonesimas", 1000000000000), + ("billonésimos", 1000000000000), + ("billonésimas", 1000000000000), + ] + ) + PrefixCardinalMap = dict( + [ + ("dos", 2), + ("tres", 3), + ("cuatro", 4), + ("cinco", 5), + ("seis", 6), + ("siete", 7), + ("ocho", 8), + ("nueve", 9), + ("diez", 10), + ("once", 11), + ("doce", 12), + ("trece", 13), + ("catorce", 14), + ("quince", 15), + ("dieciseis", 16), + ("dieciséis", 16), + ("diecisiete", 17), + ("dieciocho", 18), + ("diecinueve", 19), + ("veinte", 20), + ("ventiuna", 21), + ("veintiun", 21), + ("veintiún", 21), + ("veintidos", 22), + ("veintitres", 23), + ("veinticuatro", 24), + ("veinticinco", 25), + ("veintiseis", 26), + ("veintisiete", 27), + ("veintiocho", 28), + ("veintinueve", 29), + ("treinta", 30), + ("cuarenta", 40), + ("cincuenta", 50), + ("sesenta", 60), + ("setenta", 70), + ("ochenta", 80), + ("noventa", 90), + ("cien", 100), + ("doscientos", 200), + ("trescientos", 300), + ("cuatrocientos", 400), + ("quinientos", 500), + ("seiscientos", 600), + ("setecientos", 700), + ("ochocientos", 800), + ("novecientos", 900), + ] + ) + SuffixOrdinalMap = dict([("milesimo", 1000), ("millonesimo", 1000000), ("billonesimo", 1000000000000)]) + RoundNumberMap = dict( + [ + ("mil", 1000), + ("milesimo", 1000), + ("millon", 1000000), + ("millón", 1000000), + ("millones", 1000000), + ("millonesimo", 1000000), + ("billon", 1000000000000), + ("billón", 1000000000000), + ("billones", 1000000000000), + ("billonesimo", 1000000000000), + ("trillon", 1000000000000000000), + ("trillón", 1000000000000000000), + ("trillones", 1000000000000000000), + ("trillonesimo", 1000000000000000000), + ("docena", 12), + ("docenas", 12), + ("dz", 12), + ("doz", 12), + ("dzs", 12), + ("dozs", 12), + ("k", 1000), + ("m", 1000000), + ("g", 1000000000), + ("b", 1000000000), + ("t", 1000000000000), + ] + ) AmbiguityFiltersDict = dict([("^[.]", "")]) - RelativeReferenceOffsetMap = dict([("proxima", "1"), - ("proximo", "1"), - ("proximas", "1"), - ("proximos", "1"), - ("próxima", "1"), - ("próximo", "1"), - ("próximas", "1"), - ("próximos", "1"), - ("anterior", "-1"), - ("anteriores", "-1"), - ("actual", "0"), - ("actuales", "0"), - ("siguiente", "1"), - ("siguientes", "1"), - ("ultima", "0"), - ("ultimo", "0"), - ("última", "0"), - ("último", "0"), - ("ultimas", "0"), - ("ultimos", "0"), - ("últimas", "0"), - ("últimos", "0"), - ("penultima", "-1"), - ("penultimo", "-1"), - ("penúltima", "-1"), - ("penúltimo", "-1"), - ("penultimas", "-1"), - ("penultimos", "-1"), - ("penúltimas", "-1"), - ("penúltimos", "-1"), - ("antepenultima", "-2"), - ("antepenultimo", "-2"), - ("antepenúltima", "-2"), - ("antepenúltimo", "-2"), - ("antepenultimas", "-2"), - ("antepenultimos", "-2"), - ("antepenúltimas", "-2"), - ("antepenúltimos", "-2"), - ("antes de la ultima", "-1"), - ("antes del ultimo", "-1"), - ("antes de la última", "-1"), - ("antes del último", "-1"), - ("anterior al ultimo", "-1"), - ("anterior a la ultima", "-1"), - ("anterior al último", "-1"), - ("anterior a la última", "-1")]) - RelativeReferenceRelativeToMap = dict([("proxima", "current"), - ("proximo", "current"), - ("proximas", "current"), - ("proximos", "current"), - ("próxima", "current"), - ("próximo", "current"), - ("próximas", "current"), - ("próximos", "current"), - ("anterior", "current"), - ("anteriores", "current"), - ("actual", "current"), - ("actuales", "current"), - ("siguiente", "current"), - ("siguientes", "current"), - ("ultima", "end"), - ("ultimo", "end"), - ("última", "end"), - ("último", "end"), - ("ultimas", "end"), - ("ultimos", "end"), - ("últimas", "end"), - ("últimos", "end"), - ("penultima", "end"), - ("penultimo", "end"), - ("penúltima", "end"), - ("penúltimo", "end"), - ("penultimas", "end"), - ("penultimos", "end"), - ("penúltimas", "end"), - ("penúltimos", "end"), - ("antepenultima", "end"), - ("antepenultimo", "end"), - ("antepenúltima", "end"), - ("antepenúltimo", "end"), - ("antepenultimas", "end"), - ("antepenultimos", "end"), - ("antepenúltimas", "end"), - ("antepenúltimos", "end"), - ("antes de la ultima", "end"), - ("antes del ultimo", "end"), - ("antes de la última", "end"), - ("antes del último", "end"), - ("anterior al ultimo", "end"), - ("anterior a la ultima", "end"), - ("anterior al último", "end"), - ("anterior a la última", "end")]) + RelativeReferenceOffsetMap = dict( + [ + ("proxima", "1"), + ("proximo", "1"), + ("proximas", "1"), + ("proximos", "1"), + ("próxima", "1"), + ("próximo", "1"), + ("próximas", "1"), + ("próximos", "1"), + ("anterior", "-1"), + ("anteriores", "-1"), + ("actual", "0"), + ("actuales", "0"), + ("siguiente", "1"), + ("siguientes", "1"), + ("ultima", "0"), + ("ultimo", "0"), + ("última", "0"), + ("último", "0"), + ("ultimas", "0"), + ("ultimos", "0"), + ("últimas", "0"), + ("últimos", "0"), + ("penultima", "-1"), + ("penultimo", "-1"), + ("penúltima", "-1"), + ("penúltimo", "-1"), + ("penultimas", "-1"), + ("penultimos", "-1"), + ("penúltimas", "-1"), + ("penúltimos", "-1"), + ("antepenultima", "-2"), + ("antepenultimo", "-2"), + ("antepenúltima", "-2"), + ("antepenúltimo", "-2"), + ("antepenultimas", "-2"), + ("antepenultimos", "-2"), + ("antepenúltimas", "-2"), + ("antepenúltimos", "-2"), + ("antes de la ultima", "-1"), + ("antes del ultimo", "-1"), + ("antes de la última", "-1"), + ("antes del último", "-1"), + ("anterior al ultimo", "-1"), + ("anterior a la ultima", "-1"), + ("anterior al último", "-1"), + ("anterior a la última", "-1"), + ] + ) + RelativeReferenceRelativeToMap = dict( + [ + ("proxima", "current"), + ("proximo", "current"), + ("proximas", "current"), + ("proximos", "current"), + ("próxima", "current"), + ("próximo", "current"), + ("próximas", "current"), + ("próximos", "current"), + ("anterior", "current"), + ("anteriores", "current"), + ("actual", "current"), + ("actuales", "current"), + ("siguiente", "current"), + ("siguientes", "current"), + ("ultima", "end"), + ("ultimo", "end"), + ("última", "end"), + ("último", "end"), + ("ultimas", "end"), + ("ultimos", "end"), + ("últimas", "end"), + ("últimos", "end"), + ("penultima", "end"), + ("penultimo", "end"), + ("penúltima", "end"), + ("penúltimo", "end"), + ("penultimas", "end"), + ("penultimos", "end"), + ("penúltimas", "end"), + ("penúltimos", "end"), + ("antepenultima", "end"), + ("antepenultimo", "end"), + ("antepenúltima", "end"), + ("antepenúltimo", "end"), + ("antepenultimas", "end"), + ("antepenultimos", "end"), + ("antepenúltimas", "end"), + ("antepenúltimos", "end"), + ("antes de la ultima", "end"), + ("antes del ultimo", "end"), + ("antes de la última", "end"), + ("antes del último", "end"), + ("anterior al ultimo", "end"), + ("anterior a la ultima", "end"), + ("anterior al último", "end"), + ("anterior a la última", "end"), + ] + ) + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-number/resource-definitions.json b/Python/libraries/recognizers-number/resource-definitions.json index 7505aa87cd..a83cfe2b4e 100644 --- a/Python/libraries/recognizers-number/resource-definitions.json +++ b/Python/libraries/recognizers-number/resource-definitions.json @@ -119,6 +119,18 @@ "class DutchNumeric:" ], "footer": [ "# pylint: enable=line-too-long" ] + }, + { + "input": [ "Arabic", "Arabic-Numbers" ], + "output": "arabic_numeric", + "header": [ + "from .base_numbers import BaseNumbers", + "# pylint: disable=line-too-long", + "", + "", + "class ArabicNumeric:" + ], + "footer": [ "# pylint: enable=line-too-long" ] } ] } diff --git a/Python/libraries/recognizers-number/setup.py b/Python/libraries/recognizers-number/setup.py index 56fdace3c1..b8edf59c52 100644 --- a/Python/libraries/recognizers-number/setup.py +++ b/Python/libraries/recognizers-number/setup.py @@ -2,16 +2,17 @@ # Licensed under the MIT License. import os -from setuptools import setup, find_packages + +from setuptools import find_packages, setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -NAME = "recognizers-text-number" -VERSION = "1.0.0.a0" -REQUIRES = ['recognizers-text', 'regex'] +NAME = "recognizers-text-number-genesys" +VERSION = "1.1.43" +REQUIRES = ['recognizers-text-genesys', 'regex'] setup( name=NAME, @@ -19,8 +20,7 @@ def read(fname): url='https://github.com/Microsoft/Recognizers-Text', author='Microsoft', description='recognizers-text-number README', - keywords=['nlp', 'nlp-entity-extraction', - 'entity-extraction', 'parser-library'], + keywords=['nlp', 'nlp-entity-extraction', 'entity-extraction', 'parser-library'], long_description=read('README.rst'), license='MIT', packages=find_packages(), @@ -32,5 +32,5 @@ def read(fname): 'Operating System :: OS Independent', 'Development Status :: 3 - Alpha', 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] + ], ) diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_GUID.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_GUID.py index ce6e33116e..7c6cd03ba4 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_GUID.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_GUID.py @@ -15,4 +15,6 @@ class BaseGUID: GUIDRegexElement = f'(([a-f0-9]{{8}}(-[a-f0-9]{{4}}){{3}}-[a-f0-9]{{12}})|([a-f0-9]{{32}}))' GUIDRegex = f'(\\b{GUIDRegexElement}\\b|\\{{{GUIDRegexElement}\\}}|urn:uuid:{GUIDRegexElement}\\b|%7[b]{GUIDRegexElement}%7[d]|[x]\\\'{GUIDRegexElement}\\\')' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_email.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_email.py index a2d7831495..b0d37e89e9 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_email.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_email.py @@ -20,4 +20,6 @@ class BaseEmail: EmailSuffix = f'(?(\\[)(\\[{IPv4Regex}\\])|{NormalSuffixRegex})' EmailRegex2 = f'(({EmailPrefix})@({EmailSuffix}))' RFC5322Regex = f'\\A(?:[a-z0-9!#$%&\'*+/=?^_`{{|}}~-]+(?:\\.[a-z0-9!#$%&\'*+/=?^_`{{|}}~-]+)*|\"\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\"\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){{3}}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])\\z' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_hashtag.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_hashtag.py index a93a70ad21..275b6b8dff 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_hashtag.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_hashtag.py @@ -14,4 +14,6 @@ class BaseHashtag: HashtagRegex = f'((?<=\\s|^)#([a-zA-Z0-9_]+))' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_ip.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_ip.py index 4fbd25cc76..02c74139fa 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_ip.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_ip.py @@ -27,4 +27,6 @@ class BaseIp: Ipv6EllipsisRegexOther = f'\\B::\\B|\\B:(:{BasicIpv6Element}){{1,7}}\\b|\\b({BasicIpv6Element}:){{1,7}}:\\B' MergedIpv6Regex = f'({BasicIpv6Regex}|{Ipv6EllipsisRegex1}|{Ipv6EllipsisRegex2}|{Ipv6EllipsisRegex3}|{Ipv6EllipsisRegex4}|{Ipv6EllipsisRegex5}|{Ipv6EllipsisRegex6}|{Ipv6EllipsisRegex7}|{Ipv6EllipsisRegex8})' Ipv6Regex = f'(\\b{MergedIpv6Regex}\\b)|({Ipv6EllipsisRegexOther})' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_mention.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_mention.py index e50bfa916d..0afa3466de 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_mention.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_mention.py @@ -14,4 +14,6 @@ class BaseMention: MentionRegex = f'@([a-zA-Z0-9_]+)(?![.]\\w)\\b' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_phone_numbers.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_phone_numbers.py index bad24b0d89..c6808b05f0 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_phone_numbers.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_phone_numbers.py @@ -48,7 +48,10 @@ def NLPhoneNumberRegex(WordBoundariesRegex, EndWordBoundariesRegex): def SpecialPhoneNumberRegex(WordBoundariesRegex, EndWordBoundariesRegex): return f'({WordBoundariesRegex}(\\d{{3,4}}[/-]\\d{{1,4}}[/-]\\d{{3,4}}){EndWordBoundariesRegex})' - NoAreaCodeUSPhoneNumberRegex = f'(?[a-zA-Z]{{2,18}}){UrlSuffixRegex}' UrlRegex2 = f'((ht|f)tp(s?)\\:\\/\\/|www\\.)[-a-zA-Z0-9@:%._\\+~#=]{{1,256}}\\.(?[a-zA-Z0-9()]{{1,6}})\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)' - IpUrlRegex = f'(?({ExtractionRestrictionRegex}{ProtocolRegex}({BaseIp.Ipv4Regex}|localhost){UrlSuffixRegex}))' + IpUrlRegex = ( + f'(?({ExtractionRestrictionRegex}{ProtocolRegex}({BaseIp.Ipv4Regex}|localhost){UrlSuffixRegex}))' + ) AmbiguousTimeTerm = f'^(1?[0-9]|2[0-3]).[ap]m$' - TldList = [r'com', r'org', r'net', r'int', r'edu', r'gov', r'mil', r'academy', r'app', r'aws', r'bot', r'buy', r'cafe', r'city', r'cloud', r'company', r'eco', r'education', r'game', r'games', r'gmbh', r'law', r'limited', r'live', r'llc', r'ltd', r'ltda', r'map', r'med', r'news', r'ngo', r'ong', r'phd', r'place', r'radio', r'science', r'search', r'shopping', r'sport', r'store', r'tvs', r'wiki', r'work', r'ac', r'ad', r'ae', r'af', r'ag', r'ai', r'al', r'am', r'an', r'ao', r'aq', r'ar', r'as', r'at', r'au', r'aw', r'ax', r'az', r'ba', r'bb', r'bd', r'be', r'bf', r'bg', r'bh', r'bi', r'bj', r'bl', r'bm', r'bn', r'bo', r'bq', r'br', r'bs', r'bt', r'bv', r'bw', r'by', r'bz', r'ca', r'cc', r'cd', r'cf', r'cg', r'ch', r'ci', r'ck', r'cl', r'cm', r'cn', r'co', r'cr', r'cu', r'cv', r'cw', r'cx', r'cy', r'cz', r'de', r'dj', r'dk', r'dm', r'do', r'dz', r'ec', r'ee', r'eg', r'eh', r'er', r'es', r'et', r'eu', r'fi', r'fj', r'fk', r'fm', r'fo', r'fr', r'ga', r'gb', r'gd', r'ge', r'gf', r'gg', r'gh', r'gi', r'gl', r'gm', r'gn', r'gp', r'gq', r'gr', r'gs', r'gt', r'gu', r'gw', r'gy', r'hk', r'hm', r'hn', r'hr', r'ht', r'hu', r'id', r'ie', r'il', r'im', r'in', r'io', r'iq', r'ir', r'is', r'it', r'je', r'jm', r'jo', r'jp', r'ke', r'kg', r'kh', r'ki', r'km', r'kn', r'kp', r'kr', r'kw', r'ky', r'kz', r'la', r'lb', r'lc', r'li', r'lk', r'lr', r'ls', r'lt', r'lu', r'lv', r'ly', r'ma', r'mc', r'md', r'me', r'mf', r'mg', r'mh', r'mk', r'ml', r'mm', r'mn', r'mo', r'mp', r'mq', r'mr', r'ms', r'mt', r'mu', r'mv', r'mw', r'mx', r'my', r'mz', r'na', r'nc', r'ne', r'nf', r'ng', r'ni', r'nl', r'no', r'np', r'nr', r'nu', r'nz', r'om', r'pa', r'pe', r'pf', r'pg', r'ph', r'pk', r'pl', r'pm', r'pn', r'pr', r'ps', r'pt', r'pw', r'py', r'qa', r're', r'ro', r'rs', r'ru', r'rw', r'sa', r'sb', r'sc', r'sd', r'se', r'sg', r'sh', r'si', r'sj', r'sk', r'sl', r'sm', r'sn', r'so', r'sr', r'ss', r'st', r'su', r'sv', r'sx', r'sy', r'sz', r'tc', r'td', r'tf', r'tg', r'th', r'tj', r'tk', r'tl', r'tm', r'tn', r'to', r'tp', r'tr', r'tt', r'tv', r'tw', r'tz', r'ua', r'ug', r'uk', r'um', r'us', r'uy', r'uz', r'va', r'vc', r've', r'vg', r'vi', r'vn', r'vu', r'wf', r'ws', r'ye', r'yt', r'za', r'zm', r'zw'] + TldList = [ + r'com', + r'org', + r'net', + r'int', + r'edu', + r'gov', + r'mil', + r'academy', + r'app', + r'aws', + r'bot', + r'buy', + r'cafe', + r'city', + r'cloud', + r'company', + r'eco', + r'education', + r'game', + r'games', + r'gmbh', + r'law', + r'limited', + r'live', + r'llc', + r'ltd', + r'ltda', + r'map', + r'med', + r'news', + r'ngo', + r'ong', + r'phd', + r'place', + r'radio', + r'science', + r'search', + r'shopping', + r'sport', + r'store', + r'tvs', + r'wiki', + r'work', + r'ac', + r'ad', + r'ae', + r'af', + r'ag', + r'ai', + r'al', + r'am', + r'an', + r'ao', + r'aq', + r'ar', + r'as', + r'at', + r'au', + r'aw', + r'ax', + r'az', + r'ba', + r'bb', + r'bd', + r'be', + r'bf', + r'bg', + r'bh', + r'bi', + r'bj', + r'bl', + r'bm', + r'bn', + r'bo', + r'bq', + r'br', + r'bs', + r'bt', + r'bv', + r'bw', + r'by', + r'bz', + r'ca', + r'cc', + r'cd', + r'cf', + r'cg', + r'ch', + r'ci', + r'ck', + r'cl', + r'cm', + r'cn', + r'co', + r'cr', + r'cu', + r'cv', + r'cw', + r'cx', + r'cy', + r'cz', + r'de', + r'dj', + r'dk', + r'dm', + r'do', + r'dz', + r'ec', + r'ee', + r'eg', + r'eh', + r'er', + r'es', + r'et', + r'eu', + r'fi', + r'fj', + r'fk', + r'fm', + r'fo', + r'fr', + r'ga', + r'gb', + r'gd', + r'ge', + r'gf', + r'gg', + r'gh', + r'gi', + r'gl', + r'gm', + r'gn', + r'gp', + r'gq', + r'gr', + r'gs', + r'gt', + r'gu', + r'gw', + r'gy', + r'hk', + r'hm', + r'hn', + r'hr', + r'ht', + r'hu', + r'id', + r'ie', + r'il', + r'im', + r'in', + r'io', + r'iq', + r'ir', + r'is', + r'it', + r'je', + r'jm', + r'jo', + r'jp', + r'ke', + r'kg', + r'kh', + r'ki', + r'km', + r'kn', + r'kp', + r'kr', + r'kw', + r'ky', + r'kz', + r'la', + r'lb', + r'lc', + r'li', + r'lk', + r'lr', + r'ls', + r'lt', + r'lu', + r'lv', + r'ly', + r'ma', + r'mc', + r'md', + r'me', + r'mf', + r'mg', + r'mh', + r'mk', + r'ml', + r'mm', + r'mn', + r'mo', + r'mp', + r'mq', + r'mr', + r'ms', + r'mt', + r'mu', + r'mv', + r'mw', + r'mx', + r'my', + r'mz', + r'na', + r'nc', + r'ne', + r'nf', + r'ng', + r'ni', + r'nl', + r'no', + r'np', + r'nr', + r'nu', + r'nz', + r'om', + r'pa', + r'pe', + r'pf', + r'pg', + r'ph', + r'pk', + r'pl', + r'pm', + r'pn', + r'pr', + r'ps', + r'pt', + r'pw', + r'py', + r'qa', + r're', + r'ro', + r'rs', + r'ru', + r'rw', + r'sa', + r'sb', + r'sc', + r'sd', + r'se', + r'sg', + r'sh', + r'si', + r'sj', + r'sk', + r'sl', + r'sm', + r'sn', + r'so', + r'sr', + r'ss', + r'st', + r'su', + r'sv', + r'sx', + r'sy', + r'sz', + r'tc', + r'td', + r'tf', + r'tg', + r'th', + r'tj', + r'tk', + r'tl', + r'tm', + r'tn', + r'to', + r'tp', + r'tr', + r'tt', + r'tv', + r'tw', + r'tz', + r'ua', + r'ug', + r'uk', + r'um', + r'us', + r'uy', + r'uz', + r'va', + r'vc', + r've', + r'vg', + r'vi', + r'vn', + r'vu', + r'wf', + r'ws', + r'ye', + r'yt', + r'za', + r'zm', + r'zw', + ] + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_ip.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_ip.py index a89d76b501..4938d65111 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_ip.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_ip.py @@ -18,4 +18,6 @@ class ChineseIp: Ipv4Regex = f'({PhoneNumbersDefinitions.WordBoundariesRegex}(1\\d{{2}}|2[0-4]\\d|25[0-5]|0?[1-9]\\d|0{{0,2}}\\d)((\\.(1\\d{{2}}|2[0-4]\\d|25[0-5]|0?[1-9]\\d|0{{0,2}}\\d)){{3}}){PhoneNumbersDefinitions.EndWordBoundariesRegex})' Ipv6EllipsisRegexOther = f'({PhoneNumbersDefinitions.NonWordBoundariesRegex}::{PhoneNumbersDefinitions.NonWordBoundariesRegex}|{PhoneNumbersDefinitions.NonWordBoundariesRegex}:(:{BaseIp.BasicIpv6Element}){{1,7}}{PhoneNumbersDefinitions.WordBoundariesRegex}|{PhoneNumbersDefinitions.WordBoundariesRegex}({BaseIp.BasicIpv6Element}:){{1,7}}:{PhoneNumbersDefinitions.NonWordBoundariesRegex})' Ipv6Regex = f'({PhoneNumbersDefinitions.WordBoundariesRegex}{BaseIp.MergedIpv6Regex}{PhoneNumbersDefinitions.WordBoundariesRegex})|({Ipv6EllipsisRegexOther})' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_phone_numbers.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_phone_numbers.py index 5467d49c4a..5b4f72ca23 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_phone_numbers.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_phone_numbers.py @@ -19,4 +19,6 @@ class ChinesePhoneNumbers: EndWordBoundariesRegex = f'(\\b|(?=[\\u0800-\\u9FFF]))' ColonPrefixCheckRegex = f'(([a-z]|[\\u4E00-\\u9FA5])\\s*$)' ForbiddenPrefixMarkers = [r':', r'%'] + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_url.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_url.py index c46ef13134..2e5d65198b 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_url.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/chinese_url.py @@ -19,4 +19,6 @@ class ChineseURL: UrlPrefixRegex = f'({ExtractionRestrictionRegex}{BaseURL.ProtocolRegex}?|{BaseURL.ProtocolRegex})[a-zA-Z0-9][-a-zA-Z0-9._]{{0,256}}(?[a-zA-Z]{{2,18}}){BaseURL.UrlSuffixRegex}' IpUrlRegex = f'(?({ExtractionRestrictionRegex}{BaseURL.ProtocolRegex}({BaseIp.Ipv4Regex}|localhost){BaseURL.UrlSuffixRegex}))' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/english_phone_numbers.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/english_phone_numbers.py index de6df13acc..d0c07c954b 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/english_phone_numbers.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/english_phone_numbers.py @@ -15,4 +15,6 @@ class EnglishPhoneNumbers: NumberReplaceToken = '@builtin.phonenumber' FalsePositivePrefixRegex = f'(account|card)(\\s+(#|number))?(\\s+is)?:?\\s*$' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/portuguese_phone_numbers.py b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/portuguese_phone_numbers.py index 12764ac3e4..a6c969d786 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/resources/portuguese_phone_numbers.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/resources/portuguese_phone_numbers.py @@ -15,4 +15,6 @@ class PortuguesePhoneNumbers: NumberReplaceToken = '@builtin.phonenumber' FalsePositivePrefixRegex = f'conta(\\s+(número|bancária(\\s+número)?))?(\\s+é)?:?\\s*$' + + # pylint: enable=line-too-long diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/config/ip_configuration.py b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/config/ip_configuration.py index 54d8f28f93..a60e14cb15 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/config/ip_configuration.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/config/ip_configuration.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class IpConfiguration: options: object diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/config/url_configuration.py b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/config/url_configuration.py index fd22701a78..b57c995f7a 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/config/url_configuration.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/config/url_configuration.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class URLConfiguration: options: object diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/constants.py b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/constants.py index 8e28c5ea13..3fccd666e3 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/constants.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/constants.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class Constants: IP_REGEX_IPV4: str = "ipv4" IP_REGEX_IPV6: str = "ipv6" diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/english/parsers.py b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/english/parsers.py index 33370b48e0..ea35b0881b 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/english/parsers.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/english/parsers.py @@ -40,43 +40,54 @@ def score_phone_number(self, phone_number_text) -> float: country_code_regex = re.compile(BasePhoneNumbers.CountryCodeRegex) area_code_regex = re.compile(BasePhoneNumbers.AreaCodeIndicatorRegex) - format_indicator_regex = re.compile( - BasePhoneNumbers.FormatIndicatorRegex, re.IGNORECASE | re.DOTALL) - no_area_code_USphonenumber_regex = re.compile( - BasePhoneNumbers.NoAreaCodeUSPhoneNumberRegex) + format_indicator_regex = re.compile(BasePhoneNumbers.FormatIndicatorRegex, re.IGNORECASE | re.DOTALL) + no_area_code_USphonenumber_regex = re.compile(BasePhoneNumbers.NoAreaCodeUSPhoneNumberRegex) # Country code score or area code score - score += self.country_code_award if country_code_regex.search( - phone_number_text) else self.area_code_award if area_code_regex.search( - phone_number_text) else 0 + score += ( + self.country_code_award + if country_code_regex.search(phone_number_text) + else self.area_code_award if area_code_regex.search(phone_number_text) else 0 + ) # Formatted score if format_indicator_regex.search(phone_number_text): - format_matches = list( - format_indicator_regex.finditer(phone_number_text)) + format_matches = list(format_indicator_regex.finditer(phone_number_text)) format_indicator_count = len(format_matches) - score += min(format_indicator_count, - self.max_format_indicator_num) * self.formatted_award - score -= self.continue_format_indicator_deduction_score if any( - len(match[0]) > 1 for match in format_matches) else 0 - if self.single_bracket_regex.search(phone_number_text) and not \ - self.complete_bracket_regex.search(phone_number_text): + score += min(format_indicator_count, self.max_format_indicator_num) * self.formatted_award + score -= ( + self.continue_format_indicator_deduction_score + if any(len(match[0]) > 1 for match in format_matches) + else 0 + ) + if self.single_bracket_regex.search(phone_number_text) and not self.complete_bracket_regex.search( + phone_number_text + ): score -= self.wrong_format_indicator_deduction_score # Length score if self.digit_regex.search(phone_number_text): - score += min((len(list(self.digit_regex.finditer(phone_number_text))) - self.phone_number_length_base), - self.max_length_award_num) * self.length_award + score += ( + min( + (len(list(self.digit_regex.finditer(phone_number_text))) - self.phone_number_length_base), + self.max_length_award_num, + ) + * self.length_award + ) # Same tailing digit deduction if self.tail_same_digit_regex.search(phone_number_text): - score -= (len(self.tail_same_digit_regex.search(phone_number_text)[ - 0]) - self.tail_same_limit) * self.tail_same_deduction_score + score -= ( + len(self.tail_same_digit_regex.search(phone_number_text)[0]) - self.tail_same_limit + ) * self.tail_same_deduction_score # Pure digit deduction if self.pure_digit_regex.search(phone_number_text): - score -= (len(phone_number_text) - self.pure_digit_length_limit) * self.length_award \ - if len(phone_number_text) > self.pure_digit_length_limit else 0 + score -= ( + (len(phone_number_text) - self.pure_digit_length_limit) * self.length_award + if len(phone_number_text) > self.pure_digit_length_limit + else 0 + ) # Special format deduction for pattern in BasePhoneNumbers.TypicalDeductionRegexList: @@ -86,15 +97,18 @@ def score_phone_number(self, phone_number_text) -> float: # Continue digit deduction if self.continue_digit_regex.search(phone_number_text): - score -= max(len(list(self.continue_digit_regex.finditer(phone_number_text))) - 1, - 0) * self.continue_digit_deduction_score + score -= ( + max(len(list(self.continue_digit_regex.finditer(phone_number_text))) - 1, 0) + * self.continue_digit_deduction_score + ) # Special award for special USphonenumber, i.e. 223-4567 or 223 - 4567 if no_area_code_USphonenumber_regex.match(phone_number_text): score += self.length_award * 1.5 return max(min(score, self.score_upper_limit), self.score_lower_limit) / ( - self.score_upper_limit - self.score_lower_limit) + self.score_upper_limit - self.score_lower_limit + ) def parse(self, source: ExtractResult): result = ParseResult(source) @@ -156,4 +170,5 @@ def score_guid(self, guid_text) -> float: score -= self.pure_digit_penalty if self.pure_digit_regex.search(guid_text) else 0 return max(min(score, self.score_upper_limit), self.score_lower_limit) / ( - self.score_upper_limit - self.score_lower_limit) + self.score_upper_limit - self.score_lower_limit + ) diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/extractors.py b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/extractors.py index 2435def63f..b2861f28e4 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/extractors.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/extractors.py @@ -41,8 +41,7 @@ def extract(self, source: str) -> List[ExtractResult]: match_source: Dict[Match, str] = dict() - matches_list = list( - map(lambda x: MatchesVal(matches=list(re.finditer(x.re, source)), val=x.val), self.regexes)) + matches_list = list(map(lambda x: MatchesVal(matches=list(re.finditer(x.re, source)), val=x.val), self.regexes)) matches_list = list(filter(lambda x: len(x.matches) > 0, matches_list)) for ml in matches_list: @@ -61,11 +60,11 @@ def extract(self, source: str) -> List[ExtractResult]: if i + 1 == len(source) or not matched[i + 1]: start = last + 1 length = i - last - substring = source[start:start + length].strip() + substring = source[start : start + length].strip() src_match = next( - (x for x in iter(match_source) if (x.start() == - start and (x.end() - x.start()) == length)), - None) + (x for x in iter(match_source) if (x.start() == start and (x.end() - x.start()) == length)), + None, + ) if src_match is not None: value = ExtractResult() @@ -103,29 +102,72 @@ def __init__(self, config): end_word_boundaries_regex = config.end_word_boundaries_regex self._regexes = [ - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.GeneralPhoneNumberRegex( - word_boundaries_regex, end_word_boundaries_regex)), Constants.PHONE_NUMBER_REGEX_GENERAL), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.BRPhoneNumberRegex( - word_boundaries_regex, non_word_boundaries_regex, end_word_boundaries_regex)), - Constants.PHONE_NUMBER_REGEX_BR), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.UKPhoneNumberRegex( - word_boundaries_regex, non_word_boundaries_regex, end_word_boundaries_regex)), - Constants.PHONE_NUMBER_REGEX_UK), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.DEPhoneNumberRegex( - word_boundaries_regex, end_word_boundaries_regex)), Constants.PHONE_NUMBER_REGEX_DE), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.USPhoneNumberRegex( - word_boundaries_regex, non_word_boundaries_regex, end_word_boundaries_regex)), - Constants.PHONE_NUMBER_REGEX_US), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.CNPhoneNumberRegex( - word_boundaries_regex, end_word_boundaries_regex)), Constants.PHONE_NUMBER_REGEX_CN), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.DKPhoneNumberRegex( - word_boundaries_regex, end_word_boundaries_regex)), Constants.PHONE_NUMBER_REGEX_DK), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.ITPhoneNumberRegex( - word_boundaries_regex, end_word_boundaries_regex)), Constants.PHONE_NUMBER_REGEX_IT), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.NLPhoneNumberRegex( - word_boundaries_regex, end_word_boundaries_regex)), Constants.PHONE_NUMBER_REGEX_NL), - ReVal(RegExpUtility.get_safe_reg_exp(BasePhoneNumbers.SpecialPhoneNumberRegex( - word_boundaries_regex, end_word_boundaries_regex)), Constants.PHONE_NUMBER_REGEX_SPECIAL), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.GeneralPhoneNumberRegex(word_boundaries_regex, end_word_boundaries_regex) + ), + Constants.PHONE_NUMBER_REGEX_GENERAL, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.BRPhoneNumberRegex( + word_boundaries_regex, non_word_boundaries_regex, end_word_boundaries_regex + ) + ), + Constants.PHONE_NUMBER_REGEX_BR, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.UKPhoneNumberRegex( + word_boundaries_regex, non_word_boundaries_regex, end_word_boundaries_regex + ) + ), + Constants.PHONE_NUMBER_REGEX_UK, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.DEPhoneNumberRegex(word_boundaries_regex, end_word_boundaries_regex) + ), + Constants.PHONE_NUMBER_REGEX_DE, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.USPhoneNumberRegex( + word_boundaries_regex, non_word_boundaries_regex, end_word_boundaries_regex + ) + ), + Constants.PHONE_NUMBER_REGEX_US, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.CNPhoneNumberRegex(word_boundaries_regex, end_word_boundaries_regex) + ), + Constants.PHONE_NUMBER_REGEX_CN, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.DKPhoneNumberRegex(word_boundaries_regex, end_word_boundaries_regex) + ), + Constants.PHONE_NUMBER_REGEX_DK, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.ITPhoneNumberRegex(word_boundaries_regex, end_word_boundaries_regex) + ), + Constants.PHONE_NUMBER_REGEX_IT, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.NLPhoneNumberRegex(word_boundaries_regex, end_word_boundaries_regex) + ), + Constants.PHONE_NUMBER_REGEX_NL, + ), + ReVal( + RegExpUtility.get_safe_reg_exp( + BasePhoneNumbers.SpecialPhoneNumberRegex(word_boundaries_regex, end_word_boundaries_regex) + ), + Constants.PHONE_NUMBER_REGEX_SPECIAL, + ), ] @property @@ -142,14 +184,12 @@ def extract(self, source: str): ssn_filter_regex = re.compile(BasePhoneNumbers.SSNFilterRegex) colon_prefix_check_regex = re.compile(self.config.colon_prefix_check_regex) - if (pre_check_phone_number_regex.search(source) is None): + if pre_check_phone_number_regex.search(source) is None: return ret extract_results = super().extract(source) - format_indicator_regex = re.compile( - BasePhoneNumbers.FormatIndicatorRegex, re.IGNORECASE | re.DOTALL) + format_indicator_regex = re.compile(BasePhoneNumbers.FormatIndicatorRegex, re.IGNORECASE | re.DOTALL) for er in extract_results: - if (count_digits(er.text) < 7 and er.data != "ITPhoneNumber") or \ - ssn_filter_regex.search(er.text): + if (count_digits(er.text) < 7 and er.data != "ITPhoneNumber") or ssn_filter_regex.search(er.text): continue if count_digits(er.text) == 16 and er.text[0] != "+": continue @@ -169,25 +209,30 @@ def extract(self, source: str): continue ch = source[er.start - 1] - front = source[0: er.start - 1] - if self.config.false_positive_prefix_regex and re.compile(self.config.false_positive_prefix_regex).search(front): + front = source[0 : er.start - 1] + if self.config.false_positive_prefix_regex and re.compile(self.config.false_positive_prefix_regex).search( + front + ): continue if er.start != 0: if ch in BasePhoneNumbers.BoundaryMarkers: # Handle cases like "-1234567" and "-1234+5678" - if ch in BasePhoneNumbers.SpecialBoundaryMarkers and \ - format_indicator_regex.search(er.text) and \ - er.start >= 2: + if ( + ch in BasePhoneNumbers.SpecialBoundaryMarkers + and format_indicator_regex.search(er.text) + and er.start >= 2 + ): ch_gap = source[er.start - 2] if ch_gap.isdigit(): international_dialing_prefix_regex = re.compile( - BasePhoneNumbers.InternationDialingPrefixRegex) + BasePhoneNumbers.InternationDialingPrefixRegex + ) match = international_dialing_prefix_regex.search(front) if match is not None: er.start = match.start() er.length = er.length + match.end() - match.start() + 1 - er.text = source[er.start:er.start + er.length].strip() + er.text = source[er.start : er.start + er.length].strip() ret.append(er) # Handle cases like "91a-677-0060". elif ch_gap.islower(): @@ -207,8 +252,7 @@ def extract(self, source: str): # filter hexadecimal address like 00 10 00 31 46 D9 E9 11 for m in re.finditer(BasePhoneNumbers.PhoneNumberMaskRegex, source): - ret = [er for er in ret if er.start < - m.start() or er.end > m.end()] + ret = [er for er in ret if er.start < m.start() or er.end > m.end()] return ret @@ -224,8 +268,7 @@ def regexes(self) -> List[ReVal]: def __init__(self): self._regexes = [ - ReVal(RegExpUtility.get_safe_reg_exp( - BaseEmail.EmailRegex), Constants.EMAIL_REGEX), + ReVal(RegExpUtility.get_safe_reg_exp(BaseEmail.EmailRegex), Constants.EMAIL_REGEX), # EmailRegex2 will break the code as it's not supported in Python, comment out for now # ReVal(RegExpUtility.get_safe_reg_exp(BaseEmail.EmailRegex2, remove_question=True), Constants.EMAIL_REGEX), ] @@ -274,8 +317,7 @@ def extract(self, source: str) -> List[ExtractResult]: matched: List[bool] = [False] * len(source) match_source: Dict[Match, str] = dict() - matches_list = list( - map(lambda x: MatchesVal(matches=list(re.finditer(x.re, source)), val=x.val), self.regexes)) + matches_list = list(map(lambda x: MatchesVal(matches=list(re.finditer(x.re, source)), val=x.val), self.regexes)) matches_list = list(filter(lambda x: len(x.matches) > 0, matches_list)) for ml in matches_list: @@ -293,24 +335,33 @@ def extract(self, source: str) -> List[ExtractResult]: if i + 1 == len(source) or not matched[i + 1]: start = last + 1 length = i - last - substring = source[start:start + length].strip() + substring = source[start : start + length].strip() simple_tokenizer = SimpleTokenizer() if substring.startswith(Constants.IPV6_ELLIPSIS) and ( - start > 0 and (str.isdigit(source[start - 1]) or - (str.isalpha(source[start - 1]) and - not simple_tokenizer.is_cjk(c=list(source)[start - 1])))): + start > 0 + and ( + str.isdigit(source[start - 1]) + or ( + str.isalpha(source[start - 1]) + and not simple_tokenizer.is_cjk(c=list(source)[start - 1]) + ) + ) + ): continue elif substring.endswith(Constants.IPV6_ELLIPSIS) and ( - i + 1 < len(source) and (str.isdigit(source[i + 1]) or - (str.isalpha(source[i + 1]) and - not simple_tokenizer.is_cjk(c=list(source)[start - 1])))): + i + 1 < len(source) + and ( + str.isdigit(source[i + 1]) + or (str.isalpha(source[i + 1]) and not simple_tokenizer.is_cjk(c=list(source)[start - 1])) + ) + ): continue src_match = next( - (x for x in iter(match_source) if (x.start() == - start and (x.end() - x.start()) == length)), - None) + (x for x in iter(match_source) if (x.start() == start and (x.end() - x.start()) == length)), + None, + ) if src_match is not None: value = ExtractResult() @@ -326,7 +377,7 @@ def __init__(self, config): self.config = config self._regexes = [ ReVal(self.config.ipv4_regex, Constants.IP_REGEX_IPV4), - ReVal(self.config.ipv6_regex, Constants.IP_REGEX_IPV6) + ReVal(self.config.ipv6_regex, Constants.IP_REGEX_IPV6), ] @@ -395,8 +446,9 @@ def __init__(self, config): self._regexes = [ ReVal(config.ip_url_regex, Constants.URL_REGEX), ReVal(config.url_regex, Constants.URL_REGEX), - ReVal(RegExpUtility.get_safe_reg_exp(BaseURL.UrlRegex2), Constants.URL_REGEX) + ReVal(RegExpUtility.get_safe_reg_exp(BaseURL.UrlRegex2), Constants.URL_REGEX), ] - self._ambiguous_time_term = ReVal(RegExpUtility.get_safe_reg_exp(BaseURL.AmbiguousTimeTerm), - Constants.URL_REGEX) + self._ambiguous_time_term = ReVal( + RegExpUtility.get_safe_reg_exp(BaseURL.AmbiguousTimeTerm), Constants.URL_REGEX + ) diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/models.py b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/models.py index 06dc424a93..1d4bf135fa 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/models.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/models.py @@ -46,9 +46,7 @@ def parse(self, query: str) -> List[ModelResult]: @staticmethod def get_resolution(data: ParseResult): - return { - 'value': data.resolution_str - } + return {'value': data.resolution_str} class PhoneNumberModel(AbstractSequenceModel): @@ -82,10 +80,7 @@ def parse(self, query: str) -> List[ModelResult]: return model_results def get_resolution(self, data: ParseResult): - return { - 'value': data.resolution_str, - 'score': '%g' % data.value - } + return {'value': data.resolution_str, 'score': '%g' % data.value} class EmailModel(AbstractSequenceModel): @@ -123,10 +118,7 @@ def parse(self, query: str) -> List[ModelResult]: return model_results def get_resolution(self, data: ParseResult): - return { - 'value': data.resolution_str, - 'score': '%g' % data.value - } + return {'value': data.resolution_str, 'score': '%g' % data.value} class HashtagModel(AbstractSequenceModel): @@ -165,10 +157,7 @@ def parse(self, query: str) -> List[ModelResult]: return model_results def get_resolution(self, data: ParseResult): - return { - 'value': data.resolution_str, - 'score': str(data.value) - } + return {'value': data.resolution_str, 'score': str(data.value)} class MentionModel(AbstractSequenceModel): diff --git a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/sequence_recognizer.py b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/sequence_recognizer.py index 9de2b3d646..29afcb9898 100644 --- a/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/sequence_recognizer.py +++ b/Python/libraries/recognizers-sequence/recognizers_sequence/sequence/sequence_recognizer.py @@ -16,54 +16,80 @@ class SequenceOptions(IntFlag): class SequenceRecognizer(Recognizer[SequenceOptions]): - def __init__(self, target_culture: str = None, options: SequenceOptions = SequenceOptions.NONE, - lazy_initialization: bool = True): + def __init__( + self, + target_culture: str = None, + options: SequenceOptions = SequenceOptions.NONE, + lazy_initialization: bool = True, + ): if options < SequenceOptions.NONE or options > SequenceOptions.NONE: raise ValueError() super().__init__(target_culture, options, lazy_initialization) def initialize_configuration(self): - self.register_model('PhoneNumberModel', Culture.English, - lambda options: PhoneNumberModel(PhoneNumberParser(), - BasePhoneNumberExtractor(EnglishPhoneNumberExtractorConfiguration()))) - - self.register_model('PhoneNumberModel', Culture.Chinese, - lambda options: PhoneNumberModel(PhoneNumberParser(), - BasePhoneNumberExtractor(ChinesePhoneNumberExtractorConfiguration()))) - - self.register_model('PhoneNumberModel', Culture.Portuguese, - lambda options: PhoneNumberModel(PhoneNumberParser(), - BasePhoneNumberExtractor(PortuguesePhoneNumberExtractorConfiguration()))) - - self.register_model('EmailModel', Culture.English, - lambda options: EmailModel(EmailParser(), EnglishEmailExtractor())) - - self.register_model('IpAddressModel', Culture.English, - lambda options: IpAddressModel(IpParser(), - BaseIpExtractor(EnglishIpExtractorConfiguration(options)))) - - self.register_model('IpAddressModel', Culture.Chinese, - lambda options: IpAddressModel(IpParser(), - BaseIpExtractor(ChineseIpExtractorConfiguration(options)))) - - self.register_model('MentionModel', Culture.English, - lambda options: MentionModel(MentionParser(), EnglishMentionExtractor())) - - self.register_model('HashtagModel', Culture.English, - lambda options: HashtagModel(HashtagParser(), EnglishHashtagExtractor())) - - self.register_model('URLModel', Culture.English, - lambda options: URLModel( - URLParser(), BaseURLExtractor(EnglishURLExtractorConfiguration(options))) - ) - - self.register_model('URLModel', Culture.Chinese, - lambda options: URLModel( - URLParser(), BaseURLExtractor(ChineseURLExtractorConfiguration(options))) - ) - - self.register_model('GUIDModel', Culture.English, - lambda options: GUIDModel(GUIDParser(), EnglishGUIDExtractor())) + self.register_model( + 'PhoneNumberModel', + Culture.English, + lambda options: PhoneNumberModel( + PhoneNumberParser(), BasePhoneNumberExtractor(EnglishPhoneNumberExtractorConfiguration()) + ), + ) + + self.register_model( + 'PhoneNumberModel', + Culture.Chinese, + lambda options: PhoneNumberModel( + PhoneNumberParser(), BasePhoneNumberExtractor(ChinesePhoneNumberExtractorConfiguration()) + ), + ) + + self.register_model( + 'PhoneNumberModel', + Culture.Portuguese, + lambda options: PhoneNumberModel( + PhoneNumberParser(), BasePhoneNumberExtractor(PortuguesePhoneNumberExtractorConfiguration()) + ), + ) + + self.register_model( + 'EmailModel', Culture.English, lambda options: EmailModel(EmailParser(), EnglishEmailExtractor()) + ) + + self.register_model( + 'IpAddressModel', + Culture.English, + lambda options: IpAddressModel(IpParser(), BaseIpExtractor(EnglishIpExtractorConfiguration(options))), + ) + + self.register_model( + 'IpAddressModel', + Culture.Chinese, + lambda options: IpAddressModel(IpParser(), BaseIpExtractor(ChineseIpExtractorConfiguration(options))), + ) + + self.register_model( + 'MentionModel', Culture.English, lambda options: MentionModel(MentionParser(), EnglishMentionExtractor()) + ) + + self.register_model( + 'HashtagModel', Culture.English, lambda options: HashtagModel(HashtagParser(), EnglishHashtagExtractor()) + ) + + self.register_model( + 'URLModel', + Culture.English, + lambda options: URLModel(URLParser(), BaseURLExtractor(EnglishURLExtractorConfiguration(options))), + ) + + self.register_model( + 'URLModel', + Culture.Chinese, + lambda options: URLModel(URLParser(), BaseURLExtractor(ChineseURLExtractorConfiguration(options))), + ) + + self.register_model( + 'GUIDModel', Culture.English, lambda options: GUIDModel(GUIDParser(), EnglishGUIDExtractor()) + ) def get_phone_number_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: if culture and (culture.lower().startswith("zh-") or culture.lower().startswith("ja-")): @@ -93,50 +119,57 @@ def get_email_model(self, culture: str = None, fallback_to_default_culture: bool return self.get_model('EmailModel', culture, fallback_to_default_culture) -def recognize_phone_number(query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, - fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_phone_number( + query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = SequenceRecognizer(culture, options) model = recognizer.get_phone_number_model(culture, fallback_to_default_culture) return model.parse(query) -def recognize_email(query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, - fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_email( + query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = SequenceRecognizer(culture, options) model = recognizer.get_email_model(culture, fallback_to_default_culture) return model.parse(query) -def recognize_ip_address(query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, - fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_ip_address( + query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = SequenceRecognizer(culture, options) model = recognizer.get_ip_address_model(culture, fallback_to_default_culture) return model.parse(query) -def recognize_mention(query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, - fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_mention( + query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = SequenceRecognizer(culture, options) model = recognizer.get_mention_model(culture, fallback_to_default_culture) return model.parse(query) -def recognize_hashtag(query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, - fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_hashtag( + query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = SequenceRecognizer(culture, options) model = recognizer.get_hashtag_model(culture, fallback_to_default_culture) return model.parse(query) -def recognize_url(query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, - fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_url( + query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = SequenceRecognizer(culture, options) model = recognizer.get_url_model(culture, fallback_to_default_culture) return model.parse(query) -def recognize_guid(query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, - fallback_to_default_culture: bool = True) -> List[ModelResult]: +def recognize_guid( + query: str, culture: str, options: SequenceOptions = SequenceOptions.NONE, fallback_to_default_culture: bool = True +) -> List[ModelResult]: recognizer = SequenceRecognizer(culture, options) model = recognizer.get_guid_model(culture, fallback_to_default_culture) return model.parse(query) diff --git a/Python/libraries/recognizers-sequence/setup.py b/Python/libraries/recognizers-sequence/setup.py index 70c18e4438..f509a213fe 100644 --- a/Python/libraries/recognizers-sequence/setup.py +++ b/Python/libraries/recognizers-sequence/setup.py @@ -2,16 +2,17 @@ # Licensed under the MIT License. import os -from setuptools import setup, find_packages + +from setuptools import find_packages, setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -NAME = "recognizers-text-sequence" -VERSION = "1.0.0.a0" -REQUIRES = ['recognizers-text', 'recognizers-text-number', 'regex'] +NAME = "recognizers-text-sequence-genesys" +VERSION = "1.1.43" +REQUIRES = ['recognizers-text-genesys', 'recognizers-text-number-genesys', 'regex'] setup( name=NAME, @@ -19,8 +20,7 @@ def read(fname): url='https://github.com/Microsoft/Recognizers-Text', author='Microsoft', description='recognizers-text-sequence README', - keywords=['nlp', 'nlp-entity-extraction', - 'entity-extraction', 'parser-library'], + keywords=['nlp', 'nlp-entity-extraction', 'entity-extraction', 'parser-library'], long_description=read('README.rst'), license='MIT', packages=find_packages(), @@ -32,5 +32,5 @@ def read(fname): 'Operating System :: OS Independent', 'Development Status :: 3 - Alpha', 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] + ], ) diff --git a/Python/libraries/recognizers-suite/recognizers_suite/__init__.py b/Python/libraries/recognizers-suite/recognizers_suite/__init__.py index 980c4283b5..f79a9a7920 100644 --- a/Python/libraries/recognizers-suite/recognizers_suite/__init__.py +++ b/Python/libraries/recognizers-suite/recognizers_suite/__init__.py @@ -3,8 +3,17 @@ from recognizers_text.model import ModelResult from recognizers_text.culture import Culture -from recognizers_number.number.number_recognizer import recognize_number, recognize_ordinal, recognize_percentage, NumberOptions -from recognizers_number_with_unit.number_with_unit.number_with_unit_recognizer import recognize_age, recognize_currency, recognize_dimension, recognize_temperature, NumberWithUnitOptions +from recognizers_number.number.number_recognizer import recognize_number, recognize_ordinal, NumberOptions +from recognizers_number_with_unit.number_with_unit.number_with_unit_recognizer import ( + recognize_currency, + NumberWithUnitOptions, +) from recognizers_date_time.date_time.date_time_recognizer import recognize_datetime, DateTimeOptions -from recognizers_sequence.sequence.sequence_recognizer import recognize_phone_number, recognize_email, recognize_url, recognize_ip_address, SequenceOptions +from recognizers_sequence.sequence.sequence_recognizer import ( + recognize_phone_number, + recognize_email, + recognize_url, + recognize_ip_address, + SequenceOptions, +) from recognizers_choice.choice.recognizers_choice import * diff --git a/Python/libraries/recognizers-suite/setup.py b/Python/libraries/recognizers-suite/setup.py index 40c7cee90c..6b6b7b1160 100644 --- a/Python/libraries/recognizers-suite/setup.py +++ b/Python/libraries/recognizers-suite/setup.py @@ -2,17 +2,25 @@ # Licensed under the MIT License. import os -from setuptools import setup, find_packages + +from setuptools import find_packages, setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -NAME = 'recognizers-text-suite' -VERSION = '1.0.0.a0' -REQUIRES = ['recognizers-text', 'recognizers-text-number', 'recognizers-text-number-with-unit', - 'recognizers-text-date-time', 'recognizers-text-sequence', 'recognizers-text-choice'] +NAME = 'recognizers-text-suite-genesys' +VERSION = '1.1.43' +REQUIRES = [ + 'recognizers-text-genesys==1.1.43', + 'recognizers-text-number-genesys==1.1.43', + 'recognizers-text-number-with-unit-genesys==1.1.43', + 'recognizers-text-date-time-genesys==1.1.43', + 'recognizers-text-sequence-genesys==1.1.43', + 'recognizers-text-choice-genesys==1.1.43', + 'datatypes_timex_expression_genesys==1.1.43', +] setup( name=NAME, @@ -20,8 +28,7 @@ def read(fname): url='https://github.com/Microsoft/Recognizers-Text', author='Microsoft', description='recognizers-text-suite README', - keywords=['nlp', 'nlp-entity-extraction', - 'entity-extraction', 'parser-library'], + keywords=['nlp', 'nlp-entity-extraction', 'entity-extraction', 'parser-library'], long_description=read('README.rst'), license='MIT', packages=find_packages(), @@ -33,5 +40,5 @@ def read(fname): 'Operating System :: OS Independent', 'Development Status :: 3 - Alpha', 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] + ], ) diff --git a/Python/libraries/recognizers-text/recognizers_text/__init__.py b/Python/libraries/recognizers-text/recognizers_text/__init__.py index c84f3c8e66..69bd561ef3 100644 --- a/Python/libraries/recognizers-text/recognizers_text/__init__.py +++ b/Python/libraries/recognizers-text/recognizers_text/__init__.py @@ -7,3 +7,4 @@ from .extractor import * from .parser import * from .utilities import * +from .resolution_key import * diff --git a/Python/libraries/recognizers-text/recognizers_text/culture.py b/Python/libraries/recognizers-text/recognizers_text/culture.py index 80eff1ad23..c8d6d49499 100644 --- a/Python/libraries/recognizers-text/recognizers_text/culture.py +++ b/Python/libraries/recognizers-text/recognizers_text/culture.py @@ -1,7 +1,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class Culture: + Arabic: str = 'ar-ae' Chinese: str = 'zh-cn' Dutch: str = 'nl-nl' English: str = 'en-us' @@ -15,6 +17,7 @@ class Culture: SpanishMexican: str = 'es-mx' Turkish: str = 'tr-tr' German: str = 'de-de' + Catalan: str = 'ca-es' @staticmethod def _get_supported_culture_codes(): @@ -31,7 +34,9 @@ def _get_supported_culture_codes(): Culture.Spanish, Culture.SpanishMexican, Culture.Turkish, - Culture.German + Culture.German, + Culture.Catalan, + Culture.Arabic, ] @staticmethod diff --git a/Python/libraries/recognizers-text/recognizers_text/extractor.py b/Python/libraries/recognizers-text/recognizers_text/extractor.py index 3eb20262eb..3cf6370c5e 100644 --- a/Python/libraries/recognizers-text/recognizers_text/extractor.py +++ b/Python/libraries/recognizers-text/recognizers_text/extractor.py @@ -23,8 +23,9 @@ def overlap(self, other) -> bool: return (not self.start > other.end) and (not other.start > self.end) def cover(self, other) -> bool: - return (((other.start < self.start) and (other.end >= self.end)) - or ((other.start <= self.start) and (other.end > self.end))) + return ((other.start < self.start) and (other.end >= self.end)) or ( + (other.start <= self.start) and (other.end > self.end) + ) @staticmethod def get_from_text(source: str): diff --git a/Python/libraries/recognizers-text/recognizers_text/matcher/aa_node.py b/Python/libraries/recognizers-text/recognizers_text/matcher/aa_node.py index 7be75bb43c..7afd1e9e2e 100644 --- a/Python/libraries/recognizers-text/recognizers_text/matcher/aa_node.py +++ b/Python/libraries/recognizers-text/recognizers_text/matcher/aa_node.py @@ -7,9 +7,9 @@ class AaNode(Node): def __init__(self, c: [] = [], depth: int = 0, parent=[]): - self.__word = c, - self.__depth = depth, - self.__parent = parent, + self.__word = (c,) + self.__depth = (depth,) + self.__parent = (parent,) self.__fail = 0 def __getitem__(self, item): diff --git a/Python/libraries/recognizers-text/recognizers_text/matcher/match_result.py b/Python/libraries/recognizers-text/recognizers_text/matcher/match_result.py index fcbb1e7472..9edb849fc5 100644 --- a/Python/libraries/recognizers-text/recognizers_text/matcher/match_result.py +++ b/Python/libraries/recognizers-text/recognizers_text/matcher/match_result.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class MatchResult: def __init__(self, start: int = 0, length: int = 0, ids: [] = []): diff --git a/Python/libraries/recognizers-text/recognizers_text/matcher/node.py b/Python/libraries/recognizers-text/recognizers_text/matcher/node.py index 11a21f74f5..61b2d35afe 100644 --- a/Python/libraries/recognizers-text/recognizers_text/matcher/node.py +++ b/Python/libraries/recognizers-text/recognizers_text/matcher/node.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class Node: def __init__(self): self.__values = [] diff --git a/Python/libraries/recognizers-text/recognizers_text/matcher/number_with_unit_tokenizer.py b/Python/libraries/recognizers-text/recognizers_text/matcher/number_with_unit_tokenizer.py index 2110a41253..9a54cd605c 100644 --- a/Python/libraries/recognizers-text/recognizers_text/matcher/number_with_unit_tokenizer.py +++ b/Python/libraries/recognizers-text/recognizers_text/matcher/number_with_unit_tokenizer.py @@ -28,18 +28,26 @@ def tokenize(self, input: str) -> []: c = chars[i] if str.isspace(c): if in_token: - tokens.append(Token(token_start, i - token_start, input[token_start: token_start + (i - token_start)])) + tokens.append( + Token(token_start, i - token_start, input[token_start : token_start + (i - token_start)]) + ) in_token = False - elif not (c in self.special_tokens_characters) and not (str.isdigit(c) or str.isalpha(c)) or \ - self.is_chinese(c) or self.is_japanese(c): + elif ( + c not in self.special_tokens_characters + and not (str.isdigit(c) or str.isalpha(c)) + or self.is_chinese(c) + or self.is_japanese(c) + ): # Non-splittable currency units (as "$") are treated as regular letters. For instance, 'us$' should be # a single token if in_token: - tokens.append(Token(token_start, i - token_start, input[token_start: token_start + (i - token_start)])) + tokens.append( + Token(token_start, i - token_start, input[token_start : token_start + (i - token_start)]) + ) in_token = False - tokens.append(Token(i, 1, input[i: token_start + (i - token_start) + 1])) + tokens.append(Token(i, 1, input[i : token_start + (i - token_start) + 1])) else: if in_token and i > 0: @@ -47,14 +55,20 @@ def tokenize(self, input: str) -> []: if self.is_splittable_unit(c, pre_char): # Split if letters or non-splittable units are adjacent with digits. - tokens.append(Token(token_start, i - token_start, input[token_start: token_start + (i - token_start)])) + tokens.append( + Token(token_start, i - token_start, input[token_start : token_start + (i - token_start)]) + ) token_start = i if not in_token: token_start = i in_token = True if in_token: - tokens.append(Token(token_start, len(chars) - token_start, input[token_start: token_start + (len(chars) - token_start)])) + tokens.append( + Token( + token_start, len(chars) - token_start, input[token_start : token_start + (len(chars) - token_start)] + ) + ) return tokens @@ -63,8 +77,9 @@ def is_splittable_unit(self, cur_char: chr, pre_char: chr): if (str.isalpha(cur_char) and str.isdigit(pre_char)) or (str.isdigit(cur_char) and str.isalpha(pre_char)): return True - if (str.isdigit(cur_char) and pre_char in self.special_tokens_characters) or \ - (cur_char in self.special_tokens_characters and str.isdigit(pre_char)): + if (str.isdigit(cur_char) and pre_char in self.special_tokens_characters) or ( + cur_char in self.special_tokens_characters and str.isdigit(pre_char) + ): return True return False diff --git a/Python/libraries/recognizers-text/recognizers_text/matcher/simple_tokenizer.py b/Python/libraries/recognizers-text/recognizers_text/matcher/simple_tokenizer.py index e9c146e766..125cccfa20 100644 --- a/Python/libraries/recognizers-text/recognizers_text/matcher/simple_tokenizer.py +++ b/Python/libraries/recognizers-text/recognizers_text/matcher/simple_tokenizer.py @@ -21,8 +21,9 @@ def tokenize(self, input: str) -> []: c = chars[i] if str.isspace(c): if in_token: - tokens.append(Token(token_start, i - token_start, - input[token_start: token_start + (i - token_start)])) + tokens.append( + Token(token_start, i - token_start, input[token_start : token_start + (i - token_start)]) + ) in_token = False elif not (str.isdigit(c) or str.isalpha(c)) or self.is_cjk(c): @@ -30,11 +31,12 @@ def tokenize(self, input: str) -> []: # a single token if in_token: - tokens.append(Token(token_start, i - token_start, - input[token_start: token_start + (i - token_start)])) + tokens.append( + Token(token_start, i - token_start, input[token_start : token_start + (i - token_start)]) + ) in_token = False - tokens.append(Token(i, 1, input[i: token_start + (i - token_start) + 1])) + tokens.append(Token(i, 1, input[i : token_start + (i - token_start) + 1])) else: @@ -43,8 +45,11 @@ def tokenize(self, input: str) -> []: in_token = True if in_token: - tokens.append(Token(token_start, len(chars) - token_start, - input[token_start: token_start + (len(chars) - token_start)])) + tokens.append( + Token( + token_start, len(chars) - token_start, input[token_start : token_start + (len(chars) - token_start)] + ) + ) return tokens @@ -57,14 +62,21 @@ def is_chinese(self, c: chr): def is_japanese(self, c: chr): uc = ord(c) hexa_list = [0x3040, 0x309F, 0x30A0, 0x30FF, 0xFF66, 0xFF9D] - return (hexa_list[0] <= uc <= hexa_list[1]) or (hexa_list[2] <= uc <= hexa_list[3]) or \ - (hexa_list[4] <= uc <= hexa_list[5]) + return ( + (hexa_list[0] <= uc <= hexa_list[1]) + or (hexa_list[2] <= uc <= hexa_list[3]) + or (hexa_list[4] <= uc <= hexa_list[5]) + ) def is_korean(self, c: chr): uc = ord(c) hexa_list = [0xAC00, 0xD7AF, 0x1100, 0x11FF, 0x3130, 0x318F, 0xFFB0, 0xFFDC] - return (hexa_list[0] <= uc <= hexa_list[1]) or (hexa_list[2] <= uc <= hexa_list[3]) or \ - (hexa_list[4] <= uc <= hexa_list[5]) or (hexa_list[6] <= uc <= hexa_list[7]) + return ( + (hexa_list[0] <= uc <= hexa_list[1]) + or (hexa_list[2] <= uc <= hexa_list[3]) + or (hexa_list[4] <= uc <= hexa_list[5]) + or (hexa_list[6] <= uc <= hexa_list[7]) + ) def is_cjk(self, c: chr): return self.is_chinese(c) or self.is_japanese(c) or self.is_korean(c) diff --git a/Python/libraries/recognizers-text/recognizers_text/matcher/string_matcher.py b/Python/libraries/recognizers-text/recognizers_text/matcher/string_matcher.py index 5de97c2dbb..f7f6d785b9 100644 --- a/Python/libraries/recognizers-text/recognizers_text/matcher/string_matcher.py +++ b/Python/libraries/recognizers-text/recognizers_text/matcher/string_matcher.py @@ -7,7 +7,6 @@ from .matcher import Matcher from .trie_tree import TrieTree from .ac_automaton import AcAutomaton -from multipledispatch import dispatch from .match_result import MatchResult @@ -73,7 +72,7 @@ def find(self, tokenized_query) -> []: end_token = query_tokens[r.start + r.length - 1] start = start_token.start length = end_token.end - start_token.start - r_text = tokenized_query[start: start + length] + r_text = tokenized_query[start : start + length] match_result = MatchResult() match_result.start = start diff --git a/Python/libraries/recognizers-text/recognizers_text/matcher/token.py b/Python/libraries/recognizers-text/recognizers_text/matcher/token.py index 608ccb4fc7..eb2316dab6 100644 --- a/Python/libraries/recognizers-text/recognizers_text/matcher/token.py +++ b/Python/libraries/recognizers-text/recognizers_text/matcher/token.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class Token(object): def __init__(self, start: int, length: int, text: str): self.__length = length diff --git a/Python/libraries/recognizers-text/recognizers_text/matcher/trie_tree.py b/Python/libraries/recognizers-text/recognizers_text/matcher/trie_tree.py index 4a427f9d89..d252b629f7 100644 --- a/Python/libraries/recognizers-text/recognizers_text/matcher/trie_tree.py +++ b/Python/libraries/recognizers-text/recognizers_text/matcher/trie_tree.py @@ -1,9 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import List - -from recognizers_text import ModelResult from .node import Node from .abstract_matcher import AbstractMatcher @@ -40,7 +37,7 @@ def find(self, query_text: []) -> []: for i in range(0, len(query_text)): node = self.root j = i - for j in range(j, len(query_text)+1): + for j in range(j, len(query_text) + 1): if node.end: yield MatchResult(i, j - i, node.values) diff --git a/Python/libraries/recognizers-text/recognizers_text/meta_data.py b/Python/libraries/recognizers-text/recognizers_text/meta_data.py index 53e4d19fad..c7e70eb932 100644 --- a/Python/libraries/recognizers-text/recognizers_text/meta_data.py +++ b/Python/libraries/recognizers-text/recognizers_text/meta_data.py @@ -1,8 +1,10 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. + class MetaData: def __init__(self): self.has_mod: bool = False self.is_duration_with_ago_and_later = False self.is_mealtime = False + self.is_holiday = False diff --git a/Python/libraries/recognizers-text/recognizers_text/model.py b/Python/libraries/recognizers-text/recognizers_text/model.py index 94f7a6aba3..65df2cf995 100644 --- a/Python/libraries/recognizers-text/recognizers_text/model.py +++ b/Python/libraries/recognizers-text/recognizers_text/model.py @@ -25,7 +25,7 @@ class ModelResult(object): resolution: Union[Dict[str, object], List[Dict[str, object]]] def __repr__(self) -> str: - value = self.resolution.get('value', None) + value = self.resolution.get('value', None) if self.resolution else None if value: return '{} ({})'.format(self.text, value) @@ -33,9 +33,7 @@ def __repr__(self) -> str: return self.text def __str__(self) -> str: - return '{}: {} [{}, {}]'.format( - self.type_name, self.text, self.start, self.end - ) + return '{}: {} [{}, {}]'.format(self.type_name, self.text, self.start, self.end) def get_dict(self) -> Dict[str, Any]: """ @@ -47,7 +45,7 @@ def get_dict(self) -> Dict[str, Any]: 'Start': self.start, 'End': self.end, 'TypeName': self.type_name, - 'Resolution': self.resolution.copy() + 'Resolution': self.resolution.copy(), } @@ -71,18 +69,17 @@ class ModelFactory(Generic[T_MODEL_OPTIONS]): __cache: Dict[CacheKey, Model] = dict() def __init__(self): - self.model_factories: Dict[ModelCtorKey, - Callable[[T_MODEL_OPTIONS], Model]] = dict() + self.model_factories: Dict[ModelCtorKey, Callable[[T_MODEL_OPTIONS], Model]] = dict() - def get_model(self, model_type_name: str, culture: str, fallback_to_default_culture: bool, options: T_MODEL_OPTIONS) -> Model: + def get_model( + self, model_type_name: str, culture: str, fallback_to_default_culture: bool, options: T_MODEL_OPTIONS + ) -> Model: result = self.try_get_model(model_type_name, culture, options) if result is None and fallback_to_default_culture is True: - result = self.try_get_model( - model_type_name, ModelFactory.__fallback_to_default_culture, options) + result = self.try_get_model(model_type_name, ModelFactory.__fallback_to_default_culture, options) if result is not None: return result - raise ValueError( - f'Could not find Model with the specified configuration: {culture},{model_type_name}') + raise ValueError(f'Could not find Model with the specified configuration: {culture},{model_type_name}') def register_model(self, model_type_name: str, culture: str, model_ctor: Callable[[T_MODEL_OPTIONS], Model]): key = ModelCtorKey(model_type=model_type_name, culture=culture) @@ -91,27 +88,23 @@ def register_model(self, model_type_name: str, culture: str, model_ctor: Callabl self.model_factories[key] = model_ctor def try_get_model(self, model_type_name: str, culture: str, options: T_MODEL_OPTIONS) -> Optional[Model]: - cache_result = self.get_model_from_cache( - model_type_name, culture, options) + cache_result = self.get_model_from_cache(model_type_name, culture, options) if cache_result is not None: return cache_result key = ModelCtorKey(model_type=model_type_name, culture=culture) model_ctor = self.model_factories.get(key, None) if model_ctor is not None: model = model_ctor(options) - self.register_model_in_cache( - model_type_name, culture, options, model) + self.register_model_in_cache(model_type_name, culture, options, model) return model return None def get_model_from_cache(self, model_type_name: str, culture: str, options: T_MODEL_OPTIONS) -> Model: - key = CacheKey(model_type=model_type_name, - culture=culture, options=options) + key = CacheKey(model_type=model_type_name, culture=culture, options=options) return ModelFactory.__cache.get(key, None) def register_model_in_cache(self, model_type_name: str, culture: str, options: T_MODEL_OPTIONS, model: Model): - key = CacheKey(model_type=model_type_name, - culture=culture, options=options) + key = CacheKey(model_type=model_type_name, culture=culture, options=options) ModelFactory.__cache[key] = model def initialize_models(self, target_culture: str, options: T_MODEL_OPTIONS): diff --git a/Python/libraries/recognizers-text/recognizers_text/resolution_key.py b/Python/libraries/recognizers-text/recognizers_text/resolution_key.py new file mode 100644 index 0000000000..e6deda9a31 --- /dev/null +++ b/Python/libraries/recognizers-text/recognizers_text/resolution_key.py @@ -0,0 +1,10 @@ +class ResolutionKey: + value_set: str = 'values' + value: str = 'value' + type: str = 'type' + unit: str = 'unit' + score: str = 'score' + iso_currency: str = 'isoCurrency' + sub_type: str = 'subtype' + relative_to: str = 'offset' + offset: str = 'relativeTo' diff --git a/Python/libraries/recognizers-text/recognizers_text/utilities.py b/Python/libraries/recognizers-text/recognizers_text/utilities.py index 1bd9c5848c..5a2f6a22ba 100644 --- a/Python/libraries/recognizers-text/recognizers_text/utilities.py +++ b/Python/libraries/recognizers-text/recognizers_text/utilities.py @@ -35,7 +35,7 @@ def index_of(string, token, position): class ConditionalMatch: def __init__(self, match: Match, success: bool): - self._match = match, + self._match = (match,) self._success = success @property @@ -109,13 +109,13 @@ def get_matches(regexp: Pattern, source: str) -> []: return list(filter(None, map(lambda m: m.group().lower(), matches))) @staticmethod - def match_begin(regex: Pattern, text: str, trim: bool): - match = regex.search(text) + def match_begin(regexp: Pattern, text: str, trim: bool): + match = regexp.search(text) if match is None: return None - str_before = text[0: text.index(match.group())] + str_before = text[0 : text.index(match.group())] if trim: str_before = str_before.strip() @@ -129,7 +129,7 @@ def match_end(regexp: Pattern, text: str, trim: bool): if match is None: return None - srt_after = text[text.index(match.group()) + (match.end() - match.start()):] + srt_after = text[text.index(match.group()) + (match.end() - match.start()) :] if trim: srt_after = srt_after.strip() @@ -139,8 +139,8 @@ def match_end(regexp: Pattern, text: str, trim: bool): return ConditionalMatch(match, success) @staticmethod - def is_exact_match(regex: Pattern, text: str, trim: bool): - match = regex.match(text) + def is_exact_match(regexp: Pattern, text: str, trim: bool): + match = regexp.match(text) length = len(text.strip()) if trim else len(text) @@ -195,7 +195,7 @@ def preprocess(source: str, case_sensitive: bool = False, recode: bool = True) - return result tokens = '(kB|K[Bb]?|M[BbM]?|G[Bb]?|B)' - expression = f'(?<=(\\s|\\d))' + tokens + '\\b' + expression = '(?<=(\\s|\\d))' + tokens + '\\b' special_tokens_regex = RegExpUtility.get_safe_reg_exp(expression, regex.S) @staticmethod @@ -205,8 +205,7 @@ def to_lower_term_sensitive(input_str: str) -> str: matches = QueryProcessor.special_tokens_regex.finditer(input_str) for match in matches: - QueryProcessor.apply_reverse( - match.start(), str_chars, match.group()) + QueryProcessor.apply_reverse(match.start(), str_chars, match.group()) return ''.join(str_chars) diff --git a/Python/libraries/recognizers-text/setup.py b/Python/libraries/recognizers-text/setup.py index cf1e76b76a..150563bd24 100644 --- a/Python/libraries/recognizers-text/setup.py +++ b/Python/libraries/recognizers-text/setup.py @@ -1,11 +1,12 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from setuptools import setup, find_packages +from setuptools import find_packages, setup -NAME = "recognizers-text" -VERSION = "1.0.0.a0" -REQUIRES = ['emoji==2.0.0', 'multipledispatch'] + +NAME = "recognizers-text-genesys" +VERSION = "1.1.43" +REQUIRES = ['emoji==1.1.0', 'multipledispatch'] setup( name=NAME, @@ -13,8 +14,7 @@ url='https://github.com/Microsoft/Recognizers-Text', author='Microsoft', description='recognizers-text README', - keywords=['nlp', 'nlp-entity-extraction', - 'entity-extraction', 'parser-library'], + keywords=['nlp', 'nlp-entity-extraction', 'entity-extraction', 'parser-library'], long_description='recognizers-text long README.', license='MIT', packages=find_packages(), @@ -26,5 +26,5 @@ 'Operating System :: OS Independent', 'Development Status :: 3 - Alpha', 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] + ], ) diff --git a/Python/libraries/resource-generator/lib/code_writer.py b/Python/libraries/resource-generator/lib/code_writer.py index ce77f5a526..d1f99f8d42 100644 --- a/Python/libraries/resource-generator/lib/code_writer.py +++ b/Python/libraries/resource-generator/lib/code_writer.py @@ -88,6 +88,8 @@ def __init__(self, name, value_type, entries): for value in entries: value = value.replace('\'', '\\\'') + if value == '\\': + value = value.replace('\\', '\\\\') self.entries.append(f'r{value_quote}{value}{value_quote}') def write(self): diff --git a/Python/pyproject.toml b/Python/pyproject.toml new file mode 100644 index 0000000000..e6ba91bf46 --- /dev/null +++ b/Python/pyproject.toml @@ -0,0 +1,22 @@ +[tool.isort] +profile = "black" +atomic = true +line_length = 120 +lines_after_imports = 2 +# Add a custom section for internal libraries. +known_internal_libraries = ['datatypes_timex_expression', 'recognizers_choice', 'recognizers_date_time', + 'recognizers_number', 'recognizers_number_with_unit', 'recognizers_sequence', + 'recognizers_suite', 'recognizers_text'] +# What sections isort should display imports for and in what order. +sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'INTERNAL_LIBRARIES', 'FIRSTPARTY', 'LOCALFOLDER'] + + +[tool.black] +line-length = 120 +target-version = ['py38'] +include = '\.pyi?$' +skip-string-normalization = true + +[tool.ruff] +# Same as Black. +line-length = 120 diff --git a/Python/requirements.txt b/Python/requirements.txt index cd6e64a28d..a24841da3f 100644 --- a/Python/requirements.txt +++ b/Python/requirements.txt @@ -1,4 +1,7 @@ datedelta -pre-commit==1.16.1 -autopep8 -flake8 \ No newline at end of file +python-dateutil +pre-commit==3.5.0 +isort==5.13.2 +ruff==0.4.2 +black==24.4.2 +pyupgrade==3.15.2 diff --git a/Python/samples/README.md b/Python/samples/README.md index 1fae68d3f5..765d1d3110 100644 --- a/Python/samples/README.md +++ b/Python/samples/README.md @@ -43,26 +43,10 @@ Recognizers.recognize_number(user_input, culture), # E.g "eleventh" will return "11". Recognizers.recognize_ordinal(user_input, culture), -# Percentage recognizer - This function will find any number presented as percentage -# E.g "one hundred percents" will return "100%" -Recognizers.recognize_percentage(user_input, culture), - -# Age recognizer - This function will find any age number presented -# E.g "After ninety five years of age, perspectives change" will return "95 Year" -Recognizers.recognize_age(user_input, culture), - # Currency recognizer - This function will find any currency presented # E.g "Interest expense in the 1988 third quarter was $ 75.3 million" will return "75300000 Dollar" Recognizers.recognize_currency(user_input, culture), -# Dimension recognizer - This function will find any dimension presented -# E.g "The six-mile trip to my airport hotel that had taken 20 minutes earlier in the day took more than three hours." will return "6 Mile" -Recognizers.recognize_dimension(user_input, culture), - -# Temperature recognizer - This function will find any temperature presented -# E.g "Set the temperature to 30 degrees celsius" will return "30 C" -Recognizers.recognize_temperature(user_input, culture), - # DateTime recognizer - This function will find any Date even if its write in colloquial language # E.g "I'll go back 8pm today" will return "2017-10-04 20:00:00" Recognizers.recognize_datetime(user_input, culture) diff --git a/Python/samples/simple_console/sample.py b/Python/samples/simple_console/sample.py index e091b14c1e..8fbe1a7e05 100644 --- a/Python/samples/simple_console/sample.py +++ b/Python/samples/simple_console/sample.py @@ -52,29 +52,11 @@ def parse_all(user_input: str, culture: str) -> List[List[ModelResult]]: # E.g "eleventh" will return "11". Recognizers.recognize_ordinal(user_input, culture), - # Percentage recognizer - This function will find any number presented as percentage - # E.g "one hundred percents" will return "100%" - Recognizers.recognize_percentage(user_input, culture), - - # Age recognizer - This function will find any age number presented - # E.g "After ninety five years of age, perspectives change" will return - # "95 Year" - Recognizers.recognize_age(user_input, culture), - # Currency recognizer - This function will find any currency presented # E.g "Interest expense in the 1988 third quarter was $ 75.3 million" # will return "75300000 Dollar" Recognizers.recognize_currency(user_input, culture), - # Dimension recognizer - This function will find any dimension presented E.g "The six-mile trip to my airport - # hotel that had taken 20 minutes earlier in the day took more than - # three hours." will return "6 Mile" - Recognizers.recognize_dimension(user_input, culture), - - # Temperature recognizer - This function will find any temperature presented - # E.g "Set the temperature to 30 degrees celsius" will return "30 C" - Recognizers.recognize_temperature(user_input, culture), - # DateTime recognizer - This function will find any Date even if its write in colloquial language - # E.g "I'll go back 8pm today" will return "2017-10-04 20:00:00" Recognizers.recognize_datetime(user_input, culture), diff --git a/Python/setup.cfg b/Python/setup.cfg deleted file mode 100644 index aec31e9cc8..0000000000 --- a/Python/setup.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[flake8] -ignore=E501,F403,W504,F405,F401,E711,W503,E265,F811,E714,F841,E226,E713,F632,E722,F821,F541,E741 -max-line-length=140 -exclude=build,dist -[pycodestyle] -max_line_length = 140 -ignore = E501 -[autopep8] -max_line_length = 140 -ignore = E501 \ No newline at end of file diff --git a/Python/tests/requirements.txt b/Python/tests/requirements.txt index bda6e46d69..6e54689705 100644 --- a/Python/tests/requirements.txt +++ b/Python/tests/requirements.txt @@ -1,2 +1,3 @@ pytest-cov pytest>=3.2.0 +pytest-xdist==3.5.0 diff --git a/Python/tests/runner.py b/Python/tests/runner.py index b859ceb3c9..2bd68c1cfb 100644 --- a/Python/tests/runner.py +++ b/Python/tests/runner.py @@ -2,11 +2,16 @@ # Licensed under the MIT License. import glob -import os import json +import os import re + import pytest from recognizers_text.culture import Culture +from regex import regex + +regex._MAXCACHE = 100000 +regex._MAXREPCACHE = 100000 def split_all(path): @@ -56,6 +61,8 @@ def get_specs(recognizer, entity): if 'NotSupportedByDesign' in spec and 'python' in spec['NotSupportedByDesign']: continue not_supported = 'NotSupported' in spec and 'python' in spec['NotSupported'] + if not_supported: + continue message = sp['config']['language'] + ' - ' + \ recognizer + ' - ' + sp['config']['model'] + entity ret_specs.append(pytest.param( @@ -72,9 +79,12 @@ def get_specs(recognizer, entity): ENTITY_PATTERN = re.compile('(.*)(Model|Parser|Extractor|Resolver)(.*)') CULTURES = { + 'Arabic': Culture.Arabic, 'Chinese': Culture.Chinese, + 'Catalan': Culture.Catalan, 'Dutch': Culture.Dutch, 'English': Culture.English, + 'EnglishOthers': Culture.EnglishOthers, 'French': Culture.French, 'Italian': Culture.Italian, 'Japanese': Culture.Japanese, diff --git a/Python/tests/test_initialization_number_with_unit_recognizer.py b/Python/tests/test_initialization_number_with_unit_recognizer.py index da1d6d27f9..a245aeba05 100644 --- a/Python/tests/test_initialization_number_with_unit_recognizer.py +++ b/Python/tests/test_initialization_number_with_unit_recognizer.py @@ -3,18 +3,13 @@ import pytest from recognizers_text import Culture -from recognizers_number_with_unit.number_with_unit import NumberWithUnitRecognizer, NumberWithUnitOptions -from recognizers_number_with_unit.number_with_unit.models import DimensionModel, AbstractNumberWithUnitModel, ExtractorParserModel -from recognizers_number_with_unit.number_with_unit.extractors import NumberWithUnitExtractor -from recognizers_number_with_unit.number_with_unit.english.extractors import EnglishDimensionExtractorConfiguration -from recognizers_number_with_unit.number_with_unit.parsers import NumberWithUnitParser -from recognizers_number_with_unit.number_with_unit.english.parsers import EnglishDimensionParserConfiguration +from recognizers_number_with_unit.number_with_unit import CurrencyModel, AbstractNumberWithUnitModel, ExtractorParserModel, NumberWithUnitRecognizer, NumberWithUnitOptions, NumberWithUnitExtractor, EnglishCurrencyExtractorConfiguration, NumberWithUnitParser, EnglishCurrencyParserConfiguration class TestInitializationNumberWithUnitRecognizer(): - control_model = DimensionModel( - [ExtractorParserModel(NumberWithUnitExtractor(EnglishDimensionExtractorConfiguration( - )), NumberWithUnitParser(EnglishDimensionParserConfiguration()))] + control_model = CurrencyModel( + [ExtractorParserModel(NumberWithUnitExtractor(EnglishCurrencyExtractorConfiguration( + )), NumberWithUnitParser(EnglishCurrencyParserConfiguration()))] ) english_culture = Culture.English spanish_culture = Culture.Spanish @@ -56,43 +51,16 @@ def assert_models_distinct(self, expected, actual): assert any_config_is_different - def test_without_culture_use_target_culture(self): - recognizer = NumberWithUnitRecognizer(self.english_culture) - self.assert_models_equal( - self.control_model, - recognizer.get_dimension_model()) - - def test_withOtherCulture_not_use_target_culture(self): - recognizer = NumberWithUnitRecognizer(self.english_culture) - self.assert_models_distinct( - self.control_model, - recognizer.get_dimension_model( - self.spanish_culture)) - - def test_with_invalid_culture_use_target_culture(self): - recognizer = NumberWithUnitRecognizer(self.spanish_culture) - self.assert_models_equal( - self.control_model, - recognizer.get_dimension_model( - self.invalid_culture)) - def test_with_invalid_culture_and_without_fallback_throw_error(self): recognizer = NumberWithUnitRecognizer() with pytest.raises(ValueError): - recognizer.get_dimension_model(self.invalid_culture, False) + recognizer.get_currency_model(self.invalid_culture, False) def test_with_invalid_culture_as_target_and_without_fallback_throw_error( self): recognizer = NumberWithUnitRecognizer(self.invalid_culture) with pytest.raises(ValueError): - recognizer.get_dimension_model(None, False) - - def test_without_target_culture_and_without_culture_fallback_to_english_culture( - self): - recognizer = NumberWithUnitRecognizer() - self.assert_models_equal( - self.control_model, - recognizer.get_dimension_model()) + recognizer.get_currency_model(None, False) def test_initialization_with_int_option_resolve_options_enum(self): recognizer = NumberWithUnitRecognizer( @@ -107,4 +75,3 @@ def test_initialization_with_invalid_options_throw_error(self): if __name__ == '__main__': tests = TestInitializationNumberWithUnitRecognizer() - tests.test_withOtherCulture_not_use_target_culture() diff --git a/Python/tests/test_runner_datetime.py b/Python/tests/test_runner_datetime.py index 3ad0f9d8b3..55ce6d79cb 100644 --- a/Python/tests/test_runner_datetime.py +++ b/Python/tests/test_runner_datetime.py @@ -6,11 +6,17 @@ import pytest from runner import get_specs, CULTURES from recognizers_date_time import recognize_datetime +from unittest import skip MODELFUNCTION = { 'DateTime': recognize_datetime } +CJK_languages = [ + # "Chinese", Skipped until it uses CJK base extractors/parsers + "Japanese", + "Korean" +] @pytest.mark.parametrize( 'culture, model, options, context, source, expected_results', @@ -22,7 +28,6 @@ def test_datetime_extractor( context, source, expected_results): - reference_datetime = get_reference_date(context) language = get_language(culture) extractor = create_extractor(language, model, options) @@ -49,7 +54,6 @@ def test_datetime_parser( context, source, expected_results): - reference_datetime = get_reference_date(context) language = get_language(culture) extractor = create_extractor(language, model, options) @@ -86,7 +90,6 @@ def test_datetime_mergedparser( context, source, expected_results): - reference_datetime = get_reference_date(context) language = get_language(culture) extractor = create_extractor(language, model, options) @@ -130,7 +133,6 @@ def test_datetime_model( context, source, expected_results): - reference_datetime = get_reference_date(context) option_obj = get_option(options) @@ -162,6 +164,17 @@ def test_datetime_model( assert_model_resolution(actual_resolution_value, expected['Resolution']['values'], spec_info) +@skip("Used for troubleshooting individual phrases") +def test_individual_utterance(): + text = 'عدت إلى 27.' + # text = "عدت يوم 27/3" + res = recognize_datetime(text, "ar-ae") + + print(f"\nResult: {res}") + assert len(res) > 0 + assert res[0].resolution.get("values") is not None + + def get_props(results, prop): list_result = [] for result in results: @@ -230,9 +243,16 @@ def create_extractor(language, model, options): if extractor: return extractor() - extractor = get_class( - f'recognizers_date_time.date_time.base_{model.lower()}', - f'Base{model}Extractor') + if language in CJK_languages: + extractor = get_class( + f'recognizers_date_time.date_time.CJK.base_{model.lower()}', + f'BaseCJK{model}Extractor' + ) + else: + extractor = get_class( + f'recognizers_date_time.date_time.base_{model.lower()}', + f'Base{model}Extractor') + configuration = get_class( f'recognizers_date_time.date_time.{language.lower()}.{model.lower()}_extractor_config', f'{language}{model}ExtractorConfiguration') @@ -261,11 +281,15 @@ def create_parser(language, model, options): f'{language}{model}Parser') if not parser: - parser = get_class( - f'recognizers_date_time.date_time.base_{model.lower()}', - f'Base{model}Parser') - if model == 'TimeZone': - return parser() + if language in CJK_languages: + parser = get_class( + f'recognizers_date_time.date_time.CJK.base_{model.lower()}', + f'BaseCJK{model}Parser' + ) + else: + parser = get_class( + f'recognizers_date_time.date_time.base_{model.lower()}', + f'Base{model}Parser') configuration_class = get_class( f'recognizers_date_time.date_time.{language.lower()}.{model.lower()}_parser_config', @@ -313,7 +337,6 @@ def get_results(culture, model, source, options, reference): def get_option(option): - if not option: option = 'None' @@ -329,3 +352,4 @@ def get_option(option): return option_class['SPLIT_DATE_AND_TIME'] return option_class['NONE'] + diff --git a/Python/tests/test_runner_number.py b/Python/tests/test_runner_number.py index 7cf254ae1d..9d62720916 100644 --- a/Python/tests/test_runner_number.py +++ b/Python/tests/test_runner_number.py @@ -1,14 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +from unittest import skip import pytest + +from recognizers_number.culture import SUPPORTED_CULTURES from runner import get_specs -from recognizers_number.number.number_recognizer import recognize_number, recognize_ordinal, recognize_percentage +from recognizers_number.number.number_recognizer import recognize_number, recognize_ordinal MODELFUNCTION = { 'Number': recognize_number, 'Ordinal': recognize_ordinal, - 'Percent': recognize_percentage, } @@ -41,3 +43,12 @@ def get_results(culture, model, source): def assert_verbose(actual, expected, spec_info): assert actual == expected, \ "Actual: {} | Expected: {} | Context: {}".format(actual, expected, spec_info) + + +@skip("Used for troubleshooting individual phrases") +def test_individual_utterance(): + res = recognize_number("نصف مليون", "ar-ae") + + print(f"\nResult: {res}") + assert len(res) > 0 + assert res[0].resolution.get("value") is not None diff --git a/Python/tests/test_runner_number_with_unit.py b/Python/tests/test_runner_number_with_unit.py index 0151c02333..5635221827 100644 --- a/Python/tests/test_runner_number_with_unit.py +++ b/Python/tests/test_runner_number_with_unit.py @@ -3,14 +3,10 @@ import pytest from runner import get_specs -from recognizers_number_with_unit.number_with_unit.number_with_unit_recognizer import recognize_age, recognize_currency, \ - recognize_dimension, recognize_temperature +from recognizers_number_with_unit.number_with_unit.number_with_unit_recognizer import recognize_currency MODELFUNCTION = { - 'Age': recognize_age, 'Currency': recognize_currency, - 'Temperature': recognize_temperature, - 'Dimension': recognize_dimension, } @@ -50,3 +46,4 @@ def resolution_assert(actual, expected, props): def assert_verbose(actual, expected, spec_info): assert actual == expected, \ "Actual: {} | Expected: {} | Context: {}".format(actual, expected, spec_info) + diff --git a/Script/Utils/generate_test_coverage_report.py b/Script/Utils/generate_test_coverage_report.py new file mode 100644 index 0000000000..5da64c70fc --- /dev/null +++ b/Script/Utils/generate_test_coverage_report.py @@ -0,0 +1,63 @@ +import csv +import json +from itertools import groupby +from pathlib import Path + + +OUTPUT_FILE = 'python_test_coverage_report.csv' + + +def main(): + test_coverage = [] + language_set = set() + + for path in Path('../../Specs').rglob('*.json'): + entity, lang = path.parts[-3:-1] + language_set.add(lang) + + with path.open() as f: + try: + test_cases = json.loads(f.read()) + except json.JSONDecodeError as e: + continue + + total = 0 + python_supported = 0 + for test_case in test_cases: + not_supported = test_case.get('NotSupportedByDesign', '') + not_supported += test_case.get('NotSupported', '') + if 'dotnet' in not_supported: + continue + if 'python' not in not_supported: + python_supported += 1 + total += 1 + + percent = round(python_supported / total * 100) if total else None + + test_coverage.append({ + 'entity': entity, + 'lang': lang, + 'model': path.stem, + 'percent': percent, + }) + + languages = sorted(language_set) + sort_key = lambda x: (x['entity'], x['model'], x['lang']) + test_coverage = sorted(test_coverage, key=sort_key) + + with open(OUTPUT_FILE, 'w', newline='') as f: + writer = csv.writer(f) + writer.writerow([''] + languages) + for entity, entity_group in groupby(test_coverage, key=lambda x: x['entity']): + writer.writerow([entity]) + for model, model_group in groupby(entity_group, key=lambda x: x['model']): + lang_coverage = {lang: {'percent': None} for lang in languages} + for lang in model_group: + if lang['percent'] is not None: + lang_coverage[lang['lang']] = lang + lang_coverage_list = [lang_coverage[lang] for lang in languages] + writer.writerow([model] + [lang['percent'] if lang else '' for lang in lang_coverage_list]) + + +if __name__ == '__main__': + main() diff --git a/Specs/Choice/Arabic/BooleanModel.json b/Specs/Choice/Arabic/BooleanModel.json index 872270cbdd..314229dc44 100644 --- a/Specs/Choice/Arabic/BooleanModel.json +++ b/Specs/Choice/Arabic/BooleanModel.json @@ -1,6 +1,7 @@ [ { "Input": "بالتأكيد!", + "NotSupported": "python", "Results": [ { "Text": "بالتأكيد", @@ -14,6 +15,7 @@ }, { "Input": "أنا لا أظن ذلك. لا.", + "NotSupported": "python", "Results": [ { "Text": "لا", @@ -27,6 +29,7 @@ }, { "Input": "أعتقد أن هذا سينجح. لذلك نعم سوف أقوم بذلك.", + "NotSupported": "python", "Results": [ { "Text": "نعم", @@ -40,6 +43,7 @@ }, { "Input": "لا، قلت الرابع من يوليو", + "NotSupported": "python", "Results": [ { "Text": "لا", @@ -53,6 +57,7 @@ }, { "Input": "نعم... قلت لا بصل", + "NotSupported": "python", "Results": [ { "Text": "نعم", @@ -66,6 +71,7 @@ }, { "Input": "قلت لا ليس نعم!", + "NotSupported": "python", "Results": [ { "Text": "لا", @@ -79,6 +85,7 @@ }, { "Input": "نعم. أنا أقول لا", + "NotSupported": "python", "Results": [ { "Text": "نعم", @@ -92,6 +99,7 @@ }, { "Input": "اختلف ، فإنه ليس صحيح", + "NotSupported": "python", "Results": [ { "Text": "ليس صحيح", @@ -105,6 +113,7 @@ }, { "Input": "اتفق، لا مشكلة", + "NotSupported": "python", "Results": [ { "Text": "اتفق", @@ -132,6 +141,7 @@ }, { "Input": "أختلف", + "NotSupportedByDesign": "python", "Results": [ { "Text": "أختلف", @@ -145,6 +155,7 @@ }, { "Input": "انها ليست على ما يرام", + "NotSupportedByDesign": "python", "Results": [ { "Text": "ليست", diff --git a/Specs/DateTime/Arabic/DateExtractor.json b/Specs/DateTime/Arabic/DateExtractor.json index b4f8340b40..525f24f7fb 100644 --- a/Specs/DateTime/Arabic/DateExtractor.json +++ b/Specs/DateTime/Arabic/DateExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "سأعود في 15", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "15", @@ -13,7 +13,7 @@ }, { "Input": "سأعود في 22 أبريل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "22 أبريل", @@ -25,7 +25,7 @@ }, { "Input": "سأعود في 1 يناير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1 يناير", @@ -37,7 +37,7 @@ }, { "Input": "سأعود في يناير 1", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يناير 1", @@ -49,7 +49,7 @@ }, { "Input": "سأعود في 2 أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 أكتوبر", @@ -61,7 +61,7 @@ }, { "Input": "سأعود في 12 يناير 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 يناير 2016", @@ -73,7 +73,7 @@ }, { "Input": "سأعود في 12 يناير من عام 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 يناير من عام 2016", @@ -85,19 +85,19 @@ }, { "Input": "سأعود يوم الاثنين 12 يناير 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "الاثنين 12 يناير 2016", - "Start": 10, - "Length": 21, + "Text": "يوم الاثنين 12 يناير 2016", + "Start": 6, + "Length": 25, "Type": "date" } ] }, { "Input": "سأعود 2016/02/22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2016/02/22", @@ -109,7 +109,7 @@ }, { "Input": "سأعود 2016/04/21", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2016/04/21", @@ -121,7 +121,7 @@ }, { "Input": "سوف أعود 16/04/21", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "16/04/21", @@ -133,7 +133,7 @@ }, { "Input": "سأعود 9-18-15", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "9-18-15", @@ -145,7 +145,7 @@ }, { "Input": "سأعود في 4.22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4.22", @@ -157,7 +157,7 @@ }, { "Input": "سأعود في 22-4", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "22-4", @@ -169,7 +169,7 @@ }, { "Input": "سأعود عند 4.22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4.22", @@ -181,7 +181,7 @@ }, { "Input": "سأعود عند 22-4", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "22-4", @@ -193,7 +193,7 @@ }, { "Input": "سأعود في 4/22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4/22", @@ -205,7 +205,7 @@ }, { "Input": "سأعود في 04/22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "04/22", @@ -217,7 +217,7 @@ }, { "Input": "سوف أعود 4/22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4/22", @@ -229,7 +229,7 @@ }, { "Input": "سأعود 04/22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "04/22", @@ -241,7 +241,7 @@ }, { "Input": "سأعود 2015/08/12", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2015/08/12", @@ -253,7 +253,7 @@ }, { "Input": "سأعود 11/12, 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "11/12, 2016", @@ -265,7 +265,7 @@ }, { "Input": "سوف أعود 11/12, 16", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "11/12, 16", @@ -277,7 +277,7 @@ }, { "Input": "سأعود في أول يناير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أول يناير", @@ -289,7 +289,7 @@ }, { "Input": "سأعود في 1 كانون الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1 كانون الثاني", @@ -301,7 +301,7 @@ }, { "Input": "سأعود في 28-نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "28-نوفمبر", @@ -313,7 +313,7 @@ }, { "Input": "سأعود الأربعاء ، 22 يناير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأربعاء ، 22 يناير", @@ -325,7 +325,7 @@ }, { "Input": "سأعود أول يوم جمعة من يوليو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أول يوم جمعة من يوليو", @@ -337,7 +337,7 @@ }, { "Input": "سأعود أول يوم جمعة في هذا الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أول يوم جمعة في هذا الشهر", @@ -349,7 +349,7 @@ }, { "Input": "سأعود بعد أسبوعين من الآن", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد أسبوعين من الآن", @@ -361,7 +361,7 @@ }, { "Input": "سأعود الأسبوع القادم يوم الجمعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع القادم يوم الجمعة", @@ -373,19 +373,19 @@ }, { "Input": "سأعود يوم الجمعة الأسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "الجمعة الأسبوع المقبل", - "Start": 10, - "Length": 21, + "Text": "يوم الجمعة الأسبوع المقبل", + "Start": 6, + "Length": 25, "Type": "date" } ] }, { "Input": "الاثنين الماضي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الاثنين الماضي", @@ -397,7 +397,7 @@ }, { "Input": "سأعود يوم الثلاثاء.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثاء", @@ -409,7 +409,7 @@ }, { "Input": "سأعود يوم الثلاثاء. أخبار جيدة.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثاء", @@ -421,7 +421,7 @@ }, { "Input": "سأعود يوم الثلاثاء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثاء", @@ -433,7 +433,7 @@ }, { "Input": "سأعود يوم الجمعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة", @@ -445,7 +445,7 @@ }, { "Input": "سأعود الجمعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة", @@ -457,7 +457,7 @@ }, { "Input": "سأعود هذا اليوم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم", @@ -469,7 +469,7 @@ }, { "Input": "سأعود غداً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "غداً", @@ -481,7 +481,7 @@ }, { "Input": "سأعود بالأمس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأمس", @@ -493,7 +493,7 @@ }, { "Input": "سأعود قبل يوم أمس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "قبل يوم أمس", @@ -505,7 +505,7 @@ }, { "Input": "سأعود بعد غد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد غد", @@ -517,7 +517,7 @@ }, { "Input": "سأعود في اليوم الآتي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم الآتي", @@ -529,7 +529,7 @@ }, { "Input": "سأعود في اليوم التالي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم التالي", @@ -541,7 +541,7 @@ }, { "Input": "سأعود هذا يوم الجمعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا يوم الجمعة", @@ -553,7 +553,7 @@ }, { "Input": "سأعود يوم الأحد القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد القادم", @@ -565,7 +565,7 @@ }, { "Input": "سأعود يوم الأحد الماضي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد الماضي", @@ -577,7 +577,7 @@ }, { "Input": "سأعود في آخر يوم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "آخر يوم", @@ -589,7 +589,7 @@ }, { "Input": "سأعود في اليوم الأخير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم الأخير", @@ -601,7 +601,7 @@ }, { "Input": "سأعود اليوم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم", @@ -613,7 +613,7 @@ }, { "Input": "سأعود هذا الأسبوع الجمعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا الأسبوع الجمعة", @@ -625,7 +625,7 @@ }, { "Input": "سأعود الأسبوع القادم الأحد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع القادم الأحد", @@ -637,7 +637,7 @@ }, { "Input": "سأعود الأسبوع الماضي الأحد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الماضي الأحد", @@ -649,7 +649,7 @@ }, { "Input": "سأعود 15 يونيو 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "15 يونيو 2016", @@ -661,7 +661,7 @@ }, { "Input": "البيسبول على مايو الحادي عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مايو الحادي عشر", @@ -673,7 +673,7 @@ }, { "Input": "سأرجع الرابع من مايو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الرابع من مايو", @@ -685,7 +685,7 @@ }, { "Input": "سأرجع في الرابع من مارس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الرابع من مارس", @@ -697,7 +697,7 @@ }, { "Input": "سأعود يناير الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يناير الأول", @@ -709,7 +709,7 @@ }, { "Input": "سأعود في الحادي والعشرين من مايو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادي والعشرين من مايو", @@ -721,7 +721,7 @@ }, { "Input": "سأعود مايو الحادي والعشرين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مايو الحادي والعشرين", @@ -733,7 +733,7 @@ }, { "Input": "سأعود الثاني من أغسطس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثاني من أغسطس", @@ -745,7 +745,7 @@ }, { "Input": "سأعود الثاني والعشرين من يونيو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثاني والعشرين من يونيو", @@ -757,7 +757,7 @@ }, { "Input": "لقد عدت قبل شهرين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "قبل شهرين", @@ -781,7 +781,7 @@ }, { "Input": "من الذي راسلته عبر البريد الإلكتروني قبل شهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "قبل شهر", @@ -793,43 +793,43 @@ }, { "Input": "عدت إلى 27", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "إلى 27", - "Start": 4, - "Length": 6, + "Text": " 27", + "Start": 7, + "Length": 3, "Type": "date" } ] }, { "Input": "عدت في يوم 27", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "يوم 27", - "Start": 8, - "Length": 6, + "Text": " 27", + "Start":11, + "Length": 3, "Type": "date" } ] }, { "Input": "عدت إلى 27.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "إلى 27", - "Start": 4, - "Length": 6, + "Text": " 27", + "Start": 7, + "Length": 3, "Type": "date" } ] }, { "Input": "عدت في 27!", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "27", @@ -841,7 +841,7 @@ }, { "Input": "عدت في 27.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "27", @@ -853,7 +853,7 @@ }, { "Input": "عدت إلى الحادي والعشرين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "إلى الحادي والعشرين", @@ -865,7 +865,7 @@ }, { "Input": "عدت للثانية والعشرين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "للثانية والعشرين", @@ -877,7 +877,7 @@ }, { "Input": "عدت للثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "للثاني", @@ -889,7 +889,7 @@ }, { "Input": "عدت للثاني والعشرين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "للثاني والعشرين", @@ -901,7 +901,7 @@ }, { "Input": "عدت للحادية والثلاثين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "للحادية والثلاثين", @@ -913,31 +913,31 @@ }, { "Input": "عدت يوم 27", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "يوم 27", - "Start": 4, - "Length": 6, + "Text": " 27", + "Start": 7, + "Length": 3, "Type": "date" } ] }, { "Input": "عدت يوم 21", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "يوم 21", - "Start": 4, - "Length": 6, + "Text": " 21", + "Start": 7, + "Length": 3, "Type": "date" } ] }, { "Input": "عدت في 22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "22", @@ -949,7 +949,7 @@ }, { "Input": "عدت في الثاني!", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثاني", @@ -961,7 +961,7 @@ }, { "Input": "عدت في الثاني والعشرين!", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثاني والعشرين", @@ -973,22 +973,22 @@ }, { "Input": "الجائزة الأولى", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "سأذهب إلى الطابق الـ27", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "فعاليات تذكارية بمناسبة الذكرى الخامسة والعشرين للعلاقات الدبلوماسية بين سنغافورة والصين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "الحصول على تذاكر لتجربة الباب السابع عشر المسكونة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -996,7 +996,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السبت الثاني", @@ -1011,7 +1011,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأربعاء 27", @@ -1026,7 +1026,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الخميس في 21", @@ -1041,7 +1041,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة في 22", @@ -1056,7 +1056,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السبت في 23", @@ -1071,7 +1071,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة 15", @@ -1086,7 +1086,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الخميس في الحادية والعشرين", @@ -1101,7 +1101,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة في الثانية والعشرين", @@ -1116,7 +1116,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة في الخمسة عشر", @@ -1131,7 +1131,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الخميس في السابع", @@ -1143,7 +1143,7 @@ }, { "Input": "سأعود يوم الأحد الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد الثاني", @@ -1155,7 +1155,7 @@ }, { "Input": "سأعود يوم الأحد الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد الأول", @@ -1167,7 +1167,7 @@ }, { "Input": "سأعود الثلاثاء الثالث", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثاء الثالث", @@ -1179,7 +1179,7 @@ }, { "Input": "سأعود يوم الأحد الخامس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد الخامس", @@ -1191,7 +1191,7 @@ }, { "Input": "سأعود يوم الأحد السادس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد", @@ -1203,7 +1203,7 @@ }, { "Input": "سأعود يوم الاثنين العاشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الاثنين", @@ -1215,7 +1215,7 @@ }, { "Input": "سأعود في 20 من الشهر القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20 من الشهر القادم", @@ -1227,7 +1227,7 @@ }, { "Input": "سأعود في 31 من هذا الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "31 من هذا الشهر", @@ -1239,12 +1239,12 @@ }, { "Input": "قد تحاول كورتانا ترتيب مكالمة سكايب إما يوم الجمعة هذا الأسبوع أو الثلاثاء من الأسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "الجمعة هذا الأسبوع", - "Start": 44, - "Length": 18, + "Text": "يوم الجمعة هذا الأسبوع ", + "Start": 40, + "Length": 23, "Type": "date" }, { @@ -1257,12 +1257,12 @@ }, { "Input": "قد تحاول كورتانا ترتيب مكالمة سكايب إما يوم الجمعة من هذا الأسبوع أو هذا الأسبوع يوم السبت", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "الجمعة من هذا الأسبوع", - "Start": 44, - "Length": 21, + "Text": "يوم الجمعة من هذا الأسبوع ", + "Start": 40, + "Length": 26, "Type": "date" }, { @@ -1275,7 +1275,7 @@ }, { "Input": " 2016. نوفمبر .16", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2016. نوفمبر .16", @@ -1287,7 +1287,7 @@ }, { "Input": "كان لدينا اجتماع 1 شهر و 21 يوم من الآن", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1 شهر و 21 يوم من الآن", @@ -1299,7 +1299,7 @@ }, { "Input": "غادرت هنا 2 عام و شهر و 21 يوم من الآن", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 عام و شهر و 21 يوم من الآن", @@ -1311,7 +1311,7 @@ }, { "Input": "سأعيش هنا 2 عام و 21 يوم من الآن", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 عام و 21 يوم من الآن", @@ -1323,7 +1323,7 @@ }, { "Input": "غادرت هنا 2 سنة 1 شهر 21 يوم من الآن", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 سنة 1 شهر 21 يوم من الآن", @@ -1335,7 +1335,7 @@ }, { "Input": "غادرت هنا في العشرين من الشهر المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العشرين من الشهر المقبل", @@ -1347,7 +1347,7 @@ }, { "Input": "غادرت هنا في 5 ديسمبر 1391", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "5 ديسمبر 1391", @@ -1383,7 +1383,7 @@ }, { "Input": "في سبتمبر الحادي والعشرين من ألف وتسعمائة وثمانية وسبعون", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبتمبر الحادي والعشرين من ألف وتسعمائة وثمانية وسبعون", @@ -1395,7 +1395,7 @@ }, { "Input": "في سبتمبر 10, ألف وتسعمائة وواحد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبتمبر 10, ألف وتسعمائة وواحد", @@ -1407,7 +1407,7 @@ }, { "Input": "في العاشر من سبتمبر ، ألفين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العاشر من سبتمبر ، ألفين", @@ -1434,5 +1434,65 @@ "Type": "date" } ] + }, + { + "Input": "هذا الأربعاء", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "هذا الأربعاء", + "Start": 0, + "Length": 12, + "Type": "date" + } + ] + }, + { + "Input": "سأستقل الحافلة في الرابع من فبراير 2013", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الرابع من فبراير 2013", + "Start": 18, + "Length": 21, + "Type": "date" + } + ] + }, + { + "Input": "كنت أرغب في الحصول على المعجنات في التاسع من أكتوبر 2021", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "التاسع من أكتوبر 2021", + "Start": 35, + "Length": 21, + "Type": "date" + } + ] + }, + { + "Input": "في الثالث عشر من مارس 2012 حدث شيء ما", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثالث عشر من مارس 2012", + "Start": 3, + "Length": 23, + "Type": "date" + } + ] + }, + { + "Input": "بدأت حياتي في الحادي والثلاثين من يناير عام 1934", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الحادي والثلاثين من يناير عام 1934", + "Start": 14, + "Length": 34, + "Type": "date" + } + ] } -] \ No newline at end of file +] diff --git a/Specs/DateTime/Arabic/DateParser.json b/Specs/DateTime/Arabic/DateParser.json index 31354419ed..583733a516 100644 --- a/Specs/DateTime/Arabic/DateParser.json +++ b/Specs/DateTime/Arabic/DateParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "15", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 أكتوبر", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 يناير 2016", @@ -148,12 +148,12 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "الاثنين 12 يناير 2016", - "Start": 10, - "Length": 21, + "Text": "يوم الاثنين 12 يناير 2016", + "Start": 6, + "Length": 25, "Type": "date", "Value": { "Timex": "2016-01-12", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2016/02/22", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2016/04/21", @@ -245,7 +245,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "21-04-2016", @@ -269,7 +269,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4.22", @@ -293,7 +293,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "22-4", @@ -317,7 +317,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4.22", @@ -341,7 +341,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "22-4", @@ -365,7 +365,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4/22", @@ -389,7 +389,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "04/22", @@ -413,7 +413,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4/22", @@ -437,7 +437,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "22/04", @@ -461,7 +461,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2015/08/12", @@ -485,7 +485,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "08/12, 2015", @@ -509,7 +509,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "08/12, 15", @@ -533,7 +533,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1 يناير", @@ -557,7 +557,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يناير-1", @@ -581,7 +581,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأربعاء , 22 يناير", @@ -780,7 +780,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم", @@ -805,7 +805,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "غداً", @@ -830,7 +830,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأمس", @@ -977,10 +977,9 @@ { "Input": "سأعود هذا يوم الجمعة", "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" + "ReferenceDateTime": "2024-01-17T00:00:00" }, - "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا يوم الجمعة", @@ -988,12 +987,12 @@ "Length": 14, "Type": "date", "Value": { - "Timex": "2016-11-11", + "Timex": "2024-01-26", "FutureResolution": { - "date": "2016-11-11" + "date": "2024-01-26" }, "PastResolution": { - "date": "2016-11-11" + "date": "2024-01-26" } } } @@ -1004,7 +1003,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد القادم", @@ -1028,7 +1027,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد الماضي", @@ -1077,7 +1076,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع القادم الأحد", @@ -1101,7 +1100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الماضي الأحد", @@ -1175,7 +1174,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم", @@ -1199,7 +1198,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "15 يونيو 2016", @@ -1273,7 +1272,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع المقبل يوم الجمعة", @@ -1322,7 +1321,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يومي", @@ -1346,7 +1345,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم", @@ -1495,11 +1494,10 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "إلى 27", + "Text": " 27", "Start": 4, "Length": 6, "Type": "date", @@ -1509,7 +1507,7 @@ "date": "2016-11-27" }, "PastResolution": { - "date": "2016-11-27" + "date": "2016-10-27" } } } @@ -1520,11 +1518,10 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "يوم 27", + "Text": " 27", "Start": 4, "Length": 6, "Type": "date", @@ -1534,7 +1531,7 @@ "date": "2016-11-27" }, "PastResolution": { - "date": "2016-11-27" + "date": "2016-10-27" } } } @@ -1920,7 +1917,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8200463+08:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد الثاني", @@ -1944,7 +1941,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8200463+08:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد الأول", @@ -1968,7 +1965,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8210454+08:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثاء الثالث", @@ -1992,7 +1989,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8225493+08:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأحد الخامس", @@ -2065,7 +2062,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 يناير 2018", @@ -2089,7 +2086,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "18-9-15", @@ -2163,7 +2160,7 @@ "Context": { "ReferenceDateTime": "2016-11-14T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "16. نوفمبر. 2016", @@ -2362,7 +2359,7 @@ "Context": { "ReferenceDateTime": "2017-12-18T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "5 ديسمبر 1391", @@ -2483,7 +2480,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العاشر من سبتمبر ، ألفين", @@ -2501,5 +2498,418 @@ } } ] + }, + { + "Input": "12/05/2021", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "12/05/2021", + "Start": 0, + "Length": 10, + "Type": "date", + "Value": { + "Timex": "2021-05-12", + "FutureResolution": { + "date": "2021-05-12" + }, + "PastResolution": { + "date": "2021-05-12" + } + } + } + ] + }, + { + "Input": "11/03/2009", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "11/03/2009", + "Start": 0, + "Length": 10, + "Type": "date", + "Value": { + "Timex": "2009-03-11", + "FutureResolution": { + "date": "2009-03-11" + }, + "PastResolution": { + "date": "2009-03-11" + } + } + } + ] + }, + { + "Input": "عدت يوم 27/3", + "Context": { + "ReferenceDateTime": "2016-04-07T00:00:00" + }, + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "27/3", + "Start": 8, + "Length": 4, + "Type": "date", + "Value": { + "Timex": "XXXX-03-27", + "FutureResolution": { + "date": "2017-03-27" + }, + "PastResolution": { + "date": "2016-03-27" + } + } + } + ] + }, + { + "Input": "هذا الأربعاء", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "هذا الأربعاء", + "Start": 0, + "Length": 2, + "Type": "date", + "Value": { + "Timex": "2016-11-09", + "FutureResolution": { + "date": "2016-11-09" + } + } + } + ] + }, + { + "Input": "سأستقل الحافلة في الرابع من فبراير 2013", + "Context": { + "ReferenceDateTime": "2024-01-01T00:00:00" + }, + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الرابع من فبراير 2013", + "Start": 18, + "Length": 21, + "Type": "date", + "Value": { + "Timex": "2013-02-04", + "FutureResolution": { + "date": "2013-02-04" + }, + "PastResolution": { + "date": "2013-02-04" + } + } + } + ] + }, + { + "Input": "كنت أرغب في الحصول على المعجنات في التاسع من أكتوبر 2021", + "Context": { + "ReferenceDateTime": "2023-01-01T00:00:00" + }, + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "التاسع من أكتوبر 2021", + "Start": 35, + "Length": 21, + "Type": "date", + "Value": { + "Timex": "2021-10-09", + "FutureResolution": { + "date": "2021-10-09" + }, + "PastResolution": { + "date": "2021-10-09" + } + } + } + ] + }, + { + "Input": "في الثالث عشر من مارس 2012 حدث شيء ما", + "Context": { + "ReferenceDateTime": "2023-01-01T00:00:00" + }, + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثالث عشر من مارس 2012", + "Start": 3, + "Length": 23, + "Type": "date", + "Value": { + "Timex": "2012-03-13", + "FutureResolution": { + "date": "2012-03-13" + }, + "PastResolution": { + "date": "2012-03-13" + } + } + } + ] + }, + { + "Input": "بدأت حياتي في الحادي والثلاثين من يناير عام 1934", + "Context": { + "ReferenceDateTime": "2023-01-01T00:00:00" + }, + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الحادي والثلاثين من يناير عام 1934", + "Start": 14, + "Length": 34, + "Type": "date", + "Value": { + "Timex": "1934-01-31", + "FutureResolution": { + "date": "1934-01-31" + }, + "PastResolution": { + "date": "1934-01-31" + } + } + } + ] + }, + { + "Input": "سأعود بعد يوم", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد يوم", + "Start": 6, + "Length": 6, + "Type": "date", + "Value": { + "Timex": "2016-11-08", + "FutureResolution": { + "date": "2016-11-08" + }, + "PastResolution": { + "date": "2016-11-08" + } + } + } + ] + }, + { + "Input": "سأعود بعد يومين", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد يومين", + "Start": 6, + "Length": 8, + "Type": "date", + "Value": { + "Timex": "2016-11-09", + "FutureResolution": { + "date": "2016-11-09" + }, + "PastResolution": { + "date": "2016-11-09" + } + } + } + ] + }, + { + "Input": "سأعود بعد يومان", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد يومان", + "Start": 6, + "Length": 8, + "Type": "date", + "Value": { + "Timex": "2016-11-09", + "FutureResolution": { + "date": "2016-11-09" + }, + "PastResolution": { + "date": "2016-11-09" + } + } + } + ] + }, + { + "Input": "سأعود بعد ثلاثة أيام", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد ثلاثة أيام", + "Start": 6, + "Length": 13, + "Type": "date", + "Value": { + "Timex": "2016-11-10", + "FutureResolution": { + "date": "2016-11-10" + }, + "PastResolution": { + "date": "2016-11-10" + } + } + } + ] + }, + { + "Input": "سأعود بعد أربعة أيام", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد أربعة أيام", + "Start": 6, + "Length": 13, + "Type": "date", + "Value": { + "Timex": "2016-11-11", + "FutureResolution": { + "date": "2016-11-11" + }, + "PastResolution": { + "date": "2016-11-11" + } + } + } + ] + }, + { + "Input": "سأعود بعد خمسة أيام", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد خمسة أيام", + "Start": 6, + "Length": 12, + "Type": "date", + "Value": { + "Timex": "2016-11-12", + "FutureResolution": { + "date": "2016-11-12" + }, + "PastResolution": { + "date": "2016-11-12" + } + } + } + ] + }, + { + "Input": "سأعود بعد ستة أيام", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد ستة أيام", + "Start": 6, + "Length": 11, + "Type": "date", + "Value": { + "Timex": "2016-11-13", + "FutureResolution": { + "date": "2016-11-13" + }, + "PastResolution": { + "date": "2016-11-13" + } + } + } + ] + }, + { + "Input": "سأعود بعد سبعة أيام", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد سبعة أيام", + "Start": 6, + "Length": 12, + "Type": "date", + "Value": { + "Timex": "2016-11-14", + "FutureResolution": { + "date": "2016-11-14" + }, + "PastResolution": { + "date": "2016-11-14" + } + } + } + ] + }, + { + "Input": "سأعود بعد أسبوع", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد أسبوع", + "Start": 6, + "Length": 8, + "Type": "date", + "Value": { + "Timex": "2016-11-14", + "FutureResolution": { + "date": "2016-11-14" + }, + "PastResolution": { + "date": "2016-11-14" + } + } + } + ] + }, + { + "Input": "سأعود بعد اسبوع", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "بعد اسبوع", + "Start": 6, + "Length": 8, + "Type": "date", + "Value": { + "Timex": "2016-11-14", + "FutureResolution": { + "date": "2016-11-14" + }, + "PastResolution": { + "date": "2016-11-14" + } + } + } + ] } -] \ No newline at end of file + ] \ No newline at end of file diff --git a/Specs/DateTime/Arabic/DatePeriodExtractor.json b/Specs/DateTime/Arabic/DatePeriodExtractor.json index 57735628a0..8dcafa6709 100644 --- a/Specs/DateTime/Arabic/DatePeriodExtractor.json +++ b/Specs/DateTime/Arabic/DatePeriodExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "سأخرج في يناير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يناير", @@ -13,7 +13,7 @@ }, { "Input": "سأخرج هذا يناير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا يناير", @@ -25,7 +25,7 @@ }, { "Input": "سأخرج شهر يناير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر يناير", @@ -37,7 +37,7 @@ }, { "Input": "سأخرج في شهر يناير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر يناير", @@ -49,7 +49,7 @@ }, { "Input": "لقد فاتني يناير 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يناير 2001", @@ -61,7 +61,7 @@ }, { "Input": "لقد فاتني يناير, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يناير, 2001", @@ -73,7 +73,7 @@ }, { "Input": "سأخرج في فبراير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "فبراير", @@ -85,7 +85,7 @@ }, { "Input": "سأخرج هذا فبراير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا فبراير", @@ -97,7 +97,7 @@ }, { "Input": "سأخرج شهر فبراير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر فبراير", @@ -109,7 +109,7 @@ }, { "Input": "سأخرج في شهر فبراير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر فبراير", @@ -121,7 +121,7 @@ }, { "Input": "لقد فاتني فبراير 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "فبراير 2001", @@ -133,7 +133,7 @@ }, { "Input": "لقد فاتني فبراير, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "فبراير, 2001", @@ -145,7 +145,7 @@ }, { "Input": "سأخرج في مارس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مارس", @@ -157,7 +157,7 @@ }, { "Input": "سأخرج هذا مارس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا مارس", @@ -169,7 +169,7 @@ }, { "Input": "سأخرج شهر مارس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر مارس", @@ -181,7 +181,7 @@ }, { "Input": "سأخرج في شهر مارس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر مارس", @@ -193,7 +193,7 @@ }, { "Input": "لقد فاتني مارس 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مارس 2001", @@ -205,7 +205,7 @@ }, { "Input": "لقد فاتني مارس, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مارس, 2001", @@ -217,7 +217,7 @@ }, { "Input": "سأخرج في أبريل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أبريل", @@ -229,7 +229,7 @@ }, { "Input": "سأخرج هذا أبريل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا أبريل", @@ -241,7 +241,7 @@ }, { "Input": "سأخرج شهر أبريل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أبريل", @@ -253,7 +253,7 @@ }, { "Input": "سأخرج في شهر أبريل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أبريل", @@ -265,7 +265,7 @@ }, { "Input": "لقد فاتني أبريل 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أبريل 2001", @@ -277,7 +277,7 @@ }, { "Input": "لقد فاتني أبريل, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أبريل, 2001", @@ -289,7 +289,7 @@ }, { "Input": "سأخرج في مايو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مايو", @@ -301,7 +301,7 @@ }, { "Input": "سأخرج هذا مايو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا مايو", @@ -313,7 +313,7 @@ }, { "Input": "سأخرج شهر مايو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر مايو", @@ -325,7 +325,7 @@ }, { "Input": "سأخرج في شهر مايو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر مايو", @@ -337,7 +337,7 @@ }, { "Input": "لقد فاتني مايو 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مايو 2001", @@ -349,7 +349,7 @@ }, { "Input": "لقد فاتني مايو, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مايو, 2001", @@ -361,7 +361,7 @@ }, { "Input": "سأخرج في يونيو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو", @@ -373,7 +373,7 @@ }, { "Input": "سأخرج هذا يونيو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا يونيو", @@ -385,7 +385,7 @@ }, { "Input": "سأخرج شهر يونيو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر يونيو", @@ -397,7 +397,7 @@ }, { "Input": "سأخرج في شهر يونيو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر يونيو", @@ -409,7 +409,7 @@ }, { "Input": "لقد فاتني يونيو 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو 2001", @@ -421,7 +421,7 @@ }, { "Input": "لقد فاتني يونيو, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو, 2001", @@ -433,7 +433,7 @@ }, { "Input": "سأخرج في يوليو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يوليو", @@ -445,7 +445,7 @@ }, { "Input": "سأخرج هذا يوليو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا يوليو", @@ -457,7 +457,7 @@ }, { "Input": "سأخرج شهر يوليو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر يوليو", @@ -469,7 +469,7 @@ }, { "Input": "سأخرج في شهر يوليو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر يوليو", @@ -481,7 +481,7 @@ }, { "Input": "لقد فاتني يوليو 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يوليو 2001", @@ -493,7 +493,7 @@ }, { "Input": "لقد فاتني يوليو, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يوليو, 2001", @@ -505,7 +505,7 @@ }, { "Input": "سأخرج في أغسطس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أغسطس", @@ -517,7 +517,7 @@ }, { "Input": "سأخرج هذا أغسطس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا أغسطس", @@ -529,7 +529,7 @@ }, { "Input": "سأخرج شهر أغسطس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أغسطس", @@ -541,7 +541,7 @@ }, { "Input": "سأخرج في شهر أغسطس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أغسطس", @@ -553,7 +553,7 @@ }, { "Input": "لقد فاتني أغسطس 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أغسطس 2001", @@ -565,7 +565,7 @@ }, { "Input": "لقد فاتني أغسطس, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أغسطس, 2001", @@ -577,7 +577,7 @@ }, { "Input": "سأخرج في سبتمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبتمبر", @@ -589,7 +589,7 @@ }, { "Input": "سأخرج هذا سبتمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا سبتمبر", @@ -601,7 +601,7 @@ }, { "Input": "سأخرج شهر سبتمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر سبتمبر", @@ -613,7 +613,7 @@ }, { "Input": "سأخرج في شهر سبتمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر سبتمبر", @@ -625,7 +625,7 @@ }, { "Input": "لقد فاتني سبتمبر 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبتمبر 2001", @@ -637,7 +637,7 @@ }, { "Input": "لقد فاتني سبتمبر, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبتمبر, 2001", @@ -649,7 +649,7 @@ }, { "Input": "سأخرج في أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أكتوبر", @@ -661,7 +661,7 @@ }, { "Input": "سأخرج هذا أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا أكتوبر", @@ -673,7 +673,7 @@ }, { "Input": "سأخرج شهر أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أكتوبر", @@ -685,7 +685,7 @@ }, { "Input": "سأخرج في شهر أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أكتوبر", @@ -697,7 +697,7 @@ }, { "Input": "لقد فاتني أكتوبر 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أكتوبر 2001", @@ -709,7 +709,7 @@ }, { "Input": "لقد فاتني أكتوبر, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أكتوبر, 2001", @@ -721,7 +721,7 @@ }, { "Input": "سأخرج في نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نوفمبر", @@ -733,7 +733,7 @@ }, { "Input": "سأخرج هذا نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا نوفمبر", @@ -745,7 +745,7 @@ }, { "Input": "سأخرج شهر نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر نوفمبر", @@ -757,7 +757,7 @@ }, { "Input": "سأخرج في شهر نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر نوفمبر", @@ -769,7 +769,7 @@ }, { "Input": "لقد فاتني نوفمبر 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نوفمبر 2001", @@ -781,7 +781,7 @@ }, { "Input": "لقد فاتني نوفمبر, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نوفمبر, 2001", @@ -793,7 +793,7 @@ }, { "Input": "سأخرج في ديسمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ديسمبر", @@ -805,7 +805,7 @@ }, { "Input": "سأخرج هذا ديسمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا ديسمبر", @@ -817,7 +817,7 @@ }, { "Input": "سأخرج شهر ديسمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر ديسمبر", @@ -829,7 +829,7 @@ }, { "Input": "سأخرج في شهر ديسمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر ديسمبر", @@ -841,7 +841,7 @@ }, { "Input": "لقد فاتني ديسمبر 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ديسمبر 2001", @@ -853,7 +853,7 @@ }, { "Input": "لقد فاتني ديسمبر, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ديسمبر, 2001", @@ -865,7 +865,7 @@ }, { "Input": "سأخرج في كانون الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "كانون الثاني", @@ -877,7 +877,7 @@ }, { "Input": "سأخرج هذا شهر كانون الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا شهر كانون الثاني", @@ -889,7 +889,7 @@ }, { "Input": "سأخرج شهر كانون الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر كانون الثاني", @@ -901,7 +901,7 @@ }, { "Input": "سأخرج في شهر كانون الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر كانون الثاني", @@ -913,7 +913,7 @@ }, { "Input": "لقد فاتني كانون الثاني 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "كانون الثاني 2001", @@ -925,7 +925,7 @@ }, { "Input": "لقد فاتني كانون الثاني, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "كانون الثاني, 2001", @@ -937,7 +937,7 @@ }, { "Input": "سأخرج في شباط", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شباط", @@ -949,7 +949,7 @@ }, { "Input": "سأخرج هذا شباط", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا شباط", @@ -961,7 +961,7 @@ }, { "Input": "سأخرج شهر شباط", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر شباط", @@ -973,7 +973,7 @@ }, { "Input": "سأخرج في شهر شباط", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر شباط", @@ -985,7 +985,7 @@ }, { "Input": "لقد فاتني شباط 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شباط 2001", @@ -997,7 +997,7 @@ }, { "Input": "لقد فاتني شباط, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شباط, 2001", @@ -1009,7 +1009,7 @@ }, { "Input": "سأخرج في آذار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "آذار", @@ -1021,7 +1021,7 @@ }, { "Input": "سأخرج هذا شهر آذار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا شهر آذار", @@ -1033,7 +1033,7 @@ }, { "Input": "سأخرج شهر آذار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر آذار", @@ -1045,7 +1045,7 @@ }, { "Input": "سأخرج في شهر آذار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر آذار", @@ -1057,7 +1057,7 @@ }, { "Input": "لقد فاتني آذار 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "آذار 2001", @@ -1069,7 +1069,7 @@ }, { "Input": "لقد فاتني آذار, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "آذار, 2001", @@ -1081,7 +1081,7 @@ }, { "Input": "سأخرج في نيسان", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نيسان", @@ -1093,7 +1093,7 @@ }, { "Input": "سأخرج هذا نيسان ", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا نيسان", @@ -1105,7 +1105,7 @@ }, { "Input": "سأخرج شهر نيسان", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر نيسان", @@ -1117,7 +1117,7 @@ }, { "Input": "سأخرج في شهر نيسان", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر نيسان", @@ -1129,7 +1129,7 @@ }, { "Input": "لقد فاتني نيسان 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نيسان 2001", @@ -1141,7 +1141,7 @@ }, { "Input": "لقد فاتني نيسان, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نيسان, 2001", @@ -1153,7 +1153,7 @@ }, { "Input": "سأخرج في حزيران", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "حزيران", @@ -1165,7 +1165,7 @@ }, { "Input": "سأخرج هذا حزيران", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا حزيران", @@ -1177,7 +1177,7 @@ }, { "Input": "سأخرج شهر حزيران", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر حزيران", @@ -1189,7 +1189,7 @@ }, { "Input": "سأخرج في شهر حزيران", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر حزيران", @@ -1201,7 +1201,7 @@ }, { "Input": "لقد فاتني حزيران 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "حزيران 2001", @@ -1213,7 +1213,7 @@ }, { "Input": "لقد فاتني حزيران, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "حزيران, 2001", @@ -1225,7 +1225,7 @@ }, { "Input": "سأخرج في تموز", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تموز", @@ -1237,7 +1237,7 @@ }, { "Input": "سأخرج هذا تموز", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا تموز", @@ -1249,7 +1249,7 @@ }, { "Input": "سأخرج شهر تموز", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر تموز", @@ -1261,7 +1261,7 @@ }, { "Input": "سأخرج في شهر تموز", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر تموز", @@ -1273,7 +1273,7 @@ }, { "Input": "لقد فاتني تموز 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تموز 2001", @@ -1285,7 +1285,7 @@ }, { "Input": "لقد فاتني تموز, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تموز, 2001", @@ -1297,7 +1297,7 @@ }, { "Input": "سأخرج في آب", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "آب", @@ -1309,7 +1309,7 @@ }, { "Input": "سأخرج هذا آب", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا آب", @@ -1321,7 +1321,7 @@ }, { "Input": "سأخرج شهر آب", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر آب", @@ -1333,7 +1333,7 @@ }, { "Input": "سأخرج في شهر آب", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر آب", @@ -1345,7 +1345,7 @@ }, { "Input": "لقد فاتني آب 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "آب 2001", @@ -1357,7 +1357,7 @@ }, { "Input": "لقد فاتني آب, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "آب, 2001", @@ -1369,7 +1369,7 @@ }, { "Input": "سأخرج في أيلول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أيلول", @@ -1381,7 +1381,7 @@ }, { "Input": "سأخرج هذا أيلول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا أيلول", @@ -1393,7 +1393,7 @@ }, { "Input": "سأخرج شهر أيلول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أيلول", @@ -1405,7 +1405,7 @@ }, { "Input": "سأخرج في شهر أيلول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أيلول", @@ -1417,7 +1417,7 @@ }, { "Input": "لقد فاتني أيلول 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أيلول 2001", @@ -1429,7 +1429,7 @@ }, { "Input": "لقد فاتني أيلول, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أيلول, 2001", @@ -1441,7 +1441,7 @@ }, { "Input": "سأخرج في تشرين الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تشرين الأول", @@ -1453,7 +1453,7 @@ }, { "Input": "سأخرج هذا تشرين الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا تشرين الأول", @@ -1465,7 +1465,7 @@ }, { "Input": "سأخرج شهر تشرين الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر تشرين الأول", @@ -1477,7 +1477,7 @@ }, { "Input": "سأخرج في شهر تشرين الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر تشرين الأول", @@ -1489,7 +1489,7 @@ }, { "Input": "لقد فاتني تشرين الأول 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تشرين الأول 2001", @@ -1501,7 +1501,7 @@ }, { "Input": "لقد فاتني تشرين الأول, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تشرين الأول, 2001", @@ -1513,7 +1513,7 @@ }, { "Input": "سأخرج في تشرين الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تشرين الثاني", @@ -1525,7 +1525,7 @@ }, { "Input": "سأخرج هذا تشرين الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا تشرين الثاني", @@ -1537,7 +1537,7 @@ }, { "Input": "سأخرج شهر تشرين الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر تشرين الثاني", @@ -1549,7 +1549,7 @@ }, { "Input": "سأخرج في شهر تشرين الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر تشرين الثاني", @@ -1561,7 +1561,7 @@ }, { "Input": "لقد فاتني تشرين الثاني 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تشرين الثاني 2001", @@ -1573,7 +1573,7 @@ }, { "Input": "لقد فاتني تشرين الثاني, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تشرين الثاني, 2001", @@ -1585,7 +1585,7 @@ }, { "Input": "سأخرج في كانون الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "كانون الأول", @@ -1597,7 +1597,7 @@ }, { "Input": "سأخرج هذا كانون الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا كانون الأول", @@ -1609,7 +1609,7 @@ }, { "Input": "سأخرج شهر كانون الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر كانون الأول", @@ -1621,7 +1621,7 @@ }, { "Input": "سأخرج في شهر كانون الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر كانون الأول", @@ -1633,7 +1633,7 @@ }, { "Input": "لقد فاتني كانون الأول 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "كانون الأول 2001", @@ -1645,7 +1645,7 @@ }, { "Input": "لقد فاتني كانون الأول, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "كانون الأول, 2001", @@ -1657,7 +1657,7 @@ }, { "Input": "تقويم شهر سبتمبر.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر سبتمبر", @@ -1669,7 +1669,7 @@ }, { "Input": "سأخرج من 4 إلى 22 هذا الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4 إلى 22 هذا الشهر", @@ -1681,7 +1681,7 @@ }, { "Input": "سأخرج من 4 إلى 23 في الشهر المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4 إلى 23 في الشهر المقبل", @@ -1693,7 +1693,7 @@ }, { "Input": "سأخرج من 3 حتى 12 سبتمبر هاهاها", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 3 حتى 12 سبتمبر", @@ -1705,7 +1705,7 @@ }, { "Input": "سأخرج من 4 إلى 23 الشهر المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4 إلى 23 الشهر المقبل", @@ -1717,7 +1717,7 @@ }, { "Input": "سأكون خارج 4 حتى 23 من هذا الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4 حتى 23 من هذا الشهر", @@ -1729,7 +1729,7 @@ }, { "Input": "سأخرج ما بين 4 و 22 هذا الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 4 و 22 هذا الشهر", @@ -1741,7 +1741,7 @@ }, { "Input": "سأخرج بين 3 و 12 سبتمبر هاهاها", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 3 و 12 سبتمبر", @@ -1753,7 +1753,7 @@ }, { "Input": "سأخرج بين 4 سبتمبر و 8 سبتمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 4 سبتمبر و 8 سبتمبر", @@ -1765,7 +1765,7 @@ }, { "Input": "سأخرج بين 15 و 19 نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 15 و 19 نوفمبر", @@ -1777,7 +1777,7 @@ }, { "Input": "سأخرج بين 15 و 19 تشرين الثاني ", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 15 و 19 تشرين الثاني", @@ -1789,7 +1789,7 @@ }, { "Input": "سأخرج بين الخامس عشر والتاسع عشر من نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين الخامس عشر والتاسع عشر من نوفمبر", @@ -1801,7 +1801,7 @@ }, { "Input": "سأخرج من 4 إلى 22 يناير 2017", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4 إلى 22 يناير 2017", @@ -1813,7 +1813,7 @@ }, { "Input": "سأخرج في الفترة ما بين 4-22 يناير 2017", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 4-22 يناير 2017", @@ -1825,7 +1825,7 @@ }, { "Input": "سأخرج في هذا الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا الأسبوع", @@ -1837,7 +1837,7 @@ }, { "Input": "سأخرج الأسبوع القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع القادم", @@ -1849,7 +1849,7 @@ }, { "Input": "سأخرج سبتمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبتمبر", @@ -1861,7 +1861,7 @@ }, { "Input": "سأخرج في سبتمبر الماضي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبتمبر الماضي", @@ -1873,7 +1873,7 @@ }, { "Input": "سأخرج في يونيو القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو القادم", @@ -1885,7 +1885,7 @@ }, { "Input": "سأخرج في يونيو 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو 2016", @@ -1897,7 +1897,7 @@ }, { "Input": "سأخرج يونيو العام المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو العام المقبل", @@ -1909,7 +1909,7 @@ }, { "Input": "سأخرج في عطلة نهاية الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عطلة نهاية الأسبوع", @@ -1921,7 +1921,7 @@ }, { "Input": "سأخرج الأسبوع الثالث من هذا الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الثالث من هذا الشهر", @@ -1933,7 +1933,7 @@ }, { "Input": "سأخرج الأسبوع الأخير من شهر يوليو", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الأخير من شهر يوليو", @@ -1945,7 +1945,7 @@ }, { "Input": "جدولة التخييم ليوم الجمعة حتى الأحد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة حتى الأحد", @@ -1969,7 +1969,7 @@ }, { "Input": "سأخرج في الأشهر 3 القادمة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الأشهر 3 القادمة", @@ -1981,7 +1981,7 @@ }, { "Input": "سأخرج بعد 3 سنوات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد 3 سنوات", @@ -1993,7 +1993,7 @@ }, { "Input": "سأخرج في 3 سنوات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في 3 سنوات", @@ -2005,7 +2005,7 @@ }, { "Input": "سأخرج بعد 3 أسابيع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد 3 أسابيع", @@ -2017,7 +2017,7 @@ }, { "Input": "سأخرج في 3 أشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في 3 أشهر", @@ -2029,7 +2029,7 @@ }, { "Input": "سأخرج في 3 أسابيع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في 3 أسابيع", @@ -2041,7 +2041,7 @@ }, { "Input": "سأخرج آخر 3 سنوات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "آخر 3 سنوات", @@ -2053,7 +2053,7 @@ }, { "Input": "سأخرج العام الماضي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العام الماضي", @@ -2065,7 +2065,7 @@ }, { "Input": "سأخرج الشهر الماضي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الشهر الماضي", @@ -2113,7 +2113,7 @@ }, { "Input": "سأخرج 2 أكتوبر إلى 22 أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 أكتوبر إلى 22 أكتوبر", @@ -2125,7 +2125,7 @@ }, { "Input": "سأخرج في 12 يناير, 2016 - 2016/02/22", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 يناير, 2016 - 2016/02/22", @@ -2137,7 +2137,7 @@ }, { "Input": "سأخرج في الأول من يناير حتى الأربعاء ، 22 يناير", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأول من يناير حتى الأربعاء ، 22 يناير", @@ -2149,7 +2149,7 @@ }, { "Input": "سأخرج اليوم حتى الغد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم حتى الغد", @@ -2161,7 +2161,7 @@ }, { "Input": "سأخرج اليوم حتى 22 أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم حتى 22 أكتوبر", @@ -2173,7 +2173,7 @@ }, { "Input": "سأخرج في 2 أكتوبر حتى بعد غد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 أكتوبر حتى بعد غد", @@ -2185,7 +2185,7 @@ }, { "Input": "سأخرج اليوم حتى الأحد المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم حتى الأحد المقبل", @@ -2197,7 +2197,7 @@ }, { "Input": "سأخرج يوم الجمعة حتى الأحد القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة حتى الأحد القادم", @@ -2209,7 +2209,7 @@ }, { "Input": "سأخرج من 2 أكتوبر إلى 22 أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 2 أكتوبر إلى 22 أكتوبر", @@ -2221,7 +2221,7 @@ }, { "Input": "سأخرج من 2015/08/12 حتى 22 أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2015/08/12 حتى 22 أكتوبر", @@ -2233,7 +2233,7 @@ }, { "Input": "سأخرج من يوم الجمعة في الثاني حتى يوم الثلاثاء في السادس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة في الثاني حتى يوم الثلاثاء في السادس", @@ -2245,7 +2245,7 @@ }, { "Input": "سأخرج من اليوم حتى الغد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم حتى الغد", @@ -2257,7 +2257,7 @@ }, { "Input": "سأخرج من يوم الجمعة حتى الأحد القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الجمعة حتى الأحد القادم", @@ -2269,7 +2269,7 @@ }, { "Input": "سأخرج بين 2 أكتوبر و 22 أكتوبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 2 أكتوبر و 22 أكتوبر", @@ -2281,7 +2281,7 @@ }, { "Input": "سأخرج 19-20 نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "19-20 نوفمبر", @@ -2293,7 +2293,7 @@ }, { "Input": "سأخرج من 19 إلى 20 نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 19 إلى 20 نوفمبر", @@ -2305,7 +2305,7 @@ }, { "Input": "سأخرج شهر نوفمبر بين 19 و 20", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر نوفمبر بين 19 و 20", @@ -2317,7 +2317,7 @@ }, { "Input": "سأخرج في الربع الثالث من عام 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الربع الثالث من عام 2016", @@ -2329,7 +2329,7 @@ }, { "Input": "سأخرج في الربع الثالث من هذا العام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الربع الثالث من هذا العام", @@ -2341,7 +2341,7 @@ }, { "Input": "سأخرج 2016 الربع الثالث", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2016 الربع الثالث", @@ -2353,7 +2353,7 @@ }, { "Input": "سأخرج 2015.3", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2015.3", @@ -2365,7 +2365,7 @@ }, { "Input": "سأخرج 3-2015 ", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3-2015", @@ -2377,7 +2377,7 @@ }, { "Input": "سأخرج 2015/3", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2015/3", @@ -2389,7 +2389,7 @@ }, { "Input": "سأخرج 3/2015", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3/2015", @@ -2401,7 +2401,7 @@ }, { "Input": "سأخرج الأسبوع الثالث من عام 2027", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الثالث من عام 2027", @@ -2413,7 +2413,7 @@ }, { "Input": "سأخرج الأسبوع الثالث العام المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الثالث العام المقبل", @@ -2425,7 +2425,7 @@ }, { "Input": "سأرحل هذا الصيف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا الصيف", @@ -2437,7 +2437,7 @@ }, { "Input": "سأرحل الربيع القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الربيع القادم", @@ -2449,7 +2449,7 @@ }, { "Input": "سأرحل الصيف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الصيف", @@ -2461,7 +2461,7 @@ }, { "Input": "سأرحل صيف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "صيف", @@ -2473,7 +2473,7 @@ }, { "Input": "سأرحل صيف 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "صيف 2016", @@ -2485,7 +2485,7 @@ }, { "Input": "سأرحل الصيف 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الصيف 2016", @@ -2497,7 +2497,7 @@ }, { "Input": "عطلات الشهر القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الشهر القادم", @@ -2509,7 +2509,7 @@ }, { "Input": "عطلة الشهر المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الشهر المقبل", @@ -2521,7 +2521,7 @@ }, { "Input": "ماذا لدي أسبوع 30 نوفمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أسبوع 30 نوفمبر", @@ -2533,7 +2533,7 @@ }, { "Input": "الأسبوع في 15 سبتمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع في 15 سبتمبر", @@ -2545,7 +2545,7 @@ }, { "Input": "أسبوع 15 سبتمبر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أسبوع 15 سبتمبر", @@ -2557,7 +2557,7 @@ }, { "Input": "من شهر سبتمبر 15", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من شهر سبتمبر 15", @@ -2569,7 +2569,7 @@ }, { "Input": "سأغادر خلال عطلة نهاية الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عطلة نهاية الأسبوع", @@ -2581,7 +2581,7 @@ }, { "Input": "سأرحل باقي الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "باقي الأسبوع", @@ -2593,7 +2593,7 @@ }, { "Input": "سأرحل بقية أسبوعي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بقية أسبوعي", @@ -2605,7 +2605,7 @@ }, { "Input": "سأرحل بقية الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بقية الأسبوع", @@ -2617,7 +2617,7 @@ }, { "Input": "سأرحل نهاية الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نهاية الأسبوع", @@ -2629,7 +2629,7 @@ }, { "Input": "سأرحل بقية هذا الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بقية هذا الأسبوع", @@ -2641,7 +2641,7 @@ }, { "Input": "سأرحل نهاية الأسبوع الحالي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نهاية الأسبوع الحالي", @@ -2653,7 +2653,7 @@ }, { "Input": "سأرحل بقية الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بقية الشهر", @@ -2665,7 +2665,7 @@ }, { "Input": "سأرحل بقية العام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بقية العام", @@ -2677,7 +2677,7 @@ }, { "Input": "يرجى تحديد موعد لقاءنا في وقت لاحق هذا الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت لاحق هذا الشهر", @@ -2689,7 +2689,7 @@ }, { "Input": "يرجى تحديد موعد لقاءنا في وقت لاحق من هذا الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت لاحق من هذا الأسبوع", @@ -2701,7 +2701,7 @@ }, { "Input": "يرجى تحديد موعد لقاءنا في أواخر الأسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أواخر الأسبوع المقبل", @@ -2713,7 +2713,7 @@ }, { "Input": "من فضلك حدد لنا وقتًا للقاء أواخر العام المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أواخر العام المقبل", @@ -2725,7 +2725,7 @@ }, { "Input": "التقينا أواخر الأسبوع الماضي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أواخر الأسبوع الماضي", @@ -2737,7 +2737,7 @@ }, { "Input": "يرجى تحديد موعد لقاءنا في وقت مبكر من هذا الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "وقت مبكر من هذا الشهر", @@ -2749,7 +2749,7 @@ }, { "Input": "يرجى تحديد موعد لقاءنا وقت مبكر هذا الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "وقت مبكر هذا الأسبوع", @@ -2761,7 +2761,7 @@ }, { "Input": "يرجى تحديد موعد لقاءنا مطلع الاسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مطلع الاسبوع المقبل", @@ -2773,7 +2773,7 @@ }, { "Input": "يرجى تحديد موعد لقاءنا مطلع العام المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مطلع العام المقبل", @@ -2785,7 +2785,7 @@ }, { "Input": "كورتانا ، يرجى تنسيق اجتماع مدته 25 دقيقة مع أنطونيو الأسبوع المقبل بين الأربعاء والجمعة.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع المقبل بين الأربعاء والجمعة", @@ -2797,7 +2797,7 @@ }, { "Input": "كورتانا ، يرجى تنسيق اجتماع مدته 25 دقيقة مع أنطونيو الأسبوع المقبل من الأربعاء إلى الجمعة.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع المقبل من الأربعاء إلى الجمعة", @@ -2809,7 +2809,7 @@ }, { "Input": "كورتانا ، يرجى تنسيق اجتماع مدته 25 دقيقة مع أنطونيو الأسبوع الماضي من الأربعاء إلى الجمعة.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الماضي من الأربعاء إلى الجمعة", @@ -2821,7 +2821,7 @@ }, { "Input": "كورتانا ، يرجى تنسيق اجتماع مدته 25 دقيقة مع أنطونيو هذا الأسبوع بين الأربعاء والجمعة.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا الأسبوع بين الأربعاء والجمعة", @@ -2833,7 +2833,7 @@ }, { "Input": "سأخرج عام 247", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عام 247", @@ -2845,7 +2845,7 @@ }, { "Input": "في السبعينيات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السبعينيات", @@ -2857,7 +2857,7 @@ }, { "Input": "من مواليد ألفين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ألفين", @@ -2869,7 +2869,7 @@ }, { "Input": "في 1970", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1970", @@ -2881,7 +2881,7 @@ }, { "Input": "السبعينيات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السبعينيات", @@ -2893,7 +2893,7 @@ }, { "Input": "سبعينيات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبعينيات", @@ -2905,7 +2905,7 @@ }, { "Input": "في الأربعينيات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأربعينيات", @@ -2917,7 +2917,7 @@ }, { "Input": "من السبعينيات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السبعينيات", @@ -2929,7 +2929,7 @@ }, { "Input": "في السبعينيات القرن التاسع عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السبعينيات القرن التاسع عشر", @@ -2941,7 +2941,7 @@ }, { "Input": "في الألفين والعشرات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الألفين والعشرات", @@ -2953,7 +2953,7 @@ }, { "Input": "في العشرينيات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العشرينيات", @@ -2965,7 +2965,7 @@ }, { "Input": "في الألفين ", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الألفين", @@ -2977,7 +2977,7 @@ }, { "Input": "سأخرج من 2 إلى 7 فبراير ، ألفان وثمانية عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 2 إلى 7 فبراير ، ألفان وثمانية عشر", @@ -2989,7 +2989,7 @@ }, { "Input": "بين 2 و 7 فبراير ألفين وثمانية عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 2 و 7 فبراير ألفين وثمانية عشر", @@ -3001,7 +3001,7 @@ }, { "Input": "سأخرج ما بين 2-7 فبراير ألفين وثمانية عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 2-7 فبراير ألفين وثمانية عشر", @@ -3013,7 +3013,7 @@ }, { "Input": "حدث ذلك في يونيو من عام تسعة عشر تسعة وتسعون", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو من عام تسعة عشر تسعة وتسعون", @@ -3025,7 +3025,7 @@ }, { "Input": "تسعة عشر ثمانية وعشرون", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تسعة عشر ثمانية وعشرون", @@ -3037,7 +3037,7 @@ }, { "Input": "سأخرج الأسبوع الأول من عام ألفين وسبعة وعشرين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الأول من عام ألفين وسبعة وعشرين", @@ -3049,7 +3049,7 @@ }, { "Input": "سأخرج في الربع الأول من عام ألفين وعشرين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الربع الأول من عام ألفين وعشرين", @@ -3061,7 +3061,7 @@ }, { "Input": "في ربيع عام تسعة عشر وثمانية وسبعين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ربيع عام تسعة عشر وثمانية وسبعين", @@ -3073,7 +3073,7 @@ }, { "Input": "عام مائتين وسبعة وستين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عام مائتين وسبعة وستين", @@ -3085,7 +3085,7 @@ }, { "Input": "الاسبوع بعد القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الاسبوع بعد القادم", @@ -3097,7 +3097,7 @@ }, { "Input": "حدث ذلك العقدين الماضيين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العقدين الماضيين", @@ -3109,7 +3109,7 @@ }, { "Input": "حدث ذلك في العقدين الماضيين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العقدين الماضيين", @@ -3121,7 +3121,7 @@ }, { "Input": "حدث ذلك في العقد القادم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العقد القادم", @@ -3133,7 +3133,7 @@ }, { "Input": "سيحدث بعد 4 أسابيع في المستقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد 4 أسابيع في المستقبل", @@ -3145,7 +3145,7 @@ }, { "Input": "سيحدث بعد يومين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد يومين", @@ -3157,7 +3157,7 @@ }, { "Input": "يمكن أن تجدنا كورتانا موعدًا بداية الأسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بداية الأسبوع المقبل", @@ -3169,7 +3169,7 @@ }, { "Input": "بالتأكيد ، لنبدأ سكايب نهاية الأسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نهاية الأسبوع المقبل", @@ -3181,7 +3181,7 @@ }, { "Input": "بالتأكيد ، لنبدأ سكايب بداية الأسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بداية الأسبوع المقبل", @@ -3193,7 +3193,7 @@ }, { "Input": "كورتانا ، تجد لنا الوقت نهاية شهر مارس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نهاية شهر مارس", @@ -3205,7 +3205,7 @@ }, { "Input": "كورتانا ، يرجى تحديد موعد لنا في منتصف الأسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في منتصف الأسبوع المقبل", @@ -3217,7 +3217,7 @@ }, { "Input": "يمكن أن يرتب لنا كورتانا لقاء منتصف مارس", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف مارس", @@ -3229,7 +3229,7 @@ }, { "Input": "ماذا عن منتصف الصيف؟", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف الصيف", @@ -3241,7 +3241,7 @@ }, { "Input": "يمكنني أن أجد لنا موعدًا بداية الأسبوع المقبل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بداية الأسبوع المقبل", @@ -3253,7 +3253,7 @@ }, { "Input": "سأخرج في أيار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أيار", @@ -3265,7 +3265,7 @@ }, { "Input": "سأخرج هذا أيار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "هذا أيار", @@ -3277,7 +3277,7 @@ }, { "Input": "سأخرج شهر أيار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أيار", @@ -3289,7 +3289,7 @@ }, { "Input": "سأخرج في شهر أيار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر أيار", @@ -3301,7 +3301,7 @@ }, { "Input": "لقد فاتني أيار 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أيار 2001", @@ -3313,7 +3313,7 @@ }, { "Input": "لقد فاتني أيار, 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أيار, 2001", @@ -3325,7 +3325,7 @@ }, { "Input": "سأخرج في محرم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "محرم", @@ -3337,7 +3337,7 @@ }, { "Input": "لقد فاتني محرم 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "محرم 2001", @@ -3349,7 +3349,7 @@ }, { "Input": "سأخرج في صفر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "صفر", @@ -3361,7 +3361,7 @@ }, { "Input": "لقد فاتني صفر 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "صفر 2001", @@ -3373,7 +3373,7 @@ }, { "Input": "سأخرج في ربيع الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ربيع الأول", @@ -3385,7 +3385,7 @@ }, { "Input": "لقد فاتني ربيع الأول 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ربيع الأول 2001", @@ -3397,7 +3397,7 @@ }, { "Input": "سأخرج في ربيع الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ربيع الثاني", @@ -3409,7 +3409,7 @@ }, { "Input": "لقد فاتني ربيع الثاني 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ربيع الثاني 2001", @@ -3421,7 +3421,7 @@ }, { "Input": "سأخرج في جمادى الأول", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "جمادى الأول", @@ -3433,7 +3433,7 @@ }, { "Input": "لقد فاتني جمادى الأول 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "جمادى الأول 2001", @@ -3445,7 +3445,7 @@ }, { "Input": "سأخرج في جمادى الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "جمادى الثاني", @@ -3457,7 +3457,7 @@ }, { "Input": "لقد فاتني جمادى الثاني 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "جمادى الثاني 2001", @@ -3469,7 +3469,7 @@ }, { "Input": "سأخرج في رجب", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "رجب", @@ -3481,7 +3481,7 @@ }, { "Input": "لقد فاتني رجب 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "رجب 2001", @@ -3493,7 +3493,7 @@ }, { "Input": "سأخرج في شعبان", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شعبان", @@ -3505,7 +3505,7 @@ }, { "Input": "لقد فاتني شعبان 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شعبان 2001", @@ -3517,7 +3517,7 @@ }, { "Input": "سأخرج في رمضان", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "رمضان", @@ -3529,7 +3529,7 @@ }, { "Input": "لقد فاتني رمضان 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "رمضان 2001", @@ -3541,7 +3541,7 @@ }, { "Input": "سأخرج في شوال", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شوال", @@ -3553,7 +3553,7 @@ }, { "Input": "لقد فاتني شوال 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شوال 2001", @@ -3565,7 +3565,7 @@ }, { "Input": "سأخرج في ذو القعدة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ذو القعدة", @@ -3577,7 +3577,7 @@ }, { "Input": "لقد فاتني ذو القعدة 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ذو القعدة 2001", @@ -3589,7 +3589,7 @@ }, { "Input": "سأخرج في ذو الحجة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ذو الحجة", @@ -3601,7 +3601,7 @@ }, { "Input": "لقد فاتني ذو الحجة 2001", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ذو الحجة 2001", @@ -3613,7 +3613,7 @@ }, { "Input": "سأخرج نوفمبر بين 15 و 19", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نوفمبر بين 15 و 19", @@ -3625,7 +3625,7 @@ }, { "Input": "سأخرج تشرين الثاني بين 15 و 19", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "تشرين الثاني بين 15 و 19", @@ -3637,7 +3637,7 @@ }, { "Input": "سأخرج نوفمبر بين الخامس عشر والتاسع عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نوفمبر بين الخامس عشر والتاسع عشر", @@ -3649,7 +3649,7 @@ }, { "Input": "يونايتد يسعى لإنهاء مهمته أمام روما | يلاكورة | 2021", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2021", diff --git a/Specs/DateTime/Arabic/DatePeriodParser.json b/Specs/DateTime/Arabic/DatePeriodParser.json index 881872e9ae..b6605520c0 100644 --- a/Specs/DateTime/Arabic/DatePeriodParser.json +++ b/Specs/DateTime/Arabic/DatePeriodParser.json @@ -59,7 +59,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 3 حتى 12 سبتمبر", @@ -194,7 +194,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 3 و 12 سبتمبر", @@ -221,7 +221,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4 إلى 22 يناير 1995", @@ -248,7 +248,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 4-22 يناير 1995", @@ -275,7 +275,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 4 سبتمبر و 8 سبتمبر", @@ -383,7 +383,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "فبراير", @@ -437,7 +437,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سبتمبر الماضي", @@ -464,7 +464,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو القادم", @@ -572,7 +572,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من شهر سبتمبر 16", @@ -599,7 +599,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2015.3", @@ -626,7 +626,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3-2015", @@ -653,7 +653,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2015/3", @@ -680,7 +680,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3/2015", @@ -950,7 +950,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 2 أكتوبر إلى 22 أكتوبر", @@ -977,7 +977,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 يناير, 2016 - 2016/01/22", @@ -1031,7 +1031,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم حتى الغد", @@ -1058,7 +1058,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 أكتوبر إلى 22 أكتوبر", @@ -1085,7 +1085,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 2 أكتوبر و 22 أكتوبر", @@ -1139,7 +1139,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 19 إلى 20 نوفمبر", @@ -1490,7 +1490,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو 2016", @@ -1517,7 +1517,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يونيو العام المقبل", @@ -1814,7 +1814,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الربع الثالث من عام 2016", @@ -1868,7 +1868,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الربع الثالث 2016", @@ -1916,7 +1916,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الربيع القادم", @@ -1937,7 +1937,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الصيف", @@ -1958,7 +1958,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "صيف", @@ -1979,7 +1979,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الصيف 2016", @@ -2000,7 +2000,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "صيف 2016", @@ -3665,7 +3665,7 @@ "ReferenceDateTime": "2017-11-08T00:00:00" }, "IgnoreResolution": "false", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نهاية شهر مارس", diff --git a/Specs/DateTime/Arabic/DateTimeExtractor.json b/Specs/DateTime/Arabic/DateTimeExtractor.json index 1b45f91f73..6bd68500d4 100644 --- a/Specs/DateTime/Arabic/DateTimeExtractor.json +++ b/Specs/DateTime/Arabic/DateTimeExtractor.json @@ -379,7 +379,7 @@ { "Input": "سأعود 14 أكتوبر 8:00 ، 14 أكتوبر", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "14 أكتوبر 8:00", diff --git a/Specs/DateTime/Arabic/DateTimeModel.json b/Specs/DateTime/Arabic/DateTimeModel.json index 7091050bdb..6dd84a0753 100644 --- a/Specs/DateTime/Arabic/DateTimeModel.json +++ b/Specs/DateTime/Arabic/DateTimeModel.json @@ -413,7 +413,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2015-3", @@ -551,13 +551,12 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": " الآن", - "Start": 5, + "Text": "الآن", + "Start": 6, "End": 9, "TypeName": "datetimeV2.datetime", "Resolution": { @@ -771,7 +770,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم من الخامسة إلى السابعة", @@ -1165,9 +1164,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال الشهر", @@ -1316,226 +1314,17 @@ } ] }, - { - "Input": "سأغادر أسبوعيا", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "أسبوعيا", - "Start": 7, - "End": 13, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "سأرحل كل يوم", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم", - "Start": 6, - "End": 11, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "سأغادر سنويا", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "سنويا", - "Start": 7, - "End": 11, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "سأغادر كل يومين", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يومين", - "Start": 7, - "End": 14, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "سأغادر كل ثلاثة أسابيع", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل ثلاثة أسابيع", - "Start": 7, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "سأغادر الساعة 3 مساءً كل يوم", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 3 مساءً كل يوم", - "Start": 7, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "سأغادر كل يوم اثنين", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم اثنين", - "Start": 7, - "End": 18, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "سأغادر كل يوم اثنين الساعة 4 مساءً", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم اثنين الساعة 4 مساءً", - "Start": 7, - "End": 33, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "سأعود 7:56:30 مساء", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": " 7:56:30 مساء", - "Start": 5, + "Text": "7:56:30 مساء", + "Start": 6, "End": 17, "TypeName": "datetimeV2.time", "Resolution": { @@ -1555,9 +1344,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة والنصف", @@ -1586,9 +1374,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة الثامنة وعشرين دقيقة مساءً", @@ -1612,13 +1399,12 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": " في الصباح في 7", - "Start": 5, + "Text": "في الصباح في 7", + "Start": 6, "End": 19, "TypeName": "datetimeV2.time", "Resolution": { @@ -1638,13 +1424,12 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": " بعد الظهر الساعة 7", - "Start": 5, + "Text": "بعد الظهر الساعة 7", + "Start": 6, "End": 23, "TypeName": "datetimeV2.time", "Resolution": { @@ -1664,13 +1449,12 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": " الظهيرة", - "Start": 5, + "Text": "الظهيرة", + "Start": 6, "End": 12, "TypeName": "datetimeV2.time", "Resolution": { @@ -1690,9 +1474,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحاديه عشر", @@ -1705,6 +1488,11 @@ "timex": "T11", "type": "time", "value": "11:00:00" + }, + { + "timex": "T23", + "type": "time", + "value": "23:00:00" } ] } @@ -1742,9 +1530,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 ظهرا", @@ -1770,7 +1557,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 5 إلى 6 مساءً", @@ -1822,9 +1609,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 5 و 6 بعد الظهر", @@ -1990,13 +1776,12 @@ "Context": { "ReferenceDateTime": "2017-09-28T14:11:10.9626841" }, - "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": " الآن", - "Start": 5, + "Text": "الآن", + "Start": 6, "End": 9, "TypeName": "datetimeV2.datetime", "Resolution": { @@ -2914,5 +2699,2302 @@ "Resolution": "not resolved" } ] + }, + { + "Input": "تَعْرفُ، نحن يُمْكِنُ أَنْ نَجْعلَ تلك النداءاتِ غداً وإلغاءِ.", + "Context": { + "ReferenceDateTime": "2024-01-15T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "غداً", + "Start": 49, + "End": 52, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2024-01-16", + "type": "date", + "value": "2024-01-16" + } + ] + } + } + ] + }, + { + "Input": "نتمنى أن يتمكن من الانضمام إلى المجموعة غدا في التدريبات .", + "Context": { + "ReferenceDateTime": "2024-01-15T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "غد", + "Start": 40, + "End": 41, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2024-01-16", + "type": "date", + "value": "2024-01-16" + } + ] + } + } + ] + }, + { + "Input": "حضارة اليوم الحاضر هي النتيجة الصافية لهذا التطور المضني", + "Context": { + "ReferenceDateTime": "2024-01-15T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "اليوم الحاضر", + "Start": 6, + "End": 17, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2024-01-15", + "type": "date", + "value": "2024-01-15" + } + ] + } + } + ] + }, + { + "Input": "ستكون دفعة المخدرات جاهزة بعد الغد.", + "Context": { + "ReferenceDateTime": "2024-01-15T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "بعد الغد", + "Start": 26, + "End": 33, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2024-01-17", + "type": "date", + "value": "2024-01-17" + } + ] + } + } + ] + }, + { + "Input": "في الحقيقة، قد أجبت على مثل هذا السؤال أول أمس.", + "Context": { + "ReferenceDateTime": "2024-01-15T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "أول أمس", + "Start": 39, + "End": 45, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2024-01-13", + "type": "date", + "value": "2024-01-13" + } + ] + } + } + ] + }, + { + "Input": "ولقد انتظرنا طويلا، ولا بد أن يحدث التغيير الآن.", + "Context": { + "ReferenceDateTime": "2024-01-15T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الآن", + "Start": 43, + "End": 46, + "TypeName": "datetimeV2.datetime", + "Resolution": { + "values": [ + { + "timex": "PRESENT_REF", + "type": "datetime", + "value": "2024-01-15 00:00:00" + } + ] + } + } + ] + }, + { + "Input": "في أي وقت تغادر رحلتي 28 أبريل؟", + "Context": { + "ReferenceDateTime": "2024-01-24T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "28 أبريل", + "Start": 22, + "End": 29, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-04-28", + "type": "date", + "value": "2023-04-28" + }, + { + "timex": "XXXX-04-28", + "type": "date", + "value": "2024-04-28" + } + ] + } + } + ] + }, + { + "Input": "في أي وقت تغادر رحلتي يوم 28 أبريل؟", + "Context": { + "ReferenceDateTime": "2024-01-24T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "يوم 28 أبريل", + "Start": 22, + "End": 33, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-04-28", + "type": "date", + "value": "2023-04-28" + }, + { + "timex": "XXXX-04-28", + "type": "date", + "value": "2024-04-28" + } + ] + } + } + ] + }, + { + "Input": "الواحدة إلا خمس وعشرون دقيقة صباحاً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الواحدة إلا خمس وعشرون دقيقة صباحا", + "Start": 0, + "End": 33, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T00:35", + "type": "time", + "value": "00:35:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الواحدة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الواحدة", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T01", + "type": "time", + "value": "01:00:00" + }, + { + "timex": "T13", + "type": "time", + "value": "13:00:00" + } + ] + } + } + ] + }, + { + "Input": "الساعه الثانيه", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثانيه", + "Start": 7, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T02", + "type": "time", + "value": "02:00:00" + }, + { + "timex": "T14", + "type": "time", + "value": "14:00:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الثانية", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثانية", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T02", + "type": "time", + "value": "02:00:00" + }, + { + "timex": "T14", + "type": "time", + "value": "14:00:00" + } + ] + } + } + ] + }, + { + "Input": "السادسة إلا ربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "السادسة إلا ربع", + "Start": 0, + "End": 14, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T05:45", + "type": "time", + "value": "05:45:00" + }, + { + "timex": "T17:45", + "type": "time", + "value": "17:45:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة السادسة إلا ربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة السادسة إلا ربع", + "Start": 0, + "End": 21, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T05:45", + "type": "time", + "value": "05:45:00" + }, + { + "timex": "T17:45", + "type": "time", + "value": "17:45:00" + } + ] + } + } + ] + }, + { + "Input": "السادسة والنصف", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "السادسة والنصف", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T06:30", + "type": "time", + "value": "06:30:00" + }, + { + "timex": "T18:30", + "type": "time", + "value": "18:30:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة السادسة والنصف", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة السادسة والنصف", + "Start": 0, + "End": 20, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T06:30", + "type": "time", + "value": "06:30:00" + }, + { + "timex": "T18:30", + "type": "time", + "value": "18:30:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة السابعة إلا خمس دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة السابعة إلا خمس دقائق", + "Start": 0, + "End": 27, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T06:55", + "type": "time", + "value": "06:55:00" + }, + { + "timex": "T18:55", + "type": "time", + "value": "18:55:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة السابعة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة السابعة", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T07", + "type": "time", + "value": "07:00:00" + }, + { + "timex": "T19", + "type": "time", + "value": "19:00:00" + } + ] + } + } + ] + }, + { + "Input": "السابعة صباحاً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "السابعة صباحا", + "Start": 0, + "End": 12, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T07", + "type": "time", + "value": "07:00:00" + } + ] + } + } + ] + }, + { + "Input": "السابعة والربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "السابعة والربع", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T07:15", + "type": "time", + "value": "07:15:00" + }, + { + "timex": "T19:15", + "type": "time", + "value": "19:15:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة السابعة والربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة السابعة والربع", + "Start": 0, + "End": 20, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T07:15", + "type": "time", + "value": "07:15:00" + }, + { + "timex": "T19:15", + "type": "time", + "value": "19:15:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الثامنة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثامنة", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T08", + "type": "time", + "value": "08:00:00" + }, + { + "timex": "T20", + "type": "time", + "value": "20:00:00" + } + ] + } + } + ] + }, + { + "Input": "الثامنة صباحاً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثامنة صباحا", + "Start": 0, + "End": 12, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T08", + "type": "time", + "value": "08:00:00" + } + ] + } + } + ] + }, + { + "Input": "الثامنة وعشر دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثامنة وعشر دقائق", + "Start": 0, + "End": 17, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T08:10", + "type": "time", + "value": "08:10:00" + }, + { + "timex": "T20:10", + "type": "time", + "value": "20:10:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الثامنة وعشر دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثامنة وعشر دقائق", + "Start": 0, + "End": 24, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T08:10", + "type": "time", + "value": "08:10:00" + }, + { + "timex": "T20:10", + "type": "time", + "value": "20:10:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة التاسعة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة التاسعة", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T09", + "type": "time", + "value": "09:00:00" + }, + { + "timex": "T21", + "type": "time", + "value": "21:00:00" + } + ] + } + } + ] + }, + { + "Input": "التاسعة صباحاً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "التاسعة صباحا", + "Start": 0, + "End": 12, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T09", + "type": "time", + "value": "09:00:00" + } + ] + } + } + ] + }, + { + "Input": "التاسعة والربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "التاسعة والربع", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T09:15", + "type": "time", + "value": "09:15:00" + }, + { + "timex": "T21:15", + "type": "time", + "value": "21:15:00" + } + ] + } + } + ] + }, + { + "Input": "التاسعة وخمس عشرة دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "التاسعة وخمس عشرة دقيقة", + "Start": 0, + "End": 22, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T09:15", + "type": "time", + "value": "09:15:00" + }, + { + "timex": "T21:15", + "type": "time", + "value": "21:15:00" + } + ] + } + } + ] + }, + { + "Input": "العاشرة إلا خمس دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "العاشرة إلا خمس دقائق", + "Start": 0, + "End": 20, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T09:55", + "type": "time", + "value": "09:55:00" + }, + { + "timex": "T21:55", + "type": "time", + "value": "21:55:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة العاشرة إلا خمس دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة العاشرة إلا خمس دقائق", + "Start": 0, + "End": 27, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T09:55", + "type": "time", + "value": "09:55:00" + }, + { + "timex": "T21:55", + "type": "time", + "value": "21:55:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة العاشرة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة العاشرة", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T10", + "type": "time", + "value": "10:00:00" + }, + { + "timex": "T22", + "type": "time", + "value": "22:00:00" + } + ] + } + } + ] + }, + { + "Input": "العاشرة صباحاً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "العاشرة صباحا", + "Start": 0, + "End": 12, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T10", + "type": "time", + "value": "10:00:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الحادية عشر إلا ربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الحادية عشر إلا ربع", + "Start": 0, + "End": 25, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T10:45", + "type": "time", + "value": "10:45:00" + }, + { + "timex": "T22:45", + "type": "time", + "value": "22:45:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الحادية عشر", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الحادية عشر", + "Start": 0, + "End": 17, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T11", + "type": "time", + "value": "11:00:00" + }, + { + "timex": "T23", + "type": "time", + "value": "23:00:00" + } + ] + } + } + ] + }, + { + "Input": "الحادية عشر صباحاً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الحادية عشر صباحا", + "Start": 0, + "End": 16, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T11", + "type": "time", + "value": "11:00:00" + } + ] + } + } + ] + }, + { + "Input": "الحادية عشرة والنصف", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الحادية عشرة والنصف", + "Start": 0, + "End": 18, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T11:30", + "type": "time", + "value": "11:30:00" + }, + { + "timex": "T23:30", + "type": "time", + "value": "23:30:00" + } + ] + } + } + ] + }, + { + "Input": "الساعه الحاديه عشر والنصف", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الحاديه عشر والنصف", + "Start": 7, + "End": 24, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T11:30", + "type": "time", + "value": "11:30:00" + }, + { + "timex": "T23:30", + "type": "time", + "value": "23:30:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الحادية عشر وخمس وأربعون دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الحادية عشر وخمس وأربعون دقيقة", + "Start": 0, + "End": 36, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T11:45", + "type": "time", + "value": "11:45:00" + }, + { + "timex": "T23:45", + "type": "time", + "value": "23:45:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الثانية عشر", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثانية عشر", + "Start": 0, + "End": 17, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T12", + "type": "time", + "value": "12:00:00" + }, + { + "timex": "T00", + "type": "time", + "value": "00:00:00" + } + ] + } + } + ] + }, + { + "Input": "الثانية عشر وعشر دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثانية عشر وعشر دقائق", + "Start": 0, + "End": 21, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T12:10", + "type": "time", + "value": "12:10:00" + }, + { + "timex": "T00:10", + "type": "time", + "value": "00:10:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الثانية عشر وعشر دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثانية عشر وعشر دقائق", + "Start": 0, + "End": 28, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T12:10", + "type": "time", + "value": "12:10:00" + }, + { + "timex": "T00:10", + "type": "time", + "value": "00:10:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الثانية عشرة والنصف بعد الظهر", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثانية عشرة والنصف بعد الظهر", + "Start": 0, + "End": 35, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T12:30", + "type": "time", + "value": "12:30:00" + } + ] + } + } + ] + }, + { + "Input": "الثانية عشرة والنصف ظهراً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثانية عشرة والنصف ظهرا", + "Start": 0, + "End": 23, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T12:30", + "type": "time", + "value": "12:30:00" + } + ] + } + } + ] + }, + { + "Input": "الثانية عشرة والنصف", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثانية عشرة والنصف", + "Start": 0, + "End": 18, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T12:30", + "type": "time", + "value": "12:30:00" + }, + { + "timex": "T00:30", + "type": "time", + "value": "00:30:00" + } + ] + } + } + ] + }, + { + "Input": "الثانية عشر والنصف", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثانية عشر والنصف", + "Start": 0, + "End": 17, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T12:30", + "type": "time", + "value": "12:30:00" + }, + { + "timex": "T00:30", + "type": "time", + "value": "00:30:00" + } + ] + } + } + ] + }, + { + "Input": "الثانية عشر وخمسون دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثانية عشر وخمسون دقيقة", + "Start": 0, + "End": 23, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T12:50", + "type": "time", + "value": "12:50:00" + }, + { + "timex": "T00:50", + "type": "time", + "value": "00:50:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الواحدة وخمس دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الواحدة وخمس دقائق", + "Start": 0, + "End": 24, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T01:05", + "type": "time", + "value": "01:05:00" + }, + { + "timex": "T13:05", + "type": "time", + "value": "13:05:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الواحدة والنصف بعد الظهر", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الواحدة والنصف بعد الظهر", + "Start": 0, + "End": 30, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T13:30", + "type": "time", + "value": "13:30:00" + } + ] + } + } + ] + }, + { + "Input": "الواحدة والنصف ظهراً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الواحدة والنصف ظهرا", + "Start": 0, + "End": 18, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T13:30", + "type": "time", + "value": "13:30:00" + } + ] + } + } + ] + }, + { + "Input": "هل هناك رحلة حوالي الساعة اثنين إلا ربع؟", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة اثنين إلا ربع", + "Start": 19, + "End": 38, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T01:45", + "type": "time", + "value": "01:45:00" + }, + { + "timex": "T13:45", + "type": "time", + "value": "13:45:00" + } + ] + } + } + ] + }, + { + "Input": "هل هناك رحلة حوالي الساعة اثنين؟", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة اثنين", + "Start": 19, + "End": 30, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T02", + "type": "time", + "value": "02:00:00" + }, + { + "timex": "T14", + "type": "time", + "value": "14:00:00" + } + ] + } + } + ] + }, + { + "Input": "الثانية وربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثانية وربع", + "Start": 0, + "End": 11, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T02:15", + "type": "time", + "value": "02:15:00" + }, + { + "timex": "T14:15", + "type": "time", + "value": "14:15:00" + } + ] + } + } + ] + }, + { + "Input": "لقد قمت بهذا الشراء في الساعة الثالثة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثالثة", + "Start": 23, + "End": 36, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T03", + "type": "time", + "value": "03:00:00" + }, + { + "timex": "T15", + "type": "time", + "value": "15:00:00" + } + ] + } + } + ] + }, + { + "Input": "الثالثة وخمس دقائق بعد الظهر", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثالثة وخمس دقائق بعد الظهر", + "Start": 0, + "End": 27, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T15:05", + "type": "time", + "value": "15:05:00" + } + ] + } + } + ] + }, + { + "Input": "لقد قمت بهذا الشراء في الساعة الثالثة وعشر دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثالثة وعشر دقائق", + "Start": 23, + "End": 47, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T03:10", + "type": "time", + "value": "03:10:00" + }, + { + "timex": "T15:10", + "type": "time", + "value": "15:10:00" + } + ] + } + } + ] + }, + { + "Input": "الثالثة والنصف", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثالثة والنصف", + "Start": 0, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T03:30", + "type": "time", + "value": "03:30:00" + }, + { + "timex": "T15:30", + "type": "time", + "value": "15:30:00" + } + ] + } + } + ] + }, + { + "Input": "أربعة إلا ربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "أربعة إلا ربع", + "Start": 0, + "End": 12, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T03:45", + "type": "time", + "value": "03:45:00" + }, + { + "timex": "T15:45", + "type": "time", + "value": "15:45:00" + } + ] + } + } + ] + }, + { + "Input": "الرابعة إلا الربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الرابعة إلا الربع", + "Start": 0, + "End": 16, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T03:45", + "type": "time", + "value": "03:45:00" + }, + { + "timex": "T15:45", + "type": "time", + "value": "15:45:00" + } + ] + } + } + ] + }, + { + "Input": "انها الرابعة الا عشر دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الرابعة الا عشر دقائق", + "Start": 5, + "End": 25, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T03:50", + "type": "time", + "value": "03:50:00" + }, + { + "timex": "T15:50", + "type": "time", + "value": "15:50:00" + } + ] + } + } + ] + }, + { + "Input": "الوقت الساعة الرابعة إلا خمس دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الرابعة إلا خمس دقائق", + "Start": 6, + "End": 33, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T03:55", + "type": "time", + "value": "03:55:00" + }, + { + "timex": "T15:55", + "type": "time", + "value": "15:55:00" + } + ] + } + } + ] + }, + { + "Input": "الوقت الساعة الرابعة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الرابعة", + "Start": 6, + "End": 19, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T04", + "type": "time", + "value": "04:00:00" + }, + { + "timex": "T16", + "type": "time", + "value": "16:00:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة الرابعة وعشرون دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الرابعة وعشرون دقيقة", + "Start": 0, + "End": 26, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T04:20", + "type": "time", + "value": "04:20:00" + }, + { + "timex": "T16:20", + "type": "time", + "value": "16:20:00" + } + ] + } + } + ] + }, + { + "Input": "الخمسة إلا عشرين دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الخمسة إلا عشرين دقيقة", + "Start": 0, + "End": 21, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T04:40", + "type": "time", + "value": "04:40:00" + }, + { + "timex": "T16:40", + "type": "time", + "value": "16:40:00" + } + ] + } + } + ] + }, + { + "Input": "خمسة إلا عشرين دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "خمسة إلا عشرين دقيقة", + "Start": 0, + "End": 19, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T04:40", + "type": "time", + "value": "04:40:00" + }, + { + "timex": "T16:40", + "type": "time", + "value": "16:40:00" + } + ] + } + } + ] + }, + { + "Input": "سأعود الخامسة والنصف", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الخامسة والنصف", + "Start": 6, + "End": 19, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T05:30", + "type": "time", + "value": "05:30:00" + }, + { + "timex": "T17:30", + "type": "time", + "value": "17:30:00" + } + ] + } + } + ] + }, + { + "Input": "الخامسة وخمس وثلاثون دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الخامسة وخمس وثلاثون دقيقة", + "Start": 0, + "End": 25, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T05:35", + "type": "time", + "value": "05:35:00" + }, + { + "timex": "T17:35", + "type": "time", + "value": "17:35:00" + } + ] + } + } + ] + }, + { + "Input": "ستة إلا عشرين دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "ستة إلا عشرين دقيقة", + "Start": 0, + "End": 18, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T05:40", + "type": "time", + "value": "05:40:00" + }, + { + "timex": "T17:40", + "type": "time", + "value": "17:40:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة السادسة وعشر دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة السادسة وعشر دقائق", + "Start": 0, + "End": 24, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T06:10", + "type": "time", + "value": "06:10:00" + }, + { + "timex": "T18:10", + "type": "time", + "value": "18:10:00" + } + ] + } + } + ] + }, + { + "Input": "السبعة إلا عشرين دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "السبعة إلا عشرين دقيقة", + "Start": 0, + "End": 21, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T06:40", + "type": "time", + "value": "06:40:00" + }, + { + "timex": "T18:40", + "type": "time", + "value": "18:40:00" + } + ] + } + } + ] + }, + { + "Input": "سبعة إلا عشرين دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "سبعة إلا عشرين دقيقة", + "Start": 0, + "End": 19, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T06:40", + "type": "time", + "value": "06:40:00" + }, + { + "timex": "T18:40", + "type": "time", + "value": "18:40:00" + } + ] + } + } + ] + }, + { + "Input": "ثمانية إلا عشرين دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "ثمانية إلا عشرين دقيقة", + "Start": 0, + "End": 21, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T07:40", + "type": "time", + "value": "07:40:00" + }, + { + "timex": "T19:40", + "type": "time", + "value": "19:40:00" + } + ] + } + } + ] + }, + { + "Input": "الثامنة إلا عشرون دقيقة", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثامنة إلا عشرون دقيقة", + "Start": 0, + "End": 22, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T07:40", + "type": "time", + "value": "07:40:00" + }, + { + "timex": "T19:40", + "type": "time", + "value": "19:40:00" + } + ] + } + } + ] + }, + { + "Input": "الثامنة إلا خمس دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثامنة إلا خمس دقائق", + "Start": 0, + "End": 20, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T07:55", + "type": "time", + "value": "07:55:00" + }, + { + "timex": "T19:55", + "type": "time", + "value": "19:55:00" + } + ] + } + } + ] + }, + { + "Input": "الثامنة وعشر دقائق", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الثامنة وعشر دقائق", + "Start": 0, + "End": 17, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T08:10", + "type": "time", + "value": "08:10:00" + }, + { + "timex": "T20:10", + "type": "time", + "value": "20:10:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة التاسعة إلا ربع", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة التاسعة إلا ربع", + "Start": 0, + "End": 21, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T08:45", + "type": "time", + "value": "08:45:00" + }, + { + "timex": "T20:45", + "type": "time", + "value": "20:45:00" + } + ] + } + } + ] + }, + { + "Input": "الساعة التاسعة والنصف مساءً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة التاسعة والنصف مساءً", + "Start": 0, + "End": 26, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T21:30", + "type": "time", + "value": "21:30:00" + } + ] + } + } + ] + }, + { + "Input": "العاشرة والربع ليلاً", + "Context": { + "ReferenceDateTime": "2024-02-01T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "العاشرة والربع ليلا", + "Start": 0, + "End": 18, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T22:15", + "type": "time", + "value": "22:15:00" + } + ] + } + } + ] + }, + { + "Input": "ألفين وخمسة عشر", + "Context": { + "ReferenceDateTime": "2024-02-21T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "ألفين وخمسة عشر", + "Start": 0, + "End": 14, + "TypeName": "datetimeV2.daterange", + "Resolution": { + "values": [ + { + "timex": "2015", + "type": "daterange", + "start": "2015-01-01", + "end": "2016-01-01" + } + ] + } + } + ] + }, + { + "Input": "ألفان وثلاثة وعشرون", + "Context": { + "ReferenceDateTime": "2024-02-21T00:00:00" + }, + "NotSupported": "dotnet", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "ألفان وثلاثة وعشرون", + "Start": 0, + "End": 18, + "TypeName": "datetimeV2.daterange", + "Resolution": { + "values": [ + { + "timex": "2023", + "type": "daterange", + "start": "2023-01-01", + "end": "2024-01-01" + } + ] + } + } + ] } -] \ No newline at end of file +] diff --git a/Specs/DateTime/Arabic/DateTimeParser.json b/Specs/DateTime/Arabic/DateTimeParser.json index 089a53c74c..7b4217e555 100644 --- a/Specs/DateTime/Arabic/DateTimeParser.json +++ b/Specs/DateTime/Arabic/DateTimeParser.json @@ -6,7 +6,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الآن", @@ -500,7 +500,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 8 مساء اليوم", @@ -1280,7 +1280,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "6 يناير 2017-6:37 صباحًا", diff --git a/Specs/DateTime/Arabic/DateTimePeriodExtractor.json b/Specs/DateTime/Arabic/DateTimePeriodExtractor.json index b5aa4983b4..ff77362389 100644 --- a/Specs/DateTime/Arabic/DateTimePeriodExtractor.json +++ b/Specs/DateTime/Arabic/DateTimePeriodExtractor.json @@ -2,7 +2,7 @@ { "Input": "سأخرج اليوم من الخامسة إلى السابعة", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم من الخامسة إلى السابعة", @@ -28,7 +28,7 @@ { "Input": "سأخرج من 5 إلى 6 الأحد القادم", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 5 إلى 6 الأحد القادم", @@ -41,7 +41,7 @@ { "Input": "سأخرج من الخامسة إلى السادسة مساء الأحد القادم", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من الخامسة إلى السادسة مساء الأحد القادم", @@ -340,7 +340,7 @@ { "Input": "سأعود بعد 3 دقائق", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد 3 دقائق", @@ -353,7 +353,7 @@ { "Input": "سأعود 3 دقائق السابقة", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 دقائق السابقة", @@ -366,7 +366,7 @@ { "Input": "سأعود بعد 5 ساعات", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد 5 ساعات", @@ -418,7 +418,7 @@ { "Input": "سأعود بعد عدة دقائق", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد عدة دقائق", @@ -431,7 +431,7 @@ { "Input": "سأعود الثلاثاء في الصباح", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثاء في الصباح", @@ -444,7 +444,7 @@ { "Input": "سأعود الثلاثاء بعد الظهر", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثاء بعد الظهر", @@ -457,7 +457,7 @@ { "Input": "سأعود الثلاثاء في المساء", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثاء في المساء", @@ -470,7 +470,7 @@ { "Input": "دعونا نجتمع في الصباح الباكر الثلاثاء", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الصباح الباكر الثلاثاء", @@ -821,12 +821,12 @@ { "Input": "هل يمكنك تحديد موعد 9 ديسمبر بين الساعة 8 صباحًا و 2 مساءً؟", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "9 ديسمبر بين الساعة 8 صباحًا و 2 مساء", + "Text": "9 ديسمبر بين الساعة 8 صباحًا و 2 مساءً", "Start": 20, - "Length": 37, + "Length": 38, "Type": "datetimerange" } ] diff --git a/Specs/DateTime/Arabic/DateTimePeriodParser.json b/Specs/DateTime/Arabic/DateTimePeriodParser.json index be13df6109..eb3b722d16 100644 --- a/Specs/DateTime/Arabic/DateTimePeriodParser.json +++ b/Specs/DateTime/Arabic/DateTimePeriodParser.json @@ -6,7 +6,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم من الخامسة إلى السابعة", @@ -678,7 +678,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 دقائق السابقة", @@ -706,7 +706,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد 5 ساعات", @@ -1630,10 +1630,10 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "9 ديسمبر بين الساعة 8 صباحًا و 2 مساء", + "Text": "9 ديسمبر بين الساعة 8 صباحًا و 2 مساءً", "Start": 20, "Length": 37, "Type": "datetimerange", diff --git a/Specs/DateTime/Arabic/DurationExtractor.json b/Specs/DateTime/Arabic/DurationExtractor.json index 9475d607a2..8f06137428 100644 --- a/Specs/DateTime/Arabic/DurationExtractor.json +++ b/Specs/DateTime/Arabic/DurationExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "سأترك لمدة 3 ساعات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 ساعات", @@ -13,7 +13,7 @@ }, { "Input": "سأغادر لمدة 3 أيام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 أيام", @@ -25,7 +25,7 @@ }, { "Input": "سأغادر لمدة 3.5 سنوات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3.5 سنوات", @@ -37,7 +37,7 @@ }, { "Input": "سأترك مدة 3 ساعات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 ساعات", @@ -49,7 +49,7 @@ }, { "Input": "سأغادر لمدة 3 الساعات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 الساعات", @@ -61,7 +61,7 @@ }, { "Input": "سأغادر لمدة 3 ساعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 ساعة", @@ -73,7 +73,7 @@ }, { "Input": "سأغادر لمدة 3 ساعات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 ساعات", @@ -85,7 +85,7 @@ }, { "Input": "سأغادر مدة 3 أيام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 أيام", @@ -97,7 +97,7 @@ }, { "Input": "سأغادر لمدة 3 أشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 أشهر", @@ -109,7 +109,7 @@ }, { "Input": "سأغادر لمدة 3 دقائق", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 دقائق", @@ -121,7 +121,7 @@ }, { "Input": "سأترك مدة 3 دقائق", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 دقائق", @@ -133,7 +133,7 @@ }, { "Input": "سأغادر لمدة 3.5 ثانية", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3.5 ثانية", @@ -145,7 +145,7 @@ }, { "Input": "سأترك لمدة 123.45 ثانية", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "123.45 ثانية", @@ -157,7 +157,7 @@ }, { "Input": "سأغادر لمدة أسبوعين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أسبوعين", @@ -169,7 +169,7 @@ }, { "Input": "سأغادر لمدة عشرين دقيقة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عشرين دقيقة", @@ -181,7 +181,7 @@ }, { "Input": "سأغادر لمدة أربع وعشرين ساعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أربع وعشرين ساعة", @@ -193,7 +193,7 @@ }, { "Input": "سأغادر طوال اليوم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال اليوم", @@ -205,7 +205,7 @@ }, { "Input": "سأغادر طوال الأسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال الأسبوع", @@ -217,7 +217,7 @@ }, { "Input": "سأغادر طوال الشهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال الشهر", @@ -229,7 +229,7 @@ }, { "Input": "سأغادر طوال العام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال العام", @@ -241,7 +241,7 @@ }, { "Input": "سأغادر طوال يوم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال يوم", @@ -253,7 +253,7 @@ }, { "Input": "سأغادر طوال أسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال أسبوع", @@ -265,7 +265,7 @@ }, { "Input": "سأغادر طوال شهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال شهر", @@ -277,7 +277,7 @@ }, { "Input": "سأغادر طوال السنة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال السنة", @@ -289,7 +289,7 @@ }, { "Input": "سأغادر ليوم كامل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يوم كامل", @@ -301,7 +301,7 @@ }, { "Input": "سأغادر لمدة أسبوع كامل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أسبوع كامل", @@ -313,7 +313,7 @@ }, { "Input": "سأغادر لمدة شهر كامل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر كامل", @@ -325,7 +325,7 @@ }, { "Input": "سأغادر لمدة عام كامل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عام كامل", @@ -337,7 +337,7 @@ }, { "Input": "سأغادر يوم كامل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يوم كامل", @@ -349,7 +349,7 @@ }, { "Input": "سأغادرلمدة أسبوع كامل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أسبوع كامل", @@ -361,7 +361,7 @@ }, { "Input": "سأغادرلمدة شهر كامل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر كامل", @@ -373,7 +373,7 @@ }, { "Input": "سأغادر لمدة سنة كاملة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سنة كاملة", @@ -385,7 +385,7 @@ }, { "Input": "سأغادر لمدة ساعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ساعة", @@ -397,7 +397,7 @@ }, { "Input": "سأترك لمدة عام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عام", @@ -409,7 +409,7 @@ }, { "Input": "نصف سنة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نصف سنة", @@ -421,7 +421,7 @@ }, { "Input": "نصف عام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نصف عام", @@ -433,7 +433,7 @@ }, { "Input": "سأترك لمدة 3 دقائق", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 دقائق", @@ -445,7 +445,7 @@ }, { "Input": "سأغادر لمدة 30 دقيقة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 دقيقة", @@ -457,7 +457,7 @@ }, { "Input": "سأغادر لمدة نصف ساعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نصف ساعة", @@ -469,7 +469,7 @@ }, { "Input": "سأغادر مدة نصف ساعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نصف ساعة", @@ -481,7 +481,7 @@ }, { "Input": "سأغادر لمدة ساعة ونصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ساعة ونصف", @@ -493,7 +493,7 @@ }, { "Input": "سأغادرمدة ساعة ونصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ساعة ونصف", @@ -505,7 +505,7 @@ }, { "Input": "سأغادر لمدة نصف الساعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نصف الساعة", @@ -517,7 +517,7 @@ }, { "Input": "سأغادر لمدة ساعتين", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ساعتين", @@ -529,7 +529,7 @@ }, { "Input": "سأغادر لمدة ساعتين ونصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ساعتين ونصف", @@ -541,7 +541,7 @@ }, { "Input": "في أسبوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أسبوع", @@ -553,7 +553,7 @@ }, { "Input": "في يوم", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يوم", @@ -565,7 +565,7 @@ }, { "Input": "لمدة ساعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ساعة", @@ -577,7 +577,7 @@ }, { "Input": "لمدة شهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر", @@ -589,7 +589,7 @@ }, { "Input": "سأغادر لبضع ساعات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بضع ساعات", @@ -601,7 +601,7 @@ }, { "Input": "سأغادر لبضع دقائق", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بضع دقائق", @@ -613,7 +613,7 @@ }, { "Input": "سأرحل لبضعة أيام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بضعة أيام", @@ -625,7 +625,7 @@ }, { "Input": "سأغادر لعدة أيام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عدة أيام", @@ -637,7 +637,7 @@ }, { "Input": "سأغادر لمدة عام واحد و شهر و 21 يوما", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عام واحد و شهر و 21 يوما", @@ -649,7 +649,7 @@ }, { "Input": "سأغادر لمدة 2 أيام و شهر واحد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2 أيام و شهر واحد", diff --git a/Specs/DateTime/Arabic/DurationParser.json b/Specs/DateTime/Arabic/DurationParser.json index 911c8ce578..8743aaab6c 100644 --- a/Specs/DateTime/Arabic/DurationParser.json +++ b/Specs/DateTime/Arabic/DurationParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 ساعات", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 أيام", @@ -53,7 +53,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3.5 سنوات", @@ -77,7 +77,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 ساعات", @@ -126,7 +126,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 ساعة", @@ -150,7 +150,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 أيام", @@ -174,7 +174,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 أشهر", @@ -198,7 +198,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 دقائق", @@ -222,7 +222,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 دقائق", @@ -247,7 +247,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3.5 ثانية", @@ -272,7 +272,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "123.45 ثانية", @@ -321,7 +321,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عشرين دقيقة", @@ -421,7 +421,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال الشهر", @@ -446,7 +446,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال العام", @@ -470,7 +470,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال يوم", @@ -494,7 +494,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال أسبوع", @@ -518,7 +518,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "طوال شهر", @@ -567,7 +567,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يوم كامل", @@ -591,7 +591,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أسبوع كامل", @@ -615,7 +615,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر كامل", @@ -639,7 +639,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عام كامل", @@ -663,7 +663,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يوم كامل", @@ -687,7 +687,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أسبوع كامل", @@ -711,7 +711,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "شهر كامل", @@ -735,7 +735,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "سنة كاملة", @@ -759,7 +759,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ساعة", @@ -783,7 +783,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نصف سنة", @@ -807,7 +807,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نصف عام", @@ -831,7 +831,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 دقائق", @@ -855,7 +855,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 دقيقة", @@ -929,7 +929,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "نصف ساعة", diff --git a/Specs/DateTime/Arabic/HolidayExtractor.json b/Specs/DateTime/Arabic/HolidayExtractor.json index 9c78e49aab..3ae1fc1ebb 100644 --- a/Specs/DateTime/Arabic/HolidayExtractor.json +++ b/Specs/DateTime/Arabic/HolidayExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "سأعود في عيد الميلاد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "عيد الميلاد", @@ -13,7 +13,7 @@ }, { "Input": "سأعود في يوم عيد الميلاد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يوم عيد الميلاد", @@ -25,7 +25,7 @@ }, { "Input": "سأعود في يواندان", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يواندان", @@ -37,7 +37,7 @@ }, { "Input": "سأعود في يوم الشكر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يوم الشكر", @@ -49,7 +49,7 @@ }, { "Input": "سأعود في يوم الأب", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يوم الأب", @@ -61,7 +61,7 @@ }, { "Input": "سأعود في يواندان هذا العام", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يواندان هذا العام", @@ -73,7 +73,7 @@ }, { "Input": "سأعود في يواندان لعام 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يواندان لعام 2016", @@ -85,7 +85,7 @@ }, { "Input": "سأعود في يواندان 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يواندان 2016", @@ -97,7 +97,7 @@ }, { "Input": "سأعود يوم إثنين الرماد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يوم إثنين الرماد", @@ -109,7 +109,7 @@ }, { "Input": "سأعود في رأس السنة الهجرية", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "رأس السنة الهجرية", @@ -121,7 +121,7 @@ }, { "Input": "سأعود في عيد الأضحى", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "عيد الأضحى", @@ -133,7 +133,7 @@ }, { "Input": "سأعود في عيد الفطر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "عيد الفطر", @@ -145,7 +145,7 @@ }, { "Input": "سأذهب إلى الحج", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "الحج", @@ -157,7 +157,7 @@ }, { "Input": "سأعود في المولد النبوي", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "المولد النبوي", @@ -169,7 +169,7 @@ }, { "Input": "سأذهب في يوم الأرض", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "يوم الأرض", @@ -181,7 +181,7 @@ }, { "Input": "سأعود في عيد الاستقلال", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "عيد الاستقلال", @@ -193,7 +193,7 @@ }, { "Input": "سأعود في الخريف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "الخريف", @@ -205,7 +205,7 @@ }, { "Input": "سأذهب في الحج سنة 2016", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascrip", "Results": [ { "Text": "الحج سنة 2016", diff --git a/Specs/DateTime/Arabic/MergedExtractor.json b/Specs/DateTime/Arabic/MergedExtractor.json index 219d10e048..f65d730549 100644 --- a/Specs/DateTime/Arabic/MergedExtractor.json +++ b/Specs/DateTime/Arabic/MergedExtractor.json @@ -106,7 +106,7 @@ { "Input": "الأسبوع الماضي", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأسبوع الماضي", @@ -184,7 +184,7 @@ { "Input": "كيف يبدو يومي؟", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "يومي", @@ -197,7 +197,7 @@ { "Input": "كيف يبدو اليوم؟", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "اليوم", @@ -307,7 +307,7 @@ { "Input": "6/6/2012 15:15", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "6/6/2012 15:15", @@ -333,7 +333,7 @@ { "Input": "29 مايو", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29 مايو", @@ -346,7 +346,7 @@ { "Input": "29 مارس", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29 مارس", @@ -359,7 +359,7 @@ { "Input": "ولدت في مارس", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مارس", @@ -398,37 +398,37 @@ { "Input": "ما هي ساعات بالومينو؟", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "في الشمس", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "أي بريد إلكتروني تلقى ردًا", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "غالبًا ما يكون وحيدًا", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "غالبا طائر", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "ساعات ميشيغان", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { diff --git a/Specs/DateTime/Arabic/MergedParser.json b/Specs/DateTime/Arabic/MergedParser.json index 6acf260419..a59e3e6759 100644 --- a/Specs/DateTime/Arabic/MergedParser.json +++ b/Specs/DateTime/Arabic/MergedParser.json @@ -649,7 +649,7 @@ }, "IgnoreResolution": "true", "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2016-2-30", @@ -796,21 +796,6 @@ } ] } - }, - { - "Text": "كل اسبوع", - "Start": -1, - "Length": 8, - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -837,21 +822,6 @@ } ] } - }, - { - "Text": "كل شهر", - "Start": 22, - "Length": 6, - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, diff --git a/Specs/DateTime/Arabic/SetExtractor.json b/Specs/DateTime/Arabic/SetExtractor.json deleted file mode 100644 index 03b17cbfe5..0000000000 --- a/Specs/DateTime/Arabic/SetExtractor.json +++ /dev/null @@ -1,314 +0,0 @@ -[ - { - "Input": "سأغادر أسبوعيا", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "أسبوعيا", - "Start": 7, - "Length": 7, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر يوميا", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "يوميا", - "Start": 7, - "Length": 5, - "Type": "set" - } - ] - }, - { - "Input": "سأرحل كل يوم", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم", - "Start": 6, - "Length": 6, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل شهر", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل شهر", - "Start": 7, - "Length": 6, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر سنويا", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "سنويا", - "Start": 7, - "Length": 5, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر سنويًا", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "سنويًا", - "Start": 7, - "Length": 6, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل يومين", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يومين", - "Start": 7, - "Length": 8, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل ثلاثة أسابيع", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل ثلاثة أسابيع", - "Start": 7, - "Length": 15, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر الساعة 3 مساءً كل يوم", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 3 مساءً كل يوم", - "Start": 7, - "Length": 21, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل 4/15", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل 4/15", - "Start": 7, - "Length": 7, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل يوم اثنين", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم اثنين", - "Start": 7, - "Length": 12, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل يوم اثنين الساعة 4 مساءً", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم اثنين الساعة 4 مساءً", - "Start": 7, - "Length": 27, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل صباح", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل صباح", - "Start": 7, - "Length": 7, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل صباح في الساعة 9 صباحًا", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل صباح في الساعة 9 صباحًا", - "Start": 7, - "Length": 26, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر بعد ظهر كل يوم في الساعة 4 مساءً", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "بعد ظهر كل يوم في الساعة 4 مساءً", - "Start": 7, - "Length": 32, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل ليلة في الساعة 9 مساءً", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل ليلة في الساعة 9 مساءً", - "Start": 7, - "Length": 25, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر كل ليلة في 9", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل ليلة في 9", - "Start": 7, - "Length": 12, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر في الصباح في التاسعة", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "في الصباح في التاسعة", - "Start": 7, - "Length": 20, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر الساعة 9 صباحًا كل يوم أحد", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 9 صباحًا كل يوم أحد", - "Start": 7, - "Length": 26, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر الساعة 9 صباحًا كل يوم الاثنين", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 9 صباحًا كل يوم الاثنين", - "Start": 7, - "Length": 30, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر الساعة 9 صباحًا أيام الإثنين", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 9 صباحًا أيام الإثنين", - "Start": 7, - "Length": 28, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر أيام الاثنين", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "أيام الاثنين", - "Start": 7, - "Length": 12, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر يوم الأحد", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "يوم الأحد", - "Start": 7, - "Length": 9, - "Type": "set" - } - ] - }, - { - "Input": "سأغادر أيام الأحد", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "أيام الأحد", - "Start": 7, - "Length": 10, - "Type": "set" - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Arabic/SetParser.json b/Specs/DateTime/Arabic/SetParser.json deleted file mode 100644 index 2b865195c4..0000000000 --- a/Specs/DateTime/Arabic/SetParser.json +++ /dev/null @@ -1,704 +0,0 @@ -[ - { - "Input": "سأغادر أسبوعيا", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2744475+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "أسبوعيا", - "Start": 7, - "Length": 7, - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - } - } - ] - }, - { - "Input": "سأغادر كل أسبوعين", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2754476+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل أسبوعين", - "Start": 7, - "Length": 10, - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - } - } - ] - }, - { - "Input": "سأغادر يوميا", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2779449+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "يوميا", - "Start": 7, - "Length": 5, - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - } - } - ] - }, - { - "Input": "سأرحل كل يوم", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2794445+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم", - "Start": 6, - "Length": 6, - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - } - } - ] - }, - { - "Input": "سأغادر كل شهر", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2829445+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل شهر", - "Start": 7, - "Length": 6, - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - } - } - ] - }, - { - "Input": "سأغادر سنويا", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2844439+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "سنويا", - "Start": 7, - "Length": 5, - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - } - } - ] - }, - { - "Input": "سأغادر سنويًا", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2854444+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "سنويًا", - "Start": 7, - "Length": 6, - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - } - } - ] - }, - { - "Input": "سأغادر كل يومين", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2909444+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يومين", - "Start": 7, - "Length": 8, - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - } - } - ] - }, - { - "Input": "سأغادر كل ثلاثة أسابيع", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2959472+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل ثلاثة أسابيع", - "Start": 7, - "Length": 15, - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - } - } - ] - }, - { - "Input": "سأغادر الساعة 3 مساءً كل يوم", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2989494+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 3 مساءً كل يوم", - "Start": 7, - "Length": 21, - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - } - } - ] - }, - { - "Input": "سأغادر الساعة 3 مساءً كل يوم", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3039501+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 3 مساءً كل يوم", - "Start": 7, - "Length": 21, - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - } - } - ] - }, - { - "Input": "سأغادر كل 4/15", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3109498+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل 4/15", - "Start": 7, - "Length": 7, - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - } - } - ] - }, - { - "Input": "سأغادر كل يوم اثنين", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3259514+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم اثنين", - "Start": 7, - "Length": 12, - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - } - } - ] - }, - { - "Input": "سأغادر كل يوم اثنين الساعة 4 مساءً", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3379507+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل يوم اثنين الساعة 4 مساءً", - "Start": 7, - "Length": 27, - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - } - } - ] - }, - { - "Input": "سأغادر كل صباح", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3429518+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل صباح", - "Start": 7, - "Length": 7, - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - } - } - ] - }, - { - "Input": "سأغادر كل صباح في الساعة 9 صباحًا", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3609535+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل صباح في الساعة 9 صباحًا", - "Start": 7, - "Length": 26, - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - } - } - ] - }, - { - "Input": "سأغادر بعد ظهر كل يوم في الساعة 4 مساءً", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3730732+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "بعد ظهر كل يوم في الساعة 4 مساءً", - "Start": 7, - "Length": 32, - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - } - } - ] - }, - { - "Input": "سأغادر كل ليلة في الساعة 9 مساءً", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3840706+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل ليلة في الساعة 9 مساءً", - "Start": 7, - "Length": 25, - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - } - } - ] - }, - { - "Input": "سأغادر كل ليلة في 9", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3930718+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل ليلة في 9", - "Start": 7, - "Length": 12, - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - } - } - ] - }, - { - "Input": "سأغادر كل صباح في الساعة 9 صباحًا", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4065719+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "كل صباح في الساعة 9 صباحًا", - "Start": 7, - "Length": 26, - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - } - } - ] - }, - { - "Input": "سأغادر في الصباح في التاسعة", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4170727+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "في الصباح في التاسعة", - "Start": 7, - "Length": 20, - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - } - } - ] - }, - { - "Input": "سأغادر الساعة 9 صباحًا كل يوم أحد", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4295727+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 9 صباحًا كل يوم أحد", - "Start": 7, - "Length": 26, - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - } - } - ] - }, - { - "Input": "سأغادر الساعة 9 صباحًا أيام الأحد", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.438575+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 9 صباحًا أيام الأحد", - "Start": 7, - "Length": 26, - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - } - } - ] - }, - { - "Input": "سأغادر الساعة 9 صباحًا أيام الأحد", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4505726+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "الساعة 9 صباحًا أيام الأحد", - "Start": 7, - "Length": 26, - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - } - } - ] - }, - { - "Input": "سأغادر أيام الاثنين", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4570731+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "أيام الاثنين", - "Start": 7, - "Length": 12, - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - } - } - ] - }, - { - "Input": "سأغادر يوم الأحد", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4635727+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "يوم الأحد", - "Start": 7, - "Length": 9, - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - } - } - ] - }, - { - "Input": "سأغادر أيام الأحد", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4710739+08:00" - }, - "IgnoreResolution": "true", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "أيام الأحد", - "Start": 7, - "Length": 10, - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - } - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Arabic/TimeExtractor.json b/Specs/DateTime/Arabic/TimeExtractor.json index 2680efcb0c..144216928a 100644 --- a/Specs/DateTime/Arabic/TimeExtractor.json +++ b/Specs/DateTime/Arabic/TimeExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "سأعود في 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7", @@ -13,7 +13,7 @@ }, { "Input": "سأعود في السابعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السابعة", @@ -25,7 +25,7 @@ }, { "Input": "سأعود عند 7 مساء.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7 مساء", @@ -37,7 +37,7 @@ }, { "Input": "سأعود في 7 مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7 مساء", @@ -49,7 +49,7 @@ }, { "Input": "سأعود 7:56 مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56 مساء", @@ -61,7 +61,7 @@ }, { "Input": "سأعود 7:56:35 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56:35 مساءً", @@ -73,7 +73,7 @@ }, { "Input": "سأعود في 7:56:35 مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56:35 مساء", @@ -85,7 +85,7 @@ }, { "Input": "سأعود 12:34", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12:34", @@ -97,7 +97,7 @@ }, { "Input": "سأعود 12:34:20", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12:34:20", @@ -109,7 +109,7 @@ }, { "Input": "سأعود T12:34:20", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "T12:34:20", @@ -121,7 +121,7 @@ }, { "Input": "سأعود 00:00", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "00:00", @@ -133,7 +133,7 @@ }, { "Input": "سأعود 00:00:30", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "00:00:30", @@ -145,7 +145,7 @@ }, { "Input": "إنها الساعة 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 7", @@ -157,7 +157,7 @@ }, { "Input": "إنها الساعة السابعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة", @@ -169,7 +169,7 @@ }, { "Input": "إنها 8 صباحًا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "8 صباحًا", @@ -181,7 +181,7 @@ }, { "Input": "إنها 8 في الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "8 في الليل", @@ -193,7 +193,7 @@ }, { "Input": "إنها الثامنة والنصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثامنة والنصف", @@ -205,7 +205,7 @@ }, { "Input": "إنها الثامنة والنصف مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثامنة والنصف مساءً", @@ -217,7 +217,7 @@ }, { "Input": "إنها الساعة الثامنة و 30 دقيقة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة الثامنة و 30 دقيقة", @@ -229,7 +229,7 @@ }, { "Input": "إنها الثامنة والربع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثامنة والربع", @@ -241,7 +241,7 @@ }, { "Input": "إنها ثامنة والربع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ثامنة والربع", @@ -253,7 +253,7 @@ }, { "Input": "إنها التاسعة مساءً و ثلاثة أرباع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "التاسعة مساءً و ثلاثة أرباع", @@ -265,7 +265,7 @@ }, { "Input": "إنها ثلاث دقائق حتى الثامنة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ثلاث دقائق حتى الثامنة", @@ -277,7 +277,7 @@ }, { "Input": "إنها الساعة السابعة والنصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة والنصف", @@ -289,7 +289,7 @@ }, { "Input": "إنها الساعة السابعة والنصف بعد الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة والنصف بعد الظهر", @@ -325,7 +325,7 @@ }, { "Input": "إنها الساعة الثامنة وعشرين دقيقة مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة الثامنة وعشرين دقيقة مساءً", @@ -337,7 +337,7 @@ }, { "Input": "سأعود بعد الظهر الساعة 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر الساعة 7", @@ -349,7 +349,7 @@ }, { "Input": "سأعود الساعة 7 الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 7 الظهر", @@ -361,7 +361,7 @@ }, { "Input": "سأعود بعد الظهر 7:00", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر 7:00", @@ -373,7 +373,7 @@ }, { "Input": "سأعود بعد الظهر 7:00:14", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر 7:00:14", @@ -385,7 +385,7 @@ }, { "Input": "سأعود بعد الظهر السابعة مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر السابعة مساء", @@ -397,7 +397,7 @@ }, { "Input": "سأعود الساعة السابعة والنصف مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة والنصف مساءً", @@ -409,7 +409,7 @@ }, { "Input": "سأعود في السابعة وخمسة وثلاثين مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السابعة وخمسة وثلاثين مساءً", @@ -421,7 +421,7 @@ }, { "Input": "سأعود في الحادية عشرة والخامسة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادية عشرة والخامسة", @@ -433,7 +433,7 @@ }, { "Input": "سأعود ثلاث دقائق قبل الخامسة والنصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "ثلاث دقائق قبل الخامسة والنصف", @@ -445,7 +445,7 @@ }, { "Input": "سأعود الخامسة وثلاثين في الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الخامسة وثلاثين في الليل", @@ -457,7 +457,7 @@ }, { "Input": "سأعود في الليل الخامسة والنصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الليل الخامسة والنصف", @@ -469,7 +469,7 @@ }, { "Input": "سأعود الظهيرة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الظهيرة", @@ -481,7 +481,7 @@ }, { "Input": "سأعود الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الظهر", @@ -493,7 +493,7 @@ }, { "Input": "سأعود الساعة 12 ظهرا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 12 ظهرا", @@ -505,7 +505,7 @@ }, { "Input": "سأعود في الحادية عشرة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادية عشرة", @@ -517,7 +517,7 @@ }, { "Input": "سأعود الحادية عشرة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادية عشرة", @@ -529,7 +529,7 @@ }, { "Input": "سأعود 340 مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "340 مساء", @@ -541,7 +541,7 @@ }, { "Input": "سأعود 1140 صباحا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1140 صباحا", @@ -553,7 +553,7 @@ }, { "Input": "منتصف الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف الليل", @@ -565,7 +565,7 @@ }, { "Input": "منتصف-الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف-الليل", @@ -577,7 +577,7 @@ }, { "Input": "منتصف الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف الصباح", @@ -589,7 +589,7 @@ }, { "Input": "منتصف-الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف-الصباح", @@ -601,7 +601,7 @@ }, { "Input": "منتصف الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف الظهر", @@ -613,7 +613,7 @@ }, { "Input": "منتصف-الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف-الظهر", @@ -625,7 +625,7 @@ }, { "Input": "منتصف النهار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف النهار", @@ -637,7 +637,7 @@ }, { "Input": "منتصف-النهار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف-النهار", @@ -649,7 +649,7 @@ }, { "Input": "وقت الظهيرة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "وقت الظهيرة", @@ -661,7 +661,7 @@ }, { "Input": "سأعود 7 مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7 مساء", @@ -673,7 +673,7 @@ }, { "Input": "سأعود 7 مساء.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7 مساء", @@ -685,7 +685,7 @@ }, { "Input": "سأعود مساء 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مساء 7", @@ -697,7 +697,7 @@ }, { "Input": "سأعود مساء 7.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "مساء 7", @@ -709,7 +709,7 @@ }, { "Input": "سأعود 7:56 صباحا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56 صباحا", @@ -721,7 +721,7 @@ }, { "Input": "سأعود 7:56:35 في الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56:35 في الصباح", @@ -733,7 +733,7 @@ }, { "Input": "سأعود 7:56:35 الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56:35 الصباح", @@ -745,7 +745,7 @@ }, { "Input": "سأعود 7:56:35 صباحا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56:35 صباحا", @@ -757,7 +757,7 @@ }, { "Input": "سأعود الساعة السابعة والنصف مساءً.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة والنصف مساءً", @@ -769,7 +769,7 @@ }, { "Input": "سأعود السابعة وثلاثين في المساء.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السابعة وثلاثين في المساء", @@ -781,7 +781,7 @@ }, { "Input": "سأعود السابعة وثلاثين المساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السابعة وثلاثين المساء", @@ -793,7 +793,7 @@ }, { "Input": "سأعود السابعة وثلاثين مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السابعة وثلاثين مساء", @@ -805,7 +805,7 @@ }, { "Input": "سأعود 340 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "340 مساءً", @@ -817,7 +817,7 @@ }, { "Input": "سأعود 1140 المساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1140 المساء", @@ -829,17 +829,17 @@ }, { "Input": "الرسائل الإلكترونية التي حصلت على ب كموضوع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "رسائل البريد الإلكتروني التي حصلت على رد", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "سأعود الساعة 12 ظهرا وقت الغداء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 12 ظهرا وقت الغداء", @@ -851,7 +851,7 @@ }, { "Input": "سأعود وقت الغداء الساعة 12 ظهرا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "وقت الغداء الساعة 12 ظهرا", @@ -863,7 +863,7 @@ }, { "Input": "سأعود في وقت الغداء الساعة 12", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "وقت الغداء الساعة 12", @@ -872,5 +872,149 @@ "Type": "time" } ] + }, + { + "Input": "نعم 4:25 مساءً من فضلك", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "4:25 مساءً", + "Start": 4, + "Length": 10, + "Type": "time" + } + ] + }, + { + "Input": "12:09 صباحًا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "12:09 صباحًا", + "Start": 0, + "Length": 12, + "Type": "time" + } + ] + }, + { + "Input": "7:00 ص", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "7:00 ص", + "Start": 0, + "Length": 6, + "Type": "time" + } + ] + }, + { + "Input": "عادةً ما أقوم بإعداد العشاء في حوالي الساعة الثامنة والنصف", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثامنة والنصف", + "Start": 37, + "Length": 21, + "Type": "time" + } + ] + }, + { + "Input": "يجب أن أعود إلى المكتب بحلول الساعة الرابعة والنصف", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الرابعة والنصف", + "Start": 29, + "Length": 21, + "Type": "time" + } + ] + }, + { + "Input": "أود أن أرى مصرفي ظهرًا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "ظهرًا", + "Start": 17, + "Length": 5, + "Type": "time" + } + ] + }, + { + "Input": "إلغاء طلبي بحلول الساعة 12 ظهرًا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة 12 ظهرًا", + "Start": 17, + "Length": 15, + "Type": "time" + } + ] + }, + { + "Input": "الساعة الواحدة وسبع وعشرون دقيقة", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الواحدة وسبع وعشرون دقيقة", + "Start": 0, + "Length": 32, + "Type": "time" + } + ] + }, + { + "Input": "ًًالساعة السابعة والربع صباحا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "السابعة والربع صباحا", + "Start": 9, + "Length": 20, + "Type": "time" + } + ] + }, + { + "Input": "الساعة التاسعة إلا ربع صباحا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة التاسعة إلا ربع صباحا", + "Start": 0, + "Length": 28, + "Type": "time" + } + ] + }, + { + "Input": "الساعة الرابعة والنصف مساءً", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الرابعة والنصف مساءً", + "Start": 0, + "Length": 27, + "Type": "time" + } + ] + }, + { + "Input": "الساعة الثامنة إلا ثلاث وعشرون دقيقة", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثامنة إلا ثلاث وعشرون دقيقة", + "Start": 0, + "Length": 36, + "Type": "time" + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Arabic/TimeParser.json b/Specs/DateTime/Arabic/TimeParser.json index 5f84e08b6f..fb4420cc38 100644 --- a/Specs/DateTime/Arabic/TimeParser.json +++ b/Specs/DateTime/Arabic/TimeParser.json @@ -177,7 +177,7 @@ }, { "Input": "سأعود في 7 صباحا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7 صباحا", @@ -198,7 +198,7 @@ }, { "Input": "سأعود عند 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7", @@ -219,7 +219,7 @@ }, { "Input": "سأعود في السابعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "السابعة", @@ -241,7 +241,7 @@ { "Input": "سأعود في 7 مساء", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7 مساء", @@ -263,7 +263,7 @@ { "Input": "سأعود 7:56 مساءً", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56 مساءً", @@ -285,7 +285,7 @@ { "Input": "سأعود في 7:56:30 مساءً", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56:30 مساءً", @@ -307,7 +307,7 @@ { "Input": "سأعود 7:56:30 مساءً", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56:30 مساءً", @@ -328,7 +328,7 @@ }, { "Input": "سأعود 12:34", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12:34", @@ -349,7 +349,7 @@ }, { "Input": "سأعود 12:34:25", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12:34:25", @@ -370,7 +370,7 @@ }, { "Input": "إنها الساعة 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 7", @@ -391,7 +391,7 @@ }, { "Input": "انها الساعة السابعة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة", @@ -412,7 +412,7 @@ }, { "Input": "إنها 8 صباحًا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "8 صباحًا", @@ -433,7 +433,7 @@ }, { "Input": "إنها 8 في الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "8 في الليل", @@ -455,7 +455,7 @@ { "Input": "انها الثامنة والنصف", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثامنة والنصف", @@ -477,7 +477,7 @@ { "Input": "إنها 8 والنصف مساءً", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "8 والنصف مساءً", @@ -498,7 +498,7 @@ }, { "Input": "إنها الساعة الثامنة و 30 دقيقة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة الثامنة و 30 دقيقة", @@ -519,7 +519,7 @@ }, { "Input": "انها الثامنة والربع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثامنة والربع", @@ -540,7 +540,7 @@ }, { "Input": "انها الثامنة وربع", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثامنة وربع", @@ -562,7 +562,7 @@ { "Input": "إنها 9 مساءً وثلاثة أرباع", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "9 مساءً وثلاثة أرباع", @@ -606,7 +606,7 @@ { "Input": "إنها الساعة السابعة والنصف", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة والنصف", @@ -628,7 +628,7 @@ { "Input": "إنها الساعة السابعة والنصف بعد الظهر", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة والنصف بعد الظهر", @@ -694,7 +694,7 @@ { "Input": "إنها الساعة الثامنة و20 دقيقة مساءً", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة الثامنة و20 دقيقة مساءً", @@ -715,7 +715,7 @@ }, { "Input": "سأعود بعد الظهر الساعة 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر الساعة 7", @@ -736,7 +736,7 @@ }, { "Input": "سأعود الظهر الساعة 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الظهر الساعة 7", @@ -757,7 +757,7 @@ }, { "Input": "سأعود بعد الظهر 7:00", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر 7:00", @@ -778,7 +778,7 @@ }, { "Input": "سأعود بعد الظهر 7:00:05", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر 7:00:05", @@ -799,7 +799,7 @@ }, { "Input": "سأعود بعد الظهر السابعة مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر السابعة مساء", @@ -821,7 +821,7 @@ { "Input": "سأعود الساعة السابعة والنصف مساءً", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة السابعة والنصف مساءً", @@ -865,7 +865,7 @@ { "Input": "سأعود الحادية عشر وعشرين مساء", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادية عشر وعشرين مساء", @@ -886,7 +886,7 @@ }, { "Input": "سأعود الظهيرة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الظهيرة", @@ -907,7 +907,7 @@ }, { "Input": "سأعود الساعة 12 ظهرا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 12 ظهرا", @@ -928,7 +928,7 @@ }, { "Input": "سأعود في الحادية عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادية عشر", @@ -949,7 +949,7 @@ }, { "Input": "سأعود الحادية عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادية عشر", @@ -971,7 +971,7 @@ { "Input": "سأعود 340 مساءً", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "340 مساءً", @@ -1013,7 +1013,7 @@ }, { "Input": "منتصف الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف الليل", @@ -1034,7 +1034,7 @@ }, { "Input": "منتصف-الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف-الليل", @@ -1055,7 +1055,7 @@ }, { "Input": "منتصف الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف الصباح", @@ -1076,7 +1076,7 @@ }, { "Input": "منتصف-الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف-الصباح", @@ -1141,7 +1141,7 @@ }, { "Input": "منتصف النهار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف النهار", @@ -1162,7 +1162,7 @@ }, { "Input": "منتصف-النهار", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "منتصف-النهار", @@ -1183,7 +1183,7 @@ }, { "Input": "وقت الظهيرة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "وقت الظهيرة", @@ -1204,7 +1204,7 @@ }, { "Input": "سأعود 12 وقت الغداء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 وقت الغداء", @@ -1225,7 +1225,7 @@ }, { "Input": "سأعود 12 منتصف الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 منتصف الليل", @@ -1290,7 +1290,7 @@ }, { "Input": "سأعود الساعة 12 ظهرا وقت الغداء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 12 ظهرا وقت الغداء", @@ -1354,7 +1354,7 @@ }, { "Input": "سأعود في وقت الغداء الساعة 11 صباحا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "وقت الغداء الساعة 11 صباحا", @@ -1376,7 +1376,7 @@ { "Input": "سأعود 7:56:13 مساءً", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "7:56:13 مساءً", @@ -1397,7 +1397,7 @@ }, { "Input": "سأعود 12:34:45", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12:34:45", @@ -1418,7 +1418,7 @@ }, { "Input": "سأعود بعد الظهر 7:00:25", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر 7:00:25", @@ -1461,7 +1461,7 @@ }, { "Input": "سأعود أحد عشر وخمسة", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "أحد عشر وخمسة", @@ -1505,7 +1505,7 @@ { "Input": "سأعود خمسة وثلاثين في الليل", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "خمسة وثلاثين في الليل", @@ -1527,7 +1527,7 @@ { "Input": "سأعود في الليلة الخامسة والنصف", "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الليلة الخامسة والنصف", @@ -1548,7 +1548,7 @@ }, { "Input": "سأعود الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الظهر", @@ -1569,7 +1569,7 @@ }, { "Input": "سأعود في وقت الغداء الساعة 12 ظهرا", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "وقت الغداء الساعة 12 ظهرا", @@ -1587,5 +1587,257 @@ } } ] + }, + { + "Input": "نعم 4:25 مساءً من فضلك", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "4:25 مساءً", + "Start": 4, + "Length": 10, + "Type": "time", + "Value": { + "Timex": "T16:25", + "FutureResolution": { + "time": "16:25:00" + }, + "PastResolution": { + "time": "16:25:00" + } + } + } + ] + }, + { + "Input": "12:09 صباحًا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "12:09 صباحًا", + "Start": 0, + "Length": 12, + "Type": "time", + "Value": { + "Timex": "T00:09", + "FutureResolution": { + "time": "00:09:00" + }, + "PastResolution": { + "time": "00:09:00" + } + } + } + ] + }, + { + "Input": "7:00 ص", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "7:00 ص", + "Start": 0, + "Length": 6, + "Type": "time", + "Value": { + "Timex": "T07:00", + "FutureResolution": { + "time": "07:00:00" + }, + "PastResolution": { + "time": "07:00:00" + } + } + } + ] + }, + { + "Input": "عادةً ما أقوم بإعداد العشاء في حوالي الساعة الثامنة والنصف", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثامنة والنصف", + "Start": 37, + "Length": 6, + "Type": "time", + "Value": { + "Timex": "T08:30", + "FutureResolution": { + "time": "08:30:00" + }, + "PastResolution": { + "time": "08:30:00" + } + } + } + ] + }, + { + "Input": "يجب أن أعود إلى المكتب بحلول الساعة الرابعة والنصف", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الرابعة والنصف", + "Start": 29, + "Length": 21, + "Type": "time", + "Value": { + "Timex": "T04:30", + "FutureResolution": { + "time": "04:30:00" + }, + "PastResolution": { + "time": "04:30:00" + } + } + } + ] + }, + { + "Input": "أود أن أرى مصرفي ظهرًا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "ظهرًا", + "Start": 17, + "Length": 5, + "Type": "time", + "Value": { + "Timex": "T12", + "FutureResolution": { + "time": "12:00:00" + }, + "PastResolution": { + "time": "12:00:00" + } + } + } + ] + }, + { + "Input": "إلغاء طلبي بحلول الساعة 12 ظهرًا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة 12 ظهرًا", + "Start": 17, + "Length": 15, + "Type": "time", + "Value": { + "Timex": "T12", + "FutureResolution": { + "time": "12:00:00" + }, + "PastResolution": { + "time": "12:00:00" + } + } + } + ] + }, + { + "Input": "الساعة الواحدة وسبع وعشرون دقيقة", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الواحدة وسبع وعشرون دقيقة", + "Start": 0, + "Length": 32, + "Type": "time", + "Value": { + "Timex": "T01:27", + "FutureResolution": { + "time": "01:27:00" + }, + "PastResolution": { + "time": "01:27:00" + } + } + } + ] + }, + { + "Input": "الساعة السابعة والربع صباحاً", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة السابعة والربع صباحا", + "Start": 9, + "Length": 20, + "Type": "time", + "Value": { + "Timex": "T07:15", + "FutureResolution": { + "time": "07:15:00" + }, + "PastResolution": { + "time": "07:15:00" + } + } + } + ] + }, + { + "Input": "الساعة التاسعة إلا ربع صباحا", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة التاسعة إلا ربع صباحا", + "Start": 0, + "Length": 28, + "Type": "time", + "Value": { + "Timex": "T08:45", + "FutureResolution": { + "time": "08:45:00" + }, + "PastResolution": { + "time": "08:45:00" + } + } + } + ] + }, + { + "Input": "الساعة الرابعة والنصف مساء", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الرابعة والنصف مساء", + "Start": 0, + "Length": 27, + "Type": "time", + "Value": { + "Timex": "T16:30", + "FutureResolution": { + "time": "16:30:00" + }, + "PastResolution": { + "time": "16:30:00" + } + } + } + ] + }, + { + "Input": "الساعة الثامنة إلا ثلاث وعشرون دقيقة", + "NotSupportedByDesign": "java, javascript", + "Results": [ + { + "Text": "الساعة الثامنة إلا ثلاث وعشرون دقيقة", + "Start": 0, + "Length": 36, + "Type": "time", + "Value": { + "Timex": "T07:37", + "FutureResolution": { + "time": "07:37:00" + }, + "PastResolution": { + "time": "07:37:00" + } + } + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Arabic/TimePeriodExtractor.json b/Specs/DateTime/Arabic/TimePeriodExtractor.json index 6cd465bf28..5f96369c5f 100644 --- a/Specs/DateTime/Arabic/TimePeriodExtractor.json +++ b/Specs/DateTime/Arabic/TimePeriodExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "سأخرج من 5 إلى 6 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 5 إلى 6 مساءً", @@ -13,7 +13,7 @@ }, { "Input": "سأخرج من 5 إلى 6 في المساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 5 إلى 6 في المساء", @@ -25,7 +25,7 @@ }, { "Input": "سأخرج من 5 إلى 6 بعد الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 5 إلى 6 بعد الظهر", @@ -49,7 +49,7 @@ }, { "Input": "سأخرج من الخامسة إلى السادسة مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من الخامسة إلى السادسة مساءً", @@ -61,7 +61,7 @@ }, { "Input": "سأخرج بين الخامسة والسادسة مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين الخامسة والسادسة مساءً", @@ -73,7 +73,7 @@ }, { "Input": "سأخرج بين الساعة 5 و 6 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين الساعة 5 و 6 مساءً", @@ -85,7 +85,7 @@ }, { "Input": "سأخرج بين الخامسة والسادسة بعد الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين الخامسة والسادسة بعد الظهر", @@ -97,7 +97,7 @@ }, { "Input": "سأكون بالخارج من 4 مساءً حتى 5 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4 مساءً حتى 5 مساءً", @@ -109,7 +109,7 @@ }, { "Input": "سأخرج الساعة 4 حتى 5 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 4 حتى 5 مساءً", @@ -121,7 +121,7 @@ }, { "Input": "سأكون بالخارج من 4:00 حتى 5 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4:00 حتى 5 مساءً", @@ -133,7 +133,7 @@ }, { "Input": "سأخرج الساعة 4:00 حتى 5 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 4:00 حتى 5 مساءً", @@ -145,7 +145,7 @@ }, { "Input": "سأكون بالخارج من الساعة 4:00 إلى الساعة 7", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من الساعة 4:00 إلى الساعة 7", @@ -157,7 +157,7 @@ }, { "Input": "سأخرج من 3 مساءً حتى السابعة والنصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 3 مساءً حتى السابعة والنصف", @@ -169,7 +169,7 @@ }, { "Input": "سأكون بالخارج 4-5 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4-5 مساءً", @@ -181,7 +181,7 @@ }, { "Input": "سأكون بالخارج من 4 إلى 5 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4 إلى 5 مساءً", @@ -193,7 +193,7 @@ }, { "Input": "سأخرج الثالثة إلا 20 دقيقة إلى الثامنة مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثالثة إلا 20 دقيقة إلى الثامنة مساءً", @@ -205,7 +205,7 @@ }, { "Input": "سأخرج من 4 مساءً إلى 5 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 4 مساءً إلى 5 مساءً", @@ -217,7 +217,7 @@ }, { "Input": "سأخرج من الرابعة مساءً حتى الخامسة والنصف", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من الرابعة مساءً حتى الخامسة والنصف", @@ -229,7 +229,7 @@ }, { "Input": "سأخرج من 3 صباحًا حتى 5 مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 3 صباحًا حتى 5 مساء", @@ -241,7 +241,7 @@ }, { "Input": "سأخرج من الثالثة صباحا حتى الخامسة بعد الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من الثالثة صباحا حتى الخامسة بعد الظهر", @@ -265,7 +265,7 @@ }, { "Input": "سأخرج بين 3 صباحًا و 5 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 3 صباحًا و 5 مساءً", @@ -277,7 +277,7 @@ }, { "Input": "دعنا نلتقي في الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الصباح", @@ -289,7 +289,7 @@ }, { "Input": "دعنا نلتقي بعد الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر", @@ -301,7 +301,7 @@ }, { "Input": "دعنا نلتقي في الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الليل", @@ -313,7 +313,7 @@ }, { "Input": "دعنا نلتقي في المساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في المساء", @@ -325,7 +325,7 @@ }, { "Input": "دعنا نلتقي في الأمسيات", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الأمسيات", @@ -337,7 +337,7 @@ }, { "Input": "دعونا نجتمع في الصباح الباكر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الصباح الباكر", @@ -349,7 +349,7 @@ }, { "Input": "دعونا نجتمع في أواخر الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في أواخر الصباح", @@ -361,7 +361,7 @@ }, { "Input": "دعنا نلتقي في الصباح الباكر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في الصباح الباكر", @@ -373,7 +373,7 @@ }, { "Input": "دعنا نلتقي في وقت متأخر من الصباح", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت متأخر من الصباح", @@ -385,7 +385,7 @@ }, { "Input": "دعونا نجتمع في وقت مبكر بعد الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت مبكر بعد الظهر", @@ -397,7 +397,7 @@ }, { "Input": "دعونا نجتمع في وقت متأخر بعد الظهر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت متأخر بعد الظهر", @@ -409,7 +409,7 @@ }, { "Input": "دعنا نلتقي في وقت مبكر من المساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت مبكر من المساء", @@ -421,7 +421,7 @@ }, { "Input": "دعنا نلتقي في وقت متأخر من المساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت متأخر من المساء", @@ -433,7 +433,7 @@ }, { "Input": "دعونا نجتمع في وقت مبكر من الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت مبكر من الليل", @@ -445,7 +445,7 @@ }, { "Input": "دعنا نلتقي عند وقت متأخر من الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "عند وقت متأخر من الليل", @@ -457,7 +457,7 @@ }, { "Input": "دعنا نلتقي في أول الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في أول الليل", @@ -469,7 +469,7 @@ }, { "Input": "دعنا نلتقي في وقت متأخر من الليل", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "في وقت متأخر من الليل", @@ -481,7 +481,7 @@ }, { "Input": "عقد اجتماع من الثانية إلى الخامسة مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من الثانية إلى الخامسة مساءً", @@ -493,7 +493,7 @@ }, { "Input": "حفلة في جينز من 6 إلى 11 مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 6 إلى 11 مساء", @@ -505,7 +505,7 @@ }, { "Input": "عقد الاجتماع من الساعة 14:00 إلى الساعة 16:30", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من الساعة 14:00 إلى الساعة 16:30", @@ -517,7 +517,7 @@ }, { "Input": "عقد اجتماع من اثنين إلى خمسة مساء", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من اثنين إلى خمسة مساء", @@ -529,7 +529,7 @@ }, { "Input": "عقد الاجتماع الساعة 1 بعد الظهر إلى 4", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 1 بعد الظهر إلى 4", @@ -541,7 +541,7 @@ }, { "Input": "عقد الاجتماع الساعة من 1 بعد الظهر إلى 4", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1 بعد الظهر إلى 4", @@ -553,7 +553,7 @@ }, { "Input": "قم بإعداد الاجتماع 1:30 بعد الظهر إلى 4!", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1:30 بعد الظهر إلى 4", @@ -565,7 +565,7 @@ }, { "Input": "قم بإعداد الاجتماع 1:30 بعد الظهر. إلى 4 أشخاص", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر", @@ -577,7 +577,7 @@ }, { "Input": "مرحبًا كورتانا - يرجى تحديد موعد لقاء سكايب مع جينيفر. أحتاج إلى اجتماع مدته 30 دقيقة في فترة ما بعد الظهر ، وسأغادر يوم الجمعة.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر", @@ -589,7 +589,7 @@ }, { "Input": "مرحبًا كورتانا - يرجى تحديد موعد لقاء سكايب مع جينيفر. أحتاج إلى اجتماع مدته 30 دقيقة يوم الجمعة ، وسأغادر بعد الظهر.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بعد الظهر", @@ -601,7 +601,7 @@ }, { "Input": "عقد الاجتماع من 1:30 إلى 3:30", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1:30 إلى 3:30", @@ -613,7 +613,7 @@ }, { "Input": "عقد الاجتماع من 1:30 مساءً إلى 3:30 ", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1:30 مساءً إلى 3:30", @@ -625,7 +625,7 @@ }, { "Input": "عقد الاجتماع من 1:30 مساءً إلى 3:30 مساءً", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1:30 مساءً إلى 3:30 مساءً", @@ -637,7 +637,7 @@ }, { "Input": "عقد الاجتماع من 1 إلى 3:30", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1 إلى 3:30", @@ -649,7 +649,7 @@ }, { "Input": "عقد الاجتماع من 1:30 إلى 3", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1:30 إلى 3", diff --git a/Specs/DateTime/Arabic/TimePeriodParser.json b/Specs/DateTime/Arabic/TimePeriodParser.json index fd27762997..2c0da08825 100644 --- a/Specs/DateTime/Arabic/TimePeriodParser.json +++ b/Specs/DateTime/Arabic/TimePeriodParser.json @@ -5,7 +5,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 5 إلى 6 مساءً", @@ -32,7 +32,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 5 إلى 6 في المساء", @@ -86,7 +86,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين الساعة 5 و 6 مساءً", @@ -113,7 +113,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "بين 5 و 6 مساءً", @@ -248,7 +248,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الساعة 4 حتى 5 مساءً", @@ -275,7 +275,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من الساعة 4:00 إلى الساعة 7", @@ -329,7 +329,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4 - 5 مساءً", @@ -922,7 +922,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1:30 بعد الظهر إلى 4", @@ -976,7 +976,7 @@ "ReferenceDateTime": "2017-12-01T13:37:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1:30 مساءً إلى 3:30", @@ -1003,7 +1003,7 @@ "ReferenceDateTime": "2017-12-01T13:37:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1:30 مساءً إلى 3:30 مساء", @@ -1056,7 +1056,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 3 إلى 3:30", @@ -1083,7 +1083,7 @@ "ReferenceDateTime": "2017-12-01T13:37:00" }, "IgnoreResolution": "true", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "من 1:30 إلى 3", diff --git a/Specs/DateTime/Catalan/DateExtractor.json b/Specs/DateTime/Catalan/DateExtractor.json new file mode 100644 index 0000000000..3bbd686844 --- /dev/null +++ b/Specs/DateTime/Catalan/DateExtractor.json @@ -0,0 +1,156 @@ +[ + { + "Input": "Tornaré el 22 d'abril", + "Results": [ + { + "Text": "22 d'abril", + "Type": "date", + "Start": 11, + "Length": 10 + } + ] + }, + { + "Input": "Tornaré el 21/04/16", + "Results": [ + { + "Text": "21/04/16", + "Type": "date", + "Start": 11, + "Length": 8 + } + ] + }, + { + "Input": "tornaré avui", + "Results": [ + { + "Text": "avui", + "Type": "date", + "Start": 8, + "Length": 4 + } + ] + }, + { + "Input": "tornaré demà", + "Results": [ + { + "Text": "demà", + "Type": "date", + "Start": 8, + "Length": 4 + } + ] + }, + { + "Input": "Tornaré el 15 de juny de 2016", + "Results": [ + { + "Text": "15 de juny de 2016", + "Type": "date", + "Start": 11, + "Length": 18 + } + ] + }, + { + "Input": "Tornaré el 21", + "Results": [ + { + "Text": "21", + "Type": "date", + "Start": 11, + "Length": 2 + } + ] + }, + { + "Input": "Tornaré el dia 3", + "Results": [ + { + "Text": "3", + "Type": "date", + "Start": 15, + "Length": 1 + } + ] + }, + { + "Input": "Vaig marxar d'aquí el 5 de desembre de 1391", + "Results": [ + { + "Text": "5 de desembre de 1391", + "Type": "date", + "Start": 22, + "Length": 21 + } + ] + }, + { + "Input": "l'1 de l'1 de 2023", + "Results": [ + { + "Text": "1 de l'1 de 2023", + "Type": "date", + "Start": 2, + "Length": 16 + } + ] + }, + { + "Input": "el 31 de l'1", + "Results": [ + { + "Text": "31 de l'1", + "Type": "date", + "Start": 3, + "Length": 9 + } + ] + }, + { + "Input": "l'u de gener de 2000", + "Results": [ + { + "Text": "u de gener de 2000", + "Type": "date", + "Start": 2, + "Length": 18 + } + ] + }, + { + "Input": "l'u de gener de l'any 2000", + "Results": [ + { + "Text": "u de gener de l'any 2000", + "Type": "date", + "Start": 2, + "Length": 24 + } + ] + }, + { + "Input": "u de l'u del 2001", + "Results": [ + { + "Text": "u de l'u del 2001", + "Type": "date", + "Start": 0, + "Length": 17 + } + ] + }, + { + "Input": "el dia 1 de gener de l'any 2000", + "Results": [ + { + "Text": "el dia 1 de gener de l'any 2000", + "Type": "date", + "Start": 0, + "Length": 31 + } + ] + } +] diff --git a/Specs/DateTime/Catalan/DateParser.json b/Specs/DateTime/Catalan/DateParser.json new file mode 100644 index 0000000000..d9ac08bf10 --- /dev/null +++ b/Specs/DateTime/Catalan/DateParser.json @@ -0,0 +1,416 @@ +[ + { + "Input": "Tornaré al 2 d'octubre", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "2 d'octubre", + "Type": "date", + "Value": { + "Timex": "XXXX-10-02", + "FutureResolution": { + "date": "2017-10-02" + }, + "PastResolution": { + "date": "2016-10-02" + } + }, + "Start": 11, + "Length": 11 + } + ] + }, + { + "Input": "Tornaré el 12 de gener de 2016", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "12 de gener de 2016", + "Type": "date", + "Value": { + "Timex": "2016-01-12", + "FutureResolution": { + "date": "2016-01-12" + }, + "PastResolution": { + "date": "2016-01-12" + } + }, + "Start": 11, + "Length": 19 + } + ] + }, + { + "Input": "Tornaré el dilluns 12 de gener de 2016", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "dilluns 12 de gener de 2016", + "Type": "date", + "Value": { + "Timex": "2016-01-12", + "FutureResolution": { + "date": "2016-01-12" + }, + "PastResolution": { + "date": "2016-01-12" + } + }, + "Start": 11, + "Length": 27 + } + ] + }, + { + "Input": "Tornaré el 21/04/16", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "21/04/16", + "Type": "date", + "Value": { + "Timex": "2016-04-21", + "FutureResolution": { + "date": "2016-04-21" + }, + "PastResolution": { + "date": "2016-04-21" + } + }, + "Start": 11, + "Length": 8 + } + ] + }, + { + "Input": "Tornaré el dimecres 22 de gener", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "dimecres 22 de gener", + "Type": "date", + "Value": { + "Timex": "XXXX-01-22", + "FutureResolution": { + "date": "2017-01-22" + }, + "PastResolution": { + "date": "2016-01-22" + } + }, + "Start": 11, + "Length": 20 + } + ] + }, + { + "Input": "Tornaré el vint-i-un de maig", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "vint-i-un de maig", + "Type": "date", + "Value": { + "Timex": "XXXX-05-21", + "FutureResolution": { + "date": "2017-05-21" + }, + "PastResolution": { + "date": "2016-05-21" + } + }, + "Start": 11, + "Length": 17 + } + ] + }, + { + "Input": "Tornaré el dia dotze de novembre.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "el dia dotze de novembre", + "Type": "date", + "Value": { + "Timex": "XXXX-11-12", + "FutureResolution": { + "date": "2023-11-12" + }, + "PastResolution": { + "date": "2022-11-12" + } + }, + "Start": 5, + "Length": 27 + } + ] + }, + { + "Input": "Tornaré el 3-7-2017", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "3-7-2017", + "Type": "date", + "Value": { + "Timex": "2017-07-03", + "FutureResolution": { + "date": "2017-07-03" + }, + "PastResolution": { + "date": "2017-07-03" + } + }, + "Start": 11, + "Length": 8 + } + ] + }, + { + "Input": "Tornaré el 05/05/89", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "05/05/89", + "Type": "date", + "Value": { + "Timex": "1989-05-05", + "FutureResolution": { + "date": "1989-05-05" + }, + "PastResolution": { + "date": "1989-05-05" + } + }, + "Start": 11, + "Length": 8 + } + ] + }, + { + "Input": "Tornaré el 21", + "Context": { + "ReferenceDateTime": "2023-12-11T01:00:00" + }, + "Results": [ + { + "Text": "21", + "Type": "date", + "Value": { + "Timex": "XXXX-XX-21", + "FutureResolution": { + "date": "2023-12-21" + }, + "PastResolution": { + "date": "2023-11-21" + } + }, + "Start": 11, + "Length": 2 + } + ] + }, + { + "Input": "Tornaré el dia 3", + "Context": { + "ReferenceDateTime": "2023-12-11T01:00:00" + }, + "Results": [ + { + "Text": "3", + "Type": "date", + "Value": { + "Timex": "XXXX-XX-03", + "FutureResolution": { + "date": "2024-01-03" + }, + "PastResolution": { + "date": "2023-12-03" + } + }, + "Start": 11, + "Length": 1 + } + ] + }, + { + "Input": "aquest article es va publicar el 06/10/2020", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "06/10/2020", + "Type": "date", + "Value": { + "Timex": "2020-10-06", + "FutureResolution": { + "date": "2020-10-06" + }, + "PastResolution": { + "date": "2020-10-06" + } + }, + "Start": 33, + "Length": 10 + } + ] + }, + { + "Input": "l'1 de l'1 de 2023", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "1 de l'1 de 2023", + "Type": "date", + "Value": { + "Timex": "2023-01-01", + "FutureResolution": { + "date": "2023-01-01" + }, + "PastResolution": { + "date": "2023-01-01" + } + }, + "Start": 2, + "Length": 17 + } + ] + }, + { + "Input": "el 31 de l'1", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "31 de l'1", + "Type": "date", + "Value": { + "Timex": "XXXX-01-31", + "FutureResolution": { + "date": "2017-01-31" + }, + "PastResolution": { + "date": "2016-01-31" + } + }, + "Start": 3, + "Length": 11 + } + ] + }, + { + "Input": "l'u de gener de 2000", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "u de gener de 2000", + "Type": "date", + "Value": { + "Timex": "2000-01-01", + "FutureResolution": { + "date": "2000-01-01" + }, + "PastResolution": { + "date": "2000-01-01" + } + }, + "Start": 2, + "Length": 18 + } + ] + }, + { + "Input": "l'u de gener de l'any 2000", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "u de gener de l'any 2000", + "Type": "date", + "Value": { + "Timex": "2000-01-01", + "FutureResolution": { + "date": "2000-01-01" + }, + "PastResolution": { + "date": "2000-01-01" + } + }, + "Start": 2, + "Length": 24 + } + ] + }, + { + "Input": "u de l'u del 2001", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "u de l'u del 2001", + "Type": "date", + "Value": { + "Timex": "2001-01-01", + "FutureResolution": { + "date": "2001-01-01" + }, + "PastResolution": { + "date": "2001-01-01" + } + }, + "Start": 0, + "Length": 17 + } + ] + }, + { + "Input": "el dia 1 de gener de l'any 2000", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "el dia 1 de gener de l'any 2000", + "Type": "date", + "Value": { + "Timex": "2000-01-01", + "FutureResolution": { + "date": "2000-01-01" + }, + "PastResolution": { + "date": "2000-01-01" + } + }, + "Start": 0, + "Length": 31 + } + ] + } +] diff --git a/Specs/DateTime/Catalan/DateTimeModel.json b/Specs/DateTime/Catalan/DateTimeModel.json new file mode 100644 index 0000000000..d10d53606c --- /dev/null +++ b/Specs/DateTime/Catalan/DateTimeModel.json @@ -0,0 +1,109 @@ +[ + { + "Input": "Vindré el 21", + "Context": { + "ReferenceDateTime": "2023-12-11T01:00:00" + }, + "Results": [ + { + "Text": "21", + "Start": 10, + "End": 11, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-XX-21", + "type": "date", + "value": "2023-11-21" + }, + { + "timex": "XXXX-XX-21", + "type": "date", + "value": "2023-12-21" + } + ] + } + } + ] + }, + { + "Input": "Vindré el dia 3", + "Context": { + "ReferenceDateTime": "2023-12-11T01:00:00" + }, + "Results": [ + { + "Text": "3", + "Start": 14, + "End": 14, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-XX-03", + "type": "date", + "value": "2023-12-03" + }, + { + "timex": "XXXX-XX-03", + "type": "date", + "value": "2024-01-03" + } + ] + } + } + ] + }, + { + "Input": "Sortiré a 2:15", + "Context": { + "ReferenceDateTime": "2023-12-11T01:00:00" + }, + "Results": [ + { + "Text": "2:15", + "Start": 10, + "End": 13, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T02:15", + "type": "time", + "value": "02:15:00" + }, + { + "timex": "T14:15", + "type": "time", + "value": "14:15:00" + } + ] + } + } + ] + }, + { + "Input": "Sortiré a 7:30 de la tarda", + "Context": { + "ReferenceDateTime": "2023-12-11T01:00:00" + }, + "Results": [ + { + "Text": "7:30 de la tarda", + "Start": 10, + "End": 25, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T19:30", + "type": "time", + "value": "19:30:00" + } + ] + } + } + ] + } +] diff --git a/Specs/DateTime/Catalan/TimeExtractor.json b/Specs/DateTime/Catalan/TimeExtractor.json new file mode 100644 index 0000000000..6f3397cfcf --- /dev/null +++ b/Specs/DateTime/Catalan/TimeExtractor.json @@ -0,0 +1,156 @@ +[ + { + "Input": "Tornaré a les 7", + "Results": [ + { + "Text": "7", + "Type": "time", + "Start": 14, + "Length": 1 + } + ] + }, + { + "Input": "Tornaré a les set", + "Results": [ + { + "Text": "set", + "Type": "time", + "Start": 14, + "Length": 3 + } + ] + }, + { + "Input": "Tornaré a les 7 de la tarda", + "Results": [ + { + "Text": "7 de la tarda", + "Type": "time", + "Start": 14, + "Length": 13 + } + ] + }, + { + "Input": "Tornaré a 7 de la tarda", + "Results": [ + { + "Text": "7 de la tarda", + "Type": "time", + "Start": 10, + "Length": 13 + } + ] + }, + { + "Input": "Tornaré a 2:15", + "Results": [ + { + "Text": "2:15", + "Type": "time", + "Start": 10, + "Length": 4 + } + ] + }, + { + "Input": "Tornaré al migdia", + "Results": [ + { + "Text": "migdia", + "Type": "time", + "Start": 11, + "Length": 6 + } + ] + }, + { + "Input": "Tornaré a les 7:56:35", + "Results": [ + { + "Text": "7:56:35", + "Type": "time", + "Start": 14, + "Length": 7 + } + ] + }, + { + "Input": "Són tres minuts per a les vuit", + "Results": [ + { + "Text": "tres minuts per a les vuit", + "Type": "time", + "Start": 4, + "Length": 26 + } + ] + }, + { + "Input": "Tornaré a les set i trenta p. m.", + "Results": [ + { + "Text": "set i trenta p. m.", + "Type": "time", + "Start": 14, + "Length": 18 + } + ] + }, + { + "Input": "un quart de nou", + "Results": [ + { + "Text": "un quart de nou", + "Type": "time", + "Start": 0, + "Length":15 + } + ] + }, + { + "Input": "Hi ha vol cap a un quart de 14:00?", + "Results": [ + { + "Text": " un quart de 14", + "Type": "time", + "Start": 15, + "Length": 15 + } + ] + }, + { + "Input": "dues menys quart", + "Results": [ + { + "Text": "dues menys quart", + "Type": "time", + "Start": 0, + "Length": 16 + } + ] + }, + { + "Input": "Son tres quarts de set", + "Results": [ + { + "Text": " tres quarts de set", + "Type": "time", + "Start": 3, + "Length": 19 + } + ] + }, + { + "Input": "3/4 d'onze", + "Results": [ + { + "Text": "3/4 d'onze", + "Type": "time", + "Start": 0, + "Length": 10 + } + ] + } +] diff --git a/Specs/DateTime/Catalan/TimeParser.json b/Specs/DateTime/Catalan/TimeParser.json new file mode 100644 index 0000000000..0b22e7e1ea --- /dev/null +++ b/Specs/DateTime/Catalan/TimeParser.json @@ -0,0 +1,262 @@ +[ + { + "Input": "posa l'alarma a les vuit i quaranta", + "Results": [ + { + "Text": "vuit i quaranta", + "Type": "time", + "Value": { + "Timex": "T08:40", + "FutureResolution": { + "time": "08:40:00" + }, + "PastResolution": { + "time": "08:40:00" + } + }, + "Start": 20, + "Length": 15 + } + ] + }, + { + "Input": "posa l'alarma a les vuit quaranta del matí", + "Results": [ + { + "Text": "vuit quaranta del matí", + "Type": "time", + "Value": { + "Timex": "T08:40", + "FutureResolution": { + "time": "08:40:00" + }, + "PastResolution": { + "time": "08:40:00" + } + }, + "Start": 20, + "Length": 22 + } + ] + }, + { + "Input": "Tornaré a les 7 de la tarda", + "Results": [ + { + "Text": "7 de la tarda", + "Type": "time", + "Value": { + "Timex": "T19", + "FutureResolution": { + "time": "19:00:00" + }, + "PastResolution": { + "time": "19:00:00" + } + }, + "Start": 14, + "Length": 3 + } + ] + }, + { + "Input": "Tornaré a les 12:34", + "Results": [ + { + "Text": "12:34", + "Type": "time", + "Value": { + "Timex": "T12:34", + "FutureResolution": { + "time": "12:34:00" + }, + "PastResolution": { + "time": "12:34:00" + } + }, + "Start": 14, + "Length": 5 + } + ] + }, + { + "Input": "Tornaré a 7 de la tarda", + "Results": [ + { + "Text": "7 de la tarda", + "Type": "time", + "Value": { + "Timex": "T19", + "FutureResolution": { + "time": "19:00:00" + }, + "PastResolution": { + "time": "19:00:00" + } + }, + "Start": 10, + "Length": 13 + } + ] + }, + { + "Input": "Tornaré a 2:15", + "Results": [ + { + "Text": "2:15", + "Type": "time", + "Value": { + "Timex": "T02:15", + "FutureResolution": { + "time": "02:15:00" + }, + "PastResolution": { + "time": "02:15:00" + } + }, + "Start": 10, + "Length": 3 + } + ] + }, + { + "Input": "Tornaré a les set i mitja de la tarda", + "Results": [ + { + "Text": "set i mitja de la tarda", + "Type": "time", + "Value": { + "Timex": "T19:30", + "FutureResolution": { + "time": "19:30:00" + }, + "PastResolution": { + "time": "19:30:00" + } + }, + "Start": 14, + "Length": 23 + } + ] + }, + { + "Input": "migdia", + "Results": [ + { + "Text": "migdia", + "Type": "time", + "Value": { + "Timex": "T12", + "FutureResolution": { + "time": "12:00:00" + }, + "PastResolution": { + "time": "12:00:00" + } + }, + "Start": 0, + "Length": 6 + } + ] + }, + { + "Input": "un quart de nou", + "Results": [ + { + "Text": "un quart de nou", + "Type": "time", + "Value": { + "Timex": "T08:15", + "FutureResolution": { + "time": "08:15:00" + }, + "PastResolution": { + "time": "08:15:00" + } + }, + "Start": 0, + "Length": 15 + } + ] + }, + { + "Input": "Hi ha vol cap a un quart de 14:00?", + "Results": [ + { + "Text": " un quart de 14", + "Type": "time", + "Value": { + "Timex": "T13:15", + "FutureResolution": { + "time": "13:15:00" + }, + "PastResolution": { + "time": "13:15:00" + } + }, + "Start": 15, + "Length": 15 + } + ] + }, + { + "Input": "dues menys quart", + "Results": [ + { + "Text": "dues menys quart", + "Type": "time", + "Value": { + "Timex": "T01:45", + "FutureResolution": { + "time": "01:45:00" + }, + "PastResolution": { + "time": "01:45:00" + } + }, + "Start": 0, + "Length": 16 + } + ] + }, + { + "Input": "Son tres quarts de set", + "Results": [ + { + "Text": " tres quarts de set", + "Type": "time", + "Value": { + "Timex": "T06:45", + "FutureResolution": { + "time": "06:45:00" + }, + "PastResolution": { + "time": "06:45:00" + } + }, + "Start": 3, + "Length": 19 + } + ] + }, + { + "Input": "3/4 d'onze", + "Results": [ + { + "Text": "3/4 d'onze", + "Type": "time", + "Value": { + "Timex": "T10:45", + "FutureResolution": { + "time": "10:45:00" + }, + "PastResolution": { + "time": "10:45:00" + } + }, + "Start": 0, + "Length": 10 + } + ] + } +] diff --git a/Specs/DateTime/Chinese/DatePeriodExtractor.json b/Specs/DateTime/Chinese/DatePeriodExtractor.json index 6041e73478..a14a4e39bd 100644 --- a/Specs/DateTime/Chinese/DatePeriodExtractor.json +++ b/Specs/DateTime/Chinese/DatePeriodExtractor.json @@ -617,5 +617,38 @@ "Length": 19 } ] + }, + { + "Input": "下下周末", + "Results": [ + { + "Text": "下下周末", + "Type": "daterange", + "Start": 0, + "Length": 4 + } + ] + }, + { + "Input": "会议在下下周", + "Results": [ + { + "Text": "下下周", + "Type": "daterange", + "Start": 3, + "Length": 3 + } + ] + }, + { + "Input": "下下周如何", + "Results": [ + { + "Text": "下下周", + "Type": "daterange", + "Start": 0, + "Length": 3 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Chinese/DatePeriodParser.json b/Specs/DateTime/Chinese/DatePeriodParser.json index e22640ae98..b3024664e9 100644 --- a/Specs/DateTime/Chinese/DatePeriodParser.json +++ b/Specs/DateTime/Chinese/DatePeriodParser.json @@ -1679,5 +1679,83 @@ "Length": 19 } ] + }, + { + "Input": "下下周末", + "Context": { + "ReferenceDateTime": "2017-03-22T00:00:00" + }, + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "下下周末", + "Type": "daterange", + "Value": { + "Timex": "2017-W13-WE", + "FutureResolution": { + "startDate": "2017-04-01", + "endDate": "2017-04-03" + }, + "PastResolution": { + "startDate": "2017-04-01", + "endDate": "2017-04-03" + } + }, + "Start": 0, + "Length": 4 + } + ] + }, + { + "Input": "会议在下下周", + "Context": { + "ReferenceDateTime": "2017-03-22T00:00:00" + }, + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "下下周", + "Type": "daterange", + "Value": { + "Timex": "2017-W13", + "FutureResolution": { + "startDate": "2017-03-27", + "endDate": "2017-04-03" + }, + "PastResolution": { + "startDate": "2017-03-27", + "endDate": "2017-04-03" + } + }, + "Start": 3, + "Length": 3 + } + ] + }, + { + "Input": "下下周如何", + "Context": { + "ReferenceDateTime": "2017-03-22T00:00:00" + }, + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "下下周", + "Type": "daterange", + "Value": { + "Timex": "2017-W13", + "FutureResolution": { + "startDate": "2017-03-27", + "endDate": "2017-04-03" + }, + "PastResolution": { + "startDate": "2017-03-27", + "endDate": "2017-04-03" + } + }, + "Start": 0, + "Length": 3 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Chinese/DateTimeModel.json b/Specs/DateTime/Chinese/DateTimeModel.json index 0555981b64..ddb82f9aeb 100644 --- a/Specs/DateTime/Chinese/DateTimeModel.json +++ b/Specs/DateTime/Chinese/DateTimeModel.json @@ -1076,190 +1076,6 @@ } ] }, - { - "Input": "事件 每天都发生", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "Results": [ - { - "Text": "每天", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 3, - "End": 4 - } - ] - }, - { - "Input": "事件每日都发生", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "Results": [ - { - "Text": "每日", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 2, - "End": 3 - } - ] - }, - { - "Input": "事件每周都发生", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "Results": [ - { - "Text": "每周", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 2, - "End": 3 - } - ] - }, - { - "Input": "事件每个星期都发生", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "Results": [ - { - "Text": "每个星期", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 2, - "End": 5 - } - ] - }, - { - "Input": "事件每个月都发生", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "Results": [ - { - "Text": "每个月", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 2, - "End": 4 - } - ] - }, - { - "Input": "事件每年都发生", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "Results": [ - { - "Text": "每年", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 2, - "End": 3 - } - ] - }, - { - "Input": "事件每周一都发生", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "Results": [ - { - "Text": "每周一", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 2, - "End": 4 - } - ] - }, - { - "Input": "事件每周一下午八点都发生", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "Results": [ - { - "Text": "每周一下午八点", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T20", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 2, - "End": 8 - } - ] - }, { "Input": "下午5:00", "Context": { @@ -4484,21 +4300,6 @@ } ] } - }, - { - "Text": "每年", - "Start": 31, - "End": 32, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -4542,21 +4343,6 @@ } ] } - }, - { - "Text": "每年", - "Start": 30, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -5129,21 +4915,6 @@ } ] } - }, - { - "Text": "每年", - "Start": 25, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, diff --git a/Specs/DateTime/Chinese/DateTimeModelExperimentalMode.json b/Specs/DateTime/Chinese/DateTimeModelExperimentalMode.json index 8fa0d164f4..6f414d8e03 100644 --- a/Specs/DateTime/Chinese/DateTimeModelExperimentalMode.json +++ b/Specs/DateTime/Chinese/DateTimeModelExperimentalMode.json @@ -638,21 +638,6 @@ } ] } - }, - { - "Text": "每年", - "Start": 31, - "End": 32, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -696,21 +681,6 @@ } ] } - }, - { - "Text": "每年", - "Start": 30, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -1465,21 +1435,6 @@ } ] } - }, - { - "Text": "每年", - "Start": 25, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, diff --git a/Specs/DateTime/Chinese/SetExtractor.json b/Specs/DateTime/Chinese/SetExtractor.json deleted file mode 100644 index 31cade38e2..0000000000 --- a/Specs/DateTime/Chinese/SetExtractor.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "Input": "事件 每天都发生", - "Results": [ - { - "Text": "每天", - "Type": "set", - "Start": 3, - "Length": 2 - } - ] - }, - { - "Input": "事件每日都发生", - "Results": [ - { - "Text": "每日", - "Type": "set", - "Start": 2, - "Length": 2 - } - ] - }, - { - "Input": "事件每周都发生", - "Results": [ - { - "Text": "每周", - "Type": "set", - "Start": 2, - "Length": 2 - } - ] - }, - { - "Input": "事件每个星期都发生", - "Results": [ - { - "Text": "每个星期", - "Type": "set", - "Start": 2, - "Length": 4 - } - ] - }, - { - "Input": "事件每个月都发生", - "Results": [ - { - "Text": "每个月", - "Type": "set", - "Start": 2, - "Length": 3 - } - ] - }, - { - "Input": "事件每年都发生", - "Results": [ - { - "Text": "每年", - "Type": "set", - "Start": 2, - "Length": 2 - } - ] - }, - { - "Input": "事件每周一都发生", - "Results": [ - { - "Text": "每周一", - "Type": "set", - "Start": 2, - "Length": 3 - } - ] - }, - { - "Input": "事件每周一下午八点都发生", - "Results": [ - { - "Text": "每周一下午八点", - "Type": "set", - "Start": 2, - "Length": 7 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Chinese/SetParser.json b/Specs/DateTime/Chinese/SetParser.json deleted file mode 100644 index 60b2455513..0000000000 --- a/Specs/DateTime/Chinese/SetParser.json +++ /dev/null @@ -1,162 +0,0 @@ -[ - { - "Input": "事件 每天都发生", - "Results": [ - { - "Text": "每天", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 3, - "Length": 2 - } - ] - }, - { - "Input": "事件每日都发生", - "Results": [ - { - "Text": "每日", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 2, - "Length": 2 - } - ] - }, - { - "Input": "事件每周都发生", - "Results": [ - { - "Text": "每周", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 2, - "Length": 2 - } - ] - }, - { - "Input": "事件每个星期都发生", - "Results": [ - { - "Text": "每个星期", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 2, - "Length": 4 - } - ] - }, - { - "Input": "事件每个月都发生", - "Results": [ - { - "Text": "每个月", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 2, - "Length": 3 - } - ] - }, - { - "Input": "事件每年都发生", - "Results": [ - { - "Text": "每年", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 2, - "Length": 2 - } - ] - }, - { - "Input": "事件每周一都发生", - "Results": [ - { - "Text": "每周一", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 2, - "Length": 3 - } - ] - }, - { - "Input": "事件每周一下午八点都发生", - "Results": [ - { - "Text": "每周一下午八点", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T20", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T20" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T20" - } - }, - "Start": 2, - "Length": 7 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Dutch/DateExtractor.json b/Specs/DateTime/Dutch/DateExtractor.json index 5d4c972e66..ca9dd5c6ae 100644 --- a/Specs/DateTime/Dutch/DateExtractor.json +++ b/Specs/DateTime/Dutch/DateExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Ik ga terug op de 15e", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 15e", @@ -13,7 +13,7 @@ }, { "Input": "Ik ga terug op 22 april", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22 april", @@ -25,7 +25,7 @@ }, { "Input": "Ik ga terug op 1 januari", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 januari", @@ -37,7 +37,7 @@ }, { "Input": "Ik ga terug op 1 jan.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 jan.", @@ -49,7 +49,7 @@ }, { "Input": "Ik ga terug op 2 oktober", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 oktober", @@ -61,7 +61,7 @@ }, { "Input": "Ik ga terug op 12 januari 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari 2016", @@ -73,7 +73,7 @@ }, { "Input": "Ik ga terug op 12 jan. 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 jan. 2016", @@ -85,7 +85,7 @@ }, { "Input": "Ik ga terug op maandag 12 januari 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag 12 januari 2016", @@ -97,7 +97,7 @@ }, { "Input": "Ik ga terug op 22/02/2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/02/2016", @@ -109,7 +109,7 @@ }, { "Input": "Ik ga terug op 21/04/2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21/04/2016", @@ -121,7 +121,7 @@ }, { "Input": "Ik ga terug op 21/04/16", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21/04/16", @@ -133,7 +133,7 @@ }, { "Input": "Ik ga terug op 18-9-15", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18-9-15", @@ -145,7 +145,7 @@ }, { "Input": "Ik ga terug op 22.4", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22.4", @@ -157,7 +157,7 @@ }, { "Input": "Ik ga terug op 22-4", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-4", @@ -169,7 +169,7 @@ }, { "Input": "Ik ga terug op 22/4", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/4", @@ -181,7 +181,7 @@ }, { "Input": "Ik ga terug op 22/04", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/04", @@ -193,7 +193,7 @@ }, { "Input": "Ik ga terug op 12 augustus 2015", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 augustus 2015", @@ -205,7 +205,7 @@ }, { "Input": "Ik ga terug op 12/11/2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12/11/2016", @@ -217,7 +217,7 @@ }, { "Input": "Ik ga terug op 12-11-16", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12-11-16", @@ -229,7 +229,7 @@ }, { "Input": "Ik ga terug op 1 jan", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 jan", @@ -241,7 +241,7 @@ }, { "Input": "Ik ga terug op 28 november", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "28 november", @@ -253,7 +253,7 @@ }, { "Input": "Ik ga terug op wo. 22 jan", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "wo. 22 jan", @@ -265,7 +265,7 @@ }, { "Input": "Ik ga terug op de eerste vrijdag van juli", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van juli", @@ -277,7 +277,7 @@ }, { "Input": "Ik ga terug op de eerste vrijdag van deze maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van deze maand", @@ -289,7 +289,7 @@ }, { "Input": "Ik ga terug over twee weken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over twee weken", @@ -301,7 +301,7 @@ }, { "Input": "Ik ga volgende week vrijdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week vrijdag", @@ -313,7 +313,7 @@ }, { "Input": "Ik ga terug volgende week vrijdag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week vrijdag", @@ -325,7 +325,7 @@ }, { "Input": "afgelopen maandag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen maandag", @@ -337,7 +337,7 @@ }, { "Input": "Ik kom terug op dinsdag.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag", @@ -349,7 +349,7 @@ }, { "Input": "Goed nieuws, ik ga terug op dinsdag.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag", @@ -361,7 +361,7 @@ }, { "Input": "Ik ga terug op dinsdag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag", @@ -373,7 +373,7 @@ }, { "Input": "Ik ga terug op vrijdag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -385,7 +385,7 @@ }, { "Input": "Ik kom terug op vrijdag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -397,7 +397,7 @@ }, { "Input": "Ik ga vandaag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag", @@ -409,7 +409,7 @@ }, { "Input": "Ik ga morgen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -421,7 +421,7 @@ }, { "Input": "Ik ben gisteren teruggekomen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gisteren", @@ -433,7 +433,7 @@ }, { "Input": "Ik ben eergisteren teruggekomen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eergisteren", @@ -445,7 +445,7 @@ }, { "Input": "Ik kom overmorgen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "overmorgen", @@ -457,7 +457,7 @@ }, { "Input": "Ik kom morgen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -469,7 +469,7 @@ }, { "Input": "Ik ga deze vrijdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze vrijdag", @@ -481,7 +481,7 @@ }, { "Input": "Ik ga volgende week zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week zondag", @@ -493,7 +493,7 @@ }, { "Input": "Ik kwam afgelopen zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen zondag", @@ -505,7 +505,7 @@ }, { "Input": "Ik ga de laatste dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste dag", @@ -517,7 +517,7 @@ }, { "Input": "Ik kom de laatste dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste dag", @@ -529,7 +529,7 @@ }, { "Input": "Ik kom vandaag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag", @@ -541,7 +541,7 @@ }, { "Input": "Ik kom deze week vrijdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week vrijdag", @@ -553,7 +553,7 @@ }, { "Input": "Ik kwam vorige week zondag terug.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige week zondag", @@ -565,7 +565,7 @@ }, { "Input": "Ik ga terug op 15 juni 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 juni 2016", @@ -577,7 +577,7 @@ }, { "Input": "Ik speel honkbal op elf mei", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "elf mei", @@ -589,7 +589,7 @@ }, { "Input": "Ik ga terug op vier mei", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vier mei", @@ -601,7 +601,7 @@ }, { "Input": "Ik ga terug op 4 maart", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4 maart", @@ -613,7 +613,7 @@ }, { "Input": "Ik ga de eerste van januari terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste van januari", @@ -625,7 +625,7 @@ }, { "Input": "Ik ga eenentwintig mei terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eenentwintig mei", @@ -637,7 +637,7 @@ }, { "Input": "Ik kom eenentwintig mei terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eenentwintig mei", @@ -649,7 +649,7 @@ }, { "Input": "Ik ga de tweede aug terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede aug", @@ -661,7 +661,7 @@ }, { "Input": "Ik ga twintig juni terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twintig juni", @@ -673,7 +673,7 @@ }, { "Input": "Ik ben twee maanden geleden teruggekomen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee maanden geleden", @@ -685,7 +685,7 @@ }, { "Input": "Ik ga twee dagen later terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen later", @@ -697,7 +697,7 @@ }, { "Input": "wie heb ik een maand geleden een email gestuurd", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een maand geleden", @@ -709,7 +709,7 @@ }, { "Input": "Ik ging terug op de 27ste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27ste", @@ -721,7 +721,7 @@ }, { "Input": "Ik ging terug voor de 27e", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27e", @@ -733,7 +733,7 @@ }, { "Input": "Ik ging terug voor de 21ste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 21ste", @@ -745,7 +745,7 @@ }, { "Input": "Ik ging terug voor de 22e", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 22e", @@ -757,7 +757,7 @@ }, { "Input": "Ik ging voor de tweede terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweede", @@ -769,7 +769,7 @@ }, { "Input": "Ik ging terug voor de eenendertigste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eenendertigste", @@ -781,7 +781,7 @@ }, { "Input": "Ik ging terug op de 27e", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27e", @@ -793,7 +793,7 @@ }, { "Input": "Ik kwam terug op de 21ste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 21ste", @@ -805,7 +805,7 @@ }, { "Input": "Ik ging terug op de 22e", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 22e", @@ -817,7 +817,7 @@ }, { "Input": "Ik kwam terug op de tweede!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweede", @@ -829,7 +829,7 @@ }, { "Input": "Kwam je terug op de tweeëntwintigste?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweeëntwintigste", @@ -842,29 +842,29 @@ { "Input": "de eerste prijs", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga naar de 27ste verdieping", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Herdenkingsevenementen voor de 25ste verjaardag van de diplomatieke betrekkingen tussen Singapore en China", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Koop kaartjes voor de 17de voor het evenement", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Wat heb ik op zaterdag de tweede?", "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zaterdag de tweede", @@ -879,7 +879,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "woensdag de 27e", @@ -894,7 +894,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de 21ste", @@ -909,7 +909,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de 22ste", @@ -924,7 +924,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zaterdag de 23ste", @@ -939,7 +939,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de 15e", @@ -954,7 +954,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de eenentwintigste", @@ -969,7 +969,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de tweeëntwintigste", @@ -984,7 +984,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de vijftiende", @@ -999,7 +999,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de zevende", @@ -1011,7 +1011,7 @@ }, { "Input": "Ik ga de tweede zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede zondag", @@ -1023,7 +1023,7 @@ }, { "Input": "Ik ga de eerste zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste zondag", @@ -1035,7 +1035,7 @@ }, { "Input": "Ik ga de derde dinsdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "derde dinsdag", @@ -1047,7 +1047,7 @@ }, { "Input": "Ik ga de vijfde zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijfde zondag", @@ -1059,7 +1059,7 @@ }, { "Input": "Ik ga de zesde zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zondag", @@ -1071,7 +1071,7 @@ }, { "Input": "Ik ga de tiende maandag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag", @@ -1083,7 +1083,7 @@ }, { "Input": "Ik ga 20ste van de volgende maand terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20ste van de volgende maand", @@ -1095,7 +1095,8 @@ }, { "Input": "Ik ga de 31ste deze maand terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 31ste deze maand", @@ -1107,7 +1108,7 @@ }, { "Input": "Cortana kan een Skype call organiseren op vrijdag deze week of donderdag volgende week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag deze week", @@ -1125,7 +1126,7 @@ }, { "Input": "Cortana kan een Skype call organiseren voor vrijdag van deze week of deze week op zondag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag van deze week", @@ -1143,7 +1144,7 @@ }, { "Input": "16 nov 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16 nov 2016", @@ -1155,7 +1156,7 @@ }, { "Input": "We hadden een meeting 1 maand 21 dagen geleden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 maand 21 dagen geleden", @@ -1167,7 +1168,7 @@ }, { "Input": "Ik ben hier 2 jaar 1 maand en 21 dagen geleden weggegaan", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 jaar 1 maand en 21 dagen geleden", @@ -1179,7 +1180,7 @@ }, { "Input": "Ik ga hier 2 jaar en 21 dagen later weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 jaar en 21 dagen later", @@ -1191,7 +1192,7 @@ }, { "Input": "Ik ging 1 maand 2 jaar 21 dagen geleden weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 maand 2 jaar 21 dagen geleden", @@ -1203,7 +1204,8 @@ }, { "Input": "Ik vertrek de 20ste volgende maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 20ste volgende maand", @@ -1215,7 +1217,7 @@ }, { "Input": "Ik ben 5 december 1391 vertrokken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 december 1391", @@ -1227,7 +1229,8 @@ }, { "Input": "maandag, tweeëntwintig jan. 2018", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "maandag, tweeëntwintig jan. 2018", @@ -1239,7 +1242,8 @@ }, { "Input": "op zondag eenentwintig januari tweeduizend en achttien", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "zondag eenentwintig januari tweeduizend en achttien", @@ -1251,7 +1255,7 @@ }, { "Input": "op eenentwintig september negentien achtenzeventig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eenentwintig september negentien achtenzeventig", @@ -1263,7 +1267,7 @@ }, { "Input": "op 20 september negentienhonderd en één", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20 september negentienhonderd en één", @@ -1275,7 +1279,7 @@ }, { "Input": "op de tiende van september tweeduizend", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tiende van september tweeduizend", @@ -1287,7 +1291,7 @@ }, { "Input": "Ben je vrij op 13-5-2015?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13-5-2015", @@ -1299,7 +1303,7 @@ }, { "Input": "Ben je beschikbaar op 13-05-2015?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13-05-2015", @@ -1311,7 +1315,7 @@ }, { "Input": "Ben je volgende week zondag beschikbaar?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week zondag", @@ -1323,7 +1327,7 @@ }, { "Input": "Ben je volgende week maandag beschikbaar?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week maandag", @@ -1335,12 +1339,12 @@ }, { "Input": "Ik ga de 15e terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Ik ga 22 april terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22 april", @@ -1352,7 +1356,7 @@ }, { "Input": "Ik ga 1 jan terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 jan", @@ -1364,7 +1368,7 @@ }, { "Input": "Ik ga 2 oktober terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 oktober", @@ -1376,7 +1380,7 @@ }, { "Input": "Ik ga 12 januari, 2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari, 2016", @@ -1388,7 +1392,7 @@ }, { "Input": "Ik ga 12 januari van 2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari van 2016", @@ -1400,7 +1404,7 @@ }, { "Input": "Ik ga maandag 12 januari, 2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag 12 januari, 2016", @@ -1412,7 +1416,7 @@ }, { "Input": "Ik ga 22-02-2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-02-2016", @@ -1424,7 +1428,7 @@ }, { "Input": "Ik ga 21-04-2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21-04-2016", @@ -1436,7 +1440,7 @@ }, { "Input": "Ik ga 21/04/16 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21/04/16", @@ -1448,7 +1452,7 @@ }, { "Input": "Ik ga 18-9-15 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18-9-15", @@ -1460,7 +1464,7 @@ }, { "Input": "Ik ga op 22.4 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22.4", @@ -1472,7 +1476,7 @@ }, { "Input": "Ik ga op 22-4 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-4", @@ -1484,7 +1488,7 @@ }, { "Input": "Ik ga op 22/4 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/4", @@ -1496,7 +1500,7 @@ }, { "Input": "Ik ga op 22-04 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-04", @@ -1508,7 +1512,7 @@ }, { "Input": "Ik ga 22/4 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/4", @@ -1520,7 +1524,7 @@ }, { "Input": "Ik ga 22/04 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/04", @@ -1532,7 +1536,7 @@ }, { "Input": "Ik ga 12-08-2015 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12-08-2015", @@ -1544,7 +1548,7 @@ }, { "Input": "Ik ga 11-12, 2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11-12, 2016", @@ -1556,7 +1560,7 @@ }, { "Input": "Ik ga de 1e jan terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 1e jan", @@ -1568,7 +1572,7 @@ }, { "Input": "Ik ga 1-jan terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1-jan", @@ -1580,7 +1584,7 @@ }, { "Input": "Ik ga 28-nov terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "28-nov", @@ -1592,7 +1596,7 @@ }, { "Input": "Ik ga woens, 22 jan terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "woens, 22 jan", @@ -1604,7 +1608,7 @@ }, { "Input": "Ik ga de eerste vrijdag van juli terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van juli", @@ -1616,7 +1620,7 @@ }, { "Input": "Ik ga de eerste vrijdag van deze maand terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van deze maand", @@ -1628,7 +1632,7 @@ }, { "Input": "Ik ga twee weken vanaf nu terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee weken vanaf nu", @@ -1640,7 +1644,7 @@ }, { "Input": "Ik ga volgende week op vrijdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week op vrijdag", @@ -1652,7 +1656,7 @@ }, { "Input": "Ik ga op vrijdag volgende week terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op vrijdag volgende week", @@ -1664,7 +1668,7 @@ }, { "Input": "Ik ga op dins. terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dins.", @@ -1676,7 +1680,7 @@ }, { "Input": "Ik ga op dins. terug, goed nieuws.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dins.", @@ -1688,7 +1692,7 @@ }, { "Input": "Ik ga op dins terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dins", @@ -1700,7 +1704,7 @@ }, { "Input": "Ik ga op vrijdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -1712,7 +1716,7 @@ }, { "Input": "Ik ga vrijdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -1724,7 +1728,7 @@ }, { "Input": "Ik ga gisteren terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gisteren", @@ -1736,7 +1740,7 @@ }, { "Input": "Ik ga eergisteren terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eergisteren", @@ -1748,7 +1752,7 @@ }, { "Input": "Ik ga overmorgen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "overmorgen", @@ -1760,7 +1764,7 @@ }, { "Input": "Ik ga de volgende dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de volgende dag", @@ -1772,7 +1776,7 @@ }, { "Input": "Ik ga volgende dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende dag", @@ -1784,7 +1788,7 @@ }, { "Input": "Ik ga volgende zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende zondag", @@ -1796,7 +1800,7 @@ }, { "Input": "Ik ga afgelopen zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen zondag", @@ -1808,7 +1812,7 @@ }, { "Input": "Ik ga laatste dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste dag", @@ -1820,7 +1824,7 @@ }, { "Input": "Ik ga de dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de dag", @@ -1832,7 +1836,7 @@ }, { "Input": "Ik ga deze week vrijdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week vrijdag", @@ -1844,7 +1848,7 @@ }, { "Input": "Ik ga afgelopen week zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen week zondag", @@ -1856,7 +1860,7 @@ }, { "Input": "Ik ga 15 juni 2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 juni 2016", @@ -1868,7 +1872,7 @@ }, { "Input": "een basketbal op de elfde mei", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "elfde mei", @@ -1880,7 +1884,7 @@ }, { "Input": "Ik ga de vierde van mei terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vierde van mei", @@ -1892,7 +1896,7 @@ }, { "Input": "Ik ga de 4e van maart terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 4e van maart", @@ -1904,7 +1908,7 @@ }, { "Input": "Ik ga eerste van jan terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste van jan", @@ -1916,7 +1920,7 @@ }, { "Input": "Ik ga eenentwintigste mei terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eenentwintigste mei", @@ -1928,7 +1932,7 @@ }, { "Input": "Ik ga tweede van aug terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede van aug", @@ -1940,7 +1944,7 @@ }, { "Input": "Ik ga tweeëntwintigste van juni terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweeëntwintigste van juni", @@ -1952,7 +1956,7 @@ }, { "Input": "Ik ging twee maanden geleden terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee maanden geleden", @@ -1964,7 +1968,7 @@ }, { "Input": "Ik ging twee dagen later terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen later", @@ -1976,7 +1980,7 @@ }, { "Input": "wie e-mailde ik een maand geleden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een maand geleden", @@ -1988,7 +1992,7 @@ }, { "Input": "Ik ging voor de 27e terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27e", @@ -2000,7 +2004,7 @@ }, { "Input": "Ik ging voor de 27e terug.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27e", @@ -2012,7 +2016,7 @@ }, { "Input": "Ik ging voor de 27e terug!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27e", @@ -2024,7 +2028,7 @@ }, { "Input": "Ik ging voor de 21e terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 21e", @@ -2036,7 +2040,7 @@ }, { "Input": "Ik ging voor de 22e terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 22e", @@ -2048,7 +2052,7 @@ }, { "Input": "Ik ging voor de tweeëntwintigste terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweeëntwintigste", @@ -2060,7 +2064,7 @@ }, { "Input": "Ik ging voor de eenendertigste terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eenendertigste", @@ -2072,7 +2076,7 @@ }, { "Input": "Ik ging op de 27e terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27e", @@ -2084,7 +2088,7 @@ }, { "Input": "Ik ging op de 21e terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 21e", @@ -2096,7 +2100,7 @@ }, { "Input": "Ik ging op de 22e terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 22e", @@ -2108,7 +2112,7 @@ }, { "Input": "Ik ging op de tweede terug!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweede", @@ -2120,7 +2124,7 @@ }, { "Input": "Ik ging op de tweeëntwintigste terug?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweeëntwintigste", @@ -2132,17 +2136,17 @@ }, { "Input": "Ik ga naar de 27e verdieping", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Herdenkingsfestiviteiten voor het 25e jubileum van diplomatieke banden tussen Singapore en China", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Regel tickets voor de 17e Spookhuisbeleving", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2150,7 +2154,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zaterdag de tweede", @@ -2165,7 +2169,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "woensdag de 27e", @@ -2180,7 +2184,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de 21e", @@ -2195,7 +2199,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de 22e", @@ -2210,7 +2214,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zaterdag de 23e", @@ -2225,7 +2229,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de tweeëntwintigste", @@ -2240,7 +2244,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de zevende", @@ -2252,7 +2256,7 @@ }, { "Input": "Ik ga tweede zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede zondag", @@ -2264,7 +2268,7 @@ }, { "Input": "Ik ga eerste zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste zondag", @@ -2276,7 +2280,7 @@ }, { "Input": "Ik ga derde dinsdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "derde dinsdag", @@ -2288,7 +2292,7 @@ }, { "Input": "Ik ga vijfde zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijfde zondag", @@ -2300,7 +2304,7 @@ }, { "Input": "Ik ga zesde zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zondag", @@ -2312,7 +2316,7 @@ }, { "Input": "Ik ga tiende maandag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag", @@ -2324,7 +2328,7 @@ }, { "Input": "Ik ga 20e van volgende maand terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20e van volgende maand", @@ -2336,7 +2340,7 @@ }, { "Input": "Ik ga 31e van deze maand terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "31e van deze maand", @@ -2348,7 +2352,7 @@ }, { "Input": "16 nov. 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16 nov. 2016", @@ -2360,7 +2364,7 @@ }, { "Input": "We hadden een meeting 1 maand, 21 dagen geleden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 maand, 21 dagen geleden", @@ -2372,7 +2376,7 @@ }, { "Input": "Ik vertrok hier 2 jaar, 1 maand, 21 dagen geleden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 jaar, 1 maand, 21 dagen geleden", @@ -2384,7 +2388,7 @@ }, { "Input": "Ik zal hier 2 jaar en 21 dagen later vertrekken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 jaar en 21 dagen later", @@ -2396,7 +2400,7 @@ }, { "Input": "Ik vertrok hier 1 maand, 2 jaar en 21 dagen geleden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 maand, 2 jaar en 21 dagen geleden", @@ -2408,7 +2412,8 @@ }, { "Input": "Ik vertrok hier de 20e volgende maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 20e volgende maand", @@ -2420,7 +2425,7 @@ }, { "Input": "Ik vertrok hier 5 december 1391", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 december 1391", @@ -2432,7 +2437,8 @@ }, { "Input": "maandag, tweeëntwintig jan, 2018", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "maandag, tweeëntwintig jan, 2018", @@ -2444,7 +2450,8 @@ }, { "Input": "op zondag eenentwintig jan tweeduizend achttien", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "zondag eenentwintig jan tweeduizend achttien", @@ -2456,7 +2463,7 @@ }, { "Input": "op september de eenentwintigste negentien achtenzeventig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "september de eenentwintigste negentien achtenzeventig", @@ -2468,7 +2475,7 @@ }, { "Input": "op 10 september, negentien nul een", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10 september, negentien nul een", @@ -2480,7 +2487,7 @@ }, { "Input": "op de tiende van september, tweeduizend", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tiende van september, tweeduizend", @@ -2492,7 +2499,7 @@ }, { "Input": "Ben je beschikbaar op 13-5-2015?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13-5-2015", @@ -2504,7 +2511,7 @@ }, { "Input": "Ben je twee zondagen vanaf nu beschikbaar?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee zondagen vanaf nu", @@ -2516,7 +2523,7 @@ }, { "Input": "Ben je twee dagen na vandaag beschikbaar?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen na vandaag", @@ -2528,7 +2535,7 @@ }, { "Input": "Ben je drie weken vanaf morgen beschikbaar?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drie weken vanaf morgen", @@ -2540,7 +2547,7 @@ }, { "Input": "Waar was je twee dagen voor gisteren?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen voor gisteren", @@ -2555,7 +2562,7 @@ "Context": { "ReferenceDateTime": "2018-06-14T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze vrijdag 15 jun", @@ -2570,7 +2577,7 @@ "Context": { "ReferenceDateTime": "2018-06-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 3 weken", @@ -2583,12 +2590,12 @@ { "Input": "het nominale bedrag van haar 6 1/4% converteerbaren", "Comment": "1/4 shouldn't recognized as date here", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Ik ga terug op Sep-23-2020.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Sep-23-2020", @@ -2600,7 +2607,7 @@ }, { "Input": "Ik ga terug op September-2020-23.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "September-2020-23", @@ -2612,7 +2619,7 @@ }, { "Input": "Ik ga terug op 2020/23/Sep.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2020/23/Sep", @@ -2624,7 +2631,7 @@ }, { "Input": "Ik ga terug op 2020-Sep-23", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2020-Sep-23", @@ -2636,7 +2643,7 @@ }, { "Input": "Ik ga terug op 23/Sep/2020", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "23/Sep/2020", @@ -2648,7 +2655,7 @@ }, { "Input": "Ik ga terug op 23-2020-September", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "23-2020-September", @@ -2660,7 +2667,7 @@ }, { "Input": "ik zal tweeëntwintig juni 2017 teruggaan", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tweeëntwintig juni 2017", @@ -2673,13 +2680,13 @@ { "Input": "6,107.31 augustus 2019 moet het decimaal niet bevatten", "Comment": "Only August 2019 should be extracted as a DateRange, so no output in Date only. Java disabled due to issue in lookbehind.", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { "Input": "ik zal 1-sep-2019 teruggaan", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1-sep-2019", @@ -2691,7 +2698,7 @@ }, { "Input": "ik zal 01/sep/2019 teruggaan", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "01/sep/2019", @@ -2703,7 +2710,7 @@ }, { "Input": "Boek een reis voor me op 26 juni van 2020", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "26 juni van 2020", diff --git a/Specs/DateTime/Dutch/DateParser.json b/Specs/DateTime/Dutch/DateParser.json index 3a33a2d83c..326b88266c 100644 --- a/Specs/DateTime/Dutch/DateParser.json +++ b/Specs/DateTime/Dutch/DateParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 15e", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 okt.", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 oktober", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee oktober", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari 2016", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag 12 januari 2016", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/02/2016", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/2/2016", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-2-2016", @@ -220,7 +220,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21-04-2016", @@ -244,7 +244,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21/04/2016", @@ -268,7 +268,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-04", @@ -292,7 +292,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/4", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-4", @@ -340,7 +340,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4/22", @@ -364,7 +364,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/04", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12-08-2015", @@ -412,7 +412,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12-08, 2015", @@ -436,7 +436,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 januari", @@ -460,7 +460,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 1e van januari", @@ -484,7 +484,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "woensdag 22 januari", @@ -508,7 +508,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste van januari", @@ -532,7 +532,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21 mei", @@ -556,7 +556,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eenentwintig mei", @@ -580,7 +580,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede van Augustus", @@ -604,7 +604,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweeëntwintig juni", @@ -628,7 +628,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -652,7 +652,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag", @@ -676,7 +676,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -700,7 +700,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gisteren", @@ -724,7 +724,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eergisteren", @@ -748,7 +748,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "overmorgen", @@ -772,7 +772,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Overmorgen", @@ -796,7 +796,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de volgende dag", @@ -820,7 +820,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "aanstaande vrijdag", @@ -844,7 +845,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "aankomende zondag", @@ -868,7 +870,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste zondag", @@ -892,7 +894,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige zondag", @@ -916,7 +918,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voorgaande zondag", @@ -940,7 +942,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week op vrijdag", @@ -964,7 +966,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week zondag", @@ -988,7 +990,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige week zondag", @@ -1012,7 +1014,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 juni 2016", @@ -1036,7 +1038,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van juli", @@ -1060,7 +1062,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van de maand", @@ -1084,7 +1086,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week vrijdag", @@ -1108,7 +1110,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week op vrijdag", @@ -1132,7 +1134,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag", @@ -1156,7 +1158,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee weken vanaf nu", @@ -1180,7 +1182,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 2 weken", @@ -1204,7 +1206,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een maand geleden", @@ -1228,7 +1230,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "enkele maanden geleden", @@ -1252,7 +1254,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "enkele dagen geleden", @@ -1276,7 +1278,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27ste", @@ -1300,7 +1302,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27e", @@ -1324,7 +1326,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 21ste", @@ -1348,7 +1350,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 22ste", @@ -1372,7 +1374,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweede", @@ -1396,7 +1398,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweeëntwintigste", @@ -1420,7 +1422,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de dertigste", @@ -1444,7 +1446,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8080661+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de 21ste", @@ -1468,7 +1470,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8110663+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de 22ste", @@ -1492,7 +1494,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8120465+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zaterdag de 23ste", @@ -1516,7 +1518,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8130455+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de 15de", @@ -1540,7 +1542,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8140457+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de eenentwintigste", @@ -1564,7 +1566,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8150456+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de tweeëntwintigste", @@ -1588,7 +1590,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8160454+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de 15de", @@ -1612,7 +1614,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8200463+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede zondag", @@ -1636,7 +1638,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8200463+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste zondag", @@ -1660,7 +1662,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8210454+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3e dinsdag", @@ -1684,7 +1686,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T17:25:49.8225493+08:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijfde zondag", @@ -1708,7 +1710,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 20ste van de volgende maand", @@ -1732,7 +1735,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 31ste van deze maand", @@ -1756,7 +1760,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari 2018", @@ -1780,7 +1784,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18-09-15", @@ -1804,7 +1808,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 dagen geleden", @@ -1828,7 +1832,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee jaar geleden", @@ -1852,7 +1856,7 @@ "Context": { "ReferenceDateTime": "2016-11-14T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16 november 2016", @@ -1876,7 +1880,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 maand en 21 dagen geleden", @@ -1900,7 +1905,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 jaar, 1 maand en 21 dagen geleden", @@ -1924,7 +1930,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "over 2 jaar en 21 dagen", @@ -1948,7 +1955,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 jaar, 1 maand en 21 dagen geleden", @@ -1972,7 +1980,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 maand en 21 dagen geleden", @@ -1996,7 +2005,8 @@ "Context": { "ReferenceDateTime": "2017-12-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 20ste van volgende maand", @@ -2020,7 +2030,7 @@ "Context": { "ReferenceDateTime": "2017-12-18T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 december 1391", @@ -2044,7 +2054,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "Maandag tweeëntwintig jan. 2018", @@ -2068,7 +2079,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "zondag eenentwintig januari tweeduizend achttien", @@ -2092,7 +2104,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "eenentwintig September negentien zevenentachtig", @@ -2116,7 +2129,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "10 september, negentien en een", @@ -2140,7 +2154,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tiende van september, tweeduizend", @@ -2164,7 +2179,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T09:58:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van de volgende maand", @@ -2188,7 +2203,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T10:45:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweede maandag van de volgende maand", @@ -2212,7 +2227,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T10:45:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de derde woensdag van de vorige maand", @@ -2236,7 +2251,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T22:16:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Volgende week dinsdag", @@ -2260,7 +2275,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T22:16:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week zondag", @@ -2284,7 +2299,7 @@ "Context": { "ReferenceDateTime": "2018-04-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen vanaf morgen", @@ -2308,7 +2323,7 @@ "Context": { "ReferenceDateTime": "2018-04-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vier dagen gerekend vanaf gisteren", @@ -2332,7 +2347,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13.5.2015", @@ -2356,7 +2371,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13-5-2015", @@ -2380,7 +2395,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7-3-2017", @@ -2404,7 +2419,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7-3-27", @@ -2428,7 +2443,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "05/05/89", @@ -2452,7 +2467,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "05/05/71", @@ -2476,7 +2491,7 @@ "Context": { "ReferenceDateTime": "2018-05-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee zondagen vanaf nu", @@ -2500,7 +2515,7 @@ "Context": { "ReferenceDateTime": "2018-05-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee maandagen later", @@ -2524,7 +2539,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen vanaf vandaag", @@ -2548,7 +2563,8 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "drie weken na morgen", @@ -2572,7 +2588,8 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "twee dagen voor gisteren", @@ -2596,7 +2613,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15", @@ -2620,7 +2637,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 okt.", @@ -2644,7 +2661,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2-okt", @@ -2668,7 +2685,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 oktober", @@ -2692,7 +2709,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari, 2016", @@ -2716,7 +2733,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag 12 januari, 2016", @@ -2740,7 +2757,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-02-2016", @@ -2764,7 +2781,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21-04-2016", @@ -2788,7 +2805,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21/04/16", @@ -2812,7 +2829,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-4", @@ -2836,7 +2853,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-4", @@ -2860,7 +2877,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22-4", @@ -2884,7 +2901,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/4", @@ -2908,7 +2925,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/4", @@ -2932,7 +2949,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12-08-2015", @@ -2956,7 +2973,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12-08, 2015", @@ -2980,7 +2997,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 1e jan", @@ -3004,7 +3021,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1-jan", @@ -3028,7 +3045,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "woens, 22e van jan", @@ -3052,7 +3069,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste van jan", @@ -3076,7 +3093,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eenentwintigste van mei", @@ -3100,7 +3117,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede van aug", @@ -3124,7 +3141,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweeëntwintigste van juni", @@ -3148,7 +3165,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -3172,7 +3189,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -3196,7 +3213,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag", @@ -3220,7 +3237,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -3244,7 +3261,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gisteren", @@ -3268,7 +3285,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eergisteren", @@ -3292,7 +3309,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "overmorgen", @@ -3316,7 +3333,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "overmorgen", @@ -3340,7 +3357,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de volgende dag", @@ -3364,7 +3381,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende dag", @@ -3388,7 +3405,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze vrijdag", @@ -3412,7 +3429,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende zondag", @@ -3436,7 +3453,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste zondag", @@ -3460,7 +3477,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week vrijdag", @@ -3484,7 +3501,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week zondag", @@ -3508,7 +3525,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen week zondag", @@ -3532,7 +3549,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste dag", @@ -3556,7 +3573,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste dag", @@ -3580,7 +3597,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de dag", @@ -3604,7 +3621,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 juni 2016", @@ -3628,7 +3645,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van juli", @@ -3652,7 +3669,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van deze maand", @@ -3676,7 +3693,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week op vrijdag", @@ -3700,7 +3717,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op vrijdag volgende week", @@ -3724,7 +3741,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mijn dag", @@ -3748,7 +3765,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze dag", @@ -3772,7 +3789,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de afgelopen dag", @@ -3796,7 +3813,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee weken vanaf nu", @@ -3820,7 +3837,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een maand geleden", @@ -3844,7 +3861,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 27e", @@ -3868,7 +3885,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 21e", @@ -3892,7 +3909,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 22e", @@ -3916,7 +3933,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweede", @@ -3940,7 +3957,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de tweeëntwintigste", @@ -3964,7 +3981,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de 21e", @@ -3988,7 +4005,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de 22e", @@ -4012,7 +4029,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zaterdag de 23e", @@ -4036,7 +4053,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de 15e", @@ -4060,7 +4077,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag de eenentwintigste", @@ -4084,7 +4101,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de tweeëntwintigste", @@ -4108,7 +4125,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag de vijftiende", @@ -4132,7 +4149,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede zondag", @@ -4156,7 +4173,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste zondag", @@ -4180,7 +4197,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "derde dinsdag", @@ -4204,7 +4221,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijfde zondag", @@ -4228,7 +4245,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 20e van volgende maand", @@ -4252,7 +4270,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 31e van deze maand", @@ -4276,7 +4295,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18-9-15", @@ -4300,7 +4319,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen geleden", @@ -4324,7 +4343,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee jaar geleden", @@ -4348,7 +4367,7 @@ "Context": { "ReferenceDateTime": "2016-11-14T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16 nov. 2016", @@ -4372,7 +4391,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 maand, 21 dagen geleden", @@ -4396,7 +4416,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 jaar, 1 maand, 21 dagen geleden", @@ -4420,7 +4441,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 jaar, 21 dagen later", @@ -4444,7 +4466,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 maand, 2 jaar, 21 dagen geleden", @@ -4468,7 +4491,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 maand en 21 dagen geleden", @@ -4492,7 +4516,8 @@ "Context": { "ReferenceDateTime": "2017-12-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de 20e van volgende maand", @@ -4516,7 +4541,7 @@ "Context": { "ReferenceDateTime": "2017-12-18T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 december 1391", @@ -4540,7 +4565,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "maandag, tweeëntwintig jan, 2018", @@ -4564,7 +4590,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "zondag eenentwintig jan tweeduizend achttien", @@ -4588,7 +4615,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "eenentwintig september negentien achtenzeventig", @@ -4612,7 +4640,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tiende van september, tweeduizend", @@ -4636,7 +4665,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T09:58:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste vrijdag van volgende maand", @@ -4660,7 +4689,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T10:45:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de derde woensdag van vorige maand", @@ -4684,7 +4713,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T22:16:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week dinsdag", @@ -4708,7 +4737,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T22:16:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op volgende week zondag", @@ -4732,7 +4761,7 @@ "Context": { "ReferenceDateTime": "2018-04-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen vanaf morgen", @@ -4756,7 +4785,7 @@ "Context": { "ReferenceDateTime": "2018-04-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vier dagen vanaf gisteren", @@ -4780,7 +4809,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13-5-2015", @@ -4804,7 +4833,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3-7-2017", @@ -4828,7 +4857,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3-7-07", @@ -4852,7 +4881,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3-7-27", @@ -4876,7 +4905,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "05-05-89", @@ -4900,7 +4929,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "05-05-71", @@ -4924,7 +4953,7 @@ "Context": { "ReferenceDateTime": "2018-05-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee zondagen vanaf nu", @@ -4948,7 +4977,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen na vandaag", @@ -4972,7 +5001,8 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "drie weken vanaf morgen", @@ -4996,7 +5026,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 3 weken", @@ -5020,7 +5050,8 @@ "Context": { "ReferenceDateTime": "2018-08-21T08:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "over vier werkdagen", @@ -5044,7 +5075,7 @@ "Context": { "ReferenceDateTime": "2018-08-21T08:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tweeëntwintigste van juni 2017", @@ -5068,7 +5099,7 @@ "Context": { "ReferenceDateTime": "2018-08-21T08:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1-sep-2019", @@ -5092,7 +5123,7 @@ "Context": { "ReferenceDateTime": "2018-08-21T08:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "01/sep/2019", @@ -5116,7 +5147,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29 feb", @@ -5140,7 +5171,7 @@ "Context": { "ReferenceDateTime": "2019-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29/2", @@ -5164,7 +5195,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29e feb", @@ -5188,7 +5219,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 feb", @@ -5212,7 +5243,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29/2/2019", @@ -5236,7 +5267,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29/2/2020", diff --git a/Specs/DateTime/Dutch/DatePeriodExtractor.json b/Specs/DateTime/Dutch/DatePeriodExtractor.json index 3cdd09b839..57259321d2 100644 --- a/Specs/DateTime/Dutch/DatePeriodExtractor.json +++ b/Specs/DateTime/Dutch/DatePeriodExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Ik ben in jan weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jan", @@ -13,7 +13,7 @@ }, { "Input": "Ik ben aanstaande jan weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande jan", @@ -25,7 +25,7 @@ }, { "Input": "Ik ben maand jan weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand jan", @@ -37,7 +37,7 @@ }, { "Input": "Ik ben de maand jan weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand jan", @@ -49,7 +49,7 @@ }, { "Input": "Ik miste jan 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jan 2001", @@ -61,7 +61,7 @@ }, { "Input": "Ik miste jan, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jan, 2001", @@ -73,7 +73,7 @@ }, { "Input": "Ik ben in feb weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "feb", @@ -85,7 +85,7 @@ }, { "Input": "Ik ben aanstaande feb weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande feb", @@ -97,7 +97,7 @@ }, { "Input": "Ik ben maand feb weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand feb", @@ -109,7 +109,7 @@ }, { "Input": "Ik ben de maand feb weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand feb", @@ -121,7 +121,7 @@ }, { "Input": "Ik miste feb 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "feb 2001", @@ -133,7 +133,7 @@ }, { "Input": "Ik miste feb, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "feb, 2001", @@ -145,7 +145,7 @@ }, { "Input": "Ik ben in mrt weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mrt", @@ -157,7 +157,7 @@ }, { "Input": "Ik ben aanstaande mrt weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande mrt", @@ -169,7 +169,7 @@ }, { "Input": "Ik ben maand mrt weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand mrt", @@ -181,7 +181,7 @@ }, { "Input": "Ik ben de maand mrt weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand mrt", @@ -193,7 +193,7 @@ }, { "Input": "Ik miste mrt 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mrt 2001", @@ -205,7 +205,7 @@ }, { "Input": "Ik miste mrt, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mrt, 2001", @@ -217,7 +217,7 @@ }, { "Input": "Ik ben in apr weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "apr", @@ -229,7 +229,7 @@ }, { "Input": "Ik ben aanstaande apr weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande apr", @@ -241,7 +241,7 @@ }, { "Input": "Ik ben maand apr weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand apr", @@ -253,7 +253,7 @@ }, { "Input": "Ik ben de maand apr weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand apr", @@ -265,7 +265,7 @@ }, { "Input": "Ik miste apr 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "apr 2001", @@ -277,7 +277,7 @@ }, { "Input": "Ik miste apr, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "apr, 2001", @@ -289,7 +289,7 @@ }, { "Input": "Ik ben in mei weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mei", @@ -301,7 +301,7 @@ }, { "Input": "Ik ben aanstaande mei weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande mei", @@ -313,7 +313,7 @@ }, { "Input": "Ik ben maand mei weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand mei", @@ -325,7 +325,7 @@ }, { "Input": "Ik ben de maand mei weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand mei", @@ -337,7 +337,7 @@ }, { "Input": "Ik miste mei 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mei 2001", @@ -349,7 +349,7 @@ }, { "Input": "Ik miste mei, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mei, 2001", @@ -361,7 +361,7 @@ }, { "Input": "Ik ben in jun weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jun", @@ -373,7 +373,7 @@ }, { "Input": "Ik ben aanstaande jun weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande jun", @@ -385,7 +385,7 @@ }, { "Input": "Ik ben maand jun weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand jun", @@ -397,7 +397,7 @@ }, { "Input": "Ik ben de maand jun weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand jun", @@ -409,7 +409,7 @@ }, { "Input": "Ik miste jun 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jun 2001", @@ -421,7 +421,7 @@ }, { "Input": "Ik miste jun, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jun, 2001", @@ -433,7 +433,7 @@ }, { "Input": "Ik ben in jul weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jul", @@ -445,7 +445,7 @@ }, { "Input": "Ik ben aanstaande jul weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande jul", @@ -457,7 +457,7 @@ }, { "Input": "Ik ben maand jul weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand jul", @@ -469,7 +469,7 @@ }, { "Input": "Ik ben de maand jul weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand jul", @@ -481,7 +481,7 @@ }, { "Input": "Ik miste jul 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jul 2001", @@ -493,7 +493,7 @@ }, { "Input": "Ik miste jul, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jul, 2001", @@ -505,7 +505,7 @@ }, { "Input": "Ik ben in aug weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aug", @@ -517,7 +517,7 @@ }, { "Input": "Ik ben aanstaande aug weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande aug", @@ -529,7 +529,7 @@ }, { "Input": "Ik ben maand aug weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand aug", @@ -541,7 +541,7 @@ }, { "Input": "Ik ben de maand aug weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand aug", @@ -553,7 +553,7 @@ }, { "Input": "Ik miste aug 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aug 2001", @@ -565,7 +565,7 @@ }, { "Input": "Ik miste aug, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aug, 2001", @@ -577,7 +577,7 @@ }, { "Input": "Ik ben in sep weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sep", @@ -589,7 +589,7 @@ }, { "Input": "Ik ben aanstaande sep weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande sep", @@ -601,7 +601,7 @@ }, { "Input": "Ik ben maand sep weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand sep", @@ -613,7 +613,7 @@ }, { "Input": "Ik ben de maand sep weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand sep", @@ -625,7 +625,7 @@ }, { "Input": "Ik miste sep 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sep 2001", @@ -637,7 +637,7 @@ }, { "Input": "Ik miste sep, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sep, 2001", @@ -649,7 +649,7 @@ }, { "Input": "Ik ben in okt weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "okt", @@ -661,7 +661,7 @@ }, { "Input": "Ik ben aanstaande okt weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande okt", @@ -673,7 +673,7 @@ }, { "Input": "Ik ben maand okt weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand okt", @@ -685,7 +685,7 @@ }, { "Input": "Ik ben de maand okt weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand okt", @@ -697,7 +697,7 @@ }, { "Input": "Ik miste okt 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "okt 2001", @@ -709,7 +709,7 @@ }, { "Input": "Ik miste okt, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "okt, 2001", @@ -721,7 +721,7 @@ }, { "Input": "Ik ben nov weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nov", @@ -733,7 +733,7 @@ }, { "Input": "Ik ben aanstaande nov weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande nov", @@ -745,7 +745,7 @@ }, { "Input": "Ik ben maand nov weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand nov", @@ -757,7 +757,7 @@ }, { "Input": "Ik ben de maand nov weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand nov", @@ -769,7 +769,7 @@ }, { "Input": "Ik miste nov 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nov 2001", @@ -781,7 +781,7 @@ }, { "Input": "Ik miste nov, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nov, 2001", @@ -793,7 +793,7 @@ }, { "Input": "Ik ben in dec weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dec", @@ -805,7 +805,7 @@ }, { "Input": "Ik ben aanstaande dec weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande dec", @@ -817,7 +817,7 @@ }, { "Input": "Ik ben maand dec weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand dec", @@ -829,7 +829,7 @@ }, { "Input": "Ik ben de maand dec weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand dec", @@ -841,7 +841,7 @@ }, { "Input": "Ik miste dec 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dec 2001", @@ -853,7 +853,7 @@ }, { "Input": "Ik miste dec, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dec, 2001", @@ -865,7 +865,7 @@ }, { "Input": "Ik ben in januari weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "januari", @@ -877,7 +877,7 @@ }, { "Input": "Ik ben aanstaande januari weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande januari", @@ -889,7 +889,7 @@ }, { "Input": "Ik ben maand januari weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand januari", @@ -901,7 +901,7 @@ }, { "Input": "Ik ben de maand januari weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand januari", @@ -913,7 +913,7 @@ }, { "Input": "Ik miste januari 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "januari 2001", @@ -925,7 +925,7 @@ }, { "Input": "Ik miste januari, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "januari, 2001", @@ -937,7 +937,7 @@ }, { "Input": "Ik ben in februari weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "februari", @@ -949,7 +949,7 @@ }, { "Input": "Ik ben aanstaande februari weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande februari", @@ -961,7 +961,7 @@ }, { "Input": "Ik ben maand februari weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand februari", @@ -973,7 +973,7 @@ }, { "Input": "Ik ben de maand februari weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand februari", @@ -985,7 +985,7 @@ }, { "Input": "Ik miste februari 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "februari 2001", @@ -997,7 +997,7 @@ }, { "Input": "Ik miste februari, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "februari, 2001", @@ -1009,7 +1009,7 @@ }, { "Input": "Ik ben in maart weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maart", @@ -1021,7 +1021,7 @@ }, { "Input": "Ik ben aanstaande maart weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande maart", @@ -1033,7 +1033,7 @@ }, { "Input": "Ik ben maand maart weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand maart", @@ -1045,7 +1045,7 @@ }, { "Input": "Ik ben de maand maart weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand maart", @@ -1057,7 +1057,7 @@ }, { "Input": "Ik miste maart 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maart 2001", @@ -1069,7 +1069,7 @@ }, { "Input": "Ik miste maart, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maart, 2001", @@ -1081,7 +1081,7 @@ }, { "Input": "Ik ben in april weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "april", @@ -1093,7 +1093,7 @@ }, { "Input": "Ik ben aanstaande april weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande april", @@ -1105,7 +1105,7 @@ }, { "Input": "Ik ben maand april weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand april", @@ -1117,7 +1117,7 @@ }, { "Input": "Ik ben de maand april weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand april", @@ -1129,7 +1129,7 @@ }, { "Input": "Ik miste april 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "april 2001", @@ -1141,7 +1141,7 @@ }, { "Input": "Ik miste april, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "april, 2001", @@ -1153,7 +1153,7 @@ }, { "Input": "Ik ben in juni weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juni", @@ -1165,7 +1165,7 @@ }, { "Input": "Ik ben aanstaande juni weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande juni", @@ -1177,7 +1177,7 @@ }, { "Input": "Ik ben maand juni weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand juni", @@ -1189,7 +1189,7 @@ }, { "Input": "Ik ben de maand juni weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand juni", @@ -1201,7 +1201,7 @@ }, { "Input": "Ik miste juni 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juni 2001", @@ -1213,7 +1213,7 @@ }, { "Input": "Ik miste juni, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juni, 2001", @@ -1225,7 +1225,7 @@ }, { "Input": "Ik ben in juli weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juli", @@ -1237,7 +1237,7 @@ }, { "Input": "Ik ben aanstaande juli weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande juli", @@ -1249,7 +1249,7 @@ }, { "Input": "Ik ben maand juli weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand juli", @@ -1261,7 +1261,7 @@ }, { "Input": "Ik ben de maand juli weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand juli", @@ -1273,7 +1273,7 @@ }, { "Input": "Ik miste juli 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juli 2001", @@ -1285,7 +1285,7 @@ }, { "Input": "Ik miste juli, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juli, 2001", @@ -1297,7 +1297,7 @@ }, { "Input": "Ik ben in augustus weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "augustus", @@ -1309,7 +1309,7 @@ }, { "Input": "Ik ben aanstaande augustus weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande augustus", @@ -1321,7 +1321,7 @@ }, { "Input": "Ik ben maand augustus weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand augustus", @@ -1333,7 +1333,7 @@ }, { "Input": "Ik ben de maand augustus weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand augustus", @@ -1345,7 +1345,7 @@ }, { "Input": "Ik miste augustus 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "augustus 2001", @@ -1357,7 +1357,7 @@ }, { "Input": "Ik miste augustus, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "augustus, 2001", @@ -1369,7 +1369,7 @@ }, { "Input": "Ik ben in september weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "september", @@ -1381,7 +1381,7 @@ }, { "Input": "Ik ben aanstaande september weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande september", @@ -1393,7 +1393,7 @@ }, { "Input": "Ik ben maand september weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand september", @@ -1405,7 +1405,7 @@ }, { "Input": "Ik ben de maand september weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand september", @@ -1417,7 +1417,7 @@ }, { "Input": "Ik miste september 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "september 2001", @@ -1429,7 +1429,7 @@ }, { "Input": "Ik miste september, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "september, 2001", @@ -1441,7 +1441,7 @@ }, { "Input": "Ik ben in oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "oktober", @@ -1453,7 +1453,7 @@ }, { "Input": "Ik ben aanstaande oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande oktober", @@ -1465,7 +1465,7 @@ }, { "Input": "Ik ben maand oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand oktober", @@ -1477,7 +1477,7 @@ }, { "Input": "Ik ben de maand oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand oktober", @@ -1489,7 +1489,7 @@ }, { "Input": "Ik miste oktober 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "oktober 2001", @@ -1501,7 +1501,7 @@ }, { "Input": "Ik miste oktober, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "oktober, 2001", @@ -1513,7 +1513,7 @@ }, { "Input": "Ik ben november weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november", @@ -1525,7 +1525,7 @@ }, { "Input": "Ik ben aanstaande november weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande november", @@ -1537,7 +1537,7 @@ }, { "Input": "Ik ben maand november weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand november", @@ -1549,7 +1549,7 @@ }, { "Input": "Ik ben de maand november weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand november", @@ -1561,7 +1561,7 @@ }, { "Input": "Ik miste november 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november 2001", @@ -1573,7 +1573,7 @@ }, { "Input": "Ik miste november, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november, 2001", @@ -1585,7 +1585,7 @@ }, { "Input": "Ik ben in december weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "december", @@ -1597,7 +1597,7 @@ }, { "Input": "Ik ben aanstaande december weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande december", @@ -1609,7 +1609,7 @@ }, { "Input": "Ik ben maand december weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand december", @@ -1621,7 +1621,7 @@ }, { "Input": "Ik ben de maand december weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand december", @@ -1633,7 +1633,7 @@ }, { "Input": "Ik miste december 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "december 2001", @@ -1645,7 +1645,7 @@ }, { "Input": "Ik miste december, 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "december, 2001", @@ -1657,7 +1657,7 @@ }, { "Input": "Agenda voor de maand september", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand september", @@ -1669,7 +1669,7 @@ }, { "Input": "Ik ben deze maand van 4 tot 22 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze maand van 4 tot 22", @@ -1681,7 +1681,7 @@ }, { "Input": "Ik ben volgende maand van 4 tot 23 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maand van 4 tot 23", @@ -1693,7 +1693,7 @@ }, { "Input": "Ik ben weg van 3 tot 12 sep hahaha", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3 tot 12 sep", @@ -1705,7 +1705,7 @@ }, { "Input": "Ik ben weg van 4 tot 23 volgende maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 4 tot 23 volgende maand", @@ -1717,7 +1717,7 @@ }, { "Input": "Ik ben weg van 4 tot 22 deze maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 4 tot 22 deze maand", @@ -1729,7 +1729,7 @@ }, { "Input": "Ik ben weg tussen 4 en 22 deze maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 4 en 22 deze maand", @@ -1741,7 +1741,7 @@ }, { "Input": "Ik ben weg tussen 3 en 12 van sep hahaha", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 en 12 van sep", @@ -1753,7 +1753,7 @@ }, { "Input": "Ik ben weg tussen 4e september tot en met 8e september ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 4e september tot en met 8e september", @@ -1765,7 +1765,7 @@ }, { "Input": "Ik ben weg tussen 15e november tot en met 19e ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 15e november tot en met 19e", @@ -1777,7 +1777,7 @@ }, { "Input": "Ik ben weg tussen 15e november tot en met de 19e ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 15e november tot en met de 19e", @@ -1789,7 +1789,7 @@ }, { "Input": "Ik ben weg tussen de 15e november tot en met 19e ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen de 15e november tot en met 19e", @@ -1801,7 +1801,7 @@ }, { "Input": "Ik ben weg van 4 tot 22 januari, 2017", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 4 tot 22 januari, 2017", @@ -1813,7 +1813,7 @@ }, { "Input": "Ik ben weg tussen 4-22 januari, 2017", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 4-22 januari, 2017", @@ -1825,7 +1825,7 @@ }, { "Input": "Ik ben weg op deze week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week", @@ -1837,7 +1837,7 @@ }, { "Input": "Ik ben weg de komende week ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende week", @@ -1849,7 +1849,7 @@ }, { "Input": "Ik ben weg in september", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "september", @@ -1861,7 +1861,7 @@ }, { "Input": "Ik ben weg afgelopen september", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen september", @@ -1873,7 +1873,7 @@ }, { "Input": "Ik ben volgende juni weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende juni", @@ -1885,7 +1885,7 @@ }, { "Input": "Ik ben juni 2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juni 2016", @@ -1897,7 +1897,7 @@ }, { "Input": "Ik ben juni volgend jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juni volgend jaar", @@ -1909,7 +1909,7 @@ }, { "Input": "Ik ben dit weekend weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dit weekend", @@ -1921,7 +1921,7 @@ }, { "Input": "Ik ben de derde week van deze maand weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de derde week van deze maand", @@ -1933,7 +1933,7 @@ }, { "Input": "Ik ben de laatste week van juli weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste week van juli", @@ -1945,7 +1945,8 @@ }, { "Input": "Plan kamperen in voor vrijdag tot en met zondag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "vrijdag tot en met zondag", @@ -1957,7 +1958,7 @@ }, { "Input": "Ik ben de volgende 3 dagen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende 3 dagen", @@ -1969,7 +1970,7 @@ }, { "Input": "Ik ben de volgende 3 maanden weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende 3 maanden", @@ -1981,22 +1982,22 @@ }, { "Input": "Ik ben over 3 jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Ik ben over 3 weken weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Ik ben over 3 maanden weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Ik ben de afgelopen 3 weken weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen 3 weken", @@ -2008,7 +2009,7 @@ }, { "Input": "Ik ben de afgelopen 3 jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen 3 jaar", @@ -2020,7 +2021,7 @@ }, { "Input": "Ik ben afgelopen jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen jaar", @@ -2032,7 +2033,7 @@ }, { "Input": "Ik ben vorige maand weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige maand", @@ -2044,7 +2045,7 @@ }, { "Input": "Ik ben vorige 3 weken weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige 3 weken", @@ -2056,7 +2057,7 @@ }, { "Input": "afgelopen paar weken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen paar weken", @@ -2068,7 +2069,7 @@ }, { "Input": "afgelopen paar dagen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen paar dagen", @@ -2080,7 +2081,7 @@ }, { "Input": "Ik ben 2 okt. tot 22 oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 okt. tot 22 oktober", @@ -2092,7 +2093,7 @@ }, { "Input": "Ik ben 12 januari, 2016 tot 22-02-2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari, 2016 tot 22-02-2016", @@ -2104,7 +2105,7 @@ }, { "Input": "Ik ben 1e jan tot woens 22 jan weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1e jan tot woens 22 jan", @@ -2116,7 +2117,7 @@ }, { "Input": "Ik ben vandaag tot morgen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag tot morgen", @@ -2128,7 +2129,7 @@ }, { "Input": "Ik ben vandaag tot 22 oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag tot 22 oktober", @@ -2140,7 +2141,7 @@ }, { "Input": "Ik ben 2 okt. tot overmorgen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 okt. tot overmorgen", @@ -2152,7 +2153,7 @@ }, { "Input": "Ik ben vandaag tot volgende zondag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag tot volgende zondag", @@ -2164,7 +2165,7 @@ }, { "Input": "Ik ben deze vrijdag tot volgende zondag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze vrijdag tot volgende zondag", @@ -2176,7 +2177,7 @@ }, { "Input": "Ik ben van 2 okt. tot 22 oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 2 okt. tot 22 oktober", @@ -2188,7 +2189,7 @@ }, { "Input": "Ik ben van 12-08-2015 tot 22 oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 12-08-2015 tot 22 oktober", @@ -2200,7 +2201,7 @@ }, { "Input": "Ik ben van vrijdag de 2e tot dinsdag de 6e weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van vrijdag de 2e tot dinsdag de 6e", @@ -2212,7 +2213,7 @@ }, { "Input": "Ik ben van vandaag tot morgen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van vandaag tot morgen", @@ -2224,7 +2225,7 @@ }, { "Input": "Ik ben van deze vrijdag tot volgende zondag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van deze vrijdag tot volgende zondag", @@ -2236,7 +2237,7 @@ }, { "Input": "Ik ben tussen 2 okt. en 22 oktober weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 2 okt. en 22 oktober", @@ -2248,7 +2249,7 @@ }, { "Input": "Ik ben 19-20 november weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19-20 november", @@ -2260,7 +2261,7 @@ }, { "Input": "Ik ben 19 tot 20 november weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19 tot 20 november", @@ -2272,7 +2273,7 @@ }, { "Input": "Ik ben november tussen 19 en 20 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november tussen 19 en 20", @@ -2284,7 +2285,7 @@ }, { "Input": "Ik ben het derde kwartaal van 2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het derde kwartaal van 2016", @@ -2296,7 +2297,7 @@ }, { "Input": "Ik ben het derde kwartaal dit jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het derde kwartaal dit jaar", @@ -2308,7 +2309,7 @@ }, { "Input": "Ik ben 2016 het derde kwartaal weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 het derde kwartaal", @@ -2320,7 +2321,7 @@ }, { "Input": "Ik ben tijdens K1 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "K1", @@ -2332,7 +2333,7 @@ }, { "Input": "Ik ben dit K3 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "K3", @@ -2344,7 +2345,7 @@ }, { "Input": "Ik ben 2015.3 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015.3", @@ -2356,7 +2357,7 @@ }, { "Input": "Ik ben 2015-3 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015-3", @@ -2368,7 +2369,7 @@ }, { "Input": "Ik ben 2015/3 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015/3", @@ -2380,7 +2381,7 @@ }, { "Input": "Ik ben 3/2015 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3/2015", @@ -2392,7 +2393,7 @@ }, { "Input": "Ik ben de derde week van 2027 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de derde week van 2027", @@ -2404,7 +2405,7 @@ }, { "Input": "Ik ben volgend jaar de derde week weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgend jaar de derde week", @@ -2416,7 +2417,7 @@ }, { "Input": "Ik vertrek deze zomer", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze zomer", @@ -2428,7 +2429,7 @@ }, { "Input": "Ik vertrek volgende lente", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende lente", @@ -2440,7 +2441,7 @@ }, { "Input": "Ik vertrek de zomer", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de zomer", @@ -2452,7 +2453,7 @@ }, { "Input": "Ik vertrek zomer", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zomer", @@ -2464,7 +2465,7 @@ }, { "Input": "Ik vertrek zomer 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zomer 2016", @@ -2476,7 +2477,7 @@ }, { "Input": "Ik vertrek zomer van 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zomer van 2016", @@ -2488,7 +2489,7 @@ }, { "Input": "vakanties aankomende maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aankomende maand", @@ -2500,7 +2501,7 @@ }, { "Input": "vakantie volgende maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maand", @@ -2512,7 +2513,7 @@ }, { "Input": "Wat heb ik de week van 30e november", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week van 30e november", @@ -2524,7 +2525,7 @@ }, { "Input": "de week van 15e september", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week van 15e september", @@ -2536,7 +2537,7 @@ }, { "Input": "week van 15e september", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "week van 15e september", @@ -2548,7 +2549,7 @@ }, { "Input": "maand van 15e september", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand van 15e september", @@ -2560,7 +2561,7 @@ }, { "Input": "Ik vertrek tijdens het weekend", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het weekend", @@ -2572,7 +2573,7 @@ }, { "Input": "Ik vertrek de rest van de week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van de week", @@ -2584,7 +2585,7 @@ }, { "Input": "Ik vertrek de rest van mijn week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van mijn week", @@ -2596,7 +2597,7 @@ }, { "Input": "Ik vertrek rest van week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van week", @@ -2608,7 +2609,7 @@ }, { "Input": "Ik vertrek rest van de week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van de week", @@ -2620,7 +2621,7 @@ }, { "Input": "Ik vertrek rest van deze week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van deze week", @@ -2632,7 +2633,7 @@ }, { "Input": "Ik vertrek rest van huidige week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van huidige week", @@ -2644,7 +2645,7 @@ }, { "Input": "Ik vertrek rest van de maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van de maand", @@ -2656,7 +2657,7 @@ }, { "Input": "Ik vertrek rest van het jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van het jaar", @@ -2668,7 +2669,7 @@ }, { "Input": "Zoek een tijd om elkaar later deze maand te ontmoeten", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later deze maand", @@ -2680,7 +2681,7 @@ }, { "Input": "Zoek een tijd om elkaar later deze week te ontmoeten", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later deze week", @@ -2692,7 +2693,7 @@ }, { "Input": "Zoek een tijd om elkaar eind volgende week te ontmoeten", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind volgende week", @@ -2704,7 +2705,7 @@ }, { "Input": "Zoek een tijd om elkaar eind volgend jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind volgend jaar", @@ -2716,7 +2717,7 @@ }, { "Input": "We hebben eind vorige week afgesproken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind vorige week", @@ -2728,7 +2729,7 @@ }, { "Input": "Zoek een tijd voor ons om af te spreken begin deze maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin deze maand", @@ -2740,7 +2741,7 @@ }, { "Input": "Zoek een tijd voor ons om af te spreken begin deze week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin deze week", @@ -2752,7 +2753,7 @@ }, { "Input": "Zoek een tijd voor ons om af te spreken begin volgende week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin volgende week", @@ -2764,7 +2765,7 @@ }, { "Input": "Zoek een tijd voor ons om af te spreken begin volgend jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin volgend jaar", @@ -2776,7 +2777,7 @@ }, { "Input": "Cortana, regel alsjeblieft een meeting van 25 minuten met antonio volgende week tussen woensdag en vrijdag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week tussen woensdag en vrijdag", @@ -2788,7 +2789,7 @@ }, { "Input": "Ik ben jaar 247 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jaar 247", @@ -2800,7 +2801,7 @@ }, { "Input": "In de jaren 1970", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren 1970", @@ -2812,7 +2813,7 @@ }, { "Input": "In de jaren 2000 werd hij geboren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren 2000", @@ -2824,7 +2825,7 @@ }, { "Input": "In de jaren '70", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren '70", @@ -2836,7 +2837,7 @@ }, { "Input": "In de jaren '40", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren '40", @@ -2848,7 +2849,7 @@ }, { "Input": "In de jaren zeventig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren zeventig", @@ -2860,7 +2861,7 @@ }, { "Input": "In de jaren negentienzeventig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren negentienzeventig", @@ -2872,7 +2873,7 @@ }, { "Input": "In de jaren tweeduizend tien", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren tweeduizend tien", @@ -2884,7 +2885,7 @@ }, { "Input": "In de jaren tweeduizend", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren tweeduizend", @@ -2896,7 +2897,7 @@ }, { "Input": "In de jaren nul", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de jaren nul", @@ -2908,7 +2909,7 @@ }, { "Input": "Ik ben van 2 tot 7 feb, tweeduizend achttien weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 2 tot 7 feb, tweeduizend achttien", @@ -2920,7 +2921,7 @@ }, { "Input": "Ik ben tussen 2 tot 7 feb tweeduizend achttien weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 2 tot 7 feb tweeduizend achttien", @@ -2932,7 +2933,7 @@ }, { "Input": "Ik ben feb tussen 2-7 tweeduizend achttien weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "feb tussen 2-7 tweeduizend achttien", @@ -2944,7 +2945,7 @@ }, { "Input": "Het gebeurde in juni van negentiennegenennegentig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juni van negentiennegenennegentig", @@ -2956,7 +2957,7 @@ }, { "Input": "In negentienachtentwintig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "negentienachtentwintig", @@ -2968,7 +2969,7 @@ }, { "Input": "Ik ben de eerste week van tweeduizend zevenentwintig weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste week van tweeduizend zevenentwintig", @@ -2980,7 +2981,7 @@ }, { "Input": "Ik ben het eerste kwartaal van tweeduizend twintig weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het eerste kwartaal van tweeduizend twintig", @@ -2992,7 +2993,7 @@ }, { "Input": "In de lente van negentienachtenzeventig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de lente van negentienachtenzeventig", @@ -3004,7 +3005,7 @@ }, { "Input": "Jaar tweehonderdzevenenzestig,", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Jaar tweehonderdzevenenzestig", @@ -3016,7 +3017,7 @@ }, { "Input": "Ik ben de week na de volgende weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week na de volgende", @@ -3028,7 +3029,7 @@ }, { "Input": "Het gebeurde in de afgelopen 2 decennia", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de afgelopen 2 decennia", @@ -3040,7 +3041,7 @@ }, { "Input": "Het gebeurde in de laatste twee decennia", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste twee decennia", @@ -3052,7 +3053,7 @@ }, { "Input": "Het gebeurde in het volgende decennium", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het volgende decennium", @@ -3064,7 +3065,8 @@ }, { "Input": "Het zal 4 weken in de toekomst gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "4 weken in de toekomst", @@ -3076,7 +3078,8 @@ }, { "Input": "Het zal 2 dagen daarna gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 dagen daarna", @@ -3088,7 +3091,7 @@ }, { "Input": "Cortana kan een tijd begin volgende week voor ons vinden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin volgende week", @@ -3100,7 +3103,7 @@ }, { "Input": "Natuurlijk, laten we eind van volgende week Skypen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van volgende week", @@ -3112,7 +3115,7 @@ }, { "Input": "Cortana kan half maart een ontmoeting voor ons regelen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half maart", @@ -3124,7 +3127,7 @@ }, { "Input": "en anders tegen midzomer?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "midzomer", @@ -3136,7 +3139,7 @@ }, { "Input": "Ik kan begin van volgende week een tijd voor ons vastleggen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin van volgende week", @@ -3148,7 +3151,7 @@ }, { "Input": "Ik ben 11-2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11-2016", @@ -3160,7 +3163,7 @@ }, { "Input": "Ik ben 11/2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11/2016", @@ -3172,7 +3175,7 @@ }, { "Input": "Ik ben 2016/11 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016/11", @@ -3184,7 +3187,7 @@ }, { "Input": "Ik ben 2016-11 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016-11", @@ -3196,7 +3199,7 @@ }, { "Input": "Ik ben 2016 november weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 november", @@ -3208,7 +3211,7 @@ }, { "Input": "Ik ben november, 2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november, 2016", @@ -3220,7 +3223,7 @@ }, { "Input": "Ik ben 2016, nov weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016, nov", @@ -3232,7 +3235,7 @@ }, { "Input": "Ik ben tussen de 1e januari en de 5e april weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen de 1e januari en de 5e april", @@ -3244,7 +3247,8 @@ }, { "Input": "Ik ben tussen de 1e januari 2015 en de 5e feb 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen de 1e januari 2015 en de 5e feb 2018", @@ -3256,7 +3260,7 @@ }, { "Input": "Ik ben tussen de 1e januari 2015 en feb 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen de 1e januari 2015 en feb 2018", @@ -3268,7 +3272,8 @@ }, { "Input": "Ik ben tussen 2015 en feb 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 2015 en feb 2018", @@ -3280,7 +3285,7 @@ }, { "Input": "Ik ben van 1 feb tot maart 2019 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1 feb tot maart 2019", @@ -3292,7 +3297,8 @@ }, { "Input": "Ik ben tussen 1 feb en maart 2019 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 1 feb en maart 2019", @@ -3304,7 +3310,8 @@ }, { "Input": "Ik ben tussen juni 2015 en mei 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen juni 2015 en mei 2018", @@ -3316,7 +3323,8 @@ }, { "Input": "Ik ben tussen mei 2015 en 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen mei 2015 en 2018", @@ -3328,7 +3336,8 @@ }, { "Input": "Ik ben tussen mei 2015 en juni 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen mei 2015 en juni 2018", @@ -3340,7 +3349,8 @@ }, { "Input": "Ik ben tussen 2015 en de 5e van januari 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 2015 en de 5e van januari 2018", @@ -3352,7 +3362,7 @@ }, { "Input": "Ik ben van 2015 tot 5 mei 2017 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 2015 tot 5 mei 2017", @@ -3364,7 +3374,7 @@ }, { "Input": "Ik ben van laatste maandag april tot 2019 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van laatste maandag april tot 2019", @@ -3376,7 +3386,7 @@ }, { "Input": "Ik ben van week 31 tot week 35 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van week 31 tot week 35", @@ -3388,7 +3398,8 @@ }, { "Input": "Ik ben tussen week 31 en week 35 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen week 31 en week 35", @@ -3400,7 +3411,8 @@ }, { "Input": "Ik zal hier blijven van vandaag tot tweeënhalve dag later", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van vandaag tot tweeënhalve dag later", @@ -3412,7 +3424,7 @@ }, { "Input": "Wat is mijn bonus van april 2017?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "april 2017", @@ -3424,7 +3436,7 @@ }, { "Input": "Ik was daar niet in dezelfde maand dat het gebeurd", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dezelfde maand", @@ -3436,7 +3448,7 @@ }, { "Input": "Ik was daar niet in dezelfde week dat het gebeurd", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dezelfde week", @@ -3448,7 +3460,7 @@ }, { "Input": "Ik was er niet dat jaar.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dat jaar", @@ -3460,7 +3472,8 @@ }, { "Input": "Ik heb al mijn werk al meer dan 2 weken voor vandaag afgerond", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "meer dan 2 weken voor vandaag", @@ -3472,7 +3485,7 @@ }, { "Input": "Ik kom binnen 2 weken vanaf vandaag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "binnen 2 weken vanaf vandaag", @@ -3484,7 +3497,8 @@ }, { "Input": "Ik kom binnen minder dan 2 weken vanaf vandaag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen minder dan 2 weken vanaf vandaag", @@ -3496,7 +3510,8 @@ }, { "Input": "Deze taak zou meer dan 2 dagen voor gisteren moeten zijn gedaan", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "meer dan 2 dagen voor gisteren", @@ -3508,7 +3523,8 @@ }, { "Input": "Deze taak zal minder dan 3 dagen na morgen afgerond zijn", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "javascript, java, python", "Results": [ { "Text": "minder dan 3 dagen na morgen", @@ -3520,7 +3536,7 @@ }, { "Input": "Ik miste okt. 2001", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "okt. 2001", @@ -3532,7 +3548,7 @@ }, { "Input": "verkoop waarvan de datum dit decennium is", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dit decennium", @@ -3544,7 +3560,7 @@ }, { "Input": "Ik ben het derde kwartaal weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het derde kwartaal", @@ -3556,7 +3572,7 @@ }, { "Input": "Ik ben het derde kwartaal van volgend jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het derde kwartaal van volgend jaar", @@ -3568,7 +3584,7 @@ }, { "Input": "Ik ben het vierde kwartaal van volgend jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het vierde kwartaal van volgend jaar", @@ -3580,12 +3596,12 @@ }, { "Input": "Zet alsjeblieft $2000 om naar Britse ponden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Het aandeel van deze bank is 20% lager in het jaar tot op heden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jaar tot op heden", @@ -3597,7 +3613,7 @@ }, { "Input": "van 1-10 tot 7-11", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1-10 tot 7-11", @@ -3609,7 +3625,7 @@ }, { "Input": "Ik zal mijn werk doen tussen nu en november 15e", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen nu en november 15e", @@ -3621,7 +3637,7 @@ }, { "Input": "Ik heb mijn werk tussen 22 jan en nu afgerond", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen 22 jan en nu", @@ -3633,7 +3649,7 @@ }, { "Input": "15.00 : ik ben deze week weg", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -3645,8 +3661,8 @@ }, { "Input": "deze week 8.00 zou een datumreeks en een tijdstip moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -3658,8 +3674,8 @@ }, { "Input": "deze week 20.00 zou een datumreeks en een tijdstip moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -3671,7 +3687,7 @@ }, { "Input": "week 10 20.00 zou een datumreeks en een tijdstip moeten zijn", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "week 10", @@ -3683,7 +3699,7 @@ }, { "Input": "week 10 10:20 zou een datumreeks en een tijdstip moeten zijn", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "week 10", @@ -3695,7 +3711,7 @@ }, { "Input": "6,107.31 augustus 2019 zou het decimaal niet moeten bevatten", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "augustus 2019", @@ -3707,7 +3723,7 @@ }, { "Input": "Ik was daar niet van 01/aug/2019 tot vandaag", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 01/aug/2019 tot vandaag", @@ -3719,7 +3735,7 @@ }, { "Input": "Ik was daar niet van 01-aug-2019 tot vandaag", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 01-aug-2019 tot vandaag", @@ -3731,8 +3747,8 @@ }, { "Input": "plan alsjeblieft een meeting in voor de week die 4 februari aanvangt", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die 4 februari aanvangt", @@ -3744,8 +3760,8 @@ }, { "Input": "plan alsjeblieft een meeting in voor de week die 4 februari start", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die 4 februari start", @@ -3757,8 +3773,8 @@ }, { "Input": "plan alsjeblieft een meeting in voor de week die op 4 februari start", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die op 4 februari start", @@ -3770,8 +3786,8 @@ }, { "Input": "plan alsjeblieft een meeting in voor de week die op 4 februari begint", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die op 4 februari begint", @@ -3783,8 +3799,8 @@ }, { "Input": "plan alsjeblieft een meeting in voor de week die 4 februari begint", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die 4 februari begint", @@ -3796,7 +3812,7 @@ }, { "Input": "Boek een reis van 26e juni van 2020 tot 28e juni van 2020", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 26e juni van 2020 tot 28e juni van 2020", @@ -3805,5 +3821,27 @@ "Length": 43 } ] + }, + { + "Input": "Laat me de gegevens van augustus 99 zien", + "Results": [ + { + "Text": "augustus 99", + "Type": "daterange", + "Start": 24, + "Length": 11 + } + ] + }, + { + "Input": "Laat me de gegevens van augustus '99 zien", + "Results": [ + { + "Text": "augustus '99", + "Type": "daterange", + "Start": 24, + "Length": 12 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Dutch/DatePeriodParser.json b/Specs/DateTime/Dutch/DatePeriodParser.json index 744a00a1ac..83438bb7ca 100644 --- a/Specs/DateTime/Dutch/DatePeriodParser.json +++ b/Specs/DateTime/Dutch/DatePeriodParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze maand van 4 tot 22", @@ -30,7 +30,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maand van 4-23", @@ -56,7 +56,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3 tot 12 van sept", @@ -82,7 +82,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van vrijdag de 11e tot dinsdag de 15e", @@ -108,7 +108,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maand 4 tot 23", @@ -134,7 +134,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze maand 4 tot 23", @@ -160,7 +160,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze maand tussen 4 en 22", @@ -186,7 +186,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 en 12 van sept", @@ -212,7 +212,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 4 tot 22 januari 1995", @@ -238,7 +238,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 4-22 januari 1995", @@ -264,7 +264,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen de 4e van september tot en met de 8e van september", @@ -290,7 +290,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende week", @@ -342,7 +342,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "huidige week", @@ -368,7 +368,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "februari", @@ -394,7 +394,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze september", @@ -420,7 +420,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen september", @@ -446,7 +446,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende juni", @@ -472,7 +472,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de derde week van deze maand", @@ -498,7 +499,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste week van juli", @@ -524,7 +525,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "week van september de 16e", @@ -550,7 +551,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maand van september de 16e", @@ -576,7 +577,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015.3", @@ -602,7 +603,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015-3", @@ -628,7 +629,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3-2015", @@ -654,7 +655,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -662,7 +663,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende 2 dagen", @@ -688,7 +689,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "afgelopen paar dagen", @@ -714,7 +716,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "afgelopen enkele dagen", @@ -740,7 +743,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week", @@ -766,7 +769,7 @@ "Context": { "ReferenceDateTime": "2026-01-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week", @@ -792,7 +795,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mijn week", @@ -818,7 +821,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het weekend", @@ -844,7 +847,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dit weekend", @@ -870,7 +873,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mijn weekend", @@ -896,7 +899,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 okt. tot 22 oktober", @@ -922,7 +925,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari 2016 - 22-01-2016", @@ -948,7 +951,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 1e van jan tot woens, de 22e jan", @@ -974,7 +977,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag tot morgen", @@ -1000,7 +1003,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 2 okt. tot 22 oktober", @@ -1026,7 +1029,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 2 okt. en 22 oktober", @@ -1052,7 +1055,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19-20 november", @@ -1078,7 +1081,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19 tot 20 november", @@ -1104,7 +1107,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 19 en 20 november", @@ -1130,7 +1133,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van de week", @@ -1156,7 +1159,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van week", @@ -1182,7 +1185,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest deze week", @@ -1208,7 +1211,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van mijn week", @@ -1234,7 +1237,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van huidige week", @@ -1260,7 +1263,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van de maand", @@ -1286,7 +1289,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van het jaar", @@ -1312,7 +1315,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dit weekend", @@ -1338,7 +1341,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dit weekend", @@ -1364,7 +1367,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "juni 2016", @@ -1390,7 +1393,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgend jaar juni", @@ -1416,7 +1419,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgend jaar", @@ -1442,7 +1445,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende 3 dagen", @@ -1468,7 +1471,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende 3 maanden", @@ -1491,7 +1494,7 @@ }, { "Input": "Ik ben over 3 jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, @@ -1502,7 +1505,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste week van okt", @@ -1528,7 +1531,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de derde week van 2027", @@ -1554,7 +1558,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "volgend jaar de derde week", @@ -1580,7 +1585,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het derde kwartaal van 2016", @@ -1606,7 +1611,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dit jaar het derde kwartaal", @@ -1632,7 +1637,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 het derde kwartaal", @@ -1658,7 +1663,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "K3 dit jaar", @@ -1684,7 +1689,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 K3", @@ -1710,7 +1715,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "K3", @@ -1736,7 +1741,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "K2", @@ -1762,7 +1767,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "K1 2016", @@ -1788,7 +1793,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "K4 2016", @@ -1814,7 +1819,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze zomer", @@ -1834,7 +1839,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende lente", @@ -1854,7 +1859,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de zomer", @@ -1874,7 +1879,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zomer", @@ -1894,7 +1899,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zomer 2016", @@ -1914,7 +1919,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zomer van 2016", @@ -1934,7 +1939,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aankomende maand", @@ -1960,7 +1965,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maand", @@ -1986,7 +1991,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind deze maand", @@ -2013,7 +2018,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind deze week", @@ -2040,7 +2045,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind dit jaar", @@ -2067,7 +2072,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin volgend jaar", @@ -2094,7 +2099,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin volgende week", @@ -2121,7 +2126,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin volgende maand", @@ -2148,7 +2153,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind vorig jaar", @@ -2175,7 +2180,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind vorige week", @@ -2202,7 +2207,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind vorige maand", @@ -2229,7 +2234,7 @@ "Context": { "ReferenceDateTime": "2017-11-14T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week tussen woensdag en vrijdag", @@ -2255,7 +2260,7 @@ "Context": { "ReferenceDateTime": "2017-11-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week", @@ -2281,7 +2286,8 @@ "Context": { "ReferenceDateTime": "2017-11-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de eerste week van dit jaar", @@ -2307,7 +2313,7 @@ "Context": { "ReferenceDateTime": "2017-11-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste week van 2015", @@ -2333,7 +2339,8 @@ "Context": { "ReferenceDateTime": "2017-11-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tweede week van 2015", @@ -2359,7 +2366,7 @@ "Context": { "ReferenceDateTime": "2017-11-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste week van 2015", @@ -2385,7 +2392,8 @@ "Context": { "ReferenceDateTime": "2017-12-18T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "jaar 247", @@ -2411,7 +2419,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren 1970", @@ -2437,7 +2446,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren 2000", @@ -2463,7 +2473,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren '70", @@ -2489,7 +2500,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "jaren '70", @@ -2515,7 +2527,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren '40", @@ -2541,7 +2554,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren zeventig", @@ -2567,7 +2581,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren negentien zeventig", @@ -2593,7 +2608,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren tweeduizend tien", @@ -2619,7 +2635,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren tweeduizend", @@ -2645,7 +2662,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de jaren nul", @@ -2671,7 +2689,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van 2 tot 7 feb, tweeduizend achttien", @@ -2697,7 +2716,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 2 en 7 feb tweeduizend achttien", @@ -2723,7 +2743,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "in feb tussen 2-7 tweeduizend achttien", @@ -2749,7 +2770,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "juni negentiennegenennegentig", @@ -2775,7 +2797,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "negentienachtentwintig", @@ -2801,7 +2823,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zeventienhonderdnegenentachtig", @@ -2827,7 +2849,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de derde week van tweeduizend zevenentwintig", @@ -2853,7 +2876,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "het derde kwartaal van tweeduizend twintig", @@ -2879,7 +2903,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de lente van negentienachtenzeventig", @@ -2899,7 +2924,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "jaar tweehonderdzevenenzestig", @@ -2925,7 +2951,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week na de volgende", @@ -2951,7 +2977,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de maand na de volgende", @@ -2977,7 +3004,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "het jaar na het volgende", @@ -3003,7 +3031,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "het weekend na het volgende", @@ -3029,7 +3058,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2014-2018", @@ -3055,7 +3085,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 2014-2018", @@ -3081,7 +3112,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van 2014 tot 2018", @@ -3107,7 +3139,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "in 2014 tot en met 2018", @@ -3133,7 +3166,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van tweeduizend tot tweeduizend veertien", @@ -3159,7 +3193,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de afgelopen 2 decennia", @@ -3185,7 +3220,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "de laatste 2 decennia", @@ -3211,7 +3247,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "het volgende decennium", @@ -3237,7 +3274,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "javascript, python", "Results": [ { "Text": "de volgende 3 decennia", @@ -3263,7 +3301,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "4 weken in de toekomst", @@ -3289,7 +3328,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 dagen daarna", @@ -3315,7 +3355,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin van volgende week", @@ -3342,7 +3382,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van volgende week", @@ -3369,7 +3409,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin van volgende week", @@ -3396,7 +3436,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "midzomer", @@ -3417,7 +3458,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 5 dagen", @@ -3443,7 +3485,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 10 maanden", @@ -3469,7 +3512,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 3 jaar", @@ -3495,7 +3539,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 5 jaar 1 maand en 12 dagen", @@ -3521,7 +3566,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen de volgende 3 jaar", @@ -3547,7 +3593,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen de aankomende 5 jaar 1 maand en 12 dagen", @@ -3573,7 +3620,7 @@ "Context": { "ReferenceDateTime": "2018-04-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 02 tot 07 april", @@ -3599,7 +3646,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -3607,7 +3654,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 juni", @@ -3633,7 +3680,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016, nov", @@ -3659,7 +3706,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november, 2016", @@ -3685,7 +3732,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november 2016", @@ -3711,7 +3758,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016-11", @@ -3737,7 +3784,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 - 11", @@ -3763,7 +3810,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016/11", @@ -3789,7 +3836,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 / 11", @@ -3815,7 +3862,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11-2016", @@ -3841,7 +3888,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11 - 2016", @@ -3867,7 +3914,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11/2016", @@ -3893,7 +3940,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11 / 2016", @@ -3920,7 +3967,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Comment": "Compound timex represent value dependency and will be split at the model level", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 1 januari en 5 april", @@ -3946,7 +3993,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 1 januari 2015 en 5 februari 2018", @@ -3972,7 +4019,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 1 januari 2015 en feb 2018", @@ -3998,7 +4046,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 2015 en feb 2018", @@ -4024,7 +4073,8 @@ "Context": { "ReferenceDateTime": "2018-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van 1 feb tot maart 2019", @@ -4050,7 +4100,8 @@ "Context": { "ReferenceDateTime": "2018-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 1 feb en maart 2019", @@ -4076,7 +4127,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen juni 2015 en mei 2018", @@ -4102,7 +4154,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen mei 2015 en 2018", @@ -4128,7 +4181,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen mei 2015 en juni 2018", @@ -4154,7 +4208,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 2015 en 5 januari 2018", @@ -4180,7 +4235,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van 2015 tot 5 mei 2017", @@ -4206,7 +4262,8 @@ "Context": { "ReferenceDateTime": "2018-05-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van de laatste maandag in april tot 2019", @@ -4232,7 +4289,8 @@ "Context": { "ReferenceDateTime": "2018-05-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van week 31 tot week 35", @@ -4258,7 +4316,8 @@ "Context": { "ReferenceDateTime": "2018-05-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen week 31 en week 35", @@ -4284,7 +4343,8 @@ "Context": { "ReferenceDateTime": "2018-05-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van vandaag tot tweeënhalve dag later", @@ -4310,7 +4370,8 @@ "Context": { "ReferenceDateTime": "2017-11-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "dezelfde week", @@ -4337,7 +4398,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "dezelfde maand", @@ -4364,7 +4426,8 @@ "Context": { "ReferenceDateTime": "2016-11-11T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "dat weekend", @@ -4391,7 +4454,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "datzelfde jaar", @@ -4418,7 +4482,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder in de week", @@ -4444,7 +4508,8 @@ "Context": { "ReferenceDateTime": "2018-05-13T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "eerder deze maand", @@ -4470,7 +4535,8 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "eerder dit jaar", @@ -4496,7 +4562,7 @@ "Context": { "ReferenceDateTime": "2017-11-10T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later deze week", @@ -4522,7 +4588,8 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "later deze maand", @@ -4548,7 +4615,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "later dit jaar", @@ -4574,7 +4642,8 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "later in het jaar", @@ -4600,7 +4669,8 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "meer dan 2 weken na vandaag", @@ -4625,7 +4695,8 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "minder dan 2 weken vanaf vandaag", @@ -4651,7 +4722,8 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 2 weken vanaf vandaag", @@ -4677,7 +4749,8 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "meer dan 2 weken voor vandaag", @@ -4702,7 +4775,8 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "meer dan 2 dagen voor gisteren", @@ -4727,7 +4801,8 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "minder dan 3 dagen na morgen", @@ -4753,7 +4828,8 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "15e eeuw", @@ -4779,7 +4855,8 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "21e eeuw", @@ -4805,7 +4882,8 @@ "Context": { "ReferenceDateTime": "2018-08-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "dit decennium", @@ -4831,7 +4909,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1-10 tot 7-11", @@ -4857,7 +4935,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 25-10 tot 25-01", @@ -4883,7 +4961,7 @@ "Context": { "ReferenceDateTime": "2019-01-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -4909,7 +4987,7 @@ "Context": { "ReferenceDateTime": "2017-01-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -4935,7 +5013,7 @@ "Context": { "ReferenceDateTime": "2016-01-01T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -4961,7 +5039,7 @@ "Context": { "ReferenceDateTime": "2019-04-23T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen nu en 15 november", @@ -4987,7 +5065,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen 22 jan en nu", @@ -5013,7 +5091,7 @@ "Context": { "ReferenceDateTime": "2019-07-11T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -5039,7 +5117,7 @@ "Context": { "ReferenceDateTime": "2019-07-11T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -5065,7 +5143,7 @@ "Context": { "ReferenceDateTime": "2019-07-11T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze week", @@ -5091,7 +5169,7 @@ "Context": { "ReferenceDateTime": "2019-07-11T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "week 10", @@ -5117,7 +5195,7 @@ "Context": { "ReferenceDateTime": "2019-07-11T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "week 10", @@ -5143,8 +5221,8 @@ "Context": { "ReferenceDateTime": "2019-07-30T15:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van aankomende vrijdag tot 1 okt 2020", @@ -5170,7 +5248,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T15:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "augustus 2019", @@ -5196,7 +5274,7 @@ "Context": { "ReferenceDateTime": "2019-10-14T15:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 1-aug-2019 tot vandaag", @@ -5222,7 +5300,7 @@ "Context": { "ReferenceDateTime": "2019-09-30T15:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 01/aug/2019 tot vandaag", @@ -5248,8 +5326,8 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die 4 februari aanvangt", @@ -5275,8 +5353,8 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die 4 februari start", @@ -5302,8 +5380,8 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die op 4 februari start", @@ -5329,8 +5407,8 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die op 4 februari begint", @@ -5356,8 +5434,8 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de week die 4 februari begint", @@ -5383,8 +5461,8 @@ "Context": { "ReferenceDateTime": "2020-04-23T18:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "einde van 2000", @@ -5411,8 +5489,8 @@ "Context": { "ReferenceDateTime": "2020-04-23T18:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "begin van 2000", @@ -5439,8 +5517,8 @@ "Context": { "ReferenceDateTime": "2020-04-23T18:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "halverwege 2000", @@ -5461,5 +5539,51 @@ "Length": 15 } ] + }, + { + "Input": "Laat me de gegevens van augustus 99 zien", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "augustus 99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 24, + "Length": 11 + } + ] + }, + { + "Input": "Laat me de gegevens van augustus '99 zien", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "augustus '99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 24, + "Length": 12 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Dutch/DateTimeExtractor.json b/Specs/DateTime/Dutch/DateTimeExtractor.json index 3ef7439856..9ce633eea6 100644 --- a/Specs/DateTime/Dutch/DateTimeExtractor.json +++ b/Specs/DateTime/Dutch/DateTimeExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Ik ga nu terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nu", @@ -13,7 +13,7 @@ }, { "Input": "Ik ga zo snel mogelijk terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zo snel mogelijk", @@ -25,7 +25,7 @@ }, { "Input": "Ik ga terug op 15 om 8:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 om 8:00", @@ -37,7 +37,7 @@ }, { "Input": "Ik ga terug op 15 om 8:00:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 om 8:00:30", @@ -49,7 +49,7 @@ }, { "Input": "Ik ga terug op 15 om 8.00:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 om 8.00:30", @@ -61,7 +61,7 @@ }, { "Input": "Ik ga terug op 15, 20u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15, 20u", @@ -73,7 +73,7 @@ }, { "Input": "Ik ga terug op 21/04/2016, 20u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21/04/2016, 20u", @@ -85,7 +85,7 @@ }, { "Input": "Ik ga terug op 23 Okt om 7", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "23 Okt om 7", @@ -97,7 +97,7 @@ }, { "Input": "Ik ga terug op 14 oktober 20:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober 20:00", @@ -109,7 +109,7 @@ }, { "Input": "Ik ga terug op 14 oktober om 8:00:00u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober om 8:00:00u", @@ -121,7 +121,7 @@ }, { "Input": "Ik ga terug op 14 oktober, 8:00u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober, 8:00u", @@ -133,7 +133,7 @@ }, { "Input": "Ik ga morgen om 8:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen om 8:00", @@ -145,7 +145,7 @@ }, { "Input": "Ik ga morgen rond 8 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen rond 8 uur", @@ -157,7 +157,7 @@ }, { "Input": "Ik ga morgen voor 8u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen voor 8u", @@ -169,7 +169,7 @@ }, { "Input": "Ik ga morgen 8:00:05u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen 8:00:05u", @@ -181,7 +181,7 @@ }, { "Input": "Ik ga volgende week vrijdag om half 4 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week vrijdag om half 4", @@ -193,7 +193,7 @@ }, { "Input": "Ik ga terug op 5 mei 2016, 20 minuten over 8 in de avond", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 mei 2016, 20 minuten over 8 in de avond", @@ -205,7 +205,7 @@ }, { "Input": "Ik ga terug 20.00 op 15", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20.00 op 15", @@ -217,7 +217,7 @@ }, { "Input": "Ik ga terug om zeven op 15", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zeven op 15", @@ -229,7 +229,7 @@ }, { "Input": "Ik ga terug om 20u komende zondag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20u komende zondag", @@ -241,7 +241,7 @@ }, { "Input": "Ik ga vandaag om 20u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag om 20u", @@ -253,7 +253,7 @@ }, { "Input": "Ik ga terug om kwart voor zeven morgen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kwart voor zeven morgen", @@ -265,7 +265,7 @@ }, { "Input": "Ik ga terug om 19u, 22-12-2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19u, 22-12-2016", @@ -277,7 +277,7 @@ }, { "Input": "Ik ga terug zeven uur morgen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zeven uur morgen", @@ -289,7 +289,7 @@ }, { "Input": "Ik ga terug om 7 uur morgenochtend", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7 uur morgenochtend", @@ -301,7 +301,7 @@ }, { "Input": "Ik ga terug om 19:00 op zondagavond", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:00 op zondagavond", @@ -313,7 +313,7 @@ }, { "Input": "Ik ga terug 20 minuten over vijf morgenochtend", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20 minuten over vijf morgenochtend", @@ -325,7 +325,7 @@ }, { "Input": "Ik ga terug op 14 oktober om 8:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober om 8:00", @@ -337,7 +337,7 @@ }, { "Input": "Ik ga terug om 7u, deze ochtend", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7u, deze ochtend", @@ -349,7 +349,7 @@ }, { "Input": "Ik ga terug om 20u 's avonds, maandag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20u 's avonds, maandag", @@ -361,7 +361,7 @@ }, { "Input": "Ik ga terug 20u in de avond, 1 jan", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20u in de avond, 1 jan", @@ -373,7 +373,7 @@ }, { "Input": "Ik ga terug om 22h vanavond", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22h vanavond", @@ -385,7 +385,7 @@ }, { "Input": "Ik ga terug om 8u deze morgen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8u deze morgen", @@ -397,7 +397,7 @@ }, { "Input": "Ik ga terug om 20u vanavond", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20u vanavond", @@ -409,7 +409,7 @@ }, { "Input": "Ik ga terug vanavond rond 7", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond rond 7", @@ -421,7 +421,7 @@ }, { "Input": "Ik ga terug deze morgen om 7", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze morgen om 7", @@ -433,7 +433,7 @@ }, { "Input": "Ik ga terug vanmorgen om 7u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanmorgen om 7u", @@ -445,7 +445,7 @@ }, { "Input": "Ik ga deze morgen om zeven terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze morgen om zeven", @@ -457,7 +457,7 @@ }, { "Input": "Ik ga deze morgen om 7:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze morgen om 7:00", @@ -469,7 +469,7 @@ }, { "Input": "Ik ga vanavond om 7 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond om 7", @@ -481,7 +481,8 @@ }, { "Input": "voor 2 personen vanavond om 21.30u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "vanavond om 21.30u", @@ -493,7 +494,8 @@ }, { "Input": "voor 2 personen vanavond om 21.30:31u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "vanavond om 21.30:31u", @@ -505,7 +507,7 @@ }, { "Input": "Ik ga eind van de dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van de dag", @@ -517,7 +519,7 @@ }, { "Input": "Ik ga morgen einde van de dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen einde van de dag", @@ -529,7 +531,7 @@ }, { "Input": "Ik ga zondag eind van de dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zondag eind van de dag", @@ -541,7 +543,7 @@ }, { "Input": "Ik ga terug op de 5e om 4u ‘s morgens", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 5e om 4u ‘s morgens", @@ -553,7 +555,7 @@ }, { "Input": "Ik ga terug op 16-12-2016 om 12.23:59u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16-12-2016 om 12.23:59u", @@ -565,7 +567,7 @@ }, { "Input": "Ik ga terug over 5 uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 5 uur", @@ -577,7 +579,7 @@ }, { "Input": "bekijk of ik beschikbaar ben om 15u op zondag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15u op zondag", @@ -589,7 +591,7 @@ }, { "Input": "Afspraak voor morgenochtend om 9 uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenochtend om 9 uur", @@ -601,7 +603,7 @@ }, { "Input": "Ik ga morgenochtend om 9 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenochtend om 9 uur", @@ -613,7 +615,7 @@ }, { "Input": "Ik ga morgenochtend om 9u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenochtend om 9u", @@ -625,7 +627,7 @@ }, { "Input": "Ik ga morgen om 9 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen om 9 uur", @@ -637,7 +639,7 @@ }, { "Input": "deze vrijdag om 13u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze vrijdag om 13u", @@ -649,7 +651,7 @@ }, { "Input": "VOEG LUNCH TOE OM 12.30u OP VRIJDAG", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "om 12.30u OP VRIJDAG", @@ -661,7 +663,7 @@ }, { "Input": "Voeg 649 toe middernacht vannacht", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "middernacht vannacht", @@ -673,7 +675,7 @@ }, { "Input": "Ik ga op 1 augustus om 11u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 augustus om 11u", @@ -685,7 +687,7 @@ }, { "Input": "Ik ga op 1 augustus om 23u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 augustus om 23u", @@ -697,7 +699,7 @@ }, { "Input": "Ik ga 1 augustus 23u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 augustus 23u", @@ -709,7 +711,7 @@ }, { "Input": "Ik ga 25/2 om 11u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "25/2 om 11u", @@ -721,7 +723,7 @@ }, { "Input": "Ik ga op 6 jan 2017 6.37u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "6 jan 2017 6.37u", @@ -733,7 +735,7 @@ }, { "Input": "16 Nov. 2016 10.38", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16 Nov. 2016 10.38", @@ -745,7 +747,7 @@ }, { "Input": "Ik vertrek 1 dag en 2 uur later", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 dag en 2 uur later", @@ -757,7 +759,7 @@ }, { "Input": "Ik ben druk over een uur, dus bel me later", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over een uur", @@ -769,7 +771,7 @@ }, { "Input": "Ik ontmoette hem 2 maanden 1 dag en 2 uur geleden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 maanden 1 dag en 2 uur geleden", @@ -781,7 +783,7 @@ }, { "Input": "Ik ontmoette hem 2 maanden 1 dag 2 uur geleden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 maanden 1 dag 2 uur geleden", @@ -793,7 +795,7 @@ }, { "Input": "Ik vertrek 1 dag en 30 minuten later", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 dag en 30 minuten later", @@ -805,7 +807,7 @@ }, { "Input": "Ik vertrek over 2 minuten", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 2 minuten", @@ -817,7 +819,7 @@ }, { "Input": "Ik ga nu meteen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nu meteen", @@ -829,7 +831,7 @@ }, { "Input": "Ik ga op 15 om 8:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 om 8:00", @@ -841,7 +843,7 @@ }, { "Input": "Ik ga op 15 om 8:00:30 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 om 8:00:30", @@ -853,7 +855,7 @@ }, { "Input": "Ik ga op de 15e, 20:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 15e, 20:00", @@ -865,7 +867,7 @@ }, { "Input": "Ik ga 21-04-2016, 20.00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21-04-2016, 20.00", @@ -877,7 +879,7 @@ }, { "Input": "Ik ga 23 okt. om zeven uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "23 okt. om zeven uur", @@ -889,7 +891,7 @@ }, { "Input": "Ik ga 14 oktober 8:00 's morgens terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober 8:00 's morgens", @@ -901,7 +903,7 @@ }, { "Input": "Ik ga 14 oktober 8:00:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober 8:00:00", @@ -913,7 +915,7 @@ }, { "Input": "Ik ga 14 oktober, 8:00 uur 's morgens terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober, 8:00 uur 's morgens", @@ -925,7 +927,7 @@ }, { "Input": "Ik ga morgen 8:00 's ochtends terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen 8:00 's ochtends", @@ -937,7 +939,7 @@ }, { "Input": "Ik ga morgen rond 8:00 's ochtends terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen rond 8:00 's ochtends", @@ -949,7 +951,7 @@ }, { "Input": "Ik ga morgen voor 8:00 's ochtends terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen voor 8:00 's ochtends", @@ -961,7 +963,7 @@ }, { "Input": "Ik ga morgen 8:00:05 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen 8:00:05", @@ -973,7 +975,7 @@ }, { "Input": "Ik ga volgende vrijdag om half 4 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende vrijdag om half 4", @@ -985,7 +987,7 @@ }, { "Input": "Ik ga 5 mei, 2016, 20.20 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 mei, 2016, 20.20", @@ -997,7 +999,7 @@ }, { "Input": "Ik ga terug op de 15e om 20.00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 15e om 20.00", @@ -1009,7 +1011,7 @@ }, { "Input": "Ik ga terug om zeven uur op de 15e", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zeven uur op de 15e", @@ -1021,7 +1023,7 @@ }, { "Input": "Ik ga volgende week zondag 20.00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week zondag 20.00", @@ -1033,7 +1035,7 @@ }, { "Input": "Ik ga 20.00 vandaag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20.00 vandaag", @@ -1045,7 +1047,7 @@ }, { "Input": "Ik ga morgen kwart voor zeven terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen kwart voor zeven", @@ -1057,7 +1059,7 @@ }, { "Input": "Ik ga 19.00, 22-12-2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19.00, 22-12-2016", @@ -1069,7 +1071,7 @@ }, { "Input": "Ik ga morgen zeven uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen zeven uur", @@ -1081,7 +1083,7 @@ }, { "Input": "Ik ga morgenochtend om 7 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenochtend om 7 uur", @@ -1093,7 +1095,7 @@ }, { "Input": "Ik ga zondagmiddag om 7:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zondagmiddag om 7:00", @@ -1105,7 +1107,7 @@ }, { "Input": "Ik ga morgenochtend tien voor half zes terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenochtend tien voor half zes", @@ -1117,7 +1119,7 @@ }, { "Input": "Ik ga 14 oktober 8:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober 8:00", @@ -1129,7 +1131,7 @@ }, { "Input": "Ik ga om 7 uur vanmorgen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7 uur vanmorgen", @@ -1141,7 +1143,7 @@ }, { "Input": "Ik ga 8 uur 's avonds, maandag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8 uur 's avonds, maandag", @@ -1153,7 +1155,7 @@ }, { "Input": "Ik ga 10 uur vanavond terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10 uur vanavond", @@ -1165,7 +1167,7 @@ }, { "Input": "Ik ga 8 uur vanmorgen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8 uur vanmorgen", @@ -1177,7 +1179,7 @@ }, { "Input": "Ik ga 8 uur vanavond terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8 uur vanavond", @@ -1189,7 +1191,7 @@ }, { "Input": "Ik ga vanavond rond 7 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond rond 7 uur", @@ -1201,7 +1203,7 @@ }, { "Input": "Ik ga vanmorgen om 7 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanmorgen om 7 uur", @@ -1213,7 +1215,7 @@ }, { "Input": "Ik ga vanmorgen om zeven uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanmorgen om zeven uur", @@ -1225,7 +1227,7 @@ }, { "Input": "Ik ga vanmorgen om 7:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanmorgen om 7:00", @@ -1237,7 +1239,8 @@ }, { "Input": "Ik ga deze avond om 7 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "deze avond om 7 uur", @@ -1249,7 +1252,8 @@ }, { "Input": "Ik ga vanavond om 7 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "vanavond om 7 uur", @@ -1261,7 +1265,8 @@ }, { "Input": "Ik ga vanavond om 21:30 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "vanavond om 21:30", @@ -1273,7 +1278,9 @@ }, { "Input": "Ik ga vanavond om 21:30:31 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", + "Results": [ { "Text": "vanavond om 21:30:31", @@ -1285,7 +1292,7 @@ }, { "Input": "Ik ga het eind van de dag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het eind van de dag", @@ -1297,7 +1304,7 @@ }, { "Input": "Ik ga eind van morgen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van morgen", @@ -1309,7 +1316,7 @@ }, { "Input": "Ik ga eind van de zondag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van de zondag", @@ -1321,7 +1328,7 @@ }, { "Input": "Ik ga op de 5e om 4:00 's ochtends terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 5e om 4:00 's ochtends", @@ -1333,7 +1340,7 @@ }, { "Input": "Ik ga 2016-12-16 12:23:59 's middags terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016-12-16 12:23:59 's middags", @@ -1345,7 +1352,7 @@ }, { "Input": "Ik ga over 5 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 5 uur", @@ -1357,7 +1364,7 @@ }, { "Input": "kijk of ik beschikbaar ben om 15:00 op zon", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15:00 op zon", @@ -1369,7 +1376,7 @@ }, { "Input": "Boek afspraak in voor morgenochtend om 9 uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenochtend om 9 uur", @@ -1381,7 +1388,7 @@ }, { "Input": "deze vrijdag om één uur 's middags", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze vrijdag om één uur 's middags", @@ -1393,7 +1400,7 @@ }, { "Input": "VOEG LUNCH TOE OM 12.30 'S MIDDAGS OP VRIJ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "om 12.30 'S MIDDAGS OP VRIJ", @@ -1405,7 +1412,7 @@ }, { "Input": "Voeg 649 middernacht vanavond", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "middernacht vanavond", @@ -1417,7 +1424,7 @@ }, { "Input": "Ik ga de 1e van augustus 11:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 1e van augustus 11:00", @@ -1429,7 +1436,7 @@ }, { "Input": "Ik ga de 1e van augustus 23:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 1e van augustus 23:00", @@ -1441,7 +1448,7 @@ }, { "Input": "Ik ga 25-02 11:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "25-02 11:00", @@ -1453,7 +1460,7 @@ }, { "Input": "Ik ga 6 jan 2017 - 6.37 's ochtends terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "6 jan 2017 - 6.37 's ochtends", @@ -1465,7 +1472,7 @@ }, { "Input": "16 nov. 2016 10:38", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16 nov. 2016 10:38", @@ -1477,7 +1484,7 @@ }, { "Input": "Ik vertrek 1 dag, 2 uur later", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 dag, 2 uur later", @@ -1489,7 +1496,7 @@ }, { "Input": "Ik ben over een uur druk, dus bel me later", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over een uur", @@ -1501,7 +1508,7 @@ }, { "Input": "Ik ontmoette hem 2 maanden, 1 dag, 2 uur geleden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 maanden, 1 dag, 2 uur geleden", @@ -1513,7 +1520,7 @@ }, { "Input": "Boek alsjeblieft Skypegesprek vandaag om 9:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag om 9:00", @@ -1525,7 +1532,7 @@ }, { "Input": "Boek alsjeblieft Skypegesprek vandaag om 21:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag om 21:00", @@ -1537,7 +1544,7 @@ }, { "Input": "Ik vertrek over 2 uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 2 uur", @@ -1549,7 +1556,7 @@ }, { "Input": "Ik zal teruggaan op woens. 26 okt. 15:50:06 2016.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "woens. 26 okt. 15:50:06 2016", @@ -1561,7 +1568,7 @@ }, { "Input": "Woens. 26 okt. 15:50:06 2016 is geen dag in 2019.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "woens. 26 okt. 15:50:06 2016", @@ -1573,7 +1580,7 @@ }, { "Input": "Ik zal om 20.30 vandaag teruggaan.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.30 vandaag", @@ -1585,7 +1592,7 @@ }, { "Input": "Ik zal vandaag om 20.30 teruggaan.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vandaag om 20.30", @@ -1597,7 +1604,7 @@ }, { "Input": "Ik zal 20.30 vandaag teruggaan.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.30 vandaag", diff --git a/Specs/DateTime/Dutch/DateTimeModel.json b/Specs/DateTime/Dutch/DateTimeModel.json index beb02cc00e..2fd2782ae4 100644 --- a/Specs/DateTime/Dutch/DateTimeModel.json +++ b/Specs/DateTime/Dutch/DateTimeModel.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4e jan 2019", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3e jan 2019", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2e jan 2019", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1e jan 2019", @@ -131,7 +131,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2/okt", @@ -160,7 +160,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22/04", @@ -189,7 +189,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "negenentwintig mei", @@ -218,7 +218,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede van augustus", @@ -247,7 +247,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag", @@ -271,7 +271,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -295,7 +295,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gisteren", @@ -319,7 +319,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -348,7 +348,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maand van 4-23", @@ -373,7 +373,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 en 12 sept", @@ -404,7 +404,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aanstaande september", @@ -429,7 +429,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 januari, 2016 - 22/01/2016", @@ -454,7 +454,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende drie dagen", @@ -479,7 +479,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste week van juli", @@ -510,7 +510,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015-3", @@ -535,7 +535,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze zomer", @@ -559,7 +559,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sinds morgen", @@ -585,7 +585,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sinds augustus", @@ -618,7 +618,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sinds aanstaande augustus", @@ -644,7 +644,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nu", @@ -668,7 +668,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober om 8:00:31", @@ -707,7 +707,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen 8:00", @@ -736,7 +736,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10, vanavond", @@ -784,7 +784,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van morgen", @@ -808,7 +808,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van de zondag", @@ -837,7 +837,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van deze zondag", @@ -892,7 +892,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22 april van 5 tot 6 's middags", @@ -923,7 +923,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen 3:00 tot 4:00", @@ -954,7 +954,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze avond", @@ -979,7 +979,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenavond", @@ -1004,7 +1004,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende maandagmiddag", @@ -1054,7 +1054,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de ochtend", @@ -1085,7 +1085,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 3u", @@ -1378,191 +1378,23 @@ ] }, { - "Input": "Ik vertrek wekelijks", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "wekelijks", - "Start": 11, - "End": 19, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ik vertrek elke dag", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke dag", - "Start": 11, - "End": 18, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ik vertrek jaarlijks", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "jaarlijks", - "Start": 11, - "End": 19, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ik vertrek elke twee dagen", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke twee dagen", - "Start": 11, - "End": 25, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ik vertrek elke drie weken", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke drie weken", - "Start": 11, - "End": 25, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ik vertrek elke dag 15.00", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke dag 15.00", - "Start": 11, - "End": 24, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15:00", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ik vertrek elke maandag", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke maandag", - "Start": 11, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ik vertrek elke maandag om 16.00", + "Input": "Ik ben 19:56:30 terug", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { - "Text": "elke maandag om 16.00", - "Start": 11, - "End": 31, - "TypeName": "datetimeV2.set", + "Text": "19:56:30", + "Start": 7, + "End": 14, + "TypeName": "datetimeV2.time", "Resolution": { "values": [ { - "timex": "XXXX-WXX-1T16:00", - "type": "set", - "value": "not resolved" + "timex": "T19:56:30", + "type": "time", + "value": "19:56:30" } ] } @@ -1570,23 +1402,23 @@ ] }, { - "Input": "Ik ben 19:56:30 terug", + "Input": "Ik ben 00:00 terug", "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" + "ReferenceDateTime": "2023-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { - "Text": "19:56:30", + "Text": "00:00", "Start": 7, - "End": 14, + "End": 11, "TypeName": "datetimeV2.time", "Resolution": { "values": [ { - "timex": "T19:56:30", + "timex": "T00:00", "type": "time", - "value": "19:56:30" + "value": "00:00:00" } ] } @@ -1598,7 +1430,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht", @@ -1627,7 +1459,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10 voor half negen 's avonds", @@ -1651,7 +1483,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s morgens om 7 uur", @@ -1675,7 +1507,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s middags om 7 uur", @@ -1699,7 +1531,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rond de middag", @@ -1723,7 +1555,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rond 11 uur", @@ -1752,7 +1584,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11:40", @@ -1781,7 +1613,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het middaguur", @@ -1805,7 +1637,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 tot 6 's middags", @@ -1861,7 +1693,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 5 en 6 's middags", @@ -1886,7 +1718,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4:00", @@ -1915,7 +1747,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3 uur 's ochtends tot 5 uur 's middags", @@ -1940,7 +1772,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 4 en 5 's middags", @@ -1965,7 +1797,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s morgens", @@ -1990,7 +1822,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds", @@ -2015,7 +1847,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 5 minuten", @@ -2039,7 +1871,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 5 minuten", @@ -2107,7 +1939,7 @@ "Context": { "ReferenceDateTime": "2017-12-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op volgende week maandag", @@ -2151,7 +1983,7 @@ "Context": { "ReferenceDateTime": "2017-12-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s ochtends om 9 uur", @@ -2236,7 +2068,7 @@ "Context": { "ReferenceDateTime": "2017-12-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag 8-9 's ochtends", @@ -2283,7 +2115,7 @@ "Context": { "ReferenceDateTime": "2017-12-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week op dinsdag", @@ -2327,7 +2159,7 @@ "Context": { "ReferenceDateTime": "2017-12-04T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week op dinsdag 9 uur 's ochtends", @@ -2371,7 +2203,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2379,7 +2211,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2387,7 +2219,7 @@ "Context": { "ReferenceDateTime": "2018-01-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag 9 mei", @@ -2416,7 +2248,7 @@ "Context": { "ReferenceDateTime": "2018-01-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mei", @@ -2491,7 +2323,7 @@ "Context": { "ReferenceDateTime": "2018-03-14T01:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week van 10 april", @@ -2522,7 +2354,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2530,7 +2362,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2538,7 +2370,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2546,7 +2378,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2554,7 +2386,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2562,7 +2394,7 @@ "Context": { "ReferenceDateTime": "2018-03-14T01:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag", @@ -2586,7 +2418,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2594,7 +2426,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2602,7 +2434,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -2651,7 +2483,7 @@ "Context": { "ReferenceDateTime": "2018-03-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over twee weken", @@ -2731,7 +2563,7 @@ "Context": { "ReferenceDateTime": "2018-04-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 juli", @@ -2760,7 +2592,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 uren", @@ -2829,7 +2661,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag 11-4", @@ -2858,7 +2690,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "andere dag", @@ -2878,65 +2710,25 @@ ] }, { - "Input": "Elke week en een ander ding deze week", + "Input": "Ik was daar niet dezelfde week dat het gebeurde", "Context": { - "ReferenceDateTime": "2018-05-20T00:00:00" + "ReferenceDateTime": "2017-11-17T00:00:00" }, "NotSupportedByDesign": "javascript,python,java", "Results": [ { - "Text": "elke week", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", + "Text": "dezelfde week", + "Start": 17, + "End": 29, + "TypeName": "datetimeV2.daterange", "Resolution": { "values": [ { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, - { - "Text": "deze week", - "Start": 28, - "End": 36, - "TypeName": "datetimeV2.daterange", - "Resolution": { - "values": [ - { - "timex": "2018-W20", - "type": "daterange", - "start": "2018-05-14", - "end": "2018-05-21" - } - ] - } - } - ] - }, - { - "Input": "Ik was daar niet dezelfde week dat het gebeurde", - "Context": { - "ReferenceDateTime": "2017-11-17T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "dezelfde week", - "Start": 17, - "End": 29, - "TypeName": "datetimeV2.daterange", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX", - "Mod": "ref_undef", - "type": "daterange", - "start": "2017-11-13", - "end": "2017-11-20" + "timex": "XXXX-WXX", + "Mod": "ref_undef", + "type": "daterange", + "start": "2017-11-13", + "end": "2017-11-20" } ] } @@ -3026,7 +2818,7 @@ "Context": { "ReferenceDateTime": "2018-05-22T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor de dag", @@ -3052,7 +2844,7 @@ "Context": { "ReferenceDateTime": "2018-05-22T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de maand", @@ -3196,7 +2988,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -3204,7 +2996,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "april 2017", @@ -3229,7 +3021,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2017 april", @@ -3254,7 +3046,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder in de week", @@ -3279,7 +3071,7 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder deze maand", @@ -3329,7 +3121,7 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later deze week", @@ -3379,7 +3171,7 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later dit jaar", @@ -3404,7 +3196,7 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later in het jaar", @@ -3429,7 +3221,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen na vandaag", @@ -3501,7 +3293,7 @@ "Context": { "ReferenceDateTime": "2018-05-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "31 dec. 1994", @@ -3525,7 +3317,7 @@ "Context": { "ReferenceDateTime": "2018-05-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5-3-'18 om 17:49:19", @@ -3611,7 +3403,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10:30 tot 15.00 op 1-1-2015", @@ -3636,7 +3428,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 en 5 op 1-1-2015", @@ -3667,7 +3459,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3:30 tot 5.55 op 1-1-2015", @@ -3698,7 +3490,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 2010", @@ -3741,7 +3533,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2010", @@ -3817,7 +3609,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "meer dan 4 dagen", @@ -3983,7 +3775,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten vanaf nu", @@ -4140,7 +3932,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2018", @@ -4166,7 +3958,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na feb 2018", @@ -4192,7 +3984,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na feb", @@ -4306,7 +4098,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige week dinsdag om 2 uur 's middags", @@ -4373,7 +4165,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week", @@ -4488,7 +4280,7 @@ "Context": { "ReferenceDateTime": "2018-06-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag om 9:00", @@ -4517,7 +4309,7 @@ "Context": { "ReferenceDateTime": "2018-06-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag om 21:00", @@ -4566,7 +4358,7 @@ "Context": { "ReferenceDateTime": "2018-06-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het jaar", @@ -4591,7 +4383,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week", @@ -4616,7 +4408,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week na volgende", @@ -4641,7 +4433,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "week 31", @@ -4666,7 +4458,7 @@ "Context": { "ReferenceDateTime": "2019-03-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "week 1", @@ -4691,7 +4483,7 @@ "Context": { "ReferenceDateTime": "2019-03-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -4699,7 +4491,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 2 minuten", @@ -4723,7 +4515,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over twee maanden", @@ -4747,7 +4539,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over twee weken", @@ -4771,7 +4563,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over twee jaar", @@ -4795,7 +4587,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen na vandaag", @@ -5169,7 +4961,7 @@ "Context": { "ReferenceDateTime": "2018-07-11T20:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vierentwintig januari half twee 's middags", @@ -5231,7 +5023,7 @@ "Context": { "ReferenceDateTime": "2018-07-13T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zat. om 5 uur", @@ -5270,7 +5062,7 @@ "Context": { "ReferenceDateTime": "2018-07-17T13:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gisterenavond", @@ -5295,7 +5087,7 @@ "Context": { "ReferenceDateTime": "2018-07-17T13:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het jaar", @@ -5320,7 +5112,7 @@ "Context": { "ReferenceDateTime": "2018-07-17T13:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "onafhankelijksdag van dit jaar", @@ -5344,7 +5136,7 @@ "Context": { "ReferenceDateTime": "2018-07-24T13:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor onafhankelijkheidsdag", @@ -5377,7 +5169,7 @@ "Context": { "ReferenceDateTime": "2018-07-31T13:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende week", @@ -5402,7 +5194,7 @@ "Context": { "ReferenceDateTime": "2018-07-31T13:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende weken", @@ -5427,7 +5219,7 @@ "Context": { "ReferenceDateTime": "2018-07-31T13:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op volgende week maandag", @@ -5451,7 +5243,7 @@ "Context": { "ReferenceDateTime": "2018-07-30T20:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22 mei (dins) - 11:30", @@ -5490,7 +5282,7 @@ "Context": { "ReferenceDateTime": "2018-07-31T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanaf het middaguur vandaag tot het middaguur morgen", @@ -5515,7 +5307,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -5523,7 +5315,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -5531,7 +5323,7 @@ "Context": { "ReferenceDateTime": "2018-08-17T15:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week", @@ -5573,7 +5365,7 @@ "Context": { "ReferenceDateTime": "2018-08-17T15:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "al zo laat als 7 uur 's ochtends", @@ -5762,7 +5554,7 @@ "Context": { "ReferenceDateTime": "2018-08-30T10:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen 5 minuten", @@ -5862,7 +5654,7 @@ "Context": { "ReferenceDateTime": "2018-09-06T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zo vroeg als het eerste kwartaal van volgend jaar", @@ -5888,7 +5680,7 @@ "Context": { "ReferenceDateTime": "2018-08-31T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het jaar hoger dan 2012", @@ -6019,7 +5811,7 @@ "ReferenceDateTime": "2018-08-31T12:00:00" }, "Comment": "Known false positive needs to be supported in the future", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1-1-2016", @@ -6043,7 +5835,7 @@ "Context": { "ReferenceDateTime": "2018-08-31T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1-1-2016", @@ -6084,7 +5876,7 @@ "Context": { "ReferenceDateTime": "2018-09-07T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jaar tot op heden", @@ -6177,7 +5969,7 @@ "Context": { "ReferenceDateTime": "2018-08-17T15:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week", @@ -6219,7 +6011,7 @@ "Context": { "ReferenceDateTime": "2018-09-25T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later dan 2018", @@ -6245,7 +6037,7 @@ "Context": { "ReferenceDateTime": "2018-09-21T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor maandag om half 3 's middags", @@ -6278,7 +6070,7 @@ "Context": { "ReferenceDateTime": "2018-09-07T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor half 3 's middags", @@ -6304,7 +6096,7 @@ "Context": { "ReferenceDateTime": "2018-09-07T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "donderdag 29/3 11 uur 's ochtends", @@ -6532,7 +6324,7 @@ "Context": { "ReferenceDateTime": "2018-08-30T10:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -6540,7 +6332,7 @@ "Context": { "ReferenceDateTime": "2018-08-30T10:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "om 6.45", @@ -6569,7 +6361,7 @@ "Context": { "ReferenceDateTime": "2018-10-17T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over twee dagen", @@ -6608,7 +6400,7 @@ "Context": { "ReferenceDateTime": "2018-10-16T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -6616,7 +6408,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1-10 tot 7-11", @@ -6672,7 +6464,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1-10-2018-7-10-2018", @@ -6697,7 +6489,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1-10-2018 - 7-10-2018", @@ -6722,7 +6514,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 1-10 en 7-11", @@ -6747,7 +6539,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "jan-feb 2017", @@ -6772,7 +6564,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nov-feb 2017", @@ -6822,7 +6614,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18 nov-19 dec, 2015", @@ -6847,7 +6639,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18 nov 2014-19 dec 2015", @@ -6872,7 +6664,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op 18-19 november", @@ -6928,7 +6720,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van mei tot okt 2020", @@ -6953,7 +6745,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1-5 - 7-5, 2020", @@ -6978,7 +6770,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1-5 - 7-5-2020", @@ -7003,7 +6795,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1-5-2019 - 7-5-2020", @@ -7028,7 +6820,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "05-aug-2016", @@ -7151,7 +6943,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 15:00-20:00 gisterenmiddag", @@ -7176,7 +6968,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 8 uur 's morgens-15:00 gisterenmiddag", @@ -7275,7 +7067,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maandag tussen 3 en 8 uur 's morgens", @@ -7300,7 +7092,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maandag tussen 3 uur 's ochtends - 12 uur 's middags", @@ -7469,7 +7261,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor dec, 2018", @@ -7520,7 +7312,7 @@ "Context": { "ReferenceDateTime": "2018-11-08T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de dag ervoor", @@ -7576,7 +7368,7 @@ "Context": { "ReferenceDateTime": "2018-11-15T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maandag", @@ -7654,7 +7446,7 @@ "Context": { "ReferenceDateTime": "2018-11-28T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor volgende week woensdag", @@ -7680,7 +7472,7 @@ "Context": { "ReferenceDateTime": "2018-11-28T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige week - maandag", @@ -7704,7 +7496,7 @@ "Context": { "ReferenceDateTime": "2018-11-28T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week maandag", @@ -7728,7 +7520,7 @@ "Context": { "ReferenceDateTime": "2018-11-21T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van de dag", @@ -7752,7 +7544,7 @@ "Context": { "ReferenceDateTime": "2018-11-21T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aan het eind van de dag", @@ -7776,7 +7568,7 @@ "Context": { "ReferenceDateTime": "2018-11-23T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aan het eind van het jaar", @@ -7802,7 +7594,7 @@ "Context": { "ReferenceDateTime": "2018-11-28T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20-11", @@ -7851,7 +7643,7 @@ "Context": { "ReferenceDateTime": "2018-11-27T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van de maand", @@ -7877,7 +7669,7 @@ "Context": { "ReferenceDateTime": "2018-11-29T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van de week", @@ -8042,7 +7834,7 @@ "ReferenceDateTime": "2018-11-28T12:00:00" }, "Comment": "Cst can't be recognized as TimeZone is not enabled for now", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 9 tot 10:30", @@ -8073,7 +7865,7 @@ "Context": { "ReferenceDateTime": "2018-11-29T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de eerste week van 2015", @@ -8123,7 +7915,7 @@ "Context": { "ReferenceDateTime": "2018-11-29T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste week van 2016", @@ -8173,7 +7965,7 @@ "Context": { "ReferenceDateTime": "2019-03-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste week van 2019", @@ -8198,7 +7990,7 @@ "Context": { "ReferenceDateTime": "2019-03-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de laatste week van 2019", @@ -8279,7 +8071,7 @@ "Context": { "ReferenceDateTime": "2018-11-30T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder vorige week", @@ -8305,7 +8097,7 @@ "Context": { "ReferenceDateTime": "2018-11-30T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later deze week", @@ -8330,7 +8122,7 @@ "Context": { "ReferenceDateTime": "2018-11-30T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15:00", @@ -8378,7 +8170,7 @@ "Context": { "ReferenceDateTime": "2018-12-05T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een jaar en een kwart", @@ -8402,7 +8194,7 @@ "Context": { "ReferenceDateTime": "2018-12-07T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -8410,7 +8202,7 @@ "Context": { "ReferenceDateTime": "2018-12-07T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -8419,7 +8211,7 @@ "ReferenceDateTime": "2018-12-07T12:00:00" }, "Comment": "Not extracted may as a datetime range is not supported for now", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -8427,7 +8219,7 @@ "Context": { "ReferenceDateTime": "2018-12-13T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -8435,7 +8227,7 @@ "Context": { "ReferenceDateTime": "2019-01-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag", @@ -8464,7 +8256,7 @@ "Context": { "ReferenceDateTime": "2019-01-25T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maandag 21", @@ -8493,7 +8285,7 @@ "Context": { "ReferenceDateTime": "2019-01-25T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zondag 31", @@ -8522,7 +8314,7 @@ "Context": { "ReferenceDateTime": "2019-02-25T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag 31", @@ -8546,6 +8338,35 @@ } ] }, + { + "Input": "Heb je een arrangement op zaterdag 30!", + "Context": { + "ReferenceDateTime": "2023-07-05T12:00:00" + }, + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "zaterdag 30", + "Start": 26, + "End": 36, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-WXX-6", + "type": "date", + "value": "2022-07-30" + }, + { + "timex": "XXXX-WXX-6", + "type": "date", + "value": "2023-09-30" + } + ] + } + } + ] + }, { "Input": "Heb je een plan na half mei?", "Context": { @@ -8584,7 +8405,7 @@ "Context": { "ReferenceDateTime": "2019-02-25T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor begin september", @@ -8698,7 +8519,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende vrijdag", @@ -8722,7 +8543,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende donderdag", @@ -8794,7 +8615,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige woensdag", @@ -8818,7 +8639,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 07:30-09:00", @@ -8849,7 +8670,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 07:30-09:30", @@ -8911,7 +8732,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -8950,7 +8771,7 @@ "Context": { "ReferenceDateTime": "2019-02-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag, 15 jan, 13:00 - 13.15", @@ -8981,7 +8802,7 @@ "Context": { "ReferenceDateTime": "2019-02-28T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18 januari, 2019", @@ -9015,58 +8836,12 @@ } ] }, - { - "Input": "boek mijn tijd in voor zwemmen elke dinsdag en donderdag 19:00 - 21:00", - "Context": { - "ReferenceDateTime": "2019-03-01T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke dinsdag", - "Start": 31, - "End": 42, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" - } - ] - } - }, - { - "Text": "donderdag 19:00 - 21:00", - "Start": 47, - "End": 69, - "TypeName": "datetimeV2.datetimerange", - "Resolution": { - "values": [ - { - "timex": "(XXXX-WXX-4T19:00,XXXX-WXX-4T21:00,PT2H)", - "type": "datetimerange", - "start": "2019-02-28 19:00:00", - "end": "2019-02-28 21:00:00" - }, - { - "timex": "(XXXX-WXX-4T19:00,XXXX-WXX-4T21:00,PT2H)", - "type": "datetimerange", - "start": "2019-03-07 19:00:00", - "end": "2019-03-07 21:00:00" - } - ] - } - } - ] - }, { "Input": "Is dit een geldige datum? 12-2015", "Context": { "ReferenceDateTime": "2019-02-27T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12-2015", @@ -9123,7 +8898,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 16:00 en 17:00 vandaag", @@ -9148,7 +8923,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10/1-11/2/2017", @@ -9173,7 +8948,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -9217,7 +8992,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond", @@ -9262,7 +9037,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 5e", @@ -9306,7 +9081,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16-12-2016", @@ -9350,7 +9125,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 15e, 20:00", @@ -9379,7 +9154,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20.00", @@ -9423,7 +9198,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zeven uur", @@ -9496,7 +9271,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "om 20.15u", @@ -9594,7 +9369,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -9634,7 +9409,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -9674,7 +9449,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag", @@ -9714,7 +9489,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze middag", @@ -9739,7 +9514,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een minuut", @@ -9788,7 +9563,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over een uur", @@ -9886,7 +9661,7 @@ "Context": { "ReferenceDateTime": "2020-08-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "09:00 's ochtends", @@ -9910,7 +9685,7 @@ "Context": { "ReferenceDateTime": "2020-08-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s ochtends om 9", @@ -9934,20 +9709,24 @@ "Context": { "ReferenceDateTime": "2020-08-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { - "Text": "elke maandag", - "Type": "set", - "Start": 7, + "Text": "maandag", + "Start": 12, "End": 18, - "TypeName": "datetimeV2.set", + "TypeName": "datetimeV2.date", "Resolution": { "values": [ { "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" + "type": "date", + "value": "2020-08-10" + }, + { + "timex": "XXXX-WXX-1", + "type": "date", + "value": "2020-08-17" } ] } @@ -9979,7 +9758,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze september", @@ -10004,7 +9783,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sinds deze augustus", @@ -10055,7 +9834,7 @@ "Context": { "ReferenceDateTime": "2018-07-17T13:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gisterennacht", @@ -10141,7 +9920,7 @@ "Context": { "ReferenceDateTime": "2018-11-15T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maandag", @@ -10205,7 +9984,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgennacht", @@ -10446,7 +10225,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4:00 tot 7", @@ -10477,7 +10256,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zat", @@ -10506,7 +10285,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zat.", @@ -10535,7 +10314,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -10543,7 +10322,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -10551,7 +10330,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -10559,7 +10338,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -10695,7 +10474,7 @@ "ReferenceDateTime": "2019-04-15T00:00:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "woensdag 4 uur", @@ -10818,7 +10597,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "achttiende van maart half tien", @@ -10857,7 +10636,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tweeëntwintig februari", @@ -10886,7 +10665,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tweeëntwintig februari 3.30", @@ -10993,7 +10772,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tweeëntwintig februari om 3.30", @@ -11032,7 +10811,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "de 22e februari 3.30", @@ -11169,7 +10948,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "januari de eerste tweeduizend en tweeëndertig", @@ -11249,7 +11028,7 @@ "Context": { "ReferenceDateTime": "2019-04-23T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen nu en november de 15e", @@ -11274,7 +11053,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen 22 jan en nu", @@ -11300,7 +11079,7 @@ "ReferenceDateTime": "2019-05-09T12:00:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen nu en de 21e van mei", @@ -11340,7 +11119,7 @@ "Context": { "ReferenceDateTime": "2019-05-16T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van april tot juni in 2017", @@ -11390,7 +11169,7 @@ "Context": { "ReferenceDateTime": "2019-05-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van januari tot april 2015", @@ -11470,7 +11249,7 @@ "Context": { "ReferenceDateTime": "2019-05-20T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vrijdag 12/5", @@ -11673,7 +11452,7 @@ "Context": { "ReferenceDateTime": "2019-05-22T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3/jan", @@ -11818,7 +11597,7 @@ "Context": { "ReferenceDateTime": "2019-05-27T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 minuten later", @@ -11842,7 +11621,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "26 juni tot 28 juni in 2020", @@ -11867,7 +11646,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "26 juni in 2019 tot 28 juni in 2020", @@ -11892,7 +11671,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "28 juni in 2020", @@ -11988,7 +11767,7 @@ "Context": { "ReferenceDateTime": "2019-05-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "maandag de zevenentwintigste om zes uur 's avonds", @@ -12012,7 +11791,7 @@ "Context": { "ReferenceDateTime": "2019-06-13T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "maandag de vierentwintigste zes uur 's avonds", @@ -12293,7 +12072,7 @@ "Context": { "ReferenceDateTime": "2013-06-03T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "om 13.00 28 februari 2013", @@ -12621,7 +12400,7 @@ "Context": { "ReferenceDateTime": "2019-06-28T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "half zes morgenavond", @@ -12645,7 +12424,7 @@ "Context": { "ReferenceDateTime": "2019-06-28T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van half vier tot half vijf", @@ -12676,7 +12455,7 @@ "Context": { "ReferenceDateTime": "2019-06-28T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van half drie tot kwart voor drie", @@ -12707,7 +12486,7 @@ "Context": { "ReferenceDateTime": "2019-06-28T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "=2019", @@ -13020,7 +12799,7 @@ "Context": { "ReferenceDateTime": "2019-07-04T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 11.30 tot 12.30 27e van december", @@ -13051,7 +12830,7 @@ "Context": { "ReferenceDateTime": "2019-07-04T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12.30 de 27e van december", @@ -13090,7 +12869,7 @@ "Context": { "ReferenceDateTime": "2019-07-04T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "27 december", @@ -13119,7 +12898,7 @@ "Context": { "ReferenceDateTime": "2019-07-04T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 december", @@ -13148,7 +12927,7 @@ "Context": { "ReferenceDateTime": "2019-07-11T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "15.00", @@ -13411,7 +13190,7 @@ "Context": { "ReferenceDateTime": "2019-07-17T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "in de vroege ochtend", @@ -13705,7 +13484,7 @@ "Context": { "ReferenceDateTime": "2019-06-10T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "dinsdag de elfde", @@ -13729,7 +13508,7 @@ "Context": { "ReferenceDateTime": "2019-07-19T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "woensdag de eenendertigste", @@ -13753,7 +13532,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze middag", @@ -13778,7 +13557,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze middag", @@ -13803,7 +13582,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze middag", @@ -13828,7 +13607,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "op volgende week dinsdag", @@ -13852,7 +13631,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "dinsdag van vorige week", @@ -14008,7 +13787,7 @@ "Context": { "ReferenceDateTime": "2018-01-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -14016,7 +13795,7 @@ "Context": { "ReferenceDateTime": "2018-01-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -14024,7 +13803,7 @@ "Context": { "ReferenceDateTime": "2019-08-08T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -14103,7 +13882,7 @@ "Context": { "ReferenceDateTime": "2019-08-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "in 3 jaar", @@ -14226,7 +14005,7 @@ "Context": { "ReferenceDateTime": "2020-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 feb 2019", @@ -14250,7 +14029,7 @@ "Context": { "ReferenceDateTime": "2019-01-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 feb", @@ -14274,7 +14053,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 feb", @@ -14298,7 +14077,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 feb 2019 17.20", @@ -14317,54 +14096,6 @@ } ] }, - { - "Input": "Laten we eenmaal per week afspreken", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "eenmaal per week", - "Start": 9, - "End": 24, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ik ga eenmaal per jaar op vakantie", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "eenmaal per jaar", - "Start": 6, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Het verzoek is ABC-12345-A1B2C3 deze ronde. Laten we een belafspraak van 30 minuten regelen deze week. Kijk ernaar uit om elkaar deze week weer te spreken.", "Context": { @@ -14427,7 +14158,7 @@ "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vorige week", @@ -14452,7 +14183,7 @@ "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -14510,7 +14241,7 @@ "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -14518,7 +14249,7 @@ "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "een seconde", @@ -14542,7 +14273,7 @@ "Context": { "ReferenceDateTime": "2019-08-24T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "3 dagen vanaf vandaag", @@ -14566,7 +14297,7 @@ "Context": { "ReferenceDateTime": "2019-08-24T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "oktober", @@ -14597,7 +14328,7 @@ "Context": { "ReferenceDateTime": "2019-09-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "na het ontbijt", @@ -14622,7 +14353,7 @@ "Context": { "ReferenceDateTime": "2019-09-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "voor de lunch", @@ -14647,7 +14378,7 @@ "Context": { "ReferenceDateTime": "2019-09-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "rond het avondeten", @@ -14674,7 +14405,7 @@ "Context": { "ReferenceDateTime": "2019-09-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -14682,7 +14413,7 @@ "Context": { "ReferenceDateTime": "2019-09-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "19.00", @@ -14706,7 +14437,7 @@ "Context": { "ReferenceDateTime": "2019-09-19T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "komende twee dagen", @@ -14732,7 +14463,7 @@ "ReferenceDateTime": "2019-09-19T00:00:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "01/aug/2019", @@ -14756,7 +14487,7 @@ "Context": { "ReferenceDateTime": "2019-09-19T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "01-aug-2019", @@ -14780,7 +14511,7 @@ "Context": { "ReferenceDateTime": "2019-10-14T01:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 01-aug-2019 tot vandaag", @@ -14805,7 +14536,7 @@ "Context": { "ReferenceDateTime": "2019-10-14T10:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "01/aug/2019 tot vandaag", @@ -14830,7 +14561,7 @@ "Context": { "ReferenceDateTime": "2019-11-01T15:16:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 min later", @@ -14849,54 +14580,6 @@ } ] }, - { - "Input": "Om de week vrijdag", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "om de week vrijdag", - "Start": 0, - "End": 17, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-5", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Laten we een driemaandelijkse meeting hebben", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "driemaandelijkse", - "Start": 13, - "End": 28, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Q1 en Q2 zouden enig jaar kunnen zijn", "Context": { @@ -14948,21 +14631,6 @@ } ] } - }, - { - "Text": "enig jaar", - "Start": 16, - "End": 24, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -15307,7 +14975,7 @@ "Context": { "ReferenceDateTime": "2019-12-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.30 vandaag", @@ -15331,7 +14999,7 @@ "Context": { "ReferenceDateTime": "2019-12-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vandaag om 20.30", @@ -15355,7 +15023,7 @@ "Context": { "ReferenceDateTime": "2019-12-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.30 vandaag", @@ -15379,7 +15047,7 @@ "Context": { "ReferenceDateTime": "2019-12-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.30 vandaag", @@ -15428,7 +15096,7 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 26e juni van 2020 tot 28e juni van 2020", @@ -15453,7 +15121,7 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van de 26e juni van 2020 tot de 28e juni van 2020", @@ -15478,7 +15146,7 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 26e juni van 2020 tot 28e van juni 2020", @@ -15735,7 +15403,7 @@ "Context": { "ReferenceDateTime": "2020-05-06T18:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen vandaag en morgen", @@ -15811,7 +15479,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -15819,7 +15487,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "02-02-2020 - 03-03-2020", @@ -15844,7 +15512,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "1/10-2/11/2017", @@ -15869,7 +15537,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -15877,7 +15545,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2002-10-09", @@ -15901,7 +15569,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -15909,7 +15577,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -16051,7 +15719,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vierde juli van 1995", @@ -16075,7 +15743,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "juni van 1992", @@ -16100,7 +15768,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4e juli van 1995", @@ -16124,7 +15792,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vierde van juli 1995", @@ -16148,7 +15816,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vierde van juli, 1995", @@ -16172,7 +15840,7 @@ "Context": { "ReferenceDateTime": "2020-05-31T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "9 tot 12 juni", @@ -16203,7 +15871,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "drie maanden", @@ -16253,31 +15921,6 @@ } ] }, - { - "Input": "Donderdagen om 17.30 Beijing-tijd", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "donderdagen om 17.30", - "Start": 0, - "End": 19, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-4T17:30", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Juneteenth, wat ook bekendstaat als Vrijheidsdag en Jubilee Day, dateert terug tot 1865 en valt elk jaar op 19 juni", "Context": { @@ -16361,21 +16004,6 @@ ] } }, - { - "Text": "elk jaar", - "Start": 96, - "End": 103, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "19 juni", "Start": 108, @@ -16403,7 +16031,7 @@ "Context": { "ReferenceDateTime": "2020-06-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "morgen", @@ -16443,7 +16071,7 @@ "Context": { "ReferenceDateTime": "2020-06-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "woensdag om 15.30", @@ -16459,154 +16087,8 @@ }, { "timex": "XXXX-WXX-3T15:30", - "type": "datetime", - "value": "2020-06-17 15:30:00" - } - ] - } - } - ] - }, - { - "Input": "Plan alsjeblieft een halfjaarlijkse meeting in", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "halfjaarlijkse", - "Start": 21, - "End": 34, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Plan alsjeblieft een meeting halfjaarlijks in", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "halfjaarlijks", - "Start": 29, - "End": 41, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Plan alsjeblieft een meeting met iedereen volgende week", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "volgende week", - "Start": 42, - "End": 54, - "TypeName": "datetimeV2.daterange", - "Resolution": { - "values": [ - { - "timex": "2020-W25", - "type": "daterange", - "start": "2020-06-15", - "end": "2020-06-22" - } - ] - } - } - ] - }, - { - "Input": "Laten we ervoor zorgen dat dat elke weekdag gebeurt.", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "elke weekdag", - "Start": 31, - "End": 42, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "waarom neem je niet de rest van de week vrij?", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "rest van de week", - "Start": 23, - "End": 38, - "TypeName": "datetimeV2.daterange", - "Resolution": { - "values": [ - { - "timex": "(2020-06-12,2020-06-14,P2D)", - "type": "daterange", - "start": "2020-06-12", - "end": "2020-06-14" - } - ] - } - } - ] - }, - { - "Input": "het is bijna tijd voor het jaarlijks overzicht", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "jaarlijks", - "Start": 27, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" + "type": "datetime", + "value": "2020-06-17 15:30:00" } ] } @@ -16614,24 +16096,24 @@ ] }, { - "Input": "wetten en voorschriften vereisen elk kwartaal rapportage over financiën ", + "Input": "waarom neem je niet de rest van de week vrij?", "Context": { "ReferenceDateTime": "2020-06-12T00:00:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { - "Text": "elk kartaal", - "Start": -1, - "End": 9, - "TypeName": "datetimeV2.set", + "Text": "rest van de week", + "Start": 23, + "End": 38, + "TypeName": "datetimeV2.daterange", "Resolution": { "values": [ { - "timex": "P3M", - "type": "set", - "value": "not resolved" + "timex": "(2020-06-12,2020-06-14,P2D)", + "type": "daterange", + "start": "2020-06-12", + "end": "2020-06-14" } ] } @@ -16643,7 +16125,7 @@ "Context": { "ReferenceDateTime": "2020-06-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "4e van juli", @@ -16675,21 +16157,6 @@ "NotSupported": "dotnet", "NotSupportedByDesign": "java, javascript, python", "Results": [ - { - "Text": "tweemaandelijkse", - "Start": 3, - "End": 18, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2M", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "", "Start": 18, @@ -16707,54 +16174,6 @@ } ] }, - { - "Input": "Doe je dat elk weekend?", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "elk weekend", - "Start": 11, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "elke twee weekenden", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "elke twee weekenden", - "Start": 0, - "End": 18, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "de cursus duurt drie weekenden", "Context": { @@ -16784,7 +16203,7 @@ "Context": { "ReferenceDateTime": "2020-06-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "het eerste kwartaal van het jaar", @@ -16815,7 +16234,7 @@ "Context": { "ReferenceDateTime": "2020-06-12T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "winter", @@ -16880,7 +16299,7 @@ "Context": { "ReferenceDateTime": "2020-06-15T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "twee uren", @@ -16904,7 +16323,7 @@ "Context": { "ReferenceDateTime": "2020-06-16T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "15.00", @@ -17078,31 +16497,6 @@ } ] }, - { - "Input": "Voeg meeting met baas toe aan mijn agenda - v", - "Context": { - "ReferenceDateTime": "2020-06-16T12:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "vandaag", - "Start": -1, - "End": 5, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2T09", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "zie je vanavond, lieverd!", "Context": { @@ -17232,7 +16626,7 @@ "Context": { "ReferenceDateTime": "2019-12-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vanavond rond 19.00", @@ -17377,7 +16771,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tegen het eind van deze maand", @@ -17403,7 +16797,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "voor het eind van dit jaar", @@ -17429,7 +16823,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "eind dit jaar", @@ -17456,7 +16850,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "na het begin van maart", @@ -17489,7 +16883,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "voor het einde van december", @@ -17601,7 +16995,7 @@ "Context": { "ReferenceDateTime": "2020-07-01T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "na de 15e dag van juni", @@ -17804,7 +17198,7 @@ "Context": { "ReferenceDateTime": "2018-06-01T16:12:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen 19.00 en 21.30 gisterenavond", @@ -17879,7 +17273,7 @@ "Context": { "ReferenceDateTime": "2018-06-01T16:12:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen 19.00 en 21.00 gisterenavond", @@ -17950,56 +17344,6 @@ } ] }, - { - "Input": "avondeten met mam welk weekend dan ook", - "Context": { - "ReferenceDateTime": "2016-11-11T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "welk weekend dan ook", - "Start": 18, - "End": 37, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "avondeten met mam alle weekenden", - "Context": { - "ReferenceDateTime": "2016-11-11T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "alle weekenden", - "Start": 18, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Ik zal de komende avond van 7 tot 9 wegzijn", "Context": { @@ -18349,7 +17693,7 @@ "Context": { "ReferenceDateTime": "2018-08-17T15:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "voor rond 14.00 vandaag", @@ -18375,7 +17719,7 @@ "Context": { "ReferenceDateTime": "2018-08-17T15:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "na rond 15.30", @@ -18426,7 +17770,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "2014", @@ -18492,7 +17836,7 @@ "Context": { "ReferenceDateTime": "2019-12-15T01:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "na 1 januari, 2007", @@ -18754,21 +18098,6 @@ "NotSupported": "dotnet", "NotSupportedByDesign": "java, javascript, python", "Results": [ - { - "Text": "elke dag", - "Start": 7, - "End": 14, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "19.13", "Start": 19, @@ -18786,30 +18115,6 @@ } ] }, - { - "Input": "Ik zal elke avond om 19.13 vertrekken", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "elke avond om 19.13", - "Start": 7, - "End": 25, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T19:13", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Wat gebeurde er op Tweede Paasdag om 10.30?", "Context": { @@ -18860,7 +18165,7 @@ "Context": { "ReferenceDateTime": "2019-08-05T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "kerstavond", @@ -18899,37 +18204,12 @@ } ] }, - { - "Input": "avondeten met mam weekenden", - "Context": { - "ReferenceDateTime": "2016-11-11T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "weekenden", - "Start": 18, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Ik zal dinsdag van 14.00 tot 14.30 weg zijn", "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "dinsdag van 14.00 tot 14.30", @@ -18960,7 +18240,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "dinsdag om 14.00 - 14.30", @@ -18991,7 +18271,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "12 december om 16.00 - 18.30", @@ -19022,7 +18302,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "om 14.00 - 14.30 op dinsdag", @@ -19079,7 +18359,7 @@ "Context": { "ReferenceDateTime": "2018-11-08T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "het jaar", @@ -19196,7 +18476,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tweeduizend twintig", @@ -19221,7 +18501,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "negentienhonderd zesennegentig", @@ -19262,7 +18542,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "het einde van vandaag", @@ -19286,7 +18566,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -19294,7 +18574,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -19302,7 +18582,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -19310,7 +18590,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -19318,7 +18598,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "hele week", @@ -19342,7 +18622,7 @@ "Context": { "ReferenceDateTime": "2011-07-02T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -19350,7 +18630,7 @@ "Context": { "ReferenceDateTime": "2011-07-02T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -19358,7 +18638,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29 feb", @@ -19387,7 +18667,7 @@ "Context": { "ReferenceDateTime": "2019-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29/2", @@ -19416,7 +18696,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29e feb", @@ -19445,7 +18725,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "30 feb", @@ -19469,7 +18749,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29/2/2019", @@ -19493,7 +18773,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29/2/2020", @@ -19518,7 +18798,7 @@ "ReferenceDateTime": "2019-09-18T18:00:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "28e feb tot 1e maart", @@ -19549,7 +18829,7 @@ "Context": { "ReferenceDateTime": "2019-09-18T18:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29/2-1/3", @@ -19580,7 +18860,7 @@ "Context": { "ReferenceDateTime": "2019-09-18T18:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "29/2-1/3/2019", @@ -19604,7 +18884,7 @@ "Context": { "ReferenceDateTime": "2021-01-15T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "deze dag", @@ -19707,7 +18987,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "in de ochtend", @@ -19732,7 +19012,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [] }, { @@ -19740,7 +19020,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "23-sep-2020", @@ -19764,7 +19044,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "23-september-2020", @@ -19788,7 +19068,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "23/sep/2020", @@ -19812,7 +19092,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vrijdag 23 om 4", @@ -19851,7 +19131,7 @@ "Context": { "ReferenceDateTime": "2021-03-15T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vrijdag de 26e om 4", @@ -19910,7 +19190,7 @@ "Context": { "ReferenceDateTime": "2021-03-15T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vrijdag om 16.00", @@ -20007,7 +19287,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "november 19-20", @@ -20038,7 +19318,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20 ste van de volgende maand", @@ -20062,7 +19342,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "vier dagen gerekend vanaf gisteren", @@ -20110,7 +19390,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "jan-feb 2017", @@ -20160,7 +19440,7 @@ "Context": { "ReferenceDateTime": "2019-07-30T00:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "op dinsdag van volgende week", @@ -20179,30 +19459,6 @@ } ] }, - { - "Input": "Plan een halfjaarlijkse vergadering in", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "halfjaarlijkse", - "Start": 9, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "DateTime zoekterm\n23.04.2022 14:55\n30.04.2022 12:04 wat tekst 2020", "Context": { diff --git a/Specs/DateTime/Dutch/DateTimeParser.json b/Specs/DateTime/Dutch/DateTimeParser.json index c158fbda86..ead82b2afe 100644 --- a/Specs/DateTime/Dutch/DateTimeParser.json +++ b/Specs/DateTime/Dutch/DateTimeParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nu", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zo snel mogelijk", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 om 8:00", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 om 8:00:20", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15, 20:00", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 15e om 4 uur 's morgens", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21-04-2016, 20:00", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "23 okt. om zeven", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober 8:00", @@ -220,7 +220,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober 8:00:31", @@ -244,7 +244,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober rond 8:00", @@ -268,7 +268,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober om 8:00:31", @@ -292,7 +292,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober, 8:00", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 mei, 2016, 10 voor half negen 's avonds", @@ -340,7 +340,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20:00 op 15", @@ -364,7 +364,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20:00 op de 15e", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zeven op 15", @@ -412,7 +412,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20:00 vandaag", @@ -436,7 +436,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kwart voor zeven morgen", @@ -460,7 +460,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:00, 22-12-2016", @@ -484,7 +484,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen 8:00", @@ -508,7 +508,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenochtend om 7", @@ -532,7 +532,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond rond 7", @@ -556,7 +556,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7:00 op volgende zondagmiddag", @@ -580,7 +580,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien voor half zes morgenochtend", @@ -604,7 +604,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7, vanmorgen", @@ -628,7 +628,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10, vanavond", @@ -652,7 +652,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20:00 's avonds, zondag", @@ -676,7 +676,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22:00 vanavond", @@ -700,7 +700,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8:00 vanmorgen", @@ -724,7 +724,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20:00 vanavond", @@ -748,7 +748,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het eind van de dag", @@ -772,7 +772,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van morgen", @@ -796,7 +796,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van de zondag", @@ -820,7 +820,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 5 uur", @@ -844,7 +844,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15 om 8:00:24", @@ -868,7 +868,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14 oktober 8:00:13", @@ -892,7 +892,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze morgen om 7", @@ -916,7 +916,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze morgen om 7 uur 's ochtends", @@ -940,7 +940,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze morgen om zeven", @@ -964,7 +964,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze morgen om 7:00", @@ -988,7 +988,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze avond om 7", @@ -1012,7 +1012,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond om 7", @@ -1036,7 +1036,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16-12-2016 12:23:59", @@ -1060,7 +1060,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "6 jan 2017 - 6:37", @@ -1084,7 +1084,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16 nov. 2016 10:38", @@ -1108,7 +1108,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T19:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 dag 2 uren later", @@ -1132,7 +1133,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T19:15:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 maand 2 dagen 2 uren 30 min geleden", @@ -1156,7 +1158,7 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over een uur", @@ -1180,7 +1182,8 @@ "Context": { "ReferenceDateTime": "2017-11-23T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "over minder dan een uur", @@ -1205,7 +1208,7 @@ "Context": { "ReferenceDateTime": "2018-11-21T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eind van de dag", @@ -1229,7 +1232,7 @@ "Context": { "ReferenceDateTime": "2018-11-21T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aan het eind van de dag", @@ -1253,7 +1256,8 @@ "Context": { "ReferenceDateTime": "2018-11-21T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", + "NotSupported": "python", "Results": [ { "Text": "woens 26 okt 15:50:06 2016", @@ -1277,7 +1281,8 @@ "Context": { "ReferenceDateTime": "2018-11-21T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", + "NotSupported": "python", "Results": [ { "Text": "woens 26 okt 15:50:06 2016", @@ -1301,7 +1306,7 @@ "Context": { "ReferenceDateTime": "2018-12-26T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.30 vandaag", @@ -1325,7 +1330,7 @@ "Context": { "ReferenceDateTime": "2018-12-26T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "vandaag om 20.30", @@ -1349,7 +1354,7 @@ "Context": { "ReferenceDateTime": "2018-12-26T12:00:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.30 vandaag", diff --git a/Specs/DateTime/Dutch/DateTimePeriodExtractor.json b/Specs/DateTime/Dutch/DateTimePeriodExtractor.json index 6c15417318..3935fc1900 100644 --- a/Specs/DateTime/Dutch/DateTimePeriodExtractor.json +++ b/Specs/DateTime/Dutch/DateTimePeriodExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Ik ben vijf tot zeven vandaag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijf tot zeven vandaag", @@ -13,7 +13,7 @@ }, { "Input": "Ik ben morgen vijf tot zeven weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen vijf tot zeven", @@ -25,7 +25,7 @@ }, { "Input": "Ik ben van 5 tot 6 volgende zondag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 6 volgende zondag", @@ -37,7 +37,7 @@ }, { "Input": "Ik ben van 5 tot 18:00 volgende zondag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 18:00 volgende zondag", @@ -49,7 +49,7 @@ }, { "Input": "Ik ben van 16:00 tot 17:00 vandaag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 tot 17:00 vandaag", @@ -61,7 +61,7 @@ }, { "Input": "Ik ben van 16:00 vandaag tot 17:00 morgen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 vandaag tot 17:00 morgen", @@ -73,7 +73,7 @@ }, { "Input": "Ik ben van 16:00 tot 17:00 morgen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 tot 17:00 morgen", @@ -85,7 +85,7 @@ }, { "Input": "Ik ben van 16:00 tot 17:00 van 6-6-2017 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 tot 17:00 van 6-6-2017", @@ -97,7 +97,7 @@ }, { "Input": "Ik ben van 16:00 tot 17:00 5 mei, 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 tot 17:00 5 mei, 2018", @@ -109,7 +109,7 @@ }, { "Input": "Ik ben van 4:00 tot 17:00 5 mei, 2018 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 4:00 tot 17:00 5 mei, 2018", @@ -121,7 +121,7 @@ }, { "Input": "Ik ben van 16:00 op 1 jan, 2016 tot 17:00 vandaag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 op 1 jan, 2016 tot 17:00 vandaag", @@ -133,7 +133,7 @@ }, { "Input": "Ik ben van 14:00, 21-2-2016 tot 3:32, 23-04-2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 14:00, 21-2-2016 tot 3:32, 23-04-2016", @@ -145,7 +145,7 @@ }, { "Input": "Ik ben van vandaag om 4 uur tot volgende woens om 5 uur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van vandaag om 4 uur tot volgende woens om 5 uur", @@ -157,7 +157,7 @@ }, { "Input": "Ik ben tussen 16:00 en 17:00 vandaag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 16:00 en 17:00 vandaag", @@ -169,7 +169,8 @@ }, { "Input": "Ik ben tussen 16:00 op 1 jan, 2016 en 17:00 vandaag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 16:00 op 1 jan, 2016 en 17:00 vandaag", @@ -181,7 +182,7 @@ }, { "Input": "Ik ga vanavond terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond", @@ -193,7 +194,7 @@ }, { "Input": "Ik ga deze nacht terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze nacht", @@ -205,7 +206,7 @@ }, { "Input": "Ik ga deze avond terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze avond", @@ -217,7 +218,7 @@ }, { "Input": "Ik ga deze ochtend terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze ochtend", @@ -229,7 +230,7 @@ }, { "Input": "Ik ga deze middag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze middag", @@ -241,7 +242,7 @@ }, { "Input": "Ik ga volgende nacht terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende nacht", @@ -253,7 +254,7 @@ }, { "Input": "Ik ga gisterenavond terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gisterenavond", @@ -265,7 +266,7 @@ }, { "Input": "Ik ga morgenavond terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenavond", @@ -277,7 +278,7 @@ }, { "Input": "Ik ga volgende maandagmiddag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maandagmiddag", @@ -289,7 +290,7 @@ }, { "Input": "Ik ga de nacht van de 5e mei terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de nacht van de 5e mei", @@ -301,7 +302,7 @@ }, { "Input": "Ik ga laatste 3 minuut terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste 3 minuut", @@ -313,7 +314,7 @@ }, { "Input": "Ik ga afgelopen 3 minuut terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen 3 minuut", @@ -325,7 +326,7 @@ }, { "Input": "Ik ga voorgaande 3 minuut terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voorgaande 3 minuut", @@ -337,7 +338,7 @@ }, { "Input": "Ik ga voorgaande 3 minuten terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voorgaande 3 minuten", @@ -349,7 +350,7 @@ }, { "Input": "Ik ga de volgende 5 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende 5 uur", @@ -361,7 +362,7 @@ }, { "Input": "Ik ga de laatste minuut terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste minuut", @@ -373,7 +374,7 @@ }, { "Input": "Ik ga volgend uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgend uur", @@ -385,7 +386,8 @@ }, { "Input": "Ik ga laatste paar minuten terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "laatste paar minuten", @@ -397,7 +399,8 @@ }, { "Input": "Ik ga laatste aantal minuten terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "laatste aantal minuten", @@ -409,7 +412,7 @@ }, { "Input": "Ik ga dinsdag in de ochtend terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de ochtend", @@ -421,7 +424,7 @@ }, { "Input": "Ik ga dinsdag in de middag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de middag", @@ -433,7 +436,7 @@ }, { "Input": "Ik ga dinsdag in de avond terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de avond", @@ -445,7 +448,7 @@ }, { "Input": "laten we dinsdag vroeg in de ochtend afspreken ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de ochtend", @@ -457,7 +460,7 @@ }, { "Input": "laten we dinsdag laat in de ochtend afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de ochtend", @@ -469,7 +472,7 @@ }, { "Input": "laten we dinsdag vroeg in de middag afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de middag", @@ -481,7 +484,7 @@ }, { "Input": "laten we dinsdag laat in de middag afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de middag", @@ -493,7 +496,7 @@ }, { "Input": "laten we dinsdag vroeg in de avond afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de avond", @@ -505,7 +508,7 @@ }, { "Input": "laten we dinsdag laat in de avond afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de avond", @@ -517,7 +520,7 @@ }, { "Input": "laten we dinsdag vroeg in de nacht afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de nacht", @@ -529,7 +532,7 @@ }, { "Input": "laten we dinsdag laat in de nacht afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de nacht", @@ -541,7 +544,7 @@ }, { "Input": "laten we op dinsdag vroeg in de ochtend afspreken ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de ochtend", @@ -553,7 +556,7 @@ }, { "Input": "laten we op dinsdag laat in de ochtend afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de ochtend", @@ -565,7 +568,7 @@ }, { "Input": "laten we op dinsdag vroeg in de middag afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de middag", @@ -577,7 +580,7 @@ }, { "Input": "laten we op dinsdag laat in de middag afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de middag", @@ -589,7 +592,7 @@ }, { "Input": "laten we op dinsdag vroeg in de avond afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de avond", @@ -601,7 +604,7 @@ }, { "Input": "laten we op dinsdag laat in de avond afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de avond", @@ -613,7 +616,7 @@ }, { "Input": "laten we op dinsdag vroeg in de nacht afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de nacht", @@ -625,7 +628,7 @@ }, { "Input": "laten we op dinsdag laat in de nacht afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de nacht", @@ -637,7 +640,7 @@ }, { "Input": "laten we op dinsdag vroeg in de morgen afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de morgen", @@ -649,7 +652,7 @@ }, { "Input": "laten we op dinsdag laat in de morgen afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de morgen", @@ -661,7 +664,7 @@ }, { "Input": "Ik ben rest van de dag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van de dag", @@ -673,7 +676,7 @@ }, { "Input": "Ik ben rest van deze dag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van deze dag", @@ -685,7 +688,7 @@ }, { "Input": "Ik ben rest van huidige dag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van huidige dag", @@ -697,7 +700,7 @@ }, { "Input": "Cortana, plan alsjeblieft een skype voor zakelijk gesprek met Wayne, op vrijdag tussen 13:00 en 16:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag tussen 13:00 en 16:00", @@ -709,7 +712,8 @@ }, { "Input": "Kan je ons morgen tussen 8:00 en 12:00 inplannen?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "morgen tussen 8:00 en 12:00", @@ -721,7 +725,7 @@ }, { "Input": "Kan je ons de 9e dec tussen 8:00 en 14:00 inplannen?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 9e dec tussen 8:00 en 14:00", @@ -733,7 +737,7 @@ }, { "Input": "Hoi Cortana- leg alsjeblieft een skypegesprek met Jennifer vast. Het is een meeting van 30 minuten op deze vrijdag, in de middag ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze vrijdag, in de middag", @@ -745,7 +749,7 @@ }, { "Input": "Hoi Cortana- leg alsjeblieft een skypegesprek met Jennifer vast. Het is een meeting van 30 minuten in de middag, deze vrijdag ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de middag, deze vrijdag", @@ -757,7 +761,8 @@ }, { "Input": "Kan je 23-09-2015 13:00 tot 4 voor ons vastleggen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "23-09-2015 13:00 tot 4", @@ -769,7 +774,8 @@ }, { "Input": "Kan je 23-09-2015 13:30 tot 4 voor ons vastleggen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "23-09-2015 13:30 tot 4", @@ -781,7 +787,7 @@ }, { "Input": "Ik ga dinsdagmorgen terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagmorgen", @@ -793,7 +799,7 @@ }, { "Input": "Ik ga dinsdagmiddag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagmiddag", @@ -805,7 +811,8 @@ }, { "Input": "Het zal 2 uur in de toekomst gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 uur in de toekomst", @@ -817,7 +824,8 @@ }, { "Input": "Het zal tussen 10 en 11:30 op 1-1-2015 gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 10 en 11:30 op 1-1-2015", @@ -829,7 +837,8 @@ }, { "Input": "Het zal 1-1-2015 tussen 10 en 11:30 gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1-1-2015 tussen 10 en 11:30", @@ -841,7 +850,7 @@ }, { "Input": "Het zal van 10:30 tot 3 op 1-1-2015 gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10:30 tot 3 op 1-1-2015", @@ -853,7 +862,7 @@ }, { "Input": "Het zal tussen 3 en 5 op 1-1-2015 gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 en 5 op 1-1-2015", @@ -865,7 +874,7 @@ }, { "Input": "Het zal van 3:30 tot 5:55 op 1-1-2015 gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3:30 tot 5:55 op 1-1-2015", @@ -877,7 +886,7 @@ }, { "Input": "Het zal 1-1-2015 na 2:00 gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1-1-2015 na 2:00", @@ -889,7 +898,7 @@ }, { "Input": "Het zal vandaag voor 16:00 gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag voor 16:00", @@ -901,7 +910,7 @@ }, { "Input": "Het zal volgende woensdag later dan 10 uur 's morgens gebeuren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende woensdag later dan 10 uur 's morgens", @@ -913,7 +922,7 @@ }, { "Input": "Het gebeurde op afgelopen dinsdag tegen 2 in de middag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen dinsdag tegen 2 in de middag", @@ -925,7 +934,7 @@ }, { "Input": "Laten we op 1 feb niet later dan 6:00 gaan", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 feb niet later dan 6:00", @@ -937,12 +946,12 @@ }, { "Input": "Het gebeurde op volgende week na 2:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Maak me onbeschikbaar van 04-12-2019 6.00 tot 05-12-2019 20.00", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 04-12-2019 6.00 tot 05-12-2019 20.00", diff --git a/Specs/DateTime/Dutch/DateTimePeriodParser.json b/Specs/DateTime/Dutch/DateTimePeriodParser.json index b5ed8ba10f..cccb125232 100644 --- a/Specs/DateTime/Dutch/DateTimePeriodParser.json +++ b/Specs/DateTime/Dutch/DateTimePeriodParser.json @@ -4,7 +4,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "vandaag tussen vijf en zeven", @@ -30,7 +31,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 6 op 22/4/2016", @@ -56,7 +57,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 6 op 22 april", @@ -82,7 +83,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 6 ‘s middags op 22 april", @@ -108,7 +109,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 januari van 5 tot 6", @@ -134,7 +136,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "morgen tussen 15 en 16 uur ’s middags", @@ -160,7 +163,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "morgen tussen 15 en 16 uur ‘s middags", @@ -186,7 +190,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "morgen tussen 15 en 16 uur", @@ -212,7 +217,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van morgen half acht tot 16 uur ‘s middags", @@ -238,7 +243,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanaf 4 uur vandaag tot morgen 5 uur ’s middags", @@ -264,7 +269,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanaf 16 uur vandaag tot morgen 17 uur ’s middags", @@ -290,7 +295,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "vanaf 14:00 tot 2016-04-23 15:32", @@ -316,7 +322,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 2016-2-21 14:00 tot 2016-04-23 03:32", @@ -342,7 +348,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vandaag tussen 16 en 17 uur in de middag", @@ -368,7 +374,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanaf 4 uur tot vandaag 5 uur in de middag", @@ -394,7 +400,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 1 januari 2016 16 uur tot vandaag 17 uur in de middag", @@ -420,7 +427,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond", @@ -446,7 +453,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond", @@ -472,7 +479,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze avond", @@ -498,7 +505,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond", @@ -524,7 +531,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze ochtend", @@ -550,7 +557,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenavond", @@ -576,7 +583,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste avond", @@ -602,7 +609,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenavond", @@ -628,7 +635,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgennacht", @@ -654,7 +661,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aankomende maandagmiddag", @@ -680,7 +687,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste 3 minuten", @@ -706,7 +713,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen 3 minuten", @@ -732,7 +739,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "laatste drie minuten", @@ -758,7 +766,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 5 uur", @@ -784,7 +793,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste minuut", @@ -810,7 +819,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "volgende uur", @@ -836,7 +846,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen een paar uur", @@ -862,7 +873,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagochtend", @@ -888,7 +899,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "aankomende dinsdagochtend", @@ -914,7 +926,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagochtend", @@ -940,7 +952,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "dinsdagmiddag", @@ -966,7 +979,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagavond", @@ -992,7 +1005,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagochtend vroeg", @@ -1020,8 +1033,8 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "Comment": "Parsing cannot be done on both sides of the day/date, and time(-related) entities ('vroeg' (early), 'ochtend' (morning)) need to be placed together", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vroeg op de dinsdagochtend", @@ -1047,7 +1060,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagochtend vroeg", @@ -1074,7 +1087,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de ochtend", @@ -1102,8 +1115,8 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "Comment": "Parsing cannot be done on both sides of the day/date, and time(-related) entities ('in het begin', 'middag') need to be placed together", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "begin van dinsdagmiddag", @@ -1129,7 +1142,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagmiddag in het begin", @@ -1156,7 +1169,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag later in de middag", @@ -1183,7 +1196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de avond", @@ -1210,7 +1223,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in het begin van de avond", @@ -1237,7 +1250,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagavond laat", @@ -1264,7 +1277,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagavond", @@ -1290,7 +1303,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagavond laat", @@ -1317,7 +1330,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de ochtend", @@ -1345,8 +1358,8 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "Comment": "Parsing cannot be done on both sides of the day/date, and time(-related) entities ('aan het einde', 'ochtend') need to be placed together", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "einde van dinsdagochtend", @@ -1372,7 +1385,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagochtend aan het einde", @@ -1400,8 +1413,8 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "Comment": "Parsing cannot be done on both sides of the day/date, and time(-related) entities ('aan het einde', 'middag') need to be placed together", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het einde van dinsdagmiddag", @@ -1427,7 +1440,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagmiddag aan het einde", @@ -1454,7 +1467,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag aan het einde van de middag", @@ -1481,7 +1494,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de avond", @@ -1507,7 +1520,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de avond", @@ -1534,8 +1547,8 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "Comment": "Parsing cannot be done on both sides of the day/date, and time(-related) entities ('laat', 'avond') need to be placed together", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laat op dinsdagavond", @@ -1561,7 +1574,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van de dag", @@ -1587,7 +1600,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van deze dag", @@ -1613,7 +1626,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van mijn dag", @@ -1639,7 +1652,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van vandaag", @@ -1665,7 +1678,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van vandaag", @@ -1691,7 +1704,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 2016-02-21 14:00 uur tot 2016-02-23 03:32", @@ -1717,7 +1730,8 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "vrijdag tussen 1 en 4 uur ‘s middags", @@ -1743,7 +1757,8 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "vrijdag tussen 13 en 16 uur ‘s middags", @@ -1769,7 +1784,8 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "vrijdag tussen 13 en 16 uur", @@ -1795,7 +1811,8 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "morgen tussen 8 uur ‘s ochtends en 2 uur ’s middags", @@ -1821,7 +1838,8 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "morgen tussen 8 uur ‘s ochtends en 14 uur ’s middags", @@ -1847,7 +1865,7 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9 december tussen 8 uur ‘s ochtends en 2 uur ‘s middags", @@ -1873,7 +1891,7 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9 december tussen 8 uur ‘s ochtends en 14 uur ‘s middags", @@ -1900,8 +1918,8 @@ "ReferenceDateTime": "2017-11-13T16:12:00" }, "Comment": "Words that are related to each other, such as 'aanstaande' and 'vrijdag', may not be seperated by other words from a different entity such as 'middag'", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdagmiddag aanstaande", @@ -1927,7 +1945,8 @@ "Context": { "ReferenceDateTime": "2017-11-13T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "aanstaande vrijdagmiddag", @@ -1953,7 +1972,8 @@ "Context": { "ReferenceDateTime": "2017-11-13T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "deze vrijdagmiddag", @@ -1979,7 +1999,7 @@ "Context": { "ReferenceDateTime": "2017-11-13T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende vrijdagmiddag", @@ -2005,7 +2025,8 @@ "Context": { "ReferenceDateTime": "2017-11-13T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "afgelopen vrijdagmiddag", @@ -2031,7 +2052,7 @@ "Context": { "ReferenceDateTime": "2017-11-14T19:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdagmiddag tussen 1 en 4", @@ -2057,7 +2078,7 @@ "Context": { "ReferenceDateTime": "2017-11-14T19:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdagmiddag tussen 13 en 16", @@ -2083,7 +2104,8 @@ "Context": { "ReferenceDateTime": "2017-11-14T19:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "vrijdag tussen 13 en 16", @@ -2109,7 +2131,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 februari in de ochtend", @@ -2135,7 +2157,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdagochtend", @@ -2161,7 +2183,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de middag", @@ -2187,7 +2209,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 2 uur", @@ -2213,7 +2236,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 15 seconden", @@ -2239,7 +2263,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 5 minuten", @@ -2265,7 +2290,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 5 uur", @@ -2291,7 +2317,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen een dag en 5 uur", @@ -2317,7 +2344,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 2 dagen, 1 uur, 5 minuten en 30 seconden", @@ -2343,7 +2371,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 2 dagen, 1 uur, 5 minuten en 30 seconden", @@ -2369,7 +2398,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen aankomende 2 dagen, 1 uur, 5 minuten en 30 seconden", @@ -2395,7 +2425,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 5 uur", @@ -2421,7 +2452,8 @@ "Context": { "ReferenceDateTime": "2018-04-19T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "maandag tussen 8 en 9", @@ -2447,7 +2479,8 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "maandag 11-4", @@ -2473,7 +2506,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1/1/2015 tussen 10 en 11:30", @@ -2499,7 +2532,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1/1/2015 tussen 10 en 11:30", @@ -2525,7 +2558,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10:30 tot 3 op 1/1/2015", @@ -2551,7 +2584,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10:30 tot 15 op 1/1/2015", @@ -2577,7 +2610,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 en 5 op 1/1/2015", @@ -2603,7 +2636,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1/1/2015 van 3:30 tot 5:55", @@ -2629,7 +2662,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "vandaag vijf tot zeven", @@ -2655,7 +2689,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 6 op 22-4-2016", @@ -2681,7 +2715,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 6 op 22 april", @@ -2707,7 +2741,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van 5 tot 18:00 op 22 april", @@ -2733,7 +2768,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van 17 tot 18:00 op 22 april", @@ -2759,7 +2795,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 6 op de 1e van jan", @@ -2785,7 +2821,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen van 15:00 tot 16:00", @@ -2811,7 +2847,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "morgen van 15 tot 16", @@ -2837,7 +2874,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3:00 tot 4:00 morgen", @@ -2863,7 +2900,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht tot 16:00 morgen", @@ -2889,7 +2926,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht tot 16 morgen", @@ -2915,7 +2952,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 vandaag tot 17:00 morgen", @@ -2941,7 +2978,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 14:00, 21-2-2016 tot 3:32, 23-04-2016", @@ -2967,7 +3004,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 16:00 en 17:00 vandaag", @@ -2993,7 +3030,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 16:00 op 1 jan, 2016 en 17:00 vandaag", @@ -3019,7 +3057,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond", @@ -3045,7 +3083,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond", @@ -3071,7 +3109,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze nacht", @@ -3097,7 +3135,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze avond", @@ -3123,7 +3161,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze ochtend", @@ -3149,7 +3187,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze middag", @@ -3175,7 +3213,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende nacht", @@ -3201,7 +3239,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen nacht", @@ -3227,7 +3265,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige nacht", @@ -3253,7 +3291,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgennacht", @@ -3279,7 +3317,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende maandagmiddag", @@ -3305,7 +3343,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen 3 min", @@ -3331,7 +3369,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "volgende 5 uren", @@ -3357,7 +3396,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laatste minuut", @@ -3383,7 +3422,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "komend uur", @@ -3409,7 +3449,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "komende paar uur", @@ -3435,7 +3476,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de ochtend", @@ -3461,7 +3502,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de ochtend van deze dinsdag", @@ -3487,7 +3528,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag, in de ochtend", @@ -3513,7 +3554,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de middag", @@ -3539,7 +3580,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag in de avond", @@ -3565,7 +3606,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vroeg in de ochtend dinsdag", @@ -3592,7 +3633,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vroeg in de ochtend op dinsdag", @@ -3619,7 +3660,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laat in de ochtend dinsdag", @@ -3646,7 +3687,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vroeg in de middag dinsdag", @@ -3673,7 +3714,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laat in de middag dinsdag", @@ -3700,7 +3741,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vroeg in de avond dinsdag", @@ -3727,7 +3768,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laat in de avond dinsdag", @@ -3754,7 +3795,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vroeg in de nacht dinsdag", @@ -3781,7 +3822,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laat in de nacht dinsdag", @@ -3808,7 +3849,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de ochtend", @@ -3835,7 +3876,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de ochtend", @@ -3862,7 +3903,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de middag", @@ -3889,7 +3930,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de middag", @@ -3916,7 +3957,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de avond", @@ -3943,7 +3984,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de avond", @@ -3970,7 +4011,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag vroeg in de nacht", @@ -3997,7 +4038,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "dinsdag laat in de nacht", @@ -4024,7 +4065,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rest van de huidige dag", @@ -4050,7 +4091,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 14:00, 21-2-2016 tot 3:32, 23-04-2016", @@ -4076,7 +4117,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de late nacht op dinsdag", @@ -4103,7 +4144,8 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "morgen tussen 8:00 en 14:00", @@ -4129,7 +4171,7 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9 dec tussen 8:00 en 14:00", @@ -4155,7 +4197,7 @@ "Context": { "ReferenceDateTime": "2017-11-13T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze vrijdag, in de middag", @@ -4181,7 +4223,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 feb 's ochtends", @@ -4207,7 +4249,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 uren in de toekomst", @@ -4233,7 +4276,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 15 seconden", @@ -4259,7 +4303,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 5 uren", @@ -4285,7 +4330,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 1 dag en 5 uren", @@ -4311,7 +4357,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen 2 dagen, 1 uur, 5 minuten, 30 seconden", @@ -4337,7 +4384,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen volgende 2 dagen, 1 uur, 5 minuten, 30 seconden", @@ -4363,7 +4411,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen aankomende 2 dagen, 1 uur, 5 minuten, 30 seconden", @@ -4389,7 +4438,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "binnen de volgende 5 uur", @@ -4415,7 +4465,8 @@ "Context": { "ReferenceDateTime": "2018-04-19T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "maandag 8 tot 9", @@ -4441,7 +4492,8 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "maandag 12-4", @@ -4467,7 +4519,8 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "maandag 11-4", @@ -4493,7 +4546,8 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tussen 10 en 11:30 op 1-1-2015", @@ -4519,7 +4573,8 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1-1-2015 tussen 10 en 11:30", @@ -4545,7 +4600,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10:30 tot 3 op 1-1-2015", @@ -4571,7 +4626,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 en 5 op 1-1-2015", @@ -4597,7 +4652,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 en 5 op 1/1/2015", @@ -4623,7 +4678,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3:30 tot 5:55 op 1-1-2015", @@ -4649,8 +4704,8 @@ "Context": { "ReferenceDateTime": "2017-11-09T16:12:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "op volgende week vrijdag tussen 8.00 en 14.00", @@ -4676,7 +4731,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "van 04-12-2019 6.00 tot 05-12-2019 20.00", @@ -4702,8 +4757,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "tussen half acht en 16.00", diff --git a/Specs/DateTime/Dutch/DurationExtractor.json b/Specs/DateTime/Dutch/DurationExtractor.json index b8e609cea6..e69dd3aec2 100644 --- a/Specs/DateTime/Dutch/DurationExtractor.json +++ b/Specs/DateTime/Dutch/DurationExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Ik ga 3u weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3u", @@ -13,7 +13,7 @@ }, { "Input": "Ik ga 3 dgn weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 dgn", @@ -25,7 +25,7 @@ }, { "Input": "Ik ga 3dagen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3dagen", @@ -37,7 +37,7 @@ }, { "Input": "Ik ga 3,5 jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3,5 jaar", @@ -49,7 +49,7 @@ }, { "Input": "Ik ga 3,5 jr weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3,5 jr", @@ -61,7 +61,7 @@ }, { "Input": "Ik ga 3 u weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 u", @@ -73,7 +73,7 @@ }, { "Input": "Ik ga 3 uur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 uur", @@ -85,7 +85,7 @@ }, { "Input": "Ik ga 3 uren weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 uren", @@ -97,7 +97,7 @@ }, { "Input": "Ik ga 3 dagen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 dagen", @@ -109,7 +109,7 @@ }, { "Input": "Ik ga 3 maanden weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 maanden", @@ -121,7 +121,7 @@ }, { "Input": "Ik ga 3 minuten weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten", @@ -133,7 +133,7 @@ }, { "Input": "Ik ga 3 min weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 min", @@ -145,7 +145,7 @@ }, { "Input": "Ik ga 123,45 seconden weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "123,45 seconden", @@ -157,7 +157,7 @@ }, { "Input": "Ik ga twee weken weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee weken", @@ -169,7 +169,7 @@ }, { "Input": "Ik ga twintig minuten weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twintig minuten", @@ -181,7 +181,7 @@ }, { "Input": "Ik ga vierentwintig uur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vierentwintig uur", @@ -193,7 +193,7 @@ }, { "Input": "Ik ga de hele dag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele dag", @@ -205,7 +205,7 @@ }, { "Input": "Ik ga de hele week weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele week", @@ -217,7 +217,7 @@ }, { "Input": "Ik ga de hele maand weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele maand", @@ -229,7 +229,7 @@ }, { "Input": "Ik ga het hele jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het hele jaar", @@ -241,7 +241,7 @@ }, { "Input": "Ik ga een hele dag weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een hele dag", @@ -253,7 +253,7 @@ }, { "Input": "Ik ga een hele week weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een hele week", @@ -265,7 +265,7 @@ }, { "Input": "Ik ga een hele maand weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een hele maand", @@ -277,7 +277,7 @@ }, { "Input": "Ik ga een heel jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een heel jaar", @@ -289,7 +289,7 @@ }, { "Input": "Ik ga een uur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een uur", @@ -301,7 +301,7 @@ }, { "Input": "Ik ga een jaar weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een jaar", @@ -313,7 +313,7 @@ }, { "Input": "half jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half jaar", @@ -325,7 +325,7 @@ }, { "Input": "een half jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een half jaar", @@ -337,7 +337,7 @@ }, { "Input": "Ik ga 3 min. weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 min.", @@ -349,7 +349,7 @@ }, { "Input": "Ik ga 30 min. weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "30 min.", @@ -361,7 +361,7 @@ }, { "Input": "Ik ga een half uur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een half uur", @@ -373,7 +373,7 @@ }, { "Input": "Ik ga een halfuur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een halfuur", @@ -385,7 +385,8 @@ }, { "Input": "Ik ga anderhalf uur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "anderhalf uur", @@ -397,7 +398,7 @@ }, { "Input": "Ik ga twee uren weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee uren", @@ -409,7 +410,8 @@ }, { "Input": "Ik ga tweeëneenhalf uur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tweeëneenhalf uur", @@ -421,7 +423,7 @@ }, { "Input": "over een week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een week", @@ -433,7 +435,7 @@ }, { "Input": "Over een dag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een dag", @@ -445,7 +447,7 @@ }, { "Input": "een uur lang", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een uur lang", @@ -457,7 +459,7 @@ }, { "Input": "een maand lang", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een maand lang", @@ -469,7 +471,7 @@ }, { "Input": "Ik ga een paar uur lang weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een paar uur lang", @@ -481,7 +483,7 @@ }, { "Input": "Ik ga een paar minuten lang weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een paar minuten lang", @@ -493,7 +495,7 @@ }, { "Input": "Ik ga een paar dagen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een paar dagen", @@ -505,7 +507,7 @@ }, { "Input": "Ik ga enkele dagen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "enkele dagen", @@ -517,7 +519,7 @@ }, { "Input": "Ik ga 1 jaar, 1 maand en 21 dagen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 jaar, 1 maand en 21 dagen", @@ -529,7 +531,7 @@ }, { "Input": "Ik ga 1 maand en 2 dagen weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 maand en 2 dagen", @@ -541,7 +543,7 @@ }, { "Input": "Ik realiseerde me dat jij nog een week weg bent.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een week", @@ -553,7 +555,7 @@ }, { "Input": "Kunnen we nog een maand wachten?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een maand", @@ -565,7 +567,7 @@ }, { "Input": "Ik vertrek voor 3u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3u", @@ -577,7 +579,7 @@ }, { "Input": "Ik vertrek voor 3,5jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3,5jaar", @@ -589,7 +591,7 @@ }, { "Input": "Ik vertrek voor 3 u", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 u", @@ -601,7 +603,7 @@ }, { "Input": "Ik vertrek voor 3 uren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 uren", @@ -613,7 +615,7 @@ }, { "Input": "Ik vertrek voor 3 maanden", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 maanden", @@ -625,7 +627,7 @@ }, { "Input": "Ik vertrek voor 3 minuten", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten", @@ -637,7 +639,7 @@ }, { "Input": "Ik vertrek voor 3 min", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 min", @@ -649,7 +651,7 @@ }, { "Input": "Ik vertrek voor 123,45 sec", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "123,45 sec", @@ -661,7 +663,7 @@ }, { "Input": "Ik vertrek voor twee weken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee weken", @@ -673,7 +675,7 @@ }, { "Input": "Ik vertrek voor twintig minuten", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twintig minuten", @@ -685,7 +687,7 @@ }, { "Input": "Ik vertrek voor de hele dag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele dag", @@ -697,7 +699,7 @@ }, { "Input": "Ik vertrek voor de hele week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele week", @@ -709,7 +711,7 @@ }, { "Input": "Ik vertrek voor de hele maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele maand", @@ -721,7 +723,7 @@ }, { "Input": "Ik vertrek voor het hele jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het hele jaar", @@ -733,7 +735,7 @@ }, { "Input": "Ik vertrek voor de gehele dag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de gehele dag", @@ -745,7 +747,7 @@ }, { "Input": "Ik vertrek voor de gehele week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de gehele week", @@ -757,7 +759,7 @@ }, { "Input": "Ik vertrek voor de gehele maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de gehele maand", @@ -769,7 +771,7 @@ }, { "Input": "Ik vertrek voor het gehele jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het gehele jaar", @@ -781,7 +783,7 @@ }, { "Input": "Ik vertrek voor een uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een uur", @@ -793,7 +795,7 @@ }, { "Input": "Ik vertrek voor een jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een jaar", @@ -805,7 +807,7 @@ }, { "Input": "Ik vertrek voor 30 minuten", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "30 minuten", @@ -817,7 +819,7 @@ }, { "Input": "Ik vertrek voor een half uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een half uur", @@ -829,7 +831,7 @@ }, { "Input": "Ik vertrek voor een halfuur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een halfuur", @@ -841,7 +843,8 @@ }, { "Input": "Ik vertrek voor anderhalf uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "anderhalf uur", @@ -853,7 +856,7 @@ }, { "Input": "Ik vertrek voor halfuur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "halfuur", @@ -865,7 +868,7 @@ }, { "Input": "Ik vertrek voor twee uren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee uren", @@ -877,7 +880,8 @@ }, { "Input": "Ik vertrek voor tweeënhalf uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tweeënhalf uur", @@ -889,7 +893,7 @@ }, { "Input": "Over een week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een week", @@ -901,7 +905,7 @@ }, { "Input": "voor een uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een uur", @@ -913,7 +917,7 @@ }, { "Input": "voor een maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een maand", @@ -925,7 +929,7 @@ }, { "Input": "Ik vertrek voor paar uren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "paar uren", @@ -937,7 +941,7 @@ }, { "Input": "Ik vertrek voor een paar minuten", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een paar minuten", @@ -949,7 +953,7 @@ }, { "Input": "Ik vertrek voor aantal dagen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "aantal dagen", @@ -961,7 +965,7 @@ }, { "Input": "Ik vertrek voor enkele dagen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "enkele dagen", @@ -973,7 +977,7 @@ }, { "Input": "Ik vertrek voor 1 jaar, 1 maand, 21 dagen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 jaar, 1 maand, 21 dagen", @@ -985,7 +989,7 @@ }, { "Input": "Ik vertrek voor 2 dagen, 1 maand", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 dagen, 1 maand", @@ -997,7 +1001,7 @@ }, { "Input": "Ik besefte dat je nog een week weg bent", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een week", @@ -1009,7 +1013,7 @@ }, { "Input": "Kunnen we nog een werkdag wachten?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een werkdag", @@ -1021,7 +1025,7 @@ }, { "Input": "Ik vertrek voor twee decennia", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee decennia", @@ -1033,7 +1037,7 @@ }, { "Input": "Ik vertrek voor veertien dagen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "veertien dagen", diff --git a/Specs/DateTime/Dutch/DurationParser.json b/Specs/DateTime/Dutch/DurationParser.json index 19a5467c3d..93aa0bdebd 100644 --- a/Specs/DateTime/Dutch/DurationParser.json +++ b/Specs/DateTime/Dutch/DurationParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3u", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 dagen", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3,5 jaar", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 u", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 uur", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 maanden", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 min", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "123,45 sec", @@ -220,7 +220,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee weken", @@ -244,7 +244,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twintig min", @@ -268,7 +268,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vierentwintig uur", @@ -292,7 +292,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele dag", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele week", @@ -340,7 +340,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele maand", @@ -364,7 +364,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het hele jaar", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de volle dag", @@ -412,7 +412,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de volle week", @@ -436,7 +436,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de volle maand", @@ -460,7 +460,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het volle jaar", @@ -484,7 +484,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een uur", @@ -508,7 +508,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half jaar", @@ -532,7 +532,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een half jaar", @@ -556,7 +556,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "anderhalf uur", @@ -580,7 +581,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "anderhalve dag", @@ -604,7 +606,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "een kwartier", @@ -628,7 +631,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "een kwart uur", @@ -652,7 +656,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een half uur", @@ -676,7 +680,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee uur", @@ -700,7 +704,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tweeëneenhalf uur", @@ -724,7 +729,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 jaar, 1 maand en 21 dagen", @@ -748,7 +754,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 dagen en 1 maand", @@ -772,7 +779,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "een week en drie dagen", @@ -796,7 +804,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "een paar weken", @@ -820,7 +829,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "een paar dagen", @@ -844,7 +854,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "minder dan een paar dagen", @@ -869,7 +880,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "meer dan een uur", @@ -894,7 +905,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een uur", @@ -918,7 +929,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een week", @@ -942,7 +953,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een maand", @@ -966,7 +977,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3u", @@ -990,7 +1001,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3,5jaar", @@ -1014,7 +1025,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 u", @@ -1038,7 +1049,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 uren", @@ -1062,7 +1073,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 maanden", @@ -1086,7 +1097,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten", @@ -1110,7 +1121,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 min", @@ -1134,7 +1145,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "123,45 sec", @@ -1158,7 +1169,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee weken", @@ -1182,7 +1193,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twintig minuten", @@ -1206,7 +1217,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele dag", @@ -1230,7 +1241,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele week", @@ -1254,7 +1265,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de hele maand", @@ -1278,7 +1289,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het hele jaar", @@ -1302,7 +1313,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de gehele dag", @@ -1326,7 +1337,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de gehele week", @@ -1350,7 +1361,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de gehele maand", @@ -1374,7 +1385,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het gehele jaar", @@ -1398,7 +1409,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een uur", @@ -1422,7 +1433,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "gehele dag", @@ -1446,7 +1457,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "30 minuten", @@ -1470,7 +1481,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "anderhalf uur", @@ -1494,7 +1506,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "halfuur", @@ -1518,7 +1530,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee uren", @@ -1542,7 +1554,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tweeënhalf uur", @@ -1566,7 +1579,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "1 jaar, 1 maand, 21 dagen", @@ -1590,7 +1604,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2 dagen, 1 maand", @@ -1614,7 +1629,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "een week en drie dagen", @@ -1638,7 +1654,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een aantal weken", @@ -1662,7 +1678,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "een aantal dagen", @@ -1686,7 +1702,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "minder dan een aantal dagen", @@ -1711,7 +1727,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "meer dan een uur", @@ -1736,7 +1752,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een uur", @@ -1760,7 +1776,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nog een week", @@ -1784,7 +1800,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "nog een werkdag", @@ -1808,7 +1825,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "twee decennia", @@ -1832,7 +1850,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "veertien dagen", diff --git a/Specs/DateTime/Dutch/HolidayExtractor.json b/Specs/DateTime/Dutch/HolidayExtractor.json index f052016a8b..4bea2c9bed 100644 --- a/Specs/DateTime/Dutch/HolidayExtractor.json +++ b/Specs/DateTime/Dutch/HolidayExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Ik ga terug met kerst", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kerst", @@ -13,7 +13,7 @@ }, { "Input": " Ik ga terug met kerst ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kerst", @@ -25,7 +25,7 @@ }, { "Input": "Ik ga terug op Nieuwjaarsdag.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Nieuwjaarsdag", @@ -37,7 +37,7 @@ }, { "Input": "Ik ga terug met thanksgiving", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "thanksgiving", @@ -49,7 +49,7 @@ }, { "Input": "Ik ga terug op vaderdag.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vaderdag", @@ -61,7 +61,7 @@ }, { "Input": "Ik ga terug op Nieuwjaarsdag dit jaar", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Nieuwjaarsdag dit jaar", @@ -73,7 +73,7 @@ }, { "Input": " Ik ga terug op Nieuwjaarsdag 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Nieuwjaarsdag 2016", @@ -85,7 +85,7 @@ }, { "Input": "Ik ga terug op nieuwjaarsdag 2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nieuwjaarsdag 2016", @@ -97,7 +97,7 @@ }, { "Input": "Ik ga terug op koningsdag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "koningsdag", @@ -109,7 +109,7 @@ }, { "Input": "Ik ga op Kerst terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Kerst", @@ -121,7 +121,7 @@ }, { "Input": "Ik ga op Eerste Kerstdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Eerste Kerstdag", @@ -133,7 +133,7 @@ }, { "Input": "Ik ga op Yuandan terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Yuandan", @@ -145,7 +145,7 @@ }, { "Input": "Ik ga op Thanksgiving terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Thanksgiving", @@ -157,7 +157,7 @@ }, { "Input": "Ik ga op Vaderdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Vaderdag", @@ -169,7 +169,7 @@ }, { "Input": "Ik ga op Yuandan dit jaar terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Yuandan dit jaar", @@ -181,7 +181,7 @@ }, { "Input": "Ik ga op Yuandan 2016 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Yuandan 2016", @@ -193,7 +193,7 @@ }, { "Input": "Ik ga terug op Eerste Paasdag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Eerste Paasdag", @@ -205,7 +205,7 @@ }, { "Input": "Ik ga op Martin Luther Kingdag terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Martin Luther Kingdag", @@ -217,7 +217,7 @@ }, { "Input": "MLKdag is een Amerikaanse nationale feestdag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "MLKdag", @@ -229,12 +229,12 @@ }, { "Input": "Er is een feestdag vernoemd naar de naam van Martin Luther King", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Ik ga terug op Dodenherdenking", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Dodenherdenking", diff --git a/Specs/DateTime/Dutch/HolidayParser.json b/Specs/DateTime/Dutch/HolidayParser.json index 6ff15f7343..b28b079bb2 100644 --- a/Specs/DateTime/Dutch/HolidayParser.json +++ b/Specs/DateTime/Dutch/HolidayParser.json @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nieuwjaarsdag", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "oudjaarsavond", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kerst", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Nieuwjaarsdag", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vaderdag", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Nieuwjaarsdag volgend jaar", @@ -259,7 +259,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vaderdag 2015", @@ -331,7 +331,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Oudjaarsavond", @@ -355,7 +355,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Kerst", @@ -403,7 +403,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Thanksgiving", @@ -427,7 +427,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Vaderdag", @@ -475,7 +475,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Thanksgiving 2010", @@ -499,7 +499,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Vaderdag 2015", @@ -547,7 +547,7 @@ "Context": { "ReferenceDateTime": "2018-06-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Martin Luther Kingdag", @@ -571,7 +571,7 @@ "Context": { "ReferenceDateTime": "2018-06-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "MLKdag", @@ -643,7 +643,7 @@ "Context": { "ReferenceDateTime": "2020-08-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "oud en nieuw", @@ -667,7 +667,7 @@ "Context": { "ReferenceDateTime": "2020-08-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Oudejaarsavond", @@ -823,7 +823,7 @@ "Context": { "ReferenceDateTime": "2020-08-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Thanksgiving", @@ -877,7 +877,7 @@ "Context": { "ReferenceDateTime": "2020-08-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "Valentijnsdag", diff --git a/Specs/DateTime/Dutch/MergedExtractor.json b/Specs/DateTime/Dutch/MergedExtractor.json index 588a38500c..2adb03d79a 100644 --- a/Specs/DateTime/Dutch/MergedExtractor.json +++ b/Specs/DateTime/Dutch/MergedExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "dit is 2 dagen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 dagen", @@ -13,7 +13,7 @@ }, { "Input": "dit is voor 16:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 16:00", @@ -25,7 +25,7 @@ }, { "Input": "dit is voor 16:00 morgen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 16:00 morgen", @@ -37,7 +37,7 @@ }, { "Input": "dit is voor morgen 16:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor morgen 16:00", @@ -49,7 +49,7 @@ }, { "Input": "dit is na 16:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 16:00", @@ -61,7 +61,7 @@ }, { "Input": "dit is na 16:00 morgen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 16:00 morgen", @@ -73,7 +73,7 @@ }, { "Input": "dit is na morgen 16.00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na morgen 16.00", @@ -85,7 +85,7 @@ }, { "Input": "Ik ben over 5 minuten terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 5 minuten", @@ -97,7 +97,7 @@ }, { "Input": "afgelopen week", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "afgelopen week", @@ -109,7 +109,7 @@ }, { "Input": "plan een meeting over 10 uur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 10 uur", @@ -121,7 +121,7 @@ }, { "Input": "Hoe ziet deze deze dag eruit?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze dag", @@ -133,7 +133,7 @@ }, { "Input": "Hoe ziet deze week eruit?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "deze week", @@ -145,7 +145,7 @@ }, { "Input": "Hoe ziet mijn week eruit?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mijn week", @@ -157,7 +157,7 @@ }, { "Input": "Hoe ziet de week eruit?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week", @@ -169,7 +169,7 @@ }, { "Input": "Hoe ziet mijn dag eruit?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mijn dag", @@ -181,7 +181,7 @@ }, { "Input": "Hoe ziet de dag eruit?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de dag", @@ -193,7 +193,8 @@ }, { "Input": "Plan een meeting 's ochtends van 9:00 tot 11:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "'s ochtends van 9:00 tot 11:00", @@ -205,7 +206,7 @@ }, { "Input": "Plan een meeting morgen van 9:00 tot 11:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen van 9:00 tot 11:00", @@ -217,7 +218,7 @@ }, { "Input": "Wijzig de meeting van de 22e juli in Bellevue naar de 22e augustus", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de 22e juli", @@ -235,7 +236,7 @@ }, { "Input": "na 2-7", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2-7", @@ -247,7 +248,7 @@ }, { "Input": "sinds 2-7", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sinds 2-7", @@ -259,7 +260,7 @@ }, { "Input": "voor 2-7", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 2-7", @@ -271,7 +272,7 @@ }, { "Input": "06-06 12:15", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "06-06 12:15", @@ -283,7 +284,7 @@ }, { "Input": "06-06-12 15:15", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "06-06-12 15:15", @@ -295,7 +296,7 @@ }, { "Input": "06-06, 2015", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "06-06, 2015", @@ -307,7 +308,7 @@ }, { "Input": "29 mei", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "29 mei", @@ -319,7 +320,7 @@ }, { "Input": "29 maart", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "29 maart", @@ -331,7 +332,7 @@ }, { "Input": "Ik ben geboren maart", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maart", @@ -343,7 +344,7 @@ }, { "Input": "Ik geboren in de maart", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "maart", @@ -355,7 +356,7 @@ }, { "Input": "mei", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "mei", @@ -367,37 +368,37 @@ }, { "Input": "Wat zijn de openingstijden van Palomino?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "in de zon", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "welke email hebben een reactie gehad?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Hij is vaak alleen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "vaak een vogel", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "uren van michigan", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Ik wijzig de afspraak van 15:00 naar 4", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15:00", @@ -415,7 +416,7 @@ }, { "Input": "Ik wijzig de afspraak van 15:00 naar 4,", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15:00", @@ -433,7 +434,7 @@ }, { "Input": "Ik wijzig de afspraak van drie uur 's middags naar vier", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drie uur 's middags", @@ -451,7 +452,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar elf", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -469,7 +470,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 4.,", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -487,7 +488,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar elf!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -505,7 +506,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar elf?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -523,7 +524,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 20!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -541,7 +542,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar twintig!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -559,7 +560,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar dertien!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -577,7 +578,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 13!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -595,7 +596,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 0!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -613,7 +614,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 24!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -631,7 +632,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar nul.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -649,7 +650,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar vierentwintig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -667,7 +668,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 4, hoe denk je?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -685,7 +686,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 4.3", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -697,7 +698,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar zesentwintig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -709,7 +710,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 4 of later", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -721,7 +722,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar 25", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -733,7 +734,7 @@ }, { "Input": "Ik wijzig de afspraak van tien uur 's ochtends naar vijfentwintig", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -751,7 +752,7 @@ }, { "Input": "volgende meeting zal plaatsvinden op 16 maart, 2017, zullen we anders een gesprek hebben om 2 uur deze middag? ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16 maart, 2017", @@ -769,7 +770,7 @@ }, { "Input": "1 april, 2018, we kunnen het 2 uur vanmiddag plannen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 april, 2018", @@ -787,7 +788,7 @@ }, { "Input": "Het bereik is voor 2012", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 2012", @@ -799,7 +800,7 @@ }, { "Input": "Het bereik is tot 2012", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tot 2012", @@ -811,7 +812,8 @@ }, { "Input": "Het bereik is 2012 of erna", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "2012 of erna", @@ -823,7 +825,7 @@ }, { "Input": "Ik ben 11-2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11-2016", @@ -835,7 +837,7 @@ }, { "Input": "Ik ben 2016-11 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016-11", @@ -847,7 +849,7 @@ }, { "Input": "Ik ben 2016 november weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 november", @@ -859,7 +861,7 @@ }, { "Input": "Ik ben november, 2016 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november, 2016", @@ -871,7 +873,7 @@ }, { "Input": "Ik ben 2016, nov weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016, nov", @@ -883,7 +885,7 @@ }, { "Input": "Hij zal later dan of op 1-1-2016 aankomen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later dan of op 1-1-2016", @@ -895,7 +897,7 @@ }, { "Input": "Hij zal voor of op 1-1-2016 vertrekken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor of op 1-1-2016", @@ -907,7 +909,7 @@ }, { "Input": "Deze taak zal af komen op of eerder dan 1-1-2016", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op of eerder dan 1-1-2016", @@ -919,7 +921,7 @@ }, { "Input": "Deze taak zal af komen voor of in feb 2018", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor of in feb 2018", @@ -931,7 +933,7 @@ }, { "Input": "Je kunt niet eerder dan of in 2016 vertrekken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder dan of in 2016", @@ -943,7 +945,7 @@ }, { "Input": "Je kunt kantoor niet verlaten om of na 18:30 vandaag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "om of na 18:30 vandaag", @@ -955,7 +957,7 @@ }, { "Input": "Je moet op of voor overmorgen vertrekken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op of voor overmorgen", @@ -967,7 +969,7 @@ }, { "Input": "Je moet op of vroeger dan 15:00 15-5-2018 vertrekken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op of vroeger dan 15:00 15-5-2018", @@ -979,7 +981,7 @@ }, { "Input": "Ben je twee dagen na vandaag beschikbaar?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen na vandaag", @@ -991,7 +993,7 @@ }, { "Input": "Ben je drie weken vanaf morgen beschikbaar?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drie weken vanaf morgen", @@ -1003,7 +1005,7 @@ }, { "Input": "Waar was je twee dagen voor gisteren?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen voor gisteren", @@ -1015,12 +1017,13 @@ }, { "Input": "Wat de verkoop per jaar?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Ik heb al mijn werk al meer dan 2 weken voor vandaag afgerond", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "meer dan 2 weken voor vandaag", @@ -1032,7 +1035,7 @@ }, { "Input": "Ik zal binnen 2 weken vanaf vandaag terugkomen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "binnen 2 weken vanaf vandaag", @@ -1044,7 +1047,8 @@ }, { "Input": "Ik zal minder dan 2 weken vanaf vandaag terugkomen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "minder dan 2 weken vanaf vandaag", @@ -1056,7 +1060,8 @@ }, { "Input": "Deze taak zou meer dan 2 dagen voor gisteren afgerond moeten zijn", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "meer dan 2 dagen voor gisteren", @@ -1068,7 +1073,8 @@ }, { "Input": "Deze taak zal minder dan 3 dagen na morgen afgerond zijn", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "minder dan 3 dagen na morgen", @@ -1080,7 +1086,7 @@ }, { "Input": "Laten we 3 minuten vanaf nu beginnen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten vanaf nu", @@ -1092,7 +1098,8 @@ }, { "Input": "Laten we 3 minuten vanaf vandaag beginnen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "3 minuten", diff --git a/Specs/DateTime/Dutch/MergedParser.json b/Specs/DateTime/Dutch/MergedParser.json index 4e65dc4dda..b640ee8eaa 100644 --- a/Specs/DateTime/Dutch/MergedParser.json +++ b/Specs/DateTime/Dutch/MergedParser.json @@ -43,7 +43,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week van 30 november", @@ -137,7 +137,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor vanavond rond 20.00", @@ -216,7 +216,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "overmorgen", @@ -240,7 +240,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "overmorgen om 8.00", @@ -269,7 +269,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag in de middag", @@ -331,7 +331,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgenochtend om 9 uur", @@ -355,7 +355,7 @@ "Context": { "ReferenceDateTime": "2017-09-15T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor woensdag", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2017-10-15T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor dinsdag de eenendertigste", @@ -414,7 +414,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 8 minuten", @@ -438,7 +438,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 10 uur", @@ -462,7 +462,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 10 dagen", @@ -486,7 +486,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 3 weken", @@ -510,7 +510,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 3 maanden", @@ -534,7 +534,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 3 jaar", @@ -558,7 +558,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 20.00", @@ -584,7 +584,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 20.00", @@ -610,7 +610,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "sinds 20.00", @@ -636,7 +636,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "30-2-2016", @@ -720,89 +720,6 @@ } ] }, - { - "Input": "leg een meeting vast iedere week om 8.00", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere week", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 21, - "Length": 11 - }, - { - "Text": "8.00", - "Type": "datetimeV2.time", - "Value": { - "values": [ - { - "timex": "T08:00", - "type": "time", - "value": "08:00:00" - }, - { - "timex": "T20:00", - "type": "time", - "value": "20:00:00" - } - ] - }, - "Start": 36, - "Length": 4 - } - ] - }, - { - "Input": "leg vast tweede zaterdag elke maand", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "tweede zaterdag", - "Type": "datetimeV2.date", - "Value": { - "values": [ - { - "timex": "2016-11-12", - "type": "date", - "value": "2016-11-12" - } - ] - }, - "Start": 9, - "Length": 15 - }, - { - "Text": "elke maand", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 25, - "Length": 10 - } - ] - }, { "Input": "Maak een afspraak voor Eerste Paasdag", "Context": { @@ -901,7 +818,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22 juli", @@ -950,7 +867,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vrijdag", @@ -1028,7 +945,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voorafgaand aan 14.00", @@ -1054,7 +971,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -1093,7 +1010,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -1132,7 +1049,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -1176,7 +1093,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -1200,7 +1117,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien uur 's ochtends", @@ -1224,7 +1141,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 5 minuten", @@ -1248,7 +1165,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 5 minuten", @@ -1272,7 +1189,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de ochtend", @@ -1297,7 +1214,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "morgen", @@ -1321,7 +1238,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor morgen", @@ -1347,7 +1264,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "niet later dan morgen", @@ -1373,7 +1290,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na of gelijk aan 1-1-2016", @@ -1399,7 +1316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later dan 1-1-2016", @@ -1425,7 +1342,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 1-1-2016", @@ -1451,7 +1368,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder dan 1-1-2016", @@ -1477,7 +1394,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "beginnend vanaf 1-1-2016", @@ -1503,7 +1420,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eindigend met 1-1-2016", @@ -1529,7 +1446,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder dan 2020", @@ -1555,7 +1472,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tot 2012", @@ -1932,7 +1849,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016, nov", @@ -1957,7 +1874,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 , nov", @@ -1982,7 +1899,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "november , 2016", @@ -2007,7 +1924,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016 november", @@ -2032,7 +1949,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11-2016", @@ -2057,7 +1974,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11- 2016", @@ -2082,7 +1999,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11 -2016", @@ -2107,7 +2024,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11/2016", @@ -2132,7 +2049,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11/ 2016", @@ -2157,7 +2074,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11 /2016", @@ -2182,7 +2099,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11 - 2016", @@ -2207,7 +2124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11 / 2016", @@ -2232,7 +2149,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later dan of op 1-1-2016", @@ -2258,7 +2175,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "later dan 1-1-2016", @@ -2284,7 +2201,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1-1-2016", @@ -2308,7 +2225,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor of op 1-1-2016", @@ -2334,7 +2251,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 1-1-2016", @@ -2360,7 +2277,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op of eerder dan 1-1-2016", @@ -2386,7 +2303,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1-1-2016", @@ -2410,7 +2327,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder dan 1-1-2016", @@ -2436,7 +2353,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor of in feb 2018", @@ -2462,7 +2379,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor feb 2018", @@ -2488,7 +2405,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "feb 2018", @@ -2513,7 +2430,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "niet later dan of in 2016", @@ -2539,7 +2456,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "niet later dan 2016", @@ -2565,7 +2482,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016", @@ -2590,7 +2507,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op of na 18.30 vandaag", @@ -2616,7 +2533,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 18.30 vandaag", @@ -2642,7 +2559,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18.30 vandaag", @@ -2666,7 +2583,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op of voor overmorgen", @@ -2692,7 +2609,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "overmorgen", @@ -2716,7 +2633,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor overmorgen", @@ -2742,7 +2659,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "op of eerder dan 15.00 15-5-2018", @@ -2768,7 +2685,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder dan 15.00 15-5-2018", @@ -2794,7 +2711,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15.00 15-5-2018", @@ -2818,7 +2735,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twee dagen na vandaag", @@ -2890,7 +2807,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor 2010", @@ -2933,7 +2850,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2010", @@ -3009,7 +2926,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "meer dan 4 dagen", @@ -3200,7 +3117,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten vanaf nu", @@ -3426,7 +3343,7 @@ "Context": { "ReferenceDateTime": "2018-06-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2018", @@ -3452,7 +3369,7 @@ "Context": { "ReferenceDateTime": "2018-06-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na feb 2018", @@ -3478,7 +3395,7 @@ "Context": { "ReferenceDateTime": "2018-06-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na feb", @@ -3592,7 +3509,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vorige week dinsdag om 2 uur 's middags", @@ -3659,7 +3576,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "volgende week", @@ -3799,7 +3716,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het jaar", @@ -3824,7 +3741,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week", @@ -3849,7 +3766,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week na de volgende", @@ -3874,7 +3791,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "week 31", @@ -3899,7 +3816,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 3 uur", @@ -3923,7 +3840,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 2 weken", @@ -3947,7 +3864,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 2 dagen", @@ -3971,7 +3888,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 2 maanden", @@ -3995,7 +3912,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 2 jaar", @@ -4019,7 +3936,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 dagen vanaf vandaag", @@ -4043,7 +3960,7 @@ "Context": { "ReferenceDateTime": "2018-08-10T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "> 18.00 vandaag", @@ -4069,7 +3986,7 @@ "Context": { "ReferenceDateTime": "2018-08-10T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": ">= 18.00 vandaag", @@ -4095,7 +4012,7 @@ "Context": { "ReferenceDateTime": "2018-08-10T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "<18.00 vandaag", @@ -4121,7 +4038,7 @@ "Context": { "ReferenceDateTime": "2018-08-10T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "<=18.00 vandaag", @@ -4147,7 +4064,7 @@ "Context": { "ReferenceDateTime": "2018-08-10T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18.00", @@ -4171,7 +4088,7 @@ "Context": { "ReferenceDateTime": "2018-08-10T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18.00", @@ -4195,7 +4112,7 @@ "Context": { "ReferenceDateTime": "2015-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2016", @@ -4308,7 +4225,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerder dan 14:00", @@ -4334,7 +4251,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na of op 1-1-2016", @@ -4410,7 +4327,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 18.30 vandaag", @@ -4436,7 +4353,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18.30 vandaag", @@ -4587,7 +4504,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 3 minuten", @@ -4628,7 +4545,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "over 3 minuten", @@ -4693,7 +4610,7 @@ "Context": { "ReferenceDateTime": "2018-06-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na afloop van 2018", @@ -4719,7 +4636,7 @@ "Context": { "ReferenceDateTime": "2018-06-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na afloop van feb 2018", @@ -4745,7 +4662,7 @@ "Context": { "ReferenceDateTime": "2018-06-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na afloop van feb", @@ -4834,7 +4751,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "komende week", @@ -4883,7 +4800,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de week na afloop van de volgende", @@ -4908,7 +4825,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2 weken", @@ -4932,7 +4849,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2 dagen", @@ -4956,7 +4873,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2 maanden", @@ -4980,7 +4897,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na 2 jaar", @@ -5004,7 +4921,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 dagen sedert vandaag", @@ -5028,7 +4945,7 @@ "Context": { "ReferenceDateTime": "2015-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "na afloop van 2016", @@ -5088,7 +5005,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor volgende dinsdag om 12.00", @@ -5121,7 +5038,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten", @@ -5162,7 +5079,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 minuten vanaf nu", @@ -5250,7 +5167,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tegen morgen", @@ -5276,7 +5193,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "uiterlijk morgen", @@ -5302,7 +5219,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "voor morgen", @@ -5328,7 +5245,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "uiterlijk morgen", @@ -5354,7 +5271,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2 dagen vanaf nu", @@ -5378,7 +5295,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vanavond", @@ -5403,7 +5320,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3 mei", diff --git a/Specs/DateTime/Dutch/SetExtractor.json b/Specs/DateTime/Dutch/SetExtractor.json deleted file mode 100644 index c281401b9c..0000000000 --- a/Specs/DateTime/Dutch/SetExtractor.json +++ /dev/null @@ -1,635 +0,0 @@ -[ - { - "Input": "Ik zal wekelijks vertrekken", - "Results": [ - { - "Text": "wekelijks", - "Type": "set", - "Start": 7, - "Length": 9 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal dagelijks vertrekken", - "Results": [ - { - "Text": "dagelijks", - "Type": "set", - "Start": 7, - "Length": 9 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke dag vertrekken", - "Results": [ - { - "Text": "elke dag", - "Type": "set", - "Start": 7, - "Length": 8 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke maand vertrekken", - "Results": [ - { - "Text": "elke maand", - "Type": "set", - "Start": 7, - "Length": 10 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal jaarlijks vertrekken", - "Results": [ - { - "Text": "jaarlijks", - "Type": "set", - "Start": 7, - "Length": 9 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke twee dagen vertrekken", - "Results": [ - { - "Text": "elke twee dagen", - "Type": "set", - "Start": 7, - "Length": 15 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke drie weken vertrekken", - "Results": [ - { - "Text": "elke drie weken", - "Type": "set", - "Start": 7, - "Length": 15 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke dag om 15:00 vertrekken", - "Results": [ - { - "Text": "elke dag om 15:00", - "Type": "set", - "Start": 7, - "Length": 17 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal iedere dag om 15:00 vertrekken", - "Results": [ - { - "Text": "iedere dag om 15:00", - "Type": "set", - "Start": 7, - "Length": 19 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke 15/4 vertrekken", - "Results": [ - { - "Text": "elke 15/4", - "Type": "set", - "Start": 7, - "Length": 9 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke maandag vertrekken", - "Results": [ - { - "Text": "elke maandag", - "Type": "set", - "Start": 7, - "Length": 12 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke maandag om 16:00 vertrekken", - "Results": [ - { - "Text": "elke maandag om 16:00", - "Type": "set", - "Start": 7, - "Length": 21 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke ochtend vertrekken", - "Results": [ - { - "Text": "elke ochtend", - "Type": "set", - "Start": 7, - "Length": 12 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke ochtend om 09:00 vertrekken", - "Results": [ - { - "Text": "elke ochtend om 09:00", - "Type": "set", - "Start": 7, - "Length": 21 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke middag om 16:00 vertrekken", - "Results": [ - { - "Text": "elke middag om 16:00", - "Type": "set", - "Start": 7, - "Length": 20 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke dag om 21:00 vertrekken", - "Results": [ - { - "Text": "elke dag om 21:00", - "Type": "set", - "Start": 7, - "Length": 17 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke avond om 9 uur vertrekken", - "Results": [ - { - "Text": "elke avond om 9 uur", - "Type": "set", - "Start": 7, - "Length": 19 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik ga weg iedere ochtend om 9 uur", - "Results": [ - { - "Text": "iedere ochtend om 9 uur", - "Type": "set", - "Start": 10, - "Length": 23 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik ga weg om 9 uur iedere ochtend", - "Results": [ - { - "Text": "9 uur iedere ochtend", - "Type": "set", - "Start": 13, - "Length": 20 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik vertrek elke zondag ochtend om 9 uur", - "Results": [ - { - "Text": "elke zondag ochtend om 9 uur", - "Type": "set", - "Start": 11, - "Length": 28 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke maandag om 09:00 vertrekken", - "Results": [ - { - "Text": "elke maandag om 09:00", - "Type": "set", - "Start": 7, - "Length": 21 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal vertrekken om 9 uur 's ochtends elke maandag", - "Results": [ - { - "Text": "9 uur 's ochtends elke maandag", - "Type": "set", - "Start": 21, - "Length": 30 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik zal elke zondag vertrekken", - "Results": [ - { - "Text": "elke zondag", - "Type": "set", - "Start": 7, - "Length": 11 - } - ], - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "Ik vertrek wekelijks", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "wekelijks", - "Type": "set", - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "Ik vertrek dagelijks", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "dagelijks", - "Type": "set", - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "Ik vertrek elke dag", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke dag", - "Type": "set", - "Start": 11, - "Length": 8 - } - ] - }, - { - "Input": "Ik vertrek elke maand", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke maand", - "Type": "set", - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "Ik vertrek jaarlijks", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "jaarlijks", - "Type": "set", - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "Ik vertek elke twee dagen", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke twee dagen", - "Type": "set", - "Start": 10, - "Length": 15 - } - ] - }, - { - "Input": "Ik vertrek iedere dag 15:00", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere dag 15:00", - "Type": "set", - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "Ik vertrek elke dag 15:00", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke dag 15:00", - "Type": "set", - "Start": 11, - "Length": 14 - } - ] - }, - { - "Input": "Ik vertrek elke 15-4", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke 15-4", - "Type": "set", - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "Ik vertrek iedere maandag", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere maandag", - "Type": "set", - "Start": 11, - "Length": 14 - } - ] - }, - { - "Input": "Ik vertrek elke maandag 16:00", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke maandag 16:00", - "Type": "set", - "Start": 11, - "Length": 18 - } - ] - }, - { - "Input": "Ik vertrek iedere ochtend", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere ochtend", - "Type": "set", - "Start": 11, - "Length": 14 - } - ] - }, - { - "Input": "Ik vertrek iedere ochtend om 9:00", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere ochtend om 9:00", - "Type": "set", - "Start": 11, - "Length": 22 - } - ] - }, - { - "Input": "Ik vertrek iedere middag om 16:00", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere middag om 16:00", - "Type": "set", - "Start": 11, - "Length": 22 - } - ] - }, - { - "Input": "Ik vertrek iedere avond om 21:00", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere avond om 21:00", - "Type": "set", - "Start": 11, - "Length": 21 - } - ] - }, - { - "Input": "Ik vertrek iedere avond om 9 uur", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere avond om 9 uur", - "Type": "set", - "Start": 11, - "Length": 21 - } - ] - }, - { - "Input": "Ik vertrek de ochtenden om 9:00", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "de ochtenden om 9:00", - "Type": "set", - "Start": 11, - "Length": 20 - } - ] - }, - { - "Input": "Ik vertrek op ochtenden om 9 uur", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "op ochtenden om 9 uur", - "Type": "set", - "Start": 11, - "Length": 21 - } - ] - }, - { - "Input": "Ik vertrek om 9 uur 's ochtends iedere zondag", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "9 uur 's ochtends iedere zondag", - "Type": "set", - "Start": 14, - "Length": 31 - } - ] - }, - { - "Input": "Ik vertrek om 9 uur 's ochtends op maandagen", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "9 uur 's ochtends op maandagen", - "Type": "set", - "Start": 14, - "Length": 30 - } - ] - }, - { - "Input": "Ik vertrek om 9:00 op maandagen", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "9:00 op maandagen", - "Type": "set", - "Start": 14, - "Length": 17 - } - ] - }, - { - "Input": "Ik vertrek op maandagen", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "op maandagen", - "Type": "set", - "Start": 11, - "Length": 12 - } - ] - }, - { - "Input": "Ik vertrek op zondagen", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "op zondagen", - "Type": "set", - "Start": 11, - "Length": 11 - } - ] - }, - { - "Input": "Ik vertrek zondagen", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "zondagen", - "Type": "set", - "Start": 11, - "Length": 8 - } - ] - }, - { - "Input": "Kan ik een boeking plaatsen voor de 9e van mei voor 2 nachten?", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "nachten", - "Type": "set", - "Start": 54, - "Length": 7 - } - ] - }, - { - "Input": "Laten we eens per week meeten", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "eens per week", - "Type": "set", - "Start": 9, - "Length": 13 - } - ] - }, - { - "Input": "Ik ga eens per jaar op vakantie", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "eens per jaar", - "Type": "set", - "Start": 6, - "Length": 13 - } - ] - }, - { - "Input": "Elke andere vrijdag", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "Elke andere vrijdag", - "Type": "set", - "Start": 0, - "Length": 19 - } - ] - }, - { - "Input": "Laten we een driemaandelijkse vergadering hebben", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "driemaandelijkse", - "Type": "set", - "Start": 13, - "Length": 16 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Dutch/SetParser.json b/Specs/DateTime/Dutch/SetParser.json deleted file mode 100644 index f09aa6e802..0000000000 --- a/Specs/DateTime/Dutch/SetParser.json +++ /dev/null @@ -1,1158 +0,0 @@ -[ - { - "Input": "Ik zal wekelijks vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2744475+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "wekelijks", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 7, - "Length": 9 - } - ] - }, - { - "Input": "Ik zal tweewekelijks vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2754476+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "tweewekelijks", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 7, - "Length": 13 - } - ] - }, - { - "Input": "Ik zal dagelijks vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2779449+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "dagelijks", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 7, - "Length": 9 - } - ] - }, - { - "Input": "Ik zal elke dag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2794445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke dag", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 7, - "Length": 8 - } - ] - }, - { - "Input": "Ik zal elke maand vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2829445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke maand", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 7, - "Length": 10 - } - ] - }, - { - "Input": "Ik zal jaarlijks vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2844439+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "jaarlijks", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 7, - "Length": 9 - } - ] - }, - { - "Input": "Ik zal elke twee dagen vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2909444+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke twee dagen", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 7, - "Length": 15 - } - ] - }, - { - "Input": "Ik zal elke 3 weken vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2959472+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke 3 weken", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "Ik zal 15.00 elke dag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2989494+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "15.00 elke dag", - "Type": "set", - "Value": { - "Timex": "T15:00", - "FutureResolution": { - "set": "Set: T15:00" - }, - "PastResolution": { - "set": "Set: T15:00" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Ik zal 15.00 iedere dag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3039501+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "15.00 iedere dag", - "Type": "set", - "Value": { - "Timex": "T15:00", - "FutureResolution": { - "set": "Set: T15:00" - }, - "PastResolution": { - "set": "Set: T15:00" - } - }, - "Start": 7, - "Length": 16 - } - ] - }, - { - "Input": "Ik zal elke 15/4 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3109498+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke 15/4", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 7, - "Length": 9 - } - ] - }, - { - "Input": "Ik zal iedere maandag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3259514+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere maandag", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Ik zal elke maandag 16.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3379507+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke maandag 16.00", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16:00", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16:00" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16:00" - } - }, - "Start": 7, - "Length": 18 - } - ] - }, - { - "Input": "Ik zal iedere ochtend vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3429518+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere ochtend", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Ik zal iedere ochtend om 9.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3609535+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere ochtend om 9.00", - "Type": "set", - "Value": { - "Timex": "T09:00", - "FutureResolution": { - "set": "Set: T09:00" - }, - "PastResolution": { - "set": "Set: T09:00" - } - }, - "Start": 7, - "Length": 22 - } - ] - }, - { - "Input": "Ik zal iedere middag om 16.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3730732+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere middag om 16.00", - "Type": "set", - "Value": { - "Timex": "T16:00", - "FutureResolution": { - "set": "Set: T16:00" - }, - "PastResolution": { - "set": "Set: T16:00" - } - }, - "Start": 7, - "Length": 23 - } - ] - }, - { - "Input": "Ik zal iedere avond om 21.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3840706+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere avond om 21.00", - "Type": "set", - "Value": { - "Timex": "T21:00", - "FutureResolution": { - "set": "Set: T21:00" - }, - "PastResolution": { - "set": "Set: T21:00" - } - }, - "Start": 7, - "Length": 21 - } - ] - }, - { - "Input": "Ik zal iedere avond om 21.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3930718+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere avond om 21.00", - "Type": "set", - "Value": { - "Timex": "T21:00", - "FutureResolution": { - "set": "Set: T21:00" - }, - "PastResolution": { - "set": "Set: T21:00" - } - }, - "Start": 7, - "Length": 21 - } - ] - }, - { - "Input": "Ik zal ochtenden om 9.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4065719+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "ochtenden om 9.00", - "Type": "set", - "Value": { - "Timex": "T09:00", - "FutureResolution": { - "set": "Set: T09:00" - }, - "PastResolution": { - "set": "Set: T09:00" - } - }, - "Start": 7, - "Length": 17 - } - ] - }, - { - "Input": "Ik zal op ochtenden om 9.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4170727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "op ochtenden om 9.00", - "Type": "set", - "Value": { - "Timex": "T09:00", - "FutureResolution": { - "set": "Set: T09:00" - }, - "PastResolution": { - "set": "Set: T09:00" - } - }, - "Start": 7, - "Length": 20 - } - ] - }, - { - "Input": "Ik zal om 9.00 iedere zondag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4295727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "9.00 iedere zondag", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09:00", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09:00" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09:00" - } - }, - "Start": 10, - "Length": 18 - } - ] - }, - { - "Input": "Ik zal om 9.00 op zondagen vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.438575+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "9.00 op zondagen", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09:00", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09:00" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09:00" - } - }, - "Start": 10, - "Length": 16 - } - ] - }, - { - "Input": "Ik zal zondagen 9.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4505726+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "zondagen 9.00", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09:00", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09:00" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09:00" - } - }, - "Start": 7, - "Length": 13 - } - ] - }, - { - "Input": "Ik zal op maandagen vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4570731+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "op maandagen", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "Ik zal op zondagen vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4635727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "op zondagen", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 7, - "Length": 11 - } - ] - }, - { - "Input": "Ik zal zondagen vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4710739+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "zondagen", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 7, - "Length": 8 - } - ] - }, - { - "Input": "Ik ga eenmaal per jaar op vakantie", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "eenmaal per jaar", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 6, - "Length": 16 - } - ] - }, - { - "Input": "Laten we eenmaal per week afspreken", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "eenmaal per week", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 9, - "Length": 16 - } - ] - }, - { - "Input": "Laten we vrijdag om de week afspreken", - "Comment": "The English counterpart is 'Every other Friday' and in Dutch the different structure (Friday every other week) prevents the case to be parsed.", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "vrijdag om de week", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-5", - "FutureResolution": { - "set": "Set: XXXX-WXX-5" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-5" - } - }, - "Start": 9, - "Length": 18 - } - ] - }, - { - "Input": "Laten we een driemaandelijkse meeting instellen", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "driemaandelijkse", - "Type": "set", - "Value": { - "Timex": "P3M", - "FutureResolution": { - "set": "Set: P3M" - }, - "PastResolution": { - "set": "Set: P3M" - } - }, - "Start": 13, - "Length": 16 - } - ] - }, - { - "Input": "Ik zal iedere dag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2794445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere dag", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 7, - "Length": 10 - } - ] - }, - { - "Input": "Ik zal iedere maand vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2829445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere maand", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "Ik zal iedere twee dagen vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2909444+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere twee dagen", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 7, - "Length": 17 - } - ] - }, - { - "Input": "Ik zal 15.00 iedere dag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2989494+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "15.00 iedere dag", - "Type": "set", - "Value": { - "Timex": "T15:00", - "FutureResolution": { - "set": "Set: T15:00" - }, - "PastResolution": { - "set": "Set: T15:00" - } - }, - "Start": 7, - "Length": 16 - } - ] - }, - { - "Input": "Ik zal 15.00 elke dag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3039501+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "15.00 elke dag", - "Type": "set", - "Value": { - "Timex": "T15:00", - "FutureResolution": { - "set": "Set: T15:00" - }, - "PastResolution": { - "set": "Set: T15:00" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Ik zal iedere 15/4 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3109498+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere 15/4", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 7, - "Length": 11 - } - ] - }, - { - "Input": "Ik zal elke maandag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3259514+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke maandag", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "Ik zal iedere maandag 16.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3379507+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iedere maandag 16.00", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16:00", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16:00" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16:00" - } - }, - "Start": 7, - "Length": 20 - } - ] - }, - { - "Input": "Ik zal elke ochtend vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3429518+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke ochtend", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "Ik zal elke ochtend om 9.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3609535+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke ochtend om 9.00", - "Type": "set", - "Value": { - "Timex": "T09:00", - "FutureResolution": { - "set": "Set: T09:00" - }, - "PastResolution": { - "set": "Set: T09:00" - } - }, - "Start": 7, - "Length": 20 - } - ] - }, - { - "Input": "Ik zal elke middag om 16.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3730732+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke middag om 16.00", - "Type": "set", - "Value": { - "Timex": "T16:00", - "FutureResolution": { - "set": "Set: T16:00" - }, - "PastResolution": { - "set": "Set: T16:00" - } - }, - "Start": 7, - "Length": 21 - } - ] - }, - { - "Input": "Ik zal elke avond om 21.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3840706+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke avond om 21.00", - "Type": "set", - "Value": { - "Timex": "T21:00", - "FutureResolution": { - "set": "Set: T21:00" - }, - "PastResolution": { - "set": "Set: T21:00" - } - }, - "Start": 7, - "Length": 19 - } - ] - }, - { - "Input": "Ik zal elke avond om 21.00 vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3930718+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "elke avond om 21.00", - "Type": "set", - "Value": { - "Timex": "T21:00", - "FutureResolution": { - "set": "Set: T21:00" - }, - "PastResolution": { - "set": "Set: T21:00" - } - }, - "Start": 7, - "Length": 19 - } - ] - }, - { - "Input": "Ik zal om 9.00 elke zondag vertrekken", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4295727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "9.00 elke zondag", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09:00", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09:00" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09:00" - } - }, - "Start": 10, - "Length": 16 - } - ] - }, - { - "Input": "Laten we vrijdag om de andere week afspreken", - "Comment": "The English counterpart is 'Every other Friday' and in Dutch the different structure (Friday every other week) prevents the case to be parsed.", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "vrijdag om de andere week", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-5", - "FutureResolution": { - "set": "Set: XXXX-WXX-5" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-5" - } - }, - "Start": 9, - "Length": 25 - } - ] - }, - { - "Input": "Laten we een kwartaal meeting instellen", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "kwartaal", - "Type": "set", - "Value": { - "Timex": "P3M", - "FutureResolution": { - "set": "Set: P3M" - }, - "PastResolution": { - "set": "Set: P3M" - } - }, - "Start": 13, - "Length": 8 - } - ] - }, - { - "Input": "Lees de beste artikelen op het gebied van Contoso via onze wekelijkse nieuwsbrief!", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "wekelijkse", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 59, - "Length": 10 - } - ] - }, - { - "Input": "Laten we een driemaandelijkse vergadering houden.", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "driemaandelijkse", - "Type": "set", - "Value": { - "Timex": "P3M", - "FutureResolution": { - "set": "Set: P3M" - }, - "PastResolution": { - "set": "Set: P3M" - } - }, - "Start": 13, - "Length": 16 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Dutch/TimeExtractor.json b/Specs/DateTime/Dutch/TimeExtractor.json index 135c4cb4c3..d365318fb2 100644 --- a/Specs/DateTime/Dutch/TimeExtractor.json +++ b/Specs/DateTime/Dutch/TimeExtractor.json @@ -9,7 +9,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om zeven uur terug", @@ -21,7 +21,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7 uur ‘s avonds terug", @@ -33,7 +33,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7:56 ‘s avonds terug", @@ -45,7 +45,7 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Ik ben om 7:56:35 ‘s avonds terug", @@ -57,7 +57,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 12:34 terug", @@ -69,7 +69,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 12:34:20 terug", @@ -81,7 +81,7 @@ "Length": 8 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om T12:34:20 terug", @@ -93,7 +93,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 00:00 terug", @@ -105,7 +105,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Ik ben om 00:00:30 terug", @@ -117,7 +117,7 @@ "Length": 8 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is 7 uur", @@ -129,7 +129,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is zeven uur", @@ -141,7 +141,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is 8 uur ‘s ochtends", @@ -153,7 +153,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is 8 uur ‘s nachts", @@ -165,7 +165,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is half negen", @@ -177,7 +177,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is kwart over acht", @@ -189,7 +189,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is kwart voor 10 ‘s avonds", @@ -201,7 +201,7 @@ "Length": 23 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is drie minuten voor acht", @@ -213,7 +213,7 @@ "Length": 22 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is half acht", @@ -225,7 +225,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Het is half acht ‘s avonds", @@ -237,7 +237,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is half acht ‘s ochtends", @@ -249,7 +249,7 @@ "Length": 21 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is kwart voor 8 in de ochtend", @@ -261,7 +261,7 @@ "Length": 26 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is 10 voor half negen in de avond", @@ -273,7 +273,7 @@ "Length": 30 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7 uur in de avond terug", @@ -285,7 +285,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7:00 ‘s avonds terug", @@ -297,7 +297,7 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Ik ben om 7:00:14 ‘s avonds terug", @@ -309,7 +309,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om vier uur ‘s middags terug", @@ -321,7 +321,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga terug om zeven uur dertig ‘s avonds", @@ -333,7 +333,7 @@ "Length": 26 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga terug om vier uur vijfendertig ‘s middags", @@ -345,7 +345,7 @@ "Length": 32 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om vijf over elf", @@ -357,7 +357,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om drie minuten voor vijf ", @@ -369,7 +369,7 @@ "Length": 22 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om half zes 's avonds", @@ -381,7 +381,7 @@ "Length": 18 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik kom middagloos terug", @@ -393,7 +393,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben ‘s middags terug", @@ -405,7 +405,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 12 uur ‘s middags terug", @@ -417,7 +417,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben tegen 11’en terug", @@ -429,7 +429,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Ik ben tegen 11-en terug", @@ -441,7 +441,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 340pm terug", @@ -453,7 +453,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 1140 a.m. terug", @@ -465,7 +465,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "middernacht", @@ -477,7 +477,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "mid morgen", @@ -489,7 +489,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "mid-morgen", @@ -501,7 +501,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "middag", @@ -513,7 +513,7 @@ "Length": 6 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "mid middag", @@ -525,7 +525,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "I'll be back 7 p m", @@ -537,7 +537,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7 uur p.m. terug", @@ -549,7 +549,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7:56 a m terug", @@ -561,7 +561,7 @@ "Length": 8 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7:56:35 a.m. terug", @@ -573,7 +573,7 @@ "Length": 12 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om 7:56:35 am", @@ -585,7 +585,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om 7:56:35 a. m.", @@ -597,7 +597,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om zeven uur dertig p.m.", @@ -609,7 +609,7 @@ "Length": 21 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 340 pm terug", @@ -621,7 +621,7 @@ "Length": 6 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 1140 a m terug", @@ -633,17 +633,17 @@ "Length": 8 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "welke emails hebben p als onderwerp gekregen", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "welke emails hebben een antwoord gehad", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 12 uur lunchtijd terug", @@ -655,7 +655,7 @@ "Length": 16 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben met lunchtijd 12 uur terug", @@ -667,11 +667,11 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 19:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:00", @@ -683,7 +683,7 @@ }, { "Input": "Ik ben om 19:56 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:56", @@ -695,7 +695,7 @@ }, { "Input": "Ik ben om 19:56:35 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:56:35", @@ -707,7 +707,7 @@ }, { "Input": "Ik ben om 12:34:20u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12:34:20u", @@ -719,7 +719,7 @@ }, { "Input": "Ik ben om 00:00:30 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "00:00:30", @@ -731,7 +731,7 @@ }, { "Input": "Het is 8 uur 's morgens", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8 uur 's morgens", @@ -743,7 +743,7 @@ }, { "Input": "Het is 8 uur 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8 uur 's avonds", @@ -755,7 +755,7 @@ }, { "Input": "Het is half negen 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half negen 's avonds", @@ -767,7 +767,7 @@ }, { "Input": "Het is kwart voor 10 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kwart voor 10 's avonds", @@ -779,7 +779,7 @@ }, { "Input": "Het is half acht 's morgens", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht 's morgens", @@ -791,7 +791,7 @@ }, { "Input": "Het is kwart voor 8 's morgens", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kwart voor 8 's morgens", @@ -803,7 +803,7 @@ }, { "Input": "Het is tien voor half 9 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien voor half 9 's avonds", @@ -815,7 +815,7 @@ }, { "Input": "Ik ga half acht 's avonds terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht 's avonds", @@ -827,7 +827,7 @@ }, { "Input": "Ik ga vijf over half acht 's avonds terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijf over half acht 's avonds", @@ -839,7 +839,7 @@ }, { "Input": "Ik ga vijf over elf terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijf over elf", @@ -851,7 +851,7 @@ }, { "Input": "Ik ga drie minuten voor half zes terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drie minuten voor half zes", @@ -863,7 +863,7 @@ }, { "Input": "Ik ga half zes 's avonds terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half zes 's avonds", @@ -875,7 +875,7 @@ }, { "Input": "Ik ga 's avonds half zes terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds half zes", @@ -887,7 +887,7 @@ }, { "Input": "Ik ben rond het middaguur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rond het middaguur", @@ -899,7 +899,7 @@ }, { "Input": "Ik ben het middaguur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het middaguur", @@ -911,7 +911,7 @@ }, { "Input": "Ik ben rond elven terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rond elven", @@ -923,7 +923,7 @@ }, { "Input": "Ik ben 15:40 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15:40", @@ -935,7 +935,7 @@ }, { "Input": "Ik ben 11:40 's morgens terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11:40 's morgens", @@ -947,7 +947,7 @@ }, { "Input": "halverwege de ochtend", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "halverwege de ochtend", @@ -959,7 +959,7 @@ }, { "Input": "halverwege de middag", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "halverwege de middag", @@ -971,7 +971,7 @@ }, { "Input": "het middaguur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het middaguur", @@ -983,7 +983,7 @@ }, { "Input": "Ik ben 19:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:00", @@ -995,7 +995,7 @@ }, { "Input": "Ik ben 7:56 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7:56", @@ -1007,7 +1007,7 @@ }, { "Input": "Ik ben 7:56:35 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7:56:35", @@ -1019,7 +1019,7 @@ }, { "Input": "Ik ben 12 uur lunchtijd terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 uur lunchtijd", @@ -1031,7 +1031,7 @@ }, { "Input": "Ik ben lunchtijd 12 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "lunchtijd 12 uur", @@ -1043,7 +1043,7 @@ }, { "Input": "Ik ben om lunchtijd 12 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "om lunchtijd 12 uur", @@ -1055,12 +1055,12 @@ }, { "Input": "Cortana, plan een vergadering voor volgende week.\nBentonville, AR 72716 P: 479.277", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "21:00 schikt me", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21:00", @@ -1072,7 +1072,7 @@ }, { "Input": "9:00 schikt me", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9:00", @@ -1084,7 +1084,7 @@ }, { "Input": "Ik ben om 21:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21:00", @@ -1096,7 +1096,7 @@ }, { "Input": "Ik ben om 9:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9:00", @@ -1109,12 +1109,12 @@ { "Input": "Dit product is geprijsd als 1.6714.", "Comment": "1 shouldn't recognized as time here", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "15.00 : Ik zal deze week weg zijn", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "15.00", @@ -1126,8 +1126,8 @@ }, { "Input": "deze week 8.00 zou een datumreeks en een tijd moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "8.00", @@ -1139,8 +1139,8 @@ }, { "Input": "deze week 20.00 zou een datumreeks en een tijd moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.00", @@ -1152,8 +1152,8 @@ }, { "Input": "week 10 20.00 zou een datumreeks en een tijd moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.00", @@ -1165,8 +1165,8 @@ }, { "Input": "week 10 10.20 zou een datumreeks en een tijd moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "10.20", @@ -1178,7 +1178,7 @@ }, { "Input": "De doeltijd is 20.10", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.10", diff --git a/Specs/DateTime/Dutch/TimeParser.json b/Specs/DateTime/Dutch/TimeParser.json index 8d3c930ea1..24cfd08473 100644 --- a/Specs/DateTime/Dutch/TimeParser.json +++ b/Specs/DateTime/Dutch/TimeParser.json @@ -18,7 +18,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " zet de wekker op tien over half negen ‘s ochtends", @@ -39,7 +39,7 @@ "Length": 32 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " zet de wekker op tien over half negen ‘s avonds", @@ -60,7 +60,7 @@ "Length": 30 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "zet de wekker op kwart voor elf", @@ -81,7 +81,7 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "zet de wekker op vijftien uur vijftien", @@ -102,7 +102,7 @@ "Length": 21 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "zet de wekker op vijftien uur dertig", @@ -123,7 +123,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "zet de wekker op tien over tien", @@ -144,7 +144,7 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "zet de wekker op vijf voor elf ‘s avonds", @@ -165,7 +165,7 @@ "Length": 23 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "ik ben om 7 uur terug", @@ -186,7 +186,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " ik ben er om 7 uur ‘s avonds", @@ -207,7 +207,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "ik ben om 7:56pm terug", @@ -228,7 +228,7 @@ "Length": 6 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "ik ben om 7:56:30pm terug", @@ -249,7 +249,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "ik ben om 7:56:30 pm terug", @@ -270,7 +270,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "ik ben om 12:34 terug", @@ -291,7 +291,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "ik ben om 12:34:25 terug", @@ -312,7 +312,7 @@ "Length": 8 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is 7 uur", @@ -333,7 +333,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is zeven uur", @@ -354,7 +354,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is 8 uur ‘s ochtends", @@ -375,7 +375,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is 8 uur ‘s avonds", @@ -396,7 +396,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is half negen", @@ -417,7 +417,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Het is half negen ‘s avonds", @@ -438,7 +438,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is kwart over acht", @@ -459,7 +459,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Het is kwart over acht", @@ -480,7 +480,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is kwart voor tien", @@ -501,7 +501,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is drie minuten voor acht", @@ -522,7 +522,7 @@ "Length": 22 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is half acht", @@ -543,7 +543,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is half acht ‘s avonds", @@ -564,7 +564,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is half acht ‘s ochtends", @@ -585,7 +585,7 @@ "Length": 21 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is kwart voor acht ‘s ochtends", @@ -606,7 +606,7 @@ "Length": 27 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Het is 20 minuten over acht in de avond", @@ -627,7 +627,7 @@ "Length": 32 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7 uur ‘s avonds terug", @@ -648,7 +648,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik kom 3 uur in de middag terug", @@ -669,7 +669,7 @@ "Length": 18 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7:00:05 ‘s avonds terug", @@ -690,7 +690,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7 uur 's avonds terug", @@ -711,7 +711,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om half acht ‘s avonds terug", @@ -732,7 +732,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om vijf over half acht ‘s avonds terug", @@ -753,7 +753,7 @@ "Length": 29 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om tien voor half twaalf ’s avonds", @@ -774,7 +774,7 @@ "Length": 31 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben rond de middag terug", @@ -795,7 +795,7 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 12 uur ‘s middags terug", @@ -816,7 +816,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben tegen 11’en terug", @@ -837,7 +837,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": " Ik ben tegen 11-en terug", @@ -858,7 +858,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 340pm terug", @@ -879,7 +879,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 1140 a.m. terug", @@ -900,7 +900,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "middernacht", @@ -921,7 +921,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "midmorgen", @@ -942,7 +942,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "halverwege de ochtend", @@ -963,7 +963,7 @@ "Length": 21 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "halverwege de middag", @@ -984,7 +984,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "middag", @@ -1005,7 +1005,7 @@ "Length": 6 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "12 uur ‘s middags", @@ -1026,7 +1026,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben met lunchtijd terug", @@ -1047,7 +1047,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om middernacht terug", @@ -1068,7 +1068,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 12 uur in de nacht terug", @@ -1089,7 +1089,7 @@ "Length": 18 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 1 uur terug", @@ -1110,7 +1110,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 12 uur lunchtijd terug", @@ -1131,7 +1131,7 @@ "Length": 16 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 1 uur lunchtijd terug", @@ -1152,7 +1152,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7:56:13 pm terug", @@ -1173,7 +1173,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "I'll ben om 12:34:45 terug", @@ -1194,7 +1194,7 @@ "Length": 8 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7:00:25 ‘s avonds terug", @@ -1215,7 +1215,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om zeven uur dertig ‘s ochtends terug", @@ -1236,7 +1236,7 @@ "Length": 28 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om vijf over elf", @@ -1257,7 +1257,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om drie minuten voor half zes", @@ -1278,7 +1278,7 @@ "Length": 26 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om half zes ’s avonds terug", @@ -1299,7 +1299,7 @@ "Length": 18 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben op de middag terug", @@ -1320,7 +1320,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 7h01 terug", @@ -1341,7 +1341,7 @@ "Length": 4 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben om 10 H 10 pm terug", @@ -1362,7 +1362,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om vijf over zes terug", @@ -1383,7 +1383,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om tien over zes terug", @@ -1404,7 +1404,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om kwart over zes terug", @@ -1425,7 +1425,7 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om tien voor half zeven terug", @@ -1446,7 +1446,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om vijf voor half zeven terug", @@ -1467,7 +1467,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om half zeven terug", @@ -1488,7 +1488,7 @@ "Length": 10 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om vijf over half zeven terug", @@ -1509,7 +1509,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om tien over half zeven terug", @@ -1530,7 +1530,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om kwart voor zeven terug", @@ -1551,7 +1551,7 @@ "Length": 16 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om tien voor zeven terug", @@ -1572,7 +1572,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ga om vijf voor zeven terug", @@ -1593,11 +1593,11 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "zet een alarm voor tien over half negen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien over half negen", @@ -1618,7 +1618,7 @@ }, { "Input": "zet een alarm voor tien over half negen 's morgens", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien over half negen 's morgens", @@ -1639,7 +1639,7 @@ }, { "Input": "zet een alarm voor tien over half negen 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien over half negen 's avonds", @@ -1660,7 +1660,7 @@ }, { "Input": "zet een alarm voor kwart voor elf", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kwart voor elf", @@ -1681,7 +1681,7 @@ }, { "Input": "zet een alarm voor kwart over drie 's middags", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kwart over drie 's middags", @@ -1702,7 +1702,7 @@ }, { "Input": "zet een alarm voor half vier 's middags", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half vier 's middags", @@ -1723,7 +1723,7 @@ }, { "Input": "zet een alarm voor tien over tien", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien over tien", @@ -1744,7 +1744,7 @@ }, { "Input": "zet een alarm voor vijf voor elf 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijf voor elf 's avonds", @@ -1765,7 +1765,7 @@ }, { "Input": "Ik ben om 7 u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7 u", @@ -1786,7 +1786,7 @@ }, { "Input": "Ik ben om zeven uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zeven uur", @@ -1807,7 +1807,7 @@ }, { "Input": "Ik ben om 19:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:00", @@ -1828,7 +1828,7 @@ }, { "Input": "Ik ben om 19:56 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:56", @@ -1849,7 +1849,7 @@ }, { "Input": "Ik ben om 19:56:30 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:56:30", @@ -1870,7 +1870,7 @@ }, { "Input": "Ik ben om 12:34 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12:34", @@ -1891,7 +1891,7 @@ }, { "Input": "Ik ben om 12:34:25 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12:34:25", @@ -1912,7 +1912,7 @@ }, { "Input": "Het is 8 uur 's morgens", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8 uur 's morgens", @@ -1933,7 +1933,7 @@ }, { "Input": "Het is 8 uur 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8 uur 's avonds", @@ -1954,7 +1954,7 @@ }, { "Input": "Het is half 9 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half 9 's avonds", @@ -1975,7 +1975,7 @@ }, { "Input": "Het is kwart voor 10 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kwart voor 10 's avonds", @@ -1996,7 +1996,7 @@ }, { "Input": "Het is half acht 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht 's avonds", @@ -2017,7 +2017,7 @@ }, { "Input": "Het is half acht 's ochtends", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht 's ochtends", @@ -2038,7 +2038,7 @@ }, { "Input": "Het is kwart voor 8 's ochtends", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "kwart voor 8 's ochtends", @@ -2059,7 +2059,7 @@ }, { "Input": "Het is 10 voor half negen 's avonds", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10 voor half negen 's avonds", @@ -2080,7 +2080,7 @@ }, { "Input": "Ik ben 7 uur 's avonds terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7 uur 's avonds", @@ -2101,7 +2101,7 @@ }, { "Input": "Ik ben 's avonds 7 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds 7 uur", @@ -2122,7 +2122,7 @@ }, { "Input": "Ik ben 's avonds 7:00 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds 7:00", @@ -2143,7 +2143,7 @@ }, { "Input": "Ik ben 's avonds 7:00:05 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds 7:00:05", @@ -2164,7 +2164,7 @@ }, { "Input": "Ik ben 's avonds zeven uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds zeven uur", @@ -2185,7 +2185,7 @@ }, { "Input": "Ik ga half acht 's avonds terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht 's avonds", @@ -2206,7 +2206,7 @@ }, { "Input": "Ik ga vijf over half acht 's avonds terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijf over half acht 's avonds", @@ -2227,7 +2227,7 @@ }, { "Input": "Ik ga tien voor half twaalf 's avonds terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien voor half twaalf 's avonds", @@ -2248,7 +2248,7 @@ }, { "Input": "Ik ben rond het middaguur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rond het middaguur", @@ -2269,7 +2269,7 @@ }, { "Input": "Ik ben rond elven terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "rond elven", @@ -2290,7 +2290,7 @@ }, { "Input": "Ik ben 15:40 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15:40", @@ -2311,7 +2311,7 @@ }, { "Input": "Ik ben 11:40 's morgens terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11:40 's morgens", @@ -2332,7 +2332,7 @@ }, { "Input": "het middaguur", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het middaguur", @@ -2353,7 +2353,7 @@ }, { "Input": "Ik ben 12 uur lunchtijd terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 uur lunchtijd", @@ -2374,7 +2374,7 @@ }, { "Input": "Ik ben 12 uur middernacht terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 uur middernacht", @@ -2395,7 +2395,7 @@ }, { "Input": "Ik ben 12 uur 's nachts terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12 uur 's nachts", @@ -2416,7 +2416,7 @@ }, { "Input": "Ik ben 1 uur middernacht terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 uur middernacht", @@ -2437,7 +2437,7 @@ }, { "Input": "Ik ben 11 uur lunchtijd terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11 uur lunchtijd", @@ -2458,7 +2458,7 @@ }, { "Input": "Ik ben 1 uur lunchtijd terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1 uur lunchtijd", @@ -2479,7 +2479,7 @@ }, { "Input": "Ik ben om lunchtijd 11 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "om lunchtijd 11 uur", @@ -2500,7 +2500,7 @@ }, { "Input": "Ik ben 19:56:13 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "19:56:13", @@ -2521,7 +2521,7 @@ }, { "Input": "Ik ben 12:34:45 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12:34:45", @@ -2542,7 +2542,7 @@ }, { "Input": "Ik ben 's avonds 7:00:25 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds 7:00:25", @@ -2563,7 +2563,7 @@ }, { "Input": "Ik ga half acht 's morgens terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half acht 's morgens", @@ -2584,7 +2584,7 @@ }, { "Input": "Ik ga vijf over elf terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijf over elf", @@ -2605,7 +2605,7 @@ }, { "Input": "Ik ga drie minuten voor half zes terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drie minuten voor half zes", @@ -2626,7 +2626,7 @@ }, { "Input": "Ik ga half zes 's avonds terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "half zes 's avonds", @@ -2647,7 +2647,7 @@ }, { "Input": "Ik ga 's avonds half zes terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds half zes", @@ -2668,7 +2668,7 @@ }, { "Input": "Ik ben het middaguur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "het middaguur", @@ -2689,7 +2689,7 @@ }, { "Input": "Ik ben om lunchtijd 12 uur terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "om lunchtijd 12 uur", @@ -2710,7 +2710,7 @@ }, { "Input": "Ik ben om 7:01u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7:01u", @@ -2731,7 +2731,7 @@ }, { "Input": "Ik ben om 22:10u terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22:10u", @@ -2752,7 +2752,7 @@ }, { "Input": "Ik ben om drie minuten na 22:10 terug", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drie minuten na 22:10", @@ -2773,7 +2773,7 @@ }, { "Input": "15.00 : Ik zal op deze week weg zijn", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "15.00", @@ -2794,8 +2794,8 @@ }, { "Input": "deze week 8.00 zou een datumreeks en een tijd moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "8.00", @@ -2816,8 +2816,8 @@ }, { "Input": "deze week 20.00 zou een datumreeks en een tijd moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.00", @@ -2838,8 +2838,8 @@ }, { "Input": "week 10 20.00 zou een datumreeks en een tijd moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.00", @@ -2860,8 +2860,8 @@ }, { "Input": "week 10 10.20 zou een datumreeks en een tijd moeten zijn", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "10.20", @@ -2882,7 +2882,7 @@ }, { "Input": "De doeltijd is 20.10", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "20.10", diff --git a/Specs/DateTime/Dutch/TimePeriodExtractor.json b/Specs/DateTime/Dutch/TimePeriodExtractor.json index dfbd25689a..05411881cb 100644 --- a/Specs/DateTime/Dutch/TimePeriodExtractor.json +++ b/Specs/DateTime/Dutch/TimePeriodExtractor.json @@ -9,7 +9,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 17:00 tot 18:00", @@ -21,7 +21,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 17:00 tot 18:00 uur", @@ -33,7 +33,7 @@ "Length": 23 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 5 tot 6 ʼs middags", @@ -45,7 +45,7 @@ "Length": 22 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 5 tot zeven in de ochtend", @@ -57,7 +57,7 @@ "Length": 29 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 5:00 tot 6:00PM", @@ -69,7 +69,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg tussen 5 en 6PM", @@ -81,7 +81,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg tussen 5PM en 6PM", @@ -93,7 +93,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg tussen 5 en 6 ʼs middags", @@ -105,7 +105,7 @@ "Length": 24 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg 4pm tot 5pm", @@ -117,7 +117,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg 4-5pm", @@ -129,7 +129,7 @@ "Length": 5 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg 4:00 tot 5pm", @@ -141,7 +141,7 @@ "Length": 12 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg 4:00-5pm", @@ -153,7 +153,7 @@ "Length": 8 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 4:00 tot 7 uur", @@ -165,7 +165,7 @@ "Length": 18 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 3pm tot half acht ", @@ -177,7 +177,7 @@ "Length": 21 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 4pm-5pm", @@ -189,7 +189,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg 4pm - 5pm", @@ -201,7 +201,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg 16:00 – 17:00", @@ -213,7 +213,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 16:00–17:00", @@ -225,7 +225,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 16:00 – 17:00", @@ -237,7 +237,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg 16:00–17:00", @@ -249,7 +249,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg 20 minuten voor drie tot acht ʼs avonds", @@ -261,7 +261,7 @@ "Length": 39 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 4 pm tot 5 pm", @@ -273,7 +273,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 4pm tot half zes", @@ -285,7 +285,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 16:00 tot 17:00", @@ -297,7 +297,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 16:00 tot half zes", @@ -309,7 +309,7 @@ "Length": 22 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 3 uur in de ochtend tot 5pm", @@ -321,7 +321,7 @@ "Length": 31 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg van 3 uur in de ochtend tot vijf uur in de middag", @@ -333,7 +333,7 @@ "Length": 49 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg tussen 16:00 uur en half zes", @@ -345,7 +345,7 @@ "Length": 28 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Ik ben weg tussen 3 uur in de ochtend en 17:00 uur", @@ -357,7 +357,7 @@ "Length": 39 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we in de ochtend afspreken", @@ -369,7 +369,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we in de middag afspreken", @@ -381,7 +381,7 @@ "Length": 12 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we in de avond afspreken ", @@ -393,7 +393,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we ʼs avonds afspreken ", @@ -405,7 +405,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we in de nacht afspreken ", @@ -417,7 +417,7 @@ "Length": 11 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we ʼs nachts afspreken ", @@ -429,7 +429,7 @@ "Length": 9 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we in de avonden afspreken", @@ -441,7 +441,7 @@ "Length": 13 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we in de vroege ochtenden afspreken", @@ -453,7 +453,7 @@ "Length": 22 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we in de late ochtenden afspreken", @@ -465,7 +465,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we vroeg in de ochtend afspreken", @@ -477,7 +477,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we laat in de ochtend afspreken", @@ -489,7 +489,7 @@ "Length": 18 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we vroeg in de middag afspreken", @@ -501,7 +501,7 @@ "Length": 18 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we laat in de middag afspreken", @@ -513,7 +513,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we vroeg in de avond afspreken", @@ -525,7 +525,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we laat in de avond afspreken", @@ -537,7 +537,7 @@ "Length": 16 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we vroeg in de nacht afspreken", @@ -549,7 +549,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we ʼs nachts laat afspreken", @@ -561,7 +561,7 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "laten we ʼs nachts vroeg afspreken", @@ -573,7 +573,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken van twee tot vijf ʼs middags", @@ -585,7 +585,7 @@ "Length": 28 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Feestje bij Jean van 18:00 tot 23:00 uur", @@ -597,7 +597,7 @@ "Length": 23 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken van 14:00 tot 16:30", @@ -609,7 +609,7 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken van twee tot vijf in de middag", @@ -621,7 +621,7 @@ "Length": 30 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken van 1 uur ʼs middags tot 4", @@ -633,7 +633,7 @@ "Length": 26 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken van 1 uur in de middag tot 4.", @@ -645,7 +645,7 @@ "Length": 28 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken van 13:30 tot 4!", @@ -657,7 +657,7 @@ "Length": 15 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken van 13:30 uur tot 4!", @@ -669,22 +669,22 @@ "Length": 19 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken 13:30 voor 4 personen", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken 13:30 uur voor 4 personen", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "afspraak maken om 13:30 uur voor 4 personen", "Results": [], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Hi Cortana- Maak alsjeblieft een skype afspraak met Jennifer. Ik heb een afspraak van 30 minuten in de middag nodig, deze vrijdag zal ik vertrekken.", @@ -696,7 +696,7 @@ "Length": 12 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "Hi Cortana- Maak alsjeblieft een skype afspraak met Jennifer. Ik heb vrijdag een afspraak van 30 minuten nodig, in de middag zal ik vertrekken.", @@ -708,7 +708,7 @@ "Length": 12 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "maak afspraak van 1:30 tot 3:30", @@ -720,7 +720,7 @@ "Length": 17 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "maak afspraak van 1:30 pm tot 3:30", @@ -732,7 +732,7 @@ "Length": 20 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "maak afspraak van 1:30 pm tot 3:30 pm", @@ -744,7 +744,7 @@ "Length": 23 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "maak afspraak van 1 tot 3:30", @@ -756,7 +756,7 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "maak afspraak van 1:30 tot 3", @@ -768,11 +768,12 @@ "Length": 14 } ], - "NotSupportedByDesign": "javascript,python,java" + "NotSupportedByDesign": "javascript,java" }, { "Input": "maak afspraak tussen 10 en 11:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 10 en 11:30", @@ -784,7 +785,8 @@ }, { "Input": "maak afspraak tussen 10:10am en 12:50", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 10:10am en 12:50", @@ -796,7 +798,8 @@ }, { "Input": "maak afspraak tussen 10:10pm en 3", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 10:10pm en 3", @@ -808,7 +811,7 @@ }, { "Input": "maak afspraak van 22:10 tot 10", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 22:10 tot 10", @@ -820,7 +823,7 @@ }, { "Input": "maak afspraak van 10:30am tot 23", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10:30am tot 23", @@ -832,7 +835,7 @@ }, { "Input": "Ik ben 5 tot 18:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 tot 18:00", @@ -844,7 +847,7 @@ }, { "Input": "Ik ben 5 tot 6 's middags weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 tot 6 's middags", @@ -856,7 +859,7 @@ }, { "Input": "Ik ben 5 tot zeven uur 's morgens weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 tot zeven uur 's morgens", @@ -868,7 +871,7 @@ }, { "Input": "Ik ben van 5 tot 18:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 18:00", @@ -880,7 +883,7 @@ }, { "Input": "Ik ben tussen 5 en 18:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 5 en 18:00", @@ -892,7 +895,7 @@ }, { "Input": "Ik ben tussen 17:00 en 18:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 17:00 en 18:00", @@ -904,7 +907,7 @@ }, { "Input": "Ik ben tussen 5 en 6 's middags weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 5 en 6 's middags", @@ -916,7 +919,7 @@ }, { "Input": "Ik ben 16:00 tot 17:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16:00 tot 17:00", @@ -928,7 +931,7 @@ }, { "Input": "Ik ben 4 tot 17:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4 tot 17:00", @@ -940,7 +943,7 @@ }, { "Input": "Ik ben 4:00 tot 17:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4:00 tot 17:00", @@ -952,7 +955,7 @@ }, { "Input": "Ik ben 4:00 tot 7 uur weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4:00 tot 7 uur", @@ -964,7 +967,7 @@ }, { "Input": "Ik ben 15:00 tot half acht weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15:00 tot half acht", @@ -976,7 +979,7 @@ }, { "Input": "Ik ben 16:00-17:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16:00-17:00", @@ -988,7 +991,7 @@ }, { "Input": "Ik ben tien over half drie tot acht uur 's avonds weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tien over half drie tot acht uur 's avonds", @@ -1000,7 +1003,7 @@ }, { "Input": "Ik ben van 16:00 tot 17:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 tot 17:00", @@ -1012,7 +1015,7 @@ }, { "Input": "Ik ben van 16:00 tot half zes weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 tot half zes", @@ -1024,7 +1027,7 @@ }, { "Input": "Ik ben van 3 uur 's ochtends tot 17:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3 uur 's ochtends tot 17:00", @@ -1036,7 +1039,7 @@ }, { "Input": "Ik ben van 3 uur 's ochtends tot vijf uur 's middags weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3 uur 's ochtends tot vijf uur 's middags", @@ -1048,7 +1051,7 @@ }, { "Input": "Ik ben tussen 16:00 en half zes weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 16:00 en half zes", @@ -1060,7 +1063,7 @@ }, { "Input": "Ik ben tussen 3 uur 's ochtends en 17:00 weg", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 uur 's ochtends en 17:00", @@ -1072,7 +1075,7 @@ }, { "Input": "laten we 's ochtends afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s ochtends", @@ -1084,7 +1087,7 @@ }, { "Input": "laten we 's middags afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s middags", @@ -1096,7 +1099,7 @@ }, { "Input": "laten we 's nachts afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s nachts", @@ -1108,7 +1111,7 @@ }, { "Input": "laten we 's avonds afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds", @@ -1120,7 +1123,7 @@ }, { "Input": "laten we vroeg in de ochtenden afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vroeg in de ochtenden", @@ -1132,7 +1135,7 @@ }, { "Input": "laten we laat in de ochtenden afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laat in de ochtenden", @@ -1144,7 +1147,7 @@ }, { "Input": "laten we laat in de nacht afspreken", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "laat in de nacht", @@ -1156,7 +1159,7 @@ }, { "Input": "regel een meeting van twee tot vijf uur 's middags", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van twee tot vijf uur 's middags", @@ -1168,7 +1171,7 @@ }, { "Input": "Feest bij Jean van 6 tot 23:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 6 tot 23:00", @@ -1180,7 +1183,7 @@ }, { "Input": "regel meeting van 14:00 tot 16:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 14:00 tot 16:30", @@ -1192,7 +1195,7 @@ }, { "Input": "regel meeting van twee tot vijf 's middags", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van twee tot vijf 's middags", @@ -1204,7 +1207,7 @@ }, { "Input": "regel meeting 13:00 tot 16:00", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13:00 tot 16:00", @@ -1216,7 +1219,7 @@ }, { "Input": "regel meeting 13:00 tot 16:00.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13:00 tot 16:00", @@ -1228,7 +1231,7 @@ }, { "Input": "regel meeting 13:30 tot 4!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "13:30 tot 4", @@ -1240,12 +1243,12 @@ }, { "Input": "regel meeting 13:30 tot 4 mensen", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Hoi Cortana- plan alsjeblieft een Skypemeeting met Jennifer. Ik heb een meeting van 30 min 's middags nodig, deze vrijdag vertrek ik.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s middags", @@ -1257,7 +1260,7 @@ }, { "Input": "Hoi Cortana- plan alsjeblieft een Skypemeeting met Jennifer. Ik heb een meeting van 30 min in de middag nodig, deze vrijdag vertrek ik.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de middag", @@ -1269,7 +1272,7 @@ }, { "Input": "regel meeting van 1:30 tot 3:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1:30 tot 3:30", @@ -1281,7 +1284,7 @@ }, { "Input": "regel meeting van 13:30 tot 3:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 13:30 tot 3:30", @@ -1293,7 +1296,7 @@ }, { "Input": "regel meeting van 13:30 tot 15:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 13:30 tot 15:30", @@ -1305,7 +1308,7 @@ }, { "Input": "regel meeting van 1 tot 3:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1 tot 3:30", @@ -1317,7 +1320,7 @@ }, { "Input": "regel meeting van 1:30 tot 3", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1:30 tot 3", @@ -1329,7 +1332,8 @@ }, { "Input": "regel meeting tussen 10 en 11:30", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 10 en 11:30", @@ -1341,7 +1345,8 @@ }, { "Input": "regel meeting tussen 10:10 en 12:50", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 10:10 en 12:50", @@ -1353,7 +1358,8 @@ }, { "Input": "regel meeting tussen 22:10 en 3", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "tussen 22:10 en 3", @@ -1365,7 +1371,7 @@ }, { "Input": "regel meeting van 22:10 tot 10", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 22:10 tot 10", @@ -1377,7 +1383,7 @@ }, { "Input": "regel meeting van 10:30 tot 23", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10:30 tot 23", @@ -1389,7 +1395,7 @@ }, { "Input": "bel me niet tijdens kantooruren", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tijdens kantooruren", @@ -1401,7 +1407,7 @@ }, { "Input": "Ik zal lunchtijd weg zijn.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "lunchtijd", @@ -1413,8 +1419,8 @@ }, { "Input": "Hij heeft lunchpauze", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "lunchpauze", @@ -1426,8 +1432,8 @@ }, { "Input": "Dit populaire, familievriendelijke concert komt terug naar de Hall voor weer een lunchconcert vol met traditionele kerstliederen en feestfavorieten", - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "lunchconcert", diff --git a/Specs/DateTime/Dutch/TimePeriodParser.json b/Specs/DateTime/Dutch/TimePeriodParser.json index f514780dfb..664f92c9cd 100644 --- a/Specs/DateTime/Dutch/TimePeriodParser.json +++ b/Specs/DateTime/Dutch/TimePeriodParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 tot 18:00", @@ -30,7 +30,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 tot 6 's avonds", @@ -56,7 +56,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5 tot zeven 's morgens", @@ -82,7 +82,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 18:00", @@ -108,7 +108,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 5 tot 6 in de avond", @@ -134,7 +134,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 5 en 6 's avonds", @@ -160,7 +160,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 17:00 en 18:00", @@ -186,7 +186,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 5 en 6 's middags", @@ -212,7 +212,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1:00 tot 17:00", @@ -238,7 +238,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 16:00 tot 17:00", @@ -264,7 +264,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 4 tot 5 's avonds", @@ -290,7 +290,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4:00 tot 7 uur", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16:00-17:00", @@ -342,7 +342,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "16:00 - 17:00", @@ -368,7 +368,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3 uur 's ochtends tot 17:00", @@ -394,7 +394,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 3 uur 's ochtends en 17:00", @@ -420,7 +420,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 16:00 en 17:00", @@ -446,7 +446,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s ochtends", @@ -472,7 +472,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s middags", @@ -498,7 +498,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s nachts", @@ -524,7 +524,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "'s avonds", @@ -550,7 +550,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de avonden", @@ -576,7 +576,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de vroege morgens", @@ -603,7 +603,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de late morgens", @@ -630,7 +630,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de vroege morgen", @@ -657,7 +657,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de late morgen", @@ -684,7 +684,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de vroege middag", @@ -711,7 +711,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de late middag", @@ -738,7 +738,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de vroege avond", @@ -765,7 +765,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de late avond", @@ -792,7 +792,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de vroege nacht", @@ -819,7 +819,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "in de late nacht", @@ -846,7 +846,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1 's middags tot 4", @@ -872,7 +872,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 13:00 tot 4", @@ -898,9 +898,9 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "dotnet", + "NotSupported": "dotnet,python", "Comment": "Not supported because the extraction is not at the end of the Input", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 13:00 tot 4", @@ -926,7 +926,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1:30 's middags tot 4", @@ -952,7 +952,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 13:30 tot 4", @@ -978,9 +978,9 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "dotnet", + "NotSupported": "dotnet,python", "Comment": "Not supported because the extraction is not at the end of the Input", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 13:30 tot 4", @@ -1006,7 +1006,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "de ochtend", @@ -1032,7 +1032,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1:30 tot 3", @@ -1058,7 +1058,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 11:00 tot 3", @@ -1084,7 +1084,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 23:00 tot 3", @@ -1110,7 +1110,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 23:01 tot 11", @@ -1136,7 +1136,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 11:01 's ochtends tot 11", @@ -1162,7 +1162,8 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van 11:01 tot 11", @@ -1188,7 +1189,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 11:00 tot 11:50", @@ -1214,7 +1215,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1:30 's middags tot 3:30", @@ -1240,7 +1241,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 13:30 tot 3:30", @@ -1266,7 +1267,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 13:30 tot 15:30", @@ -1292,7 +1293,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 15:00 tot 15:30", @@ -1318,7 +1319,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 0:01 tot 13:00", @@ -1344,7 +1345,8 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "", "Results": [ { "Text": "van 0:01 's ochtends tot 1", @@ -1370,7 +1372,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 0:01 tot 1", @@ -1396,7 +1398,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 3 tot 3:30", @@ -1422,7 +1424,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1:30 tot 3", @@ -1448,7 +1450,8 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "van 1:30 tot 3 's middags", @@ -1474,7 +1477,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 1:30 tot 15:00", @@ -1500,7 +1503,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 11 tot 15:00", @@ -1526,7 +1529,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 11 tot 11:50", @@ -1552,7 +1555,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 11 tot 3 's ochtends", @@ -1578,7 +1581,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10 tot 11:00", @@ -1604,7 +1607,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 23 tot 3:00", @@ -1630,7 +1633,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 23 tot 15:00", @@ -1656,7 +1659,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 10 en 11:30", @@ -1682,7 +1685,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 10:10 en 12:50", @@ -1708,7 +1711,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tussen 22:10 en 3", @@ -1734,7 +1737,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 22:10 tot 10", @@ -1760,7 +1763,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "van 10:30 tot 23", @@ -1786,7 +1789,8 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", + "NotSupported": "python", "Results": [ { "Text": "tijdens de werkuren", @@ -1813,7 +1817,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "lunchtijd", @@ -1839,8 +1843,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "lunchpauze", @@ -1866,8 +1870,8 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "java, javascript, python", + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "lunchconcert", diff --git a/Specs/DateTime/Dutch/TimeZoneParser.json b/Specs/DateTime/Dutch/TimeZoneParser.json deleted file mode 100644 index 50aa63bd72..0000000000 --- a/Specs/DateTime/Dutch/TimeZoneParser.json +++ /dev/null @@ -1,420 +0,0 @@ -[ - { - "Input": "Boek een kamer in Beijing tijd", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Beijing tijd", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 18, - "Length": 12 - } - ] - }, - { - "Input": "Boek een kamer voor mij om UTC4:30", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "UTC4:30", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 27, - "Length": 7 - } - ] - }, - { - "Input": "Reserveer een kamer om gmt-3", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "gmt-3", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-03:00", - "UtcOffsetMins": -180 - } - }, - "Start": 23, - "Length": 5 - } - ] - }, - { - "Input": "Reserveer een kamer in de standaardtijd van afghanistan", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "standaardtijd van afghanistan", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 26, - "Length": 29 - } - ] - }, - { - "Input": "Reserveer een kamer in de middag", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "in de middag", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 20, - "Length": 12 - } - ] - }, - { - "Input": "boek me een kamer rond utc 0", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "utc 0", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+00:00", - "UtcOffsetMins": 0 - } - }, - "Start": 23, - "Length": 5 - } - ] - }, - { - "Input": "boek me een kamer in PDST", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "PDST", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 21, - "Length": 4 - } - ] - }, - { - "Input": "boek me een kamer in AWDT", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "AWDT", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 21, - "Length": 4 - } - ] - }, - { - "Input": "boek me een kamer in COT", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "COT", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 21, - "Length": 3 - } - ] - }, - { - "Input": "boek me een kamer in hkt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "hkt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 21, - "Length": 3 - } - ] - }, - { - "Input": "boek me een kamer in pacific daylight saving time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "pacific daylight saving time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 21, - "Length": 28 - } - ] - }, - { - "Input": "boek me een kamer in austrialian western daylight tijd", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "austrialian western daylight tijd", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 21, - "Length": 33 - } - ] - }, - { - "Input": "boek me een kamer in austrialian west daylight tijd", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "austrialian west daylight tijd", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 21, - "Length": 30 - } - ] - }, - { - "Input": "boek me een kamer in colombia tijd", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "colombia tijd", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 21, - "Length": 13 - } - ] - }, - { - "Input": "boek me een kamer in hong kong tijd", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "hong kong tijd", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 21, - "Length": 14 - } - ] - }, - { - "Input": "boek me een kamer in aedt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "aedt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+11:00", - "UtcOffsetMins": 660 - } - }, - "Start": 21, - "Length": 4 - } - ] - }, - { - "Input": "boek me een kamer in PDT", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "PDT", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 21, - "Length": 3 - } - ] - }, - { - "Input": "boek me een kamer in TOST", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "TOST", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+14:00", - "UtcOffsetMins": 840 - } - }, - "Start": 21, - "Length": 4 - } - ] - }, - { - "Input": "boek me een kamer in pacific daylight tijd", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "pacific daylight tijd", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 21, - "Length": 21 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/English/DateExtractor.json b/Specs/DateTime/English/DateExtractor.json index 7195b9bb60..82f4a64acd 100644 --- a/Specs/DateTime/English/DateExtractor.json +++ b/Specs/DateTime/English/DateExtractor.json @@ -23,7 +23,7 @@ }, { "Input": "i'll go back april22", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "april22", @@ -35,7 +35,7 @@ }, { "Input": "i'll go back 22april", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "22april", @@ -91,7 +91,7 @@ }, { "Input": "i'll go back january12,2016", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "january12,2016", @@ -470,7 +470,7 @@ }, { "Input": "i'll go back tmrw", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "tmrw", @@ -515,7 +515,7 @@ }, { "Input": "i'll go back the day after tmrw", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "the day after tmrw", @@ -745,6 +745,110 @@ } ] }, + { + "Input": "I'll go back on April first 2021.", + "NotSupported": "javascript", + "Results": [ + { + "Text": "April first 2021", + "Type": "date", + "Start": 16, + "Length": 16 + } + ] + }, + { + "Input": "I'll go back Jun third 2023", + "NotSupported": "javascript", + "Results": [ + { + "Text": "Jun third 2023", + "Type": "date", + "Start": 13, + "Length": 14 + } + ] + }, + { + "Input": "I'll go back September the second 2025.", + "NotSupported": "javascript", + "Results": [ + { + "Text": "September the second 2025", + "Type": "date", + "Start": 13, + "Length": 25 + } + ] + }, + { + "Input": "I'll go back March one 2020", + "NotSupported": "javascript", + "Results": [ + { + "Text": "March one 2020", + "Type": "date", + "Start": 13, + "Length": 14 + } + ] + }, + { + "Input": "I'll go back Aug twelve 2024.", + "NotSupported": "javascript", + "Results": [ + { + "Text": "Aug twelve 2024", + "Type": "date", + "Start": 13, + "Length": 15 + } + ] + }, + { + "Input": "I'll go back February twenty fifth", + "Results": [ + { + "Text": "February twenty fifth", + "Type": "date", + "Start": 13, + "Length": 21 + } + ] + }, + { + "Input": "I'll go back on Nov the twelfth.", + "Results": [ + { + "Text": "Nov the twelfth", + "Type": "date", + "Start": 16, + "Length": 15 + } + ] + }, + { + "Input": "I'll go back January thirty one", + "Results": [ + { + "Text": "January thirty one", + "Type": "date", + "Start": 13, + "Length": 18 + } + ] + }, + { + "Input": "I'll go back Oct twenty three.", + "Results": [ + { + "Text": "Oct twenty three", + "Type": "date", + "Start": 13, + "Length": 16 + } + ] + }, { "Input": "i went back two months ago", "Results": [ @@ -1285,7 +1389,7 @@ "NotSupported": "javascript, python", "Results": [ { - "Text": "the 20th next month", + "Text": "20th next month", "Type": "date", "Start": 12, "Length": 19 @@ -1329,7 +1433,7 @@ }, { "Input": "on september the twenty-first nineteen seventy eight", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "september the twenty-first nineteen seventy eight", @@ -1341,7 +1445,7 @@ }, { "Input": "on september 10, nineteen zero one", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "september 10, nineteen zero one", @@ -1353,7 +1457,7 @@ }, { "Input": "on the tenth of september, two thousand", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "tenth of september, two thousand", @@ -1620,7 +1724,7 @@ }, { "Input": "i'll go back twenty second of june 2017", - "NotSupported": "python,javascript", + "NotSupported": "javascript", "Results": [ { "Text": "twenty second of june 2017", @@ -1632,7 +1736,7 @@ }, { "Input": "i'll go back twenty-second of june 2017", - "NotSupported": "python,javascript", + "NotSupported": "javascript", "Results": [ { "Text": "twenty-second of june 2017", @@ -1680,5 +1784,115 @@ "Length": 17 } ] + }, + { + "Input": "Book me a trip on Monday 8th", + "Results": [ + { + "Text": "Monday 8th", + "Type": "date", + "Start": 18, + "Length": 10 + } + ] + }, + { + "Input": "the photograph appeared in the 01/07 issue of the magazine", + "Results": [ + { + "Text": "the 01/07", + "Type": "date", + "Start": 27, + "Length": 9 + } + ] + }, + { + "Input": "the contract is expected to start on 10/11", + "Results": [ + { + "Text": "10/11", + "Type": "date", + "Start": 37, + "Length": 5 + } + ] + }, + { + "Input": "the software used in the 11/3/2020 election can be easily hacked", + "Results": [ + { + "Text": "the 11/3/2020", + "Type": "date", + "Start": 21, + "Length": 13 + } + ] + }, + { + "Input": "this article was published on 06/10/2020", + "Results": [ + { + "Text": "06/10/2020", + "Type": "date", + "Start": 30, + "Length": 10 + } + ] + }, + { + "Input": "I was born on January eleventh nineteen seventy-four", + "Results": [ + { + "Text": "january eleventh nineteen seventy-four", + "Type": "date", + "Start": 14, + "Length": 38 + } + ] + }, + { + "Input": "Aliens will land on earth on the fourth of july twenty twenty-seven", + "Results": [ + { + "Text": "fourth of july twenty twenty-seven", + "Type": "date", + "Start": 33, + "Length": 34 + } + ] + }, + { + "Input": "My car insurance expires on June first twenty twenty", + "Results": [ + { + "Text": "june first twenty twenty", + "Type": "date", + "Start": 28, + "Length": 24 + } + ] + }, + { + "Input": "Is there anything for March the second twenty fourteen", + "Results": [ + { + "Text": "march the second twenty fourteen", + "Type": "date", + "Start": 22, + "Length": 32 + } + ] + }, + { + "Input": "Do you remember the twenty-second of july nineteen forty-eight", + "Results": [ + { + "Text": "twenty-second of july nineteen forty-eight", + "Type": "date", + "Start": 20, + "Length": 42 + } + ] } ] diff --git a/Specs/DateTime/English/DateParser.json b/Specs/DateTime/English/DateParser.json index e3b3bf72ff..c01ea96a87 100644 --- a/Specs/DateTime/English/DateParser.json +++ b/Specs/DateTime/English/DateParser.json @@ -73,7 +73,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "Oct2", @@ -143,7 +143,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "October2", @@ -728,6 +728,218 @@ } ] }, + { + "Input": "I'll go back on April first 2021.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "April first 2021", + "Type": "date", + "Value": { + "Timex": "2021-04-01", + "FutureResolution": { + "date": "2021-04-01" + }, + "PastResolution": { + "date": "2021-04-01" + } + }, + "Start": 16, + "Length": 16 + } + ] + }, + { + "Input": "I'll go back Jun third 2023", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "Jun third 2023", + "Type": "date", + "Value": { + "Timex": "2023-06-03", + "FutureResolution": { + "date": "2023-06-03" + }, + "PastResolution": { + "date": "2023-06-03" + } + }, + "Start": 13, + "Length": 14 + } + ] + }, + { + "Input": "I'll go back September the second 2025.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "September the second 2025", + "Type": "date", + "Value": { + "Timex": "2025-09-02", + "FutureResolution": { + "date": "2025-09-02" + }, + "PastResolution": { + "date": "2025-09-02" + } + }, + "Start": 13, + "Length": 25 + } + ] + }, + { + "Input": "I'll go back March one 2020", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "March one 2020", + "Type": "date", + "Value": { + "Timex": "2020-03-01", + "FutureResolution": { + "date": "2020-03-01" + }, + "PastResolution": { + "date": "2020-03-01" + } + }, + "Start": 13, + "Length": 14 + } + ] + }, + { + "Input": "I'll go back Aug twelve 2024.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "Aug twelve 2024", + "Type": "date", + "Value": { + "Timex": "2024-08-12", + "FutureResolution": { + "date": "2024-08-12" + }, + "PastResolution": { + "date": "2024-08-12" + } + }, + "Start": 13, + "Length": 15 + } + ] + }, + { + "Input": "I'll go back February twenty fifth", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "February twenty fifth", + "Type": "date", + "Value": { + "Timex": "XXXX-02-25", + "FutureResolution": { + "date": "2024-02-25" + }, + "PastResolution": { + "date": "2023-02-25" + } + }, + "Start": 13, + "Length": 21 + } + ] + }, + { + "Input": "I'll go back on Nov the twelfth.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "Nov the twelfth", + "Type": "date", + "Value": { + "Timex": "XXXX-11-12", + "FutureResolution": { + "date": "2023-11-12" + }, + "PastResolution": { + "date": "2022-11-12" + } + }, + "Start": 16, + "Length": 15 + } + ] + }, + { + "Input": "I'll go back January thirty one", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "January thirty one", + "Type": "date", + "Value": { + "Timex": "XXXX-01-31", + "FutureResolution": { + "date": "2024-01-31" + }, + "PastResolution": { + "date": "2023-01-31" + } + }, + "Start": 13, + "Length": 18 + } + ] + }, + { + "Input": "I'll go back Oct twenty three.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "Oct twenty three", + "Type": "date", + "Value": { + "Timex": "XXXX-10-23", + "FutureResolution": { + "date": "2023-10-23" + }, + "PastResolution": { + "date": "2022-10-23" + } + }, + "Start": 13, + "Length": 16 + } + ] + }, { "Input": "I'll go back on Friday", "Context": { @@ -2377,7 +2589,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "September the twenty-first nineteen seventy eight", @@ -2401,7 +2613,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "September 10, nineteen zero one", @@ -2425,7 +2637,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "tenth of September, two thousand", @@ -2564,6 +2776,7 @@ "Context": { "ReferenceDateTime": "2018-04-20T00:00:00" }, + "NotSupported": "", "Results": [ { "Text": "two days from tomorrow", @@ -2587,6 +2800,7 @@ "Context": { "ReferenceDateTime": "2018-04-20T00:00:00" }, + "NotSupported": "", "Results": [ { "Text": "four days from yesterday", @@ -2702,6 +2916,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, + "NotSupported": "", "Results": [ { "Text": "3-7-27", @@ -2725,6 +2940,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, + "NotSupported": "", "Results": [ { "Text": "05/05/89", @@ -2748,6 +2964,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, + "NotSupported": "", "Results": [ { "Text": "05/05/71", @@ -2771,6 +2988,7 @@ "Context": { "ReferenceDateTime": "2018-05-07T00:00:00" }, + "NotSupported": "", "Results": [ { "Text": "two sundays from now", @@ -2794,7 +3012,7 @@ "Context": { "ReferenceDateTime": "2018-05-07T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "two monday later", @@ -2938,7 +3156,7 @@ "Context": { "ReferenceDateTime": "2018-08-21T08:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "twenty second of june 2017", @@ -3143,5 +3361,212 @@ "Length": 9 } ] + }, + { + "Input": "the photograph appeared in the 01/07 issue of the magazine", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "the 01/07", + "Type": "date", + "Value": { + "Timex": "XXXX-01-07", + "FutureResolution": { + "date": "2024-01-07" + }, + "PastResolution": { + "date": "2023-01-07" + } + }, + "Start": 27, + "Length": 9 + } + ] + }, + { + "Input": "the contract is expected to start on 10/11", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "10/11", + "Type": "date", + "Value": { + "Timex": "XXXX-10-11", + "FutureResolution": { + "date": "2023-10-11" + }, + "PastResolution": { + "date": "2022-10-11" + } + }, + "Start": 37, + "Length": 5 + } + ] + }, + { + "Input": "the software used in the 11/3/2020 election can be easily hacked", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "the 11/3/2020", + "Type": "date", + "Value": { + "Timex": "2020-11-03", + "FutureResolution": { + "date": "2020-11-03" + }, + "PastResolution": { + "date": "2020-11-03" + } + }, + "Start": 21, + "Length": 13 + } + ] + }, + { + "Input": "this article was published on 06/10/2020", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "06/10/2020", + "Type": "date", + "Value": { + "Timex": "2020-06-10", + "FutureResolution": { + "date": "2020-06-10" + }, + "PastResolution": { + "date": "2020-06-10" + } + }, + "Start": 30, + "Length": 10 + } + ] + }, + { + "Input": "I was born on January eleventh nineteen seventy-four", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "january eleventh nineteen seventy-four", + "Type": "date", + "Value": { + "Timex": "1974-01-11", + "FutureResolution": { + "date": "1974-01-11" + }, + "PastResolution": { + "date": "1974-01-11" + } + }, + "Start": 14, + "Length": 38 + } + ] + }, + { + "Input": "Aliens will land on earth on the fourth of july twenty twenty-seven", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "fourth of july twenty twenty-seven", + "Type": "date", + "Value": { + "Timex": "2027-07-04", + "FutureResolution": { + "date": "2027-07-04" + }, + "PastResolution": { + "date": "2027-07-04" + } + }, + "Start": 33, + "Length": 34 + } + ] + }, + { + "Input": "Is there anything for March the second twenty fourteen", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "march the second twenty fourteen", + "Type": "date", + "Value": { + "Timex": "2014-03-02", + "FutureResolution": { + "date": "2014-03-02" + }, + "PastResolution": { + "date": "2014-03-02" + } + }, + "Start": 22, + "Length": 32 + } + ] + }, + { + "Input": "Do you remember the twenty-second of july nineteen forty-eight", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "twenty-second of july nineteen forty-eight", + "Type": "date", + "Value": { + "Timex": "1948-07-22", + "FutureResolution": { + "date": "1948-07-22" + }, + "PastResolution": { + "date": "1948-07-22" + } + }, + "Start": 20, + "Length": 42 + } + ] + }, + { + "Input": "My car insurance expires on June first twenty twenty", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "june first twenty twenty", + "Type": "date", + "Value": { + "Timex": "2020-06-01", + "FutureResolution": { + "date": "2020-06-01" + }, + "PastResolution": { + "date": "2020-06-01" + } + }, + "Start": 28, + "Length": 24 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/English/DatePeriodExtractor.json b/Specs/DateTime/English/DatePeriodExtractor.json index e99c9f76a0..3efadb3b73 100644 --- a/Specs/DateTime/English/DatePeriodExtractor.json +++ b/Specs/DateTime/English/DatePeriodExtractor.json @@ -1882,17 +1882,17 @@ }, { "Input": "I'll be out in 3 years", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { "Input": "I'll be out in 3 weeks", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { "Input": "I'll be out in 3 months", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -2659,7 +2659,7 @@ }, { "Input": "I'll be out year 247", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "year 247", @@ -2671,7 +2671,7 @@ }, { "Input": "In the 1970s", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the 1970s", @@ -2683,7 +2683,7 @@ }, { "Input": "In the 2000s, he was born.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the 2000s", @@ -2695,7 +2695,7 @@ }, { "Input": "In the 1970's", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the 1970's", @@ -2707,7 +2707,7 @@ }, { "Input": "In the 70s", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the 70s", @@ -2719,7 +2719,7 @@ }, { "Input": "In the 70's", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the 70's", @@ -2731,7 +2731,7 @@ }, { "Input": "In the '40s", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the '40s", @@ -2743,7 +2743,7 @@ }, { "Input": "In the seventies", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the seventies", @@ -2755,7 +2755,7 @@ }, { "Input": "In the nineteen seventies", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the nineteen seventies", @@ -2767,7 +2767,7 @@ }, { "Input": "In the two thousand and tens", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the two thousand and tens", @@ -2779,7 +2779,7 @@ }, { "Input": "In the twenty-tens", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the twenty-tens", @@ -2791,7 +2791,7 @@ }, { "Input": "In the two thousands", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the two thousands", @@ -2803,7 +2803,7 @@ }, { "Input": "In the noughties", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the noughties", @@ -2851,7 +2851,7 @@ }, { "Input": "It happened in June of nineteen ninety nine", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "June of nineteen ninety nine", @@ -2911,7 +2911,7 @@ }, { "Input": "Year two hundred and sixty seven,", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "Year two hundred and sixty seven", @@ -2935,7 +2935,7 @@ }, { "Input": "It happened in the past 2 decades", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the past 2 decades", @@ -2947,7 +2947,7 @@ }, { "Input": "It happened in the last two decades", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the last two decades", @@ -2959,7 +2959,7 @@ }, { "Input": "It happened in the next decade", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the next decade", @@ -3331,7 +3331,7 @@ }, { "Input": "I'll be out between January 1st 2015 and Feb 2018", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between January 1st 2015 and Feb 2018", @@ -3343,7 +3343,7 @@ }, { "Input": "I'll be out between 2015 and Feb 2018", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 2015 and Feb 2018", @@ -3355,7 +3355,7 @@ }, { "Input": "I'll be out from Feb 1st to March 2019", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from Feb 1st to March 2019", @@ -3367,7 +3367,7 @@ }, { "Input": "I'll be out between Feb 1st and March 2019", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between Feb 1st and March 2019", @@ -3379,7 +3379,7 @@ }, { "Input": "I'll be out between 2015 June and 2018 May", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 2015 June and 2018 May", @@ -3391,7 +3391,7 @@ }, { "Input": "I'll be out between 2015 May and 2018", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 2015 May and 2018", @@ -3403,7 +3403,7 @@ }, { "Input": "I'll be out between May 2015 and 2018", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between May 2015 and 2018", @@ -3415,7 +3415,7 @@ }, { "Input": "I'll be out between May 2015 and 2018 June", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between May 2015 and 2018 June", @@ -3427,7 +3427,7 @@ }, { "Input": "I'll be out between 2015 and January 5th 2018", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 2015 and January 5th 2018", @@ -3439,7 +3439,7 @@ }, { "Input": "I'll be out from 2015 to May 5th, 2017", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 2015 to May 5th, 2017", @@ -3451,7 +3451,7 @@ }, { "Input": "I'll be out from last Monday April to 2019", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from last Monday April to 2019", @@ -3463,7 +3463,7 @@ }, { "Input": "I'll be out from Week 31 to Week 35", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from Week 31 to Week 35", @@ -3475,7 +3475,7 @@ }, { "Input": "I'll be out between Week 31 and Week 35", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between Week 31 and Week 35", @@ -3514,7 +3514,7 @@ }, { "Input": "I was not there the same month that it happened.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "same month", @@ -3526,7 +3526,7 @@ }, { "Input": "I was not there the same week that it happened.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "same week", @@ -3538,7 +3538,7 @@ }, { "Input": "I weren't there that year.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "that year", @@ -3562,7 +3562,7 @@ }, { "Input": "I will come back within 2 weeks from today", - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [ { "Text": "within 2 weeks from today", @@ -3625,7 +3625,7 @@ }, { "Input": "Cortana, can you please set something up for the week of the 18th.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the week of the 18th", @@ -3637,7 +3637,7 @@ }, { "Input": "sales where date is this decade.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "this decade", @@ -3915,5 +3915,29 @@ "Length": 43 } ] + }, + { + "Input": "Show me the records for August 99", + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "August 99", + "Type": "daterange", + "Start": 24, + "Length": 9 + } + ] + }, + { + "Input": "Show me the records for August '99", + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "August '99", + "Type": "daterange", + "Start": 24, + "Length": 10 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/English/DatePeriodParser.json b/Specs/DateTime/English/DatePeriodParser.json index 9be0c5a87a..80ab286ab0 100644 --- a/Specs/DateTime/English/DatePeriodParser.json +++ b/Specs/DateTime/English/DatePeriodParser.json @@ -480,7 +480,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the last week of july", @@ -656,7 +656,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -1486,7 +1486,7 @@ }, { "Input": "I'll be out in 3 years", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, @@ -2505,7 +2505,7 @@ "Context": { "ReferenceDateTime": "2017-11-20T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "first week of 2015", @@ -2582,7 +2582,7 @@ "Context": { "ReferenceDateTime": "2017-11-20T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "last week of 2015", @@ -3050,7 +3050,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "June of nineteen ninety nine", @@ -3076,7 +3076,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "nineteen twenty eight", @@ -3102,7 +3102,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "one thousand seven hundred and eighty nine", @@ -3616,7 +3616,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "beginning of next week", @@ -3643,7 +3643,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "end of next week", @@ -3670,7 +3670,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "start of next week", @@ -3697,7 +3697,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "end of March", @@ -3724,7 +3724,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "mid next week", @@ -3751,7 +3751,7 @@ "Context": { "ReferenceDateTime": "2017-11-08T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "beginning of next week", @@ -4005,7 +4005,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -4489,7 +4489,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Comment": "Compound timex represent value dependency and will be split at the model level", - "NotSupported": "javascript,python,java", + "NotSupported": "javascript,java", "Results": [ { "Text": "between January 1st and April 5th", @@ -4593,7 +4593,7 @@ "Context": { "ReferenceDateTime": "2018-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from Feb 1st to March 2019", @@ -4619,7 +4619,7 @@ "Context": { "ReferenceDateTime": "2018-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between Feb 1st and March 2019", @@ -5090,7 +5090,7 @@ "Context": { "ReferenceDateTime": "2017-11-10T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "later this week", @@ -5901,7 +5901,7 @@ "Context": { "ReferenceDateTime": "2019-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "the week commencing february 4", @@ -6128,5 +6128,51 @@ "Length": 14 } ] + }, + { + "Input": "Show me the records for August 99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "August 99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 24, + "Length": 9 + } + ] + }, + { + "Input": "Show me the records for August '99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "August '99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 24, + "Length": 10 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/English/DateTimeExtractor.json b/Specs/DateTime/English/DateTimeExtractor.json index e42a7c80de..a186d873e1 100644 --- a/Specs/DateTime/English/DateTimeExtractor.json +++ b/Specs/DateTime/English/DateTimeExtractor.json @@ -32,6 +32,28 @@ } ] }, + { + "Input": "I'll go back on 15 at 00:00", + "Results": [ + { + "Text": "15 at 00:00", + "Type": "datetime", + "Start": 16, + "Length": 11 + } + ] + }, + { + "Input": "I'll go back on 15 at 00:00:00", + "Results": [ + { + "Text": "15 at 00:00:00", + "Type": "datetime", + "Start": 16, + "Length": 14 + } + ] + }, { "Input": "I'll go back on 15 at 8:00", "Results": [ @@ -739,7 +761,7 @@ }, { "Input": "I will leave 1 day 2 hours later", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1 day 2 hours later", diff --git a/Specs/DateTime/English/DateTimeModel.json b/Specs/DateTime/English/DateTimeModel.json index 87bc77c43b..56a66b8c45 100644 --- a/Specs/DateTime/English/DateTimeModel.json +++ b/Specs/DateTime/English/DateTimeModel.json @@ -228,6 +228,238 @@ } ] }, + { + "Input": "I'll go back on April first 2021.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "april first 2021", + "Start": 16, + "End": 31, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2021-04-01", + "type": "date", + "value": "2021-04-01" + } + ] + } + } + ] + }, + { + "Input": "I'll go back Jun third 2023", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "jun third 2023", + "Start": 13, + "End": 26, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2023-06-03", + "type": "date", + "value": "2023-06-03" + } + ] + } + } + ] + }, + { + "Input": "I'll go back September the second 2025.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "september the second 2025", + "Start": 13, + "End": 37, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "2025-09-02", + "type": "date", + "value": "2025-09-02" + } + ] + } + } + ] + }, + { + "Input": "I'll go back March one 2020", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "march one 2020", + "TypeName": "datetimeV2.date", + "Start": 13, + "End": 26, + "Resolution": { + "values": [ + { + "timex": "2020-03-01", + "type": "date", + "value": "2020-03-01" + } + ] + } + } + ] + }, + { + "Input": "I'll go back Aug twelve 2024.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "aug twelve 2024", + "TypeName": "datetimeV2.date", + "Start": 13, + "End": 27, + "Resolution": { + "values": [ + { + "timex": "2024-08-12", + "type": "date", + "value": "2024-08-12" + } + ] + } + } + ] + }, + { + "Input": "I'll go back February twenty fifth", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "february twenty fifth", + "Start": 13, + "End": 33, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-02-25", + "type": "date", + "value": "2023-02-25" + }, + { + "timex": "XXXX-02-25", + "type": "date", + "value": "2024-02-25" + } + ] + } + } + ] + }, + { + "Input": "I'll go back on Nov the twelfth.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "nov the twelfth", + "Start": 16, + "End": 30, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-11-12", + "type": "date", + "value": "2022-11-12" + }, + { + "timex": "XXXX-11-12", + "type": "date", + "value": "2023-11-12" + } + ] + } + } + ] + }, + { + "Input": "I'll go back January thirty one", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "january thirty one", + "Start": 13, + "End": 30, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-01-31", + "type": "date", + "value": "2023-01-31" + }, + { + "timex": "XXXX-01-31", + "type": "date", + "value": "2024-01-31" + } + ] + } + } + ] + }, + { + "Input": "I'll go back Oct twenty three.", + "Context": { + "ReferenceDateTime": "2023-04-25T00:00:00" + }, + "Results": [ + { + "Text": "oct twenty three", + "Start": 13, + "End": 28, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-10-23", + "type": "date", + "value": "2022-10-23" + }, + { + "timex": "XXXX-10-23", + "type": "date", + "value": "2023-10-23" + } + ] + } + } + ] + }, { "Input": "I'll go back today", "Context": { @@ -1119,224 +1351,17 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ - { - "Text": "all day", - "Start": 15, - "End": 21, - "TypeName": "datetimeV2.duration", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "duration", - "value": "86400" - } - ] - } - } - ] - }, - { - "Input": "I'll leave for twenty and four hours", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "twenty and four hours", - "Start": 15, - "End": 35, - "TypeName": "datetimeV2.duration", - "Resolution": { - "values": [ - { - "timex": "PT24H", - "type": "duration", - "value": "86400" - } - ] - } - } - ] - }, - { - "Input": "I'll leave for all month", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "all month", - "Start": 15, - "End": 23, - "TypeName": "datetimeV2.duration", - "Resolution": { - "values": [ - { - "timex": "P1M", - "type": "duration", - "value": "2592000" - } - ] - } - } - ] - }, - { - "Input": "I'll leave for an hour", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "an hour", - "Start": 15, - "End": 21, - "TypeName": "datetimeV2.duration", - "Resolution": { - "values": [ - { - "timex": "PT1H", - "type": "duration", - "value": "3600" - } - ] - } - } - ] - }, - { - "Input": "I'll leave for few hours", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "few hours", - "Start": 15, - "End": 23, - "TypeName": "datetimeV2.duration", - "Resolution": { - "values": [ - { - "timex": "PT3H", - "type": "duration", - "value": "10800" - } - ] - } - } - ] - }, - { - "Input": "I'll leave for a few minutes", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "a few minutes", - "Start": 15, - "End": 27, - "TypeName": "datetimeV2.duration", - "Resolution": { - "values": [ - { - "timex": "PT3M", - "type": "duration", - "value": "180" - } - ] - } - } - ] - }, - { - "Input": "I'll leave for some days", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "some days", - "Start": 15, - "End": 23, - "TypeName": "datetimeV2.duration", - "Resolution": { - "values": [ - { - "timex": "P3D", - "type": "duration", - "value": "259200" - } - ] - } - } - ] - }, - { - "Input": "I'll leave for several weeks", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "several weeks", - "Start": 15, - "End": 27, - "TypeName": "datetimeV2.duration", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "duration", - "value": "1814400" - } - ] - } - } - ] - }, - { - "Input": "I'll leave weekly", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "weekly", - "Start": 11, - "End": 16, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave every day", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "every day", - "Start": 11, - "End": 19, - "TypeName": "datetimeV2.set", + { + "Text": "all day", + "Start": 15, + "End": 21, + "TypeName": "datetimeV2.duration", "Resolution": { "values": [ { "timex": "P1D", - "type": "set", - "value": "not resolved" + "type": "duration", + "value": "86400" } ] } @@ -1344,22 +1369,22 @@ ] }, { - "Input": "I'll leave everyday", + "Input": "I'll leave for twenty and four hours", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ { - "Text": "everyday", - "Start": 11, - "End": 18, - "TypeName": "datetimeV2.set", + "Text": "twenty and four hours", + "Start": 15, + "End": 35, + "TypeName": "datetimeV2.duration", "Resolution": { "values": [ { - "timex": "P1D", - "type": "set", - "value": "not resolved" + "timex": "PT24H", + "type": "duration", + "value": "86400" } ] } @@ -1367,22 +1392,22 @@ ] }, { - "Input": "I'll leave annually", + "Input": "I'll leave for all month", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ { - "Text": "annually", - "Start": 11, - "End": 18, - "TypeName": "datetimeV2.set", + "Text": "all month", + "Start": 15, + "End": 23, + "TypeName": "datetimeV2.duration", "Resolution": { "values": [ { - "timex": "P1Y", - "type": "set", - "value": "not resolved" + "timex": "P1M", + "type": "duration", + "value": "2592000" } ] } @@ -1390,22 +1415,22 @@ ] }, { - "Input": "I'll leave each two days", + "Input": "I'll leave for an hour", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ { - "Text": "each two days", - "Start": 11, - "End": 23, - "TypeName": "datetimeV2.set", + "Text": "an hour", + "Start": 15, + "End": 21, + "TypeName": "datetimeV2.duration", "Resolution": { "values": [ { - "timex": "P2D", - "type": "set", - "value": "not resolved" + "timex": "PT1H", + "type": "duration", + "value": "3600" } ] } @@ -1413,22 +1438,22 @@ ] }, { - "Input": "I'll leave every three week", + "Input": "I'll leave for few hours", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ { - "Text": "every three week", - "Start": 11, - "End": 26, - "TypeName": "datetimeV2.set", + "Text": "few hours", + "Start": 15, + "End": 23, + "TypeName": "datetimeV2.duration", "Resolution": { "values": [ { - "timex": "P3W", - "type": "set", - "value": "not resolved" + "timex": "PT3H", + "type": "duration", + "value": "10800" } ] } @@ -1436,22 +1461,22 @@ ] }, { - "Input": "I'll leave 3pm each day", + "Input": "I'll leave for a few minutes", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ { - "Text": "3pm each day", - "Start": 11, - "End": 22, - "TypeName": "datetimeV2.set", + "Text": "a few minutes", + "Start": 15, + "End": 27, + "TypeName": "datetimeV2.duration", "Resolution": { "values": [ { - "timex": "T15", - "type": "set", - "value": "not resolved" + "timex": "PT3M", + "type": "duration", + "value": "180" } ] } @@ -1459,22 +1484,22 @@ ] }, { - "Input": "I'll leave every monday", + "Input": "I'll leave for some days", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ { - "Text": "every monday", - "Start": 11, - "End": 22, - "TypeName": "datetimeV2.set", + "Text": "some days", + "Start": 15, + "End": 23, + "TypeName": "datetimeV2.duration", "Resolution": { "values": [ { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" + "timex": "P3D", + "type": "duration", + "value": "259200" } ] } @@ -1482,22 +1507,22 @@ ] }, { - "Input": "I'll leave each monday at 4pm", + "Input": "I'll leave for several weeks", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ { - "Text": "each monday at 4pm", - "Start": 11, - "End": 28, - "TypeName": "datetimeV2.set", + "Text": "several weeks", + "Start": 15, + "End": 27, + "TypeName": "datetimeV2.duration", "Resolution": { "values": [ { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" + "timex": "P3W", + "type": "duration", + "value": "1814400" } ] } @@ -2868,21 +2893,6 @@ "ReferenceDateTime": "2018-05-20T00:00:00" }, "Results": [ - { - "Text": "each week", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 28, @@ -2908,21 +2918,6 @@ }, "NotSupported": "javascript", "Results": [ - { - "Text": "each week", - "Start": 66, - "End": 74, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 136, @@ -9876,7 +9871,7 @@ "Context": { "ReferenceDateTime": "2019-01-25T12:00:00" }, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "sunday 31", @@ -9905,7 +9900,7 @@ "Context": { "ReferenceDateTime": "2019-02-25T12:00:00" }, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "friday 31", @@ -9929,6 +9924,35 @@ } ] }, + { + "Input": "Do you have any arrangement on Saturday 30?", + "Context": { + "ReferenceDateTime": "2023-07-05T12:00:00" + }, + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "saturday 30", + "Start": 31, + "End": 41, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-WXX-6", + "type": "date", + "value": "2022-07-30" + }, + { + "timex": "XXXX-WXX-6", + "type": "date", + "value": "2023-09-30" + } + ] + } + } + ] + }, { "Input": "Do you have any plan after mid May?", "Context": { @@ -10326,7 +10350,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { @@ -10437,16 +10461,21 @@ }, "Results": [ { - "Text": "every tuesday", - "Start": 26, + "Text": "tuesday", + "Start": 32, "End": 38, - "TypeName": "datetimeV2.set", + "TypeName": "datetimeV2.date", "Resolution": { "values": [ { "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" + "type": "date", + "value": "2019-02-26" + }, + { + "timex": "XXXX-WXX-2", + "type": "date", + "value": "2019-03-05" } ] } @@ -10581,6 +10610,52 @@ "NotSupported": "javascript, java, python", "Results": [] }, + { + "Input": "I'll be back at 00:00", + "Context": { + "ReferenceDateTime": "2023-03-28T00:00:00" + }, + "Results": [ + { + "Text": "00:00", + "Start": 16, + "End": 20, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T00:00", + "type": "time", + "value": "00:00:00" + } + ] + } + } + ] + }, + { + "Input": "I'll be back tomorrow at 00:00.", + "Context": { + "ReferenceDateTime": "2023-03-28T00:00:00" + }, + "Results": [ + { + "Text": "tomorrow at 00:00", + "Start": 13, + "End": 29, + "TypeName": "datetimeV2.datetime", + "Resolution": { + "values": [ + { + "timex": "2023-03-29T00:00", + "type": "datetime", + "value": "2023-03-29 00:00:00" + } + ] + } + } + ] + }, { "Input": "I'll be back at 9:00a.", "Context": { @@ -11163,7 +11238,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "january first two thousand and thirty two", @@ -12176,7 +12251,7 @@ "Context": { "ReferenceDateTime": "2019-06-03T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "january first 2000", @@ -12200,7 +12275,7 @@ "Context": { "ReferenceDateTime": "2019-06-03T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "january first 12", @@ -14247,81 +14322,12 @@ "Text": "feb 30 2019 17:20", "Start": 44, "End": 60, - "TypeName": "datetimeV2.datetime", - "Resolution": { - "values": [ - { - "timex": "2019-02-30T17:20", - "type": "datetime", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Let's meet once a week", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a week", - "Start": 11, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Have vitamins one a day", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "one a day", - "Start": 14, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I go on vacation once a year", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a year", - "Start": 17, - "End": 27, - "TypeName": "datetimeV2.set", + "TypeName": "datetimeV2.datetime", "Resolution": { "values": [ { - "timex": "P1Y", - "type": "set", + "timex": "2019-02-30T17:20", + "type": "datetime", "value": "not resolved" } ] @@ -14801,52 +14807,6 @@ } ] }, - { - "Input": "Every other Friday", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "Results": [ - { - "Text": "every other friday", - "Start": 0, - "End": 17, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-5", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Let's have a quarterly meeting.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "quarterly", - "Start": 13, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "q1 and q2 could be any year", "Context": { @@ -14896,21 +14856,6 @@ } ] } - }, - { - "Text": "any year", - "Start": 19, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -15734,7 +15679,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -15792,7 +15737,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -15824,7 +15769,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -15832,7 +15777,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -15967,7 +15912,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "fourth of july of 1995", @@ -16061,7 +16006,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "fourth of july 1995", @@ -16085,7 +16030,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "fourth of july, 1995", @@ -16189,29 +16134,6 @@ } ] }, - { - "Input": "Thursdays at 17.30 Beijing time", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "Results": [ - { - "Text": "thursdays at 17.30", - "Start": 0, - "End": 17, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-4T17:30", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Juneteenth, which is also known as Freedom Day and Jubilee Day, dates back to 1865, and it is observed on 19 June every year.", "Context": { @@ -16313,21 +16235,6 @@ } ] } - }, - { - "Text": "every year", - "Start": 114, - "End": 123, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -16399,54 +16306,6 @@ } ] }, - { - "Input": "Please schedule a meeting semi-annually", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "semi-annually", - "Start": 26, - "End": 38, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Please schedule a semiannual meeting", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "semiannual", - "Start": 18, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Please schedule a meeting with everyone next week", "Context": { @@ -16471,30 +16330,6 @@ } ] }, - { - "Input": "Let's make sure that happens every weekday", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "every weekday", - "Start": 29, - "End": 41, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "why don't you take the remaining of the week off?", "Context": { @@ -16519,53 +16354,6 @@ } ] }, - { - "Input": "it's almost time for the annual review", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "Results": [ - { - "Text": "annual", - "Start": 25, - "End": 30, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "laws and regulations require reporting financials each quarter", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "each quarter", - "Start": 50, - "End": 61, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "4th of july is around the corner", "Context": { @@ -16601,21 +16389,6 @@ }, "NotSupported": "javascript, python, java", "Results": [ - { - "Text": "bi-monthly", - "Start": 4, - "End": 13, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2M", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "summer", "Start": 55, @@ -16633,54 +16406,6 @@ } ] }, - { - "Input": "do you do that every weekend?", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "every weekend", - "Start": 15, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "every two weekends", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "every two weekends", - "Start": 0, - "End": 17, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "the course lasts three weekends", "Context": { @@ -16990,33 +16715,9 @@ "Resolution": { "values": [ { - "timex": "PT1H", - "type": "duration", - "value": "3600" - } - ] - } - } - ] - }, - { - "Input": "Add meeting with boss to my calendar - Tuesdays at 9am", - "Context": { - "ReferenceDateTime": "2020-06-16T12:00:00" - }, - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "tuesdays at 9am", - "Start": 39, - "End": 53, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2T09", - "type": "set", - "value": "not resolved" + "timex": "PT1H", + "type": "duration", + "value": "3600" } ] } @@ -17533,7 +17234,7 @@ "Context": { "ReferenceDateTime": "2020-07-01T12:00:00" }, - "NotSupportedByDesign": "python, java, javascript", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "twenty third day of september", @@ -17844,54 +17545,6 @@ } ] }, - { - "Input": "dinner with mom any weekend.", - "Context": { - "ReferenceDateTime": "2016-11-11T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "any weekend", - "Start": 16, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "dinner with mom all weekends.", - "Context": { - "ReferenceDateTime": "2016-11-11T00:00:00" - }, - "NotSupported": "javascript, python, java, dotnet", - "Results": [ - { - "Text": "all weekends", - "Start": 16, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "I'll be out next evening from 7 to 9", "Context": { @@ -18685,21 +18338,6 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ - { - "Text": "every day", - "Start": 11, - "End": 19, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "7:13 p.m.", "Start": 24, @@ -18717,29 +18355,6 @@ } ] }, - { - "Input": "I'll leave every evening at 7:13 p.m.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "every evening at 7:13 p.m.", - "Start": 11, - "End": 36, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T19:13", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "What happened on Easter Monday at 10:30 am?", "Context": { @@ -18827,30 +18442,6 @@ } ] }, - { - "Input": "dinner with mom weekends.", - "Context": { - "ReferenceDateTime": "2016-11-11T00:00:00" - }, - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "weekends", - "Start": 16, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "I'll be out Tuesday from 2:00 to 2:30 pm", "Context": { @@ -20232,21 +19823,6 @@ ] } }, - { - "Text": "daily", - "Start": 228, - "End": 232, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "until april 27th", "Start": 234, @@ -20520,21 +20096,6 @@ }, "NotSupported": "javascript, python, java", "Results": [ - { - "Text": "daily", - "Start": 38, - "End": 42, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "past fortnight", "Start": 64, @@ -21333,7 +20894,7 @@ "Context": { "ReferenceDateTime": "2021-06-18T18:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [] }, { @@ -21341,7 +20902,7 @@ "Context": { "ReferenceDateTime": "2021-06-18T18:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [] }, { @@ -21349,7 +20910,7 @@ "Context": { "ReferenceDateTime": "2021-06-18T18:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [] }, { @@ -21705,7 +21266,7 @@ "Context": { "ReferenceDateTime": "2018-01-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "april of 1987", @@ -21730,7 +21291,7 @@ "Context": { "ReferenceDateTime": "2018-01-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "april of 87", @@ -21949,7 +21510,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "january twenty five nineteen eighty six", @@ -21973,7 +21534,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "twenty five january nineteen eighty six", @@ -21997,7 +21558,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "fifteen august nineteen hundred ninety three", @@ -22021,7 +21582,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "13 sept nineteen seventy two", @@ -22045,7 +21606,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "6 april seventeen hundred thirty three", @@ -22069,7 +21630,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "august two thousand and fifteen", @@ -22094,7 +21655,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "october two thousand and five", @@ -22119,7 +21680,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "october two thousand", @@ -22582,21 +22143,6 @@ }, "NotSupported": "java, javascript, python", "Results": [ - { - "Text": "every week", - "Start": 19, - "End": 28, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "starting next week", "Start": 30, @@ -22795,7 +22341,7 @@ "Context": { "ReferenceDateTime": "2022-05-01T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "sun 14th", @@ -22819,29 +22365,6 @@ } ] }, - { - "Input": "It's an everyday routine.", - "Context": { - "ReferenceDateTime": "2018-11-30T12:00:00" - }, - "Results": [ - { - "Text": "everyday", - "Start": 8, - "End": 15, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "We meet in half an hour", "Context": { @@ -22874,98 +22397,16 @@ "NotSupported": "javascript, python", "Results": [ { - "Text": "half an hour from now", - "Start": 11, - "End": 31, - "TypeName": "datetimeV2.datetime", - "Resolution": { - "values": [ - { - "timex": "2022-01-07T19:26:00", - "type": "datetime", - "value": "2022-01-07 19:26:00" - } - ] - } - } - ] - }, - { - "Input": "I'll go back on Mon 13th", - "Context": { - "ReferenceDateTime": "2022-05-01T00:00:00" - }, - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "mon 13th", - "Start": 16, - "End": 23, - "TypeName": "datetimeV2.date", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "date", - "value": "2021-12-13" - }, - { - "timex": "XXXX-WXX-1", - "type": "date", - "value": "2022-06-13" - } - ] - } - } - ] - }, - { - "Input": "I'll be out tuesday afternoon", - "Context": { - "ReferenceDateTime": "2016-11-07T16:12:00" - }, - "Results": [ - { - "Text": "tuesday afternoon", - "Start": 12, - "End": 28, - "TypeName": "datetimeV2.datetimerange", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2TAF", - "type": "datetimerange", - "start": "2016-11-01 12:00:00", - "end": "2016-11-01 16:00:00" - }, - { - "timex": "XXXX-WXX-2TAF", - "type": "datetimerange", - "start": "2016-11-08 12:00:00", - "end": "2016-11-08 16:00:00" - } - ] - } - } - ] - }, - { - "Input": "I'll be out tuesday afternoons", - "Context": { - "ReferenceDateTime": "2016-11-07T16:12:00" - }, - "Results": [ - { - "Text": "tuesday afternoons", - "Start": 12, - "End": 29, - "TypeName": "datetimeV2.set", + "Text": "half an hour from now", + "Start": 11, + "End": 31, + "TypeName": "datetimeV2.datetime", "Resolution": { "values": [ { - "timex": "XXXX-WXX-2TAF", - "type": "set", - "value": "not resolved" + "timex": "2022-01-07T19:26:00", + "type": "datetime", + "value": "2022-01-07 19:26:00" } ] } @@ -22973,22 +22414,28 @@ ] }, { - "Input": "I'll be out Friday mornings", + "Input": "I'll go back on Mon 13th", "Context": { - "ReferenceDateTime": "2016-11-07T16:12:00" + "ReferenceDateTime": "2022-05-01T00:00:00" }, + "NotSupported": "java, javascript", "Results": [ { - "Text": "friday mornings", - "Start": 12, - "End": 26, - "TypeName": "datetimeV2.set", + "Text": "mon 13th", + "Start": 16, + "End": 23, + "TypeName": "datetimeV2.date", "Resolution": { "values": [ { - "timex": "XXXX-WXX-5TMO", - "type": "set", - "value": "not resolved" + "timex": "XXXX-WXX-1", + "type": "date", + "value": "2021-12-13" + }, + { + "timex": "XXXX-WXX-1", + "type": "date", + "value": "2022-06-13" } ] } @@ -22996,22 +22443,29 @@ ] }, { - "Input": "I'll be out mornings", + "Input": "I'll be out tuesday afternoon", "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, "Results": [ { - "Text": "mornings", + "Text": "tuesday afternoon", "Start": 12, - "End": 19, - "TypeName": "datetimeV2.set", + "End": 28, + "TypeName": "datetimeV2.datetimerange", "Resolution": { "values": [ { - "timex": "TMO", - "type": "set", - "value": "not resolved" + "timex": "XXXX-WXX-2TAF", + "type": "datetimerange", + "start": "2016-11-01 12:00:00", + "end": "2016-11-01 16:00:00" + }, + { + "timex": "XXXX-WXX-2TAF", + "type": "datetimerange", + "start": "2016-11-08 12:00:00", + "end": "2016-11-08 16:00:00" } ] } @@ -23388,7 +22842,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T10:20:00" }, - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "today from 7 to 7:30", @@ -23861,7 +23315,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "23.04.2022 14:55", @@ -24450,7 +23904,7 @@ "Context": { "ReferenceDateTime": "2016-11-02T10:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "nov/2", @@ -24479,7 +23933,7 @@ "Context": { "ReferenceDateTime": "2022-07-10T10:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "from 2 july to 10 july", @@ -24510,7 +23964,7 @@ "Context": { "ReferenceDateTime": "2019-07-04T00:00:00" }, - "NotSupported": "java, python", + "NotSupported": "java", "Results": [ { "Text": "last quarter", @@ -24635,7 +24089,7 @@ "Context": { "ReferenceDateTime": "2019-07-04T00:00:00" }, - "NotSupported": "java, python", + "NotSupported": "java", "Results": [ { "Text": "next quarter", @@ -24872,7 +24326,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -24880,7 +24334,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "14 nov", @@ -24909,7 +24363,7 @@ "Context": { "ReferenceDateTime": "2022-04-27T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "saturday", @@ -24938,7 +24392,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "14 nov 2023", @@ -24962,7 +24416,7 @@ "Context": { "ReferenceDateTime": "2022-07-27T10:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "after dinner", @@ -25002,7 +24456,7 @@ "Context": { "ReferenceDateTime": "2022-07-27T10:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "after dinnertime", @@ -25042,7 +24496,7 @@ "Context": { "ReferenceDateTime": "2022-07-27T10:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "at lunch", @@ -25082,7 +24536,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "next month", @@ -25107,7 +24561,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "next month", @@ -25148,7 +24602,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next month", @@ -25188,7 +24642,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T13:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "next month", @@ -25229,7 +24683,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next month", @@ -25271,7 +24725,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next year", @@ -25311,7 +24765,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next year", @@ -25356,7 +24810,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T13:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "next year", @@ -25397,7 +24851,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next year", @@ -25439,7 +24893,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next month", @@ -25484,7 +24938,7 @@ "Context": { "ReferenceDateTime": "2022-04-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next year", @@ -25519,5 +24973,222 @@ } } ] + }, + { + "Input": "the photograph appeared in the 01/07 issue of the magazine", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 27, + "End": 35, + "Resolution": { + "values": [ + { + "timex": "XXXX-01-07", + "type": "date", + "value": "2023-01-07" + }, + { + "timex": "XXXX-01-07", + "type": "date", + "value": "2024-01-07" + } + ] + }, + "Text": "the 01/07", + "TypeName": "datetimeV2.date" + } + ] + }, + { + "Input": "the contract is expected to start on 10/11", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 37, + "End": 41, + "Resolution": { + "values": [ + { + "timex": "XXXX-10-11", + "type": "date", + "value": "2022-10-11" + }, + { + "timex": "XXXX-10-11", + "type": "date", + "value": "2023-10-11" + } + ] + }, + "Text": "10/11", + "TypeName": "datetimeV2.date" + } + ] + }, + { + "Input": "the software used in the 11/3/2020 election can be easily hacked", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 21, + "End": 33, + "Resolution": { + "values": [ + { + "timex": "2020-11-03", + "type": "date", + "value": "2020-11-03" + } + ] + }, + "Text": "the 11/3/2020", + "TypeName": "datetimeV2.date" + } + ] + }, + { + "Input": "this article was published on 06/10/2020", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 30, + "End": 39, + "Resolution": { + "values": [ + { + "timex": "2020-06-10", + "type": "date", + "value": "2020-06-10" + } + ] + }, + "Text": "06/10/2020", + "TypeName": "datetimeV2.date" + } + ] + }, + { + "Input": "I was born on January eleventh nineteen seventy-four", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 14, + "End": 51, + "Resolution": { + "values": [ + { + "timex": "1974-01-11", + "type": "date", + "value": "1974-01-11" + } + ] + }, + "Text": "january eleventh nineteen seventy-four", + "Type": "datetimeV2.date" + } + ] + }, + { + "Input": "Aliens will land on earth on the fourth of july twenty twenty-seven", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 33, + "End": 66, + "Resolution": { + "values": [ + { + "timex": "2027-07-04", + "type": "date", + "value": "2027-07-04" + } + ] + }, + "Text": "fourth of july twenty twenty-seven", + "Type": "datetimeV2.date" + } + ] + }, + { + "Input": "My car insurance expires on June first twenty twenty", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 28, + "End": 51, + "Resolution": { + "values": [ + { + "timex": "2020-06-01", + "type": "date", + "value": "2020-06-01" + } + ] + }, + "Text": "june first twenty twenty", + "Type": "datetimeV2.date" + } + ] + }, + { + "Input": "Is there anything for March the second twenty fourteen", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 22, + "End": 53, + "Resolution": { + "values": [ + { + "timex": "2014-03-02", + "type": "date", + "value": "2014-03-02" + } + ] + }, + "Text": "march the second twenty fourteen", + "Type": "datetimeV2.date" + } + ] + }, + { + "Input": "Do you remember the twenty-second of july nineteen forty-eight", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 20, + "End": 61, + "Resolution": { + "values": [ + { + "timex": "1948-07-22", + "type": "date", + "value": "1948-07-22" + } + ] + }, + "Text": "twenty-second of july nineteen forty-eight", + "Type": "datetimeV2.date" + } + ] } ] diff --git a/Specs/DateTime/English/DateTimeModelCalendarMode.json b/Specs/DateTime/English/DateTimeModelCalendarMode.json index 16465b8d30..8bccadab5f 100644 --- a/Specs/DateTime/English/DateTimeModelCalendarMode.json +++ b/Specs/DateTime/English/DateTimeModelCalendarMode.json @@ -164,7 +164,7 @@ "Context": { "ReferenceDateTime": "2017-12-18T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "yesterday at 12", @@ -292,7 +292,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "2 hours", @@ -332,7 +332,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "2 hours", @@ -372,23 +372,8 @@ "Context": { "ReferenceDateTime": "2018-05-20T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ - { - "Text": "each week", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 28, @@ -412,23 +397,8 @@ "Context": { "ReferenceDateTime": "2018-05-20T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ - { - "Text": "each week", - "Start": 66, - "End": 74, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 136, @@ -537,7 +507,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -545,7 +515,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -553,7 +523,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -561,7 +531,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -569,7 +539,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -577,7 +547,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -585,7 +555,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -1033,52 +1003,6 @@ } ] }, - { - "Input": "Let's meet once a week", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a week", - "Start": 11, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I go on vacation once a year", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a year", - "Start": 17, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Let's find one morning together", "Context": { @@ -1250,29 +1174,6 @@ } ] }, - { - "Input": "It's an everyday routine.", - "Context": { - "ReferenceDateTime": "2018-11-30T12:00:00" - }, - "Results": [ - { - "Text": "everyday", - "Start": 8, - "End": 15, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "We meet in half an hour", "Context": { diff --git a/Specs/DateTime/English/DateTimeModelComplexCalendar.json b/Specs/DateTime/English/DateTimeModelComplexCalendar.json index 037ee71425..f912e137d2 100644 --- a/Specs/DateTime/English/DateTimeModelComplexCalendar.json +++ b/Specs/DateTime/English/DateTimeModelComplexCalendar.json @@ -158,7 +158,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -166,7 +166,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -174,7 +174,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -182,7 +182,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -190,7 +190,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -256,7 +256,7 @@ "Context": { "ReferenceDateTime": "2017-12-18T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "yesterday at 12", @@ -384,7 +384,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "2 hours", @@ -424,7 +424,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "2 hours", @@ -1494,7 +1494,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "another week", @@ -1518,23 +1518,8 @@ "Context": { "ReferenceDateTime": "2018-05-20T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ - { - "Text": "each week", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 28, @@ -1558,23 +1543,8 @@ "Context": { "ReferenceDateTime": "2018-05-20T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ - { - "Text": "each week", - "Start": 66, - "End": 74, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 136, @@ -1897,7 +1867,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -1905,7 +1875,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -1913,7 +1883,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -1921,7 +1891,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "earlier in the week", @@ -1946,7 +1916,7 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "earlier this month", @@ -1996,7 +1966,7 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "later this week", @@ -2046,7 +2016,7 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "later this year", @@ -2071,7 +2041,7 @@ "Context": { "ReferenceDateTime": "2018-05-28T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "later in the year", @@ -2096,7 +2066,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "april 2017", @@ -2121,7 +2091,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "2017 april", @@ -2146,7 +2116,7 @@ "Context": { "ReferenceDateTime": "2018-05-24T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "april", @@ -2177,7 +2147,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "two days after today", @@ -2591,7 +2561,7 @@ "Context": { "ReferenceDateTime": "2018-06-12T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [] }, { @@ -2630,7 +2600,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1/1/2015 between 10 and 11:30", @@ -2686,7 +2656,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 3 and 5 on 1/1/2015", @@ -2816,7 +2786,7 @@ "Context": { "ReferenceDateTime": "2018-06-14T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [ { "Text": "this sunday around 7:00", @@ -2845,7 +2815,7 @@ "Context": { "ReferenceDateTime": "2018-05-31T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "before 2010", @@ -3199,7 +3169,7 @@ "Context": { "ReferenceDateTime": "2018-06-12T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [] }, { @@ -3208,7 +3178,7 @@ "Context": { "ReferenceDateTime": "2018-06-12T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [] }, { @@ -3217,7 +3187,7 @@ "Context": { "ReferenceDateTime": "2018-06-12T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [] }, { @@ -3225,7 +3195,7 @@ "Context": { "ReferenceDateTime": "2018-06-12T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "martin luther king day", @@ -3388,7 +3358,7 @@ "Context": { "ReferenceDateTime": "2018-06-20T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -3396,7 +3366,7 @@ "Context": { "ReferenceDateTime": "2018-06-19T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [ { "Text": "more than 4 days", @@ -3702,7 +3672,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "after 2018", @@ -3728,7 +3698,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "after feb 2018", @@ -3754,7 +3724,7 @@ "Context": { "ReferenceDateTime": "2018-05-29T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "after feb", @@ -3936,7 +3906,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next week", @@ -4165,7 +4135,7 @@ "Context": { "ReferenceDateTime": "2018-07-02T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "week 31", @@ -4190,7 +4160,7 @@ "Context": { "ReferenceDateTime": "2018-06-26T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "in 2 minutes", @@ -4214,7 +4184,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "in two months", @@ -4238,7 +4208,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "in two weeks", @@ -4262,7 +4232,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "in two years", @@ -4286,7 +4256,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "two days from today", @@ -4474,7 +4444,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2008", @@ -4764,7 +4734,7 @@ "Context": { "ReferenceDateTime": "2018-07-31T13:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "following week", @@ -4814,7 +4784,7 @@ "Context": { "ReferenceDateTime": "2018-07-31T13:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "on monday of the following week", @@ -5090,7 +5060,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -5098,7 +5068,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -5229,7 +5199,7 @@ "Context": { "ReferenceDateTime": "2018-08-17T15:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "as late as 7:00 am", @@ -5255,7 +5225,7 @@ "Context": { "ReferenceDateTime": "2018-08-17T15:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "as late as tomorrow", @@ -5687,7 +5657,7 @@ "Context": { "ReferenceDateTime": "2018-09-06T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "as early as next year's first quarter", @@ -5713,7 +5683,7 @@ "Context": { "ReferenceDateTime": "2018-08-31T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "year greater than 2012", @@ -6002,7 +5972,7 @@ "Context": { "ReferenceDateTime": "2018-09-21T12:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "monday at 2.30", @@ -6041,7 +6011,7 @@ "Context": { "ReferenceDateTime": "2018-09-07T12:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "before 2.30pm", @@ -6067,7 +6037,7 @@ "Context": { "ReferenceDateTime": "2018-09-07T12:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "thursday 29/03 11.00am", @@ -6301,7 +6271,7 @@ "Context": { "ReferenceDateTime": "2018-08-30T10:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [] }, { @@ -6309,7 +6279,7 @@ "Context": { "ReferenceDateTime": "2018-08-30T10:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "at 6.45", @@ -6376,7 +6346,7 @@ "Context": { "ReferenceDateTime": "2018-10-17T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "in two days", @@ -6750,7 +6720,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "from may to oct 2020", @@ -6873,7 +6843,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "monday morning from 10am to 12pm", @@ -6935,7 +6905,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "yesterday afternoon from 3-8pm", @@ -6960,7 +6930,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "from 3-8pm yesterday afternoon", @@ -6985,7 +6955,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "from 8am-3 yesterday afternoon", @@ -7053,7 +7023,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "between 3 and 8 yesterday", @@ -7084,7 +7054,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "between 3 and 8am next monday", @@ -7109,7 +7079,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "between 3am - 12pm next monday", @@ -7134,7 +7104,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "6-8 next monday", @@ -7196,7 +7166,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T12:00:00" }, - "NotSupportedByDesign": "javascript, python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "next monday morning 6-8", @@ -7984,7 +7954,7 @@ "Context": { "ReferenceDateTime": "2018-11-29T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "last week of 2016", @@ -8337,7 +8307,7 @@ "Context": { "ReferenceDateTime": "2018-12-07T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Comment": "Not extracted may as a datetime range is not supported for now", "Results": [] }, @@ -8385,7 +8355,7 @@ "Context": { "ReferenceDateTime": "2019-01-24T12:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "tuesday", @@ -8414,7 +8384,7 @@ "Context": { "ReferenceDateTime": "2019-01-25T12:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "monday 21", @@ -8443,7 +8413,7 @@ "Context": { "ReferenceDateTime": "2019-01-21T12:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "monday 21", @@ -8467,7 +8437,7 @@ "Context": { "ReferenceDateTime": "2019-01-25T12:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "sunday 31", @@ -8496,7 +8466,7 @@ "Context": { "ReferenceDateTime": "2019-02-25T12:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "friday 31", @@ -8558,7 +8528,7 @@ "Context": { "ReferenceDateTime": "2019-02-25T12:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "before early september", @@ -8656,7 +8626,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "next friday", @@ -8680,7 +8650,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "following friday", @@ -8704,7 +8674,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "coming thursday", @@ -8776,7 +8746,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "previous wednesday", @@ -8800,7 +8770,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "last wednesday", @@ -8929,7 +8899,7 @@ "Context": { "ReferenceDateTime": "2019-01-31T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -8974,7 +8944,7 @@ "Context": { "ReferenceDateTime": "2019-02-27T00:00:00" }, - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "tuesday, jan 15, 1:00 pm - 1:15 pm", @@ -9005,7 +8975,7 @@ "Context": { "ReferenceDateTime": "2019-02-28T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "january 18, 2019", @@ -9046,16 +9016,21 @@ }, "Results": [ { - "Text": "every tuesday", - "Start": 26, + "Text": "tuesday", + "Start": 32, "End": 38, - "TypeName": "datetimeV2.set", + "TypeName": "datetimeV2.date", "Resolution": { "values": [ { "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" + "type": "date", + "value": "2019-02-26" + }, + { + "timex": "XXXX-WXX-2", + "type": "date", + "value": "2019-03-05" } ] } @@ -9089,7 +9064,7 @@ "Context": { "ReferenceDateTime": "2019-02-27T00:00:00" }, - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "12-2015", @@ -9130,7 +9105,7 @@ "Context": { "ReferenceDateTime": "2019-02-27T00:00:00" }, - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "2015-12", @@ -9311,7 +9286,7 @@ "Context": { "ReferenceDateTime": "2019-04-25T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [ { "Text": "january first two thousand and thirty two", @@ -9507,7 +9482,7 @@ "Context": { "ReferenceDateTime": "2019-05-16T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [ { "Text": "from april to june in 2017", @@ -9557,7 +9532,7 @@ "Context": { "ReferenceDateTime": "2019-05-22T00:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [ { "Text": "from january to april 2015", @@ -9606,7 +9581,7 @@ "Context": { "ReferenceDateTime": "2019-05-20T12:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "5.12", @@ -9635,7 +9610,7 @@ "Context": { "ReferenceDateTime": "2019-05-20T12:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "friday 5/12", @@ -9834,7 +9809,7 @@ "Context": { "ReferenceDateTime": "2019-05-22T12:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "jan/3", @@ -9996,7 +9971,7 @@ "Context": { "ReferenceDateTime": "2019-05-30T12:00:00" }, - "NotSupported": "python, javascript", + "NotSupported": "javascript", "Results": [ { "Text": "26 june to 28 june in 2020", @@ -10337,7 +10312,7 @@ "Context": { "ReferenceDateTime": "2019-06-03T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "january first 2000", @@ -10361,7 +10336,7 @@ "Context": { "ReferenceDateTime": "2019-06-03T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "january first 12", @@ -10385,7 +10360,7 @@ "Context": { "ReferenceDateTime": "2013-06-03T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "13:00 february 28, 2013", @@ -10457,7 +10432,7 @@ "Context": { "ReferenceDateTime": "2019-06-18T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "this calendar year", @@ -10784,7 +10759,7 @@ "Context": { "ReferenceDateTime": "2019-06-28T00:00:00" }, - "NotSupported": "python, javascript, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "=2019", @@ -10809,7 +10784,7 @@ "Context": { "ReferenceDateTime": "2019-06-28T00:00:00" }, - "NotSupported": "python, javascript, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "> = 2019", @@ -11921,7 +11896,7 @@ "Context": { "ReferenceDateTime": "2018-01-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -11929,7 +11904,7 @@ "Context": { "ReferenceDateTime": "2018-01-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -12030,7 +12005,7 @@ "Context": { "ReferenceDateTime": "2019-08-12T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "in 3 years", @@ -12152,7 +12127,7 @@ { "Input": "8/1.5 looks like a formula", "Comment": "Java disabled due to issue in lookbehind.", - "NotSupported": "dotnet, java, javascript, python", + "NotSupported": "dotnet, java, javascript", "Results": [] }, { @@ -12175,58 +12150,12 @@ } ] }, - { - "Input": "Let's meet once a week", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a week", - "Start": 11, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I go on vacation once a year", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a year", - "Start": 17, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "The request is ABC-12345-A1B2C3 this round. Let's arrange a 30 minutes call this week. Look forward to speaking again this week.", "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "30 minutes", @@ -12282,7 +12211,7 @@ "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "last week", @@ -12307,7 +12236,7 @@ "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -12381,7 +12310,7 @@ "Context": { "ReferenceDateTime": "2019-08-24T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "october", @@ -12552,7 +12481,7 @@ { "Input": "We will have lunch together with Jim", "Comment": "Disable this for now because of new features in .NET", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Context": { "ReferenceDateTime": "2019-09-12T00:00:00" }, @@ -12611,29 +12540,6 @@ } ] }, - { - "Input": "Let's have a quarterly meeting.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "quarterly", - "Start": 13, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "what about 30 min later?", "Context": { @@ -12950,7 +12856,7 @@ "Context": { "ReferenceDateTime": "2020-05-06T18:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "between today and tomorrow", @@ -13025,7 +12931,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -13033,7 +12939,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "02-02-2020 - 03-03-2020", @@ -13058,7 +12964,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -13066,7 +12972,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2002-10-09", @@ -13090,7 +12996,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -13098,7 +13004,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -13145,36 +13051,12 @@ } ] }, - { - "Input": "Thursdays at 17.30 Beijing time", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "thursdays at 17.30 beijing time", - "Start": 0, - "End": 30, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-4T17:30", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Race - 3pm - this week", "Context": { "ReferenceDateTime": "2020-06-16T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "3pm", @@ -13214,7 +13096,7 @@ "Context": { "ReferenceDateTime": "2020-06-16T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "today", @@ -13273,7 +13155,7 @@ "Context": { "ReferenceDateTime": "2020-06-16T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "may 25th", @@ -13347,30 +13229,6 @@ } ] }, - { - "Input": "Add meeting with boss to my calendar - Tuesdays at 9am", - "Context": { - "ReferenceDateTime": "2020-06-16T12:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "tuesdays at 9am", - "Start": 39, - "End": 53, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2T09", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Tune in tomorrow, 13/04/21, at 7 PM CET for episode 3 of Decentralized", "Context": { @@ -13516,29 +13374,6 @@ } ] }, - { - "Input": "It's an everyday routine.", - "Context": { - "ReferenceDateTime": "2018-11-30T12:00:00" - }, - "Results": [ - { - "Text": "everyday", - "Start": 8, - "End": 15, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "We meet in half an hour", "Context": { diff --git a/Specs/DateTime/English/DateTimeModelExperimentalMode.json b/Specs/DateTime/English/DateTimeModelExperimentalMode.json index c04df16715..4e2ca002d1 100644 --- a/Specs/DateTime/English/DateTimeModelExperimentalMode.json +++ b/Specs/DateTime/English/DateTimeModelExperimentalMode.json @@ -1186,213 +1186,6 @@ } ] }, - { - "Input": "I'll leave weekly", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "weekly", - "Start": 11, - "End": 16, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave every day", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "every day", - "Start": 11, - "End": 19, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave everyday", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "everyday", - "Start": 11, - "End": 18, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave annually", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "annually", - "Start": 11, - "End": 18, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave each two days", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "each two days", - "Start": 11, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave every three week", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "every three week", - "Start": 11, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave 3pm each day", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "3pm each day", - "Start": 11, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave every monday", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "every monday", - "Start": 11, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I'll leave each monday at 4pm", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "each monday at 4pm", - "Start": 11, - "End": 28, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "I'll be back 7:56:30 pm", "Context": { @@ -2760,21 +2553,6 @@ "ReferenceDateTime": "2018-05-20T00:00:00" }, "Results": [ - { - "Text": "each week", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 28, @@ -2800,21 +2578,6 @@ }, "NotSupported": "javascript, python", "Results": [ - { - "Text": "each week", - "Start": 66, - "End": 74, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 136, @@ -7596,98 +7359,6 @@ } ] }, - { - "Input": "Let's meet once a week", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a week", - "Start": 11, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Have vitamins one a day", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "one a day", - "Start": 14, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I go on vacation once a year", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a year", - "Start": 17, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Let's have a quarterly meeting.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "quarterly", - "Start": 13, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "my vacation will start from October", "Context": { diff --git a/Specs/DateTime/English/DateTimeModelExtendedTypes.json b/Specs/DateTime/English/DateTimeModelExtendedTypes.json index 4fb1f0261b..97069b18c7 100644 --- a/Specs/DateTime/English/DateTimeModelExtendedTypes.json +++ b/Specs/DateTime/English/DateTimeModelExtendedTypes.json @@ -709,7 +709,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "2 hours", @@ -749,7 +749,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "2 hours", @@ -789,7 +789,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "2 hours", @@ -829,7 +829,7 @@ "Context": { "ReferenceDateTime": "2018-03-25T01:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "10 minutes", @@ -869,7 +869,7 @@ "Context": { "ReferenceDateTime": "2018-04-27T15:47:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "three hours", @@ -909,7 +909,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "5/17/2018", @@ -933,7 +933,7 @@ "Context": { "ReferenceDateTime": "2018-05-07T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "5/17", @@ -962,7 +962,7 @@ "Context": { "ReferenceDateTime": "2018-05-07T00:00:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "may 17", @@ -992,21 +992,6 @@ "ReferenceDateTime": "2018-05-20T00:00:00" }, "Results": [ - { - "Text": "each week", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 0, - "End": 8 - }, { "Text": "this week", "TypeName": "datetimeV2.daterange", @@ -1030,23 +1015,8 @@ "Context": { "ReferenceDateTime": "2018-05-20T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ - { - "Text": "each week", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 66, - "End": 74 - }, { "Text": "this week", "TypeName": "datetimeV2.daterange", @@ -1570,7 +1540,7 @@ "Context": { "ReferenceDateTime": "2018-08-08T10:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -1579,7 +1549,7 @@ "Context": { "ReferenceDateTime": "2018-08-08T10:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -1799,58 +1769,12 @@ } ] }, - { - "Input": "Let's meet once a week", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a week", - "Start": 11, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "I go on vacation once a year", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a year", - "Start": 17, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "The request is ABC-12345-A1B2C3 this round. Let's arrange a 30 minutes call this week. Look forward to speaking again this week.", "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "30 minutes", @@ -1906,7 +1830,7 @@ "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "last week", @@ -1931,7 +1855,7 @@ "Context": { "ReferenceDateTime": "2019-09-09T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { diff --git a/Specs/DateTime/English/DateTimeParser.json b/Specs/DateTime/English/DateTimeParser.json index 2fdd6bd7d7..9d94781207 100644 --- a/Specs/DateTime/English/DateTimeParser.json +++ b/Specs/DateTime/English/DateTimeParser.json @@ -45,6 +45,52 @@ } ] }, + { + "Input": "I'll go back on 15 at 00:00", + "Context": { + "ReferenceDateTime": "2023-11-07T00:00:00" + }, + "Results": [ + { + "Text": "15 at 00:00", + "Type": "datetime", + "Value": { + "Timex": "XXXX-XX-15T00:00", + "FutureResolution": { + "dateTime": "2023-11-15 00:00:00" + }, + "PastResolution": { + "dateTime": "2023-10-15 00:00:00" + } + }, + "Start": 16, + "Length": 11 + } + ] + }, + { + "Input": "I'll go back on 15 at 00:00:00", + "Context": { + "ReferenceDateTime": "2023-11-07T00:00:00" + }, + "Results": [ + { + "Text": "15 at 00:00:00", + "Type": "datetime", + "Value": { + "Timex": "XXXX-XX-15T00:00:00", + "FutureResolution": { + "dateTime": "2023-11-15 00:00:00" + }, + "PastResolution": { + "dateTime": "2023-10-15 00:00:00" + } + }, + "Start": 16, + "Length": 14 + } + ] + }, { "Input": "I'll go back on 15 at 8:00", "Context": { diff --git a/Specs/DateTime/English/DateTimePeriodExtractor.json b/Specs/DateTime/English/DateTimePeriodExtractor.json index 9a66ff83bc..71db0748ef 100644 --- a/Specs/DateTime/English/DateTimePeriodExtractor.json +++ b/Specs/DateTime/English/DateTimePeriodExtractor.json @@ -873,7 +873,7 @@ }, { "Input": "Can you schedule us 2015-09-23 1:30p.m. to 4.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015-09-23 1:30p.m. to 4", @@ -933,7 +933,7 @@ }, { "Input": "It will happen 1/1/2015 between 10 and 11:30", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1/1/2015 between 10 and 11:30", @@ -957,7 +957,7 @@ }, { "Input": "It will happen between 3 and 5 on 1/1/2015", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 3 and 5 on 1/1/2015", @@ -969,7 +969,7 @@ }, { "Input": "It will happen from 3:30 to 5:55 on 1/1/2015", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 3:30 to 5:55 on 1/1/2015", @@ -981,7 +981,7 @@ }, { "Input": "It will happen 1/1/2015 after 2:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1/1/2015 after 2:00", @@ -993,7 +993,7 @@ }, { "Input": "It will happen today before 4pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "today before 4pm", @@ -1005,7 +1005,7 @@ }, { "Input": "It will happen next Wednesday later than 10 in the morning", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "next Wednesday later than 10 in the morning", @@ -1017,7 +1017,7 @@ }, { "Input": "It happened on previous Tuesday by 2 in the afternoon", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "previous Tuesday by 2 in the afternoon", @@ -1029,7 +1029,7 @@ }, { "Input": "Let's go on Feb 1st no later than 6:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "Feb 1st no later than 6:00", @@ -1041,7 +1041,7 @@ }, { "Input": "Make me unavailable from 12-04-2019 6:00am until 12-05-2019 8:00pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 12-04-2019 6:00am until 12-05-2019 8:00pm", @@ -1053,7 +1053,7 @@ }, { "Input": "It happened on next week after 2:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] } ] \ No newline at end of file diff --git a/Specs/DateTime/English/DateTimePeriodParser.json b/Specs/DateTime/English/DateTimePeriodParser.json index a44b6916e9..545b232121 100644 --- a/Specs/DateTime/English/DateTimePeriodParser.json +++ b/Specs/DateTime/English/DateTimePeriodParser.json @@ -1779,7 +1779,7 @@ "Context": { "ReferenceDateTime": "2017-11-14T19:12:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "in the afternoon on Friday between 1PM and 4 PM", @@ -1831,7 +1831,7 @@ "Context": { "ReferenceDateTime": "2017-11-17T19:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2018-09-23 1:30p.m. to 4", @@ -2273,7 +2273,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1/1/2015 between 10 and 11:30", @@ -2325,7 +2325,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 3 and 5 on 1/1/2015", @@ -2351,7 +2351,7 @@ "Context": { "ReferenceDateTime": "2018-05-16T08:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 3:30 to 5:55 on 1/1/2015", @@ -2429,7 +2429,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "between half past seven and 4pm of tomorrow", diff --git a/Specs/DateTime/English/DurationExtractor.json b/Specs/DateTime/English/DurationExtractor.json index 8780700be9..89bc6eb5b5 100644 --- a/Specs/DateTime/English/DurationExtractor.json +++ b/Specs/DateTime/English/DurationExtractor.json @@ -595,7 +595,7 @@ }, { "Input": "I'll leave for 1 year 1 month 21 days", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1 year 1 month 21 days", @@ -607,7 +607,7 @@ }, { "Input": "I'll leave for 2 days 1 month", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2 days 1 month", @@ -641,7 +641,7 @@ }, { "Input": "Can we wait another business day?", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "another business day", @@ -653,7 +653,7 @@ }, { "Input": "I'll leave for half an business days.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "half an business days", @@ -665,7 +665,7 @@ }, { "Input": "I'll leave for two decades.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "two decades", @@ -677,7 +677,7 @@ }, { "Input": "I'll leave for a fortnight.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "a fortnight", diff --git a/Specs/DateTime/English/MergedParser.json b/Specs/DateTime/English/MergedParser.json index 53d4eed62b..beb3e7304a 100644 --- a/Specs/DateTime/English/MergedParser.json +++ b/Specs/DateTime/English/MergedParser.json @@ -676,7 +676,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { @@ -755,21 +755,6 @@ }, "Start": 22, "Length": 4 - }, - { - "Text": "every week", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 27, - "Length": 10 } ] }, @@ -793,21 +778,6 @@ }, "Start": 9, "Length": 15 - }, - { - "Text": "each month", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 28, - "Length": 10 } ] }, @@ -3835,7 +3805,7 @@ "ReferenceDateTime": "2018-06-26T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "2007", @@ -3929,7 +3899,7 @@ "ReferenceDateTime": "2018-06-26T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "the year", @@ -3955,7 +3925,7 @@ "ReferenceDateTime": "2018-07-02T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "the week", @@ -4007,7 +3977,7 @@ "ReferenceDateTime": "2018-07-02T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "week 31", @@ -4033,7 +4003,7 @@ "ReferenceDateTime": "2018-07-05T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "in 3 hours", @@ -4058,7 +4028,7 @@ "ReferenceDateTime": "2018-07-05T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "in 2 weeks", @@ -4083,7 +4053,7 @@ "ReferenceDateTime": "2018-07-05T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "in 2 days", @@ -4108,7 +4078,7 @@ "ReferenceDateTime": "2018-07-05T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "in 2 months", @@ -4133,7 +4103,7 @@ "ReferenceDateTime": "2018-07-05T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "in 2 years", @@ -4158,7 +4128,7 @@ "ReferenceDateTime": "2018-07-05T00:00:00" }, "NotSupported": "javascript", - "NotSupportedByDesign": "python", + "NotSupportedByDesign": "", "Results": [ { "Text": "2 days from today", diff --git a/Specs/DateTime/English/SetExtractor.json b/Specs/DateTime/English/SetExtractor.json deleted file mode 100644 index 6f7f20824f..0000000000 --- a/Specs/DateTime/English/SetExtractor.json +++ /dev/null @@ -1,349 +0,0 @@ -[ - { - "Input": "I'll leave weekly", - "Results": [ - { - "Text": "weekly", - "Type": "set", - "Start": 11, - "Length": 6 - } - ] - }, - { - "Input": "I'll leave daily", - "Results": [ - { - "Text": "daily", - "Type": "set", - "Start": 11, - "Length": 5 - } - ] - }, - { - "Input": "I'll leave every day", - "Results": [ - { - "Text": "every day", - "Type": "set", - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "I'll leave each month", - "Results": [ - { - "Text": "each month", - "Type": "set", - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "I'll leave annually", - "Results": [ - { - "Text": "annually", - "Type": "set", - "Start": 11, - "Length": 8 - } - ] - }, - { - "Input": "I'll leave annual", - "Results": [ - { - "Text": "annual", - "Type": "set", - "Start": 11, - "Length": 6 - } - ] - }, - { - "Input": "I'll leave each two days", - "Results": [ - { - "Text": "each two days", - "Type": "set", - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "I'll leave every three week", - "Results": [ - { - "Text": "every three week", - "Type": "set", - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "I'll leave 3pm every day", - "Results": [ - { - "Text": "3pm every day", - "Type": "set", - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "I'll leave 3pm each day", - "Results": [ - { - "Text": "3pm each day", - "Type": "set", - "Start": 11, - "Length": 12 - } - ] - }, - { - "Input": "I'll leave each 4/15", - "Results": [ - { - "Text": "each 4/15", - "Type": "set", - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "I'll leave every monday", - "Results": [ - { - "Text": "every monday", - "Type": "set", - "Start": 11, - "Length": 12 - } - ] - }, - { - "Input": "I'll leave each monday 4pm", - "Results": [ - { - "Text": "each monday 4pm", - "Type": "set", - "Start": 11, - "Length": 15 - } - ] - }, - { - "Input": "I'll leave every morning", - "Results": [ - { - "Text": "every morning", - "Type": "set", - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "I'll leave every morning at 9am", - "Results": [ - { - "Text": "every morning at 9am", - "Type": "set", - "Start": 11, - "Length": 20 - } - ] - }, - { - "Input": "I'll leave every afternoon at 4pm", - "Results": [ - { - "Text": "every afternoon at 4pm", - "Type": "set", - "Start": 11, - "Length": 22 - } - ] - }, - { - "Input": "I'll leave every night at 9pm", - "Results": [ - { - "Text": "every night at 9pm", - "Type": "set", - "Start": 11, - "Length": 18 - } - ] - }, - { - "Input": "I'll leave every night at 9", - "Results": [ - { - "Text": "every night at 9", - "Type": "set", - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "I'll leave mornings at 9am", - "Results": [ - { - "Text": "mornings at 9am", - "Type": "set", - "Start": 11, - "Length": 15 - } - ] - }, - { - "Input": "I'll leave on mornings at 9", - "Results": [ - { - "Text": "on mornings at 9", - "Type": "set", - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "I'll leave at 9am every Sunday", - "Results": [ - { - "Text": "9am every Sunday", - "Type": "set", - "Start": 14, - "Length": 16 - } - ] - }, - { - "Input": "I'll leave at 9am on Mondays", - "Results": [ - { - "Text": "9am on Mondays", - "Type": "set", - "Start": 14, - "Length": 14 - } - ] - }, - { - "Input": "I'll leave at 9am Mondays", - "Results": [ - { - "Text": "9am Mondays", - "Type": "set", - "Start": 14, - "Length": 11 - } - ] - }, - { - "Input": "I'll leave on Mondays", - "Results": [ - { - "Text": "on Mondays", - "Type": "set", - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "I'll leave on Sundays", - "Results": [ - { - "Text": "on Sundays", - "Type": "set", - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "I'll leave Sundays", - "Results": [ - { - "Text": "Sundays", - "Type": "set", - "Start": 11, - "Length": 7 - } - ] - }, - { - "Input": "Can I do a booking for the 09th of May for 2 nights?", - "Results": [ - { - "Text": "nights", - "Type": "set", - "Start": 45, - "Length": 6 - } - ] - }, - { - "Input": "Let's meet once a week", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a week", - "Type": "set", - "Start": 11, - "Length": 11 - } - ] - }, - { - "Input": "I go on vacation once a year", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a year", - "Type": "set", - "Start": 17, - "Length": 11 - } - ] - }, - { - "Input": "Every other Friday", - "Results": [ - { - "Text": "Every other Friday", - "Type": "set", - "Start": 0, - "Length": 18 - } - ] - }, - { - "Input": "Let's have a quarterly meeting.", - "Results": [ - { - "Text": "quarterly", - "Type": "set", - "Start": 13, - "Length": 9 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/English/SetParser.json b/Specs/DateTime/English/SetParser.json deleted file mode 100644 index 2b3eaadc17..0000000000 --- a/Specs/DateTime/English/SetParser.json +++ /dev/null @@ -1,738 +0,0 @@ -[ - { - "Input": "I'll leave weekly", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2744475+08:00" - }, - "Results": [ - { - "Text": "weekly", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 11, - "Length": 6 - } - ] - }, - { - "Input": "I'll leave biweekly", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2754476+08:00" - }, - "Results": [ - { - "Text": "biweekly", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 11, - "Length": 8 - } - ] - }, - { - "Input": "I'll leave daily", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2779449+08:00" - }, - "Results": [ - { - "Text": "daily", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 11, - "Length": 5 - } - ] - }, - { - "Input": "I'll leave every day", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2794445+08:00" - }, - "Results": [ - { - "Text": "every day", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "I'll leave each month", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2829445+08:00" - }, - "Results": [ - { - "Text": "each month", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "I'll leave annually", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2844439+08:00" - }, - "Results": [ - { - "Text": "annually", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 11, - "Length": 8 - } - ] - }, - { - "Input": "I'll leave annual", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2854444+08:00" - }, - "Results": [ - { - "Text": "annual", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 11, - "Length": 6 - } - ] - }, - { - "Input": "I'll leave each two days", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2909444+08:00" - }, - "Results": [ - { - "Text": "each two days", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "I'll leave every three week", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2959472+08:00" - }, - "Results": [ - { - "Text": "every three week", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "I'll leave 3pm every day", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2989494+08:00" - }, - "Results": [ - { - "Text": "3pm every day", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "I'll leave 3pm each day", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3039501+08:00" - }, - "Results": [ - { - "Text": "3pm each day", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 11, - "Length": 12 - } - ] - }, - { - "Input": "I'll leave each 4/15", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3109498+08:00" - }, - "Results": [ - { - "Text": "each 4/15", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "I'll leave every monday", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3259514+08:00" - }, - "Results": [ - { - "Text": "every monday", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 11, - "Length": 12 - } - ] - }, - { - "Input": "I'll leave each monday 4pm", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3379507+08:00" - }, - "Results": [ - { - "Text": "each monday 4pm", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 11, - "Length": 15 - } - ] - }, - { - "Input": "I'll leave every morning", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3429518+08:00" - }, - "Results": [ - { - "Text": "every morning", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "I'll leave every morning at 9am", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3609535+08:00" - }, - "Results": [ - { - "Text": "every morning at 9am", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 11, - "Length": 20 - } - ] - }, - { - "Input": "I'll leave every afternoon at 4pm", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3730732+08:00" - }, - "Results": [ - { - "Text": "every afternoon at 4pm", - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - }, - "Start": 11, - "Length": 22 - } - ] - }, - { - "Input": "I'll leave every night at 9pm", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3840706+08:00" - }, - "Results": [ - { - "Text": "every night at 9pm", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 11, - "Length": 18 - } - ] - }, - { - "Input": "I'll leave every night at 9", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3930718+08:00" - }, - "Results": [ - { - "Text": "every night at 9", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "I'll leave mornings at 9am", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4065719+08:00" - }, - "Results": [ - { - "Text": "mornings at 9am", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 11, - "Length": 15 - } - ] - }, - { - "Input": "I'll leave on mornings at 9", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4170727+08:00" - }, - "Results": [ - { - "Text": "on mornings at 9", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "I'll leave at 9am every Sunday", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4295727+08:00" - }, - "Results": [ - { - "Text": "9am every Sunday", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 16 - } - ] - }, - { - "Input": "I'll leave at 9am on Sundays", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.438575+08:00" - }, - "Results": [ - { - "Text": "9am on Sundays", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 14 - } - ] - }, - { - "Input": "I'll leave at 9am Sundays", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4505726+08:00" - }, - "Results": [ - { - "Text": "9am Sundays", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 11 - } - ] - }, - { - "Input": "I'll leave on Mondays", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4570731+08:00" - }, - "Results": [ - { - "Text": "on Mondays", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "I'll leave on Sundays", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4635727+08:00" - }, - "Results": [ - { - "Text": "on Sundays", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "I'll leave Sundays", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4710739+08:00" - }, - "Results": [ - { - "Text": "Sundays", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 11, - "Length": 7 - } - ] - }, - { - "Input": "I go on vacation once a year", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a year", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 17, - "Length": 11 - } - ] - }, - { - "Input": "Let's meet once a week", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "once a week", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 11, - "Length": 11 - } - ] - }, - { - "Input": "Every other Friday", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "Results": [ - { - "Text": "Every other Friday", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-5", - "FutureResolution": { - "set": "Set: XXXX-WXX-5" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-5" - } - }, - "Start": 0, - "Length": 18 - } - ] - }, - { - "Input": "Let's have a quarterly meeting.", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "Results": [ - { - "Text": "quarterly", - "Type": "set", - "Value": { - "Timex": "P3M", - "FutureResolution": { - "set": "Set: P3M" - }, - "PastResolution": { - "set": "Set: P3M" - } - }, - "Start": 13, - "Length": 9 - } - ] - }, - { - "Input": "It's an everyday routine.", - "Context": { - "ReferenceDateTime": "2018-11-30T12:00:00" - }, - "Results": [ - { - "Text": "everyday", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 8, - "Length": 8 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/English/TimeExtractor.json b/Specs/DateTime/English/TimeExtractor.json index a5c6e67e2b..998e4af51b 100644 --- a/Specs/DateTime/English/TimeExtractor.json +++ b/Specs/DateTime/English/TimeExtractor.json @@ -120,6 +120,17 @@ } ] }, + { + "Input": "I'll be back 00:00:00", + "Results": [ + { + "Text": "00:00:00", + "Type": "time", + "Start": 13, + "Length": 8 + } + ] + }, { "Input": "I'll be back 00:00:30", "Results": [ @@ -307,6 +318,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": [ diff --git a/Specs/DateTime/English/TimeParser.json b/Specs/DateTime/English/TimeParser.json index c5afe910b3..3908b3e6b4 100644 --- a/Specs/DateTime/English/TimeParser.json +++ b/Specs/DateTime/English/TimeParser.json @@ -299,6 +299,26 @@ } ] }, + { + "Input": "I'll be back 00:00", + "Results": [ + { + "Text": "00:00", + "Type": "time", + "Value": { + "Timex": "T00:00", + "FutureResolution": { + "time": "00:00:00" + }, + "PastResolution": { + "time": "00:00:00" + } + }, + "Start": 13, + "Length": 5 + } + ] + }, { "Input": "I'll be back 12:34", "Results": [ @@ -659,6 +679,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": [ @@ -1561,7 +1661,7 @@ }, { "Input": "I'll be back at 7h01", - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "7h01", @@ -1582,7 +1682,7 @@ }, { "Input": "I'll be back at 10 H 10 pm.", - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "10 H 10 pm", @@ -1603,7 +1703,7 @@ }, { "Input": "I'll be back at three min past 10 H 10 pm.", - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "three min past 10 H 10 pm", diff --git a/Specs/DateTime/English/TimePeriodExtractor.json b/Specs/DateTime/English/TimePeriodExtractor.json index 1bc85cb6b2..6f84a9ed06 100644 --- a/Specs/DateTime/English/TimePeriodExtractor.json +++ b/Specs/DateTime/English/TimePeriodExtractor.json @@ -601,7 +601,7 @@ }, { "Input": "set up meeting between 10 and 11:30", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 10 and 11:30", @@ -613,7 +613,7 @@ }, { "Input": "set up meeting between 10:10am and 12:50", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 10:10am and 12:50", @@ -625,7 +625,7 @@ }, { "Input": "set up meeting between 10:10pm and 3", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 10:10pm and 3", @@ -637,7 +637,7 @@ }, { "Input": "set up meeting from 10:10pm to 10", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 10:10pm to 10", @@ -649,7 +649,7 @@ }, { "Input": "set up meeting from 10:30am to 23", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 10:30am to 23", @@ -661,7 +661,7 @@ }, { "Input": "Don't call me in the business hours", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "in the business hours", @@ -673,7 +673,7 @@ }, { "Input": "I'll be out lunch time", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "lunch time", @@ -685,7 +685,7 @@ }, { "Input": "He is at lunch", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "at lunch", @@ -697,7 +697,7 @@ }, { "Input": "This popular family friendly concert returns to the Hall for another lunchtime filled with traditional carols and festive favourites", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "lunchtime", diff --git a/Specs/DateTime/English/TimePeriodParser.json b/Specs/DateTime/English/TimePeriodParser.json index 8885dee761..3f3ae4433c 100644 --- a/Specs/DateTime/English/TimePeriodParser.json +++ b/Specs/DateTime/English/TimePeriodParser.json @@ -1141,7 +1141,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupported": "python", + "NotSupported": "", "Results": [ { "Text": "from 0:01 am to 1 pm", @@ -1167,7 +1167,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 0:01 am to 1", @@ -1418,7 +1418,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 10 and 11:30", @@ -1444,7 +1444,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 10:10am and 12:50", @@ -1470,7 +1470,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "between 10:10pm and 3", @@ -1496,7 +1496,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 10:10pm to 10", @@ -1522,7 +1522,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "from 10:30am to 23", @@ -1548,7 +1548,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "in the business hours", @@ -1600,7 +1600,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "at lunch", @@ -1626,7 +1626,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "lunchtime", diff --git a/Specs/DateTime/English/TimeZoneExtractor.json b/Specs/DateTime/English/TimeZoneExtractor.json deleted file mode 100644 index 0500c012e6..0000000000 --- a/Specs/DateTime/English/TimeZoneExtractor.json +++ /dev/null @@ -1,290 +0,0 @@ -[ - { - "Input": "Book me a room at beijing time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "beijing time", - "Type": "timezone", - "Start": 18, - "Length": 12 - } - ] - }, - { - "Input": "Book me a room at utc4:30", - "NotSupported": "javascript", - "Results": [ - { - "Text": "utc4:30", - "Type": "timezone", - "Start": 18, - "Length": 7 - } - ] - }, - { - "Input": "Book me a room at gmt-3", - "NotSupported": "javascript", - "Results": [ - { - "Text": "gmt-3", - "Type": "timezone", - "Start": 18, - "Length": 5 - } - ] - }, - { - "Input": "Book me a room at afghanistan standard time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "afghanistan standard time", - "Type": "timezone", - "Start": 18, - "Length": 25 - } - ] - }, - { - "Input": "Book me a room at aft", - "NotSupported": "javascript", - "Results": [ - { - "Text": "aft", - "Type": "timezone", - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at beijing-time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "beijing-time", - "Type": "timezone", - "Start": 18, - "Length": 12 - } - ] - }, - { - "Input": "Book me a room at St. Louis-time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "St. Louis-time", - "Type": "timezone", - "Start": 18, - "Length": 14 - } - ] - }, - { - "Input": "Book me a room at San José Time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "San José Time", - "Type": "timezone", - "Start": 18, - "Length": 13 - } - ] - }, - { - "Input": "For me, Christchurch Time, Colchester-time or Edinburgh time is OK.", - "NotSupported": "javascript", - "Results": [ - { - "Text": "Christchurch Time", - "Type": "timezone", - "Start": 8, - "Length": 17 - }, - { - "Text": "Colchester-time", - "Type": "timezone", - "Start": 27, - "Length": 15 - }, - { - "Text": "Edinburgh time", - "Type": "timezone", - "Start": 46, - "Length": 14 - } - ] - }, - { - "Input": "Cortana will email you to find a time which works in the Sydney timezone.", - "NotSupported": "javascript", - "Results": [ - { - "Text": "Sydney timezone", - "Type": "timezone", - "Start": 57, - "Length": 15 - } - ] - }, - { - "Input": "Cortana will email you to find a time which works in the Montréal time.", - "NotSupported": "javascript", - "Results": [ - { - "Text": "Montréal time", - "Type": "timezone", - "Start": 57, - "Length": 13 - } - ] - }, - { - "Input": "Cortana will email you to find a time which works in the Montreal time.", - "NotSupported": "javascript", - "Results": [ - { - "Text": "Montreal time", - "Type": "timezone", - "Start": 57, - "Length": 13 - } - ] - }, - { - "Input": "Book me a room at pt", - "NotSupported": "javascript", - "Results": [ - { - "Text": "pt", - "Type": "timezone", - "Start": 18, - "Length": 2 - } - ] - }, - { - "Input": "Book me a room at et", - "NotSupported": "javascript", - "Results": [ - { - "Text": "et", - "Type": "timezone", - "Start": 18, - "Length": 2 - } - ] - }, - { - "Input": "let's meet Saint Barthélemy time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "Saint Barthélemy time", - "Type": "timezone", - "Start": 11, - "Length": 21 - } - ] - }, - { - "Input": "let's meet saint barthelemy timezone", - "NotSupported": "javascript", - "Results": [ - { - "Text": "saint barthelemy timezone", - "Type": "timezone", - "Start": 11, - "Length": 25 - } - ] - }, - { - "Input": "It is the outcome of the vote that counts.", - "Comment": "This case is to verify that the utc substring won't be extracted from the word outcome.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "Show me times at Lincoln Square", - "Comment": "This case is to verify that the 'me time' substring won't be extracted from the 'me times'.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "I said New York time, not York time", - "Comment": "Extract longest item when there are some overlap items", - "NotSupported": "javascript", - "Results": [ - { - "Text": "New York time", - "Type": "timezone", - "Start": 7, - "Length": 13 - }, - { - "Text": "York time", - "Type": "timezone", - "Start": 26, - "Length": 9 - } - ] - }, - { - "Input": "I'm in the pacific timezone", - "NotSupported": "javascript", - "Results": [ - { - "Text": "pacific timezone", - "Type": "timezone", - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "Let's meet at 1pm mountain timezone", - "NotSupported": "javascript", - "Results": [ - { - "Text": "mountain timezone", - "Type": "timezone", - "Start": 18, - "Length": 17 - } - ] - }, - { - "Input": "It's 1pm Eastern Daylight Time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "eastern daylight time", - "Type": "timezone", - "Start": 9, - "Length": 21 - } - ] - }, - { - "Input": "It's about 1pm ACDT", - "NotSupported": "javascript", - "Results": [ - { - "Text": "acdt", - "Type": "timezone", - "Start": 15, - "Length": 4 - } - ] - }, - { - "Input": "Once upon a time...", - "NotSupported": "javascript", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/DateTime/English/TimeZoneParser.json b/Specs/DateTime/English/TimeZoneParser.json deleted file mode 100644 index 587e52255c..0000000000 --- a/Specs/DateTime/English/TimeZoneParser.json +++ /dev/null @@ -1,1026 +0,0 @@ -[ - { - "Input": "Book me a room at beijing time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "beijing time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 18, - "Length": 12 - } - ] - }, - { - "Input": "Book me a room at utc4:30", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "utc4:30", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 18, - "Length": 7 - } - ] - }, - { - "Input": "Book me a room at gmt-3", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "gmt-3", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-03:00", - "UtcOffsetMins": -180 - } - }, - "Start": 18, - "Length": 5 - } - ] - }, - { - "Input": "Book me a room at afghanistan standard time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "afghanistan standard time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 18, - "Length": 25 - } - ] - }, - { - "Input": "Book me a room at aft", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "aft", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at utc±0", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "utc±0", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+00:00", - "UtcOffsetMins": 0 - } - }, - "Start": 18, - "Length": 5 - } - ] - }, - { - "Input": "Book me a room at pdst", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "pdst", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 18, - "Length": 4 - } - ] - }, - { - "Input": "Book me a room at awdt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "awdt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 18, - "Length": 4 - } - ] - }, - { - "Input": "Book me a room at cot", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "cot", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at hkt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "hkt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at pacific daylight saving time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "pacific daylight saving time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 18, - "Length": 28 - } - ] - }, - { - "Input": "Book me a room at austrialian western daylight time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "austrialian western daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 18, - "Length": 33 - } - ] - }, - { - "Input": "Book me a room at australian western daylight time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "australian western daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 18, - "Length": 32 - } - ] - }, - { - "Input": "Book me a room at australian west daylight time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "australian west daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 18, - "Length": 29 - } - ] - }, - { - "Input": "Book me a room at colombia time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "colombia time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 18, - "Length": 13 - } - ] - }, - { - "Input": "Book me a room at hong kong time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "hong kong time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 18, - "Length": 14 - } - ] - }, - { - "Input": "Book me a room at aedt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "aedt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+11:00", - "UtcOffsetMins": 660 - } - }, - "Start": 18, - "Length": 4 - } - ] - }, - { - "Input": "Book me a room at pdt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "pdt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at tost", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "tost", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+14:00", - "UtcOffsetMins": 840 - } - }, - "Start": 18, - "Length": 4 - } - ] - }, - { - "Input": "Book me a room at pacific daylight time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "pacific daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 18, - "Length": 21 - } - ] - }, - { - "Input": "Book me a room at 10:30am montreal time.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "montreal time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 26, - "Length": 13 - } - ] - }, - { - "Input": "Book me a room at Saint Barthélemy time.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "Saint Barthélemy time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 18, - "Length": 21 - } - ] - }, - { - "Input": "Book me a room at 16:30 WET.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "WET", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+00:00", - "UtcOffsetMins": 0 - } - }, - "Start": 24, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at 16:30 Central Europe Std Time.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "Central Europe Std Time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+01:00", - "UtcOffsetMins": 60 - } - }, - "Start": 24, - "Length": 23 - } - ] - }, - { - "Input": "We can do either New York time or Sao Paulo time.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "New York time", - "Start": 17, - "Length": 13, - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - } - }, - { - "Text": "Sao Paulo time", - "Start": 34, - "Length": 14, - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - } - } - ] - }, - { - "Input": "Make sure to accommodate west coast timezone.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "west coast timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 25, - "Length": 19 - } - ] - }, - { - "Input": "tonight at 6PM CDT time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "CDT", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - }, - "Start": 15, - "Length": 3 - } - ] - }, - { - "Input": "Please schedule 30 minute teams call during central time business hours", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Comment": "Central by default resolves to standard time, not daylight. Returning both options is in the roadmap.", - "NotSupported": "javascript", - "Results": [ - { - "Text": "central time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-06:00", - "UtcOffsetMins": -360 - } - }, - "Start": 44, - "Length": 12 - } - ] - }, - { - "Input": "I’m open at 11:30 AMPDT/1:30CST today", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet, javascript, java, python", - "Results": [ - { - "Text": "PDT", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 20, - "Length": 3 - }, - { - "Text": "CST", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 28, - "Length": 3 - } - ] - }, - { - "Input": "I'm in the pacific timezone", - "NotSupported": "javascript", - "Results": [ - { - "Text": "pacific timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "value": "UTC-08:00", - "utcOffsetMins": "-480" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "Let's meet at 1pm mountain timezone", - "NotSupported": "javascript", - "Comment": "Mountain by default resolves to standard time, not daylight. Returning both options is in the roadmap.", - "Results": [ - { - "Text": "mountain timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "-420", - "value": "UTC-07:00" - } - }, - "Start": 18, - "Length": 17 - } - ] - }, - { - "Input": "I'm in the Madrid time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "Madrid time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 11, - "Length": 11 - } - ] - }, - { - "Input": "I'm in the Madrid timezone", - "NotSupported": "javascript", - "Results": [ - { - "Text": "Madrid timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 11, - "Length": 15 - } - ] - }, - { - "Input": "I'm in the Madrid timezone", - "NotSupported": "javascript", - "Results": [ - { - "Text": "Madrid timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "I'm in Madrid.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "I'm on Russia time zone 3", - "NotSupported": "javascript", - "Results": [ - { - "Text": "russia time zone 3", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "240", - "value": "UTC+04:00" - } - }, - "Start": 7, - "Length": 18 - } - ] - }, - { - "Input": "All times in central standard time (mexico)", - "NotSupported": "javascript", - "Results": [ - { - "Text": "central standard time (mexico)", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "-360", - "value": "UTC-06:00" - } - }, - "Start": 13, - "Length": 30 - } - ] - }, - { - "Input": "I'm on Russia time zone 10", - "NotSupported": "javascript", - "Results": [ - { - "Text": "russia time zone 10", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "660", - "value": "UTC+11:00" - } - }, - "Start": 7, - "Length": 19 - } - ] - }, - { - "Input": "I'm at MSK+7, not MSK", - "NotSupported": "javascript", - "Results": [ - { - "Text": "MSK+7", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "600", - "value": "UTC+10:00" - } - }, - "Start": 7, - "Length": 5 - }, - { - "Text": "MSK", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "180", - "value": "UTC+03:00" - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "I'm at MSK-1.", - "NotSupported": "javascript", - "Results": [ - { - "Text": "MSK-1", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "120", - "value": "UTC+02:00" - } - }, - "Start": 7, - "Length": 5 - } - ] - }, - { - "Input": "Book me a room at UTC + 4", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "utc + 4", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:00", - "UtcOffsetMins": 240 - } - }, - "Start": 18, - "Length": 7 - } - ] - }, - { - "Input": "Book me a room at UTC -4", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "UTC -4", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-04:00", - "UtcOffsetMins": -240 - } - }, - "Start": 18, - "Length": 6 - } - ] - }, - { - "Input": "I'm at Eastern Daylight Time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "eastern daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 7, - "Length": 21 - } - ] - }, - { - "Input": "I'm at Central Daylight Time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "central daylight Time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 7, - "Length": 21 - } - ] - }, - { - "Input": "It's about 1pm ACDT", - "NotSupported": "javascript", - "Results": [ - { - "Text": "acdt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+10:30", - "UtcOffsetMins": 630 - } - }, - "Start": 15, - "Length": 4 - } - ] - }, - { - "Input": "Kiribati's Line Islands is in UTC+14", - "NotSupported": "javascript", - "Results": [ - { - "Text": "utc+14", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+14:00", - "UtcOffsetMins": 840 - } - }, - "Start": 30, - "Length": 6 - } - ] - }, - { - "Input": "All deadlines are 11.59 pm UTC -12h (\"anywhere on Earth / AoE\")", - "NotSupported": "javascript", - "Results": [ - { - "Text": "UTC -12h", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 27, - "Length": 8 - }, - { - "Text": "anywhere on earth", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 38, - "Length": 17 - }, - { - "Text": "aoe", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 58, - "Length": 3 - } - ] - }, - { - "Input": "Don't forget we're in UK time", - "NotSupported": "javascript", - "Results": [ - { - "Text": "uk time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 22, - "Length": 7 - } - ] - }, - { - "Input": "Can you find a slot in a US-friendly time?", - "NotSupported": "javascript,python,java", - "Results": [ - { - "Text": "US-friendly time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 25, - "Length": 16 - } - ] - } -] diff --git a/Specs/DateTime/EnglishOthers/DateParser.json b/Specs/DateTime/EnglishOthers/DateParser.json index 87fb54bc8f..2e3dc22382 100644 --- a/Specs/DateTime/EnglishOthers/DateParser.json +++ b/Specs/DateTime/EnglishOthers/DateParser.json @@ -67,5 +67,97 @@ "Length": 6 } ] + }, + { + "Input": "the photograph appeared in the 01/07 issue of the magazine", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "the 01/07", + "Type": "date", + "Value": { + "Timex": "XXXX-07-01", + "FutureResolution": { + "date": "2023-07-01" + }, + "PastResolution": { + "date": "2022-07-01" + } + }, + "Start": 27, + "Length": 9 + } + ] + }, + { + "Input": "the contract is expected to start on 10/11", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "10/11", + "Type": "date", + "Value": { + "Timex": "XXXX-11-10", + "FutureResolution": { + "date": "2023-11-10" + }, + "PastResolution": { + "date": "2022-11-10" + } + }, + "Start": 37, + "Length": 5 + } + ] + }, + { + "Input": "the software used in the 11/3/2020 election can be easily hacked", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "the 11/3/2020", + "Type": "date", + "Value": { + "Timex": "2020-03-11", + "FutureResolution": { + "date": "2020-03-11" + }, + "PastResolution": { + "date": "2020-03-11" + } + }, + "Start": 21, + "Length": 13 + } + ] + }, + { + "Input": "this article was published on 06/10/2020", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Text": "06/10/2020", + "Type": "date", + "Value": { + "Timex": "2020-10-06", + "FutureResolution": { + "date": "2020-10-06" + }, + "PastResolution": { + "date": "2020-10-06" + } + }, + "Start": 30, + "Length": 10 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/EnglishOthers/DateTimeModel.json b/Specs/DateTime/EnglishOthers/DateTimeModel.json index ddc0ec6008..df8a407f74 100644 --- a/Specs/DateTime/EnglishOthers/DateTimeModel.json +++ b/Specs/DateTime/EnglishOthers/DateTimeModel.json @@ -22,6 +22,29 @@ } ] }, + { + "Input": "I'll go back 5/3/23 @ 00:00:00", + "Context": { + "ReferenceDateTime": "2023-05-01T00:00:00" + }, + "Results": [ + { + "Text": "5/3/23 @ 00:00:00", + "Start": 13, + "End": 29, + "TypeName": "datetimeV2.datetime", + "Resolution": { + "values": [ + { + "timex": "2023-03-05T00:00:00", + "type": "datetime", + "value": "2023-03-05 00:00:00" + } + ] + } + } + ] + }, { "Input": "The date should be 05-Aug-2016", "Context": { @@ -913,6 +936,29 @@ } ] }, + { + "Input": "The target time is 00:00", + "Context": { + "ReferenceDateTime": "2023-12-26T00:00:00" + }, + "Results": [ + { + "Text": "00:00", + "Start": 19, + "End": 23, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T00:00", + "type": "time", + "value": "00:00:00" + } + ] + } + } + ] + }, { "Input": "I'll go back Sep-23-2020.", "Context": { @@ -1056,5 +1102,107 @@ } } ] + }, + { + "Input": "the photograph appeared in the 01/07 issue of the magazine", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 27, + "End": 35, + "Resolution": { + "values": [ + { + "timex": "XXXX-07-01", + "type": "date", + "value": "2022-07-01" + }, + { + "timex": "XXXX-07-01", + "type": "date", + "value": "2023-07-01" + } + ] + }, + "Text": "the 01/07", + "TypeName": "datetimeV2.date" + } + ] + }, + { + "Input": "the contract is expected to start on 10/11", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 37, + "End": 41, + "Resolution": { + "values": [ + { + "timex": "XXXX-11-10", + "type": "date", + "value": "2022-11-10" + }, + { + "timex": "XXXX-11-10", + "type": "date", + "value": "2023-11-10" + } + ] + }, + "Text": "10/11", + "TypeName": "datetimeV2.date" + } + ] + }, + { + "Input": "the software used in the 11/3/2020 election can be easily hacked", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 21, + "End": 33, + "Resolution": { + "values": [ + { + "timex": "2020-03-11", + "type": "date", + "value": "2020-03-11" + } + ] + }, + "Text": "the 11/3/2020", + "TypeName": "datetimeV2.date" + } + ] + }, + { + "Input": "this article was published on 06/10/2020", + "Context": { + "ReferenceDateTime": "2023-05-05T00:00:00" + }, + "Results": [ + { + "Start": 30, + "End": 39, + "Resolution": { + "values": [ + { + "timex": "2020-10-06", + "type": "date", + "value": "2020-10-06" + } + ] + }, + "Text": "06/10/2020", + "TypeName": "datetimeV2.date" + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/French/DateExtractor.json b/Specs/DateTime/French/DateExtractor.json index f9e721eb85..a103cf97fb 100644 --- a/Specs/DateTime/French/DateExtractor.json +++ b/Specs/DateTime/French/DateExtractor.json @@ -10,6 +10,28 @@ } ] }, + { + "Input": "envoyez-moi un reçu de l'achat effectué le 17 du 11", + "Results": [ + { + "Text": "17 du 11", + "Type": "date", + "Start": 43, + "Length": 8 + } + ] + }, + { + "Input": "à quelle heure vais-je voir le médecin le mardi 13 du 6e mois", + "Results": [ + { + "Text": "mardi 13 du 6e", + "Type": "date", + "Start": 42, + "Length": 14 + } + ] + }, { "Input": "Je suis retourne pour le 27e", "Results": [ @@ -2622,5 +2644,53 @@ "Length": 12 } ] + }, + { + "Input": "2 septembre mille neuf cent nonante-quatre", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "2 septembre mille neuf cent nonante-quatre", + "Type": "date", + "Start": 0, + "Length": 42 + } + ] + }, + { + "Input": "15 janvier mil neuf cent septante-quatre", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "15 janvier mil neuf cent septante-quatre", + "Type": "date", + "Start": 0, + "Length": 40 + } + ] + }, + { + "Input": "c'était le 25 mars mil neuf cent quatre-vingt-dix", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "25 mars mil neuf cent quatre-vingt-dix", + "Type": "date", + "Start": 11, + "Length": 38 + } + ] + }, + { + "Input": "le 17 juillet mil neuf cent nonante", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "17 juillet mil neuf cent nonante", + "Type": "date", + "Start": 3, + "Length": 32 + } + ] } ] diff --git a/Specs/DateTime/French/DateParser.json b/Specs/DateTime/French/DateParser.json index cb1bc7ca3c..eff6946175 100644 --- a/Specs/DateTime/French/DateParser.json +++ b/Specs/DateTime/French/DateParser.json @@ -22,6 +22,52 @@ } ] }, + { + "Input": "envoyez-moi un reçu de l'achat effectué le 17 du 11", + "Context": { + "ReferenceDateTime": "2024-11-17T00:00:00" + }, + "Results": [ + { + "Text": "17 du 11", + "Type": "date", + "Value": { + "Timex": "XXXX-11-17", + "FutureResolution": { + "date": "2024-11-17" + }, + "PastResolution": { + "date": "2023-11-17" + } + }, + "Start": 43, + "Length": 7 + } + ] + }, + { + "Input": "à quelle heure vais-je voir le médecin le mardi 13 du 6e mois", + "Context": { + "ReferenceDateTime": "2024-6-13T00:00:00" + }, + "Results": [ + { + "Text": "mardi 13 du 6e", + "Type": "date", + "Value": { + "Timex": "XXXX-06-13", + "FutureResolution": { + "date": "2024-06-13" + }, + "PastResolution": { + "date": "2023-06-13" + } + }, + "Start": 43, + "Length": 7 + } + ] + }, { "Input": "Je reviendrai en 15", "Context": { @@ -3972,5 +4018,89 @@ "Length": 10 } ] + }, + { + "Input": "2 septembre mille neuf cent nonante-quatre", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "2 septembre mille neuf cent nonante-quatre", + "Type": "date", + "Value": { + "Timex": "1994-09-02", + "FutureResolution": { + "date": "1994-09-02" + }, + "PastResolution": { + "date": "1994-09-02" + } + }, + "Start": 0, + "Length": 41 + } + ] + }, + { + "Input": "15 janvier mil neuf cent septante-quatre", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "15 janvier mil neuf cent septante-quatre", + "Type": "date", + "Value": { + "Timex": "1974-01-15", + "FutureResolution": { + "date": "1974-01-15" + }, + "PastResolution": { + "date": "1974-01-15" + } + }, + "Start": 0, + "Length": 39 + } + ] + }, + { + "Input": "c'était le 25 mars mil neuf cent quatre-vingt-dix", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "25 mars mil neuf cent quatre-vingt-dix", + "Type": "date", + "Value": { + "Timex": "1990-03-25", + "FutureResolution": { + "date": "1990-03-25" + }, + "PastResolution": { + "date": "1990-03-25" + } + }, + "Start": 11, + "Length": 37 + } + ] + }, + { + "Input": "le 17 juillet mil neuf cent nonante", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "17 juillet mil neuf cent nonante", + "Type": "date", + "Value": { + "Timex": "1990-07-17", + "FutureResolution": { + "date": "1990-07-17" + }, + "PastResolution": { + "date": "1990-07-17" + } + }, + "Start": 3, + "Length": 31 + } + ] } ] diff --git a/Specs/DateTime/French/DatePeriodExtractor.json b/Specs/DateTime/French/DatePeriodExtractor.json index 30600f3b44..3f58a5db14 100644 --- a/Specs/DateTime/French/DatePeriodExtractor.json +++ b/Specs/DateTime/French/DatePeriodExtractor.json @@ -5950,5 +5950,41 @@ "Length": 31 } ] + }, + { + "Input": "Montrez-moi les records d'août 99", + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "août 99", + "Type": "daterange", + "Start": 26, + "Length": 7 + } + ] + }, + { + "Input": "Montrez-moi les records d'août '99", + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "août '99", + "Type": "daterange", + "Start": 26, + "Length": 8 + } + ] + }, + { + "Input": "Je suis né en deux mille neuf", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "deux mille neuf", + "Type": "daterange", + "Start": 14, + "Length": 15 + } + ] } ] diff --git a/Specs/DateTime/French/DatePeriodParser.json b/Specs/DateTime/French/DatePeriodParser.json index b304394156..ae1d932793 100644 --- a/Specs/DateTime/French/DatePeriodParser.json +++ b/Specs/DateTime/French/DatePeriodParser.json @@ -7140,5 +7140,74 @@ "Length": 14 } ] + }, + { + "Input": "Montrez-moi les records d'août 99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "août 99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 26, + "Length": 7 + } + ] + }, + { + "Input": "Montrez-moi les records d'août '99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "août '99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 26, + "Length": 8 + } + ] + }, + { + "Input": "Je suis né en deux mille neuf", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "deux mille neuf", + "Type": "daterange", + "Value": { + "Timex": "2009", + "FutureResolution": { + "startDate": "2009-01-01", + "endDate": "2010-01-01" + }, + "PastResolution": { + "startDate": "2009-01-01", + "endDate": "2010-01-01" + } + }, + "Start": 14, + "Length": 15 + } + ] } ] diff --git a/Specs/DateTime/French/DateTimeExtractor.json b/Specs/DateTime/French/DateTimeExtractor.json index 7c1af30457..3e983cf009 100644 --- a/Specs/DateTime/French/DateTimeExtractor.json +++ b/Specs/DateTime/French/DateTimeExtractor.json @@ -1456,3 +1456,4 @@ ] } ] + diff --git a/Specs/DateTime/French/DateTimeModel.json b/Specs/DateTime/French/DateTimeModel.json index 4e608dcb21..5418c360ad 100644 --- a/Specs/DateTime/French/DateTimeModel.json +++ b/Specs/DateTime/French/DateTimeModel.json @@ -618,190 +618,6 @@ } ] }, - { - "Input": "Je vais partir hebdomadaire", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "hebdomadaire", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 26 - } - ] - }, - { - "Input": "Je vais partir tous les jours", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "tous les jours", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 28 - } - ] - }, - { - "Input": "Je vais partir annuellement", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "annuellement", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 26 - } - ] - }, - { - "Input": "Je vais partir chaque deux jours", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "chaque deux jours", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 31 - } - ] - }, - { - "Input": "Je vais partir toutes les trois semaines", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "toutes les trois semaines", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 39 - } - ] - }, - { - "Input": "Je vais partir chaque lundi", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "chaque lundi", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 26 - } - ] - }, - { - "Input": "Je vais partir 4pm chaque lundi", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "4pm chaque lundi", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 30 - } - ] - }, - { - "Input": "Je vais partir 16 heures chaque lundi", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "16 heures chaque lundi", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 36 - } - ] - }, { "Input": "Je reviendrai Oct/2", "Context": { @@ -1302,6 +1118,29 @@ } ] }, + { + "Input": "Je retournerai 00:00", + "Context": { + "ReferenceDateTime": "2023-11-07T00:00:00" + }, + "Results": [ + { + "Text": "00:00", + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T00:00", + "type": "time", + "value": "00:00:00" + } + ] + }, + "Start": 15, + "End": 19 + } + ] + }, { "Input": "Je retournerai 19:56:30", "Context": { @@ -1974,54 +1813,6 @@ } ] }, - { - "Input": "Je vais partir a 15 heures tous les jours", - "Context": { - "ReferenceDateTime": "2019-08-12T00:00:00" - }, - "NotSupported": "javascript, java, python", - "Results": [ - { - "Text": "15 heures tous les jours", - "Start": 17, - "End": 40, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je vais partir à 15 tous les jours", - "Context": { - "ReferenceDateTime": "2019-08-12T00:00:00" - }, - "NotSupported": "javascript, java, python", - "Results": [ - { - "Text": "15 tous les jours", - "Start": 17, - "End": 33, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Dix heures mercredi matin", "Context": { @@ -2084,54 +1875,6 @@ } ] }, - { - "Input": "Je vais partir à 15 heures tous les jours", - "Context": { - "ReferenceDateTime": "2019-08-12T00:00:00" - }, - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "15 heures tous les jours", - "Start": 17, - "End": 40, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je vais partir a 15 tous les jours", - "Context": { - "ReferenceDateTime": "2019-08-12T00:00:00" - }, - "NotSupported": "javascript, java, python", - "Results": [ - { - "Text": "15 tous les jours", - "Start": 17, - "End": 33, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "En juillet 98, la France a remporté le mondial de football.", "Context": { @@ -4818,182 +4561,14 @@ ] }, { - "Input": "Je partirai chaque semaine", + "Input": "Je retournerai à 7:56:30 pm", "NotSupported": "dotnet, javascript, python, java", "Results": [ { - "Text": "chaque semaine", - "Start": 12, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai tous les jours", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les jours", - "Start": 12, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai annuellement", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "annuellement", - "Start": 12, - "End": 24, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai tous les deux jours", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les deux jours", - "Start": 12, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai toutes les trois semaines", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "toutes les trois semaines", - "Start": 12, - "End": 37, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai tous les jours à 15h", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les jours à 15h", - "Start": 12, - "End": 32, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai tous les lundis", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les lundis", - "Start": 12, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai chaque lundi à 16h", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque lundi à 16h", - "Start": 12, - "End": 30, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je retournerai à 7:56:30 pm", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "7:56:30 pm", - "Start": 17, - "End": 27, - "TypeName": "datetimeV2.time", + "Text": "7:56:30 pm", + "Start": 17, + "End": 27, + "TypeName": "datetimeV2.time", "Resolution": { "values": [ { @@ -6217,21 +5792,6 @@ "Input": "Chaque semaine et autre chose cette semaine", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "Chaque semaine", - "Start": 0, - "End": 14, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "cette semaine", "Start": 30, @@ -6254,21 +5814,6 @@ "Input": "Les notes sont distribuées dans les notes de la session de travail LT jointes chaque semaine et les points importants sont partagés dans la section des données. Pour le sujet spécial de cette semaine, l'équipe chargée des données a rédigé une synthèse de certaines des nouveaux caractéristiques du tableau de bord et de la façon dont il est construit. Si vous n'avez pas vu le tableau de bord, c'est peut-être une bonne occasion d'apprendre quelque chose de nouveau. Je voudrais demander à Cortana de planifier 45 minutes en novembre. J'aimerais également vous annoncer que l'intégration de Skype avec notre logiciel OWA Rea", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "chaque semaine", - "Start": 78, - "End": 92, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "cette semaine", "Start": 186, @@ -13015,21 +12560,6 @@ "Input": "réservez mon temps pour la baignade tous les mardis et jeudis de 19h00 à 21h00.", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "tous les mardis", - "Start": 36, - "End": 51, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "jeudis de 19h00 à 21h00", "Start": 55, @@ -16456,48 +15986,6 @@ } ] }, - { - "Input": "Rencontrons-nous une fois par semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par semaine", - "Start": 17, - "End": 37, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je pars en vacances une fois par an", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par an", - "Start": 20, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "La demande est ABC-12345-A1B2C3 ce tour. Organisons un appel de 30 minutes cette semaine. Au plaisir de reprendre la parole cette semaine.", "NotSupported": "dotnet, javascript, python, java", @@ -16918,48 +16406,6 @@ } ] }, - { - "Input": "Tous les deux vendredis", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "Tous les deux vendredis", - "Start": 0, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-5", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ayons une réunion tous les quatre mois.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les quatre mois", - "Start": 18, - "End": 38, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "trimestre1 et trimestre2 pourraient être n'importe quelle année", "NotSupported": "dotnet, javascript, python, java", @@ -17007,21 +16453,6 @@ } ] } - }, - { - "Text": "n'importe quelle année", - "Start": 41, - "End": 63, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -18154,27 +17585,6 @@ } ] }, - { - "Input": "Les jeudis à 17h30 heure de Pékin", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "jeudis à 17h30", - "Start": 4, - "End": 18, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-4T17:30", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Juneteenth, également connu sous le nom de Freedom Day et Jubilee Day, remonte à 1865 et est célébré le 19 juin de chaque année.", "NotSupported": "dotnet, javascript, python, java", @@ -18274,21 +17684,6 @@ } ] } - }, - { - "Text": "chaque année", - "Start": 115, - "End": 127, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -18355,48 +17750,6 @@ } ] }, - { - "Input": "Veuillez planifier semestriellement une réunion", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "semestriellement", - "Start": 19, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Veuillez planifier une réunion semestrielle", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "semestrielle", - "Start": 31, - "End": 43, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Veuillez planifier une réunion avec tout le monde la semaine prochaine", "NotSupported": "dotnet, javascript, python, java", @@ -18419,27 +17772,6 @@ } ] }, - { - "Input": "Assurons-nous que cela arrive tous les journées de travail", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les journées de travail", - "Start": 30, - "End": 58, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "pourquoi ne pas prendre des vacances pour le reste de la semaine ?", "NotSupported": "dotnet, javascript, python, java", @@ -18462,48 +17794,6 @@ } ] }, - { - "Input": "il est presque temps pour la revue annuelle", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "annuelle", - "Start": 35, - "End": 43, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "les lois et règlements exigent la présentation des états financiers chaque trimestre", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque trimestre", - "Start": 68, - "End": 84, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Le 4 juillet approche", "NotSupported": "dotnet, javascript, python, java", @@ -18534,21 +17824,6 @@ "Input": "les exercices bimensuels auront lieu tout été", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "bimensuel", - "Start": 14, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2M", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "été", "Start": 42, @@ -18566,48 +17841,6 @@ } ] }, - { - "Input": "est-ce que tu fais cela tous les week-ends ?", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les week-ends", - "Start": 24, - "End": 42, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "tous les deux week-ends", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les deux week-ends", - "Start": 0, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "le cours dure trois week-ends", "NotSupported": "dotnet, javascript, python, java", @@ -18905,27 +18138,6 @@ } ] }, - { - "Input": "Ajouter la réunion avec le patron à mon calendrier-les mardis à 9 h", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "mardis à 9 h", - "Start": 55, - "End": 67, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2T09", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "à ce soir, chérie !", "NotSupported": "dotnet, javascript, python, java", @@ -19643,48 +18855,6 @@ } ] }, - { - "Input": "dîner avec maman n'importe quel week-end.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "n'importe quel week-en", - "Start": 17, - "End": 39, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "dîner avec maman tous les week-ends.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les week-ends", - "Start": 17, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Je serai absent le prochaini soir de 7h à 9h", "NotSupported": "dotnet, javascript, python, java", @@ -20348,21 +19518,6 @@ "Input": "Je partirai tous les jours à 19h13", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "tous les jours", - "Start": 12, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "19h13", "Start": 29, @@ -20380,27 +19535,6 @@ } ] }, - { - "Input": "Je partirai tous les soirs à 19h13", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les soirs à 19h13", - "Start": 12, - "End": 34, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T19:13", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Que s'est-il passé le lundi de Pâques à 10h30 ?", "NotSupported": "dotnet, javascript, python, java", @@ -20483,27 +19617,6 @@ } ] }, - { - "Input": "dîner avec maman les week-ends.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "week-ends", - "Start": 21, - "End": 30, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Je serai absent mardi de 14h00 à 14h30", "NotSupported": "dotnet, javascript, python, java", diff --git a/Specs/DateTime/French/DateTimeModelCalendarMode.json b/Specs/DateTime/French/DateTimeModelCalendarMode.json index 29bc632da2..656a562b36 100644 --- a/Specs/DateTime/French/DateTimeModelCalendarMode.json +++ b/Specs/DateTime/French/DateTimeModelCalendarMode.json @@ -326,21 +326,6 @@ "Input": "Chaque semaine et autre chose cette semaine", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "Chaque semaine", - "Start": 0, - "End": 14, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "cette semaine", "Start": 30, @@ -363,21 +348,6 @@ "Input": "Les notes sont distribuées dans les notes de la session de travail LT jointes chaque semaine et les points importants sont partagés dans la section des données. Pour le sujet spécial de cette semaine, l'équipe chargée des données a rédigé une synthèse de certaines des nouveaux caractéristiques du tableau de bord et de la façon dont il est construit. Si vous n'avez pas vu le tableau de bord, c'est peut-être une bonne occasion d'apprendre quelque chose de nouveau. Je voudrais demander à Cortana de planifier 45 minutes en novembre. J'aimerais également vous annoncer que l'intégration de Skype avec notre logiciel OWA Rea", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "chaque semaine", - "Start": 78, - "End": 92, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "cette semaine", "Start": 186, @@ -905,47 +875,5 @@ } } ] - }, - { - "Input": "Rencontrons-nous une fois par semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par semaine", - "Start": 17, - "End": 37, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je pars en vacances une fois par an", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par an", - "Start": 20, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] } ] diff --git a/Specs/DateTime/French/DateTimeModelComplexCalendar.json b/Specs/DateTime/French/DateTimeModelComplexCalendar.json index 2ddbcff92d..615197eeae 100644 --- a/Specs/DateTime/French/DateTimeModelComplexCalendar.json +++ b/Specs/DateTime/French/DateTimeModelComplexCalendar.json @@ -1389,21 +1389,6 @@ "Input": "Chaque semaine et une autre chose cette semaine", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "Chaque semaine", - "Start": 0, - "End": 14, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "cette semaine", "Start": 34, @@ -1426,21 +1411,6 @@ "Input": "Les notes sont partagées dans les notes de séance du LT jointes chaque semaine et les points forts sont partagés dans la section \"aperçu des données\". Pour le thème spécial de cette semaine, l’équipe de données a écrit un aperçu de certaines des nouvelles fonctionnalités que prend en charge le tableau de bord et comment il est construit. Si vous n’avez pas vu le tableau de bord, ce sera peut-être une grande opportunité d’apprendre quelque chose de nouveau. Je voudrais demander à Cortana de programmer 45 minutes en novembre.Je voudrais aussi partager l’information que Skype intégration avec notre Rea OWA", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "chaque semaine", - "Start": 64, - "End": 78, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "cette semaine", "Start": 176, @@ -8102,21 +8072,6 @@ "Input": "réservez mon temps pour la natation tous les mardis et jeudis de 19 heures à 21 heures.", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "tous les mardis", - "Start": 36, - "End": 51, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "jeudis de 19 heures à 21 heures", "Start": 55, @@ -10896,48 +10851,6 @@ } ] }, - { - "Input": "On se voit une fois par semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par semaine", - "Start": 11, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je pars en vacances une fois par an", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par an", - "Start": 20, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "La requête est ABC-12345-A1B2C3. Organisons un appel de 30 minutes cette semaine. J’ai hâte de reprendre la parole cette semaine.", "NotSupported": "dotnet, javascript, python, java", @@ -11293,27 +11206,6 @@ } ] }, - { - "Input": "Faisons une réunion trimestrielle.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "trimestrielle", - "Start": 20, - "End": 33, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Et 30 minutes plus tard?", "NotSupported": "dotnet, javascript, python, java", @@ -11746,27 +11638,6 @@ } ] }, - { - "Input": "Jeudi à 17h30, l'heure de Beijing", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "17h30, l'heure de Beijing", - "Start": 8, - "End": 33, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-4T17:30", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Course - 15 heures - cette semaine", "NotSupported": "dotnet, javascript, python, java", @@ -11935,26 +11806,5 @@ } } ] - }, - { - "Input": "Ajoutez un rendez-vous avec le patron à mon agenda - les mardis à 9 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "mardis à 9 heures", - "Start": 57, - "End": 74, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2T09", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] } ] diff --git a/Specs/DateTime/French/DateTimeModelExperimentalMode.json b/Specs/DateTime/French/DateTimeModelExperimentalMode.json index 265dbe4f05..eb02685b71 100644 --- a/Specs/DateTime/French/DateTimeModelExperimentalMode.json +++ b/Specs/DateTime/French/DateTimeModelExperimentalMode.json @@ -1085,174 +1085,6 @@ } ] }, - { - "Input": "Je partirai chaque semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque semaine", - "Start": 12, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai tous les jours", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les jours", - "Start": 12, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai anuellement", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "anuellement", - "Start": 12, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai tous les deux jours", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les deux jours", - "Start": 12, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai toutes les trois semaines", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "toutes les trois semaines", - "Start": 12, - "End": 37, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai à 15h chaque jour", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "15h chaque jour", - "Start": 14, - "End": 29, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai tous les lundis", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les lundis", - "Start": 12, - "End": 27, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je partirai chaque lundi à 16h", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque lundi à 16h", - "Start": 12, - "End": 30, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Je serai de retour à 19:56:30", "NotSupported": "dotnet, javascript, python, java", @@ -2485,21 +2317,6 @@ "Input": "Chaque semaine et autre chose cette semaine", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "Chaque semaine", - "Start": 0, - "End": 14, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "cette semaine", "Start": 30, @@ -2522,21 +2339,6 @@ "Input": "Les notes sont distribuées dans les notes de la session de travail LT jointes chaque semaine et les points importants sont partagés dans la section des données. Pour le sujet spécial de cette semaine, l'équipe chargée des données a rédigé une synthèse de certaines des nouveaux caractéristiques du tableau de bord et de la façon dont il est construit. Si vous n'avez pas vu le tableau de bord, c'est peut-être une bonne occasion d'apprendre quelque chose de nouveau. Je voudrais demander à Cortana de planifier 45 minutes en novembre. J'aimerais également vous annoncer que l'intégration de Skype avec notre logiciel OWA Rea", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "chaque semaine", - "Start": 78, - "End": 92, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "cette semaine", "Start": 186, @@ -6794,69 +6596,6 @@ } ] }, - { - "Input": "Rencontrons-nous une fois par semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par semaine", - "Start": 17, - "End": 37, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je pars en vacances une fois par an", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par an", - "Start": 20, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ayons une réunion trimestrielle.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "trimestrielle", - "Start": 18, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "mes vacances commenceront à partir d'octobre", "NotSupported": "dotnet, javascript, python, java", diff --git a/Specs/DateTime/French/DateTimeModelExtendedTypes.json b/Specs/DateTime/French/DateTimeModelExtendedTypes.json index 30cacf267d..7f292606a3 100644 --- a/Specs/DateTime/French/DateTimeModelExtendedTypes.json +++ b/Specs/DateTime/French/DateTimeModelExtendedTypes.json @@ -924,21 +924,6 @@ "Input": "Chaque semaine et autre chose de cette semaine", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "Chaque semaine", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 0, - "End": 14 - }, { "Text": "cette semaine", "TypeName": "datetimeV2.daterange", @@ -961,21 +946,6 @@ "Input": "Les notes sont partagées dans les notes de séance du LT jointes chaque semaine et les points forts sont partagés dans la section \"aperçu des données\". Pour cette semaine 鈥檚 thème spécial, l’équipe de données a écrit un aperçu de certaines des nouvelles fonctionnalités que prend en charge le tableau de bord et comment il est construit. Si vous n’avez pas vu le tableau de bord, ce sera peut-être une grande opportunité d’apprendre quelque chose de nouveau. Je voudrais demander à Cortana de programmer 45 minutes en novembre. Je voudrais aussi partager l’information que Skype intégration avec notre Rea OWA", "NotSupported": "dotnet, javascript, python, java", "Results": [ - { - "Text": "chaque semaine", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 64, - "End": 78 - }, { "Text": "cette semaine", "TypeName": "datetimeV2.daterange", @@ -1678,48 +1648,6 @@ } ] }, - { - "Input": "On se voit une fois par semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par semaine", - "Start": 11, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Je pars en vacances une fois par an", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par an", - "Start": 20, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "La requête est ABC-12345-A1B2C3. Organisons un appel de 30 minutes cette semaine. J’ai hâte de reprendre la parole cette semaine.", "NotSupported": "dotnet, javascript, python, java", diff --git a/Specs/DateTime/French/DateTimeParser.json b/Specs/DateTime/French/DateTimeParser.json index a63b9d87fe..14d6b49d9b 100644 --- a/Specs/DateTime/French/DateTimeParser.json +++ b/Specs/DateTime/French/DateTimeParser.json @@ -2609,4 +2609,5 @@ } ] } + ] diff --git a/Specs/DateTime/French/MergedParser.json b/Specs/DateTime/French/MergedParser.json index 6287494668..7e18a0103a 100644 --- a/Specs/DateTime/French/MergedParser.json +++ b/Specs/DateTime/French/MergedParser.json @@ -67,21 +67,6 @@ }, "Start": 24, "Length": 3 - }, - { - "Text": "chaque semaine", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 28, - "Length": 14 } ] }, @@ -1243,21 +1228,6 @@ }, "Start": 24, "Length": 8 - }, - { - "Text": "chaque semaine", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 33, - "Length": 14 } ] }, @@ -1279,21 +1249,6 @@ }, "Start": 13, "Length": 15 - }, - { - "Text": "chaque mois", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 32, - "Length": 11 } ] }, diff --git a/Specs/DateTime/French/SetExtractor.json b/Specs/DateTime/French/SetExtractor.json deleted file mode 100644 index 8abff89746..0000000000 --- a/Specs/DateTime/French/SetExtractor.json +++ /dev/null @@ -1,670 +0,0 @@ -[ - { - "Input": "Je vais partir 9 heures chaque dimanche", - "Results": [ - { - "Text": "9 heures chaque dimanche", - "Type": "set", - "Start": 15, - "Length": 24 - } - ] - }, - { - "Input": "Je vais partir 9am chaque lundis", - "Results": [ - { - "Text": "9am chaque lundis", - "Type": "set", - "Start": 15, - "Length": 17 - } - ] - }, - { - "Input": "Je vais partir 9am lundis", - "Results": [ - { - "Text": "9am lundis", - "Type": "set", - "Start": 15, - "Length": 10 - } - ] - }, - { - "Input": "Je vais partir 9 heures lundis", - "Results": [ - { - "Text": "9 heures lundis", - "Type": "set", - "Start": 15, - "Length": 15 - } - ] - }, - { - "Input": "Je vais partir Lundis", - "Results": [ - { - "Text": "Lundis", - "Type": "set", - "Start": 15, - "Length": 6 - } - ] - }, - { - "Input": "Je vais partir chaque Dimanche", - "Results": [ - { - "Text": "chaque Dimanche", - "Type": "set", - "Start": 15, - "Length": 15 - } - ] - }, - { - "Input": "Je vais partir Dimanches", - "Results": [ - { - "Text": "Dimanches", - "Type": "set", - "Start": 15, - "Length": 9 - } - ] - }, - { - "Input": "Je vais partir chaque semaine", - "Results": [ - { - "Text": "chaque semaine", - "Type": "set", - "Start": 15, - "Length": 14 - } - ] - }, - { - "Input": "Je vais partir tous les jours", - "Results": [ - { - "Text": "tous les jours", - "Type": "set", - "Start": 15, - "Length": 14 - } - ] - }, - { - "Input": "Je vais partir quotidien", - "Results": [ - { - "Text": "quotidien", - "Type": "set", - "Start": 15, - "Length": 9 - } - ] - }, - { - "Input": "Je vais partir hebdomadaire", - "Results": [ - { - "Text": "hebdomadaire", - "Type": "set", - "Start": 15, - "Length": 12 - } - ] - }, - { - "Input": "Je vais partir mensuel", - "Results": [ - { - "Text": "mensuel", - "Type": "set", - "Start": 15, - "Length": 7 - } - ] - }, - { - "Input": "Je vais partir bihebdomadaire", - "Results": [ - { - "Text": "bihebdomadaire", - "Type": "set", - "Start": 15, - "Length": 14 - } - ] - }, - { - "Input": "Je vais partir chaque mois", - "Results": [ - { - "Text": "chaque mois", - "Type": "set", - "Start": 15, - "Length": 11 - } - ] - }, - { - "Input": "Je vais partir annuellement", - "Results": [ - { - "Text": "annuellement", - "Type": "set", - "Start": 15, - "Length": 12 - } - ] - }, - { - "Input": "Je vais partir chaque deux jours", - "Results": [ - { - "Text": "chaque deux jours", - "Type": "set", - "Start": 15, - "Length": 17 - } - ] - }, - { - "Input": "Je vais partir chaque trois semaine", - "Results": [ - { - "Text": "chaque trois semaine", - "Type": "set", - "Start": 15, - "Length": 20 - } - ] - }, - { - "Input": "Je vais partir 3pm tous les jours", - "Results": [ - { - "Text": "3pm tous les jours", - "Type": "set", - "Start": 15, - "Length": 18 - } - ] - }, - { - "Input": "Je vais partir à 15 tous les jours", - "Results": [ - { - "Text": "15 tous les jours", - "Type": "set", - "Start": 17, - "Length": 17 - } - ] - }, - { - "Input": "Je vais partir chaque lundi", - "Results": [ - { - "Text": "chaque lundi", - "Type": "set", - "Start": 15, - "Length": 12 - } - ] - }, - { - "Input": "Je vais partir chaque lundi 4pm", - "Results": [ - { - "Text": "chaque lundi 4pm", - "Type": "set", - "Start": 15, - "Length": 16 - } - ] - }, - { - "Input": "Je vais partir tous les matins", - "Results": [ - { - "Text": " tous les matin", - "Type": "set", - "Start": 14, - "Length": 15 - } - ] - }, - { - "Input": "Je vais partir tous les matins a 9", - "Results": [ - { - "Text": " tous les matin", - "Type": "set", - "Start": 14, - "Length": 15 - } - ] - }, - { - "Input": "Je vais partir chaque matin at 9", - "Results": [ - { - "Text": " chaque matin", - "Type": "set", - "Start": 14, - "Length": 13 - } - ] - }, - { - "Input": "Je vais partir chaque apres-midi à 16", - "Results": [ - { - "Text": "chaque apres-midi à 16", - "Type": "set", - "Start": 15, - "Length": 22 - } - ] - }, - { - "Input": "Je vais partir chaque nuit a 9pm", - "Results": [ - { - "Text": "chaque nuit a 9pm", - "Type": "set", - "Start": 15, - "Length": 17 - } - ] - }, - { - "Input": "Je vais partir chaque nuit a 9", - "Results": [ - { - "Text": "chaque nuit a 9", - "Type": "set", - "Start": 15, - "Length": 15 - } - ] - }, - { - "Input": "Je vais partir à 16 chaque lundi", - "Results": [ - { - "Text": "16 chaque lundi", - "Type": "set", - "Start": 17, - "Length": 15 - } - ] - }, - { - "Input": "de 14 heures à 16 heures, chaque lundi", - "Results": [ - { - "Text": "de 14 heures à 16 heures, chaque lundi", - "Type": "set", - "Start": 0, - "Length": 38 - } - ] - }, - { - "Input": "avant 12h00 chaque lundi", - "NotSupported": "javascript, java, dotnet, python", - "Comment": "same bug in EN", - "Results": [ - { - "Text": "avant 16 chaque lundi", - "Type": "set", - "Start": 0, - "Length": 21 - } - ] - }, - { - "Input": "avant 12:00 chaque lundi", - "NotSupported": "javascript, java, dotnet, python", - "Comment": "same bug in EN", - "Results": [ - { - "Text": "avant 12:00 chaque lundi", - "Type": "set", - "Start": 0, - "Length": 24 - } - ] - }, - { - "Input": "de 14 heures à 16 heures chaque lundi", - "Results": [ - { - "Text": "de 14 heures à 16 heures chaque lundi", - "Type": "set", - "Start": 0, - "Length": 37 - } - ] - }, - { - "Input": "Je vais partir chaque jour", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque jour", - "Type": "set", - "Start": 15, - "Length": 11 - } - ] - }, - { - "Input": "Je vais partir chaque année", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque année", - "Type": "set", - "Start": 15, - "Length": 12 - } - ] - }, - { - "Input": "Je vais partir tous les deux jours", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les deux jours", - "Type": "set", - "Start": 15, - "Length": 19 - } - ] - }, - { - "Input": "Je vais partir tous les trois semaines", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les trois semaines", - "Type": "set", - "Start": 15, - "Length": 23 - } - ] - }, - { - "Input": "Je vais partir à 15 heures chaque jour ", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "15 heures chaque jour ", - "Type": "set", - "Start": 17, - "Length": 23 - } - ] - }, - { - "Input": "Je vais partir à 15 heures tous les jours ", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "15 heures tous les jours ", - "Type": "set", - "Start": 17, - "Length": 25 - } - ] - }, - { - "Input": "Je vais partir chaque 4/15 ", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque 4/15", - "Type": "set", - "Start": 15, - "Length": 11 - } - ] - }, - { - "Input": "Je vais partir tous les lundis", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les lundis", - "Type": "set", - "Start": 15, - "Length": 15 - } - ] - }, - { - "Input": "Je vais partir tous les lundis à 16 heures ", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les lundis à 16 heures ", - "Type": "set", - "Start": 15, - "Length": 28 - } - ] - }, - { - "Input": "Je vais partir chaque matin à 9 heures ", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque matin à 9 heures ", - "Type": "set", - "Start": 15, - "Length": 24 - } - ] - }, - { - "Input": "Je vais partir tous les après-midi à 16 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les après-midi à 16 heures", - "Type": "set", - "Start": 15, - "Length": 31 - } - ] - }, - { - "Input": "Je vais partir tous les soirs à 21 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les soirs à 21 heures", - "Type": "set", - "Start": 15, - "Length": 26 - } - ] - }, - { - "Input": "Je vais partir chaque nuit à 21 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque nuit à 21 heures", - "Type": "set", - "Start": 15, - "Length": 23 - } - ] - }, - { - "Input": "Je vais partir tous les matins à 9 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les matins à 9 heures", - "Type": "set", - "Start": 15, - "Length": 26 - } - ] - }, - { - "Input": "Je vais partir chaque matin à 9 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque matin à 9 heures", - "Type": "set", - "Start": 15, - "Length": 23 - } - ] - }, - { - "Input": "Je vais partir à 9 heures tous les dimanches", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "9 heures tous les dimanches", - "Type": "set", - "Start": 17, - "Length": 27 - } - ] - }, - { - "Input": "Je vais partir à 9 heures chaque lundi", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "9 heures chaque lundi", - "Type": "set", - "Start": 17, - "Length": 21 - } - ] - }, - { - "Input": "Je vais partir à 9 heures tous les lundis", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "9 heures tous les lundis", - "Type": "set", - "Start": 17, - "Length": 24 - } - ] - }, - { - "Input": "Je vais partir lundis", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "lundis", - "Type": "set", - "Start": 15, - "Length": 6 - } - ] - }, - { - "Input": "Je vais partir chaque dimanche", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque dimanche", - "Type": "set", - "Start": 15, - "Length": 15 - } - ] - }, - { - "Input": "Je vais partir tous les dimanches", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les dimanches", - "Type": "set", - "Start": 15, - "Length": 18 - } - ] - }, - { - "Input": "Puis-je faire une réservation de deux nuits pour le 9 mai?", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "nuits", - "Type": "set", - "Start": 38, - "Length": 5 - } - ] - }, - { - "Input": "On se voit une fois par semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par semaine", - "Type": "set", - "Start": 11, - "Length": 20 - } - ] - }, - { - "Input": "Je pars en vacances une fois par an", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par an", - "Type": "set", - "Start": 20, - "Length": 15 - } - ] - }, - { - "Input": "Un vendredi sur deux", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "Un vendredi sur deux", - "Type": "set", - "Start": 0, - "Length": 20 - } - ] - }, - { - "Input": "Organisons une réunion trimestrielle", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "trimestrielle", - "Type": "set", - "Start": 23, - "Length": 13 - } - ] - } -] diff --git a/Specs/DateTime/French/SetParser.json b/Specs/DateTime/French/SetParser.json deleted file mode 100644 index 1865b43909..0000000000 --- a/Specs/DateTime/French/SetParser.json +++ /dev/null @@ -1,1228 +0,0 @@ -[ - { - "Input": "Je vais partir a 9am Dimanches", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:16.6159645-03:00" - }, - "Results": [ - { - "Text": "9am Dimanches", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 17, - "Length": 13 - } - ] - }, - { - "Input": "Je vais partir chaque de matin a 9am", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:19.4550127-03:00" - }, - "Results": [ - { - "Text": "chaque de matin a 9am", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 15, - "Length": 21 - } - ] - }, - { - "Input": "Je vais partir chaque apres-midi a 4pm", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:19.4900115-03:00" - }, - "Results": [ - { - "Text": "chaque apres-midi a 4pm", - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - }, - "Start": 15, - "Length": 23 - } - ] - }, - { - "Input": "Je vais partir chaque nuit a 9pm", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:19.5265112-03:00" - }, - "Results": [ - { - "Text": "chaque nuit a 9pm", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 15, - "Length": 17 - } - ] - }, - { - "Input": "Je vais partir chaque nuit 9", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:19.5560123-03:00" - }, - "Results": [ - { - "Text": "chaque nuit 9", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 15, - "Length": 13 - } - ] - }, - { - "Input": "Je vais partir chaque nuit a 21", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:19.5920118-03:00" - }, - "Results": [ - { - "Text": "chaque nuit a 21", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 15, - "Length": 16 - } - ] - }, - { - "Input": "Je vais partir chaque nuit 21", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:19.621011-03:00" - }, - "Results": [ - { - "Text": "chaque nuit 21", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 15, - "Length": 14 - } - ] - }, - { - "Input": "Je vais partir tous les de matin 9am", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:19.6610194-03:00" - }, - "Results": [ - { - "Text": "tous les de matin 9am", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 15, - "Length": 21 - } - ] - }, - { - "Input": "Je vais partir a Lundis", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:21.7045166-03:00" - }, - "Results": [ - { - "Text": "Lundis", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 17, - "Length": 6 - } - ] - }, - { - "Input": "Je vais partir Dimanches", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:21.7260153-03:00" - }, - "Results": [ - { - "Text": "Dimanches", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 15, - "Length": 9 - } - ] - }, - { - "Input": "Je vais partir tous les Dimanches", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:21.7855155-03:00" - }, - "Results": [ - { - "Text": "tous les Dimanches", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 15, - "Length": 18 - } - ] - }, - { - "Input": "Je vais partir chaque Dimanches", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:21.8420111-03:00" - }, - "Results": [ - { - "Text": "chaque Dimanches", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 15, - "Length": 16 - } - ] - }, - { - "Input": "Je vais partir chaque semaine", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.3570246-03:00" - }, - "Results": [ - { - "Text": "chaque semaine", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 15, - "Length": 14 - } - ] - }, - { - "Input": "Je vais partir bihebdomadaire", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.3580267-03:00" - }, - "Results": [ - { - "Text": "bihebdomadaire", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 15, - "Length": 14 - } - ] - }, - { - "Input": "Je vais partir hebdomadaire", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.3590265-03:00" - }, - "Results": [ - { - "Text": "hebdomadaire", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 15, - "Length": 12 - } - ] - }, - { - "Input": "Je vais partir quotidien", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.3600258-03:00" - }, - "Results": [ - { - "Text": "quotidien", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 15, - "Length": 9 - } - ] - }, - { - "Input": "Je vais partir journellement", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.3610265-03:00" - }, - "Results": [ - { - "Text": "journellement", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 15, - "Length": 13 - } - ] - }, - { - "Input": "Je vais partir chaque mois", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.3775441-03:00" - }, - "Results": [ - { - "Text": "chaque mois", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 15, - "Length": 11 - } - ] - }, - { - "Input": "Je vais partir annuellement", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.3785448-03:00" - }, - "Results": [ - { - "Text": "annuellement", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 15, - "Length": 12 - } - ] - }, - { - "Input": "Je vais partir annuel", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.3795446-03:00" - }, - "Results": [ - { - "Text": "annuel", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 15, - "Length": 6 - } - ] - }, - { - "Input": "Je vais partir chaque deux jours", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.4010443-03:00" - }, - "Results": [ - { - "Text": "chaque deux jours", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 15, - "Length": 17 - } - ] - }, - { - "Input": "Je vais partir chaque trois semaine", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.4250441-03:00" - }, - "Results": [ - { - "Text": "chaque trois semaine", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 15, - "Length": 20 - } - ] - }, - { - "Input": "Je vais partir chaque 15/4", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.447021-03:00" - }, - "Results": [ - { - "Text": "chaque 15/4", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 15, - "Length": 12 - } - ] - }, - { - "Input": "Je vais partir chaque Lundi", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.469026-03:00" - }, - "Results": [ - { - "Text": "chaque Lundi", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 15, - "Length": 12 - } - ] - }, - { - "Input": "Je vais partir chaque Lundi 4pm", - "Context": { - "ReferenceDateTime": "2017-10-09T12:21:35.4960223-03:00" - }, - "Results": [ - { - "Text": "chaque Lundi 4pm", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 15, - "Length": 16 - } - ] - }, - { - "Input": "Je partirai chaque semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque semaine", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 12, - "Length": 14 - } - ] - }, - { - "Input": "Je partirai toutes les deux semaines", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "toutes les deux semaines", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 12, - "Length": 24 - } - ] - }, - { - "Input": "Je partirai tous les jours", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les jours", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 12, - "Length": 14 - } - ] - }, - { - "Input": "Je partirai chaque jour", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque jour", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 12, - "Length": 11 - } - ] - }, - { - "Input": "Je partirai tous les mois", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les mois", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 12, - "Length": 13 - } - ] - }, - { - "Input": "Je partirai chaque année", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque année", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 12, - "Length": 12 - } - ] - }, - { - "Input": "Je partirai annuellement", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "annuellement", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 12, - "Length": 12 - } - ] - }, - { - "Input": "Je partirai tous les deux jours", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les deux jours", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 12, - "Length": 19 - } - ] - }, - { - "Input": "Je partirai toutes les trois semaines", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "toutes les trois semaines", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 12, - "Length": 25 - } - ] - }, - { - "Input": "Je partirai à 15 heures tous les jours", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "15 heures tous les jours", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 14, - "Length": 24 - } - ] - }, - { - "Input": "Je partirai à 15 heures chaque jour", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "15 heures chaque jour", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 14, - "Length": 21 - } - ] - }, - { - "Input": "Je partirai chaque 15/04", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque 15/04", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 12, - "Length": 12 - } - ] - }, - { - "Input": "Je partirai tous les lundis", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les lundis", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 12, - "Length": 15 - } - ] - }, - { - "Input": "Je partirai tous les lundis à 16 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les lundis à 16 heures", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 12, - "Length": 27 - } - ] - }, - { - "Input": "Je partirai tous les matins", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les matins", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 12, - "Length": 15 - } - ] - }, - { - "Input": "Je partirai tous les matins à 9 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les matins à 9 heures", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 12, - "Length": 26 - } - ] - }, - { - "Input": "Je partirai tous les après-midi à 16 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les après-midi à 16 heures", - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - }, - "Start": 12, - "Length": 31 - } - ] - }, - { - "Input": "Je partirai tous les soirs à 21 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les soirs à 21 heures", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 12, - "Length": 26 - } - ] - }, - { - "Input": "Je partirai tous les soirs à 9 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tous les soirs à 9 heures", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 12, - "Length": 25 - } - ] - }, - { - "Input": "Je partirai chaque matin à 9 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque matin à 9 heures", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 12, - "Length": 23 - } - ] - }, - { - "Input": "Je partirai le matin à 9 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "matin à 9 heures", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 15, - "Length": 16 - } - ] - }, - { - "Input": "Je partirai à 9 heures tous les dimanches", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "9 heures tous les dimanches", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 27 - } - ] - }, - { - "Input": "Je partirai à 9 heures le dimanche", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "9 heures le dimanche", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 20 - } - ] - }, - { - "Input": "Je partirai à 9 heures chaque dimanche", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "9 heures chaque dimanche", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 24 - } - ] - }, - { - "Input": "Je partirai le lundi", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "lundi", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 15, - "Length": 5 - } - ] - }, - { - "Input": "Je partirai le dimanche", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "dimanche", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 15, - "Length": 8 - } - ] - }, - { - "Input": "Je partirai chaque dimanche", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "chaque dimanche", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 12, - "Length": 15 - } - ] - }, - { - "Input": "Je pars en vacances une fois par an", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par an", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 20, - "Length": 15 - } - ] - }, - { - "Input": "On se voit une fois par semaine", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "une fois par semaine", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 11, - "Length": 20 - } - ] - }, - { - "Input": "Un vendredi sur deux", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "Un vendredi sur deux", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-5", - "FutureResolution": { - "set": "Set: XXXX-WXX-5" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-5" - } - }, - "Start": 0, - "Length": 20 - } - ] - }, - { - "Input": "Organisons une réunion trimestrielle.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "trimestrielle", - "Type": "set", - "Value": { - "Timex": "P3M", - "FutureResolution": { - "set": "Set: P3M" - }, - "PastResolution": { - "set": "Set: P3M" - } - }, - "Start": 23, - "Length": 13 - } - ] - } -] diff --git a/Specs/DateTime/French/TimeExtractor.json b/Specs/DateTime/French/TimeExtractor.json index c3222a2b15..4080ecbc09 100644 --- a/Specs/DateTime/French/TimeExtractor.json +++ b/Specs/DateTime/French/TimeExtractor.json @@ -1251,7 +1251,7 @@ }, { "Input": "Je reviens à midi", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "midi", @@ -1813,5 +1813,68 @@ "Length": 5 } ] + }, + { + "Input": "23h est trop tard pour une heure d'arrive, veuillez prévoir quelque chose plus tôt", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "23h", + "Type": "time", + "Start": 0, + "Length": 3 + } + ] + }, + { + "Input": "Je vais rentrer à une heure de l'après-midi", + "NotSupported": "javascript,java", + "Results": [ + { + "Text": "une heure de l'après-midi", + "Type": "time", + "Start": 18, + "Length": 25 + } + ] + }, + { + "Input": "Je partirai à dix heures de l'après-midi", + "NotSupported": "javascript,java", + "Results": [ + { + "Text": "dix heures de l'après-midi", + "Type": "time", + "Start": 14, + "Length": 26 + } + ] + }, + { + "Input": "Je vais rentrer à cinq heures de l'après-midi", + "NotSupported": "javascript,java", + "Results": [ + { + "Text": "cinq heures de l'après-midi", + "Type": "time", + "Start": 18, + "Length": 27 + } + ] + }, + { + "Input": "une heure du matin", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "une heure du matin", + "Type": "time", + "Start": 0, + "Length": 18 + } + ] } ] + + + diff --git a/Specs/DateTime/French/TimeParser.json b/Specs/DateTime/French/TimeParser.json index c3129ed442..e516f88d55 100644 --- a/Specs/DateTime/French/TimeParser.json +++ b/Specs/DateTime/French/TimeParser.json @@ -3458,7 +3458,7 @@ }, { "Input": "Je vais revenir à midi", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "midi", @@ -3542,7 +3542,7 @@ }, { "Input": "Je reviendrai à midi", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "midi", @@ -3794,7 +3794,7 @@ }, { "Input": "Je reviens à midi", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "midi", @@ -4043,5 +4043,114 @@ "Length": 5 } ] + }, + { + "Input": "23h est trop tard pour une heure d'arrive, veuillez prévoir quelque chose plus tôt", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "23h", + "Type": "time", + "Value": { + "Timex": "T23", + "FutureResolution": { + "time": "23:00:00" + }, + "PastResolution": { + "time": "23:00:00" + } + }, + "Start": 0, + "Length": 3 + } + ] + }, + { + "Input": "Je vais rentrer à une heure de l'après-midi", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "une heure de l'après-midi", + "Type": "time", + "Value": { + "Timex": "T13", + "FutureResolution": { + "time": "13:00:00" + }, + "PastResolution": { + "time": "13:00:00" + } + }, + "Start": 18, + "Length": 25 + } + ] + }, + { + "Input": "Je partirai à dix heures de l'après-midi", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "dix heures de l'après-midi" , + "Type": "time", + "Value": { + "Timex": "T22", + "FutureResolution": { + "time": "22:00:00" + }, + "PastResolution": { + "time": "22:00:00" + } + }, + "Start": 14, + "Length": 25 + } + ] + + + }, + { + "Input": "Je vais rentrer à cinq heures de l'après-midi", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "cinq heures de l'après-midi", + "Type": "time", + "Value": { + "Timex": "T17", + "FutureResolution": { + "time": "17:00:00" + }, + "PastResolution": { + "time": "17:00:00" + } + }, + "Start": 18, + "Length": 27 + } + ] + }, + { + "Input": "une heure du matin", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "une heure du matin", + "Type": "time", + "Value": { + "Timex": "T01", + "FutureResolution": { + "time": "01:00:00" + }, + "PastResolution": { + "time": "01:00:00" + } + }, + "Start": 0, + "Length": 18 + } + ] } ] + + diff --git a/Specs/DateTime/French/TimeZoneExtractor.json b/Specs/DateTime/French/TimeZoneExtractor.json deleted file mode 100644 index 4c4d56a6d9..0000000000 --- a/Specs/DateTime/French/TimeZoneExtractor.json +++ /dev/null @@ -1,287 +0,0 @@ -[ - { - "Input": "Réservez-moi une chambre à l'heure de Beijing", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Beijing", - "Type": "timezone", - "Start": 29, - "Length": 16 - } - ] - }, - { - "Input": "Réservez-moi une chambre à utc 4h30", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "utc 4h30", - "Type": "timezone", - "Start": 27, - "Length": 8 - } - ] - }, - { - "Input": "Réservez-moi une chambre à gmt 3 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "gmt 3 heures", - "Type": "timezone", - "Start": 27, - "Length": 12 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure standard d’Afghanistan", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure standard d’Afghanistan", - "Type": "timezone", - "Start": 29, - "Length": 28 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure d’Afghanistan", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "l’heure d’Afghanistan", - "Type": "timezone", - "Start": 27, - "Length": 21 - } - ] - }, - { - "Input": "Réserve-moi une chambre à l'heure de Beijing", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Beijing", - "Type": "timezone", - "Start": 28, - "Length": 16 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l'heure de Saint-Louis", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Saint-Louis", - "Type": "timezone", - "Start": 29, - "Length": 20 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure de San José", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de San José", - "Type": "timezone", - "Start": 29, - "Length": 17 - } - ] - }, - { - "Input": "Pour moi, l’heure de Christchurch, l’heure de Colchester ou l’heure d’Édimbourg, ça va.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Christchurch", - "Type": "timezone", - "Start": 12, - "Length": 21 - }, - { - "Text": "heure de Colchester", - "Type": "timezone", - "Start": 37, - "Length": 19 - }, - { - "Text": "heure d’Édimbourg", - "Type": "timezone", - "Start": 62, - "Length": 17 - } - ] - }, - { - "Input": "Cortana vous enverra un e-mail pour trouver un temps qui marche dans le fuseau horaire de Sydney.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire de Sydney", - "Type": "timezone", - "Start": 72, - "Length": 24 - } - ] - }, - { - "Input": "Cortana vous enverra un e-mail pour trouver un temps qui fonctionne à l’heure de Montréal.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Montréal", - "Type": "timezone", - "Start": 72, - "Length": 17 - } - ] - }, - { - "Input": "Cortana vous enverra un courriel pour trouver un temps qui fonctionne à l’heure de Montréal.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Montréal", - "Type": "timezone", - "Start": 74, - "Length": 17 - } - ] - }, - { - "Input": "Réserve-moi une chambre à l'heure du Pacifique", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure du Pacifique", - "Type": "timezone", - "Start": 28, - "Length": 18 - } - ] - }, - { - "Input": "Réserve-moi une chambre à l'heure de l'Est", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de l'Est", - "Type": "timezone", - "Start": 28, - "Length": 14 - } - ] - }, - { - "Input": "rencontrons-nous à l'heure de Saint Barthélemy", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Saint Barthélemy", - "Type": "timezone", - "Start": 21, - "Length": 25 - } - ] - }, - { - "Input": "rencontrons-nous dans le fuseau horaire de Saint-Barthélemy", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire de Saint-Barthélemy", - "Type": "timezone", - "Start": 25, - "Length": 34 - } - ] - }, - { - "Input": "C’est le résultat du vote qui compte.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "Montre-moi les horaires à Lincoln Square", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "J’ai dit l’heure de New York, pas l’heure de York", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de New York", - "Type": "timezone", - "Start": 11, - "Length": 17 - }, - { - "Text": "heure de York", - "Type": "timezone", - "Start": 36, - "Length": 13 - } - ] - }, - { - "Input": "Je suis dans le fuseau horaire du Pacifique", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire du Pacifique", - "Type": "timezone", - "Start": 16, - "Length": 27 - } - ] - }, - { - "Input": "Rencontrons-nous à 13 heures dans le fuseau horaire des Rocheuses", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire des Rocheuses", - "Type": "timezone", - "Start": 37, - "Length": 28 - } - ] - }, - { - "Input": "Il est 13 heures, l'heure avancée de l'Est", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée de l'Est", - "Type": "timezone", - "Start": 20, - "Length": 22 - } - ] - }, - { - "Input": "Il est environ 13 heures ACDT", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "ACDT", - "Type": "timezone", - "Start": 25, - "Length": 4 - } - ] - }, - { - "Input": "Autrefois…", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - } -] diff --git a/Specs/DateTime/French/TimeZoneParser.json b/Specs/DateTime/French/TimeZoneParser.json deleted file mode 100644 index 4b9743e24a..0000000000 --- a/Specs/DateTime/French/TimeZoneParser.json +++ /dev/null @@ -1,913 +0,0 @@ -[ - { - "Input": "Réservez-moi une chambre à l'heure de Beijing", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Beijing", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 29, - "Length": 16 - } - ] - }, - { - "Input": "Réservez-moi une chambre à utc 4h30", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "utc 4h30", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 27, - "Length": 8 - } - ] - }, - { - "Input": "Réservez-moi une chambre à gmt 3 heures", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "gmt 3 heures", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-03:00", - "UtcOffsetMins": -180 - } - }, - "Start": 27, - "Length": 12 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure normale d’Afghanistan", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure normale d’Afghanistan", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 29, - "Length": 27 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure d'Afghanistan", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure d'Afghanistan", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 29, - "Length": 19 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l'utc+/-0", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "utc+/-0", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+00:00", - "UtcOffsetMins": 0 - } - }, - "Start": 29, - "Length": 7 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure d’été du pacifique", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure d’été du pacifique", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 29, - "Length": 24 - } - ] - }, - { - "Input": "Réservez-moi une chambre à awdt", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "awdt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 27, - "Length": 4 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure de la Colombie", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de la Colombie", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 29, - "Length": 20 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l'heure de Hong Kong", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Hong Kong", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 29, - "Length": 18 - } - ] - }, - { - "Input": "Réserve-moi une chambre à l’heure d’été du pacifique", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure d’été du pacifique", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 28, - "Length": 24 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure avancée de l’ouest de l'australie", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée de l’ouest de l'australie", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 29, - "Length": 39 - } - ] - }, - { - "Input": "Réserve-moi une chambre à l’heure avancée de l’ouest de l'australie", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée de l’ouest de l'australie", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 28, - "Length": 39 - } - ] - }, - { - "Input": "Réserve-moi une chambre à l’heure de la Colombie", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de la Colombie", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 28, - "Length": 20 - } - ] - }, - { - "Input": "Réserve-moi une chambre à l'heure de Hong Kong", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Hong Kong", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 28, - "Length": 18 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure avancée de l’est de l'australie", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée de l’est de l'australie", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+11:00", - "UtcOffsetMins": 660 - } - }, - "Start": 29, - "Length": 37 - } - ] - }, - { - "Input": "Réserve-moi une chambre à l’heure avancée du pacifique", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée du pacifique", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 28, - "Length": 26 - } - ] - }, - { - "Input": "Réservez-moi une chambre à tost", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tost", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+14:00", - "UtcOffsetMins": 840 - } - }, - "Start": 27, - "Length": 4 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l’heure avancée du pacifique", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée du pacifique", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 29, - "Length": 26 - } - ] - }, - { - "Input": "Réservez-moi une chambre à 10h30, l'heure de Montréal.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Montréal", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 36, - "Length": 17 - } - ] - }, - { - "Input": "Réservez-moi une chambre à l'heure de Saint-Barthélemy.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Saint-Barthélemy", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 29, - "Length": 25 - } - ] - }, - { - "Input": "Réservez-moi une chambre à 16h30, l'heure de l'ouest de l'Europe.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de l'ouest de l'Europe", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+00:00", - "UtcOffsetMins": 0 - } - }, - "Start": 36, - "Length": 28 - } - ] - }, - { - "Input": "Réservez-moi une chambre à 16h30, l'heure standard de l'Europe Centrale.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure standard de l'Europe Centrale", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+01:00", - "UtcOffsetMins": 60 - } - }, - "Start": 36, - "Length": 35 - } - ] - }, - { - "Input": "On peut faire soit à l'heure de New York, soit à l'heure de Sao Paolo.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de New York", - "Start": 23, - "Length": 17, - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - } - }, - { - "Text": "heure de Sao Paolo", - "Start": 51, - "Length": 18, - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - } - } - ] - }, - { - "Input": "Assurez-vous d’accueillir le fuseau horaire de la côte ouest.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire de la côte ouest", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 29, - "Length": 31 - } - ] - }, - { - "Input": "ce soir à 18 heures, l'heure avancée du Centre", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée du Centre", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - }, - "Start": 23, - "Length": 23 - } - ] - }, - { - "Input": "Préparez les appels des équipes de 30 minutes pendant les heures centrales d’ouverture", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heures centrales", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 58, - "Length": 16 - } - ] - }, - { - "Input": "Je m'ouvre à 11h30 aujourd'hui, l'heure avancée du pacifique/l'heure normale du Central", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée du pacifique", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 34, - "Length": 26 - }, - { - "Text": "heure normale du Central", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 63, - "Length": 24 - } - ] - }, - { - "Input": "Je suis dans le fuseau pacifique", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau pacifique", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "value": "UTC-08:00", - "utcOffsetMins": "-480" - } - }, - "Start": 16, - "Length": 16 - } - ] - }, - { - "Input": "On se voit à 13 heures dans le fuseau horaire de Rocheusse", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire de Rocheusse", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "-360", - "value": "UTC-06:00" - } - }, - "Start": 31, - "Length": 27 - } - ] - }, - { - "Input": "Je suis à l’heure de Madrid", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure de Madrid", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 12, - "Length": 15 - } - ] - }, - { - "Input": "Je suis dans le fuseau horaire de Madrid", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire de Madrid", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 16, - "Length": 24 - } - ] - }, - { - "Input": "Je me trouve dans le fuseau horaire de Madrid", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire de Madrid", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 21, - "Length": 24 - } - ] - }, - { - "Input": "Je suis à Madrid.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "Je suis dans le fuseau horaire de Russie 3", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire de Russie 3", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "240", - "value": "UTC+04:00" - } - }, - "Start": 16, - "Length": 26 - } - ] - }, - { - "Input": "Tout moment à l'heure normale du Central (Mexico)", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure normale du Central", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "-360", - "value": "UTC-06:00" - } - }, - "Start": 16, - "Length": 24 - } - ] - }, - { - "Input": "Je suis dans le fuseau horaire de Russie 10", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "fuseau horaire de Russie 10", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "660", - "value": "UTC+11:00" - } - }, - "Start": 16, - "Length": 27 - } - ] - }, - { - "Input": "Je suis à MSK+7, pas MSK", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "MSK+7", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "600", - "value": "UTC+10:00" - } - }, - "Start": 10, - "Length": 5 - }, - { - "Text": "MSK", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "180", - "value": "UTC+03:00" - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Je suis à MSK-1.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "MSK-1", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "120", - "value": "UTC+02:00" - } - }, - "Start": 10, - "Length": 5 - } - ] - }, - { - "Input": "Réservez-moi une chambre à UTC + 4", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "UTC + 4", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:00", - "UtcOffsetMins": 240 - } - }, - "Start": 27, - "Length": 7 - } - ] - }, - { - "Input": "Réservez-moi une chambre à UTC -4", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "UTC -4", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-04:00", - "UtcOffsetMins": -240 - } - }, - "Start": 27, - "Length": 6 - } - ] - }, - { - "Input": "Je suis à l’heure d’été de l'Ouest", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure d’été de l'Ouest", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 12, - "Length": 22 - } - ] - }, - { - "Input": "Je suis à l'heure avancée du Centre", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée du Centre", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 12, - "Length": 23 - } - ] - }, - { - "Input": "Il est environ 13 heures de l'heure avancée du centre de l'australie", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure avancée du centre de l'australie", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+10:30", - "UtcOffsetMins": 630 - } - }, - "Start": 30, - "Length": 38 - } - ] - }, - { - "Input": "Les îles de la ligne de Kiribati sont à UTC+14", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "UTC+14", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+14:00", - "UtcOffsetMins": 840 - } - }, - "Start": 40, - "Length": 6 - } - ] - }, - { - "Input": "Tous les délais sont à 23h59 UTC -12 heures («n’importe où sur terre/AoE»).", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "UTC -12 heures", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 29, - "Length": 14 - }, - { - "Text": "n’importe où sur terre", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 46, - "Length": 22 - }, - { - "Text": "AoE", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 69, - "Length": 3 - } - ] - }, - { - "Input": "N’oublie pas qu’on est à l’heure anglaise", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "heure anglaise", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 27, - "Length": 14 - } - ] - }, - { - "Input": "Pouvez-vous trouver une place dans un moment de convivialité des Etats-Unis?", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "moment de convivialité des Etats-Unis", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 38, - "Length": 37 - } - ] - } -] diff --git a/Specs/DateTime/German/DateExtractor.json b/Specs/DateTime/German/DateExtractor.json index 3ca097d27a..edb4e4749a 100644 --- a/Specs/DateTime/German/DateExtractor.json +++ b/Specs/DateTime/German/DateExtractor.json @@ -350,5 +350,27 @@ "Length": 26 } ] + }, + { + "Input": "Mein Geburtsdatum ist der 22.04.1990", + "Results": [ + { + "Text": "der 22.04.1990", + "Type": "date", + "Start": 22, + "Length": 14 + } + ] + }, + { + "Input": "Um wie viel Uhr werde ich am Dienstag, den 15.6. den Doktor sehen?", + "Results": [ + { + "Text": "dienstag, den 15.6", + "Type": "date", + "Start": 29, + "Length": 18 + } + ] } ] diff --git a/Specs/DateTime/German/DatePeriodExtractor.json b/Specs/DateTime/German/DatePeriodExtractor.json index d2a0efd14a..73ede453f1 100644 --- a/Specs/DateTime/German/DatePeriodExtractor.json +++ b/Specs/DateTime/German/DatePeriodExtractor.json @@ -754,5 +754,41 @@ "Length": 10 } ] + }, + { + "Input": "Zeigen Sie mir die Aufzeichnungen vom August 99", + "NotSupportedByDesign": "javascript", + "Results": [ + { + "Text": "August 99", + "Type": "daterange", + "Start": 38, + "Length": 9 + } + ] + }, + { + "Input": "Zeigen Sie mir die Aufzeichnungen vom August '99", + "NotSupportedByDesign": "javascript", + "Results": [ + { + "Text": "August '99", + "Type": "daterange", + "Start": 38, + "Length": 10 + } + ] + }, + { + "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/DatePeriodParser.json b/Specs/DateTime/German/DatePeriodParser.json index 7bae9c3d8b..ca93b44de9 100644 --- a/Specs/DateTime/German/DatePeriodParser.json +++ b/Specs/DateTime/German/DatePeriodParser.json @@ -1310,5 +1310,51 @@ "Length": 9 } ] + }, + { + "Input": "Zeigen Sie mir die Aufzeichnungen vom August 99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "August 99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 38, + "Length": 9 + } + ] + }, + { + "Input": "Zeigen Sie mir die Aufzeichnungen vom August '99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "August '99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 38, + "Length": 10 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/German/DateTimeModel.json b/Specs/DateTime/German/DateTimeModel.json index 0e914eaff7..d05d94d3af 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", @@ -734,145 +733,6 @@ } ] }, - { - "Input": "Das passiert dann jährlich", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "jährlich", - "Start": 18, - "End": 25, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ich muss das alle zwei Tage machen", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "alle zwei tage", - "Start": 13, - "End": 26, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Ich gehe jeden Tag um 3 Uhr Nachmittags", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "python", - "Results": [ - { - "Text": "jeden tag um 3 uhr nachmittags", - "Start": 9, - "End": 38, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Wir treffen uns Montags", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "montags", - "Start": 16, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Der Termin ist jeden Mittwoch um 16 Uhr", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "jeden mittwoch um 16 uhr", - "Start": 15, - "End": 38, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-3T16", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Das Meeting ist immer Mittwochs", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "immer mittwochs", - "Start": 16, - "End": 30, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-3", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Ich bin gegen 7:56:30 Abends zurück", "Context": { @@ -1270,6 +1130,29 @@ "NotSupported": "javascript", "Results": [] }, + { + "Input": "Lass uns um 00:00 einen Kaffee trinken gehen", + "Context": { + "ReferenceDateTime": "2023-08-05T00:00:00" + }, + "Results": [ + { + "Text": "00:00", + "Start": 12, + "End": 16, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T00:00", + "type": "time", + "value": "00:00:00" + } + ] + } + } + ] + }, { "Input": "Lass uns um 18:12 einen Kaffee trinken gehen", "Context": { @@ -1390,29 +1273,6 @@ } ] }, - { - "Input": "Ich gehe jeden Montag um 4 Uhr", - "Context": { - "ReferenceDateTime": "2019-08-06T00:00:00" - }, - "Results": [ - { - "Text": "jeden montag um 4 uhr", - "Start": 9, - "End": 29, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T04", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Am Wochenende bin ich nicht hier", "Context": { @@ -2745,21 +2605,6 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Results": [ - { - "Text": "jeden tag", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "19:13 uhr", "Start": 13, @@ -2777,29 +2622,6 @@ } ] }, - { - "Input": "jeden Abend um 19:13 Uhr Alarm stellen", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Results": [ - { - "Text": "jeden abend um 19:13 uhr", - "Start": 0, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T19:13", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Was läuft am ostermontag um 10:30 uhr?", "Context": { @@ -3924,7 +3746,7 @@ "Context": { "ReferenceDateTime": "2018-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "so 27.02.2022", @@ -4416,30 +4238,6 @@ } ] }, - { - "Input": "Jeden Donnerstag wandern wir auf dem Goldsteig.", - "Context": { - "ReferenceDateTime": "2021-06-18T18:00:00" - }, - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "jeden donnerstag", - "Start": 0, - "End": 15, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-4", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Tag der Arbeit, ersten Weihnachtsfeiertag, zweiten Weihnachtstag", "Context": { @@ -4786,30 +4584,6 @@ } ] }, - { - "Input": "Kinderflohmarkt immer Sonnabends", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "python", - "Results": [ - { - "Text": "immer sonnabends", - "Start": 16, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-6", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "In Deutschland gibt es unter anderem den meteorologischen und kalendarischen Herbstanfang.", "Context": { @@ -5618,5 +5392,80 @@ } } ] + }, + { + "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" + } + ] + } + } + ] + }, + { + "Input": "Um wie viel Uhr werde ich am Dienstag, den 15.6. den Doktor sehen?", + "Context": { + "ReferenceDateTime": "2023-08-02T00:00:00" + }, + "Results": [ + { + "Text": "dienstag, den 15.6", + "Start": 29, + "End": 46, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-06-15", + "type": "date", + "value": "2023-06-15" + }, + { + "timex": "XXXX-06-15", + "type": "date", + "value": "2024-06-15" + } + ] + } + } + ] } -] \ No newline at end of file +] diff --git a/Specs/DateTime/German/SetExtractor.json b/Specs/DateTime/German/SetExtractor.json deleted file mode 100644 index 30f75b37b1..0000000000 --- a/Specs/DateTime/German/SetExtractor.json +++ /dev/null @@ -1,158 +0,0 @@ -[ - { - "Input": "Ich verlasse das Hause täglich", - "NotSupported": "javascript", - "Results": [ - { - "Text": "täglich", - "Type": "set", - "Start": 23, - "Length": 7 - } - ] - }, - { - "Input": "Ich gehe täglich", - "NotSupported": "javascript", - "Results": [ - { - "Text": "täglich", - "Type": "set", - "Start": 9, - "Length": 7 - } - ] - }, - { - "Input": "Ich gehe jeden Tag", - "NotSupported": "javascript", - "Results": [ - { - "Text": "jeden Tag", - "Type": "set", - "Start": 9, - "Length": 9 - } - ] - }, - { - "Input": "Ich gehe jeden Monat", - "NotSupported": "javascript", - "Results": [ - { - "Text": "jeden Monat", - "Type": "set", - "Start": 9, - "Length": 11 - } - ] - }, - { - "Input": "Ich gehe jährlich", - "NotSupported": "javascript", - "Results": [ - { - "Text": "jährlich", - "Type": "set", - "Start": 9, - "Length": 8 - } - ] - }, - { - "Input": "Ich gehe jedes Jahr", - "NotSupported": "javascript", - "Results": [ - { - "Text": "jedes Jahr", - "Type": "set", - "Start": 9, - "Length": 10 - } - ] - }, - { - "Input": "Ich gehe alle 2 Tage", - "NotSupported": "javascript", - "Results": [ - { - "Text": "alle 2 Tage", - "Type": "set", - "Start": 9, - "Length": 11 - } - ] - }, - { - "Input": "Ich gehe alle 3 Wochen", - "NotSupported": "javascript", - "Results": [ - { - "Text": "alle 3 Wochen", - "Type": "set", - "Start": 9, - "Length": 13 - } - ] - }, - { - "Input": "Ich gehe jeden Tag um 3 Uhr", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "jeden Tag um 3 Uhr", - "Type": "set", - "Start": 9, - "Length": 18 - } - ] - }, - { - "Input": "Ich gehe um 3 Uhr jeden Tag", - "NotSupported": "javascript", - "Results": [ - { - "Text": "3 Uhr jeden Tag", - "Type": "set", - "Start": 12, - "Length": 15 - } - ] - }, - { - "Input": "Ich gehe jeden Montag", - "NotSupported": "javascript", - "Results": [ - { - "Text": "jeden Montag", - "Type": "set", - "Start": 9, - "Length": 12 - } - ] - }, - { - "Input": "Ich gehe jeden Montag um 4 Uhr", - "NotSupported": "javascript", - "Results": [ - { - "Text": "jeden Montag um 4 Uhr", - "Type": "set", - "Start": 9, - "Length": 21 - } - ] - }, - { - "Input": "Ich gehe jede Nacht um 4 Uhr", - "NotSupported": "javascript", - "Results": [ - { - "Text": "jede Nacht um 4 Uhr", - "Type": "set", - "Start": 9, - "Length": 19 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/German/SetParser.json b/Specs/DateTime/German/SetParser.json deleted file mode 100644 index 4e5e552568..0000000000 --- a/Specs/DateTime/German/SetParser.json +++ /dev/null @@ -1,122 +0,0 @@ -[ - { - "Input": "Ich mache das wöchentlich", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2744475+08:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "wöchentlich", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 14, - "Length": 11 - } - ] - }, - { - "Input": "Ich mache das täglich", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2779449+08:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "täglich", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 14, - "Length": 7 - } - ] - }, - { - "Input": "Ich mache das jeden Tag", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2744475+08:00" - }, - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "jeden Tag", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 14, - "Length": 9 - } - ] - }, - { - "Input": "Das ist ein monatlich auftretendes Problem.", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2779449+08:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "monatlich", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 12, - "Length": 9 - } - ] - }, - { - "Input": "Das ist unser alljährliches Sommerfest.", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2779449+08:00" - }, - "NotSupported": "javascript", - "Results": [ - { - "Text": "alljährliches", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 14, - "Length": 13 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/German/TimeExtractor.json b/Specs/DateTime/German/TimeExtractor.json index dd02fd917a..afda6b74f5 100644 --- a/Specs/DateTime/German/TimeExtractor.json +++ b/Specs/DateTime/German/TimeExtractor.json @@ -179,6 +179,126 @@ } ] }, + { + "Input": "Es ist 10 nach 3", + "NotSupported": "javascript", + "Results": [ + { + "Text": "10 nach 3", + "Type": "time", + "Start": 7, + "Length": 9 + } + ] + }, + { + "Input": "Es ist 10 nach drei", + "NotSupported": "javascript", + "Results": [ + { + "Text": "10 nach drei", + "Type": "time", + "Start": 7, + "Length": 12 + } + ] + }, + { + "Input": "Es ist zehn nach 3", + "NotSupported": "javascript", + "Results": [ + { + "Text": "zehn nach 3", + "Type": "time", + "Start": 7, + "Length": 11 + } + ] + }, + { + "Input": "Es ist zehn nach drei", + "NotSupported": "javascript", + "Results": [ + { + "Text": "zehn nach drei", + "Type": "time", + "Start": 7, + "Length": 14 + } + ] + }, + { + "Input": "Es ist 5 vor 3", + "NotSupported": "javascript", + "Results": [ + { + "Text": "5 vor 3", + "Type": "time", + "Start": 7, + "Length": 7 + } + ] + }, + { + "Input": "Es ist 5 minuten vor 4", + "NotSupported": "javascript", + "Results": [ + { + "Text": "5 minuten vor 4", + "Type": "time", + "Start": 7, + "Length": 15 + } + ] + }, + { + "Input": "Es ist 5 min vor vier", + "NotSupported": "javascript", + "Results": [ + { + "Text": "5 min vor vier", + "Type": "time", + "Start": 7, + "Length": 14 + } + ] + }, + { + "Input": "Es ist fünf minuten vor 8", + "NotSupported": "javascript", + "Results": [ + { + "Text": "fünf minuten vor 8", + "Type": "time", + "Start": 7, + "Length": 18 + } + ] + }, + { + "Input": "Es ist fünf vor vier", + "NotSupported": "javascript", + "Results": [ + { + "Text": "fünf vor vier", + "Type": "time", + "Start": 7, + "Length": 13 + } + ] + }, + { + "Input": "Es ist fünf minuten vor vier", + "NotSupported": "javascript", + "Results": [ + { + "Text": "fünf minuten vor vier", + "Type": "time", + "Start": 7, + "Length": 21 + } + ] + }, { "Input": "Es ist viertel nach acht", "NotSupported": "javascript", @@ -239,4 +359,4 @@ } ] } -] \ No newline at end of file +] diff --git a/Specs/DateTime/German/TimeParser.json b/Specs/DateTime/German/TimeParser.json index 9785cda5b4..d1d37bfa86 100644 --- a/Specs/DateTime/German/TimeParser.json +++ b/Specs/DateTime/German/TimeParser.json @@ -104,6 +104,90 @@ } ] }, + { + "Input": "Das dürfte gegen 10 nach 3 Vormittags sein.", + "NotSupported": "javascript", + "Results": [ + { + "Text": "10 nach 3 Vormittags", + "Type": "time", + "Value": { + "Timex": "T03:10", + "FutureResolution": { + "time": "03:10:00" + }, + "PastResolution": { + "time": "03:10:00" + } + }, + "Start": 17, + "Length": 20 + } + ] + }, + { + "Input": "Das dürfte gegen 10 nach drei Nachmittag sein.", + "NotSupported": "javascript", + "Results": [ + { + "Text": "10 nach drei Nachmittag", + "Type": "time", + "Value": { + "Timex": "T15:10", + "FutureResolution": { + "time": "15:10:00" + }, + "PastResolution": { + "time": "15:10:00" + } + }, + "Start": 17, + "Length": 23 + } + ] + }, + { + "Input": "Das dürfte gegen zehn nach 3 Vormittags sein.", + "NotSupported": "javascript", + "Results": [ + { + "Text": "zehn nach 3 Vormittags", + "Type": "time", + "Value": { + "Timex": "T03:10", + "FutureResolution": { + "time": "03:10:00" + }, + "PastResolution": { + "time": "03:10:00" + } + }, + "Start": 17, + "Length": 22 + } + ] + }, + { + "Input": "Das dürfte gegen zehn nach drei Nachmittag sein.", + "NotSupported": "javascript", + "Results": [ + { + "Text": "zehn nach drei Nachmittag", + "Type": "time", + "Value": { + "Timex": "T15:10", + "FutureResolution": { + "time": "15:10:00" + }, + "PastResolution": { + "time": "15:10:00" + } + }, + "Start": 17, + "Length": 25 + } + ] + }, { "Input": "Das dürfte gegen viertel nach 7 Vormittags sein.", "NotSupported": "javascript", @@ -125,6 +209,132 @@ } ] }, + { + "Input": "Es ist 5 vor 3 Vormittags", + "NotSupported": "javascript", + "Results": [ + { + "Text": "5 vor 3 vormittags", + "Type": "time", + "Value": { + "Timex": "T02:55", + "FutureResolution": { + "time": "02:55:00" + }, + "PastResolution": { + "time": "02:55:00" + } + }, + "Start": 7, + "Length": 18 + } + ] + }, + { + "Input": "Es ist 5 minuten vor 4 Nachmittag", + "NotSupported": "javascript", + "Results": [ + { + "Text": "5 minuten vor 4 nachmittag", + "Type": "time", + "Value": { + "Timex": "T15:55", + "FutureResolution": { + "time": "15:55:00" + }, + "PastResolution": { + "time": "15:55:00" + } + }, + "Start": 7, + "Length": 26 + } + ] + }, + { + "Input": "Es ist 5 min vor vier vormittags", + "NotSupported": "javascript", + "Results": [ + { + "Text": "5 min vor vier vormittags", + "Type": "time", + "Value": { + "Timex": "T03:55", + "FutureResolution": { + "time": "03:55:00" + }, + "PastResolution": { + "time": "03:55:00" + } + }, + "Start": 7, + "Length": 25 + } + ] + }, + { + "Input": "Es ist fünf minuten vor 8 Nachmittag", + "NotSupported": "javascript", + "Results": [ + { + "Text": "fünf minuten vor 8 nachmittag", + "Type": "time", + "Value": { + "Timex": "T19:55", + "FutureResolution": { + "time": "19:55:00" + }, + "PastResolution": { + "time": "19:55:00" + } + }, + "Start": 7, + "Length": 29 + } + ] + }, + { + "Input": "Es ist fünf vor zehn Vormittags", + "NotSupported": "javascript", + "Results": [ + { + "Text": "fünf vor zehn vormittags", + "Type": "time", + "Value": { + "Timex": "T09:55", + "FutureResolution": { + "time": "09:55:00" + }, + "PastResolution": { + "time": "09:55:00" + } + }, + "Start": 7, + "Length": 24 + } + ] + }, + { + "Input": "Es ist fünf minuten vor vier nachmittag", + "NotSupported": "javascript", + "Results": [ + { + "Text": "fünf minuten vor vier nachmittag", + "Type": "time", + "Value": { + "Timex": "T15:55", + "FutureResolution": { + "time": "15:55:00" + }, + "PastResolution": { + "time": "15:55:00" + } + }, + "Start": 7, + "Length": 32 + } + ] + }, { "Input": "Ich habe den Alarm auf 8:40 eingestellt", "NotSupported": "javascript", @@ -543,4 +753,4 @@ } ] } -] \ No newline at end of file +] diff --git a/Specs/DateTime/Hindi/DateTimeModel.json b/Specs/DateTime/Hindi/DateTimeModel.json index 913e724cdd..e53739dd36 100644 --- a/Specs/DateTime/Hindi/DateTimeModel.json +++ b/Specs/DateTime/Hindi/DateTimeModel.json @@ -1269,199 +1269,6 @@ } ] }, - { - "Input": "मैं हर हफ़्ते बाहर जाउंगा", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर हफ़्ते", - "Start": 4, - "End": 11, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "मैं रोज जाऊंगा", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज", - "Start": 4, - "End": 6, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "मैं हर साल बाहर जाउंगा", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर साल", - "Start": 4, - "End": 9, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "मैं हर दो दिन बाहर जाउंगा", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दो दिन", - "Start": 4, - "End": 12, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "मैं हर तीन हफ्ते में बाहर जाउंगा", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर तीन हफ्ते में", - "Start": 4, - "End": 19, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "मैं हर दिन दोपहर 3 बजे निकलूंगा", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दिन दोपहर 3 बजे", - "Start": 4, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "मैं हर सोमवार बाहर रहुंगा", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर सोमवार", - "Start": 4, - "End": 12, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "मैं हर सोमवार शाम 4 बजे निकलूंगा", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर सोमवार शाम 4 बजे", - "Start": 4, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "मैं शाम 7:56:30 बजे आऊंगा", "Context": { @@ -2884,21 +2691,6 @@ "NotSupported": "dotnet", "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "हर हफ्ते", - "Start": 0, - "End": 7, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 28, @@ -2925,21 +2717,6 @@ "NotSupported": "dotnet", "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "प्रत्येक सप्ताह", - "Start": 9, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 136, @@ -9675,7 +9452,7 @@ "ReferenceDateTime": "2019-01-25T12:00:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21 सोमवार", @@ -9704,7 +9481,7 @@ "Context": { "ReferenceDateTime": "2019-01-21T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21 सोमवार", @@ -9729,7 +9506,7 @@ "ReferenceDateTime": "2019-01-25T12:00:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "रविवार 31", @@ -9759,7 +9536,7 @@ "ReferenceDateTime": "2019-02-25T12:00:00" }, "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "31 शुक्रवार", @@ -9783,6 +9560,35 @@ } ] }, + { + "Input": "क्या शनिवार 30 तारीख को कोई व्यवस्था है!", + "Context": { + "ReferenceDateTime": "2023-07-05T12:00:00" + }, + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "शनिवार 30", + "Start": 5, + "End": 14, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-WXX-6", + "type": "date", + "value": "2022-07-30" + }, + { + "timex": "XXXX-WXX-6", + "type": "date", + "value": "2023-09-30" + } + ] + } + } + ] + }, { "Input": "क्या मई के मध्य के बाद आपके कोई इंतजाम है?", "Context": { @@ -10253,21 +10059,6 @@ "NotSupported": "dotnet", "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "हर मंगलवार", - "Start": 0, - "End": 9, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "thursday 19:00 - 21:00", "Start": 44, diff --git a/Specs/DateTime/Hindi/MergedParser.json b/Specs/DateTime/Hindi/MergedParser.json index 31980c1bb3..13971f3360 100644 --- a/Specs/DateTime/Hindi/MergedParser.json +++ b/Specs/DateTime/Hindi/MergedParser.json @@ -630,21 +630,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "हर हफ्ते", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 0, - "Length": 8 - }, { "Text": "सुबह 8 बजे", "Type": "datetimeV2.time", @@ -669,21 +654,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "हर महीने", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 0, - "Length": 8 - }, { "Text": "दूसरे शनिवार", "Type": "datetimeV2.date", @@ -1451,21 +1421,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "हर हफ्ते", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 8, - "Length": 8 - }, { "Text": "सुबह 8 बजे", "Type": "datetimeV2.time", diff --git a/Specs/DateTime/Hindi/SetExtractor.json b/Specs/DateTime/Hindi/SetExtractor.json deleted file mode 100644 index 14e06b6a31..0000000000 --- a/Specs/DateTime/Hindi/SetExtractor.json +++ /dev/null @@ -1,364 +0,0 @@ -[ - { - "Input": "मैं हर हफ्ते जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर हफ्ते", - "Type": "set", - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "मैं रोज़ जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज़", - "Type": "set", - "Start": 4, - "Length": 3 - } - ] - }, - { - "Input": "मैं हर दिन", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दिन", - "Type": "set", - "Start": 4, - "Length": 6 - } - ] - }, - { - "Input": "मैं हर महीने जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर महीने", - "Type": "set", - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "मैं सालाना जाता हूं", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "सालाना", - "Type": "set", - "Start": 4, - "Length": 6 - } - ] - }, - { - "Input": "मैं साल में एक बार जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "साल में एक बार", - "Type": "set", - "Start": 4, - "Length": 14 - } - ] - }, - { - "Input": "मैं ऐनुअली एक बार जाता हूं", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "ऐनुअली एक बार", - "Type": "set", - "Start": 4, - "Length": 13 - } - ] - }, - { - "Input": "मैं हर दो दिन में जाती हूं", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दो दिन में", - "Type": "set", - "Start": 4, - "Length": 13 - } - ] - }, - { - "Input": "मैं प्रत्येक दूसरे दिन जाती हूं", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "प्रत्येक दूसरे दिन", - "Type": "set", - "Start": 4, - "Length": 18 - } - ] - }, - { - "Input": "मैं हरेक तीन हफ़्तों में जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हरेक तीन हफ़्तों में", - "Type": "set", - "Start": 4, - "Length": 19 - } - ] - }, - { - "Input": "मैं हर तीसरे हफ़्ते जाती हूं", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर तीसरे हफ़्ते", - "Type": "set", - "Start": 4, - "Length": 14 - } - ] - }, - { - "Input": "मैं रोज़ शाम 3 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज़ शाम 3 बजे", - "Type": "set", - "Start": 4, - "Length": 13 - } - ] - }, - { - "Input": "मैं हर दिन शाम 3 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दिन शाम 3 बजे", - "Type": "set", - "Start": 4, - "Length": 16 - } - ] - }, - { - "Input": "हरेक 15/4 को मैं निकल जाउंगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हरेक 15/4", - "Type": "set", - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "मैं हरेक सोमवार को जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हरेक सोमवार", - "Type": "set", - "Start": 4, - "Length": 11 - } - ] - }, - { - "Input": "मैं हर सोमवार को शाम 4 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर सोमवार को शाम 4 बजे", - "Type": "set", - "Start": 4, - "Length": 22 - } - ] - }, - { - "Input": "मैं रोज सुबह जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज सुबह", - "Type": "set", - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "मैं प्रतिदिन पूर्वाह्न 9 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "प्रतिदिन पूर्वाह्न 9 बजे", - "Type": "set", - "Start": 4, - "Length": 24 - } - ] - }, - { - "Input": "मैं रोजाना दोपहर 4 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोजाना दोपहर 4 बजे", - "Type": "set", - "Start": 4, - "Length": 18 - } - ] - }, - { - "Input": "मैं हर रोज रात 9 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर रोज रात 9 बजे", - "Type": "set", - "Start": 4, - "Length": 16 - } - ] - }, - { - "Input": "मैं रोज़ रात के 9 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज़ रात के 9 बजे", - "Type": "set", - "Start": 4, - "Length": 16 - } - ] - }, - { - "Input": "मैं रोज़ सुबह ९ बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज़ सुबह ९ बजे", - "Type": "set", - "Start": 4, - "Length": 14 - } - ] - }, - { - "Input": "मैं रोज़ सुबह को 9 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज़ सुबह को 9 बजे", - "Type": "set", - "Start": 4, - "Length": 17 - } - ] - }, - { - "Input": "मैं हर इतवार को सुबह 9 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर इतवार को सुबह 9 बजे", - "Type": "set", - "Start": 4, - "Length": 22 - } - ] - }, - { - "Input": "मैं हर रविवार को सुबह 9 बजे जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर रविवार को सुबह 9 बजे", - "Type": "set", - "Start": 4, - "Length": 23 - } - ] - }, - { - "Input": "मैं हर मंडे को 9 ओक्लॉक जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर मंडे को 9 ओक्लॉक", - "Type": "set", - "Start": 4, - "Length": 19 - } - ] - }, - { - "Input": "मैं हर सोमवार को जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर सोमवार", - "Type": "set", - "Start": 4, - "Length": 9 - } - ] - }, - { - "Input": "मैं हर संडे को जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर संडे", - "Type": "set", - "Start": 4, - "Length": 7 - } - ] - }, - { - "Input": "मैं हर इतवार जाऊँगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर इतवार", - "Type": "set", - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "क्या मैं 09th मई को 2 रातों के लिए बुकिंग करवा सकता हूँ ", - "Comment": "(Can I do a booking for the 09th of May for 2 nights?). Hindi does not use plurals of weekdays such as 'Mondays', 'mornings', 'nights'", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रातों ", - "Type": "set", - "Start": 22, - "Length": 6 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Hindi/SetParser.json b/Specs/DateTime/Hindi/SetParser.json deleted file mode 100644 index 59496df5af..0000000000 --- a/Specs/DateTime/Hindi/SetParser.json +++ /dev/null @@ -1,654 +0,0 @@ -[ - { - "Input": "मैं हर हफ्ते जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2744475+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर हफ्ते", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "मैं हफ्ते में दो बार जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2754476+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हफ्ते में दो बार", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 4, - "Length": 16 - } - ] - }, - { - "Input": "मैं रोज़ जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2779449+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज़", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 4, - "Length": 3 - } - ] - }, - { - "Input": "मैं रोज़ जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2794445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोज़", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 4, - "Length": 3 - } - ] - }, - { - "Input": "मैं हर महीने जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2829445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर महीने", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "मैं सालाना जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2844439+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "सालाना", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 4, - "Length": 6 - } - ] - }, - { - "Input": "मैं हर वर्ष जाउंगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2854444+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर वर्ष", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 4, - "Length": 7 - } - ] - }, - { - "Input": "मैं हर दो दिन में जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2909444+03:00" - }, - "Comment": "The input literally translates to 'I'll leave each in two days' and 'in two days' is processed as Date instead of Duration", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दो दिन में", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 4, - "Length": 13 - } - ] - }, - { - "Input": "मैं हर तीन हफ्ते में जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2959472+03:00" - }, - "Comment": "The input literally translates to 'I'll leave each in three weeks' and 'in three weeks' is processed as Date instead of Duration", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर तीन हफ्ते में", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 4, - "Length": 16 - } - ] - }, - { - "Input": "मैं रोजाना शाम को 3 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2989494+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोजाना शाम को 3 बजे", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 4, - "Length": 19 - } - ] - }, - { - "Input": "मैं हर दिन शाम को 3 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3039501+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दिन शाम को 3 बजे", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 4, - "Length": 19 - } - ] - }, - { - "Input": "मैं हर सोमवार को जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3259514+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर सोमवार", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 4, - "Length": 9 - } - ] - }, - { - "Input": "मैं हर सोमवार को शाम 4 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3379507+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर सोमवार को शाम 4 बजे", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 4, - "Length": 22 - } - ] - }, - { - "Input": "मैं हर दिन सुबह जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3429518+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दिन सुबह", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 4, - "Length": 11 - } - ] - }, - { - "Input": "मैं हर रोज सुबह 9 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3609535+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर रोज सुबह 9 बजे", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 4, - "Length": 17 - } - ] - }, - { - "Input": "मैं हर दिन दोपहर 4 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3730732+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर दिन दोपहर 4 बजे", - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - }, - "Start": 4, - "Length": 18 - } - ] - }, - { - "Input": "मैं डेली रात 9 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3840706+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "डेली रात 9 बजे", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 4, - "Length": 14 - } - ] - }, - { - "Input": "मैं रोजाना रात 9 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3930718+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोजाना रात 9 बजे", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 4, - "Length": 16 - } - ] - }, - { - "Input": "मैं रोजाना सुबह 9 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4065719+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "रोजाना सुबह 9 बजे", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 4, - "Length": 17 - } - ] - }, - { - "Input": "मैं प्रतिदिन सुबह को 9 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4170727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "प्रतिदिन सुबह को 9 बजे", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 4, - "Length": 22 - } - ] - }, - { - "Input": "मैं हर इतवार को सुबह 9 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4295727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर इतवार को सुबह 9 बजे", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 4, - "Length": 22 - } - ] - }, - { - "Input": "मैं हर इतवार को सुबह 9 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.438575+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर इतवार को सुबह 9 बजे", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 4, - "Length": 22 - } - ] - }, - { - "Input": "मैं हर इतवार सुबह 9 बजे जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4505726+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर इतवार सुबह 9 बजे", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 4, - "Length": 19 - } - ] - }, - { - "Input": "मैं हर सोमवार को जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4570731+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर सोमवार", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 4, - "Length": 9 - } - ] - }, - { - "Input": "मैं हर इतवार को जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4635727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर इतवार", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "मैं हर इतवार जाऊँगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4710739+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर इतवार", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "मैं हर संडे को जाउंगा", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4710739+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "हर संडे", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 4, - "Length": 7 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Italian/DatePeriodExtractor.json b/Specs/DateTime/Italian/DatePeriodExtractor.json index 5a1503d43d..d846c8d07e 100644 --- a/Specs/DateTime/Italian/DatePeriodExtractor.json +++ b/Specs/DateTime/Italian/DatePeriodExtractor.json @@ -2869,5 +2869,29 @@ "Length": 34 } ] + }, + { + "Input": "Fammi vedere i record dell'agosto 99.", + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "agosto 99", + "Type": "daterange", + "Start": 27, + "Length": 9 + } + ] + }, + { + "Input": "Fammi vedere i record dell'agosto '99.", + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "agosto '99", + "Type": "daterange", + "Start": 27, + "Length": 10 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Italian/DatePeriodParser.json b/Specs/DateTime/Italian/DatePeriodParser.json index b4343c8c2f..925185e1e2 100644 --- a/Specs/DateTime/Italian/DatePeriodParser.json +++ b/Specs/DateTime/Italian/DatePeriodParser.json @@ -3443,5 +3443,51 @@ "Length": 11 } ] + }, + { + "Input": "Fammi vedere i record dell'agosto 99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "agosto 99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 27, + "Length": 9 + } + ] + }, + { + "Input": "Fammi vedere i record dell'agosto '99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "agosto '99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 27, + "Length": 10 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Italian/DateTimeModel.json b/Specs/DateTime/Italian/DateTimeModel.json index ce398f9429..4f8335f0db 100644 --- a/Specs/DateTime/Italian/DateTimeModel.json +++ b/Specs/DateTime/Italian/DateTimeModel.json @@ -1251,194 +1251,26 @@ ] }, { - "Input": "Andrò via settimanalmente", + "Input": "Tornerò alle 00:00", "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, "NotSupportedByDesign": "javascript,java", "Results": [ { - "Text": "settimanalmente", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 10, - "End": 24 - } - ] - }, - { - "Input": "Andrò via ogni giorno", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni giorno", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 10, - "End": 20 - } - ] - }, - { - "Input": "Andrò via annualmente", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "annualmente", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 10, - "End": 20 - } - ] - }, - { - "Input": "Andrò via ogni due giorni", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni due giorni", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 10, - "End": 24 - } - ] - }, - { - "Input": "Ma ne vado ogni tre settimane", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni tre settimane", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 11, - "End": 28 - } - ] - }, - { - "Input": "Andrò via alle 3pm ogni giorno", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "3pm ogni giorno", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 15, - "End": 29 - } - ] - }, - { - "Input": "Andrò via ogni lunedì", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni lunedì", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 10, - "End": 20 - } - ] - }, - { - "Input": "Andrò via ogni lunedì alle 4pm", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni lunedì alle 4pm", - "TypeName": "datetimeV2.set", + "Text": "00:00", + "TypeName": "datetimeV2.time", "Resolution": { "values": [ { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" + "timex": "T00:00", + "type": "time", + "value": "00:00:00" } ] }, - "Start": 10, - "End": 29 + "Start": 13, + "End": 17 } ] }, diff --git a/Specs/DateTime/Italian/MergedParser.json b/Specs/DateTime/Italian/MergedParser.json index caac5773b7..1ded5cf8c4 100644 --- a/Specs/DateTime/Italian/MergedParser.json +++ b/Specs/DateTime/Italian/MergedParser.json @@ -712,21 +712,6 @@ }, "Start": 31, "Length": 4 - }, - { - "Text": "ogni settimana", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 36, - "Length": 14 } ] }, @@ -751,21 +736,6 @@ }, "Start": 13, "Length": 14 - }, - { - "Text": "ogni mese", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 31, - "Length": 9 } ] }, diff --git a/Specs/DateTime/Italian/SetExtractor.json b/Specs/DateTime/Italian/SetExtractor.json deleted file mode 100644 index 779477c505..0000000000 --- a/Specs/DateTime/Italian/SetExtractor.json +++ /dev/null @@ -1,302 +0,0 @@ -[ - { - "Input": "Andrò via settimanalmente", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "settimanalmente", - "Type": "set", - "Start": 10, - "Length": 15 - } - ] - }, - { - "Input": "Andrò via quotidianamente", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "quotidianamente", - "Type": "set", - "Start": 10, - "Length": 15 - } - ] - }, - { - "Input": "Andrò via ogni giorno", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni giorno", - "Type": "set", - "Start": 10, - "Length": 11 - } - ] - }, - { - "Input": "Andrò via ogni mese", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni mese", - "Type": "set", - "Start": 10, - "Length": 9 - } - ] - }, - { - "Input": "Andrò via annualmente", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "annualmente", - "Type": "set", - "Start": 10, - "Length": 11 - } - ] - }, - { - "Input": "Andrò via una volta all'anno", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "una volta all'anno", - "Type": "set", - "Start": 10, - "Length": 18 - } - ] - }, - { - "Input": "Andrò via ogni due giorni", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni due giorni", - "Type": "set", - "Start": 10, - "Length": 15 - } - ] - }, - { - "Input": "Andrò via ogni tre settimane", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni tre settimane", - "Type": "set", - "Start": 10, - "Length": 18 - } - ] - }, - { - "Input": "Andrò via alle 3pm ogni giorno", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "3pm ogni giorno", - "Type": "set", - "Start": 15, - "Length": 15 - } - ] - }, - { - "Input": "Andrò via ogni 4/15", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni 4/15", - "Type": "set", - "Start": 10, - "Length": 9 - } - ] - }, - { - "Input": "Andrò via ogni lunedì", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni lunedì", - "Type": "set", - "Start": 10, - "Length": 11 - } - ] - }, - { - "Input": "Andrò via ogni lunedì alle 4pm", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni lunedì alle 4pm", - "Type": "set", - "Start": 10, - "Length": 20 - } - ] - }, - { - "Input": "Andrò via ogni mattina", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni mattina", - "Type": "set", - "Start": 10, - "Length": 12 - } - ] - }, - { - "Input": "Andrò via ogni mattina alle 9am", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni mattina alle 9am", - "Type": "set", - "Start": 10, - "Length": 21 - } - ] - }, - { - "Input": "Andrò via ogni pomeriggio alle 4pm", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni pomeriggio alle 4pm", - "Type": "set", - "Start": 10, - "Length": 24 - } - ] - }, - { - "Input": "Andrò via ogni notte alle 9pm", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni notte alle 9pm", - "Type": "set", - "Start": 10, - "Length": 19 - } - ] - }, - { - "Input": "Andrò via ogni notte alle 9", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni notte alle 9", - "Type": "set", - "Start": 10, - "Length": 17 - } - ] - }, - { - "Input": "Andrò via tutte le mattine alle 9am", - "NotSupportedByDesign": "python,javascript,java", - "Results": [ - { - "Text": "tutte le mattine alle 9am", - "Type": "set", - "Start": 10, - "Length": 25 - } - ] - }, - { - "Input": "Andrò via ogni mattina alle 9", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni mattina alle 9", - "Type": "set", - "Start": 10, - "Length": 19 - } - ] - }, - { - "Input": "Andrò via tutte le mattine", - "NotSupportedByDesign": "python,javascript,java", - "Results": [ - { - "Text": "tutte le mattine", - "Type": "set", - "Start": 10, - "Length": 16 - } - ] - }, - { - "Input": "Andrò via tutti i giorni", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "tutti i giorni", - "Type": "set", - "Start": 10, - "Length": 14 - } - ] - }, - { - "Input": "Andrò via alle 9am ogni domenica", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "9am ogni domenica", - "Type": "set", - "Start": 15, - "Length": 17 - } - ] - }, - { - "Input": "Andrò via alle 9am di ogni lunedì", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "9am di ogni lunedì", - "Type": "set", - "Start": 15, - "Length": 18 - } - ] - }, - { - "Input": "Andrò via alle 9am tutti i lunedì", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "9am tutti i lunedì", - "Type": "set", - "Start": 15, - "Length": 18 - } - ] - }, - { - "Input": "Andrò via i lunedì", - "NotSupportedByDesign": "python,javascript,java", - "Results": [ - { - "Text": "i lunedì", - "Type": "set", - "Start": 10, - "Length": 8 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Italian/SetParser.json b/Specs/DateTime/Italian/SetParser.json deleted file mode 100644 index cff30c3c75..0000000000 --- a/Specs/DateTime/Italian/SetParser.json +++ /dev/null @@ -1,650 +0,0 @@ -[ - { - "Input": "Andrò via settimanalmente", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2744475+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "settimanalmente", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 10, - "Length": 15 - } - ] - }, - { - "Input": "Andrò via ogni due settimane", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2754476+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni due settimane", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 10, - "Length": 18 - } - ] - }, - { - "Input": "Andrò via quotidianamente", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2779449+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "quotidianamente", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 10, - "Length": 15 - } - ] - }, - { - "Input": "Andrò via ogni giorno", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2794445+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni giorno", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 10, - "Length": 11 - } - ] - }, - { - "Input": "Andrò via ogni mese", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2829445+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni mese", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 10, - "Length": 9 - } - ] - }, - { - "Input": "Andrò via annualmente", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2844439+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "annualmente", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 10, - "Length": 11 - } - ] - }, - { - "Input": "Andrò via una volta all'anno", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2854444+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "una volta all'anno", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 10, - "Length": 18 - } - ] - }, - { - "Input": "Andrò via ogni anno", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2854444+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni anno", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 10, - "Length": 9 - } - ] - }, - { - "Input": "Andrò via ogni due giorni", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2909444+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni due giorni", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 10, - "Length": 15 - } - ] - }, - { - "Input": "Andrò via ogni tre settimane", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2959472+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni tre settimane", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 10, - "Length": 18 - } - ] - }, - { - "Input": "Andrò via alle 3pm ogni giorno", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.2989494+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "3pm ogni giorno", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 15, - "Length": 15 - } - ] - }, - { - "Input": "Andrò via ogni 4/15", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3109498+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni 4/15", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 10, - "Length": 9 - } - ] - }, - { - "Input": "Andrò via ogni lunedì", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3259514+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni lunedì", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 10, - "Length": 11 - } - ] - }, - { - "Input": "Andrò via ogni lunedì alle 4pm", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3379507+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni lunedì alle 4pm", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 10, - "Length": 20 - } - ] - }, - { - "Input": "Andrò via ogni mattina", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3429518+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni mattina", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 10, - "Length": 12 - } - ] - }, - { - "Input": "Andrò via ogni mattina alle 9am", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3609535+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni mattina alle 9am", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 10, - "Length": 21 - } - ] - }, - { - "Input": "Andrò via ogni pomeriggio alle 4pm", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3730732+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni pomeriggio alle 4pm", - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - }, - "Start": 10, - "Length": 24 - } - ] - }, - { - "Input": "Andrò via ogni notte alle 9pm", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3840706+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni notte alle 9pm", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 10, - "Length": 19 - } - ] - }, - { - "Input": "Andrò via ogni notte alle 9", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.3930718+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni notte alle 9", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 10, - "Length": 17 - } - ] - }, - { - "Input": "Andrò via tutte le mattine alle 9am", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4065719+08:00" - }, - "NotSupportedByDesign": "python,javascript,java", - "Results": [ - { - "Text": "tutte le mattine alle 9am", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 10, - "Length": 25 - } - ] - }, - { - "Input": "Andrò via ogni mattina alle 9", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4170727+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ogni mattina alle 9", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 10, - "Length": 19 - } - ] - }, - { - "Input": "Andrò via tutte le mattine", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4170727+08:00" - }, - "NotSupportedByDesign": "python,javascript,java", - "Results": [ - { - "Text": "tutte le mattine", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 10, - "Length": 16 - } - ] - }, - { - "Input": "Andrò via tutti i giorni", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4170727+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "tutti i giorni", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 10, - "Length": 14 - } - ] - }, - { - "Input": "Andrò via alle 9am ogni domenica", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4295727+08:00" - }, - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "9am ogni domenica", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 15, - "Length": 17 - } - ] - }, - { - "Input": "Andrò via alle 9am tutte le domeniche", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4505726+08:00" - }, - "NotSupportedByDesign": "python,javascript,java", - "Results": [ - { - "Text": "9am tutte le domeniche", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 15, - "Length": 22 - } - ] - }, - { - "Input": "Andrò via i lunedì", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4570731+08:00" - }, - "NotSupportedByDesign": "python,javascript,java", - "Results": [ - { - "Text": "i lunedì", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 10, - "Length": 8 - } - ] - }, - { - "Input": "Andrò via le domeniche", - "Context": { - "ReferenceDateTime": "2017-09-27T17:25:54.4635727+08:00" - }, - "NotSupportedByDesign": "python,javascript,java", - "Results": [ - { - "Text": "le domeniche", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 10, - "Length": 12 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Italian/TimeExtractor.json b/Specs/DateTime/Italian/TimeExtractor.json index 95d8075b88..8c4fd4fbde 100644 --- a/Specs/DateTime/Italian/TimeExtractor.json +++ b/Specs/DateTime/Italian/TimeExtractor.json @@ -263,6 +263,54 @@ } ] }, + { + "Input": "Mancano 5 minuti alle 4", + "NotSupportedByDesign": "java,javascript", + "Results": [ + { + "Text": "5 minuti alle 4", + "Type": "time", + "Start": 8, + "Length": 15 + } + ] + }, + { + "Input": "Mancano 10 minuti alle quattro", + "NotSupportedByDesign": "java,javascript", + "Results": [ + { + "Text": "10 minuti alle quattro", + "Type": "time", + "Start": 8, + "Length": 22 + } + ] + }, + { + "Input": "Mancano cinque minuti alle 14", + "NotSupportedByDesign": "java,javascript", + "Results": [ + { + "Text": "cinque minuti alle 14", + "Type": "time", + "Start": 8, + "Length": 21 + } + ] + }, + { + "Input": "Mancano dieci minuti alle otto", + "NotSupportedByDesign": "java,javascript", + "Results": [ + { + "Text": "dieci minuti alle otto", + "Type": "time", + "Start": 8, + "Length": 22 + } + ] + }, { "Input": "Sono le sette e mezza", "NotSupportedByDesign": "javascript", diff --git a/Specs/DateTime/Italian/TimeParser.json b/Specs/DateTime/Italian/TimeParser.json index ad67f51a90..ec7177dfef 100644 --- a/Specs/DateTime/Italian/TimeParser.json +++ b/Specs/DateTime/Italian/TimeParser.json @@ -566,6 +566,90 @@ } ] }, + { + "Input": "Mancano 5 minuti alle 4", + "NotSupportedByDesign": "java,javascript", + "Results": [ + { + "Text": "5 minuti alle 4", + "Type": "time", + "Value": { + "Timex": "T03:55", + "FutureResolution": { + "time": "03:55:00" + }, + "PastResolution": { + "time": "03:55:00" + } + }, + "Start": 8, + "Length": 15 + } + ] + }, + { + "Input": "Mancano 10 minuti alle quattro", + "NotSupportedByDesign": "java,javascript", + "Results": [ + { + "Text": "10 minuti alle quattro", + "Type": "time", + "Value": { + "Timex": "T03:50", + "FutureResolution": { + "time": "03:50:00" + }, + "PastResolution": { + "time": "03:50:00" + } + }, + "Start": 8, + "Length": 22 + } + ] + }, + { + "Input": "Mancano cinque minuti alle 14", + "NotSupportedByDesign": "java,javascript", + "Results": [ + { + "Text": "cinque minuti alle 14", + "Type": "time", + "Value": { + "Timex": "T13:55", + "FutureResolution": { + "time": "13:55:00" + }, + "PastResolution": { + "time": "13:55:00" + } + }, + "Start": 8, + "Length": 21 + } + ] + }, + { + "Input": "Mancano dieci minuti alle otto", + "NotSupportedByDesign": "java,javascript", + "Results": [ + { + "Text": "dieci minuti alle otto", + "Type": "time", + "Value": { + "Timex": "T07:50", + "FutureResolution": { + "time": "07:50:00" + }, + "PastResolution": { + "time": "07:50:00" + } + }, + "Start": 8, + "Length": 22 + } + ] + }, { "Input": "Sono le sette e mezza", "NotSupportedByDesign": "javascript", diff --git a/Specs/DateTime/Japanese/DateExtractor.json b/Specs/DateTime/Japanese/DateExtractor.json index eac4232bd1..47a53cb3fe 100644 --- a/Specs/DateTime/Japanese/DateExtractor.json +++ b/Specs/DateTime/Japanese/DateExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "1月1日 に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1月1日", @@ -13,7 +13,7 @@ }, { "Input": "10月2日 に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月2日", @@ -25,7 +25,7 @@ }, { "Input": "2016年1月12日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年1月12日", @@ -37,7 +37,7 @@ }, { "Input": "2016年1月12日月曜日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年1月12日月曜日", @@ -49,7 +49,7 @@ }, { "Input": "2016年2月22日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年2月22日", @@ -61,7 +61,7 @@ }, { "Input": "2016年4月21日戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年4月21日", @@ -73,7 +73,7 @@ }, { "Input": "2015年9月18日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年9月18日", @@ -85,7 +85,7 @@ }, { "Input": "4月22日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4月22日", @@ -97,7 +97,7 @@ }, { "Input": "2015年8月12日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年8月12日", @@ -109,7 +109,7 @@ }, { "Input": "2016年11月12日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年11月12日", @@ -121,7 +121,7 @@ }, { "Input": "1月1日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1月1日", @@ -133,7 +133,7 @@ }, { "Input": "11月28日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11月28日", @@ -145,7 +145,7 @@ }, { "Input": "7月の第1金曜日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7月の第1金曜日", @@ -157,7 +157,7 @@ }, { "Input": "今から2週間後に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今から2週間後", @@ -169,7 +169,7 @@ }, { "Input": "火曜日に戻ります。いい知らせです。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "火曜日", @@ -181,7 +181,7 @@ }, { "Input": "今週の金曜日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の金曜日", @@ -193,7 +193,7 @@ }, { "Input": "来週の日曜日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週の日曜日", @@ -205,7 +205,7 @@ }, { "Input": "私は最後の日に戻ります", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "最後の日", @@ -217,7 +217,7 @@ }, { "Input": "私はその日に戻ります", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その日", @@ -229,7 +229,7 @@ }, { "Input": "2016年6月15日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年6月15日", @@ -241,7 +241,7 @@ }, { "Input": "5月11日に野球", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5月11日", @@ -253,7 +253,7 @@ }, { "Input": "5月4日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5月4日", @@ -265,7 +265,7 @@ }, { "Input": "3月4日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3月4日", @@ -277,7 +277,7 @@ }, { "Input": "5月21日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5月21日", @@ -289,7 +289,7 @@ }, { "Input": "8月2日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8月2日", @@ -301,7 +301,7 @@ }, { "Input": "6月22日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "6月22日", @@ -349,7 +349,7 @@ }, { "Input": "27日に戻りました", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "27日", @@ -361,7 +361,7 @@ }, { "Input": "27日に戻りました。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "27日", @@ -373,7 +373,7 @@ }, { "Input": "27日に戻りました!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "27日", @@ -385,7 +385,7 @@ }, { "Input": "21日に戻りました", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21日", @@ -397,7 +397,7 @@ }, { "Input": "22日に戻りました", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22日", @@ -409,7 +409,7 @@ }, { "Input": "2日に戻りました", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2日", @@ -421,7 +421,7 @@ }, { "Input": "2日に戻りました!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2日", @@ -433,7 +433,7 @@ }, { "Input": "22日に戻りました?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22日", @@ -445,12 +445,12 @@ }, { "Input": "一等賞", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "第17回ドアホーンテッドエクスペリエンスのチケットを入手する", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -458,7 +458,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2日の土曜日", @@ -473,7 +473,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "27日水曜日", @@ -488,7 +488,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21日木曜日", @@ -503,7 +503,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22日金曜日", @@ -518,7 +518,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "23日土曜日", @@ -533,7 +533,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日金曜日", @@ -548,7 +548,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7日木曜日", @@ -560,7 +560,7 @@ }, { "Input": "来月の20日に戻ります", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来月の20日", @@ -572,7 +572,7 @@ }, { "Input": "今月の31日に戻ります", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今月の31日", @@ -584,7 +584,7 @@ }, { "Input": "コルタナが今週の金曜日か来週の火曜日にスカイプ通話を手配してくれます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の金曜日", @@ -602,7 +602,7 @@ }, { "Input": "コルタナが今週の金曜日か今週の土曜日にスカイプ通話を手配してくれます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の金曜日", @@ -620,7 +620,7 @@ }, { "Input": "2016年11月16日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年11月16日", @@ -680,7 +680,7 @@ }, { "Input": "私は1391年12月5日にここを離れました", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1391年12月5日", @@ -692,7 +692,7 @@ }, { "Input": "2018年1月22日月曜日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2018年1月22日月曜日", @@ -704,7 +704,7 @@ }, { "Input": "2018年1月21日日曜日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2018年1月21日日曜日", @@ -716,7 +716,7 @@ }, { "Input": "1978年9月21日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1978年9月21日", @@ -728,7 +728,7 @@ }, { "Input": "1901年9月10日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1901年9月10日", @@ -740,7 +740,7 @@ }, { "Input": "2000年9月10日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2000年9月10日", @@ -752,7 +752,7 @@ }, { "Input": "2015年5月13日はお暇ですか?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年5月13日", @@ -764,7 +764,7 @@ }, { "Input": "2015年5月13日はご都合いかがでしょうか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年5月13日", @@ -776,7 +776,7 @@ }, { "Input": "今から2週先の日曜日のご都合はいかがでしょうか?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今から2週先の日曜日", @@ -800,7 +800,7 @@ }, { "Input": "今日から2日後のご都合はいかがでしょうか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から2日後", @@ -812,7 +812,7 @@ }, { "Input": "明日から3週間のご都合はいかがでしょうか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日から3週間", @@ -824,7 +824,7 @@ }, { "Input": "あなたは昨日の2日前どこにいましたか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昨日の2日前", @@ -839,7 +839,7 @@ "Context": { "ReferenceDateTime": "2018-06-14T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の金曜日6月15日", @@ -869,7 +869,7 @@ "Context": { "ReferenceDateTime": "2018-06-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の金曜日6月22日", @@ -884,7 +884,7 @@ "Context": { "ReferenceDateTime": "2018-06-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の金曜日6月23日", @@ -914,7 +914,7 @@ "Context": { "ReferenceDateTime": "2018-07-06T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7月6日金曜日", @@ -929,7 +929,7 @@ "Context": { "ReferenceDateTime": "2018-07-06T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2018年7月6日金曜日", @@ -953,7 +953,7 @@ }, { "Input": "コルタナ、10月1日に何か設定してくれませんか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月1日", @@ -966,12 +966,12 @@ { "Input": "その6.25%転換...の額面金額", "Comment": "1/4 shouldn't recognized as date here", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "15 日に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "15 日", @@ -983,7 +983,7 @@ }, { "Input": "1/1 に帰ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1/1", @@ -995,7 +995,7 @@ }, { "Input": "誕生日は10/03です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "10/03", @@ -1007,7 +1007,7 @@ }, { "Input": "それは 2016 年 1 月 12 日に発売されました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2016 年 1 月 12 日", @@ -1019,7 +1019,7 @@ }, { "Input": "それは2016年1月12日に発売されました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2016年1月12日", @@ -1031,7 +1031,7 @@ }, { "Input": "それが発売されたのは2016年1月12日 月曜日です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2016年1月12日 月曜日", @@ -1043,7 +1043,7 @@ }, { "Input": "02/22/2016", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "02/22/2016", @@ -1055,7 +1055,7 @@ }, { "Input": "21/04/2016に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21/04/2016", @@ -1067,7 +1067,7 @@ }, { "Input": "21/04/16に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21/04/16", @@ -1079,7 +1079,7 @@ }, { "Input": "9-18-15に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "9-18-15", @@ -1091,7 +1091,7 @@ }, { "Input": "4.22 に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4.22", @@ -1103,7 +1103,7 @@ }, { "Input": "4-22 に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4-22", @@ -1115,7 +1115,7 @@ }, { "Input": "4.22に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4.22", @@ -1127,7 +1127,7 @@ }, { "Input": "22/04 に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "22/04", @@ -1139,7 +1139,7 @@ }, { "Input": "2015/08/12 に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2015/08/12", @@ -1151,7 +1151,7 @@ }, { "Input": "11/12,2016に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "11/12,2016", @@ -1163,7 +1163,7 @@ }, { "Input": "一月二十二日 水曜日に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一月二十二日 水曜日", @@ -1175,7 +1175,7 @@ }, { "Input": "5月の第2日曜日は母の日です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5月の第2日曜日", @@ -1187,7 +1187,7 @@ }, { "Input": "今月の第一金曜日は定休日です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今月の第一金曜日", @@ -1199,7 +1199,7 @@ }, { "Input": "来週金曜日に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, python,java", "Results": [ { "Text": "来週金曜日", @@ -1223,7 +1223,7 @@ }, { "Input": "火曜日に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "火曜日", @@ -1235,7 +1235,7 @@ }, { "Input": "火曜に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "火曜", @@ -1247,7 +1247,7 @@ }, { "Input": "帰るのは今週の木曜日です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今週の木曜日", @@ -1259,7 +1259,7 @@ }, { "Input": "先週の月曜日に帰ってきました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "先週の月曜日", @@ -1271,7 +1271,7 @@ }, { "Input": "金曜日に帰ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "金曜日", @@ -1283,7 +1283,7 @@ }, { "Input": "今日帰ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今日", @@ -1295,7 +1295,7 @@ }, { "Input": "明日帰ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明日", @@ -1307,7 +1307,7 @@ }, { "Input": "昨日帰ってきました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "昨日", @@ -1319,7 +1319,7 @@ }, { "Input": "きのう帰ってきました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "きのう", @@ -1331,7 +1331,7 @@ }, { "Input": "明日帰る予定です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明日", @@ -1343,7 +1343,7 @@ }, { "Input": "あした帰る予定です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "あした", @@ -1355,7 +1355,7 @@ }, { "Input": "あす帰る予定です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "あす", @@ -1367,7 +1367,7 @@ }, { "Input": "明後日帰る予定です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明後日", @@ -1379,7 +1379,7 @@ }, { "Input": "あさって帰る予定です。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "あさって", @@ -1391,7 +1391,7 @@ }, { "Input": "一昨日帰ってきました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一昨日", @@ -1403,7 +1403,7 @@ }, { "Input": "おととい帰ってきました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "おととい", @@ -1415,7 +1415,7 @@ }, { "Input": "2か月前に帰ってきました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript,python,java", "Results": [ { "Text": "2か月前", @@ -1427,7 +1427,7 @@ }, { "Input": "二か月前に帰ってきました。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript,python,java", "Results": [ { "Text": "二か月前", @@ -1451,12 +1451,12 @@ }, { "Input": "27階に行きます。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "シンガポールと中国の外交関係25周年記念行事", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { @@ -1464,7 +1464,7 @@ "Context": { "ReferenceDateTime": "2017-09-01T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "27日水曜日", @@ -1476,7 +1476,7 @@ }, { "Input": "来月20日に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "来月20日", @@ -1488,7 +1488,7 @@ }, { "Input": "今月31日に戻ります。", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今月31日", @@ -1500,7 +1500,7 @@ }, { "Input": "13.5.2015 は空いていますか?", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "13.5.2015", @@ -1512,7 +1512,7 @@ }, { "Input": "2015.5.13 は空いていますか?", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2015.5.13", @@ -1524,8 +1524,8 @@ }, { "Input": "今日から2日間空いてますか?", - "NotSupported": "javascript, python", - "NotSupportedByDesign": "javascript, python, java", + "NotSupported": "javascript", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今日から2日間", @@ -1537,8 +1537,8 @@ }, { "Input": "明日から3週間空いてますか?", - "NotSupported": "javascript, python", - "NotSupportedByDesign": "javascript, python, java", + "NotSupported": "javascript", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明日から3週間", @@ -1554,7 +1554,7 @@ "ReferenceDateTime": "2018-06-20T00:00:00" }, "NotSupported": "python,java,javascript", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3 週間後", @@ -1569,7 +1569,7 @@ "Context": { "ReferenceDateTime": "2018-07-06T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "7.6 金曜日", @@ -1584,7 +1584,7 @@ "Context": { "ReferenceDateTime": "2018-07-06T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "7/6 金曜日", @@ -1599,7 +1599,7 @@ "Context": { "ReferenceDateTime": "2018-07-06T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "7-6 金曜日", @@ -1614,7 +1614,7 @@ "Context": { "ReferenceDateTime": "2018-07-06T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2018-7-6 金曜日", @@ -1626,7 +1626,7 @@ }, { "Input": "月曜日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "月曜日", @@ -1638,7 +1638,7 @@ }, { "Input": "火曜日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "火曜日", @@ -1650,7 +1650,7 @@ }, { "Input": "水曜日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "水曜日", @@ -1662,7 +1662,7 @@ }, { "Input": "木曜日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "木曜日", @@ -1674,7 +1674,7 @@ }, { "Input": "金曜日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "金曜日", @@ -1686,7 +1686,7 @@ }, { "Input": "土曜日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "土曜日", @@ -1698,7 +1698,7 @@ }, { "Input": "日曜日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "日曜日", @@ -1710,7 +1710,7 @@ }, { "Input": "月曜", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "月曜", @@ -1722,7 +1722,7 @@ }, { "Input": "火曜", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "火曜", @@ -1734,7 +1734,7 @@ }, { "Input": "水曜", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "水曜", @@ -1746,7 +1746,7 @@ }, { "Input": "木曜", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "木曜", @@ -1758,7 +1758,7 @@ }, { "Input": "金曜", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "金曜", @@ -1770,7 +1770,7 @@ }, { "Input": "土曜", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "土曜", @@ -1782,7 +1782,7 @@ }, { "Input": "日曜", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "日曜", @@ -1938,7 +1938,7 @@ }, { "Input": "今日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今日", @@ -1950,7 +1950,7 @@ }, { "Input": "きょう", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "きょう", @@ -1962,7 +1962,7 @@ }, { "Input": "明日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明日", @@ -1974,7 +1974,7 @@ }, { "Input": "あす", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "あす", @@ -1986,7 +1986,7 @@ }, { "Input": "あした", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "あした", @@ -1998,7 +1998,7 @@ }, { "Input": "明後日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明後日", @@ -2010,7 +2010,7 @@ }, { "Input": "あさって", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "あさって", @@ -2022,7 +2022,7 @@ }, { "Input": "明々後日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明々後日", @@ -2034,7 +2034,7 @@ }, { "Input": "しあさって", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "しあさって", @@ -2046,7 +2046,7 @@ }, { "Input": "昨日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "昨日", @@ -2058,7 +2058,7 @@ }, { "Input": "きのう", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "きのう", @@ -2070,7 +2070,7 @@ }, { "Input": "さくじつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "さくじつ", @@ -2082,7 +2082,7 @@ }, { "Input": "一昨日", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一昨日", @@ -2094,7 +2094,7 @@ }, { "Input": "おととい", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "おととい", @@ -2106,7 +2106,7 @@ }, { "Input": "おとつい", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "おとつい", @@ -2118,7 +2118,7 @@ }, { "Input": "いっさくじつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "いっさくじつ", @@ -2142,7 +2142,7 @@ }, { "Input": "すみません、6月15日出発の航空便を予約しました。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "6月15日", @@ -2154,7 +2154,7 @@ }, { "Input": "旧暦の正月初一", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "旧暦の正月初一", @@ -2166,7 +2166,7 @@ }, { "Input": "先週の水曜日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "先週の水曜日", @@ -2202,7 +2202,7 @@ }, { "Input": "明後日、空いていますか?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "明後日", @@ -2214,7 +2214,7 @@ }, { "Input": "最後の水曜日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "最後の水曜日", @@ -2226,7 +2226,7 @@ }, { "Input": "一昨昨日はどうでしたか?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "一昨昨日", @@ -2274,7 +2274,7 @@ }, { "Input": "2015年5月13日、空いていますか?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2015年5月13日", @@ -2298,7 +2298,7 @@ }, { "Input": "先週の月曜日はテストがありました", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "先週の月曜日", @@ -2322,7 +2322,7 @@ }, { "Input": "最近はお元気ですか?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "最近", @@ -2334,7 +2334,7 @@ }, { "Input": "2004年8月15日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2004年8月15日", @@ -2370,7 +2370,7 @@ }, { "Input": "もうすぐ1月19日になります。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1月19日", @@ -2382,7 +2382,7 @@ }, { "Input": "去年の今月の十日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "去年の今月の十日", @@ -2418,7 +2418,7 @@ }, { "Input": "平成二十二年一月二十九日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "平成二十二年一月二十九日", @@ -2430,7 +2430,7 @@ }, { "Input": "会議は今週の月曜日になりました。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今週の月曜日", @@ -2454,7 +2454,7 @@ }, { "Input": "7月4日に北京に到着します。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "7月4日", @@ -2490,7 +2490,7 @@ }, { "Input": "明日はいいですか?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "明日", @@ -2514,7 +2514,7 @@ }, { "Input": "9月8日に着きます", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "9月8日", @@ -2526,7 +2526,7 @@ }, { "Input": "旧暦の三月一日にしました", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "旧暦の三月一日", @@ -2538,7 +2538,7 @@ }, { "Input": "弥明後日はいいですか?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "弥明後日", @@ -2550,7 +2550,7 @@ }, { "Input": "2010年1月29日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2010年1月29日", @@ -2562,7 +2562,7 @@ }, { "Input": "1月19日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1月19日", @@ -2574,7 +2574,7 @@ }, { "Input": "今月の十日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今月の十日", diff --git a/Specs/DateTime/Japanese/DateParser.json b/Specs/DateTime/Japanese/DateParser.json index 620e0aa2b1..bd1f6d7275 100644 --- a/Specs/DateTime/Japanese/DateParser.json +++ b/Specs/DateTime/Japanese/DateParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月2日", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年2月22日", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年4月21日", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4月22日", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年8月12日", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1月1日", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "先週の日曜日", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "最後の日", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7月の第1金曜日", @@ -220,7 +220,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "私の一日", @@ -244,7 +244,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "前日", @@ -364,7 +364,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "27日", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "21日", @@ -412,7 +412,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "22日", @@ -436,7 +436,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "二日", @@ -460,7 +460,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "二十二日", @@ -484,7 +484,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "30日", @@ -605,7 +605,7 @@ "ReferenceDateTime": "2017-09-27T00:00:00" }, "Comment": "Translated from 'third thursday'.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "第三火曜日", @@ -629,7 +629,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2018年1月12日", @@ -654,7 +654,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Comment": "Translated from 9-18-15(MDY)", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年9月18日", @@ -774,7 +774,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年5月13日", @@ -798,7 +798,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年5月13日", @@ -822,7 +822,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2017年3月7日", @@ -846,7 +846,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2007年3月7日", @@ -870,7 +870,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2027年3月7日", @@ -894,7 +894,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1989年5月5日", @@ -918,7 +918,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1971年5月5日", @@ -990,7 +990,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "15日", @@ -1014,7 +1014,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "10-2", @@ -1038,7 +1038,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "10/2", @@ -1086,7 +1086,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2016年1月12日", @@ -1134,7 +1134,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "02/22/2016", @@ -1159,7 +1159,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Comment": "Translated from 21/04/2016(DMY).", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2016/04/21", @@ -1184,7 +1184,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Comment": "Unnecessary. Japanese don't use DMY form.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21/04/16", @@ -1208,7 +1208,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21-04-2016", @@ -1232,7 +1232,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4.22", @@ -1256,7 +1256,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4-22", @@ -1280,7 +1280,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4/22", @@ -1304,7 +1304,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "22/04", @@ -1328,7 +1328,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2015/08/12", @@ -1352,7 +1352,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "08/12,2015", @@ -1376,7 +1376,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1月の1日", @@ -1400,7 +1400,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1月22日水曜", @@ -1424,7 +1424,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5月21日", @@ -1448,7 +1448,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5月の21日", @@ -1520,7 +1520,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "金曜日", @@ -1544,7 +1544,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今日", @@ -1568,7 +1568,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明日", @@ -1592,7 +1592,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "昨日", @@ -1640,7 +1640,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明後日", @@ -1664,7 +1664,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "明後日", @@ -1688,7 +1688,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "次の日", @@ -1712,7 +1712,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "この金曜日", @@ -1760,7 +1760,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "先週の日曜日", @@ -1784,7 +1784,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript,python,java", "Results": [ { "Text": "今週の金曜日", @@ -1832,7 +1832,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "昨日", @@ -1856,7 +1856,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "その日", @@ -1880,7 +1880,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2016年6月15日", @@ -1905,7 +1905,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Comment": "Translated from 'the first friday of july' which is 7th month.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "7月の第一金曜日", @@ -1929,7 +1929,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今月の第一金曜日", @@ -1977,7 +1977,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今日", @@ -2001,7 +2001,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "この日", @@ -2025,7 +2025,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "前日", @@ -2073,7 +2073,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript,python,java", "Results": [ { "Text": "1か月前", @@ -2097,7 +2097,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, python,java", "Results": [ { "Text": "数月前", @@ -2121,7 +2121,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript,python,java", "Results": [ { "Text": "数日前", @@ -2145,7 +2145,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "27日", @@ -2170,7 +2170,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "Comment": "There is no preposition or other indicator in the sentence to identify '27' as a date", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { @@ -2203,7 +2203,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "27日", @@ -2252,7 +2252,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21日", @@ -2300,7 +2300,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二日目", @@ -2324,7 +2324,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十二日", @@ -2541,7 +2541,7 @@ "Context": { "ReferenceDateTime": "2017-09-27T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "第1の日曜日", @@ -2566,7 +2566,7 @@ "ReferenceDateTime": "2017-09-27T00:00:00" }, "Comment": "Translated from 'third Tuesday'.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "第3の火曜日", @@ -2665,7 +2665,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2018年一月十二日", @@ -2689,7 +2689,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "15-9-18", @@ -2737,7 +2737,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript,python,java", "Results": [ { "Text": "二年前", @@ -2761,7 +2761,7 @@ "Context": { "ReferenceDateTime": "2016-11-14T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2016年11月16日", @@ -2954,7 +2954,7 @@ "Context": { "ReferenceDateTime": "2017-12-18T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1391年12月5日", @@ -2978,7 +2978,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2018年1月22日月曜日", @@ -3026,7 +3026,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1978年9月21日", @@ -3074,7 +3074,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二千年の九月十日", @@ -3098,7 +3098,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T09:58:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "来月の最初の金曜日", @@ -3122,7 +3122,7 @@ "Context": { "ReferenceDateTime": "2018-03-20T10:45:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "来月の第2月曜日", @@ -3218,7 +3218,7 @@ "Context": { "ReferenceDateTime": "2018-04-20T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今日から二日", @@ -3242,7 +3242,7 @@ "Context": { "ReferenceDateTime": "2018-04-20T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今日から4日", @@ -3266,7 +3266,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "13.5.2015", @@ -3290,7 +3290,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2015.5.13", @@ -3338,7 +3338,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3-7-07", @@ -3362,7 +3362,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3-7-27", @@ -3386,7 +3386,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "05/05/89", @@ -3410,7 +3410,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "71/05/05", @@ -3554,7 +3554,7 @@ "Context": { "ReferenceDateTime": "2018-07-05T00:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript,python,java", "Results": [ { "Text": "3週間で", @@ -3578,7 +3578,7 @@ "Context": { "ReferenceDateTime": "2018-08-21T08:00:00" }, - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript,python,java", "Results": [ { "Text": "4営業日で", @@ -3674,7 +3674,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1月19日", @@ -3698,7 +3698,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2010年1月29日", @@ -3722,7 +3722,7 @@ "Context": { "ReferenceDateTime": "2018-09-18T18:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "水曜日", @@ -3746,7 +3746,7 @@ "Context": { "ReferenceDateTime": "2018-09-18T18:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "明後日", @@ -3770,7 +3770,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "日曜", @@ -3890,7 +3890,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "一月十九日", @@ -3914,7 +3914,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "旧暦の三月一日", @@ -3938,7 +3938,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript,python,java", "Results": [ { "Text": "今週の月曜日", @@ -3986,7 +3986,7 @@ "Context": { "ReferenceDateTime": "2018-07-30T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "昨日", @@ -4034,7 +4034,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "先週の月曜日", @@ -4058,7 +4058,7 @@ "Context": { "ReferenceDateTime": "2018-09-18T18:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "月曜日", @@ -4130,7 +4130,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "平成二十二年一月二十九日", @@ -4299,7 +4299,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "十二日", @@ -4347,7 +4347,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2004年8月15日", @@ -4371,7 +4371,7 @@ "Context": { "ReferenceDateTime": "2016-03-10T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "二十九日", @@ -4491,7 +4491,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "去年の今月の十日", @@ -4515,7 +4515,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "平成二十七年五月十三日", @@ -4539,7 +4539,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "この間", @@ -4587,7 +4587,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "月曜日", @@ -4611,7 +4611,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "明日", diff --git a/Specs/DateTime/Japanese/DatePeriodExtractor.json b/Specs/DateTime/Japanese/DatePeriodExtractor.json index f31726fb71..224574a922 100644 --- a/Specs/DateTime/Japanese/DatePeriodExtractor.json +++ b/Specs/DateTime/Japanese/DatePeriodExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "1月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1月", @@ -13,7 +13,7 @@ }, { "Input": "今年の1月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の1月", @@ -25,7 +25,7 @@ }, { "Input": "2001年1月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年1月", @@ -37,7 +37,7 @@ }, { "Input": "2月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2月", @@ -49,7 +49,7 @@ }, { "Input": "今年の2月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の2月", @@ -61,7 +61,7 @@ }, { "Input": "2001年2月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年2月", @@ -73,7 +73,7 @@ }, { "Input": "3月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3月", @@ -85,7 +85,7 @@ }, { "Input": "今年の3月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の3月", @@ -97,7 +97,7 @@ }, { "Input": "2001年3月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年3月", @@ -109,7 +109,7 @@ }, { "Input": "4月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4月", @@ -121,7 +121,7 @@ }, { "Input": "今年の4月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の4月", @@ -133,7 +133,7 @@ }, { "Input": "2001年4月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年4月", @@ -145,7 +145,7 @@ }, { "Input": "5月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5月", @@ -157,7 +157,7 @@ }, { "Input": "今年の5月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の5月", @@ -169,7 +169,7 @@ }, { "Input": "2001年5月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年5月", @@ -181,7 +181,7 @@ }, { "Input": "6月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "6月", @@ -193,7 +193,7 @@ }, { "Input": "今年の6月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の6月", @@ -205,7 +205,7 @@ }, { "Input": "2001年6月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年6月", @@ -217,7 +217,7 @@ }, { "Input": "7月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7月", @@ -229,7 +229,7 @@ }, { "Input": "今年の7月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の7月", @@ -241,7 +241,7 @@ }, { "Input": "2001年7月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年7月", @@ -253,7 +253,7 @@ }, { "Input": "8月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8月", @@ -265,7 +265,7 @@ }, { "Input": "今年の8月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の8月", @@ -277,7 +277,7 @@ }, { "Input": "2001年8月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年8月", @@ -289,7 +289,7 @@ }, { "Input": "9月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9月", @@ -301,7 +301,7 @@ }, { "Input": "今年の9月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の9月", @@ -313,7 +313,7 @@ }, { "Input": "2001年9月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年9月", @@ -325,7 +325,7 @@ }, { "Input": "10月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月", @@ -337,7 +337,7 @@ }, { "Input": "今年の10月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の10月", @@ -349,7 +349,7 @@ }, { "Input": "2001年10月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年10月", @@ -361,7 +361,7 @@ }, { "Input": "11月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11月", @@ -373,7 +373,7 @@ }, { "Input": "今年の11月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の11月", @@ -385,7 +385,7 @@ }, { "Input": "2001年11月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年11月", @@ -397,7 +397,7 @@ }, { "Input": "12月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12月", @@ -409,7 +409,7 @@ }, { "Input": "今年の12月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の12月", @@ -421,7 +421,7 @@ }, { "Input": "2001年12月は不在でした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2001年12月", @@ -433,7 +433,7 @@ }, { "Input": "9月のカレンダー", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9月", @@ -445,7 +445,7 @@ }, { "Input": "今月の4日から22日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今月の4日から22日まで", @@ -457,7 +457,7 @@ }, { "Input": "来月の4日から23日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来月の4日から23日まで", @@ -469,7 +469,7 @@ }, { "Input": "9月3日から12日まで不在にします。ハハハ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9月3日から12日まで", @@ -481,7 +481,7 @@ }, { "Input": "今月の4日から23日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今月の4日から23日まで", @@ -493,7 +493,7 @@ }, { "Input": "今月の4日から22日の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今月の4日から22日の間", @@ -505,7 +505,7 @@ }, { "Input": "9月3日から12日の間、不在にします。ハハハ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9月3日から12日の間", @@ -517,7 +517,7 @@ }, { "Input": "9月4日から8日までの間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9月4日から8日までの間", @@ -529,7 +529,7 @@ }, { "Input": "11月15日から19日までの間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11月15日から19日までの間", @@ -541,7 +541,7 @@ }, { "Input": "2017年1月4日から22日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2017年1月4日から22日まで", @@ -553,7 +553,7 @@ }, { "Input": "2017年1月4日から22日の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2017年1月4日から22日の間", @@ -565,7 +565,7 @@ }, { "Input": "今週は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週", @@ -577,7 +577,7 @@ }, { "Input": "来週は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週", @@ -589,7 +589,7 @@ }, { "Input": "来年の6月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年の6月", @@ -601,7 +601,7 @@ }, { "Input": "2016年6月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年6月", @@ -613,7 +613,7 @@ }, { "Input": "今週末は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週末", @@ -625,7 +625,7 @@ }, { "Input": "今月の第三週は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今月の第三週", @@ -637,7 +637,7 @@ }, { "Input": "7月の最後の週は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7月の最後の週", @@ -649,7 +649,7 @@ }, { "Input": "金曜日から日曜日までキャンプの予定を入れる。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "金曜日から日曜日まで", @@ -661,7 +661,7 @@ }, { "Input": "向こう3日間は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "向こう3日間", @@ -673,7 +673,7 @@ }, { "Input": "向こう3か月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "向こう3か月", @@ -686,7 +686,7 @@ { "Input": "3年後に不在にします。", "Comment": "This test case was intended to correspond to the English 'I'll be out in 3 years', but '後に' (after) is used instead of 'で' (in). A test case using 'で' has been appended to the specs.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3年後に", @@ -699,7 +699,7 @@ { "Input": "3週間後に不在にします。", "Comment": "This test case was intended to correspond to the English 'I'll be out in 3 weeks', but '後に' (after) is used instead of 'で' (in). A test case using 'で' has been appended to the specs.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3週間後に", @@ -712,7 +712,7 @@ { "Input": "3か月後に不在にします。", "Comment": "This test case was intended to correspond to the English 'I'll be out in 3 months', but '後に' (after) is used instead of 'で' (in). A test case using 'で' has been appended to the specs.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3か月後に", @@ -724,7 +724,7 @@ }, { "Input": "前の3週間は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "前の3週間", @@ -736,7 +736,7 @@ }, { "Input": "この数週間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "この数週間", @@ -748,7 +748,7 @@ }, { "Input": "この数日間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "この数日間", @@ -760,7 +760,7 @@ }, { "Input": "10月2日から22日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月2日から22日まで", @@ -772,7 +772,7 @@ }, { "Input": "2016年1月12日から2016年2月22日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年1月12日から2016年2月22日まで", @@ -784,7 +784,7 @@ }, { "Input": "1月1日から1月22日水曜日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1月1日から1月22日水曜日まで", @@ -796,7 +796,7 @@ }, { "Input": "今日から明日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から明日まで", @@ -808,7 +808,7 @@ }, { "Input": "今日から10月22日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から10月22日まで", @@ -820,7 +820,7 @@ }, { "Input": "10月2日から明後日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月2日から明後日まで", @@ -832,7 +832,7 @@ }, { "Input": "今日から来週日曜日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から来週日曜日まで", @@ -844,7 +844,7 @@ }, { "Input": "今週の金曜日から来週の日曜日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の金曜日から来週の日曜日まで", @@ -856,7 +856,7 @@ }, { "Input": "2015年8月12日から10月22日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年8月12日から10月22日まで", @@ -883,7 +883,7 @@ }, { "Input": "10月2日から22日の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月2日から22日の間", @@ -895,7 +895,7 @@ }, { "Input": "11月19日から20日まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11月19日から20日まで", @@ -907,7 +907,7 @@ }, { "Input": "11月19日から20日の間は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11月19日から20日の間", @@ -919,7 +919,7 @@ }, { "Input": "2016年の第3四半期は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年の第3四半期", @@ -931,7 +931,7 @@ }, { "Input": "今年の第3四半期は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の第3四半期", @@ -943,7 +943,7 @@ }, { "Input": "第1四半期中に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "第1四半期", @@ -955,7 +955,7 @@ }, { "Input": "第3四半期は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "第3四半期", @@ -967,7 +967,7 @@ }, { "Input": "2015年3月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年3月", @@ -979,7 +979,7 @@ }, { "Input": "2027年の第3週は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2027年の第3週", @@ -991,7 +991,7 @@ }, { "Input": "来年の第3週は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年の第3週", @@ -1003,7 +1003,7 @@ }, { "Input": "今年の夏出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の夏", @@ -1015,7 +1015,7 @@ }, { "Input": "来年の春出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年の春", @@ -1027,7 +1027,7 @@ }, { "Input": "その夏出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その夏", @@ -1039,7 +1039,7 @@ }, { "Input": "夏出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夏", @@ -1051,7 +1051,7 @@ }, { "Input": "2016年の夏出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年の夏", @@ -1063,7 +1063,7 @@ }, { "Input": "来月の休日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来月", @@ -1075,7 +1075,7 @@ }, { "Input": "11月30日の週", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11月30日の週", @@ -1087,7 +1087,7 @@ }, { "Input": "9月15日の週", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9月15日の週", @@ -1099,7 +1099,7 @@ }, { "Input": "9月15日の月", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "9月15日の月", @@ -1111,7 +1111,7 @@ }, { "Input": "その週末に出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その週末", @@ -1123,7 +1123,7 @@ }, { "Input": "その週の残りの日は休暇を取ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その週の残りの日", @@ -1135,7 +1135,7 @@ }, { "Input": "私の週の残りの日は休暇を取ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "私の週の残りの日", @@ -1147,7 +1147,7 @@ }, { "Input": "週の残りの日は休暇を取ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "週の残りの日", @@ -1159,7 +1159,7 @@ }, { "Input": "今週の残りの日は休暇を取ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の残りの日", @@ -1171,7 +1171,7 @@ }, { "Input": "その月の残りの日は休暇を取ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その月の残りの日", @@ -1183,7 +1183,7 @@ }, { "Input": "その年いっぱいは休暇を取ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その年いっぱい", @@ -1195,7 +1195,7 @@ }, { "Input": "今月の終わりごろ会うための時間をつくってください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今月の終わりごろ", @@ -1207,7 +1207,7 @@ }, { "Input": "今週の終わりごろ会うための時間をつくってください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の終わりごろ", @@ -1219,7 +1219,7 @@ }, { "Input": "来週の終わりごろ会うための時間をつくってください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週の終わりごろ", @@ -1231,7 +1231,7 @@ }, { "Input": "来年の終わりごろ会うための時間をつくってください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年の終わりごろ", @@ -1243,7 +1243,7 @@ }, { "Input": "私たちは先週の終わりごろ会いました。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "先週の終わりごろ", @@ -1255,7 +1255,7 @@ }, { "Input": "今月初めに会うための時間をとってください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今月初め", @@ -1267,7 +1267,7 @@ }, { "Input": "今週初めに会うための時間をとってください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週初め", @@ -1279,7 +1279,7 @@ }, { "Input": "来週初めに会うための時間をとってください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週初め", @@ -1291,7 +1291,7 @@ }, { "Input": "来年初めに会うための時間をとってください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年初め", @@ -1303,7 +1303,7 @@ }, { "Input": "コルタナ、アントニオと25分の会議を来週の水曜日から金曜日の間で調整して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週の水曜日から金曜日の間", @@ -1315,7 +1315,7 @@ }, { "Input": "コルタナ、アントニオと25分の会議を来週の水曜日から金曜日で調整して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,python, java", "Results": [ { "Text": "来週の水曜日から金曜日", @@ -1327,7 +1327,7 @@ }, { "Input": "コルタナ、アントニオと25分の会議を先週の水曜日から金曜日の間で調整して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "先週の水曜日から金曜日の間", @@ -1351,7 +1351,7 @@ }, { "Input": "247年は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "247年", @@ -1363,7 +1363,7 @@ }, { "Input": "1970年代に", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1970年代", @@ -1375,7 +1375,7 @@ }, { "Input": "2000年代に彼は生まれた。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2000年代", @@ -1387,7 +1387,7 @@ }, { "Input": "70年代に", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "70年代", @@ -1399,7 +1399,7 @@ }, { "Input": "40年代に", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "40年代", @@ -1411,7 +1411,7 @@ }, { "Input": "2010年代に", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2010年代", @@ -1423,7 +1423,7 @@ }, { "Input": "2000年代に", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2000年代", @@ -1435,7 +1435,7 @@ }, { "Input": "2018年2月2日から7日は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2018年2月2日から7日", @@ -1447,7 +1447,7 @@ }, { "Input": "2018年2月2日から7日の間は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2018年2月2日から7日の間", @@ -1459,7 +1459,7 @@ }, { "Input": "1999年の6月にそれは起きた。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1999年の6月", @@ -1471,7 +1471,7 @@ }, { "Input": "1928年に", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1928年に", @@ -1483,7 +1483,7 @@ }, { "Input": "2027年の最初の週は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2027年の最初の週", @@ -1495,7 +1495,7 @@ }, { "Input": "2020年の第1四半期は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2020年の第1四半期", @@ -1507,7 +1507,7 @@ }, { "Input": "1978年の春に", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1978年の春", @@ -1519,7 +1519,7 @@ }, { "Input": "再来週は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "再来週", @@ -1531,7 +1531,7 @@ }, { "Input": "それは過去20年間に起きた。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "過去20年間", @@ -1543,7 +1543,7 @@ }, { "Input": "それは次の10年間に起きた。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "次の10年間", @@ -1555,7 +1555,7 @@ }, { "Input": "それは今後4週間に起きるでしょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今後4週間", @@ -1567,7 +1567,7 @@ }, { "Input": "それは2日後に起きるでしょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2日後に", @@ -1579,7 +1579,7 @@ }, { "Input": "コルタナが来週の初めに時間を見つけてくれる。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週の初め", @@ -1591,7 +1591,7 @@ }, { "Input": "承知しました。来週の終わりにスカイプを取得しましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週の終わり", @@ -1603,7 +1603,7 @@ }, { "Input": "承知しました。来週の初めにスカイプを取得しましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週の初め", @@ -1615,7 +1615,7 @@ }, { "Input": "コルタナ、三月の下旬に時間を見つけて。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "三月の下旬", @@ -1627,7 +1627,7 @@ }, { "Input": "コルタナ、来週半ばに時間を見つけて。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週半ば", @@ -1639,7 +1639,7 @@ }, { "Input": "コルタナが三月半ばに会えるよう手配してくれる。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "三月半ば", @@ -1651,7 +1651,7 @@ }, { "Input": "夏の半ばまでにどうですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夏の半ば", @@ -1663,7 +1663,7 @@ }, { "Input": "来週のはじめに時間がつくれます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週のはじめ", @@ -1675,7 +1675,7 @@ }, { "Input": "2016年11月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年11月", @@ -1687,7 +1687,7 @@ }, { "Input": "1月1日から4月5日の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1月1日から4月5日の間", @@ -1699,7 +1699,7 @@ }, { "Input": "2015年1月1日から2018年2月5日の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年1月1日から2018年2月5日の間", @@ -1735,7 +1735,7 @@ }, { "Input": "2019年2月1日から3月まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2019年2月1日から3月まで", @@ -1747,7 +1747,7 @@ }, { "Input": "2019年2月1日から3月の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2019年2月1日から3月の間", @@ -1759,7 +1759,7 @@ }, { "Input": "2015年6月から2018年5月の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年6月から2018年5月の間", @@ -1783,7 +1783,7 @@ }, { "Input": "2015年5月から2018年6月の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年5月から2018年6月の間", @@ -1855,7 +1855,7 @@ }, { "Input": "今日から2日半の間、ここに滞在します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から2日半の間", @@ -1867,7 +1867,7 @@ }, { "Input": "私の2017年4月のボーナスは何ですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2017年4月", @@ -1879,7 +1879,7 @@ }, { "Input": "私はそれが起きたのと同じ月にそこにいませんでした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "同じ月", @@ -1891,7 +1891,7 @@ }, { "Input": "私はそれが起きたのと同じ週にそこにいませんでした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "同じ週", @@ -1903,7 +1903,7 @@ }, { "Input": "私はその年にそこにいませんでした。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その年", @@ -1915,7 +1915,7 @@ }, { "Input": "今日から2週間以上前にもうすべての仕事を終えた。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から2週間以上前", @@ -1927,7 +1927,7 @@ }, { "Input": "今日から2週間以内に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から2週間以内", @@ -1939,7 +1939,7 @@ }, { "Input": "この仕事は昨日の2日以上前には終わらせておくべきだった。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昨日の2日以上前", @@ -1951,7 +1951,7 @@ }, { "Input": "この仕事は明日から3日以内に終わらせます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日から3日以内", @@ -1963,7 +1963,7 @@ }, { "Input": "コルタナ、18日の週に何か予定を入れて。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "18日の週", @@ -1975,7 +1975,7 @@ }, { "Input": "日付がこの10年の売上", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "この10年", @@ -1987,7 +1987,7 @@ }, { "Input": "2016年第3四半期は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年第3四半期", @@ -1999,7 +1999,7 @@ }, { "Input": "来年の第3四半期は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年の第3四半期", @@ -2011,7 +2011,7 @@ }, { "Input": "来年の第4四半期は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年の第4四半期", @@ -2024,12 +2024,12 @@ { "Input": "2000ドルをイギリスポンドに換算してください。", "Comment": "2000 shouldn't recognized as year here", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "この銀行の株は年初来20%下がっている。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "年初来", @@ -2041,7 +2041,7 @@ }, { "Input": "10月1日から11月7日まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月1日から11月7日まで", @@ -2119,7 +2119,7 @@ }, { "Input": "今年の夏", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今年の夏", @@ -2155,7 +2155,7 @@ }, { "Input": "先週", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "先週", @@ -2191,7 +2191,7 @@ }, { "Input": "2018年12月", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2018年12月", @@ -2239,7 +2239,7 @@ }, { "Input": "会議は来週になりました。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "来週", @@ -2263,7 +2263,7 @@ }, { "Input": "平成三十年十二月", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "平成三十年十二月", @@ -2275,7 +2275,7 @@ }, { "Input": "この三年間、犯罪者数は年々減っています。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "この三年間", @@ -2299,7 +2299,7 @@ }, { "Input": "100とはただの数字です。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -2328,7 +2328,7 @@ }, { "Input": "次の週末", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "次の週末", @@ -2340,7 +2340,7 @@ }, { "Input": "来週はどうですか?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "来週", @@ -2376,7 +2376,7 @@ }, { "Input": "1499とはただの数字です。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -2405,7 +2405,7 @@ }, { "Input": "来月まで終わります。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "来月", @@ -2441,7 +2441,7 @@ }, { "Input": "一月十日から十二日まで", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "一月十日から十二日まで", @@ -2453,7 +2453,7 @@ }, { "Input": "翌年", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "翌年", @@ -2465,7 +2465,7 @@ }, { "Input": "先月", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "先月", @@ -2477,7 +2477,7 @@ }, { "Input": "翌日", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "翌日", @@ -2549,7 +2549,7 @@ }, { "Input": "来年", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "来年", @@ -2561,7 +2561,7 @@ }, { "Input": "今クォーター", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今クォーター", @@ -2573,7 +2573,7 @@ }, { "Input": "過去の十年間北京は著しく変わりました。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "過去の十年間", @@ -2585,7 +2585,7 @@ }, { "Input": "2101とはただの数字です。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -2614,7 +2614,7 @@ }, { "Input": "今月", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今月", @@ -2626,7 +2626,7 @@ }, { "Input": "こんげつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "こんげつ", @@ -2638,7 +2638,7 @@ }, { "Input": "来月", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "来月", @@ -2650,7 +2650,7 @@ }, { "Input": "らいげつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "らいげつ", @@ -2663,7 +2663,7 @@ { "Input": "再来月", "Comment": "Pronounciation: さらいげつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "再来月", @@ -2675,7 +2675,7 @@ }, { "Input": "昨月", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "昨月", @@ -2687,7 +2687,7 @@ }, { "Input": "さくげつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "さくげつ", @@ -2699,7 +2699,7 @@ }, { "Input": "せんげつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "せんげつ", @@ -2711,7 +2711,7 @@ }, { "Input": "先々月", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "先々月", @@ -2723,7 +2723,7 @@ }, { "Input": "せんせんげつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "せんせんげつ", @@ -2735,7 +2735,7 @@ }, { "Input": "前月", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "前月", @@ -2747,7 +2747,7 @@ }, { "Input": "ぜんげつ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ぜんげつ", @@ -2759,7 +2759,7 @@ }, { "Input": "今年", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "今年", @@ -2771,7 +2771,7 @@ }, { "Input": "ことし", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ことし", @@ -2783,7 +2783,7 @@ }, { "Input": "らいねん", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "らいねん", @@ -2795,7 +2795,7 @@ }, { "Input": "再来年", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "再来年", @@ -2807,7 +2807,7 @@ }, { "Input": "さらいねん", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "さらいねん", @@ -2819,7 +2819,7 @@ }, { "Input": "昨年", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "昨年", @@ -2831,7 +2831,7 @@ }, { "Input": "さくねん", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "さくねん", @@ -2843,7 +2843,7 @@ }, { "Input": "きょねん", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "きょねん", diff --git a/Specs/DateTime/Japanese/DatePeriodParser.json b/Specs/DateTime/Japanese/DatePeriodParser.json index 7e9454beec..f2bfe7d043 100644 --- a/Specs/DateTime/Japanese/DatePeriodParser.json +++ b/Specs/DateTime/Japanese/DatePeriodParser.json @@ -186,7 +186,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1995年1月4日から22日まで", @@ -212,7 +212,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1995年1月4日から22日の間", @@ -264,7 +264,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週", @@ -290,7 +290,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週", @@ -602,7 +602,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その週", @@ -628,7 +628,7 @@ "Context": { "ReferenceDateTime": "2026-01-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週", @@ -654,7 +654,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "私の週", @@ -707,7 +707,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週末", @@ -733,7 +733,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "私の週末", @@ -785,7 +785,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年1月12日から2016年1月22日まで", @@ -837,7 +837,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から明日まで", @@ -1149,7 +1149,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "週末", @@ -1175,7 +1175,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週末", @@ -1409,7 +1409,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年の第3四半期", @@ -1435,7 +1435,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の第3四半期", @@ -1513,7 +1513,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年の第1四半期", @@ -1617,7 +1617,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の夏", @@ -1637,7 +1637,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年の春", @@ -1657,7 +1657,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その夏", @@ -1677,7 +1677,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夏", @@ -1697,7 +1697,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年の夏", @@ -2064,7 +2064,7 @@ "Context": { "ReferenceDateTime": "2017-11-17T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週", @@ -2168,7 +2168,7 @@ "Context": { "ReferenceDateTime": "2017-11-20T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週末", @@ -2298,7 +2298,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java, python", "Results": [ { "Text": "70年代", @@ -2324,7 +2324,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java, python", "Results": [ { "Text": "40年代", @@ -2402,7 +2402,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2018年2月2日から7日", @@ -2428,7 +2428,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2018年2月2日から7日の間", @@ -2532,7 +2532,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2020年の第3四半期", @@ -2558,7 +2558,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1978年の春", @@ -2708,7 +2708,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2014年から2018年まで", @@ -2734,7 +2734,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2014年から2018年の間", @@ -2760,7 +2760,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2000年から2014年まで", @@ -4276,7 +4276,7 @@ "Context": { "ReferenceDateTime": "2019-01-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週", @@ -4302,7 +4302,7 @@ "Context": { "ReferenceDateTime": "2017-01-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週", @@ -4328,7 +4328,7 @@ "Context": { "ReferenceDateTime": "2016-01-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週", @@ -4426,7 +4426,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "08日から12日まで", @@ -4452,7 +4452,7 @@ "Context": { "ReferenceDateTime": "2018-11-30T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "08日から12日まで", @@ -4478,7 +4478,7 @@ "Context": { "ReferenceDateTime": "2018-12-30T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "08日から12日まで", @@ -4504,7 +4504,7 @@ "Context": { "ReferenceDateTime": "2018-01-30T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "08日から12日まで", @@ -4530,7 +4530,7 @@ "Context": { "ReferenceDateTime": "2018-01-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "08日から12日まで", @@ -4553,7 +4553,7 @@ }, { "Input": "2008年から2012年まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2008年から2012年まで", @@ -4651,7 +4651,7 @@ "Context": { "ReferenceDateTime": "2018-11-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "08/1から09/4まで", @@ -4703,7 +4703,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript,python,java", "Results": [ { "Text": "2019年6月1日から6月30日まで", @@ -4755,7 +4755,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript,python,java", "Results": [ { "Text": "来月", @@ -5243,7 +5243,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "来週", @@ -5347,7 +5347,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript,python,java", "Results": [ { "Text": "2007年", @@ -5477,7 +5477,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "二〇一六年から二〇一八年まで", @@ -5581,7 +5581,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript,python,java", "Results": [ { "Text": "来年", @@ -5659,7 +5659,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "次の週末", @@ -5737,7 +5737,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今年の第一クォーター", @@ -5945,7 +5945,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "来週", @@ -6118,7 +6118,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "翌年", diff --git a/Specs/DateTime/Japanese/DateTimeExtractor.json b/Specs/DateTime/Japanese/DateTimeExtractor.json index 9a7e1c8fb8..96d8ba4e1b 100644 --- a/Specs/DateTime/Japanese/DateTimeExtractor.json +++ b/Specs/DateTime/Japanese/DateTimeExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "今戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今", @@ -13,7 +13,7 @@ }, { "Input": "できるだけ早く戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "できるだけ早く", @@ -25,7 +25,7 @@ }, { "Input": "今すぐ戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今すぐ", @@ -37,7 +37,7 @@ }, { "Input": "15日の8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の8時", @@ -49,7 +49,7 @@ }, { "Input": "15日の8時30秒に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の8時30秒", @@ -61,7 +61,7 @@ }, { "Input": "15日の午後8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の午後8時", @@ -73,7 +73,7 @@ }, { "Input": "2016年04月21日の午後8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年04月21日の午後8時", @@ -85,7 +85,7 @@ }, { "Input": "2016年04月21日の午後8時13秒に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年04月21日の午後8時13秒", @@ -97,7 +97,7 @@ }, { "Input": "10月23日の7時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月23日の7時", @@ -109,7 +109,7 @@ }, { "Input": "10月14日の午前8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8時", @@ -121,7 +121,7 @@ }, { "Input": "10月14日の午前8時1秒に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8時1秒", @@ -133,7 +133,7 @@ }, { "Input": "明日の午前8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の午前8時", @@ -145,7 +145,7 @@ }, { "Input": "明日の午前8時ごろ戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の午前8時", @@ -157,7 +157,7 @@ }, { "Input": "明日の午前8時5秒に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の午前8時5秒", @@ -169,7 +169,7 @@ }, { "Input": "来週の金曜日の3時半に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週の金曜日の3時半", @@ -181,7 +181,7 @@ }, { "Input": "2016年5月5日の夜8時20分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年5月5日の夜8時20分", @@ -193,7 +193,7 @@ }, { "Input": "15日の7時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の7時", @@ -205,7 +205,7 @@ }, { "Input": "来週の日曜日の午後8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来週の日曜日の午後8時", @@ -217,7 +217,7 @@ }, { "Input": "今日の午後8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日の午後8時", @@ -229,7 +229,7 @@ }, { "Input": "明日の7時15分前に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の7時15分前", @@ -241,7 +241,7 @@ }, { "Input": "2016年12月22日の19時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年12月22日の19時", @@ -253,7 +253,7 @@ }, { "Input": "明日の7時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の7時", @@ -265,7 +265,7 @@ }, { "Input": "明日の朝7時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の朝7時", @@ -277,7 +277,7 @@ }, { "Input": "日曜の午後7時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "日曜の午後7時", @@ -289,7 +289,7 @@ }, { "Input": "明日の朝5時20分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の朝5時20分", @@ -301,7 +301,7 @@ }, { "Input": "10月14日の8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の8時", @@ -313,7 +313,7 @@ }, { "Input": "今朝の7時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今朝の7時", @@ -325,7 +325,7 @@ }, { "Input": "1月1日の午後8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1月1日の午後8時", @@ -337,7 +337,7 @@ }, { "Input": "今夜10時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜10時", @@ -349,7 +349,7 @@ }, { "Input": "今朝8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今朝8時", @@ -361,7 +361,7 @@ }, { "Input": "今夜8時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜8時", @@ -373,7 +373,7 @@ }, { "Input": "今夜7時ごろ戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜7時", @@ -385,7 +385,7 @@ }, { "Input": "今朝7時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今朝7時", @@ -397,7 +397,7 @@ }, { "Input": "今夜7時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜7時", @@ -409,7 +409,7 @@ }, { "Input": "今夜9時30分に2名", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜9時30分", @@ -421,7 +421,7 @@ }, { "Input": "今夜9時30分31秒に2名", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜9時30分31秒", @@ -433,7 +433,7 @@ }, { "Input": "今日中に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日中", @@ -445,7 +445,7 @@ }, { "Input": "明日中に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日中", @@ -457,12 +457,12 @@ }, { "Input": "日曜日のうちに戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "5日の午前4時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5日の午前4時", @@ -474,7 +474,7 @@ }, { "Input": "2016年12月16日の午後12時23分59秒に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年12月16日の午後12時23分59秒", @@ -486,7 +486,7 @@ }, { "Input": "あと5時間で戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "あと5時間で", @@ -498,7 +498,7 @@ }, { "Input": "日曜日の午後3時があいているか確認。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "日曜日の午後3時", @@ -510,7 +510,7 @@ }, { "Input": "明日の朝9時にアポを入れる。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の朝9時", @@ -522,7 +522,7 @@ }, { "Input": "明日の朝9時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の朝9時", @@ -534,7 +534,7 @@ }, { "Input": "明日の9時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の9時", @@ -546,7 +546,7 @@ }, { "Input": "今週の金曜日の午後1時", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今週の金曜日の午後1時", @@ -558,7 +558,7 @@ }, { "Input": "金曜日の午後12時30分にランチの予定を追加。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "金曜日の午後12時30分", @@ -570,7 +570,7 @@ }, { "Input": "今夜12時に649を追加。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜12時", @@ -582,7 +582,7 @@ }, { "Input": "8月1日の午前11時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8月1日の午前11時", @@ -594,7 +594,7 @@ }, { "Input": "8月1日の午後11時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8月1日の午後11時", @@ -606,7 +606,7 @@ }, { "Input": "2月25日の午前11時に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2月25日の午前11時", @@ -618,7 +618,7 @@ }, { "Input": "2017年1月6日の午前6時37分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2017年1月6日の午前6時37分", @@ -630,7 +630,7 @@ }, { "Input": "2016年11月16日の10時38分", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年11月16日の10時38分", @@ -642,7 +642,7 @@ }, { "Input": "あと1日と2時間で出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "あと1日と2時間で", @@ -654,7 +654,7 @@ }, { "Input": "あと1時間で忙しくなるので、後で電話してください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "あと1時間で", @@ -678,7 +678,7 @@ }, { "Input": "あと1日と30分で出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "あと1日と30分で", @@ -690,7 +690,7 @@ }, { "Input": "あと2分で出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "あと2分で", @@ -702,7 +702,7 @@ }, { "Input": "今日午前9時にスカイプ通話を予約してください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日午前9時", @@ -714,7 +714,7 @@ }, { "Input": "今日午後9時にスカイプ通話を予約してください。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日午後9時", @@ -726,7 +726,7 @@ }, { "Input": "あと2時間で出発します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "あと2時間で", @@ -750,7 +750,7 @@ }, { "Input": "平成二十二年一月二十九日五時", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "平成二十二年一月二十九日五時", @@ -762,7 +762,7 @@ }, { "Input": "明日の午後五時", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "明日の午後五時", @@ -786,7 +786,7 @@ }, { "Input": "昨夜六時", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "昨夜六時", @@ -798,7 +798,7 @@ }, { "Input": "今朝五時", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今朝五時", @@ -822,7 +822,7 @@ }, { "Input": "一月十九日午後五時", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "一月十九日午後五時", @@ -858,7 +858,7 @@ }, { "Input": "今日の朝8時15分", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今日の朝8時15分", @@ -882,7 +882,7 @@ }, { "Input": "今は都合が悪い", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今", @@ -906,7 +906,7 @@ }, { "Input": "今夜六時", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今夜六時", @@ -918,7 +918,7 @@ }, { "Input": "日曜日の終わりに帰ります", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "日曜日の終わり", diff --git a/Specs/DateTime/Japanese/DateTimeModel.json b/Specs/DateTime/Japanese/DateTimeModel.json index c7bddbefc6..914e04cbb4 100644 --- a/Specs/DateTime/Japanese/DateTimeModel.json +++ b/Specs/DateTime/Japanese/DateTimeModel.json @@ -1322,198 +1322,6 @@ } ] }, - { - "Input": "毎週出発する。", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週", - "Start": 0, - "End": 1, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "毎日出発する。", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日", - "Start": 0, - "End": 1, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "毎年出発する。", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎年", - "Start": 0, - "End": 1, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "2日ごとに出発する。", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2日ごとに", - "Start": 0, - "End": 4, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "3週間ごとに出発する。", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3週間ごとに", - "Start": 0, - "End": 5, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "毎日午後3時に出発する。", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日午後3時", - "Start": 0, - "End": 5, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "毎週月曜日に出発する。", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日", - "Start": 0, - "End": 4, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "毎週月曜日午後4時に出発する。", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日午後4時", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "午後7時56分30秒に戻ってきます。", "Context": { @@ -2886,21 +2694,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "毎週", - "Start": 0, - "End": 1, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "今週", "Start": 5, @@ -2926,21 +2719,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "毎週", - "Start": 3, - "End": 4, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "今週", "Start": 60, @@ -9373,21 +9151,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "毎週火曜日", - "Start": 6, - "End": 10, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "木曜日の19時から21時", "Start": 12, @@ -10767,21 +10530,6 @@ } ] } - }, - { - "Text": "毎年", - "Start": 35, - "End": 36, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -11324,30 +11072,6 @@ } ] }, - { - "Input": "事件は毎週の月曜日夜8時に起こします。", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週の月曜日夜8時", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T20", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 3, - "End": 11 - } - ] - }, { "Input": "昨日留守しました。", "Context": { @@ -11993,21 +11717,6 @@ } ] } - }, - { - "Text": "毎年", - "Start": 18, - "End": 19, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -12659,30 +12368,6 @@ } ] }, - { - "Input": "事件は毎年起こします。", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎年", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 3, - "End": 4 - } - ] - }, { "Input": "水曜日", "Context": { @@ -13333,30 +13018,6 @@ } ] }, - { - "Input": "事件は毎日起こします。", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎日", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 3, - "End": 4 - } - ] - }, { "Input": "彼は2007年後に学校に来たことはありません。", "Context": { @@ -13409,30 +13070,6 @@ } ] }, - { - "Input": "事件は毎週の月曜日に起こします。", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週の月曜日", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 3, - "End": 8 - } - ] - }, { "Input": "明日午後五時", "Context": { @@ -13772,54 +13409,6 @@ } ] }, - { - "Input": "事件は毎週起こします。", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 3, - "End": 4 - } - ] - }, - { - "Input": "事件は毎月起こします。", - "Context": { - "ReferenceDateTime": "2017-03-22T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎月", - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 3, - "End": 4 - } - ] - }, { "Input": "出荷日は2015年1月1日またはその前、または2015年2月1日前の受け方の税金の中間値を降順にランクする。", "Context": { @@ -14661,21 +14250,6 @@ } ] } - }, - { - "Text": "毎年", - "Start": 35, - "End": 36, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, diff --git a/Specs/DateTime/Japanese/DateTimeModelExperimentalMode.json b/Specs/DateTime/Japanese/DateTimeModelExperimentalMode.json index d93cbfb3c7..f15093d64f 100644 --- a/Specs/DateTime/Japanese/DateTimeModelExperimentalMode.json +++ b/Specs/DateTime/Japanese/DateTimeModelExperimentalMode.json @@ -259,21 +259,6 @@ } ] } - }, - { - "Text": "毎年", - "Start": 34, - "End": 35, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -823,21 +808,6 @@ } ] } - }, - { - "Text": "毎年", - "Start": 19, - "End": 20, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -1062,21 +1032,6 @@ } ] } - }, - { - "Text": "毎年", - "Start": 29, - "End": 30, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, diff --git a/Specs/DateTime/Japanese/DateTimeParser.json b/Specs/DateTime/Japanese/DateTimeParser.json index 24a848ecd9..f2c21e2c9c 100644 --- a/Specs/DateTime/Japanese/DateTimeParser.json +++ b/Specs/DateTime/Japanese/DateTimeParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の8時20秒", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年4月21日の午後8時", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年4月21日の午後8時20秒", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8時", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8時31秒", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8時頃", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8時25秒", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年12月22日19時", @@ -220,7 +220,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の8時24秒", @@ -268,7 +268,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8時13秒", @@ -292,7 +292,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日の朝午前7時", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日の朝7時", @@ -340,7 +340,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年12月16日の12時23分59秒", @@ -364,7 +364,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2017年1月6日の午前6時37分", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年11月16日 10時38分", @@ -460,7 +460,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今", @@ -508,7 +508,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の8時", @@ -532,7 +532,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の8時0分20秒", @@ -556,7 +556,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の午後8時", @@ -580,7 +580,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5日の午前4時", @@ -604,7 +604,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年04月21日の午後8:00", @@ -628,7 +628,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年04月21日の午後8:00:20", @@ -652,7 +652,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月23日の7時", @@ -676,7 +676,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8:00", @@ -700,7 +700,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8:00:31", @@ -724,7 +724,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8:00頃", @@ -748,7 +748,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8:00:25", @@ -772,7 +772,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年5月5日の夜8時20分過ぎに", @@ -796,7 +796,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日午後8時", @@ -820,7 +820,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の7時", @@ -844,7 +844,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日の午後8時", @@ -868,7 +868,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の7時15分前", @@ -892,7 +892,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016-12-22 19:00", @@ -916,7 +916,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の午前8:00", @@ -940,7 +940,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の朝7時", @@ -964,7 +964,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜7時ぐらい", @@ -988,7 +988,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "次の日曜日の午後7:00", @@ -1012,7 +1012,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日の朝5時20分過ぎに", @@ -1036,7 +1036,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今朝の7時", @@ -1060,7 +1060,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜10時", @@ -1156,7 +1156,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜午後10時", @@ -1180,7 +1180,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今朝の午前8時", @@ -1204,7 +1204,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜午後8時", @@ -1324,7 +1324,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "15日の8:00:24", @@ -1372,7 +1372,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10月14日の午前8:00:13", @@ -1396,7 +1396,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今朝7時", @@ -1420,7 +1420,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日の夜午前7時", @@ -1444,7 +1444,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日の朝7:00", @@ -1468,7 +1468,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日の夜7時", @@ -1492,7 +1492,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今夜7時", @@ -1516,7 +1516,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016-12-16T12:23:59", @@ -1540,7 +1540,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2017年1月6日 - 6:37am", @@ -1564,7 +1564,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年11月16日 10:38", @@ -1685,7 +1685,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1987年1月11日の8時", @@ -1709,7 +1709,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今日朝8時15分", @@ -1733,7 +1733,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "旧暦2015年10月1日の午前9時20分", @@ -1757,7 +1757,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2010-1-29の夜6時", @@ -1781,7 +1781,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2010/01/29の正午12時", @@ -1805,7 +1805,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2010年1月29日の朝7時", @@ -1829,7 +1829,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今日朝5時", @@ -1853,7 +1853,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1月19日の午後5時", @@ -1877,7 +1877,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2010.1.29の5時", @@ -1901,7 +1901,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "明日午後5時", @@ -1925,7 +1925,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T14:07:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "今夜6時", diff --git a/Specs/DateTime/Japanese/DurationExtractor.json b/Specs/DateTime/Japanese/DurationExtractor.json index a17be1da6a..631ff16124 100644 --- a/Specs/DateTime/Japanese/DurationExtractor.json +++ b/Specs/DateTime/Japanese/DurationExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "3時間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3時間", @@ -13,7 +13,7 @@ }, { "Input": "3日間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3日間", @@ -37,7 +37,7 @@ }, { "Input": "3か月不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3か月", @@ -49,7 +49,7 @@ }, { "Input": "3分不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3分", @@ -73,7 +73,7 @@ }, { "Input": "123.45秒不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "123.45秒", @@ -85,7 +85,7 @@ }, { "Input": "2週間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2週間", @@ -97,7 +97,7 @@ }, { "Input": "20分不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20分", @@ -109,7 +109,7 @@ }, { "Input": "24時間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "24時間", @@ -193,7 +193,7 @@ }, { "Input": "1時間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1時間", @@ -205,7 +205,7 @@ }, { "Input": "1年間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1年間", @@ -229,7 +229,7 @@ }, { "Input": "30分不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "30分", @@ -253,7 +253,7 @@ }, { "Input": "2時間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2時間", @@ -277,7 +277,7 @@ }, { "Input": "1週間で", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1週間", @@ -289,7 +289,7 @@ }, { "Input": "1日で", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1日", @@ -301,7 +301,7 @@ }, { "Input": "1時間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1時間", @@ -313,7 +313,7 @@ }, { "Input": "1か月間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1か月間", @@ -325,7 +325,7 @@ }, { "Input": "数時間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "数時間", @@ -337,7 +337,7 @@ }, { "Input": "数分不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "数分", @@ -349,7 +349,7 @@ }, { "Input": "数日間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "数日間", @@ -433,7 +433,7 @@ }, { "Input": "20年間不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "20年間", @@ -445,7 +445,7 @@ }, { "Input": "二年間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "二年間", @@ -457,7 +457,7 @@ }, { "Input": "五時間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "五時間", @@ -481,7 +481,7 @@ }, { "Input": "七週間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "七週間", @@ -517,7 +517,7 @@ }, { "Input": "六日間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "六日間", diff --git a/Specs/DateTime/Japanese/HolidayExtractor.json b/Specs/DateTime/Japanese/HolidayExtractor.json index 8ad7c0364f..f98074562c 100644 --- a/Specs/DateTime/Japanese/HolidayExtractor.json +++ b/Specs/DateTime/Japanese/HolidayExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "クリスマスに戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "クリスマス", @@ -13,7 +13,7 @@ }, { "Input": "クリスマスの日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "クリスマスの日", @@ -25,7 +25,7 @@ }, { "Input": "元旦に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "元旦", @@ -37,7 +37,7 @@ }, { "Input": "感謝祭の日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "感謝祭の日", @@ -49,7 +49,7 @@ }, { "Input": "父の日に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "父の日", @@ -61,7 +61,7 @@ }, { "Input": "今年の元旦に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今年の元旦", @@ -73,7 +73,7 @@ }, { "Input": "2016年の元旦に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年の元旦", @@ -85,7 +85,7 @@ }, { "Input": "2016年元旦に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年元旦", @@ -97,7 +97,7 @@ }, { "Input": "クリーンマンデイに戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "クリーンマンデイ", @@ -109,7 +109,7 @@ }, { "Input": "キング牧師記念日は、アメリカの連邦祝日です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "キング牧師記念日", @@ -121,12 +121,12 @@ }, { "Input": "マーティン・ルーサー・キングは、自分の名がつけられた祝日がある。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "明日建軍節だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "建軍節", @@ -138,7 +138,7 @@ }, { "Input": "明日バレンタインデーだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "バレンタインデー", @@ -150,7 +150,7 @@ }, { "Input": "明日国慶節だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "国慶節", @@ -162,7 +162,7 @@ }, { "Input": "明日清明だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "清明", @@ -174,7 +174,7 @@ }, { "Input": "明日大晦日だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "大晦日", @@ -186,7 +186,7 @@ }, { "Input": "明日ハロウィンだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "ハロウィン", @@ -198,7 +198,7 @@ }, { "Input": "明日中秋節だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "中秋節", @@ -210,7 +210,7 @@ }, { "Input": "明日旧正月だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "旧正月", @@ -222,7 +222,7 @@ }, { "Input": "明日ガールズデーだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "ガールズデー", @@ -234,7 +234,7 @@ }, { "Input": "明日感謝祭だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "感謝祭", @@ -246,7 +246,7 @@ }, { "Input": "明日子供の日だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "子供の日", @@ -258,7 +258,7 @@ }, { "Input": "明日クリスマスだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "クリスマス", @@ -270,7 +270,7 @@ }, { "Input": "明日お正月だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "お正月", @@ -282,7 +282,7 @@ }, { "Input": "明日植樹祭だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "植樹祭", @@ -294,7 +294,7 @@ }, { "Input": "明日重陽節だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "重陽節", @@ -306,7 +306,7 @@ }, { "Input": "明日父の日だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "父の日", @@ -318,7 +318,7 @@ }, { "Input": "明日シングルデーだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "シングルデー", @@ -330,7 +330,7 @@ }, { "Input": "明日国際婦人デーだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "国際婦人デー", @@ -342,7 +342,7 @@ }, { "Input": "明日ダブル十一だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "ダブル十一", @@ -354,7 +354,7 @@ }, { "Input": "明日元宵節だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "元宵節", @@ -366,7 +366,7 @@ }, { "Input": "明日教師の日だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "教師の日", @@ -378,7 +378,7 @@ }, { "Input": "明日新年だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "新年", @@ -390,7 +390,7 @@ }, { "Input": "明日中秋だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "中秋", @@ -402,7 +402,7 @@ }, { "Input": "明日端午の節句だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "端午の節句", @@ -414,7 +414,7 @@ }, { "Input": "明日母の日だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "母の日", @@ -426,7 +426,7 @@ }, { "Input": "明日エイプリルフールだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "エイプリルフール", @@ -438,7 +438,7 @@ }, { "Input": "明日青年の日だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "青年の日", @@ -450,7 +450,7 @@ }, { "Input": "明日メーデーだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "メーデー", @@ -462,7 +462,7 @@ }, { "Input": "明日クリスマスイブだけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "クリスマスイブ", @@ -474,7 +474,7 @@ }, { "Input": "明日清明節だけどどこ行く?", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "清明節", diff --git a/Specs/DateTime/Japanese/HolidayParser.json b/Specs/DateTime/Japanese/HolidayParser.json index 0050606e9b..fdf8e2fbf7 100644 --- a/Specs/DateTime/Japanese/HolidayParser.json +++ b/Specs/DateTime/Japanese/HolidayParser.json @@ -29,7 +29,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "クリスマスの日", @@ -53,7 +53,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "大晦日", @@ -77,7 +77,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "クリスマス", @@ -101,7 +101,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "元旦", @@ -125,7 +125,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "感謝祭の日", @@ -149,7 +149,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "感謝祭", @@ -173,7 +173,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "父の日", @@ -197,7 +197,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "来年の元旦", @@ -221,7 +221,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2010年の感謝祭の日", @@ -245,7 +245,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2015年の父の日", @@ -269,7 +269,7 @@ "Context": { "ReferenceDateTime": "2018-06-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "メーデー", @@ -308,7 +308,7 @@ "Context": { "ReferenceDateTime": "2018-06-01T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "キング牧師記念日", @@ -332,7 +332,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "教師の日", @@ -356,7 +356,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "母の日", @@ -380,7 +380,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "中秋", @@ -404,7 +404,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "端午の節句", @@ -428,7 +428,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "子供の日", @@ -452,7 +452,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "元宵節", @@ -476,7 +476,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "国慶節", @@ -500,7 +500,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "クリスマス", @@ -524,7 +524,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "メーデー", @@ -548,7 +548,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "旧正月", @@ -572,7 +572,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "感謝祭", @@ -596,7 +596,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "シングルデー", @@ -620,7 +620,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "ハロウィン", @@ -644,7 +644,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "中秋節", @@ -668,7 +668,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "クリスマスイブ", @@ -692,7 +692,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "青年の日", @@ -716,7 +716,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "ダブル十一", @@ -740,7 +740,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "父の日", @@ -764,7 +764,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "エイプリルフール", @@ -788,7 +788,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "バレンタインデー", @@ -812,7 +812,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "お正月", @@ -836,7 +836,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "ガールズデー", @@ -860,7 +860,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "新年", @@ -884,7 +884,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "清明節", @@ -908,7 +908,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "植樹祭", @@ -932,7 +932,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "国際婦人デー", @@ -956,7 +956,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "建軍節", @@ -980,7 +980,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "重陽節", @@ -1004,7 +1004,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "大晦日", @@ -1028,7 +1028,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "旧暦の正月初一", diff --git a/Specs/DateTime/Japanese/MergedExtractor.json b/Specs/DateTime/Japanese/MergedExtractor.json index c2f631032f..6585e5151a 100644 --- a/Specs/DateTime/Japanese/MergedExtractor.json +++ b/Specs/DateTime/Japanese/MergedExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "これは2日です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2日", @@ -49,7 +49,7 @@ }, { "Input": "これは明日午後4時以降です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日午後4時以降", @@ -73,7 +73,7 @@ }, { "Input": "この1週間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "この1週間", @@ -97,7 +97,7 @@ }, { "Input": "この日はどうですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "この日", @@ -109,7 +109,7 @@ }, { "Input": "この週はどうですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "この週", @@ -121,7 +121,7 @@ }, { "Input": "私の一週間はどんなかんじですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "私の一週間", @@ -133,7 +133,7 @@ }, { "Input": "その週はどんなかんじですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その週", @@ -145,7 +145,7 @@ }, { "Input": "私の一日はどんなかんじですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "私の一日", @@ -157,7 +157,7 @@ }, { "Input": "その日はどんなかんじですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "その日", @@ -169,7 +169,7 @@ }, { "Input": "午前9時から11時まで会議の予定を入れて。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前9時から11時まで", @@ -193,7 +193,7 @@ }, { "Input": "7月22日のベルビューでの会議を8月22日に変更。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7月22日", @@ -211,7 +211,7 @@ }, { "Input": "7月2日以降", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7月2日以降", @@ -235,7 +235,7 @@ }, { "Input": "7月2日以前", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7月2日以前", @@ -247,7 +247,7 @@ }, { "Input": "6月6日 12時15分", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "6月6日 12時15分", @@ -259,7 +259,7 @@ }, { "Input": "2012年6月6日 15時15分", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2012年6月6日 15時15分", @@ -271,7 +271,7 @@ }, { "Input": "5月29日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5月29日", @@ -283,7 +283,7 @@ }, { "Input": "3月29日", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3月29日", @@ -319,12 +319,12 @@ }, { "Input": "notapplicable", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "午後3時の予定を4時に変更します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後3時", @@ -342,7 +342,7 @@ }, { "Input": "午前10時の予定を11時に変更します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時", @@ -360,7 +360,7 @@ }, { "Input": "午前10時の予定を20時に変更します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時", @@ -378,7 +378,7 @@ }, { "Input": "午前10時の予定を13時に変更します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時", @@ -396,7 +396,7 @@ }, { "Input": "午前10時の予定を0時に変更します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時", @@ -414,7 +414,7 @@ }, { "Input": "午前10時の予定を24時に変更します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時", @@ -432,7 +432,7 @@ }, { "Input": "午前10時の予定を4時に変更しますが、どうでしょうか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時", @@ -462,7 +462,7 @@ }, { "Input": "午前10時の予定を26時に変更します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時", @@ -498,7 +498,7 @@ }, { "Input": "午前10時の予定を25時に変更します。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時", @@ -588,7 +588,7 @@ }, { "Input": "2016年11月は不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年11月", @@ -600,7 +600,7 @@ }, { "Input": "2016年11月", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2016年11月", @@ -708,7 +708,7 @@ }, { "Input": "今日から2日後のご都合はいかがでしょうか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から2日後", @@ -720,7 +720,7 @@ }, { "Input": "明日から3週間のご都合はいかがでしょうか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日から3週間", @@ -732,7 +732,7 @@ }, { "Input": "昨日の2日前、あなたはどこにいましたか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昨日の2日前", @@ -744,7 +744,7 @@ }, { "Input": "今日から2週間以上前にもうすべての仕事を終えた。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から2週間以上前", @@ -756,7 +756,7 @@ }, { "Input": "今日から2週間以内に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日から2週間以内", @@ -768,7 +768,7 @@ }, { "Input": "この仕事は昨日の2日以上前には終わらせておくべきだった。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昨日の2日以上前", @@ -780,7 +780,7 @@ }, { "Input": "この仕事は明日から3日以内に終わらせます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "明日から3日以内", @@ -792,7 +792,7 @@ }, { "Input": "今から3分後に始めましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今から3分後", @@ -804,7 +804,7 @@ }, { "Input": "今日から3分始めましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "今日", @@ -846,7 +846,7 @@ }, { "Input": "これは2日間です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2日間", diff --git a/Specs/DateTime/Japanese/MergedParser.json b/Specs/DateTime/Japanese/MergedParser.json index 65ee094ae2..5d84ad5222 100644 --- a/Specs/DateTime/Japanese/MergedParser.json +++ b/Specs/DateTime/Japanese/MergedParser.json @@ -89,7 +89,7 @@ "Context": { "ReferenceDateTime": "2020-01-05T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "午前10時", @@ -128,7 +128,7 @@ "Context": { "ReferenceDateTime": "2020-01-05T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "午前10時", @@ -167,7 +167,7 @@ "Context": { "ReferenceDateTime": "2020-01-05T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "午前10時", diff --git a/Specs/DateTime/Japanese/SetExtractor.json b/Specs/DateTime/Japanese/SetExtractor.json deleted file mode 100644 index ecc835785b..0000000000 --- a/Specs/DateTime/Japanese/SetExtractor.json +++ /dev/null @@ -1,290 +0,0 @@ -[ - { - "Input": "毎週出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎日出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎月出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎月", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎年出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎年", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "2日ごとに出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2日ごとに", - "Type": "set", - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "3週間ごとに出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3週間ごとに", - "Type": "set", - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "毎日午後3時に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日午後3時", - "Type": "set", - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "毎年4月15日に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎年4月15日", - "Type": "set", - "Start": 0, - "Length": 7 - } - ] - }, - { - "Input": "毎週月曜日に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日", - "Type": "set", - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎週月曜日午後4時に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日午後4時", - "Type": "set", - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎朝出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎朝", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎朝9時に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎朝9時", - "Type": "set", - "Start": 0, - "Length": 4 - } - ] - }, - { - "Input": "毎日午後4時に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日午後4時", - "Type": "set", - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "毎晩9時に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎晩9時", - "Type": "set", - "Start": 0, - "Length": 4 - } - ] - }, - { - "Input": "各午前9時に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "各午前9時", - "Type": "set", - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎週日曜日午前9時に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週日曜日午前9時", - "Type": "set", - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎週月曜日午前9時に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日午前9時", - "Type": "set", - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎週日曜日に出発する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週日曜日", - "Type": "set", - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎週日曜日午後八時に事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週日曜日午後八時", - "Type": "set", - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎週日曜日事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週日曜日", - "Type": "set", - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎日事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎日", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎週事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎月事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎月", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎年事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎年", - "Type": "set", - "Start": 0, - "Length": 2 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Japanese/SetParser.json b/Specs/DateTime/Japanese/SetParser.json deleted file mode 100644 index 7dca9c662e..0000000000 --- a/Specs/DateTime/Japanese/SetParser.json +++ /dev/null @@ -1,776 +0,0 @@ -[ - { - "Input": "毎週出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2744475+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "隔週出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2754476+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "隔週", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎日出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2779449+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎日出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2794445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎月出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2829445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎月", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎年出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2844439+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎年", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎年出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2854444+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎年", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "2日ごとに出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2909444+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2日ごとに", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "3週間ごとに出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2959472+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3週間ごとに", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "毎日午後3時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2989494+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日午後3時", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "毎日午後3時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3039501+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日午後3時", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "毎年4月15日に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3109498+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎年4月15日", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 0, - "Length": 7 - } - ] - }, - { - "Input": "毎週月曜日に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3259514+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎週月曜日午後4時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3379507+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日午後4時", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎朝出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3429518+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎朝", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎朝9時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3609535+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎朝9時", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 0, - "Length": 4 - } - ] - }, - { - "Input": "毎日午後4時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3730732+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎日午後4時", - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - }, - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "各晩9時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3840706+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "各晩9時", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 0, - "Length": 4 - } - ] - }, - { - "Input": "毎晩9時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3930718+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎晩9時", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 0, - "Length": 4 - } - ] - }, - { - "Input": "各午前9時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4065719+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "各午前9時", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎午前9時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4170727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎午前9時", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎週日曜日午前9時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4295727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週日曜日午前9時", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎週月曜日午前9時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.438575+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日午前9時", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T09" - } - }, - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎週月曜日午前9時に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4505726+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日午前9時", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T09" - } - }, - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎週月曜日に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4570731+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週月曜日", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎週日曜日に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4635727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎週日曜日", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "各週日曜日に出発する。", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4710739+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "各週日曜日", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎週日曜日午後八時に事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週日曜日午後八時", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T20", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T20" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T20" - } - }, - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "毎週日曜日事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週日曜日", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 0, - "Length": 5 - } - ] - }, - { - "Input": "毎日事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎日", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎週事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎週", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎月事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎月", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 0, - "Length": 2 - } - ] - }, - { - "Input": "毎年事件が起こる", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "毎年", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 0, - "Length": 2 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Japanese/TimeExtractor.json b/Specs/DateTime/Japanese/TimeExtractor.json index e2fb7021b2..17546c47f7 100644 --- a/Specs/DateTime/Japanese/TimeExtractor.json +++ b/Specs/DateTime/Japanese/TimeExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "7時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7時", @@ -13,7 +13,7 @@ }, { "Input": "午後7時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時", @@ -25,7 +25,7 @@ }, { "Input": "午後7時56分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時56分", @@ -37,7 +37,7 @@ }, { "Input": "午後7時56分35秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時56分35秒", @@ -49,7 +49,7 @@ }, { "Input": "12時34分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12時34分", @@ -61,7 +61,7 @@ }, { "Input": "12時34分20秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12時34分20秒", @@ -73,7 +73,7 @@ }, { "Input": "00時00分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "00時00分", @@ -85,7 +85,7 @@ }, { "Input": "00時00分30秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "00時00分30秒", @@ -97,7 +97,7 @@ }, { "Input": "7時です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7時", @@ -109,7 +109,7 @@ }, { "Input": "朝の8時です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝の8時", @@ -121,7 +121,7 @@ }, { "Input": "夜の8時です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜の8時", @@ -133,7 +133,7 @@ }, { "Input": "8時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時半", @@ -145,7 +145,7 @@ }, { "Input": "午後8時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後8時半", @@ -157,7 +157,7 @@ }, { "Input": "8時30分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時30分", @@ -169,7 +169,7 @@ }, { "Input": "8時15分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時15分", @@ -181,7 +181,7 @@ }, { "Input": "午後9時45分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後9時45分", @@ -193,7 +193,7 @@ }, { "Input": "8時3分前です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時3分前", @@ -205,7 +205,7 @@ }, { "Input": "7時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7時半", @@ -217,7 +217,7 @@ }, { "Input": "午後7時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時半", @@ -229,7 +229,7 @@ }, { "Input": "朝の7時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝の7時半", @@ -241,7 +241,7 @@ }, { "Input": "朝の8時15分前です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝の8時15分前", @@ -253,7 +253,7 @@ }, { "Input": "夜の8時20分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜の8時20分", @@ -265,7 +265,7 @@ }, { "Input": "午後の7時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後の7時", @@ -277,7 +277,7 @@ }, { "Input": "午後7時00分14秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時00分14秒", @@ -289,7 +289,7 @@ }, { "Input": "午後7時30分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時30分", @@ -301,7 +301,7 @@ }, { "Input": "午後7時35分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時35分", @@ -313,7 +313,7 @@ }, { "Input": "11時5分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11時5分", @@ -325,7 +325,7 @@ }, { "Input": "5時27分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5時27分", @@ -337,7 +337,7 @@ }, { "Input": "夜の5時30分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜の5時30分", @@ -349,7 +349,7 @@ }, { "Input": "正午ごろ戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午", @@ -361,7 +361,7 @@ }, { "Input": "正午に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午", @@ -373,7 +373,7 @@ }, { "Input": "昼の12時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼の12時", @@ -385,7 +385,7 @@ }, { "Input": "11時ごろ戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11時", @@ -397,7 +397,7 @@ }, { "Input": "午後3時40分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後3時40分", @@ -409,7 +409,7 @@ }, { "Input": "午前11時40分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前11時40分", @@ -421,7 +421,7 @@ }, { "Input": "真夜中", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "真夜中", @@ -433,7 +433,7 @@ }, { "Input": "午前半ば", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前半ば", @@ -445,7 +445,7 @@ }, { "Input": "午後3時ごろ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後3時", @@ -457,7 +457,7 @@ }, { "Input": "正午", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午", @@ -469,7 +469,7 @@ }, { "Input": "午前7時56分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前7時56分", @@ -481,7 +481,7 @@ }, { "Input": "午前7時56分35秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前7時56分35秒", @@ -493,17 +493,17 @@ }, { "Input": "表題がpなのは、どのメールですか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "どのメールに返信がきましたか。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "正午の昼食時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午の昼食時", @@ -515,7 +515,7 @@ }, { "Input": "昼食時の正午に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼食時の正午", @@ -527,7 +527,7 @@ }, { "Input": "私は午後9時がいいです。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後9時", @@ -539,7 +539,7 @@ }, { "Input": "私は午前9時がいいです。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前9時", @@ -551,7 +551,7 @@ }, { "Input": "午後9時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後9時", @@ -563,7 +563,7 @@ }, { "Input": "午前9時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前9時", @@ -576,7 +576,7 @@ { "Input": "この品の値段は1.6714です。", "Comment": "1 shouldn't recognized as time here", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { @@ -593,7 +593,7 @@ }, { "Input": "今日十時ぐらい以降、マイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "十時ぐらい", @@ -617,7 +617,7 @@ }, { "Input": "今日夜二時半にマイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜二時半", @@ -629,7 +629,7 @@ }, { "Input": "今日午後十一時半にマイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後十一時半", @@ -641,7 +641,7 @@ }, { "Input": "今日十一時四十五分にマイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "十一時四十五分", @@ -653,7 +653,7 @@ }, { "Input": "今日夜十時頃以降、マイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜十時頃", @@ -677,7 +677,7 @@ }, { "Input": "今日朝十時ぐらい、マイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝十時ぐらい", @@ -689,7 +689,7 @@ }, { "Input": "今日夜19:30にマイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜19:30", @@ -701,7 +701,7 @@ }, { "Input": "今日夜9:30にマイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜9:30", @@ -725,7 +725,7 @@ }, { "Input": "今日朝十一時にマイクロソフトビルの入り口で会いましょう", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝十一時", diff --git a/Specs/DateTime/Japanese/TimeParser.json b/Specs/DateTime/Japanese/TimeParser.json index df595ef75b..3097cb1f43 100644 --- a/Specs/DateTime/Japanese/TimeParser.json +++ b/Specs/DateTime/Japanese/TimeParser.json @@ -1,7 +1,7 @@ [ { "Input": "アラームを8時40分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時40分", @@ -22,7 +22,7 @@ }, { "Input": "アラームを午前8時40分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前8時40分", @@ -43,7 +43,7 @@ }, { "Input": "アラームを午後8時40分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後8時40分", @@ -64,7 +64,7 @@ }, { "Input": "アラームを10時45分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10時45分", @@ -85,7 +85,7 @@ }, { "Input": "アラームを午後15時15分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後15時15分", @@ -106,7 +106,7 @@ }, { "Input": "アラームを午後15時30分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後15時30分", @@ -127,7 +127,7 @@ }, { "Input": "アラームを10時10分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10時10分", @@ -148,7 +148,7 @@ }, { "Input": "アラームを午後10時55分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後10時55分", @@ -169,7 +169,7 @@ }, { "Input": "7時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7時", @@ -190,7 +190,7 @@ }, { "Input": "午後7時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時", @@ -211,7 +211,7 @@ }, { "Input": "午後7時56分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時56分", @@ -232,7 +232,7 @@ }, { "Input": "午後7時56分30秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時56分30秒", @@ -253,7 +253,7 @@ }, { "Input": "12時34分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12時34分", @@ -274,7 +274,7 @@ }, { "Input": "12時34分25秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12時34分25秒", @@ -295,7 +295,7 @@ }, { "Input": "7時です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7時", @@ -316,7 +316,7 @@ }, { "Input": "朝の8時です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝の8時", @@ -337,7 +337,7 @@ }, { "Input": "夜の8時です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜の8時", @@ -358,7 +358,7 @@ }, { "Input": "8時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時半", @@ -379,7 +379,7 @@ }, { "Input": "午後8時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後8時半", @@ -400,7 +400,7 @@ }, { "Input": "8時30分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時30分", @@ -421,7 +421,7 @@ }, { "Input": "8時15分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時15分", @@ -442,7 +442,7 @@ }, { "Input": "午後9時45分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後9時45分", @@ -463,7 +463,7 @@ }, { "Input": "8時3分前です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時3分前", @@ -484,7 +484,7 @@ }, { "Input": "7時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7時半", @@ -505,7 +505,7 @@ }, { "Input": "午後7時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時半", @@ -526,7 +526,7 @@ }, { "Input": "朝の7時半です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝の7時半", @@ -547,7 +547,7 @@ }, { "Input": "朝の8時15分前です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝の8時15分前", @@ -568,7 +568,7 @@ }, { "Input": "夜の8時20分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜の8時20分", @@ -589,7 +589,7 @@ }, { "Input": "午後の7時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後の7時", @@ -610,7 +610,7 @@ }, { "Input": "午後7時00分05秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時00分05秒", @@ -631,7 +631,7 @@ }, { "Input": "午後7時30分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時30分", @@ -652,7 +652,7 @@ }, { "Input": "午後7時35分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時35分", @@ -673,7 +673,7 @@ }, { "Input": "午後11時20分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後11時20分", @@ -694,7 +694,7 @@ }, { "Input": "正午ごろ戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午", @@ -715,7 +715,7 @@ }, { "Input": "正午12時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午12時", @@ -736,7 +736,7 @@ }, { "Input": "11時ごろ戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11時", @@ -757,7 +757,7 @@ }, { "Input": "午後3時40分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後3時40分", @@ -778,7 +778,7 @@ }, { "Input": "午前11時40分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前11時40分", @@ -799,7 +799,7 @@ }, { "Input": "真夜中", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "真夜中", @@ -820,7 +820,7 @@ }, { "Input": "午前半ば", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前半ば", @@ -841,7 +841,7 @@ }, { "Input": "午後3時ごろ", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後3時", @@ -862,7 +862,7 @@ }, { "Input": "正午", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午", @@ -883,7 +883,7 @@ }, { "Input": "昼食時の12時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼食時の12時", @@ -904,7 +904,7 @@ }, { "Input": "夜中の12時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜中の12時", @@ -925,7 +925,7 @@ }, { "Input": "夜の12時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜の12時", @@ -946,7 +946,7 @@ }, { "Input": "夜中の1時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜中の1時", @@ -967,7 +967,7 @@ }, { "Input": "昼食時の11時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼食時の11時", @@ -988,7 +988,7 @@ }, { "Input": "昼食時の1時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼食時の1時", @@ -1009,7 +1009,7 @@ }, { "Input": "11時の昼食時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11時の昼食時", @@ -1030,7 +1030,7 @@ }, { "Input": "午後7時56分13秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時56分13秒", @@ -1051,7 +1051,7 @@ }, { "Input": "12時34分45秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "12時34分45秒", @@ -1072,7 +1072,7 @@ }, { "Input": "午後7時25秒に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後7時25秒", @@ -1093,7 +1093,7 @@ }, { "Input": "午前7時30分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前7時30分", @@ -1114,7 +1114,7 @@ }, { "Input": "11時5分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11時5分", @@ -1135,7 +1135,7 @@ }, { "Input": "5時27分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5時27分", @@ -1156,7 +1156,7 @@ }, { "Input": "夜の5時30分に戻ります。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜の5時30分", @@ -1177,7 +1177,7 @@ }, { "Input": "正午に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午", @@ -1198,7 +1198,7 @@ }, { "Input": "正午の昼食時に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "正午の昼食時", @@ -1219,7 +1219,7 @@ }, { "Input": "7時1分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "7時1分", @@ -1240,7 +1240,7 @@ }, { "Input": "午後10時10分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後10時10分", @@ -1261,7 +1261,7 @@ }, { "Input": "午後10時13分に戻ってきます。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後10時13分", @@ -1285,7 +1285,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "朝十時ぐらい", @@ -1309,7 +1309,7 @@ "Context": { "ReferenceDateTime": "2019-08-19T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "夜八時", @@ -1333,7 +1333,7 @@ "Context": { "ReferenceDateTime": "2019-08-09T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "朝8時", @@ -1357,7 +1357,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "午後五時", @@ -1381,7 +1381,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "朝11時", @@ -1405,7 +1405,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "夜十時ぐらい", @@ -1429,7 +1429,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "未明二時半", @@ -1453,7 +1453,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "夜19:30", @@ -1477,7 +1477,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "午後十一時半", @@ -1501,7 +1501,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "十時頃", @@ -1525,7 +1525,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "零時かっきり", @@ -1549,7 +1549,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "夜9:30", @@ -1573,7 +1573,7 @@ "Context": { "ReferenceDateTime": "2019-08-19T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "朝八時", @@ -1597,7 +1597,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "零時", @@ -1618,7 +1618,7 @@ }, { "Input": "8時3分です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8時3分", @@ -1639,7 +1639,7 @@ }, { "Input": "アラームを25時40分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "25時40分", @@ -1660,7 +1660,7 @@ }, { "Input": "アラームを26時45分にセットして。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "26時45分", @@ -1681,7 +1681,7 @@ }, { "Input": "私は8:00:24pmに戻ります", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "8:00:24pm", diff --git a/Specs/DateTime/Japanese/TimePeriodExtractor.json b/Specs/DateTime/Japanese/TimePeriodExtractor.json index 7578b1dbb0..a6d079735a 100644 --- a/Specs/DateTime/Japanese/TimePeriodExtractor.json +++ b/Specs/DateTime/Japanese/TimePeriodExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "午後5時から6時まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後5時から6時まで", @@ -13,7 +13,7 @@ }, { "Input": "午前5時から7時まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前5時から7時まで", @@ -25,7 +25,7 @@ }, { "Input": "午後5時から6時の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後5時から6時の間", @@ -37,7 +37,7 @@ }, { "Input": "午後5時から午後6時の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後5時から午後6時の間", @@ -49,7 +49,7 @@ }, { "Input": "午後4時から午後5時まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後4時から午後5時まで", @@ -61,7 +61,7 @@ }, { "Input": "午後4時から5時まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後4時から5時まで", @@ -73,7 +73,7 @@ }, { "Input": "4時から7時まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4時から7時まで", @@ -85,7 +85,7 @@ }, { "Input": "午後3時から7時半まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後3時から7時半まで", @@ -97,7 +97,7 @@ }, { "Input": "午後3時20分から8時まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後3時20分から8時まで", @@ -109,7 +109,7 @@ }, { "Input": "午後4時から5時半まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後4時から5時半まで", @@ -121,7 +121,7 @@ }, { "Input": "午前3時から午後5時まで不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前3時から午後5時まで", @@ -133,7 +133,7 @@ }, { "Input": "午後4時から5時半の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後4時から5時半の間", @@ -145,7 +145,7 @@ }, { "Input": "午前3時から午後5時の間、不在にします。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前3時から午後5時の間", @@ -157,7 +157,7 @@ }, { "Input": "午前中に会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前中", @@ -169,7 +169,7 @@ }, { "Input": "午後に会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後に", @@ -181,7 +181,7 @@ }, { "Input": "夜に会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜に", @@ -193,7 +193,7 @@ }, { "Input": "早朝に会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "早朝に", @@ -205,7 +205,7 @@ }, { "Input": "昼前に会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼前に", @@ -217,7 +217,7 @@ }, { "Input": "昼すぎに会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼すぎに", @@ -229,7 +229,7 @@ }, { "Input": "夕方前に会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夕方前に", @@ -241,7 +241,7 @@ }, { "Input": "夕方に会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夕方に", @@ -253,7 +253,7 @@ }, { "Input": "深夜に会いましょう。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "深夜に", @@ -265,7 +265,7 @@ }, { "Input": "午後2時から5時まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後2時から5時まで", @@ -277,7 +277,7 @@ }, { "Input": "午後6時から11時までジャンのパーティー", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後6時から11時まで", @@ -289,7 +289,7 @@ }, { "Input": "14時から16時30分まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "14時から16時30分まで", @@ -301,7 +301,7 @@ }, { "Input": "午後1時から4時まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時から4時まで", @@ -313,7 +313,7 @@ }, { "Input": "午後1時30分から4時まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時30分から4時まで", @@ -325,12 +325,12 @@ }, { "Input": "午後1時30分から4人の会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "こんにちはコルタナ。ジェニファーとスカイプ会議の予定を入れてください。私が出発する今週の金曜日午後に30分の会議が必要です。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後に", @@ -342,7 +342,7 @@ }, { "Input": "1時30分から3時30分まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1時30分から3時30分まで", @@ -354,7 +354,7 @@ }, { "Input": "午後1時30分から3時30分まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時30分から3時30分まで", @@ -366,7 +366,7 @@ }, { "Input": "午後1時30分から午後3時30分まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時30分から午後3時30分まで", @@ -378,7 +378,7 @@ }, { "Input": "1時から3時30分まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1時から3時30分まで", @@ -390,7 +390,7 @@ }, { "Input": "1時30分から3時まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1時30分から3時まで", @@ -402,7 +402,7 @@ }, { "Input": "10時から11時30分の間で会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10時から11時30分の間", @@ -414,7 +414,7 @@ }, { "Input": "午前10時10分から12時50分の間で会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時10分から12時50分の間", @@ -426,7 +426,7 @@ }, { "Input": "午後10時10分から3時の間で会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後10時10分から3時の間", @@ -438,7 +438,7 @@ }, { "Input": "午後10時10分から10時まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後10時10分から10時まで", @@ -450,7 +450,7 @@ }, { "Input": "午前10時半から23時まで会議を設定して。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時半から23時まで", @@ -462,7 +462,7 @@ }, { "Input": "営業時間内に電話をかけてこないで。", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "営業時間内に", @@ -474,7 +474,7 @@ }, { "Input": "深夜20時~早朝4時", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "深夜20時~早朝4時", @@ -486,7 +486,7 @@ }, { "Input": "午後2時~4時", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後2時~4時", @@ -498,7 +498,7 @@ }, { "Input": "午後五時から六時まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後五時から六時まで", @@ -510,7 +510,7 @@ }, { "Input": "午後5時から6時まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後5時から6時まで", @@ -522,7 +522,7 @@ }, { "Input": "夜9時30分から午前3時まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜9時30分から午前3時まで", @@ -534,7 +534,7 @@ }, { "Input": "午後", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後", @@ -546,7 +546,7 @@ }, { "Input": "深夜12時から未明2時まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "深夜12時から未明2時まで", @@ -558,7 +558,7 @@ }, { "Input": "午後四時から夜八時まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後四時から夜八時まで", @@ -570,7 +570,7 @@ }, { "Input": "昼", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼", @@ -582,7 +582,7 @@ }, { "Input": "午後五時半から六時半まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後五時半から六時半まで", @@ -594,7 +594,7 @@ }, { "Input": "午前", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前", @@ -606,7 +606,7 @@ }, { "Input": "夜", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜", @@ -618,7 +618,7 @@ }, { "Input": "午前8時45分から9時30分", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前8時45分から9時30分", @@ -630,7 +630,7 @@ }, { "Input": "早朝四時から六時まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "早朝四時から六時まで", @@ -642,7 +642,7 @@ }, { "Input": "4時から6時まで", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4時から6時まで", @@ -654,7 +654,7 @@ }, { "Input": "早朝四時から六時までの間", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "早朝四時から六時までの間", diff --git a/Specs/DateTime/Japanese/TimePeriodParser.json b/Specs/DateTime/Japanese/TimePeriodParser.json index b45cc93ec6..65ba6b26a5 100644 --- a/Specs/DateTime/Japanese/TimePeriodParser.json +++ b/Specs/DateTime/Japanese/TimePeriodParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後5時から6時まで", @@ -30,7 +30,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前5時から7時まで", @@ -56,7 +56,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後5時から6時の間", @@ -82,7 +82,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後5時から午後6時の間", @@ -108,7 +108,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前1時から午後5時まで", @@ -134,7 +134,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後4時から午後5時まで", @@ -160,7 +160,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後4時から5時まで", @@ -186,7 +186,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4時から7時まで", @@ -212,7 +212,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前3時から午後5時まで", @@ -238,7 +238,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前3時から午後5時の間", @@ -265,7 +265,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "Comment": "'今日の' shouldn't be annotated by TimePeriodParser", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後4時から午後5時の間", @@ -291,7 +291,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前中", @@ -317,7 +317,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後に", @@ -343,7 +343,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜に", @@ -369,7 +369,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "早朝に", @@ -396,7 +396,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼前に", @@ -423,7 +423,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "早朝に", @@ -450,7 +450,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼すぎに", @@ -477,7 +477,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夕方前に", @@ -504,7 +504,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夕方に", @@ -531,7 +531,7 @@ "ReferenceDateTime": "2016-11-07T16:12:00" }, "Comment": "TBD: Need to find 'early evening' in Japanese. 深夜 is night.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "深夜に", @@ -557,7 +557,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時から4時まで", @@ -583,7 +583,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時30分から4時まで", @@ -609,7 +609,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前中", @@ -635,7 +635,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前1時30分から3時まで", @@ -661,7 +661,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前11時から3時まで", @@ -687,7 +687,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後11時から3時まで", @@ -713,7 +713,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後11時1分から11時まで", @@ -739,7 +739,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前11時1分から11時まで", @@ -765,7 +765,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前11時から11時50分まで", @@ -791,7 +791,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時30分から3時30分まで", @@ -817,7 +817,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時30分から午後3時30分まで", @@ -843,7 +843,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後3時から午後3時30分まで", @@ -869,7 +869,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前0時1分から午後1時まで", @@ -895,7 +895,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前0時1分から1時まで", @@ -921,7 +921,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "3時から3時30分まで", @@ -947,7 +947,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1時30分から3時まで", @@ -973,7 +973,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後1時30分から3時まで", @@ -999,7 +999,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11時から午後3時まで", @@ -1025,7 +1025,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11時から午前3時まで", @@ -1051,7 +1051,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時から11時まで", @@ -1077,7 +1077,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "23時から午前3時まで", @@ -1103,7 +1103,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "23時から午後3時まで", @@ -1129,7 +1129,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10時から11時30分の間", @@ -1155,7 +1155,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時10分から12時50分の間", @@ -1181,7 +1181,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後10時10分から3時の間", @@ -1207,7 +1207,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後10時10分から10時まで", @@ -1233,7 +1233,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前10時半から23時まで", @@ -1259,7 +1259,7 @@ "Context": { "ReferenceDateTime": "2017-12-01T13:37:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "営業時間内に", @@ -1285,7 +1285,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "17時55分23秒から18時33分02秒まで", @@ -1311,7 +1311,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後五時から午前三時まで", @@ -1337,7 +1337,7 @@ "Context": { "ReferenceDateTime": "2018-10-11T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "夜", @@ -1363,7 +1363,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後五時から夜七時半まで", @@ -1389,7 +1389,7 @@ "Context": { "ReferenceDateTime": "2018-10-11T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "昼", @@ -1415,7 +1415,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後五時から6時まで", @@ -1441,7 +1441,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5時から6時まで", @@ -1467,7 +1467,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "朝五時から六時まで", @@ -1493,7 +1493,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "五時半から六時まで", @@ -1519,7 +1519,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "17:55:23から18:33:02まで", @@ -1545,7 +1545,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後五時十五分から六時まで", @@ -1571,7 +1571,7 @@ "Context": { "ReferenceDateTime": "2018-10-11T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午前", @@ -1597,7 +1597,7 @@ "Context": { "ReferenceDateTime": "2018-10-11T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "午後", @@ -1623,7 +1623,7 @@ "Context": { "ReferenceDateTime": "2018-10-11T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "日中", @@ -1649,7 +1649,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "5時から午後6時まで", @@ -1675,7 +1675,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4時から25時まで", @@ -1701,7 +1701,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "4時から26時まで", @@ -1727,7 +1727,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "26時から30時まで", diff --git a/Specs/DateTime/Korean/DateTimeModel.json b/Specs/DateTime/Korean/DateTimeModel.json index 31ba5052d4..0f237f3517 100644 --- a/Specs/DateTime/Korean/DateTimeModel.json +++ b/Specs/DateTime/Korean/DateTimeModel.json @@ -1369,181 +1369,6 @@ } ] }, - { - "Input": "매주 떠날 겁니다. ", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주", - "Start": 0, - "End": 2, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "매일 떠날 겁니다. ", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일", - "Start": 0, - "End": 2, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "매년 떠날 겁니다. ", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매년", - "Start": 0, - "End": 2, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "격일로 떠날 겁니다. ", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "격일로", - "Start": 0, - "End": 3, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "3주에 한 번씩 떠날 겁니다. ", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3주에 한 번씩", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "매일 오후 3시에 떠날 겁니다. ", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 오후 3시에", - "Start": 0, - "End": 9, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "매주 월요일마다 떠날 겁니다. ", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주 월요일", - "Start": 0, - "End": 6, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "저녁 7시 56분 30초에 돌아올 겁니다. ", "Context": { @@ -2873,21 +2698,6 @@ "NotSupported": "dotnet", "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "매주", - "Start": 0, - "End": 2, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 28, @@ -2914,21 +2724,6 @@ "NotSupported": "dotnet", "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "매주", - "Start": 4, - "End": 6, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "this week", "Start": 136, @@ -8730,21 +8525,6 @@ "NotSupported": "dotnet", "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "매주 화요일", - "Start": 0, - "End": 6, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "thursday 19:00 - 21:00", "Start": 44, diff --git a/Specs/DateTime/Korean/SetExtractor.json b/Specs/DateTime/Korean/SetExtractor.json deleted file mode 100644 index 7182ae4d34..0000000000 --- a/Specs/DateTime/Korean/SetExtractor.json +++ /dev/null @@ -1,275 +0,0 @@ -[ - { - "Input": "나는 매주 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주", - "Type": "set", - "Start": 3, - "Length": 2 - } - ] - }, - { - "Input": "나는 날마다 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "날마다", - "Type": "set", - "Start": 3, - "Length": 3 - } - ] - }, - { - "Input": "나는 매일 떠날 거야.", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일", - "Type": "set", - "Start": 3, - "Length": 2 - } - ] - }, - { - "Input": "나는 매달 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매달", - "Type": "set", - "Start": 3, - "Length": 2 - } - ] - }, - { - "Input": "나는 매년 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매년", - "Type": "set", - "Start": 3, - "Length": 2 - } - ] - }, - { - "Input": "나는 이틀마다 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "이틀마다", - "Type": "set", - "Start": 3, - "Length": 4 - } - ] - }, - { - "Input": "나는 3주마다 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3주마다", - "Type": "set", - "Start": 3, - "Length": 4 - } - ] - }, - { - "Input": "나는 매일 오후 3시에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 오후 3시", - "Type": "set", - "Start": 3, - "Length": 8 - } - ] - }, - { - "Input": "나는 4월 15일마다 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "4월 15일마다", - "Type": "set", - "Start": 3, - "Length": 8 - } - ] - }, - { - "Input": "나는 매주 월요일에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주 월요일", - "Type": "set", - "Start": 3, - "Length": 6 - } - ] - }, - { - "Input": "나는 월요일 오후 4시마다 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "월요일 오후 4시마다", - "Type": "set", - "Start": 3, - "Length": 11 - } - ] - }, - { - "Input": "나는 매일 아침에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 아침", - "Type": "set", - "Start": 3, - "Length": 5 - } - ] - }, - { - "Input": "나는 매일 아침 오전 9시에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 아침 오전 9시에", - "Type": "set", - "Start": 3, - "Length": 12 - } - ] - }, - { - "Input": "나는 매일 오후 4시에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 오후 4시에", - "Type": "set", - "Start": 3, - "Length": 9 - } - ] - }, - { - "Input": "나는 매일 밤 9시에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 밤 9시에", - "Type": "set", - "Start": 3, - "Length": 8 - } - ] - }, - { - "Input": "나는 매일 아침 9시에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 아침 9시에", - "Type": "set", - "Start": 3, - "Length": 9 - } - ] - }, - { - "Input": "나는 매주 일요일 아침 9시에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주 일요일 아침 9시에", - "Type": "set", - "Start": 3, - "Length": 13 - } - ] - }, - { - "Input": "나는 매주 월요일 아침 9시에 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주 월요일 아침 9시에", - "Type": "set", - "Start": 3, - "Length": 13 - } - ] - }, - { - "Input": "나는 월요일마다 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "월요일마다", - "Type": "set", - "Start": 3, - "Length": 5 - } - ] - }, - { - "Input": "나는 일요일마다 떠날 거야. ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "일요일마다", - "Type": "set", - "Start": 3, - "Length": 5 - } - ] - }, - { - "Input": "5월 9일 이틀 밤 예약이 가능합니까? ", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "밤", - "Type": "set", - "Start": 9, - "Length": 1 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Korean/SetParser.json b/Specs/DateTime/Korean/SetParser.json deleted file mode 100644 index d65faf9bc4..0000000000 --- a/Specs/DateTime/Korean/SetParser.json +++ /dev/null @@ -1,677 +0,0 @@ -[ - { - "Input": "나는 매주 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2744475+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 11, - "Length": 6 - } - ] - }, - { - "Input": "나는 격주로 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2754476+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "격주로", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 11, - "Length": 8 - } - ] - }, - { - "Input": "나는 매일 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2779449+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 11, - "Length": 5 - } - ] - }, - { - "Input": "나는 매일 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2794445+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "나는 매달 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2829445+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매달", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "나는 일 년에 한 번 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2844439+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "일 년에 한 번 ", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 11, - "Length": 8 - } - ] - }, - { - "Input": "나는 매년 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2854444+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매년", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 11, - "Length": 6 - } - ] - }, - { - "Input": "나는 격일로 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2909444+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "격일로", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "나는 3주마다 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2959472+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3주마다", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "나는 매일 오후 3시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2989494+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 오후 3시", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "나는 매일 오후 3시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3039501+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 오후 3시", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 11, - "Length": 12 - } - ] - }, - { - "Input": "나는 4월 15일마다 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3109498+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "4월 15일마다", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 11, - "Length": 9 - } - ] - }, - { - "Input": "나는 월요일마다 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3259514+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "월요일마다", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 11, - "Length": 12 - } - ] - }, - { - "Input": "나는 월요일 오후 4시마다 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3379507+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "월요일 오후 4시마다", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 11, - "Length": 15 - } - ] - }, - { - "Input": "나는 매일 아침 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3429518+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 아침", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 11, - "Length": 13 - } - ] - }, - { - "Input": "나는 매일 아침 9시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3609535+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 아침 9시에", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 11, - "Length": 20 - } - ] - }, - { - "Input": "나는 매일 오후 4시에 떠날 거야.", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3730732+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 오후 4시에", - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - }, - "Start": 11, - "Length": 22 - } - ] - }, - { - "Input": "나는 매일 밤 9시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3840706+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 밤 9시에", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 11, - "Length": 18 - } - ] - }, - { - "Input": "나는 매일 밤 9시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3930718+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 밤 9시에", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "나는 매일 아침 9시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4065719+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 아침 9시에", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 11, - "Length": 15 - } - ] - }, - { - "Input": "나는 매일 아침 9시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4170727+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매일 아침 9시에", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "나는 매주 일요일 아침 9시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4295727+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주 일요일 아침 9시", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 16 - } - ] - }, - { - "Input": "나는 매주 일요일 아침 9시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.438575+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주 일요일 아침 9시", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 14 - } - ] - }, - { - "Input": "나는 매주 일요일 아침 9시에 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4505726+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "매주 일요일 아침 9시", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 14, - "Length": 11 - } - ] - }, - { - "Input": "나는 월요일마다 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4570731+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "월요일마다", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "나는 일요일마다 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4635727+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "일요일마다", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 11, - "Length": 10 - } - ] - }, - { - "Input": "나는 일요일마다 떠날 거야. ", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4710739+03:00" - }, - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "일요일마다", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 11, - "Length": 7 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Portuguese/DateExtractor.json b/Specs/DateTime/Portuguese/DateExtractor.json index 3c6a6910db..948d8978d0 100644 --- a/Specs/DateTime/Portuguese/DateExtractor.json +++ b/Specs/DateTime/Portuguese/DateExtractor.json @@ -714,5 +714,41 @@ "Length": 9 } ] + }, + { + "Input": "marque a reunião para 7 do 7", + "NotSupported": "javascript", + "Results": [ + { + "Text": "7 do 7", + "Type": "date", + "Start": 22, + "Length": 6 + } + ] + }, + { + "Input": "me envie um comprovante da minha compra é feita no dia 17 do 11", + "NotSupported": "javascript", + "Results": [ + { + "Text": "dia 17 do 11", + "Type": "date", + "Start": 51, + "Length": 12 + } + ] + }, + { + "Input": "minha compra feita no dia 7/7/2020", + "NotSupported": "javascript", + "Results": [ + { + "Text": "dia 7/7/2020", + "Type": "date", + "Start": 22, + "Length": 12 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Portuguese/DateParser.json b/Specs/DateTime/Portuguese/DateParser.json index 0bbc511943..52e9a5023e 100644 --- a/Specs/DateTime/Portuguese/DateParser.json +++ b/Specs/DateTime/Portuguese/DateParser.json @@ -1551,5 +1551,77 @@ "Length": 8 } ] + }, + { + "Input": "marque a reunião para 7 do 7", + "Context": { + "ReferenceDateTime": "2024-07-07T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "7 do 7", + "Type": "date", + "Value": { + "Timex": "XXXX-07-07", + "FutureResolution": { + "date": "2024-07-07" + }, + "PastResolution": { + "date": "2023-07-07" + } + }, + "Start": 23, + "Length": 5 + } + ] + }, + { + "Input": "me envie um comprovante da minha compra é feita no dia 17 do 11", + "Context": { + "ReferenceDateTime": "2024-11-17T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "dia 17 do 11", + "Type": "date", + "Value": { + "Timex": "XXXX-11-17", + "FutureResolution": { + "date": "2024-11-17" + }, + "PastResolution": { + "date": "2023-11-17" + } + }, + "Start": 52, + "Length": 11 + } + ] + }, + { + "Input": "minha compra feita no dia 7/7/2020", + "Context": { + "ReferenceDateTime": "2024-11-17T00:00:00" + }, + "NotSupported": "javascript", + "Results": [ + { + "Text": "dia 7/7/2020", + "Type": "date", + "Value": { + "Timex": "2020-07-07", + "FutureResolution": { + "date": "2020-07-07" + }, + "PastResolution": { + "date": "2020-07-07" + } + }, + "Start": 22, + "Length": 12 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Portuguese/DatePeriodExtractor.json b/Specs/DateTime/Portuguese/DatePeriodExtractor.json index 4859aaad1c..ca285f5629 100644 --- a/Specs/DateTime/Portuguese/DatePeriodExtractor.json +++ b/Specs/DateTime/Portuguese/DatePeriodExtractor.json @@ -704,5 +704,29 @@ "Length": 36 } ] + }, + { + "Input": "Mostre-me os registros de agosto de 99", + "NotSupportedByDesign": "javascript", + "Results": [ + { + "Text": "agosto de 99", + "Type": "daterange", + "Start": 26, + "Length": 12 + } + ] + }, + { + "Input": "Mostre-me os registros de agosto de '99", + "NotSupportedByDesign": "javascript", + "Results": [ + { + "Text": "agosto de '99", + "Type": "daterange", + "Start": 26, + "Length": 13 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Portuguese/DatePeriodParser.json b/Specs/DateTime/Portuguese/DatePeriodParser.json index 6a47cd7f78..37e35cb0e3 100644 --- a/Specs/DateTime/Portuguese/DatePeriodParser.json +++ b/Specs/DateTime/Portuguese/DatePeriodParser.json @@ -1342,5 +1342,51 @@ "Length": 36 } ] + }, + { + "Input": "Mostre-me os registros de agosto de 99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "agosto de 99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 26, + "Length": 12 + } + ] + }, + { + "Input": "Mostre-me os registros de agosto de '99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "agosto de '99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 26, + "Length": 13 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Portuguese/DateTimeModel.json b/Specs/DateTime/Portuguese/DateTimeModel.json index 52eb4a9e82..e36c74b4a8 100644 --- a/Specs/DateTime/Portuguese/DateTimeModel.json +++ b/Specs/DateTime/Portuguese/DateTimeModel.json @@ -1481,8 +1481,8 @@ "NotSupported": "javascript", "Results": [ { - "Text": "17/11", - "Start": 53, + "Text": "dia 17/11", + "Start": 49, "End": 57, "TypeName": "datetimeV2.date", "Resolution": { @@ -3001,6 +3001,30 @@ } ] }, + { + "Input": "reunião para 00:00", + "Context": { + "ReferenceDateTime": "2023-05-14T12:00:00" + }, + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "00:00", + "Start": 13, + "End": 17, + "TypeName": "datetimeV2.time", + "Resolution": { + "values": [ + { + "timex": "T00:00", + "type": "time", + "value": "00:00:00" + } + ] + } + } + ] + }, { "Input": "reunião para as 5 e 45", "Context": { @@ -3877,54 +3901,6 @@ } ] }, - { - "Input": "Vamos ter uma reunião trimestral.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "trimestral", - "Start": 22, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "O Conselho será informado semestralmente sobre o andamento do pedido", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "semestralmente", - "Start": 26, - "End": 39, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Eu tenho muitos ganhos neste ano letivo.", "Context": { diff --git a/Specs/DateTime/Portuguese/SetExtractor.json b/Specs/DateTime/Portuguese/SetExtractor.json deleted file mode 100644 index a626feb34a..0000000000 --- a/Specs/DateTime/Portuguese/SetExtractor.json +++ /dev/null @@ -1,242 +0,0 @@ -[ - { - "Input": "sairei semanalmente", - "NotSupported": "javascript", - "Results": [ - { - "Text": "semanalmente", - "Type": "set", - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "sairei diariamente", - "NotSupported": "javascript", - "Results": [ - { - "Text": "diariamente", - "Type": "set", - "Start": 7, - "Length": 11 - } - ] - }, - { - "Input": "saí todo dia", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todo dia", - "Type": "set", - "Start": 4, - "Length": 8 - } - ] - }, - { - "Input": "minha saída diária", - "NotSupported": "javascript", - "Results": [ - { - "Text": "diária", - "Type": "set", - "Start": 12, - "Length": 6 - } - ] - }, - { - "Input": "sairei todos os dias", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todos os dias", - "Type": "set", - "Start": 7, - "Length": 13 - } - ] - }, - { - "Input": "sairei cada mes", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada mes", - "Type": "set", - "Start": 7, - "Length": 8 - } - ] - }, - { - "Input": "sairei todos os meses", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todos os meses", - "Type": "set", - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "sairei todas as semanas", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todas as semanas", - "Type": "set", - "Start": 7, - "Length": 16 - } - ] - }, - { - "Input": "sairei mensalmente", - "NotSupported": "javascript", - "Results": [ - { - "Text": "mensalmente", - "Type": "set", - "Start": 7, - "Length": 11 - } - ] - }, - { - "Input": "sairei anualmente", - "NotSupported": "javascript", - "Results": [ - { - "Text": "anualmente", - "Type": "set", - "Start": 7, - "Length": 10 - } - ] - }, - { - "Input": "salirei todos os anos", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todos os anos", - "Type": "set", - "Start": 8, - "Length": 13 - } - ] - }, - { - "Input": "irei a cada dois dias", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada dois dias", - "Type": "set", - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "virão cada tres semanas", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada tres semanas", - "Type": "set", - "Start": 6, - "Length": 17 - } - ] - }, - { - "Input": "irei a cada 3 semanas", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada 3 semanas", - "Type": "set", - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "eu irei às 3pm todos os dias", - "NotSupported": "javascript", - "Results": [ - { - "Text": "3pm todos os dias", - "Type": "set", - "Start": 11, - "Length": 17 - } - ] - }, - { - "Input": "eu irei todos os dias as 3pm", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "todos os dias as 3pm", - "Type": "set", - "Start": 8, - "Length": 20 - } - ] - }, - { - "Input": "sairei cada 15/4", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada 15/4", - "Type": "set", - "Start": 7, - "Length": 9 - } - ] - }, - { - "Input": "sairei todos os domingos", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todos os domingos", - "Type": "set", - "Start": 7, - "Length": 17 - } - ] - }, - { - "Input": "sairei todas as segundas", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todas as segundas", - "Type": "set", - "Start": 7, - "Length": 17 - } - ] - }, - { - "Input": "sairei cada domingo as 4pm", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada domingo as 4pm", - "Type": "set", - "Start": 7, - "Length": 19 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Portuguese/SetParser.json b/Specs/DateTime/Portuguese/SetParser.json deleted file mode 100644 index 81cd30cdde..0000000000 --- a/Specs/DateTime/Portuguese/SetParser.json +++ /dev/null @@ -1,401 +0,0 @@ -[ - { - "Input": "Sairei semanalmente", - "NotSupported": "javascript", - "Results": [ - { - "Text": "semanalmente", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "Sairei quinzenalmente", - "NotSupported": "javascript", - "Results": [ - { - "Text": "quinzenalmente", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Sairei diariamente", - "NotSupported": "javascript", - "Results": [ - { - "Text": "diariamente", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 7, - "Length": 11 - } - ] - }, - { - "Input": "Minha saída diária", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "diária", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 12, - "Length": 6 - } - ] - }, - { - "Input": "Sairei todos os dias", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todos os dias", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 7, - "Length": 13 - } - ] - }, - { - "Input": "Sairei a cada mes", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada mes", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 9, - "Length": 8 - } - ] - }, - { - "Input": "Sairei todos os meses", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todos os meses", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Sairei todas as semanas", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todas as semanas", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 7, - "Length": 16 - } - ] - }, - { - "Input": "Sairei anualmente", - "NotSupported": "javascript", - "Results": [ - { - "Text": "anualmente", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 7, - "Length": 10 - } - ] - }, - { - "Input": "Sairei todos os anos", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todos os anos", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 7, - "Length": 13 - } - ] - }, - { - "Input": "Me irei a cada dois dias", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada dois dias", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 10, - "Length": 14 - } - ] - }, - { - "Input": "Me irei a cada tres semanas", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada tres semanas", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 10, - "Length": 17 - } - ] - }, - { - "Input": "Me irei a cada 3 semanas", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada 3 semanas", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 10, - "Length": 14 - } - ] - }, - { - "Input": "Vou-me às 3pm todos os dias", - "NotSupported": "javascript", - "Results": [ - { - "Text": "3pm todos os dias", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 10, - "Length": 17 - } - ] - }, - { - "Input": "Vou-me todos os dias as 3pm", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "todos os dias as 3pm", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 7, - "Length": 20 - } - ] - }, - { - "Input": "Sairei em cada 15/4", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada 15/4", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 10, - "Length": 9 - } - ] - }, - { - "Input": "Sairei todas as segundas-feiras", - "NotSupported": "javascript", - "Results": [ - { - "Text": "todas as segundas-feiras", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 7, - "Length": 24 - } - ] - }, - { - "Input": "Sairei toda segunda-feira", - "NotSupported": "javascript", - "Results": [ - { - "Text": "toda segunda-feira", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 7, - "Length": 18 - } - ] - }, - { - "Input": "Sairei cada segunda-feira as 4pm", - "NotSupported": "javascript", - "Results": [ - { - "Text": "cada segunda-feira as 4pm", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 7, - "Length": 25 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Spanish/DateExtractor.json b/Specs/DateTime/Spanish/DateExtractor.json index 2eea7681d3..abc0b831bd 100644 --- a/Specs/DateTime/Spanish/DateExtractor.json +++ b/Specs/DateTime/Spanish/DateExtractor.json @@ -671,5 +671,86 @@ "Length": 19 } ] + }, + { + "Input": "quién fue el presidente el 23 del 5 del 91", + "NotSupported": "java", + "NotSupportedByDesign": "javascript", + "Results": [ + { + "Text": "23 del 5 del 91", + "Type": "date", + "Start": 27, + "Length": 15 + } + ] + }, + { + "Input": "quién fue el presidente el 23 de 5 de 91", + "NotSupported": "java", + "NotSupportedByDesign": "javascript", + "Results": [ + { + "Text": "23 de 5 de 91", + "Type": "date", + "Start": 27, + "Length": 13 + } + ] + }, + { + "Input": "enviame un recibo por la compra hecha el 17 barra 11", + "Results": [ + { + "Text": "17 barra 11", + "Type": "date", + "Start": 41, + "Length": 11 + } + ] + }, + { + "Input": "reserva un hotel para el 21 barra 3 en el marriott", + "Results": [ + { + "Text": "21 barra 3", + "Type": "date", + "Start": 25, + "Length": 10 + } + ] + }, + { + "Input": "reserva un hotel para el veintiseis barra 6 en el marriott", + "Results": [ + { + "Text": "veintiseis barra 6", + "Type": "date", + "Start": 25, + "Length": 18 + } + ] + }, + { + "Input": "reservar el vuelo para el diecisiete barra tres", + "Results": [ + { + "Text": "diecisiete barra tres", + "Type": "date", + "Start": 26, + "Length": 21 + } + ] + }, + { + "Input": "envíame el correo del 17 barra once", + "Results": [ + { + "Text": "17 barra once", + "Type": "date", + "Start": 22, + "Length": 13 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Spanish/DateParser.json b/Specs/DateTime/Spanish/DateParser.json index f51200712f..044aca7bb2 100644 --- a/Specs/DateTime/Spanish/DateParser.json +++ b/Specs/DateTime/Spanish/DateParser.json @@ -1677,5 +1677,206 @@ "Length": 8 } ] + }, + { + "Input": "envíame un recibo por la compra hecha el 17 del 11", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "17 del 11", + "Type": "date", + "Value": { + "Timex": "XXXX-11-17", + "FutureResolution": { + "date": "2016-11-17" + }, + "PastResolution": { + "date": "2015-11-17" + } + }, + "Start": 41, + "Length": 9 + } + ] + }, + { + "Input": "reserva un hotel para el 21 del 3 en el marriott", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "21 del 3", + "Type": "date", + "Value": { + "Timex": "XXXX-03-21", + "FutureResolution": { + "date": "2017-03-21" + }, + "PastResolution": { + "date": "2016-03-21" + } + }, + "Start": 25, + "Length": 8 + } + ] + }, + { + "Input": "quién fue el presidente el 23 del 5 del 91", + "Results": [ + { + "Text": "23 del 5 del 91", + "Type": "date", + "Value": { + "Timex": "1991-05-23", + "FutureResolution": { + "date": "1991-05-23" + }, + "PastResolution": { + "date": "1991-05-23" + } + }, + "Start": 27, + "Length": 15 + } + ] + }, + { + "Input": "quién fue el presidente el 23 de 5 de 91", + "Results": [ + { + "Text": "23 de 5 de 91", + "Type": "date", + "Value": { + "Timex": "1991-05-23", + "FutureResolution": { + "date": "1991-05-23" + }, + "PastResolution": { + "date": "1991-05-23" + } + }, + "Start": 27, + "Length": 13 + } + ] + }, + { + "Input": "enviame un recibo por la compra hecha el 17 barra 11", + "Context": { + "ReferenceDateTime": "2024-04-11T00:00:00" + }, + "Results": [ + { + "Text": "17 barra 11", + "Type": "date", + "Value": { + "Timex": "XXXX-11-17", + "FutureResolution": { + "date": "2024-11-17" + }, + "PastResolution": { + "date": "2023-11-17" + } + }, + "Start": 41, + "Length": 11 + } + ] + }, + { + "Input": "reserva un hotel para el 21 barra 3 en el marriott", + "Context": { + "ReferenceDateTime": "2024-04-11T00:00:00" + }, + "Results": [ + { + "Text": "21 barra 3", + "Type": "date", + "Value": { + "Timex": "XXXX-03-21", + "FutureResolution": { + "date": "2025-03-21" + }, + "PastResolution": { + "date": "2024-03-21" + } + }, + "Start": 25, + "Length": 10 + } + ] + }, + { + "Input": "reserva un hotel para el veintiseis barra 6 en el marriott", + "Context": { + "ReferenceDateTime": "2024-04-17T00:00:00" + }, + "Results": [ + { + "Text": "veintiseis barra 6", + "Type": "date", + "Value": { + "Timex": "XXXX-06-26", + "FutureResolution": { + "date": "2024-06-26" + }, + "PastResolution": { + "date": "2023-06-26" + } + }, + "Start": 25, + "Length": 18 + } + ] + }, + { + "Input": "reservar el vuelo para el diecisiete barra tres", + "Context": { + "ReferenceDateTime": "2024-04-17T00:00:00" + }, + "Results": [ + { + "Text": "diecisiete barra tres", + "Type": "date", + "Value": { + "Timex": "XXXX-03-17", + "FutureResolution": { + "date": "2025-03-17" + }, + "PastResolution": { + "date": "2024-03-17" + } + }, + "Start": 26, + "Length": 21 + } + ] + }, + { + "Input": "envíame el correo del 17 barra once", + "Context": { + "ReferenceDateTime": "2024-04-17T00:00:00" + }, + "Results": [ + { + "Text": "17 barra once", + "Type": "date", + "Value": { + "Timex": "XXXX-11-17", + "FutureResolution": { + "date": "2024-11-17" + }, + "PastResolution": { + "date": "2023-11-17" + } + }, + "Start": 22, + "Length": 13 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Spanish/DatePeriodExtractor.json b/Specs/DateTime/Spanish/DatePeriodExtractor.json index 09a8a6e5e3..7f7f0e4d99 100644 --- a/Specs/DateTime/Spanish/DatePeriodExtractor.json +++ b/Specs/DateTime/Spanish/DatePeriodExtractor.json @@ -4691,5 +4691,29 @@ "Length": 19 } ] + }, + { + "Input": "Muéstrame los registros de agosto de 99", + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "agosto de 99", + "Type": "daterange", + "Start": 27, + "Length": 12 + } + ] + }, + { + "Input": "Muéstrame los registros de agosto de '99", + "NotSupportedByDesign": "javascript,java", + "Results": [ + { + "Text": "agosto de '99", + "Type": "daterange", + "Start": 27, + "Length": 13 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Spanish/DatePeriodParser.json b/Specs/DateTime/Spanish/DatePeriodParser.json index 37ecbbfb92..0791e63e2d 100644 --- a/Specs/DateTime/Spanish/DatePeriodParser.json +++ b/Specs/DateTime/Spanish/DatePeriodParser.json @@ -7037,5 +7037,51 @@ "Length": 15 } ] + }, + { + "Input": "Muéstrame los registros de agosto de 99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "agosto de 99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 27, + "Length": 12 + } + ] + }, + { + "Input": "Muéstrame los registros de agosto de '99", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "agosto de '99", + "Type": "daterange", + "Value": { + "Timex": "1999-08", + "FutureResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + }, + "PastResolution": { + "startDate": "1999-08-01", + "endDate": "1999-09-01" + } + }, + "Start": 27, + "Length": 13 + } + ] } ] \ No newline at end of file diff --git a/Specs/DateTime/Spanish/DateTimeModel.json b/Specs/DateTime/Spanish/DateTimeModel.json index 952961732d..17850a1754 100644 --- a/Specs/DateTime/Spanish/DateTimeModel.json +++ b/Specs/DateTime/Spanish/DateTimeModel.json @@ -2891,192 +2891,23 @@ ] }, { - "Input": "Me iré semanalmente", + "Input": "Regresaré a las 00:00", "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "semanalmente", - "Start": 7, - "End": 18, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Me iré cada día", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "cada día", - "Start": 7, - "End": 14, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Me iré anualmente", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "anualmente", - "Start": 7, - "End": 16, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Me iré cada dos días", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "cada dos días", - "Start": 7, - "End": 19, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Me iré cada tres semanas", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "cada tres semanas", - "Start": 7, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Me iré a las tres de la tarde cada día", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Comment": "MERGE Merge sub-entities for consistency with English.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "tres de la tarde cada día", - "Start": 13, - "End": 37, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Me iré todos los lunes", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "todos los lunes", - "Start": 7, - "End": 21, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Me iré cada lunes a las 4 p.m.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" + "ReferenceDateTime": "2023-11-07T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { - "Text": "cada lunes a las 4 p.m.", - "Start": 7, - "End": 29, - "TypeName": "datetimeV2.set", + "Text": "00:00", + "Start": 16, + "End": 20, + "TypeName": "datetimeV2.time", "Resolution": { "values": [ { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" + "timex": "T00:00", + "type": "time", + "value": "00:00:00" } ] } @@ -4503,21 +4334,6 @@ }, "NotSupported": "javascript, python, java", "Results": [ - { - "Text": "cada semana", - "Start": 0, - "End": 10, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "esta semana", "Start": 24, @@ -4543,21 +4359,6 @@ }, "NotSupported": "javascript, python, java", "Results": [ - { - "Text": "cada semana", - "Start": 75, - "End": 85, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "esta semana", "Start": 203, @@ -11586,7 +11387,7 @@ "Context": { "ReferenceDateTime": "2019-01-25T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "lunes 21", @@ -11615,7 +11416,7 @@ "Context": { "ReferenceDateTime": "2019-01-21T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "lunes 21", @@ -11639,7 +11440,7 @@ "Context": { "ReferenceDateTime": "2019-01-25T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "domingo 31", @@ -11668,7 +11469,7 @@ "Context": { "ReferenceDateTime": "2019-02-25T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "viernes 31", @@ -11692,6 +11493,35 @@ } ] }, + { + "Input": "¿Tienes algún arreglo para el sábado 30?", + "Context": { + "ReferenceDateTime": "2023-07-05T12:00:00" + }, + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "sábado 30", + "Start": 30, + "End": 38, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "XXXX-WXX-6", + "type": "date", + "value": "2022-07-30" + }, + { + "timex": "XXXX-WXX-6", + "type": "date", + "value": "2023-09-30" + } + ] + } + } + ] + }, { "Input": "¿Tienes algún plan después de medianos de mayo?", "Context": { @@ -12233,21 +12063,6 @@ }, "NotSupported": "javascript, python, java", "Results": [ - { - "Text": "todos los martes", - "Start": 29, - "End": 44, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "jueves de 19:00 a 21:00", "Start": 48, @@ -16120,56 +15935,6 @@ } ] }, - { - "Input": "Nos vemos una vez a la semana", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Comment": "SETREF. Set implementation to be refined.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "una vez a la semana", - "Start": 10, - "End": 28, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Voy de vacaciones una vez al año", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Comment": "SETREF. Set implementation to be refined.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "una vez al año", - "Start": 18, - "End": 31, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "La solicitud es ABC-12345-A1B2C3 este turno. Organicemos una llamada de 30 minutos esta semana. Esperamos volver a hablar esta semana.", "Context": { @@ -16657,55 +16422,6 @@ } ] }, - { - "Input": "Cada dos viernes", - "Context": { - "ReferenceDateTime": "2019-11-25T17:00:00" - }, - "Comment": "SETREF. Set implementation to be refined.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "cada dos viernes", - "Start": 0, - "End": 15, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-5", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Tengamos una reunión trimestral.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "trimestral", - "Start": 21, - "End": 30, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "t1 y t2 podrían ser cualquier año", "Context": { @@ -18037,31 +17753,6 @@ } ] }, - { - "Input": "Jueves a las 17.30 hora de Beijing", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "Comment": "SPLIT/MERGE", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "jueves a las 17.30", - "Start": 0, - "End": 17, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-4T17:30", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "13 de junio, que también se conoce como Día de la Libertad y Día del Jubileo, se remonta a 1865, y se observa el 19 de junio de cada año.", "Context": { @@ -18165,21 +17856,6 @@ } ] } - }, - { - "Text": "cada año", - "Start": 128, - "End": 135, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } } ] }, @@ -18252,54 +17928,6 @@ } ] }, - { - "Input": "Por favor programe una reunión semestralmente", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "semestralmente", - "Start": 31, - "End": 44, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Por favor programe una reunión semestral", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "semestral", - "Start": 31, - "End": 39, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Por favor programe una reunión con todos la próxima semana", "Context": { @@ -18325,31 +17953,6 @@ } ] }, - { - "Input": "Asegurémonos de que eso suceda todos los días laborables", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "Comment": "WORKDAYS", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "todos los días laborables", - "Start": 31, - "End": 55, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "¿Por qué no pides un permiso el resto de la semana?", "Context": { @@ -18375,55 +17978,6 @@ } ] }, - { - "Input": "Casi se trata de la hora de la revisión anual", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "anual", - "Start": 40, - "End": 44, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "las leyes y regulaciones requieren informes financieros cada trimestre", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "Comment": "SETREF. Set implementation to be refined.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "cada trimestre", - "Start": 56, - "End": 69, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3M", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "4 de julio está a la vuelta de la esquina", "Context": { @@ -18460,21 +18014,6 @@ }, "NotSupported": "javascript, python, java", "Results": [ - { - "Text": "bimensuales", - "Start": 15, - "End": 25, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2M", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "el verano", "Start": 50, @@ -18492,54 +18031,6 @@ } ] }, - { - "Input": "¿Haces eso cada finde?", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "cada finde", - "Start": 11, - "End": 20, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "cada dos fines de semana", - "Context": { - "ReferenceDateTime": "2020-06-12T00:00:00" - }, - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "cada dos fines de semana", - "Start": 0, - "End": 23, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2WE", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "el curso dura tres fines de semana", "Context": { @@ -18861,31 +18352,6 @@ } ] }, - { - "Input": "Agrega reunión con el jefe a mi calendario los martes a las 9 a.m.", - "Context": { - "ReferenceDateTime": "2020-06-16T12:00:00" - }, - "Comment": "SETREF. Set implementation to be refined.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "martes a las 9 a.m.", - "Start": 47, - "End": 65, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2T09", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "¡nos vemos esta noche, cariño!", "Context": { @@ -22448,30 +21914,6 @@ } ] }, - { - "Input": "Se informará a la Junta semestralmente de los avances en la aplicación", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "semestralmente", - "Start": 24, - "End": 37, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P0.5Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Tengo muchas ganancias en este escolar año.", "Context": { diff --git a/Specs/DateTime/Spanish/SetExtractor.json b/Specs/DateTime/Spanish/SetExtractor.json deleted file mode 100644 index 17d9c6ce74..0000000000 --- a/Specs/DateTime/Spanish/SetExtractor.json +++ /dev/null @@ -1,200 +0,0 @@ -[ - { - "Input": "saldré semanalmente", - "Results": [ - { - "Text": "semanalmente", - "Type": "set", - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "saltré diariamente", - "Results": [ - { - "Text": "diariamente", - "Type": "set", - "Start": 7, - "Length": 11 - } - ] - }, - { - "Input": "saltré a diario", - "Results": [ - { - "Text": "a diario", - "Type": "set", - "Start": 7, - "Length": 8 - } - ] - }, - { - "Input": "saldré todos los dias", - "Results": [ - { - "Text": "todos los dias", - "Type": "set", - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "saldré cada mes", - "Results": [ - { - "Text": "cada mes", - "Type": "set", - "Start": 7, - "Length": 8 - } - ] - }, - { - "Input": "saldré todos los meses", - "Results": [ - { - "Text": "todos los meses", - "Type": "set", - "Start": 7, - "Length": 15 - } - ] - }, - { - "Input": "saldré todos las semanas", - "Results": [ - { - "Text": "todos las semanas", - "Type": "set", - "Start": 7, - "Length": 17 - } - ] - }, - { - "Input": "saldré mensualmente", - "Results": [ - { - "Text": "mensualmente", - "Type": "set", - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "saldré anualmente", - "Results": [ - { - "Text": "anualmente", - "Type": "set", - "Start": 7, - "Length": 10 - } - ] - }, - { - "Input": "saldré todos los años", - "Results": [ - { - "Text": "todos los años", - "Type": "set", - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "me iré cada dos dias", - "Results": [ - { - "Text": "cada dos dias", - "Type": "set", - "Start": 7, - "Length": 13 - } - ] - }, - { - "Input": "me iré cada tres semanas", - "Results": [ - { - "Text": "cada tres semanas", - "Type": "set", - "Start": 7, - "Length": 17 - } - ] - }, - { - "Input": "me iré cada 3 semanas", - "Results": [ - { - "Text": "cada 3 semanas", - "Type": "set", - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "me iré a las 3pm todos los dias", - "Results": [ - { - "Text": "3pm todos los dias", - "Type": "set", - "Start": 13, - "Length": 18 - } - ] - }, - { - "Input": "me iré todos los dias a las 3pm", - "Results": [ - { - "Text": "todos los dias a las 3pm", - "Type": "set", - "Start": 7, - "Length": 24 - } - ] - }, - { - "Input": "saldré cada 15/4", - "Results": [ - { - "Text": "cada 15/4", - "Type": "set", - "Start": 7, - "Length": 9 - } - ] - }, - { - "Input": "saldré todos los lunes", - "Results": [ - { - "Text": "todos los lunes", - "Type": "set", - "Start": 7, - "Length": 15 - } - ] - }, - { - "Input": "saldré cada lunes a las 4pm", - "Results": [ - { - "Text": "cada lunes a las 4pm", - "Type": "set", - "Start": 7, - "Length": 20 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Spanish/SetParser.json b/Specs/DateTime/Spanish/SetParser.json deleted file mode 100644 index 7e568d1816..0000000000 --- a/Specs/DateTime/Spanish/SetParser.json +++ /dev/null @@ -1,362 +0,0 @@ -[ - { - "Input": "Saldré semanalmente", - "Results": [ - { - "Text": "semanalmente", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 7, - "Length": 12 - } - ] - }, - { - "Input": "Saldré quincenalmente", - "Results": [ - { - "Text": "quincenalmente", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Saldré diariamente", - "Results": [ - { - "Text": "diariamente", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 7, - "Length": 11 - } - ] - }, - { - "Input": "Saldré a diario", - "Results": [ - { - "Text": "a diario", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 7, - "Length": 8 - } - ] - }, - { - "Input": "Saldré todos los dias", - "Results": [ - { - "Text": "todos los dias", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Saldré cada mes", - "Results": [ - { - "Text": "cada mes", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 7, - "Length": 8 - } - ] - }, - { - "Input": "Saldré todos los meses", - "Results": [ - { - "Text": "todos los meses", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 7, - "Length": 15 - } - ] - }, - { - "Input": "Saldré todas las semanas", - "Results": [ - { - "Text": "todas las semanas", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 7, - "Length": 17 - } - ] - }, - { - "Input": "Saldré anualmente", - "Results": [ - { - "Text": "anualmente", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 7, - "Length": 10 - } - ] - }, - { - "Input": "Saldré todos los años", - "Results": [ - { - "Text": "todos los años", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Me iré cada dos dias", - "Results": [ - { - "Text": "cada dos dias", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 7, - "Length": 13 - } - ] - }, - { - "Input": "Me iré cada tres semanas", - "Results": [ - { - "Text": "cada tres semanas", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 7, - "Length": 17 - } - ] - }, - { - "Input": "Me iré cada 3 semanas", - "Results": [ - { - "Text": "cada 3 semanas", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 7, - "Length": 14 - } - ] - }, - { - "Input": "Me iré a las 3pm todos los dias", - "Results": [ - { - "Text": "3pm todos los dias", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 13, - "Length": 18 - } - ] - }, - { - "Input": "Me iré todos los dias a las 3pm", - "Results": [ - { - "Text": "todos los dias a las 3pm", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 7, - "Length": 24 - } - ] - }, - { - "Input": "Saldré cada 15/4", - "Results": [ - { - "Text": "cada 15/4", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 7, - "Length": 9 - } - ] - }, - { - "Input": "Saldré todos los lunes", - "Results": [ - { - "Text": "todos los lunes", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 7, - "Length": 15 - } - ] - }, - { - "Input": "Saldré cada lunes a las 4pm", - "Results": [ - { - "Text": "cada lunes a las 4pm", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 7, - "Length": 20 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Swedish/TimeZoneExtractor.json b/Specs/DateTime/Swedish/TimeZoneExtractor.json deleted file mode 100644 index cc82145bd7..0000000000 --- a/Specs/DateTime/Swedish/TimeZoneExtractor.json +++ /dev/null @@ -1,358 +0,0 @@ -[ - { - "Input": "Boka ett rum åt mig Afghansk tid", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Afghansk tid", - "Type": "timezone", - "Start": 20, - "Length": 12 - } - ] - }, - { - "Input": "Jag befinner mig i Amerikansk-Stillahavs normaltid", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Amerikansk-Stillahavs normaltid", - "Type": "timezone", - "Start": 19, - "Length": 31 - } - ] - }, - { - "Input": "Jag befinner mig i Aqtöbe/Aktiubinsk tid", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "aqtöbe/aktiubinsk tid", - "Type": "timezone", - "Start": 19, - "Length": 21 - } - ] - }, - { - "Input": "Klockan är 13:00 Östamerikansk sommartid", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "östamerikansk sommartid", - "Type": "timezone", - "Start": 17, - "Length": 23 - } - ] - }, - { - "Input": "Book me a room at beijing time", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "beijing time", - "Type": "timezone", - "Start": 18, - "Length": 12 - } - ] - }, - { - "Input": "Book me a room at utc4:30", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "utc4:30", - "Type": "timezone", - "Start": 18, - "Length": 7 - } - ] - }, - { - "Input": "Book me a room at gmt-3", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "gmt-3", - "Type": "timezone", - "Start": 18, - "Length": 5 - } - ] - }, - { - "Input": "Book me a room at afghanistan standard time", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "afghanistan standard time", - "Type": "timezone", - "Start": 18, - "Length": 25 - } - ] - }, - { - "Input": "Book me a room at aft", - "NotSupportedByDesign": "javascript, python, java", - "Comment": "Test to ensure default (English) implementation works", - "Results": [ - { - "Text": "aft", - "Type": "timezone", - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at beijing-time", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "beijing-time", - "Type": "timezone", - "Start": 18, - "Length": 12 - } - ] - }, - { - "Input": "Book me a room at St. Louis-time", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "St. Louis-time", - "Type": "timezone", - "Start": 18, - "Length": 14 - } - ] - }, - { - "Input": "Book me a room at San José Time", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "San José Time", - "Type": "timezone", - "Start": 18, - "Length": 13 - } - ] - }, - { - "Input": "For me, Christchurch Time, Colchester-time or Edinburgh time is OK.", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Christchurch Time", - "Type": "timezone", - "Start": 8, - "Length": 17 - }, - { - "Text": "Colchester-time", - "Type": "timezone", - "Start": 27, - "Length": 15 - }, - { - "Text": "Edinburgh time", - "Type": "timezone", - "Start": 46, - "Length": 14 - } - ] - }, - { - "Input": "Cortana will email you to find a time which works in the Sydney timezone.", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Sydney timezone", - "Type": "timezone", - "Start": 57, - "Length": 15 - } - ] - }, - { - "Input": "Cortana will email you to find a time which works in the Montréal time.", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Montréal time", - "Type": "timezone", - "Start": 57, - "Length": 13 - } - ] - }, - { - "Input": "Cortana will email you to find a time which works in the Montreal time.", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Montreal time", - "Type": "timezone", - "Start": 57, - "Length": 13 - } - ] - }, - { - "Input": "Book me a room at pt", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "pt", - "Type": "timezone", - "Start": 18, - "Length": 2 - } - ] - }, - { - "Input": "Book me a room at et", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "et", - "Type": "timezone", - "Start": 18, - "Length": 2 - } - ] - }, - { - "Input": "let's meet Saint Barthélemy time", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Saint Barthélemy time", - "Type": "timezone", - "Start": 11, - "Length": 21 - } - ] - }, - { - "Input": "let's meet saint barthelemy timezone", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "saint barthelemy timezone", - "Type": "timezone", - "Start": 11, - "Length": 25 - } - ] - }, - { - "Input": "It is the outcome of the vote that counts.", - "Comment": "This case is to verify that the utc substring won't be extracted from the word outcome.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - }, - { - "Input": "Show me times at Lincoln Square", - "Comment": "This case is to verify that the 'me time' substring won't be extracted from the 'me times'.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - }, - { - "Input": "I said New York time, not York time", - "Comment": "Extract longest item when there are some overlap items", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "New York time", - "Type": "timezone", - "Start": 7, - "Length": 13 - }, - { - "Text": "York time", - "Type": "timezone", - "Start": 26, - "Length": 9 - } - ] - }, - { - "Input": "I'm in the pacific timezone", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "pacific timezone", - "Type": "timezone", - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "Let's meet at 1pm mountain timezone", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "mountain timezone", - "Type": "timezone", - "Start": 18, - "Length": 17 - } - ] - }, - { - "Input": "It's 1pm Eastern Daylight Time", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "eastern daylight time", - "Type": "timezone", - "Start": 9, - "Length": 21 - } - ] - }, - { - "Input": "It's about 1pm ACDT", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "acdt", - "Type": "timezone", - "Start": 15, - "Length": 4 - } - ] - }, - { - "Input": "Once upon a time...", - "Comment": "Test to ensure default (English) implementation works", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Swedish/TimeZoneParser.json b/Specs/DateTime/Swedish/TimeZoneParser.json deleted file mode 100644 index 9db667df70..0000000000 --- a/Specs/DateTime/Swedish/TimeZoneParser.json +++ /dev/null @@ -1,1131 +0,0 @@ -[ - { - "Input": "Boka ett rum åt mig afghansk tid", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "afghansk tid", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 20, - "Length": 12 - } - ] - }, - { - "Input": "Boka ett rum åt mig amazonsk sommartid", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "amazonsk sommartid", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-03:00", - "UtcOffsetMins": -180 - } - }, - "Start": 20, - "Length": 18 - } - ] - }, - { - "Input": "Boka ett rum åt mig acretid", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "acretid", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 20, - "Length": 7 - } - ] - }, - { - "Input": "Boka ett rum åt mig central västaustralisk normaltid", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "central västaustralisk normaltid", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:45", - "UtcOffsetMins": 525 - } - }, - "Start": 20, - "Length": 32 - } - ] - }, - { - "Input": "Boka ett rum åt mig beijingtid", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "beijingtid", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 20, - "Length": 10 - } - ] - }, - { - "Input": "Book me a room at beijing time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "beijing time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 18, - "Length": 12 - } - ] - }, - { - "Input": "Book me a room at utc4:30", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "utc4:30", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 18, - "Length": 7 - } - ] - }, - { - "Input": "Book me a room at gmt-3", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "gmt-3", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-03:00", - "UtcOffsetMins": -180 - } - }, - "Start": 18, - "Length": 5 - } - ] - }, - { - "Input": "Book me a room at afghanistan standard time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "afghanistan standard time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 18, - "Length": 25 - } - ] - }, - { - "Input": "Book me a room at aft", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "aft", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:30", - "UtcOffsetMins": 270 - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at utc±0", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "utc±0", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+00:00", - "UtcOffsetMins": 0 - } - }, - "Start": 18, - "Length": 5 - } - ] - }, - { - "Input": "Book me a room at pdst", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "pdst", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 18, - "Length": 4 - } - ] - }, - { - "Input": "Book me a room at awdt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "awdt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 18, - "Length": 4 - } - ] - }, - { - "Input": "Book me a room at cot", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "cot", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at hkt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "hkt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at pacific daylight saving time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "pacific daylight saving time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 18, - "Length": 28 - } - ] - }, - { - "Input": "Book me a room at austrialian western daylight time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "austrialian western daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 18, - "Length": 33 - } - ] - }, - { - "Input": "Book me a room at australian western daylight time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "australian western daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 18, - "Length": 32 - } - ] - }, - { - "Input": "Book me a room at australian west daylight time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "australian west daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+09:00", - "UtcOffsetMins": 540 - } - }, - "Start": 18, - "Length": 29 - } - ] - }, - { - "Input": "Book me a room at colombia time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "colombia time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-05:00", - "UtcOffsetMins": -300 - } - }, - "Start": 18, - "Length": 13 - } - ] - }, - { - "Input": "Book me a room at hong kong time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "hong kong time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+08:00", - "UtcOffsetMins": 480 - } - }, - "Start": 18, - "Length": 14 - } - ] - }, - { - "Input": "Book me a room at aedt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "aedt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+11:00", - "UtcOffsetMins": 660 - } - }, - "Start": 18, - "Length": 4 - } - ] - }, - { - "Input": "Book me a room at pdt", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "pdt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at tost", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "tost", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+14:00", - "UtcOffsetMins": 840 - } - }, - "Start": 18, - "Length": 4 - } - ] - }, - { - "Input": "Book me a room at pacific daylight time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "pacific daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 18, - "Length": 21 - } - ] - }, - { - "Input": "Book me a room at 10:30am montreal time.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "montreal time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 26, - "Length": 13 - } - ] - }, - { - "Input": "Book me a room at Saint Barthélemy time.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Saint Barthélemy time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 18, - "Length": 21 - } - ] - }, - { - "Input": "Book me a room at 16:30 WET.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "WET", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+00:00", - "UtcOffsetMins": 0 - } - }, - "Start": 24, - "Length": 3 - } - ] - }, - { - "Input": "Book me a room at 16:30 Central Europe Std Time.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Central Europe Std Time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+01:00", - "UtcOffsetMins": 60 - } - }, - "Start": 24, - "Length": 23 - } - ] - }, - { - "Input": "We can do either New York time or Sao Paulo time.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "New York time", - "Start": 17, - "Length": 13, - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - } - }, - { - "Text": "Sao Paulo time", - "Start": 34, - "Length": 14, - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - } - } - ] - }, - { - "Input": "Make sure to accommodate west coast timezone.", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "west coast timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 25, - "Length": 19 - } - ] - }, - { - "Input": "tonight at 6PM CDT time", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "CDT", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": "-10000" - } - }, - "Start": 15, - "Length": 3 - } - ] - }, - { - "Input": "Please schedule 30 minute teams call during central time business hours", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "Comment": "Central by default resolves to standard time, not daylight. Returning both options is in the roadmap.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "central time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-06:00", - "UtcOffsetMins": -360 - } - }, - "Start": 44, - "Length": 12 - } - ] - }, - { - "Input": "I’m open at 11:30 AMPDT/1:30CST today", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupported": "dotnet, javascript, java, python", - "Results": [ - { - "Text": "PDT", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-07:00", - "UtcOffsetMins": -420 - } - }, - "Start": 20, - "Length": 3 - }, - { - "Text": "CST", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 28, - "Length": 3 - } - ] - }, - { - "Input": "I'm in the pacific timezone", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "pacific timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "value": "UTC-08:00", - "utcOffsetMins": "-480" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "Let's meet at 1pm mountain timezone", - "NotSupportedByDesign": "javascript, python, java", - "Comment": "Mountain by default resolves to standard time, not daylight. Returning both options is in the roadmap.", - "Results": [ - { - "Text": "mountain timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "-420", - "value": "UTC-07:00" - } - }, - "Start": 18, - "Length": 17 - } - ] - }, - { - "Input": "I'm in the Madrid time", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Madrid time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 11, - "Length": 11 - } - ] - }, - { - "Input": "I'm in the Madrid timezone", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Madrid timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 11, - "Length": 15 - } - ] - }, - { - "Input": "I'm in the Madrid timezone", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "Madrid timezone", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "60", - "value": "UTC+01:00" - } - }, - "Start": 11, - "Length": 16 - } - ] - }, - { - "Input": "I'm in Madrid.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - }, - { - "Input": "I'm on Russia time zone 3", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "russia time zone 3", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "240", - "value": "UTC+04:00" - } - }, - "Start": 7, - "Length": 18 - } - ] - }, - { - "Input": "All times in central standard time (mexico)", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "central standard time (mexico)", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "-360", - "value": "UTC-06:00" - } - }, - "Start": 13, - "Length": 30 - } - ] - }, - { - "Input": "I'm on Russia time zone 10", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "russia time zone 10", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "660", - "value": "UTC+11:00" - } - }, - "Start": 7, - "Length": 19 - } - ] - }, - { - "Input": "I'm at MSK+7, not MSK", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "MSK+7", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "600", - "value": "UTC+10:00" - } - }, - "Start": 7, - "Length": 5 - }, - { - "Text": "MSK", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "180", - "value": "UTC+03:00" - } - }, - "Start": 18, - "Length": 3 - } - ] - }, - { - "Input": "I'm at MSK-1.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "MSK-1", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "utcOffsetMins": "120", - "value": "UTC+02:00" - } - }, - "Start": 7, - "Length": 5 - } - ] - }, - { - "Input": "Book me a room at UTC + 4", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "utc + 4", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+04:00", - "UtcOffsetMins": 240 - } - }, - "Start": 18, - "Length": 7 - } - ] - }, - { - "Input": "Book me a room at UTC -4", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "UTC -4", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-04:00", - "UtcOffsetMins": -240 - } - }, - "Start": 18, - "Length": 6 - } - ] - }, - { - "Input": "I'm at Eastern Daylight Time", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "eastern daylight time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 7, - "Length": 21 - } - ] - }, - { - "Input": "I'm at Central Daylight Time", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "central daylight Time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 7, - "Length": 21 - } - ] - }, - { - "Input": "It's about 1pm ACDT", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "acdt", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+10:30", - "UtcOffsetMins": 630 - } - }, - "Start": 15, - "Length": 4 - } - ] - }, - { - "Input": "Kiribati's Line Islands is in UTC+14", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "utc+14", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+14:00", - "UtcOffsetMins": 840 - } - }, - "Start": 30, - "Length": 6 - } - ] - }, - { - "Input": "All deadlines are 11.59 pm UTC -12h (\"anywhere on Earth / AoE\")", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "UTC -12h", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 27, - "Length": 8 - }, - { - "Text": "anywhere on earth", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 38, - "Length": 17 - }, - { - "Text": "aoe", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC-12:00", - "UtcOffsetMins": -720 - } - }, - "Start": 58, - "Length": 3 - } - ] - }, - { - "Input": "Don't forget we're in UK time", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "uk time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 22, - "Length": 7 - } - ] - }, - { - "Input": "Can you find a slot in a US-friendly time?", - "NotSupported": "javascript,python,java", - "Results": [ - { - "Text": "US-friendly time", - "Type": "timezone", - "Value": { - "TimeZoneResolution": { - "Value": "UTC+XX:XX", - "UtcOffsetMins": -10000 - } - }, - "Start": 25, - "Length": 16 - } - ] - } -] diff --git a/Specs/DateTime/Turkish/DateTimeModel.json b/Specs/DateTime/Turkish/DateTimeModel.json index b28ebd7c34..130b8631ae 100644 --- a/Specs/DateTime/Turkish/DateTimeModel.json +++ b/Specs/DateTime/Turkish/DateTimeModel.json @@ -1323,198 +1323,6 @@ } ] }, - { - "Input": "Haftalık ayrılacağım", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "haftalık", - "Start": 0, - "End": 7, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Her gün ayrılacağım", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "her gün", - "Start": 0, - "End": 6, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Yıllık ayrılacağım", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yıllık", - "Start": 0, - "End": 5, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1Y", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Her iki gün ayrılacağım", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "her iki gün", - "Start": 0, - "End": 10, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P2D", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Her üç hafta ayrılacağım", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "her üç hafta", - "Start": 0, - "End": 11, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P3W", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Her gün öğleden sonra 3'te ayrılacağım", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "her gün öğleden sonra 3", - "Start": 0, - "End": 22, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "T15", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Her Pazartesi ayrılacağım", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "her pazartesi", - "Start": 0, - "End": 12, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, - { - "Input": "Her Pazartesi saat 16'da ayrılacağım", - "Context": { - "ReferenceDateTime": "2016-11-07T00:00:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "her pazartesi saat 16", - "Start": 0, - "End": 20, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-1T16", - "type": "set", - "value": "not resolved" - } - ] - } - } - ] - }, { "Input": "Saat yedi buçuk", "Context": { @@ -2669,21 +2477,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "her hafta", - "Start": 0, - "End": 8, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "bu hafta", "Start": 13, @@ -2709,21 +2502,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "her hafta", - "Start": 8, - "End": 16, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "bu haftaki", "Start": 126, @@ -8657,21 +8435,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "her salı", - "Start": 0, - "End": 7, - "TypeName": "datetimeV2.set", - "Resolution": { - "values": [ - { - "timex": "XXXX-WXX-2", - "type": "set", - "value": "not resolved" - } - ] - } - }, { "Text": "perşembe 19:00 - 21:00", "Start": 12, diff --git a/Specs/DateTime/Turkish/MergedParser.json b/Specs/DateTime/Turkish/MergedParser.json index 6c3e619d70..9d9a8f319b 100644 --- a/Specs/DateTime/Turkish/MergedParser.json +++ b/Specs/DateTime/Turkish/MergedParser.json @@ -707,21 +707,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "her hafta", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1W", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 0, - "Length": 9 - }, { "Text": "sabah 8", "Type": "datetimeV2.time", @@ -746,21 +731,6 @@ }, "NotSupportedByDesign": "javascript,python,java", "Results": [ - { - "Text": "Her ayın", - "Type": "datetimeV2.set", - "Value": { - "values": [ - { - "timex": "P1M", - "type": "set", - "value": "not resolved" - } - ] - }, - "Start": 0, - "Length": 8 - }, { "Text": "ikinci Cumartesi", "Type": "datetimeV2.date", diff --git a/Specs/DateTime/Turkish/SetExtractor.json b/Specs/DateTime/Turkish/SetExtractor.json deleted file mode 100644 index 89a4cd5259..0000000000 --- a/Specs/DateTime/Turkish/SetExtractor.json +++ /dev/null @@ -1,266 +0,0 @@ -[ - { - "Input": "Haftalık ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Haftalık", - "Type": "set", - "Start": 0, - "Length": 8 - } - ] - }, - { - "Input": "Günlük ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Günlük", - "Type": "set", - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "Her gün ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her gün", - "Type": "set", - "Start": 0, - "Length": 7 - } - ] - }, - { - "Input": "Her ay ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her ay", - "Type": "set", - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "Yıllık ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Yıllık", - "Type": "set", - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "Her iki gün ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her iki gün", - "Type": "set", - "Start": 0, - "Length": 11 - } - ] - }, - { - "Input": "Her üç hafta ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her üç hafta", - "Type": "set", - "Start": 0, - "Length": 12 - } - ] - }, - { - "Input": "Her gün saat 15'te ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her gün saat 15", - "Type": "set", - "Start": 0, - "Length": 15 - } - ] - }, - { - "Input": "Her 15/4'te ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her 15/4", - "Type": "set", - "Start": 0, - "Length": 8 - } - ] - }, - { - "Input": "Her Pazartesi ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her Pazartesi", - "Type": "set", - "Start": 0, - "Length": 13 - } - ] - }, - { - "Input": "Her Pazartesi saat 16'da ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her Pazartesi saat 16", - "Type": "set", - "Start": 0, - "Length": 21 - } - ] - }, - { - "Input": "Her sabah ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her sabah", - "Type": "set", - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "Her sabah saat 9'da ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her sabah saat 9", - "Type": "set", - "Start": 0, - "Length": 16 - } - ] - }, - { - "Input": "Her öğleden sonra saat 16'da ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her öğleden sonra saat 16", - "Type": "set", - "Start": 0, - "Length": 25 - } - ] - }, - { - "Input": "Her gece saat 21'de ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her gece saat 21", - "Type": "set", - "Start": 0, - "Length": 16 - } - ] - }, - { - "Input": "Her gece 21'de ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her gece 21", - "Type": "set", - "Start": 0, - "Length": 11 - } - ] - }, - { - "Input": "Sabahları saat 9'da ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Sabahları saat 9", - "Type": "set", - "Start": 0, - "Length": 16 - } - ] - }, - { - "Input": "Her Pazar saat 9'da ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her Pazar saat 9", - "Type": "set", - "Start": 0, - "Length": 16 - } - ] - }, - { - "Input": "Pazartesileri saat 9'da ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazartesileri saat 9", - "Type": "set", - "Start": 0, - "Length": 20 - } - ] - }, - { - "Input": "Pazartesi günleri ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazartesi günleri", - "Type": "set", - "Start": 0, - "Length": 17 - } - ] - }, - { - "Input": "Pazar günleri ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazar günleri", - "Type": "set", - "Start": 0, - "Length": 13 - } - ] - }, - { - "Input": "Pazarları ayrılacağım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazarları", - "Type": "set", - "Start": 0, - "Length": 9 - } - ] - } -] \ No newline at end of file diff --git a/Specs/DateTime/Turkish/SetParser.json b/Specs/DateTime/Turkish/SetParser.json deleted file mode 100644 index 0d4b79d703..0000000000 --- a/Specs/DateTime/Turkish/SetParser.json +++ /dev/null @@ -1,602 +0,0 @@ -[ - { - "Input": "Haftalık ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2744475+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Haftalık", - "Type": "set", - "Value": { - "Timex": "P1W", - "FutureResolution": { - "set": "Set: P1W" - }, - "PastResolution": { - "set": "Set: P1W" - } - }, - "Start": 0, - "Length": 8 - } - ] - }, - { - "Input": "iki haftada bir ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2754476+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iki haftada bir", - "Type": "set", - "Value": { - "Timex": "P2W", - "FutureResolution": { - "set": "Set: P2W" - }, - "PastResolution": { - "set": "Set: P2W" - } - }, - "Start": 0, - "Length": 15 - } - ] - }, - { - "Input": "Günlük ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2779449+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Günlük", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "Her gün ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2794445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her gün", - "Type": "set", - "Value": { - "Timex": "P1D", - "FutureResolution": { - "set": "Set: P1D" - }, - "PastResolution": { - "set": "Set: P1D" - } - }, - "Start": 0, - "Length": 7 - } - ] - }, - { - "Input": "Her ay ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2829445+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her ay", - "Type": "set", - "Value": { - "Timex": "P1M", - "FutureResolution": { - "set": "Set: P1M" - }, - "PastResolution": { - "set": "Set: P1M" - } - }, - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "Yıllık ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2844439+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Yıllık", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 0, - "Length": 6 - } - ] - }, - { - "Input": "Senelik ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2854444+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Senelik", - "Type": "set", - "Value": { - "Timex": "P1Y", - "FutureResolution": { - "set": "Set: P1Y" - }, - "PastResolution": { - "set": "Set: P1Y" - } - }, - "Start": 0, - "Length": 7 - } - ] - }, - { - "Input": "Her iki gün ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2909444+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her iki gün", - "Type": "set", - "Value": { - "Timex": "P2D", - "FutureResolution": { - "set": "Set: P2D" - }, - "PastResolution": { - "set": "Set: P2D" - } - }, - "Start": 0, - "Length": 11 - } - ] - }, - { - "Input": "Her üç hafta ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.2959472+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her üç hafta", - "Type": "set", - "Value": { - "Timex": "P3W", - "FutureResolution": { - "set": "Set: P3W" - }, - "PastResolution": { - "set": "Set: P3W" - } - }, - "Start": 0, - "Length": 12 - } - ] - }, - { - "Input": "Her gün saat 15'te ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3039501+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her gün saat 15", - "Type": "set", - "Value": { - "Timex": "T15", - "FutureResolution": { - "set": "Set: T15" - }, - "PastResolution": { - "set": "Set: T15" - } - }, - "Start": 0, - "Length": 15 - } - ] - }, - { - "Input": "Her 15/4'te ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3109498+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her 15/4", - "Type": "set", - "Value": { - "Timex": "XXXX-04-15", - "FutureResolution": { - "set": "Set: XXXX-04-15" - }, - "PastResolution": { - "set": "Set: XXXX-04-15" - } - }, - "Start": 0, - "Length": 8 - } - ] - }, - { - "Input": "Her Pazartesi ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3259514+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her Pazartesi", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 0, - "Length": 13 - } - ] - }, - { - "Input": "Her Pazartesi saat 16'da ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3379507+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her Pazartesi saat 16", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1T16", - "FutureResolution": { - "set": "Set: XXXX-WXX-1T16" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1T16" - } - }, - "Start": 0, - "Length": 21 - } - ] - }, - { - "Input": "Her sabah ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3429518+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her sabah", - "Type": "set", - "Value": { - "Timex": "TMO", - "FutureResolution": { - "set": "Set: TMO" - }, - "PastResolution": { - "set": "Set: TMO" - } - }, - "Start": 0, - "Length": 9 - } - ] - }, - { - "Input": "Her sabah saat 9'da ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3609535+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her sabah saat 9", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 0, - "Length": 16 - } - ] - }, - { - "Input": "Her öğleden sonra saat 16'da ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3730732+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her öğleden sonra saat 16", - "Type": "set", - "Value": { - "Timex": "T16", - "FutureResolution": { - "set": "Set: T16" - }, - "PastResolution": { - "set": "Set: T16" - } - }, - "Start": 0, - "Length": 25 - } - ] - }, - { - "Input": "Her gece saat 21'de ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3840706+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her gece saat 21", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 0, - "Length": 16 - } - ] - }, - { - "Input": "Her gece 21'de ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.3930718+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her gece 21", - "Type": "set", - "Value": { - "Timex": "T21", - "FutureResolution": { - "set": "Set: T21" - }, - "PastResolution": { - "set": "Set: T21" - } - }, - "Start": 0, - "Length": 11 - } - ] - }, - { - "Input": "Sabahları saat 9'da ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4170727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Sabahları saat 9", - "Type": "set", - "Value": { - "Timex": "T09", - "FutureResolution": { - "set": "Set: T09" - }, - "PastResolution": { - "set": "Set: T09" - } - }, - "Start": 0, - "Length": 16 - } - ] - }, - { - "Input": "Her Pazar saat 9'da ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4295727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Her Pazar saat 9", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 0, - "Length": 16 - } - ] - }, - { - "Input": "Pazar'ları saat 9'da ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.438575+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazar'ları saat 9", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 0, - "Length": 17 - } - ] - }, - { - "Input": "Pazar'ları saat 9'da ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4505726+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazar'ları saat 9", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7T09", - "FutureResolution": { - "set": "Set: XXXX-WXX-7T09" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7T09" - } - }, - "Start": 0, - "Length": 17 - } - ] - }, - { - "Input": "Pazartesi günleri ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4570731+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazartesi günleri", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-1", - "FutureResolution": { - "set": "Set: XXXX-WXX-1" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-1" - } - }, - "Start": 0, - "Length": 17 - } - ] - }, - { - "Input": "Pazar günleri ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4635727+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazar günleri", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 0, - "Length": 13 - } - ] - }, - { - "Input": "Pazar'ları ayrılacağım", - "Context": { - "ReferenceDateTime": "2017-09-27T12:25:54.4710739+03:00" - }, - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "Pazar'ları", - "Type": "set", - "Value": { - "Timex": "XXXX-WXX-7", - "FutureResolution": { - "set": "Set: XXXX-WXX-7" - }, - "PastResolution": { - "set": "Set: XXXX-WXX-7" - } - }, - "Start": 0, - "Length": 10 - } - ] - } -] \ No newline at end of file diff --git a/Specs/Number/Arabic/NumberModel.json b/Specs/Number/Arabic/NumberModel.json index 91cf3910ce..79ca9be899 100644 --- a/Specs/Number/Arabic/NumberModel.json +++ b/Specs/Number/Arabic/NumberModel.json @@ -2,7 +2,7 @@ { "Input": "تجده في الصفحة ال١٩٢", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "١٩٢", @@ -91,7 +91,7 @@ { "Input": "وزنه ٠,٠٨", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٠,٠٨", @@ -108,7 +108,7 @@ { "Input": "وزنه ٠,٢٣٤٥٦", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٠,٢٣٤٥٦", @@ -125,7 +125,7 @@ { "Input": "مقاسه ٤,٨ .", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٤,٨", @@ -141,7 +141,7 @@ }, { "Input": "يوجد ستة عشر تفاحاً.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ستة عشر", @@ -175,7 +175,7 @@ { "Input": "مائة وستة عشر صفحة", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "مائة وستة عشر", @@ -192,7 +192,7 @@ { "Input": "مائة وستة صفحات.", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "مائة وستة", @@ -259,7 +259,7 @@ { "Input": "مائة آلاف دولار", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "مائة آلاف", @@ -361,7 +361,7 @@ { "Input": "عدد السكان في الهند ١،٢٣٤،٥٦٧", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "١،٢٣٤،٥٦٧", @@ -378,7 +378,7 @@ { "Input": "النتيجة الصحيحة ٩,٢٣٢١٣١٢ ", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٩,٢٣٢١٣١٢", @@ -395,7 +395,7 @@ { "Input": "-٩,٢٣٢١٣١٢", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-٩,٢٣٢١٣١٢", @@ -412,7 +412,7 @@ { "Input": "-١", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-١", @@ -429,7 +429,7 @@ { "Input": "-١ ٤/٥", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-١ ٤/٥", @@ -445,7 +445,7 @@ }, { "Input": "لديها ثلاثة اقلام", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ثلاثة", @@ -462,7 +462,7 @@ { "Input": "رقم الهاتف ١٢٣٤٥٦٧٨٩١٠١٢٣١", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "١٢٣٤٥٦٧٨٩١٠١٢٣١", @@ -479,7 +479,7 @@ { "Input": "-١٢٣٤٥٦٧٨٩١٠١٢٣١", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-١٢٣٤٥٦٧٨٩١٠١٢٣١", @@ -496,7 +496,7 @@ { "Input": " -١٢٣٤٥٦٧٨٩١٠١٢٣١", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-١٢٣٤٥٦٧٨٩١٠١٢٣١", @@ -513,7 +513,7 @@ { "Input": "١", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "١", @@ -530,7 +530,7 @@ { "Input": "عدد سكان ١ ترليون", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "١ ترليون", @@ -546,7 +546,7 @@ }, { "Input": "في الحديقة ثلاثة اشجار", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ثلاثة", @@ -580,7 +580,7 @@ { "Input": "عدد سكان المنطقة واحد وعشرون تريليون", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "واحد وعشرون تريليون", @@ -597,7 +597,7 @@ { "Input": "عدد سكان المنطقة واحد وعشرون تريليون وثلاث مائة", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "واحد وعشرون تريليون وثلاث مائة", @@ -631,7 +631,7 @@ { "Input": "تحتوي السلة على اثنين وخمسون فاكهة", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "اثنين وخمسون", @@ -648,7 +648,7 @@ { "Input": "يوجد في الغابة ثلاث مائة وواحد وثلاثون أشجار", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ثلاث مائة وواحد وثلاثون", @@ -750,7 +750,7 @@ { "Input": "٣/٤ الكأس", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٣/٤", @@ -1425,12 +1425,12 @@ }, { "Input": "حجزت رحلتي في درجة الأولى", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "درجة الحرارة سالب واحد", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "سالب واحد", @@ -1447,7 +1447,7 @@ { "Input": "سالب واحد على ٢٠", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "سالب واحد على ٢٠", @@ -1560,7 +1560,7 @@ }, { "Input": "صفر هو٠", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "صفر", @@ -1587,7 +1587,7 @@ { "Input": "هل يوجد وقت في يوم ٥/١٧/٢٠١٨؟", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٥", @@ -1629,7 +1629,7 @@ { "Input": "رقم لوحة السيارة ثلاث مئة وواحد.", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ثلاث مئة وواحد", @@ -1645,28 +1645,28 @@ }, { "Input": "الذي ذكرتها كان باطلا.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "الدي ذكرتها كانت غير صحيحة.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "أي واحد تفضل؟", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "هذاك جيد حقا.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "في بعض البلدان تستطيع ان تكتب ٥.٠٠ او ٥,٠٠", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٥.٠٠", @@ -1693,7 +1693,7 @@ { "Input": "ستة وعشرون شخص توفي في حادث في تيكمان.", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ستة وعشرون", @@ -1726,7 +1726,7 @@ { "Input": "أريد أن اربح ١٠٠٠٠ دولار في ٣ سنوات.", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "١٠٠٠٠", @@ -1753,7 +1753,7 @@ { "Input": "أريد أن ٢٠٠٠ دولار خلال ٣ سنوات.", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٢٠٠٠", @@ -1780,7 +1780,7 @@ { "Input": "الكسر الصحيح ٢٠٠٠ على ٣", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٢٠٠٠ على ٣", @@ -1797,7 +1797,7 @@ { "Input": "$٢٠", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٢٠", @@ -1813,7 +1813,7 @@ }, { "Input": "الإجابة سالب واحد.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "سالب واحد", @@ -1830,7 +1830,7 @@ { "Input": "-٤/٥", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-٤/٥", @@ -1931,7 +1931,7 @@ { "Input": "درجة الحرارة سالب ٥", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "سالب ٥", @@ -1948,7 +1948,7 @@ { "Input": "١ ٢٣٤ ٥٦٧", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "١ ٢٣٤ ٥٦٧", @@ -1982,7 +1982,7 @@ { "Input": "الأرقام هي ١ ، ٢٣٤ ، ٥٦٧", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "١", @@ -2154,7 +2154,7 @@ { "Input": "يمكنني أن أعطيك ٣ مئة و ٢١ يوان", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "٣ مئة و ٢١", @@ -2340,7 +2340,7 @@ { "Input": "192.", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2401,7 +2401,7 @@ { "Input": "السائل 180.25 مل", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2418,7 +2418,7 @@ { "Input": "السائل 180 مل", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2435,7 +2435,7 @@ { "Input": " طريق 29 كم ", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2452,7 +2452,7 @@ { "Input": " 4 مايو ", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2475,7 +2475,7 @@ { "Input": ".08", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2492,7 +2492,7 @@ { "Input": "واحد", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2509,13 +2509,13 @@ { "Input": "مفرد", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": ".23456000", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2532,7 +2532,7 @@ { "Input": "4.800", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2549,7 +2549,7 @@ { "Input": "المائة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java, python", "NotSupported": "dotnet", "Results": [ { @@ -2566,7 +2566,7 @@ { "Input": "ثلث", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -2617,7 +2617,7 @@ { "Input": "ستة عشر", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2651,7 +2651,7 @@ { "Input": "مائة و ستون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2668,7 +2668,7 @@ { "Input": "مائة و واحد و ستون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2685,7 +2685,7 @@ { "Input": "واحد من تريليون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -2702,7 +2702,7 @@ { "Input": "واحد من مائة مليون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -2719,7 +2719,7 @@ { "Input": " نصف دستة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2736,7 +2736,7 @@ { "Input": " 3 دستات", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2770,7 +2770,7 @@ { "Input": "ثلاثة دستات", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2787,7 +2787,7 @@ { "Input": "1,234,567", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2804,7 +2804,7 @@ { "Input": "1, 234, 567", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2837,13 +2837,13 @@ ] }, { - "Input": "9.2321312", + "Input": "9,2321312", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { - "Text": "9.2321312", + "Text": "9,2321312", "TypeName": "number", "Resolution": { "value": "9.2321312" @@ -2854,13 +2854,13 @@ ] }, { - "Input": " -9.2321312", + "Input": " -9,2321312", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { - "Text": "-9.2321312", + "Text": "-9,2321312", "TypeName": "number", "Resolution": { "value": "-9.2321312" @@ -2873,7 +2873,7 @@ { "Input": " -1", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2890,7 +2890,7 @@ { "Input": "-4/5", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2907,7 +2907,7 @@ { "Input": "- 1 4/5", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2924,7 +2924,7 @@ { "Input": "ثلاثة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2941,7 +2941,7 @@ { "Input": " 123456789101231", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2958,7 +2958,7 @@ { "Input": "-123456789101231", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2975,7 +2975,7 @@ { "Input": "1", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -2992,7 +2992,7 @@ { "Input": " ثلاثة ", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3009,7 +3009,7 @@ { "Input": "تريليون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3060,7 +3060,7 @@ { "Input": "اثنان و خمسون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3077,7 +3077,7 @@ { "Input": "52", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3094,7 +3094,7 @@ { "Input": "ثلاثمائة و واحد و ثلاثون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3145,7 +3145,7 @@ { "Input": "مائتين فاصلة ثلاثة من مائة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3162,7 +3162,7 @@ { "Input": " 200 نقطة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3213,7 +3213,7 @@ { "Input": " 322 مائة ", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3230,7 +3230,7 @@ { "Input": "سبعون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3247,7 +3247,7 @@ { "Input": "2 1/4", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3264,7 +3264,7 @@ { "Input": "3/4", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3281,7 +3281,7 @@ { "Input": "ثمن", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3298,7 +3298,7 @@ { "Input": "خمسة أثمان", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3315,7 +3315,7 @@ { "Input": "نصف", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3332,7 +3332,7 @@ { "Input": "ثلاثة أرباع", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3349,7 +3349,7 @@ { "Input": "عشرون و ثلاثة أخماس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3366,7 +3366,7 @@ { "Input": "ثلاثة و عشرون خمس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3383,7 +3383,7 @@ { "Input": "ثلاثة و عشرون و ثلاثة أخماس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3400,7 +3400,7 @@ { "Input": "مائتين ألف و أربعمائة و أربعون و ثلاثة أخماس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3417,7 +3417,7 @@ { "Input": "واحد و نصف", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3434,7 +3434,7 @@ { "Input": "واحد و ربع", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3451,7 +3451,7 @@ { "Input": "خمسة و ربع", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3468,7 +3468,7 @@ { "Input": "مائة و ثلاثة أرباع", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3485,7 +3485,7 @@ { "Input": "واحد من مائة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3655,7 +3655,7 @@ { "Input": "1.2 مليار", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -3672,7 +3672,7 @@ { "Input": "خمس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3689,7 +3689,7 @@ { "Input": "واحد من مائة ألف تريليون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3706,7 +3706,7 @@ { "Input": "ثلاثة أخماس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3723,7 +3723,7 @@ { "Input": "خمس العشرون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3740,7 +3740,7 @@ { "Input": "ثلاثة و خمس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3757,7 +3757,7 @@ { "Input": "واحد و عشرون خمس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3825,7 +3825,7 @@ { "Input": "خمس خمس العشرون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3842,7 +3842,7 @@ { "Input": "مائة و ثلاثون خمس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3893,7 +3893,7 @@ { "Input": "مائة و ثلاثون و خمسين", "Comment": "PendingValidation, Mothanna Case: خمسين", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3910,7 +3910,7 @@ { "Input": "واحد من مائة و خمسة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3927,7 +3927,7 @@ { "Input": "مائة من ألف و خمسة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3944,7 +3944,7 @@ { "Input": "واحد على ثلاثة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3961,7 +3961,7 @@ { "Input": "واحد على واحد و عشرون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3978,7 +3978,7 @@ { "Input": "واحد على مائة و واحد و عشرون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -3995,7 +3995,7 @@ { "Input": "1 على ثلاثة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4012,7 +4012,7 @@ { "Input": "1 على 3", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4029,7 +4029,7 @@ { "Input": "واحد على 3", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4046,7 +4046,7 @@ { "Input": "واحد على 20", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4063,7 +4063,7 @@ { "Input": "واحد على عشرون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4080,7 +4080,7 @@ { "Input": "واحد على مائة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4097,7 +4097,7 @@ { "Input": "واحد على مائة و خمسة و عشرون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4114,7 +4114,7 @@ { "Input": " كم يساوي خمسة و تسعون مائة خمس ؟", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4131,7 +4131,7 @@ { "Input": "الجواب سالب 95 مائة خمس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4148,7 +4148,7 @@ { "Input": "الجواب هو ناقص 90 - 500 خمس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4165,7 +4165,7 @@ { "Input": "الجواب هو ناقص واحد", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4182,7 +4182,7 @@ { "Input": "الجواب هو ناقص مائة و ثلاثين خمس", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4199,7 +4199,7 @@ { "Input": "الجواب سالب واحد على 20", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4216,7 +4216,7 @@ { "Input": "الجواب هو سالب خمس فاصلة خمسة", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4233,7 +4233,7 @@ { "Input": "الجواب هو سالب 5", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4318,7 +4318,7 @@ { "Input": "1 234 567", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4335,7 +4335,7 @@ { "Input": "40 000 هو نفس 40 000", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4361,7 +4361,7 @@ { "Input": "وفي الوقت الراهن، يبلغ عدد سكان الصين 1 414 021 100 نسمة.", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4378,7 +4378,7 @@ { "Input": "سيتم التعرف على 423 0000 كرقمين.", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4404,7 +4404,7 @@ { "Input": "1 234 567.89 هو تنسيق رقم صالح.", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4421,7 +4421,7 @@ { "Input": "صفر هو 0", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4447,7 +4447,7 @@ { "Input": "هل من وقت للاجتماع في 5/17/2018؟", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4482,7 +4482,7 @@ { "Input": "رقم هاتفي هو +1-222-2222/2222", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4526,7 +4526,7 @@ { "Input": "يمكنني أن أعطيك 10 مليون", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4543,13 +4543,13 @@ { "Input": "1M ليس رقما.", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "يمكنني أن أعطيك 310 يوان", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4635,7 +4635,7 @@ { "Input": "300 و 212 رقمان صالحان", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4661,7 +4661,7 @@ { "Input": "300 و سالب واحد رقمان صالحان.", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4687,7 +4687,7 @@ { "Input": "ثلاثمائة و واحد رقم صالح", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4704,31 +4704,31 @@ { "Input": "الشخص الذي ذكرته غير صالح", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "هذا غير صحيح", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "أي شخص تفضل؟", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "هذا جيد حقاً", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "في بعض البلدان يمكنك كتابة 5.00 أو 5,00.", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4771,7 +4771,7 @@ { "Input": "على نصف الناس جاءوا إلى هنا.", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4822,7 +4822,7 @@ { "Input": "2000 على 3", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java,python", "NotSupported": "dotnet", "Results": [ { @@ -4845,7 +4845,7 @@ { "Input": "مائة ألف", "Comment": "PendingValidation", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "NotSupported": "dotnet", "Results": [ { @@ -4862,7 +4862,7 @@ { "Input": "25799‪,‪52", "Comment": "The input contains special character \u202A (Left To Right Embedding) around the decimal separator", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "25799‪,‪52", @@ -4879,7 +4879,7 @@ { "Input": "26،013‪,94", "Comment": "The input contains special character \u202A (Left To Right Embedding) next to the decimal separator", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "26،013‪,94", @@ -4894,11 +4894,11 @@ ] }, { - "Input": "12،220,13", - "NotSupportedByDesign": "javascript, java, python", + "Input": "12,220.13", + "NotSupportedByDesign": "javascript, java", "Results": [ { - "Text": "12،220,13", + "Text": "12,220.13", "TypeName": "number", "Resolution": { "subtype": "decimal", @@ -4908,5 +4908,779 @@ "End": 8 } ] + }, + { + "Input": "60,000", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "60,000", + "TypeName": "number", + "Resolution": { + "subtype": "decimal", + "value": "60000" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "11.50", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "11.50", + "TypeName": "number", + "Resolution": { + "subtype": "decimal", + "value": "11.5" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "مليونًا الأشياء", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "مليونًا", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1000000" + }, + "Start": 0, + "End": 6 + } + ] + }, + { + "Input": "هل يمكنني من فضلك الحصول على ألف شريط؟", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ألف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1000" + }, + "Start": 29, + "End": 31 + } + ] + }, + { + "Input": "13 مكاتب", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "13", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "13" + }, + "Start": 0, + "End": 1 + } + ] + }, + { + "Input": "أحد عشر مانجو", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "أحد عشر", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "11" + }, + "Start": 0, + "End": 6 + } + ] + }, + { + "Input": "ثلاثمائة", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثلاثمائة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "300" + }, + "Start": 0, + "End": 7 + } + ] + }, + { + "Input": "هناك ثلاثمائة دولار وخمسمائة وواحد بنس", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثلاثمائة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "300" + }, + "Start": 5, + "End": 12 + }, + { + "Text": "وخمسمائة وواحد", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "501" + }, + "Start": 20, + "End": 33 + } + ] + }, + { + "Input": "أحد عشر ضيفا", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "أحد عشر", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "11" + }, + "Start": 0, + "End": 6 + } + ] + }, + { + "Input": "ثلاثون جهاز كمبيوتر محمول", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثلاثون", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "30" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "ثمانمائة جنيه لا تكفي", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثمانمائة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "800" + }, + "Start": 0, + "End": 7 + } + ] + }, + { + "Input": "ويبلغ عدد سكان الهند أكثر من مليار نسمة", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "مليار", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1000000000" + }, + "Start": 29, + "End": 33 + } + ] + }, + { + "Input": "لديهم ثروة تزيد عن تريليون ريال", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "تريليون", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1000000000000" + }, + "Start": 19, + "End": 25 + } + ] + }, + { + "Input": "لديك صفر الحس السليم", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "صفر", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "0" + }, + "Start": 5, + "End": 7 + } + ] + }, + { + "Input": "المساحة أكثر من مئة متر مربع", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "مئة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "100" + }, + "Start": 16, + "End": 18 + } + ] + }, + { + "Input": "يرجى إخلاء المنطقة من أجل مئتان بيبل", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "مئتان", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "200" + }, + "Start": 26, + "End": 30 + } + ] + }, + { + "Input": "تجمع حوالي ألفان شخص", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ألفان", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "2000" + }, + "Start": 11, + "End": 15 + } + ] + }, + { + "Input": "تسعة آلاف", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "تسعة آلاف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "9000" + }, + "Start": 0, + "End": 8 + } + ] + }, + { + "Input": "هناك مائة ألف شخص في الغرفة", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "مائة ألف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "100000" + }, + "Start": 5, + "End": 12 + } + ] + }, + { + "Input": "تسعة آلاف وتسعمائة نص عشوائي", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "تسعة آلاف وتسعمائة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "9900" + }, + "Start": 0, + "End": 17 + } + ] + }, + { + "Input": "تسعة آلاف وتسعمائة نص عشوائي", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "تسعة آلاف وتسعمائة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "9900" + }, + "Start": 0, + "End": 17 + } + ] + }, + { + "Input": "عندي مشاكل الفا مع حلول الف", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "الفا", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1000" + }, + "Start": 11, + "End": 14 + }, + { + "Text": "الف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1000" + }, + "Start": 24, + "End": 26 + } + ] + }, + { + "Input": "ستة فاصل تسعة هي الدقة الدقيقة", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ستة فاصل تسعة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "6.9" + }, + "Start": 0, + "End": 12 + } + ] + }, + { + "Input": "حصلت على ثلاثة فاصل ثمانية المعدل التراكمي", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثلاثة فاصل ثمانية", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "3.8" + }, + "Start": 9, + "End": 25 + } + ] + }, + { + "Input": "أحتاج إلى أربعة مليارات وستمائة مليون في حسابي بحلول الغد", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "أربعة مليارات وستمائة مليون", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "4600000000" + }, + "Start": 10, + "End": 36 + } + ] + }, + { + "Input": "تبلغ إيرادات الشركة ثلاثة ملايين وستمائة ألف دولار", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثلاثة ملايين وستمائة ألف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "3600000" + }, + "Start": 20, + "End": 43 + } + ] + }, + { + "Input": "من فضلك أعطني ثلاثة آلاف وعشرة شوكولاتة", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثلاثة آلاف وعشرة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "3010" + }, + "Start": 14, + "End": 29 + } + ] + }, + { + "Input": "هل يمكنك أن ترسل لي تسعة ملايين وأربعة آلاف زهرة؟", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "تسعة ملايين وأربعة آلاف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "9004000" + }, + "Start": 20, + "End": 42 + } + ] + }, + { + "Input": "لقد تلقيت أربعة ملايين وتسعمائة ألف مشاركة بحلول هذا الوقت من العام", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "أربعة ملايين وتسعمائة ألف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "4900000" + }, + "Start": 10, + "End": 34 + } + ] + }, + { + "Input": "تبلغ تكلفة هذا المنزل تسعة ملايين وثلاثمائة ألف يورو", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "تسعة ملايين وثلاثمائة ألف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "9300000" + }, + "Start": 22, + "End": 46 + } + ] + }, + { + "Input": "المبلغ الواجب سداده هو خمسة ملايين وثلاثة آلاف درهم", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "خمسة ملايين وثلاثة آلاف", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "5003000" + }, + "Start": 23, + "End": 45 + } + ] + }, + { + "Input": "ستمائة مليار دولار من فضلك", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ستمائة مليار", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "600000000000" + }, + "Start": 0, + "End": 11 + } + ] + }, + { + "Input": "أريد التبرع بثلاثة وستة ملايين وأربعة دولارات", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "وستة ملايين وأربعة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "6000004" + }, + "Start": 19, + "End": 36 + } + ] + }, + { + "Input": "ستة وعشرون مليونًا", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ستة وعشرون مليونًا", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "26000000" + }, + "Start": 0, + "End": 17 + } + ] + }, + { + "Input": "ثلاثة مليارات وخمسمائة وتسعة ملايين", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثلاثة مليارات وخمسمائة وتسعة ملايين", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "3509000000" + }, + "Start": 0, + "End": 34 + } + ] + }, + { + "Input": "أربعة آلاف وثمانمائة وثلاثة وسبعون", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "أربعة آلاف وثمانمائة وثلاثة وسبعون", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "4873" + }, + "Start": 0, + "End": 33 + } + ] + }, + { + "Input": "أريد نصف مليون قطعة", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "نصف مليون", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "500000" + }, + "Start": 5, + "End": 13 + } + ] + }, + { + "Input": "نصف مليون", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "نصف مليون", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "500000" + }, + "Start": 0, + "End": 8 + } + ] + }, + { + "Input": "ثلاثة إثنان واحد", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "ثلاثة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "3" + }, + "Start": 0, + "End": 4 + }, + { + "Text": "إثنان", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "2" + }, + "Start": 6, + "End": 10 + }, + { + "Text": "واحد", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1" + }, + "Start": 12, + "End": 15 + } + ] + }, + { + "Input": "اثنان صفر اثنان أربعة", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "اثنان", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "2" + }, + "Start": 0, + "End": 4 + }, + { + "Text": "صفر", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "0" + }, + "Start": 6, + "End": 8 + }, + { + "Text": "اثنان", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "2" + }, + "Start": 10, + "End": 14 + }, + { + "Text": "أربعة", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "4" + }, + "Start": 16, + "End": 20 + } + ] + }, + { + "Input": "هل أستطيع الحصول على ۲٬٣۵٩ درهم", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "۲٬٣۵٩", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "2359" + }, + "Start": 21, + "End": 25 + } + ] + }, + { + "Input": "۸٩٫۷۰ هو عدد الأشخاص في إسبانيا", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "۸٩٫۷۰", + "TypeName": "number", + "Resolution": { + "subtype": "decimal", + "value": "89.7" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "يبلغ رصيد حسابي البنكي حوالي ۴۵۳٬۲۸۰٬۷۱۶", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "۴۵۳٬۲۸۰٬۷۱۶", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "453280716" + }, + "Start": 29, + "End": 39 + } + ] + }, + { + "Input": "في اليوم ١٬٠٠٠٫٠٥ سيحدث شيء ما.", + "NotSupportedByDesign": "javascript, java", + "Results": [ + { + "Text": "١٬٠٠٠٫٠٥", + "TypeName": "number", + "Resolution": { + "subtype": "decimal", + "value": "1000.05" + }, + "Start": 9, + "End": 16 + } + ] } ] \ No newline at end of file diff --git a/Specs/Number/Arabic/OrdinalModel.json b/Specs/Number/Arabic/OrdinalModel.json index 3bd79f66b8..0cc9051aab 100644 --- a/Specs/Number/Arabic/OrdinalModel.json +++ b/Specs/Number/Arabic/OrdinalModel.json @@ -284,7 +284,7 @@ }, { "Input": "البيت الحادي عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادي عشر", @@ -319,7 +319,7 @@ }, { "Input": "الكتاب الثلاثون غير جيد.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثلاثون", @@ -336,7 +336,7 @@ }, { "Input": "السؤال الثاني صعب.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثاني", @@ -353,7 +353,7 @@ }, { "Input": "هي في الصف الحادي عشر.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادي عشر", @@ -370,7 +370,7 @@ }, { "Input": "دخلت البيت العشرون.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "العشرون", @@ -459,7 +459,7 @@ }, { "Input": "لم أجد الكتاب التريليون.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "التريليون", @@ -512,7 +512,7 @@ }, { "Input": "احجز مقعد ففي الدرجة الأولى الى سياتل.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأولى", @@ -529,7 +529,7 @@ }, { "Input": "اعجبني الأول كتابين.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأول", @@ -546,7 +546,7 @@ }, { "Input": "اعجبني الأول.", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأول", @@ -563,7 +563,7 @@ }, { "Input": "اتحدث الكلمة الأولى", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الأولى", @@ -597,7 +597,7 @@ }, { "Input": "هي انتهت قراءة الكتاب الثاني", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الثاني", @@ -810,7 +810,7 @@ { "Input": "أريد 3 كتب القادمة.", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java, dotnet", + "NotSupported": "javascript, java, dotnet,python", "Results": [ { "Text": "القادمة", @@ -882,7 +882,7 @@ { "Input": "ثلاثة تريليون", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java, dotnet", + "NotSupported": "javascript, java, dotnet,python", "Results": [ { "Text": "ثلاثة تريليون", @@ -900,7 +900,7 @@ { "Input": "مائة تريليون", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java, dotnet", + "NotSupported": "javascript, java, dotnet,python", "Results": [ { "Text": "مائة تريليون", @@ -918,7 +918,7 @@ { "Input": "الحادية عشرة", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "الحادية عشرة", @@ -936,7 +936,7 @@ { "Input": "العشرون", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "العشرون", @@ -1062,7 +1062,7 @@ { "Input": "احجز مقعد ًا من الدرجة الأولى إلى سياتل", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "الأولى", @@ -1097,7 +1097,7 @@ { "Input": "أنا أحب الأولى", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "الأولى", @@ -1115,7 +1115,7 @@ { "Input": "تكلّم بالكلمة الأولى.", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "الأولى", @@ -1151,7 +1151,7 @@ { "Input": "لقد أنهت المركز الثاني", "Comment": "PendingValidation", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "الثاني", diff --git a/Specs/Number/Arabic/OrdinalModelSuppressExtendedTypes.json b/Specs/Number/Arabic/OrdinalModelSuppressExtendedTypes.json index 616e4ef79b..6e0e4376f7 100644 --- a/Specs/Number/Arabic/OrdinalModelSuppressExtendedTypes.json +++ b/Specs/Number/Arabic/OrdinalModelSuppressExtendedTypes.json @@ -81,7 +81,7 @@ }, { "Input": "البيت الحادي عشر", - "NotSupportedByDesign": "java, javascript, python", + "NotSupportedByDesign": "java, javascript", "Results": [ { "Text": "الحادي عشر", diff --git a/Specs/Number/Arabic/PercentModel.json b/Specs/Number/Arabic/PercentModel.json deleted file mode 100644 index c2f37fed4e..0000000000 --- a/Specs/Number/Arabic/PercentModel.json +++ /dev/null @@ -1,400 +0,0 @@ -[ - { - "Input": "هي الوحيدة الذي حصلت على ١٠٠٪.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "١٠٠٪", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 25, - "End": 28 - } - ] - }, - { - "Input": "اصبح شاحن الجوال ١٠٠٪؜.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "١٠٠٪", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 17, - "End": 20 - } - ] - }, - { - "Input": "الاحتمال هو ١٠٠ في المئة.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "١٠٠ في المئة", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 12, - "End": 23 - } - ] - }, - { - "Input": "تم تنزيل الملف ١٠٠ بالمئة.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "١٠٠ بالمئة", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 15, - "End": 24 - } - ] - }, - { - "Input": "الإجابة هو ٢٤٠ في المئة", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "٢٤٠ في المئة", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 11, - "End": 22 - } - ] - }, - { - "Input": "احتمال وقوع حادث عشرين في المئة.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "عشرين في المئة", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 17, - "End": 30 - } - ] - }, - { - "Input": "ثلاثين بالمئة ليس الإجابة الصحيحة.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "ثلاثين بالمئة", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "كان نتيجته مئة بالمئة.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "مئة بالمئة", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 11, - "End": 20 - } - ] - }, - { - "Input": "ما هو نسبة ١٠ من العدد ؟", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "نسبة ١٠", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 6, - "End": 12 - } - ] - }, - { - "Input": "نسبة اثنين وعشرين كفاية لكل شخص.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "نسبة اثنين وعشرين", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "كان يطلب نسبة ٢١٠.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "نسبة ٢١٠", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 9, - "End": 16 - } - ] - }, - { - "Input": "احتمال نزول المطر ١٠ بالمائة.", - "IgnoreResolution": true, - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "١٠ بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 18, - "End": 27 - } - ] - }, - { - "Input": "ارية فقط سالب خمسة بالمئة.", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "سالب خمسة بالمئة", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 9, - "End": 24 - } - ] - }, - { - "Input": "100%", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 بالمائة", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "100 بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 11 - } - ] - }, - { - "Input": "240 بالمائة", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "240 بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "ثلاثون بالمائة", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "ثلاثون بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "مائة بالمائة", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "مائة بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "عشرون بالمائة", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "عشرون بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "بالمائة 10", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "بالمائة 10", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "اثنين و عشرون بالمائة", - "Comment": "PendingValidation", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "اثنين و عشرون بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 20 - } - ] - }, - { - "Input": "بالمائة 210", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "بالمائة 210", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "10 بالمائة", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "10 بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "تحتاج فقط سالب خمسة بالمائة", - "Comment": "PendingValidation", - "Results": [ - { - "Text": "سالب خمسة بالمائة", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 10, - "End": 26 - } - ] - }, - { - "Input": "يمكنك الذهاب إلى http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 لمزيد من التفاصيل.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "يمكنك الذهاب إلى https://www.test.com/search?q=30%25%2020%", - "NotSupported": "javascript", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/Number/Catalan/NumberModel.json b/Specs/Number/Catalan/NumberModel.json new file mode 100644 index 0000000000..514097b210 --- /dev/null +++ b/Specs/Number/Catalan/NumberModel.json @@ -0,0 +1,365 @@ +[ + { + "Input": "192.", + "Results": [ + { + "Text": "192", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "192" + }, + "Start": 0, + "End": 2 + } + ] + }, + { + "Input": "setze", + "Results": [ + { + "Text": "setze", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "16" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "cent setze", + "Results": [ + { + "Text": "cent setze", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "116" + }, + "Start": 0, + "End": 9 + } + ] + }, + { + "Input": "cent sis", + "Results": [ + { + "Text": "cent sis", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "106" + }, + "Start": 0, + "End": 7 + } + ] + }, + { + "Input": "tres", + "Results": [ + { + "Text": "tres", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "3" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": " 123456789101231", + "Results": [ + { + "Text": "123456789101231", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "123456789101231" + }, + "Start": 1, + "End": 15 + } + ] + }, + { + "Input": "1", + "Results": [ + { + "Text": "1", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1" + }, + "Start": 0, + "End": 0 + } + ] + }, + { + "Input": "2 milions", + "Results": [ + { + "Text": "2 milions", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "2000000" + }, + "Start": 0, + "End": 8 + } + ] + }, + { + "Input": " tres ", + "Results": [ + { + "Text": "tres", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "3" + }, + "Start": 1, + "End": 4 + } + ] + }, + { + "Input": "cinquanta-dos", + "Results": [ + { + "Text": "cinquanta-dos", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "52" + }, + "Start": 0, + "End": 12 + } + ] + }, + { + "Input": "1 234 567", + "Results": [ + { + "Text": "1 234 567", + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "1234567" + }, + "Start": 0, + "End": 8 + } + ] + }, + { + "Input": "Vull guanyar 2000 dòlars durant 3 anys", + "Results": [ + { + "Text": "2000", + "Start": 13, + "End": 16, + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "2000" + } + }, + { + "Text": "3", + "Start": 32, + "End": 32, + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "3" + } + } + ] + }, + { + "Input": "Puc aconseguir 5 milions i mig de dòlars?", + "Results": [ + { + "Text": "5 milions i mig", + "Start": 15, + "End": 29, + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "5500000" + } + } + ] + }, + { + "Input": "On és el meu mig milió de dòlars?", + "Results": [ + { + "Text": "mig milió", + "Start": 13, + "End": 21, + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "500000" + } + } + ] + }, + { + "Input": "Tinc un quart de milió d'euros", + "Results": [ + { + "Text": "un quart de milió", + "Start": 5, + "End": 21, + "TypeName": "number", + "Resolution": { + "subtype": "integer", + "value": "250000" + } + } + ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + } +] diff --git a/Specs/Number/Chinese/NumberModel.json b/Specs/Number/Chinese/NumberModel.json index 0ee277d3a3..c0862d3764 100644 --- a/Specs/Number/Chinese/NumberModel.json +++ b/Specs/Number/Chinese/NumberModel.json @@ -5312,5 +5312,133 @@ "End": 30 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Chinese/PercentModel.json b/Specs/Number/Chinese/PercentModel.json deleted file mode 100644 index ca8fd12159..0000000000 --- a/Specs/Number/Chinese/PercentModel.json +++ /dev/null @@ -1,2217 +0,0 @@ -[ - { - "Input": "打对折", - "Results": [ - { - "Text": "对折", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 1, - "End": 2 - } - ] - }, - { - "Input": "对折", - "Results": [] - }, - { - "Input": "陆 点 五 折", - "Results": [ - { - "Text": "陆 点 五 折", - "TypeName": "percentage", - "Resolution": { - "value": "65%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "9成", - "Results": [ - { - "Text": "9成", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "七成 六", - "Results": [ - { - "Text": "七成 六", - "TypeName": "percentage", - "Resolution": { - "value": "76%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "7.2成", - "Results": [ - { - "Text": "7.2成", - "TypeName": "percentage", - "Resolution": { - "value": "72%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "7 2 折", - "Results": [ - { - "Text": "7 2 折", - "TypeName": "percentage", - "Resolution": { - "value": "72%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "六 点 五 成", - "Results": [ - { - "Text": "六 点 五 成", - "TypeName": "percentage", - "Resolution": { - "value": "65%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "10 成", - "Results": [ - { - "Text": "10 成", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "10 成", - "Results": [ - { - "Text": "10 成", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "十 成", - "Results": [ - { - "Text": "十 成", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "75折", - "Results": [ - { - "Text": "75折", - "TypeName": "percentage", - "Resolution": { - "value": "75%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "9.9折", - "Results": [ - { - "Text": "9.9折", - "TypeName": "percentage", - "Resolution": { - "value": "99%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "九 九 折", - "Results": [ - { - "Text": "九 九 折", - "TypeName": "percentage", - "Resolution": { - "value": "99%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "三点一折", - "Results": [ - { - "Text": "三点一折", - "TypeName": "percentage", - "Resolution": { - "value": "31%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "三成", - "Results": [ - { - "Text": "三成", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "半成", - "Results": [ - { - "Text": "半成", - "TypeName": "percentage", - "Resolution": { - "value": "5%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "半折", - "Results": [ - { - "Text": "半折", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "10成", - "Results": [ - { - "Text": "10成", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "十成", - "Results": [ - { - "Text": "十成", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "十折", - "Results": [] - }, - { - "Input": "9.5成", - "Results": [ - { - "Text": "9.5成", - "TypeName": "percentage", - "Resolution": { - "value": "95%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "九成", - "Results": [ - { - "Text": "九成", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "三成半", - "Results": [ - { - "Text": "三成半", - "TypeName": "percentage", - "Resolution": { - "value": "35%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "2.5成", - "Results": [ - { - "Text": "2.5成", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "2成", - "Results": [ - { - "Text": "2成", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "2折", - "Results": [ - { - "Text": "2折", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "两折", - "Results": [ - { - "Text": "两折", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "两成", - "Results": [ - { - "Text": "两成", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "三八折", - "Results": [ - { - "Text": "三八折", - "TypeName": "percentage", - "Resolution": { - "value": "38%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "2成,2.5成,2.1成,2成", - "Results": [ - { - "Text": "2成", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "2.5成", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 3, - "End": 6 - }, - { - "Text": "2.1成", - "TypeName": "percentage", - "Resolution": { - "value": "21%" - }, - "Start": 8, - "End": 11 - }, - { - "Text": "2成", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 13, - "End": 14 - } - ] - }, - { - "Input": "九成,五成,八点五成", - "Results": [ - { - "Text": "九成", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "五成", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 3, - "End": 4 - }, - { - "Text": "八点五成", - "TypeName": "percentage", - "Resolution": { - "value": "85%" - }, - "Start": 6, - "End": 9 - } - ] - }, - { - "Input": "2折", - "Results": [ - { - "Text": "2折", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "2折,2.5折,2.1折,2折", - "Results": [ - { - "Text": "2折", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "2.5折", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 3, - "End": 6 - }, - { - "Text": "2.1折", - "TypeName": "percentage", - "Resolution": { - "value": "21%" - }, - "Start": 8, - "End": 11 - }, - { - "Text": "2折", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 13, - "End": 14 - } - ] - }, - { - "Input": "九折,五五折,八点五折", - "Results": [ - { - "Text": "九折", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "五五折", - "TypeName": "percentage", - "Resolution": { - "value": "55%" - }, - "Start": 3, - "End": 5 - }, - { - "Text": "八点五折", - "TypeName": "percentage", - "Resolution": { - "value": "85%" - }, - "Start": 7, - "End": 10 - } - ] - }, - { - "Input": "五折", - "Results": [ - { - "Text": "五折", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "百分之2.4", - "Results": [ - { - "Text": "百分之2.4", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "千分之2.4", - "Results": [ - { - "Text": "千分之2.4", - "TypeName": "percentage", - "Resolution": { - "value": "0.24%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "千分之一", - "Results": [ - { - "Text": "千分之一", - "TypeName": "percentage", - "Resolution": { - "value": "0.1%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "仟分之贰", - "Results": [ - { - "Text": "仟分之贰", - "TypeName": "percentage", - "Resolution": { - "value": "0.2%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "万分之三", - "Results": [ - { - "Text": "万分之三", - "TypeName": "percentage", - "Resolution": { - "value": "0.03%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "萬分之肆", - "Results": [ - { - "Text": "萬分之肆", - "TypeName": "percentage", - "Resolution": { - "value": "0.04%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "百万分之五", - "NotSupported": "javascript", - "Results": [ - { - "Text": "百万分之五", - "TypeName": "percentage", - "Resolution": { - "value": "0.0005%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "千万分之六", - "NotSupported": "javascript", - "Results": [ - { - "Text": "千万分之六", - "TypeName": "percentage", - "Resolution": { - "value": "6E-05%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "万万分之七", - "NotSupported": "javascript", - "Results": [ - { - "Text": "万万分之七", - "TypeName": "percentage", - "Resolution": { - "value": "7E-06%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "百万万分之七", - "NotSupported": "javascript", - "Results": [ - { - "Text": "百万万分之七", - "TypeName": "percentage", - "Resolution": { - "value": "7E-08%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "千分之一百一十一", - "Results": [ - { - "Text": "千分之一百一十一", - "TypeName": "percentage", - "Resolution": { - "value": "11.1%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "千分之一百一十一点一一二", - "Results": [ - { - "Text": "千分之一百一十一点一一二", - "TypeName": "percentage", - "Resolution": { - "value": "11.1112%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "二三十个百分点", - "NotSupported":"java", - "Results": [] - }, - { - "Input": "百分之二三十", - "Results": [] - }, - { - "Input": "百分之五", - "NotSupported": "java", - "Results": [ - { - "Text": "百分之五", - "TypeName": "percentage", - "Resolution": { - "value": "5%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "一百五十 个百分点", - "Results": [ - { - "Text": "一百五十 个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "150%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "六个百分点", - "Results": [ - { - "Text": "六个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "2.4个百分点", - "Results": [ - { - "Text": "2.4个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "-22.2%", - "Results": [ - { - "Text": "-22.2%", - "TypeName": "percentage", - "Resolution": { - "value": "-22.2%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "22%", - "Results": [ - { - "Text": "22%", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "-122%", - "Results": [ - { - "Text": "-122%", - "TypeName": "percentage", - "Resolution": { - "value": "-122%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "百分之22", - "Results": [ - { - "Text": "百分之22", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "百分之120", - "Results": [ - { - "Text": "百分之120", - "TypeName": "percentage", - "Resolution": { - "value": "120%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百分之15K", - "Results": [ - { - "Text": "百分之15k", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百分之1,111", - "Results": [ - { - "Text": "百分之1,111", - "TypeName": "percentage", - "Resolution": { - "value": "1111%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百分之9,999", - "Results": [ - { - "Text": "百分之9,999", - "TypeName": "percentage", - "Resolution": { - "value": "9999%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "12个百分点", - "Results": [ - { - "Text": "12个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "12%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "2,123个百分点", - "Results": [ - { - "Text": "2,123个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "2123%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "二十个百分点", - "Results": [ - { - "Text": "二十个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "四点 五个百分点", - "Results": [ - { - "Text": "四点 五个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "4.5%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百分之五 十", - "NotSupported": "java", - "Results": [ - { - "Text": "百分之五 十", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百分之一 点五", - "NotSupported": "java", - "Results": [ - { - "Text": "百分之一 点五", - "TypeName": "percentage", - "Resolution": { - "value": "1.5%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "百分之56.2", - "Results": [ - { - "Text": "百分之56.2", - "TypeName": "percentage", - "Resolution": { - "value": "56.2%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "百分之12", - "Results": [ - { - "Text": "百分之12", - "TypeName": "percentage", - "Resolution": { - "value": "12%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "百分之3,000", - "Results": [ - { - "Text": "百分之3,000", - "TypeName": "percentage", - "Resolution": { - "value": "3000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百分之1,123", - "Results": [ - { - "Text": "百分之1,123", - "TypeName": "percentage", - "Resolution": { - "value": "1123%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百分之3.2k", - "Results": [ - { - "Text": "百分之3.2k", - "TypeName": "percentage", - "Resolution": { - "value": "3200%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "百分之3.2", - "Results": [ - { - "Text": "百分之3.2", - "TypeName": "percentage", - "Resolution": { - "value": "3.2%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "12.56个百分点", - "Results": [ - { - "Text": "12.56个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "12.56%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "0.4个百分点", - "Results": [ - { - "Text": "0.4个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "0.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "15,123个百分点", - "Results": [ - { - "Text": "15,123个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "15123%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "111,111个百分点", - "Results": [ - { - "Text": "111,111个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "111111%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "25%", - "Results": [ - { - "Text": "25%", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "12k个百分点", - "Results": [ - { - "Text": "12k个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "12000%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "15k个百分点", - "Results": [ - { - "Text": "15k个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "一百五十个百分点", - "Results": [ - { - "Text": "一百五十个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "150%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "七十五万个百分点", - "Results": [ - { - "Text": "七十五万个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "750000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "拾万零五十六点叁叁个百分点", - "Results": [ - { - "Text": "拾万零五十六点叁叁个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "100056.33%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "75.2个百分点", - "Results": [ - { - "Text": "75.2个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "75.2%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "75个百分点", - "Results": [ - { - "Text": "75个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "75%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "1,075个百分点", - "Results": [ - { - "Text": "1,075个百分点", - "TypeName": "percentage", - "Resolution": { - "value": "1075%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "百分之一百", - "NotSupported": "java", - "Results": [ - { - "Text": "百分之一百", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "百分之百", - "NotSupported": "java", - "Results": [ - { - "Text": "百分之百", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "百分之一百二十点五", - "NotSupported": "java", - "Results": [ - { - "Text": "百分之一百二十点五", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "百分之2.4", - "Results": [ - { - "Text": "百分之2.4", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百分之2", - "Results": [ - { - "Text": "百分之2", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "百分之1,669", - "Results": [ - { - "Text": "百分之1,669", - "TypeName": "percentage", - "Resolution": { - "value": "1669%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百分之52.5", - "Results": [ - { - "Text": "百分之52.5", - "TypeName": "percentage", - "Resolution": { - "value": "52.5%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "五百分之2.2", - "Results": [] - }, - { - "Input": "上升了百分之2.2", - "Results": [ - { - "Text": "百分之2.2", - "TypeName": "percentage", - "Resolution": { - "value": "2.2%" - }, - "Start": 3, - "End": 8 - } - ] - }, - { - "Input": "5%", - "Results": [ - { - "Text": "5%", - "TypeName": "percentage", - "Resolution": { - "value": "5%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "5.5%", - "Results": [ - { - "Text": "5.5%", - "TypeName": "percentage", - "Resolution": { - "value": "5.5%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "一 百 五 十 个 百 分 点", - "Results": [ - { - "Text": "一 百 五 十 个 百 分 点", - "TypeName": "percentage", - "Resolution": { - "value": "150%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "六 个 百 分点", - "Results": [ - { - "Text": "六 个 百 分点", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "2.4 个百分 点", - "Results": [ - { - "Text": "2.4 个百分 点", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "百 分之 一百二十点五", - "NotSupported": "java", - "Results": [ - { - "Text": "百 分之 一百二十点五", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "百 分 之2.4", - "Results": [ - { - "Text": "百 分 之2.4", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百 分之 2", - "Results": [ - { - "Text": "百 分之 2", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百 分 之 669", - "Results": [ - { - "Text": "百 分 之 669", - "TypeName": "percentage", - "Resolution": { - "value": "669%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "百 分 之 52.5 k", - "Results": [ - { - "Text": "百 分 之 52.5 k", - "TypeName": "percentage", - "Resolution": { - "value": "52500%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "百 分 之 一 百二 十点 五", - "NotSupported": "java", - "Results": [ - { - "Text": "百 分 之 一 百二 十点 五", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "打對折", - "Results": [ - { - "Text": "對折", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 1, - "End": 2 - } - ] - }, - { - "Input": "對折", - "Results": [] - }, - { - "Input": "陸 點 五 折", - "Results": [ - { - "Text": "陸 點 五 折", - "TypeName": "percentage", - "Resolution": { - "value": "65%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "六 點 五 成", - "Results": [ - { - "Text": "六 點 五 成", - "TypeName": "percentage", - "Resolution": { - "value": "65%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "三點一折", - "Results": [ - { - "Text": "三點一折", - "TypeName": "percentage", - "Resolution": { - "value": "31%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "兩折", - "Results": [ - { - "Text": "兩折", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "兩成", - "Results": [ - { - "Text": "兩成", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "九成,五成,八點五成", - "Results": [ - { - "Text": "九成", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "五成", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 3, - "End": 4 - }, - { - "Text": "八點五成", - "TypeName": "percentage", - "Resolution": { - "value": "85%" - }, - "Start": 6, - "End": 9 - } - ] - }, - { - "Input": "九折,五五折,八點五折", - "Results": [ - { - "Text": "九折", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "五五折", - "TypeName": "percentage", - "Resolution": { - "value": "55%" - }, - "Start": 3, - "End": 5 - }, - { - "Text": "八點五折", - "TypeName": "percentage", - "Resolution": { - "value": "85%" - }, - "Start": 7, - "End": 10 - } - ] - }, - { - "Input": "二三十個百分點", - "NotSupported":"java", - "Results": [] - }, - { - "Input": "一百五十 個百分點", - "Results": [ - { - "Text": "一百五十 個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "150%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "六個百分點", - "Results": [ - { - "Text": "六個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "2.4個百分點", - "Results": [ - { - "Text": "2.4個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "12個百分點", - "Results": [ - { - "Text": "12個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "12%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "2,123個百分點", - "Results": [ - { - "Text": "2,123個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "2123%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "二十個百分點", - "Results": [ - { - "Text": "二十個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "四點 五個百分點", - "Results": [ - { - "Text": "四點 五個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "4.5%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百分之一 點五", - "NotSupported": "java", - "Results": [ - { - "Text": "百分之一 點五", - "TypeName": "percentage", - "Resolution": { - "value": "1.5%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "12.56個百分點", - "Results": [ - { - "Text": "12.56個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "12.56%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "0.4個百分點", - "Results": [ - { - "Text": "0.4個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "0.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "15,123個百分點", - "Results": [ - { - "Text": "15,123個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "15123%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "111,111個百分點", - "Results": [ - { - "Text": "111,111個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "111111%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "12k個百分點", - "Results": [ - { - "Text": "12k個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "12000%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "15k個百分點", - "Results": [ - { - "Text": "15k個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "一百五十個百分點", - "Results": [ - { - "Text": "一百五十個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "150%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "七十五萬個百分點", - "Results": [ - { - "Text": "七十五萬個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "750000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "拾萬零五十六點叁叁個百分點", - "Results": [ - { - "Text": "拾萬零五十六點叁叁個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "100056.33%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "75.2個百分點", - "Results": [ - { - "Text": "75.2個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "75.2%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "75個百分點", - "Results": [ - { - "Text": "75個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "75%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "1,075個百分點", - "Results": [ - { - "Text": "1,075個百分點", - "TypeName": "percentage", - "Resolution": { - "value": "1075%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "百分之一百二十點五", - "NotSupported": "java", - "Results": [ - { - "Text": "百分之一百二十點五", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "一 百 五 十 個 百 分 點", - "Results": [ - { - "Text": "一 百 五 十 個 百 分 點", - "TypeName": "percentage", - "Resolution": { - "value": "150%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "六 個 百 分點", - "Results": [ - { - "Text": "六 個 百 分點", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "2.4 個百分 點", - "Results": [ - { - "Text": "2.4 個百分 點", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "百 分之 一百二十點五", - "NotSupported": "java", - "Results": [ - { - "Text": "百 分之 一百二十點五", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "佰 分 之 一 百二 十點 五", - "NotSupported": "java", - "Results": [ - { - "Text": "佰 分 之 一 百二 十點 五", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "苹果折扣一折", - "Results": [ - { - "Text": "一折", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 4, - "End": 5 - } - ] - }, - { - "Input": "你可以访问一下 http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "你可以访问一下 https://www.test.com/search?q=30%25%2020%", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "百分之6酒精含量的啤酒和32.5%的白酒", - "NotSupported": "javascript", - "Results": [ - { - "Text": "百分之6", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 3 - }, - { - "Text": "32.5%", - "TypeName": "percentage", - "Resolution": { - "value": "32.5%" - }, - "Start": 12, - "End": 16 - } - ] - }, - { - "Input": "百分之2等于百分之二,和2%是一样的。", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "百分之2", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 0, - "End": 3 - }, - { - "Text": "百分之二", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 6, - "End": 9 - }, - { - "Text": "2%", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 12, - "End": 13 - } - ] - }, - { - "Input": "找出酒精量在5-20%之间的产品", - "NotSupported": "javascript", - "Results": [ - { - "Text": "20%", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 8, - "End": 10 - } - ] - }, - { - "Input": "股票十天收盘价的百分之七十百分位大于1", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "百分之七十", - "Start": 8, - "End": 12, - "TypeName": "percentage", - "Resolution": { - "value": "70%" - } - } - ] - }, - { - "Input": "负3.9%", - "Results": [ - { - "Text": "负3.9%", - "TypeName": "percentage", - "Resolution": { - "value": "-3.9%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "负40%", - "Results": [ - { - "Text": "负40%", - "TypeName": "percentage", - "Resolution": { - "value": "-40%" - }, - "Start": 0, - "End": 3 - } - ] - } -] \ No newline at end of file diff --git a/Specs/Number/Dutch/NumberModel.json b/Specs/Number/Dutch/NumberModel.json index db6713f2f2..b8208e2253 100644 --- a/Specs/Number/Dutch/NumberModel.json +++ b/Specs/Number/Dutch/NumberModel.json @@ -2170,5 +2170,133 @@ "End": 33 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Dutch/OrdinalModel.json b/Specs/Number/Dutch/OrdinalModel.json index a80ea993ac..a3a5966582 100644 --- a/Specs/Number/Dutch/OrdinalModel.json +++ b/Specs/Number/Dutch/OrdinalModel.json @@ -1,7 +1,7 @@ [ { "Input": "drie biljoenste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drie biljoenste", @@ -21,7 +21,7 @@ }, { "Input": "honderd biljoenste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderd biljoenste", @@ -36,7 +36,7 @@ }, { "Input": "11e", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "11e", @@ -51,7 +51,7 @@ }, { "Input": "derde", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "derde", @@ -66,7 +66,7 @@ }, { "Input": "30ste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "30ste", @@ -81,7 +81,7 @@ }, { "Input": "tweede", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweede", @@ -96,7 +96,7 @@ }, { "Input": "elfde", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "elfde", @@ -111,7 +111,7 @@ }, { "Input": "nulde", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "nulde", @@ -126,7 +126,7 @@ }, { "Input": "twintigste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "twintigste", @@ -141,7 +141,7 @@ }, { "Input": "vijfendertigste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vijfendertigste", @@ -156,7 +156,7 @@ }, { "Input": "eenentwintigste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eenentwintigste", @@ -171,7 +171,7 @@ }, { "Input": "honderdvijfentwintigste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderdvijfentwintigste", @@ -186,7 +186,7 @@ }, { "Input": "biljoenste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "biljoenste", @@ -201,7 +201,7 @@ }, { "Input": "eerste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste", @@ -216,7 +216,7 @@ }, { "Input": "tweehonderdste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweehonderdste", @@ -231,7 +231,7 @@ }, { "Input": "Boek een eerste klas ticket naar Amsterdam", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "eerste", @@ -246,7 +246,7 @@ }, { "Input": "honderdachtste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderdachtste", @@ -261,7 +261,7 @@ }, { "Input": "honderdenachtste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderdenachtste", @@ -276,7 +276,7 @@ }, { "Input": "tweeduizend zestiende", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweeduizend zestiende", @@ -291,7 +291,7 @@ }, { "Input": "tweeduizend en zestiende", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "tweeduizend en zestiende", @@ -306,7 +306,7 @@ }, { "Input": "zeventien miljoenste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "zeventien miljoenste", @@ -321,7 +321,7 @@ }, { "Input": "vier miljoenste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vier miljoenste", @@ -336,7 +336,7 @@ }, { "Input": "vier miljoen vierhonderdduizendste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "vier miljoen vierhonderdduizendste", @@ -351,7 +351,7 @@ }, { "Input": "drieduizend tweehonderdtwintigste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drieduizend tweehonderdtwintigste", @@ -366,7 +366,7 @@ }, { "Input": "honderdvijfendertigste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderdvijfendertigste", @@ -381,7 +381,7 @@ }, { "Input": "honderdentweede", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderdentweede", @@ -396,7 +396,7 @@ }, { "Input": "drieduizendste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "drieduizendste", @@ -412,7 +412,7 @@ { "Input": "honderdeende", "Comment": "edge case: https://onzetaal.nl/taaladvies/honderdeneende-honderdeneerste/", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderdeende", @@ -428,7 +428,7 @@ { "Input": "honderdeneende", "Comment": "edge case: https://onzetaal.nl/taaladvies/honderdeneende-honderdeneerste/", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderdeneende", @@ -444,7 +444,7 @@ { "Input": "honderdeerste", "Comment": "edge case: https://onzetaal.nl/taaladvies/honderdeneende-honderdeneerste/", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "honderdeerste", @@ -460,7 +460,7 @@ { "Input": "duizendeende", "Comment": "edge case: https://onzetaal.nl/taaladvies/honderdeneende-honderdeneerste/", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "duizendeende", @@ -476,7 +476,7 @@ { "Input": "duizendeerste", "Comment": "edge case: https://onzetaal.nl/taaladvies/honderdeneende-honderdeneerste/", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "duizendeerste", @@ -491,7 +491,7 @@ }, { "Input": "achthonderdzevende", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "achthonderdzevende", @@ -506,7 +506,7 @@ }, { "Input": "driehonderdachtste", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "driehonderdachtste", diff --git a/Specs/Number/Dutch/PercentModel.json b/Specs/Number/Dutch/PercentModel.json deleted file mode 100644 index c6198d8aba..0000000000 --- a/Specs/Number/Dutch/PercentModel.json +++ /dev/null @@ -1,155 +0,0 @@ -[ - { - "Input": "100%", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": " 100% ", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": " 100 procent", - "Results": [ - { - "Text": "100 procent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": " percentage van 100", - "Results": [ - { - "Text": "percentage van 100", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "240 procent", - "Results": [ - { - "Text": "240 procent", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "twintig procent", - "Results": [ - { - "Text": "twintig procent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "percentage van 30", - "Results": [ - { - "Text": "percentage van 30", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "honderd procent", - "Results": [ - { - "Text": "honderd procent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "210 percent", - "Results": [ - { - "Text": "210 percent", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "10 percent", - "Results": [ - { - "Text": "10 percent", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "dit is een korting van min vijf procent", - "Results": [ - { - "Text": "min vijf procent", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Bezoek http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 voor meer informatie.", - "Results": [], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Bezoek https://www.test.com/search?q=30%25%2020%", - "Results": [], - "NotSupportedByDesign": "javascript, java" - } -] \ No newline at end of file diff --git a/Specs/Number/Dutch/PercentModelPercentMode.json b/Specs/Number/Dutch/PercentModelPercentMode.json deleted file mode 100644 index e6cdf30493..0000000000 --- a/Specs/Number/Dutch/PercentModelPercentMode.json +++ /dev/null @@ -1,139 +0,0 @@ -[ - { - "Input": "100%", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "twintig procent", - "Results": [ - { - "Text": "twintig procent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "percentage van twintig", - "Results": [ - { - "Text": "percentage van twintig", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - } - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "een van de drie", - "Results": [ - { - "Text": "een van de drie", - "TypeName": "percentage", - "Resolution": { - "value": "33,3333333333333%" - } - } - ], - "NotSupportedByDesign": "javascript, python, java" - }, - { - "Input": "een uit twee", - "Results": [ - { - "Text": "een uit twee", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - } - } - ], - "NotSupportedByDesign": "javascript, python, java" - }, - { - "Input": "1/4 van", - "Results": [ - { - "Text": "1/4 van", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - } - } - ], - "NotSupportedByDesign": "javascript, python, java" - }, - { - "Input": "een vierde van", - "Results": [ - { - "Text": "een vierde van", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - } - } - ], - "NotSupportedByDesign": "javascript, python, java" - }, - { - "Input": "de helft van", - "Comment": "no support for prefixing with 'de' yet", - "Results": [ - { - "Text": "de helft van", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - } - } - ], - "NotSupported": "dotNet", - "NotSupportedByDesign": "javascript,python,java" - }, - { - "Input": "een half van", - "Results": [ - { - "Text": "een half van", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - } - } - ], - "NotSupportedByDesign": "javascript, python, java" - }, - { - "Input": "een kwart van", - "Results": [ - { - "Text": "een kwart van", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - } - } - ], - "NotSupportedByDesign": "javascript, python, java" - }, - { - "Input": "een derde", - "Results": [], - "NotSupportedByDesign": "javascript, java" - } -] \ No newline at end of file diff --git a/Specs/Number/English/NumberModel.json b/Specs/Number/English/NumberModel.json index c616c3cc2d..a45bbfd3ad 100644 --- a/Specs/Number/English/NumberModel.json +++ b/Specs/Number/English/NumberModel.json @@ -1263,6 +1263,134 @@ } ] }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, { "Input": "1.2b", "Results": [ @@ -1609,6 +1737,7 @@ ] }, { + "Input": "one over three", "Results": [ { @@ -1959,7 +2088,7 @@ }, { "Input": "1 in twenty-one", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1 in twenty-one", @@ -2987,7 +3116,7 @@ }, { "Input": "1.111,11, 1,111.11", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1.111,11", @@ -3304,7 +3433,7 @@ }, { "Input": "There are five and a half million fishes in this lake", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "five and a half million", @@ -3352,7 +3481,7 @@ }, { "Input": "The result is three and one fourth", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "three and one fourth", @@ -3368,7 +3497,7 @@ }, { "Input": "They have 3 million and a quarter", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "3 million and a quarter", @@ -3511,7 +3640,7 @@ }, { "Input": "placeholder name is a next generation service for translation", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [] }, { @@ -3762,4 +3891,4 @@ } ] } -] \ No newline at end of file +] diff --git a/Specs/Number/English/NumberModelExperimentalMode.json b/Specs/Number/English/NumberModelExperimentalMode.json index 037bc09c79..f39efbc526 100644 --- a/Specs/Number/English/NumberModelExperimentalMode.json +++ b/Specs/Number/English/NumberModelExperimentalMode.json @@ -1,7 +1,7 @@ [ { "Input": "192.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "192", @@ -17,7 +17,7 @@ }, { "Input": "192.168.1.2", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "192", @@ -63,32 +63,32 @@ }, { "Input": "the 180.25ml liquid", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { "Input": "the 180ml liquid", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { "Input": " 29km Road ", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { "Input": " the May 4th ", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { "Input": "the .25ml liquid", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { "Input": ".08", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": ".08", @@ -104,17 +104,17 @@ }, { "Input": "an", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { "Input": "a", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [] }, { "Input": ".23456000", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": ".23456000", @@ -130,7 +130,7 @@ }, { "Input": "4.800", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "4.800", @@ -146,7 +146,7 @@ }, { "Input": "one hundred and three and two thirds", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "one hundred and three and two thirds", @@ -162,7 +162,7 @@ }, { "Input": "sixteen", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "sixteen", @@ -178,7 +178,7 @@ }, { "Input": "two thirds", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "two thirds", @@ -194,7 +194,7 @@ }, { "Input": "one hundred and sixteen", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "one hundred and sixteen", @@ -210,7 +210,7 @@ }, { "Input": "one hundred and six", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "one hundred and six", @@ -226,7 +226,7 @@ }, { "Input": "one hundred and sixty-one", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "one hundred and sixty-one", @@ -242,7 +242,7 @@ }, { "Input": "a trillionth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "a trillionth", @@ -258,7 +258,7 @@ }, { "Input": "a hundred trillionths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "a hundred trillionths", @@ -274,7 +274,7 @@ }, { "Input": " half a dozen", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "half a dozen", @@ -290,7 +290,7 @@ }, { "Input": " 3 dozens", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "3 dozens", @@ -306,7 +306,7 @@ }, { "Input": "a dozen", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "a dozen", @@ -322,7 +322,7 @@ }, { "Input": " three dozens ", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "three dozens", @@ -338,7 +338,7 @@ }, { "Input": " three hundred and two dozens", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "three hundred and two dozens", @@ -354,7 +354,7 @@ }, { "Input": "1,234,567", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "1,234,567", @@ -370,7 +370,7 @@ }, { "Input": "1, 234, 567", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "1", @@ -406,7 +406,7 @@ }, { "Input": "9.2321312", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "9.2321312", @@ -422,7 +422,7 @@ }, { "Input": " -9.2321312", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "-9.2321312", @@ -438,7 +438,7 @@ }, { "Input": " -1", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "-1", @@ -454,7 +454,7 @@ }, { "Input": "-4/5", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "-4/5", @@ -470,7 +470,7 @@ }, { "Input": "- 1 4/5", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "- 1 4/5", @@ -486,7 +486,7 @@ }, { "Input": "three", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "three", @@ -502,7 +502,7 @@ }, { "Input": " 123456789101231", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "123456789101231", @@ -518,7 +518,7 @@ }, { "Input": "-123456789101231", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "-123456789101231", @@ -534,7 +534,7 @@ }, { "Input": " -123456789101231", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "-123456789101231", @@ -550,7 +550,7 @@ }, { "Input": "1", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "1", @@ -566,7 +566,7 @@ }, { "Input": "10k", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "10k", @@ -582,7 +582,7 @@ }, { "Input": "10G", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "10g", @@ -598,7 +598,7 @@ }, { "Input": "- 10 k", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "- 10 k", @@ -614,7 +614,7 @@ }, { "Input": "2 million", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "2 million", @@ -630,7 +630,7 @@ }, { "Input": "1 trillion", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1 trillion", @@ -646,7 +646,7 @@ }, { "Input": " three ", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "three", @@ -662,7 +662,7 @@ }, { "Input": "one trillion", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one trillion", @@ -678,7 +678,7 @@ }, { "Input": "twenty-one trillion", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty-one trillion", @@ -694,7 +694,7 @@ }, { "Input": "twenty-one trillion three hundred", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty-one trillion three hundred", @@ -710,7 +710,7 @@ }, { "Input": "twenty-one trillion and three hundred", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty-one trillion and three hundred", @@ -726,7 +726,7 @@ }, { "Input": "fifty - two", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "fifty - two", @@ -742,7 +742,7 @@ }, { "Input": "fifty two", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "fifty two", @@ -758,7 +758,7 @@ }, { "Input": "Three hundred and thirty one", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "three hundred and thirty one", @@ -774,7 +774,7 @@ }, { "Input": "two hundred and two thousand", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "two hundred and two thousand", @@ -790,7 +790,7 @@ }, { "Input": "two thousand and two hundred", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "two thousand and two hundred", @@ -806,7 +806,7 @@ }, { "Input": " 2.33 k", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "2.33 k", @@ -822,7 +822,7 @@ }, { "Input": " two hundred point zero three", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "two hundred point zero three", @@ -838,7 +838,7 @@ }, { "Input": " two hundred point seventy-one", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "two hundred point seventy-one", @@ -854,7 +854,7 @@ }, { "Input": "1e10", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1e10", @@ -870,7 +870,7 @@ }, { "Input": "1.1^23", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1.1^23", @@ -886,7 +886,7 @@ }, { "Input": " 322 hundred ", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "322 hundred", @@ -902,7 +902,7 @@ }, { "Input": "seventy", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "seventy", @@ -918,7 +918,7 @@ }, { "Input": "fifty-two", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "fifty-two", @@ -934,7 +934,7 @@ }, { "Input": "2 1/4", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "2 1/4", @@ -950,7 +950,7 @@ }, { "Input": "3/4", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "3/4", @@ -966,7 +966,7 @@ }, { "Input": "one eighth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one eighth", @@ -982,7 +982,7 @@ }, { "Input": "five eighths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "five eighths", @@ -998,7 +998,7 @@ }, { "Input": "a half", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "a half", @@ -1014,7 +1014,7 @@ }, { "Input": "three quarters", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "three quarters", @@ -1030,7 +1030,7 @@ }, { "Input": "twenty and three fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty and three fifths", @@ -1046,7 +1046,7 @@ }, { "Input": "twenty-three fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty-three fifths", @@ -1062,7 +1062,7 @@ }, { "Input": "twenty and three and three fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty and three and three fifths", @@ -1078,7 +1078,7 @@ }, { "Input": "one million two thousand two hundred three fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one million two thousand two hundred three fifths", @@ -1094,7 +1094,7 @@ }, { "Input": "one and a half", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one and a half", @@ -1110,7 +1110,7 @@ }, { "Input": "one and a fourth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one and a fourth", @@ -1126,7 +1126,7 @@ }, { "Input": "five and a quarter", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "five and a quarter", @@ -1142,7 +1142,7 @@ }, { "Input": "one hundred and three quarters", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred and three quarters", @@ -1158,7 +1158,7 @@ }, { "Input": "a hundredth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "a hundredth", @@ -1174,7 +1174,7 @@ }, { "Input": "1.1^+23", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1.1^+23", @@ -1190,7 +1190,7 @@ }, { "Input": "2.5^-1", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "2.5^-1", @@ -1206,7 +1206,7 @@ }, { "Input": "-2500^-1", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "-2500^-1", @@ -1222,7 +1222,7 @@ }, { "Input": "-1.1^+23", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "-1.1^+23", @@ -1238,7 +1238,7 @@ }, { "Input": "-2.5^-1", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "-2.5^-1", @@ -1254,7 +1254,7 @@ }, { "Input": "-1.1^--23", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "-1.1^--23", @@ -1270,7 +1270,7 @@ }, { "Input": "-127.32e13", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "-127.32e13", @@ -1286,7 +1286,7 @@ }, { "Input": "12.32e+14", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "12.32e+14", @@ -1302,7 +1302,7 @@ }, { "Input": "-12e-1", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "-12e-1", @@ -1318,7 +1318,7 @@ }, { "Input": "1.2b", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1.2b", @@ -1334,7 +1334,7 @@ }, { "Input": "a fifth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "a fifth", @@ -1350,7 +1350,7 @@ }, { "Input": "a hundred thousand trillionths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "a hundred thousand trillionths", @@ -1366,7 +1366,7 @@ }, { "Input": "one fifth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one fifth", @@ -1382,7 +1382,7 @@ }, { "Input": "three fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "three fifths", @@ -1398,7 +1398,7 @@ }, { "Input": "twenty fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty fifths", @@ -1414,7 +1414,7 @@ }, { "Input": "three and a fifth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "three and a fifth", @@ -1430,7 +1430,7 @@ }, { "Input": "twenty one fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty one fifths", @@ -1446,7 +1446,7 @@ }, { "Input": "a twenty-first", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "a twenty-first", @@ -1462,7 +1462,7 @@ }, { "Input": "one twenty-fifth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one twenty-fifth", @@ -1478,7 +1478,7 @@ }, { "Input": "three twenty-firsts", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "three twenty-firsts", @@ -1494,7 +1494,7 @@ }, { "Input": "three twenty firsts", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "three twenty firsts", @@ -1510,7 +1510,7 @@ }, { "Input": "twenty twenty fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "twenty twenty fifths", @@ -1526,7 +1526,7 @@ }, { "Input": "one hundred and thirty fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred and thirty fifths", @@ -1542,7 +1542,7 @@ }, { "Input": "one hundred thirty fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred thirty fifths", @@ -1558,7 +1558,7 @@ }, { "Input": "one hundred thirty two fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred thirty two fifths", @@ -1574,7 +1574,7 @@ }, { "Input": "one hundred thirty-two fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred thirty-two fifths", @@ -1590,7 +1590,7 @@ }, { "Input": "one hundred and thirty-two fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred and thirty-two fifths", @@ -1606,7 +1606,7 @@ }, { "Input": "one hundred and thirty and two fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred and thirty and two fifths", @@ -1622,7 +1622,7 @@ }, { "Input": "one hundred thirty-fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred thirty-fifths", @@ -1638,7 +1638,7 @@ }, { "Input": "one one hundred fifth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one one hundred fifth", @@ -1654,7 +1654,7 @@ }, { "Input": "one one hundred and fifth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one one hundred and fifth", @@ -1670,7 +1670,7 @@ }, { "Input": "one hundred one thousand fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one hundred one thousand fifths", @@ -1686,7 +1686,7 @@ }, { "Input": "one over three", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one over three", @@ -1702,7 +1702,7 @@ }, { "Input": "1 over twenty-one", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1 over twenty-one", @@ -1718,7 +1718,7 @@ }, { "Input": "1 over one hundred and twenty one", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1 over one hundred and twenty one", @@ -1734,7 +1734,7 @@ }, { "Input": "1 over three", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1 over three", @@ -1750,7 +1750,7 @@ }, { "Input": "1 over 3", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1 over 3", @@ -1766,7 +1766,7 @@ }, { "Input": "one over 3", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one over 3", @@ -1782,7 +1782,7 @@ }, { "Input": "one over 20", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one over 20", @@ -1798,7 +1798,7 @@ }, { "Input": "one over twenty", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one over twenty", @@ -1814,7 +1814,7 @@ }, { "Input": "one over one hundred", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one over one hundred", @@ -1830,7 +1830,7 @@ }, { "Input": "one over one hundred and twenty five", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one over one hundred and twenty five", @@ -1846,7 +1846,7 @@ }, { "Input": "ninety - five hundred fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "ninety - five hundred fifths", @@ -1862,12 +1862,12 @@ }, { "Input": "Book a first class seat to seattle", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [] }, { "Input": "The answer is negative ninety - five hundred fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "negative ninety - five hundred fifths", @@ -1883,7 +1883,7 @@ }, { "Input": "The answer is minus ninety - five hundred fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "minus ninety - five hundred fifths", @@ -1899,7 +1899,7 @@ }, { "Input": "The answer is minus one", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "minus one", @@ -1915,7 +1915,7 @@ }, { "Input": "The answer is minus one hundred thirty fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "minus one hundred thirty fifths", @@ -1931,7 +1931,7 @@ }, { "Input": "The answer is negative one over 20", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "negative one over 20", @@ -1947,7 +1947,7 @@ }, { "Input": "The answer is minus five point five", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "minus five point five", @@ -1963,7 +1963,7 @@ }, { "Input": "The answer is minus 5", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "minus 5", @@ -1979,7 +1979,7 @@ }, { "Input": "one - fourth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one - fourth", @@ -1995,7 +1995,7 @@ }, { "Input": "one-eighth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one-eighth", @@ -2011,7 +2011,7 @@ }, { "Input": "five - eighths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "five - eighths", @@ -2027,7 +2027,7 @@ }, { "Input": "ninety - five hundred-fifths", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "ninety - five hundred-fifths", @@ -2043,7 +2043,7 @@ }, { "Input": "one out of three", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "one out of three", @@ -2085,7 +2085,7 @@ }, { "Input": "five eighths of", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "five eighths", @@ -2101,7 +2101,7 @@ }, { "Input": "1 234 567", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1 234 567", @@ -2117,7 +2117,7 @@ }, { "Input": "40 000 is the same as 40 000", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "40 000", @@ -2143,7 +2143,7 @@ }, { "Input": "For now, China's population is 1 414 021 100.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1 414 021 100", @@ -2159,7 +2159,7 @@ }, { "Input": "423 0000 will be recognized as two numbers.", - "NotSupported": "javascript, python", + "NotSupported": "javascript ", "Results": [ { "Text": "423", @@ -2195,7 +2195,7 @@ }, { "Input": "1 234 567.89 is a valid number format.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1 234 567.89", @@ -2211,7 +2211,7 @@ }, { "Input": "zero is 0", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "zero", @@ -2319,7 +2319,7 @@ }, { "Input": "I can give you 1M.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "1m", @@ -2335,12 +2335,12 @@ }, { "Input": "1m isn't a number.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [] }, { "Input": "I can give you 3 hundred and 21 yuan.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "3 hundred and 21", @@ -2404,7 +2404,7 @@ }, { "Input": "4000 3 hundred and 21 are two valid numbers.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "4000", @@ -2473,7 +2473,7 @@ }, { "Input": "3 hundred and 2.12 hundred are two valid numbers.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "3 hundred", @@ -2543,7 +2543,7 @@ }, { "Input": "3 hundred and one is a valid numbers.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "3 hundred and one", diff --git a/Specs/Number/English/OrdinalModel.json b/Specs/Number/English/OrdinalModel.json index 8e5e219007..8935ef07d7 100644 --- a/Specs/Number/English/OrdinalModel.json +++ b/Specs/Number/English/OrdinalModel.json @@ -335,12 +335,12 @@ }, { "Input": "a trillionth", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { "Input": "a hundred trillionth", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "a hundred trillionth", @@ -357,7 +357,7 @@ }, { "Input": "11th", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "11th", @@ -375,7 +375,7 @@ }, { "Input": "21st", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "21st", @@ -392,7 +392,7 @@ }, { "Input": "30th", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "30th", @@ -409,7 +409,7 @@ }, { "Input": "2nd", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2nd", @@ -426,7 +426,7 @@ }, { "Input": "eleventh", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "eleventh", @@ -443,7 +443,7 @@ }, { "Input": "twentieth", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "twentieth", @@ -461,7 +461,7 @@ }, { "Input": "twenty-fifth", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "twenty-fifth", @@ -478,7 +478,7 @@ }, { "Input": "twenty-first", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "twenty-first", @@ -495,7 +495,7 @@ }, { "Input": "one hundred twenty fifth", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "one hundred twenty fifth", @@ -512,7 +512,7 @@ }, { "Input": "one hundred twenty-fifth", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "one hundred twenty-fifth", @@ -529,7 +529,7 @@ }, { "Input": "trillionth", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "trillionth", @@ -546,7 +546,7 @@ }, { "Input": "twenty-one trillion and three hundred twenty second", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "twenty-one trillion and three hundred twenty second", @@ -563,7 +563,7 @@ }, { "Input": "two hundredth", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "two hundredth", @@ -580,7 +580,7 @@ }, { "Input": "Book a first class seat to seattle", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "first", @@ -613,7 +613,7 @@ }, { "Input": "I like the first one.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "first", @@ -630,7 +630,7 @@ }, { "Input": "Speak the first word.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "first", @@ -664,7 +664,7 @@ }, { "Input": "She finished second!", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "second", @@ -749,7 +749,7 @@ }, { "Input": "Nineth Meeting of the Research Partnership Platform on Competition and Consumer Protection.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "nineth", @@ -879,7 +879,7 @@ }, { "Input": "The measurement has a value of forty two and a third", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "third", @@ -896,7 +896,7 @@ }, { "Input": "The measurement has a value of two hundred thirty two and a thirtieth", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java ", "Results": [ { "Text": "thirtieth", diff --git a/Specs/Number/English/PercentModel.json b/Specs/Number/English/PercentModel.json deleted file mode 100644 index f72a52d5af..0000000000 --- a/Specs/Number/English/PercentModel.json +++ /dev/null @@ -1,267 +0,0 @@ -[ - { - "Input": "100%", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 percent", - "Results": [ - { - "Text": "100 percent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 11 - } - ] - }, - { - "Input": " 100 percentage", - "Results": [ - { - "Text": "100 percentage", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 14 - } - ] - }, - { - "Input": "240 percent", - "Results": [ - { - "Text": "240 percent", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "twenty percent", - "Results": [ - { - "Text": "twenty percent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "thirty percentage", - "Results": [ - { - "Text": "thirty percentage", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "one hundred percent", - "Results": [ - { - "Text": "one hundred percent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "one hundred percents", - "Results": [ - { - "Text": "one hundred percents", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "percents of twenty", - "Results": [ - { - "Text": "percents of twenty", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 17 - } - ] - }, - { - "Input": "percent of 10", - "Results": [ - { - "Text": "percent of 10", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "per cent of twenty-two", - "Results": [ - { - "Text": "per cent of twenty-two", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 21 - } - ] - }, - { - "Input": "per cent of 210", - "Results": [ - { - "Text": "per cent of 210", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "10 percent", - "Results": [ - { - "Text": "10 percent", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "just need minus five percent", - "Results": [ - { - "Text": "minus five percent", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 10, - "End": 27 - } - ] - }, - { - "Input": "You can go to http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 for more details.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "You can go to https://www.test.com/search?q=30%25%2020%", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "Only a small percent attain the top ranks", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "percent", - "TypeName": "percentage", - "Resolution": { - "value": "null" - }, - "Start": 13, - "End": 19 - } - ] - }, - { - "Input": "The table shows the % of increase in the last month", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "%", - "TypeName": "percentage", - "Resolution": { - "value": "null" - }, - "Start": 20, - "End": 20 - } - ] - }, - { - "Input": "How do I calculate a percentage?", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "percentage", - "TypeName": "percentage", - "Resolution": { - "value": "null" - }, - "Start": 21, - "End": 30 - } - ] - } -] \ No newline at end of file diff --git a/Specs/Number/English/PercentModelPercentMode.json b/Specs/Number/English/PercentModelPercentMode.json deleted file mode 100644 index a2cb2d45d6..0000000000 --- a/Specs/Number/English/PercentModelPercentMode.json +++ /dev/null @@ -1,157 +0,0 @@ -[ - { - "Input": "100%", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "twenty percent", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "twenty percent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "one hundred percents", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "one hundred percents", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "percents of twenty", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "percents of twenty", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 17 - } - ] - }, - { - "Input": "one out of three", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "one out of three", - "TypeName": "percentage", - "Resolution": { - "value": "33.3333333333333%" - }, - "Start": 0, - "End": 15 - } - ] - }, - { - "Input": "one in two", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "one in two", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "1/4 of", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "1/4 of", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "one fourth of", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "one fourth of", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "one half of", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "one half of", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "one quarter of", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "one quarter of", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "one third", - "NotSupported": "javascript, python", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/Number/French/NumberModel.json b/Specs/Number/French/NumberModel.json index 69c3d4b8ef..ef3f0fa7d9 100644 --- a/Specs/Number/French/NumberModel.json +++ b/Specs/Number/French/NumberModel.json @@ -1850,12 +1850,12 @@ }, { "Input": "le liquide de 180,25ml", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [] }, { "Input": "29km de route", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [] }, { @@ -1865,7 +1865,7 @@ }, { "Input": "le liquide de 0,25ml", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [] }, { @@ -2067,7 +2067,7 @@ }, { "Input": "1234567.0", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1234567.0", @@ -2691,7 +2691,7 @@ }, { "Input": "1,2b", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript , java", "Results": [ { "Text": "1,2b", @@ -3761,22 +3761,22 @@ }, { "Input": "Celle que vous avez mentionnée n'est pas valable", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript , java", "Results": [] }, { "Input": "Celui-ci n'est pas correct", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript , java", "Results": [] }, { "Input": "lequel préfères-tu ?", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript , java", "Results": [] }, { "Input": "Celui-là est vraiment bon", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript , java", "Results": [] }, { @@ -4386,5 +4386,253 @@ "End": 37 } ] + }, + { + "Input": "septante", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "septante", + "TypeName": "number", + "Resolution": { + "value": "70" + }, + "Start": 0, + "End": 7 + } + ] + }, + { + "Input": "vingt-et-un", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "vingt-et-un", + "TypeName": "number", + "Resolution": { + "value": "21" + }, + "Start": 0, + "End": 10 + } + ] + }, + { + "Input": "nonante-et-un", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "nonante-et-un", + "TypeName": "number", + "Resolution": { + "value": "91" + }, + "Start": 0, + "End": 12 + } + ] + }, + { + "Input": "cent-et-un", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "cent-et-un", + "TypeName": "number", + "Resolution": { + "value": "101" + }, + "Start": 0, + "End": 9 + } + ] + }, + { + "Input": "cent-vingt", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "cent-vingt", + "TypeName": "number", + "Resolution": { + "value": "120" + }, + "Start": 0, + "End": 9 + } + ] + }, + { + "Input": "deux-cents", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "deux-cents", + "TypeName": "number", + "Resolution": { + "value": "200" + }, + "Start": 0, + "End": 9 + } + ] + }, + { + "Input": "vingt-et-un ou plus", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "vingt-et-un", + "TypeName": "number", + "Resolution": { + "value": "21" + }, + "Start": 0, + "End": 10 + } + ] + }, + { + "Input": "Le nombre correct est cent-et-un", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "cent-et-un", + "TypeName": "number", + "Resolution": { + "value": "101" + }, + "Start": 22, + "End": 31 + } + ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } ] diff --git a/Specs/Number/French/OrdinalModel.json b/Specs/Number/French/OrdinalModel.json index 1d0cf5c834..0924b640fe 100644 --- a/Specs/Number/French/OrdinalModel.json +++ b/Specs/Number/French/OrdinalModel.json @@ -909,7 +909,7 @@ }, { "Input": "vingtième", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "vingtième", @@ -1011,7 +1011,7 @@ }, { "Input": "deux centième", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "deux centième", diff --git a/Specs/Number/French/OrdinalModelSuppressExtendedTypes.json b/Specs/Number/French/OrdinalModelSuppressExtendedTypes.json index 10ab577cdc..9f8ec7b26b 100644 --- a/Specs/Number/French/OrdinalModelSuppressExtendedTypes.json +++ b/Specs/Number/French/OrdinalModelSuppressExtendedTypes.json @@ -133,7 +133,7 @@ }, { "Input": "tierce", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "tierce", diff --git a/Specs/Number/French/PercentModel.json b/Specs/Number/French/PercentModel.json deleted file mode 100644 index 1615aab0aa..0000000000 --- a/Specs/Number/French/PercentModel.json +++ /dev/null @@ -1,470 +0,0 @@ -[ - { - "Input": "100%", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 pourcent", - "Results": [ - { - "Text": "100 pourcent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 12 - } - ] - }, - { - "Input": "120 pourcent", - "Results": [ - { - "Text": "120 pourcent", - "TypeName": "percentage", - "Resolution": { - "value": "120%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "10 pourcents", - "Results": [ - { - "Text": "10 pourcents", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": " 100 pourcentage", - "Results": [ - { - "Text": "100 pourcentage", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 15 - } - ] - }, - { - "Input": "240 pourcent", - "Results": [ - { - "Text": "240 pourcent", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "vingt pourcent", - "Results": [ - { - "Text": "vingt pourcent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "trente pourcentage", - "Results": [ - { - "Text": "trente pourcentage", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 17 - } - ] - }, - { - "Input": "cent pourcent", - "Results": [ - { - "Text": "cent pourcent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "cent pourcentages", - "Results": [ - { - "Text": "cent pourcentages", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "pourcentage de vingt", - "Results": [ - { - "Text": "pourcentage de vingt", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "4,800%", - "Results": [ - { - "Text": "4,800%", - "TypeName": "percentage", - "Resolution": { - "value": "4,8%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "pourcent des trois cent cinq", - "Results": [ - { - "Text": "pourcent des trois cent cinq", - "TypeName": "percentage", - "Resolution": { - "value": "305%" - }, - "Start": 0, - "End": 27 - } - ] - }, - { - "Input": "9,2321312%", - "Results": [ - { - "Text": "9,2321312%", - "TypeName": "percentage", - "Resolution": { - "value": "9,2321312%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "cinq cent trente cinq pourcent", - "Results": [ - { - "Text": "cinq cent trente cinq pourcent", - "TypeName": "percentage", - "Resolution": { - "value": "535%" - }, - "Start": 0, - "End": 29 - } - ] - }, - { - "Input": "1,1^23 pourcent", - "Results": [ - { - "Text": "1,1^23 pourcent", - "TypeName": "percentage", - "Resolution": { - "value": "8,95430243255239%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "vous pouvez aller à http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 pour plus de détails", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "vous pouvez aller à https://www.test.com/search?q=30%25%2020%", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "cent pour cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "cent pour cent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "100 pour-cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "100 pour-cent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "100 pour cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "100 pour cent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "100 pourcentage", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "100 pourcentage", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 15 - } - ] - }, - { - "Input": "deux cent quarante pour-cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "deux cent quarante pour-cent", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 28 - } - ] - }, - { - "Input": "vingt pour cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "vingt pour cent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 15 - } - ] - }, - { - "Input": "cent pour cent.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "cent pour cent.", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 15 - } - ] - }, - { - "Input": "cent pour-cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "cent pour-cent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "vingt pour-cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "vingt pour-cent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 15 - } - ] - }, - { - "Input": "dix pour cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "dix pour cent", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "vingt-deux pour-cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "vingt-deux pour-cent", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 20 - } - ] - }, - { - "Input": "deux cent dix pour-cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "deux cent dix pour-cent", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 0, - "End": 23 - } - ] - }, - { - "Input": "dix pour-cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "dix pour-cent", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "juste demander de soustraire cinq pour-cent", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "soustraire cinq pour-cent", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 18, - "End": 43 - } - ] - }, - { - "Input": "vous pouvez aller sur http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 pour plus de détails.", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "Vous pouvez aller sur https://www.test.com/search?q=30%25%2020%", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - } -] diff --git a/Specs/Number/French/PercentModelPercentMode.json b/Specs/Number/French/PercentModelPercentMode.json deleted file mode 100644 index 2a356ed42b..0000000000 --- a/Specs/Number/French/PercentModelPercentMode.json +++ /dev/null @@ -1,142 +0,0 @@ -[ - { - "Input": "100%", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "vingt pour cent", - "NotSupported": "dotnet, java, javascript, python", - "Results": [ - { - "Text": "vingt pour cent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "cent pour cent", - "NotSupported": "dotnet, java, javascript, python", - "Results": [ - { - "Text": "cent pour cent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "vingt pourcents", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "vingt pourcents", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "un sur trois", - "NotSupported": "dotnet, java, javascript, python", - "Results": [ - { - "Text": "un sur trois", - "TypeName": "percentage", - "Resolution": { - "value": "33.3333333333333%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "un sur deux", - "NotSupported": "dotnet, java, javascript, python", - "Results": [ - { - "Text": "un sur deux", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "1/4 de", - "NotSupported": "dotnet, java, javascript, python", - "Results": [ - { - "Text": "1/4 de", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "un quart de", - "NotSupported": "dotnet, java, javascript, python", - "Results": [ - { - "Text": "un quart de", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "une moitié de", - "NotSupported": "dotnet, java, javascript, python", - "Results": [ - { - "Text": "une moitié de", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "un tiers", - "NotSupported": "javascript, python", - "Results": [] - } -] diff --git a/Specs/Number/German/NumberModel.json b/Specs/Number/German/NumberModel.json index 0d3ae82fd2..b8f001681f 100644 --- a/Specs/Number/German/NumberModel.json +++ b/Specs/Number/German/NumberModel.json @@ -784,7 +784,7 @@ }, { "Input": "Es gibt anderthalb Stücke", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "anderthalb", @@ -799,7 +799,7 @@ }, { "Input": "Es gibt einundhalb Stücke", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "einundhalb", @@ -814,7 +814,7 @@ }, { "Input": "Es gibt dreiviertel Stücke", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "dreiviertel", @@ -829,7 +829,7 @@ }, { "Input": "Es gibt zweieinhalb Stücke", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "zweieinhalb", @@ -844,7 +844,7 @@ }, { "Input": "Es gibt dreieinhalb Stücke", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "dreieinhalb", @@ -1038,5 +1038,193 @@ "End": 40 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "100,50", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "100,50", + "TypeName": "number", + "Resolution": { + "value": "100,5" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "2.000,99", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "2.000,99", + "TypeName": "number", + "Resolution": { + "value": "2000,99" + }, + "Start": 0, + "End": 7 + } + ] + }, + { + "Input": "1000,50", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "1000,50", + "TypeName": "number", + "Resolution": { + "value": "1000,5" + }, + "Start": 0, + "End": 6 + } + ] + }, + { + "Input": "1000000,50", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "1000000,50", + "TypeName": "number", + "Resolution": { + "value": "1000000,5" + }, + "Start": 0, + "End": 9 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/German/PercentModel.json b/Specs/Number/German/PercentModel.json deleted file mode 100644 index 8fb04cbb47..0000000000 --- a/Specs/Number/German/PercentModel.json +++ /dev/null @@ -1,207 +0,0 @@ -[ - { - "Input": "100%", - "NotSupported": "javascript", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "NotSupported": "javascript", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 Prozent", - "NotSupported": "javascript", - "Results": [ - { - "Text": "100 prozent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 11 - } - ] - }, - { - "Input": "240 Prozent", - "NotSupported": "javascript", - "Results": [ - { - "Text": "240 prozent", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "zwanzig Prozent", - "NotSupported": "javascript", - "Results": [ - { - "Text": "zwanzig prozent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "dreißig Prozent", - "NotSupported": "javascript", - "Results": [ - { - "Text": "dreißig prozent", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "einhundert Prozent", - "NotSupported": "javascript", - "Results": [ - { - "Text": "einhundert prozent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 17 - } - ] - }, - { - "Input": "10 Prozent", - "NotSupported": "javascript", - "Results": [ - { - "Text": "10 prozent", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "siebenunddreißig Prozent", - "NotSupported": "javascript", - "Results": [ - { - "Text": "siebenunddreißig prozent", - "TypeName": "percentage", - "Resolution": { - "value": "37%" - }, - "Start": 0, - "End": 23 - } - ] - }, - { - "Input": "einhundertneunundneunzig Prozent", - "NotSupported": "javascript", - "Results": [ - { - "Text": "einhundertneunundneunzig prozent", - "TypeName": "percentage", - "Resolution": { - "value": "199%" - }, - "Start": 0, - "End": 31 - } - ] - }, - { - "Input": "Wenn er nicht einhundert Prozent gibt, wird er damit nicht mehr rechtzeitig fertig", - "NotSupported": "javascript", - "Results": [ - { - "Text": "einhundert prozent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 14, - "End": 31 - } - ] - }, - { - "Input": "Der Umsatz sank in der zweiten Jahreshälfte um 27% auf 300 000 GBP", - "NotSupported": "javascript", - "Results": [ - { - "Text": "27%", - "TypeName": "percentage", - "Resolution": { - "value": "27%" - }, - "Start": 47, - "End": 49 - } - ] - }, - { - "Input": "Sie können zu http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 für mehr Details gehen", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "Sie können zu https://www.test.com/search?q=30%25%2020% für mehr Details gehen", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "Diese 15 Prozentpunkte stellen den stärksten Rückgang in diesem Jahr dar.", - "NotSupported": "javascript", - "Results": [ - { - "Text": "15 prozentpunkte", - "TypeName": "percentage", - "Resolution": { - "value": "15%" - }, - "Start": 6, - "End": 21 - } - ] - } -] \ No newline at end of file diff --git a/Specs/Number/Hindi/NumberModel.json b/Specs/Number/Hindi/NumberModel.json index 710f1da8e1..64bae1ccb6 100644 --- a/Specs/Number/Hindi/NumberModel.json +++ b/Specs/Number/Hindi/NumberModel.json @@ -3064,5 +3064,133 @@ "End": 28 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Hindi/PercentModel.json b/Specs/Number/Hindi/PercentModel.json deleted file mode 100644 index 465ade42f6..0000000000 --- a/Specs/Number/Hindi/PercentModel.json +++ /dev/null @@ -1,222 +0,0 @@ -[ - { - "Input": "100%", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 परसेंट", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 परसेंट", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 10 - } - ] - }, - { - "Input": " 100 प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 11 - } - ] - }, - { - "Input": "240 प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "240 प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "बीस प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "बीस प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "तीस प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "तीस प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "एक सौ प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "एक सौ प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "बीस का प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "बीस का प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "10 का प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 का प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "बाईस का प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "बाईस का प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "210 का प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "210 का प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "10 प्रतिशत", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "बस माइनस पांच प्रतिशत चाहिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "माइनस पांच प्रतिशत", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 3, - "End": 20 - } - ] - }, - { - "Input": "अधिक विवरण के लिए आप http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 जा सकते हैं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "आप यहां जा सकते हैं https://www.test.com/search?q=30%25%2020%", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/Number/Italian/NumberModel.json b/Specs/Number/Italian/NumberModel.json index 2d1f098ebe..503d56f12b 100644 --- a/Specs/Number/Italian/NumberModel.json +++ b/Specs/Number/Italian/NumberModel.json @@ -1378,7 +1378,7 @@ }, { "Input": "uno e mezzo", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "uno e mezzo", @@ -1918,7 +1918,7 @@ }, { "Input": "cinquanta su duemilacinque", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "cinquanta su duemilacinque", @@ -2273,5 +2273,133 @@ "End": 33 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Italian/OrdinalModel.json b/Specs/Number/Italian/OrdinalModel.json index 73439b92e4..0e8b6c8242 100644 --- a/Specs/Number/Italian/OrdinalModel.json +++ b/Specs/Number/Italian/OrdinalModel.json @@ -239,7 +239,7 @@ }, { "Input": "trentaseiesimo", - "NotSupportedByDesign": "javascript,python", + "NotSupportedByDesign": "javascript", "Results": [ { "Text": "trentaseiesimo", diff --git a/Specs/Number/Italian/PercentModel.json b/Specs/Number/Italian/PercentModel.json deleted file mode 100644 index 4c59526f86..0000000000 --- a/Specs/Number/Italian/PercentModel.json +++ /dev/null @@ -1,167 +0,0 @@ -[ - { - "Input": "100%", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 percento", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "100 percento", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 12 - } - ] - }, - { - "Input": " 100 percentuale", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "100 percentuale", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 15 - } - ] - }, - { - "Input": "240 percento", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "240 percento", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "venti percento", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "venti percento", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "il sistema è il ventisette percento più efficiente", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "ventisette percento", - "TypeName": "percentage", - "Resolution": { - "value": "27%" - }, - "Start": 16, - "End": 34 - } - ] - }, - { - "Input": "trenta percento", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "trenta percento", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "trenta %", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "trenta %", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "cento percento", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "cento percento", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "10 percento", - "NotSupportedByDesign": "javascript,java", - "Results": [ - { - "Text": "10 percento", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 10 - } - ] - } -] \ No newline at end of file diff --git a/Specs/Number/Japanese/NumberModel.json b/Specs/Number/Japanese/NumberModel.json index ffa9513c90..3d631e2ea3 100644 --- a/Specs/Number/Japanese/NumberModel.json +++ b/Specs/Number/Japanese/NumberModel.json @@ -975,7 +975,7 @@ }, { "Input": "2222.2222.22222.222", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2222", @@ -1457,7 +1457,7 @@ { "Input": "答えは192です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "192", @@ -1493,7 +1493,7 @@ { "Input": "上昇率は0.23456000です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "0.23456000", @@ -1510,7 +1510,7 @@ { "Input": "この答えは4.800です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4.800", @@ -1527,7 +1527,7 @@ { "Input": "この算数の問題の答えは、103と3分の2です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "103と3分の2", @@ -1544,7 +1544,7 @@ { "Input": "倍率は16です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "16", @@ -1561,7 +1561,7 @@ { "Input": "宿題の3分の2が終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3分の2", @@ -1578,7 +1578,7 @@ { "Input": "答えは116です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "116", @@ -1595,7 +1595,7 @@ { "Input": "答えは106です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "106", @@ -1612,7 +1612,7 @@ { "Input": "今のWTOの加盟国は161です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "161", @@ -1663,7 +1663,7 @@ { "Input": "鉛筆を3ダース買いました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3ダース", @@ -1680,7 +1680,7 @@ { "Input": "ペンが1ダース千円で売られています。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1ダース", @@ -1716,7 +1716,7 @@ { "Input": "1,234,567は素数ではありません。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1,234,567", @@ -1733,7 +1733,7 @@ { "Input": "1と234と567は有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1", @@ -1770,7 +1770,7 @@ { "Input": "答えは9.2321312です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "9.2321312", @@ -1855,7 +1855,7 @@ { "Input": "3は奇数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3", @@ -1872,7 +1872,7 @@ { "Input": "答えは123456789101231です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "123456789101231", @@ -1923,7 +1923,7 @@ { "Input": "1は最小の正の整数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1", @@ -1940,7 +1940,7 @@ { "Input": "答えは1万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1万", @@ -1957,7 +1957,7 @@ { "Input": "答えは10万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "10万", @@ -1974,7 +1974,7 @@ { "Input": "答えは100億です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "100億", @@ -2008,7 +2008,7 @@ { "Input": "答えは200万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "200万", @@ -2025,7 +2025,7 @@ { "Input": "答えは1兆です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1兆", @@ -2042,7 +2042,7 @@ { "Input": "3は素数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3", @@ -2059,7 +2059,7 @@ { "Input": "答えは21兆です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21兆", @@ -2076,7 +2076,7 @@ { "Input": "答えは21兆300です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21兆300", @@ -2093,7 +2093,7 @@ { "Input": "331は奇数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "331", @@ -2110,7 +2110,7 @@ { "Input": "20万2000は実数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20万2000", @@ -2127,7 +2127,7 @@ { "Input": "2200は奇数ではありません。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2200", @@ -2144,7 +2144,7 @@ { "Input": "200.03は小数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "200.03", @@ -2161,7 +2161,7 @@ { "Input": "答えは200.71です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "200.71", @@ -2216,7 +2216,7 @@ { "Input": "答えは3万2200です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3万2200", @@ -2233,7 +2233,7 @@ { "Input": "70は整数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "70", @@ -2250,7 +2250,7 @@ { "Input": "52は偶数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "52", @@ -2267,7 +2267,7 @@ { "Input": "答えは2と4分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2と4分の1", @@ -2284,7 +2284,7 @@ { "Input": "答えは4分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4分の3", @@ -2301,7 +2301,7 @@ { "Input": "ピザを8分の1だけ食べました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "8分の1", @@ -2318,7 +2318,7 @@ { "Input": "ケーキがまだ8分の5くらい残っています。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "8分の5", @@ -2335,7 +2335,7 @@ { "Input": "水をバケツの4分の3入れます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4分の3", @@ -2352,7 +2352,7 @@ { "Input": "答えは20と5分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20と5分の3", @@ -2369,7 +2369,7 @@ { "Input": "5分の23は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の23", @@ -2386,7 +2386,7 @@ { "Input": "答えは23と5分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "23と5分の3", @@ -2420,7 +2420,7 @@ { "Input": "答えは1と2分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1と2分の1", @@ -2437,7 +2437,7 @@ { "Input": "答えは1と4分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1と4分の1", @@ -2454,7 +2454,7 @@ { "Input": "答えは5と4分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5と4分の1", @@ -2471,7 +2471,7 @@ { "Input": "答えは100と4分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "100と4分の3", @@ -2488,7 +2488,7 @@ { "Input": "100分の1が答えです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "100分の1", @@ -2657,7 +2657,7 @@ { "Input": "夏休みの宿題が5分の1終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の1", @@ -2691,7 +2691,7 @@ { "Input": "夏休みの宿題が5分の3終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の3", @@ -2708,7 +2708,7 @@ { "Input": "5分の20は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の20", @@ -2725,7 +2725,7 @@ { "Input": "3と5分の1は帯分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3と5分の1", @@ -2742,7 +2742,7 @@ { "Input": "5分の21は帯分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の21", @@ -2759,7 +2759,7 @@ { "Input": "答えは25分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "25分の1", @@ -2776,7 +2776,7 @@ { "Input": "答えは21分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21分の3", @@ -2793,7 +2793,7 @@ { "Input": "25分の20はまだ約分できます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "25分の20", @@ -2810,7 +2810,7 @@ { "Input": "答えは5分の130です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の130", @@ -2827,7 +2827,7 @@ { "Input": "答えは35分の100です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "35分の100", @@ -2844,7 +2844,7 @@ { "Input": "答えは5分の132です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の132", @@ -2861,7 +2861,7 @@ { "Input": "答えは130と5分の2です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "130と5分の2", @@ -2878,7 +2878,7 @@ { "Input": "答えは105分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "105分の1", @@ -2895,7 +2895,7 @@ { "Input": "答えは1005分の100です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1005分の100", @@ -2912,7 +2912,7 @@ { "Input": "答えは21分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21分の1", @@ -2946,7 +2946,7 @@ { "Input": "答えは3分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3分の1", @@ -2963,7 +2963,7 @@ { "Input": "答えは20分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20分の1", @@ -2980,7 +2980,7 @@ { "Input": "答えは100分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "100分の1", @@ -2997,7 +2997,7 @@ { "Input": "答えは125分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "125分の1", @@ -3014,7 +3014,7 @@ { "Input": "5分の9500はいくつですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の9500", @@ -3133,7 +3133,7 @@ { "Input": "答えは4分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4分の1", @@ -3150,7 +3150,7 @@ { "Input": "答えは8分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "8分の1", @@ -3167,7 +3167,7 @@ { "Input": "答えは8分の5です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "8分の5", @@ -3184,7 +3184,7 @@ { "Input": "4万と4万は同じです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4万", @@ -3211,7 +3211,7 @@ { "Input": "現在、中国の人口は14億1402万1100人です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "14億1402万1100", @@ -3228,7 +3228,7 @@ { "Input": "423 0000は2つの数値として認識されます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "423", @@ -3283,7 +3283,7 @@ { "Input": "0は0です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "0", @@ -3347,7 +3347,7 @@ { "Input": "私の電話番号は、プラス1の222の2222の2222です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1", @@ -3394,7 +3394,7 @@ { "Input": "私はあなたに1000万あげることができます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1000万", @@ -3411,7 +3411,7 @@ { "Input": "私はあなたに321元をあげることができます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "321", @@ -3428,7 +3428,7 @@ { "Input": "4321は有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4321", @@ -3445,7 +3445,7 @@ { "Input": "4300と0は2つの有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4300", @@ -3482,7 +3482,7 @@ { "Input": "4000と321は2つの有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4000", @@ -3519,7 +3519,7 @@ { "Input": "300と200は2つの有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "300", @@ -3593,7 +3593,7 @@ { "Input": "301は有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "301", @@ -3637,7 +3637,7 @@ { "Input": "テチマンで26人が事故死した。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "26", @@ -3654,7 +3654,7 @@ { "Input": "私は3年内に1万ドル稼ぎたいです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3", @@ -3681,7 +3681,7 @@ { "Input": "私は3年で2000ドル稼ぎたいです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3", @@ -3708,7 +3708,7 @@ { "Input": "3分の2000は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3分の2000", @@ -3725,7 +3725,7 @@ { "Input": "20ドルが必要です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20", @@ -3741,17 +3741,17 @@ }, { "Input": "このボトルには水が180.25ミリリットル入れられます。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "このボトルには水が180ミリリットル入れられます。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "会社から自宅までの距離は29キロメートルです。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { @@ -3774,7 +3774,7 @@ { "Input": "答えは192です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "192", @@ -3791,7 +3791,7 @@ { "Input": "私のパソコンのIPアドレスは192.168.1.2です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "192", @@ -3857,7 +3857,7 @@ { "Input": "上昇率は0.23456000です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "0.23456000", @@ -3874,7 +3874,7 @@ { "Input": "この答えは4.800です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4.800", @@ -3891,7 +3891,7 @@ { "Input": "この算数の問題の答えは、103と3分の2です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "103と3分の2", @@ -3908,7 +3908,7 @@ { "Input": "倍率は16です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "16", @@ -3925,7 +3925,7 @@ { "Input": "宿題の3分の2が終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3分の2", @@ -3942,7 +3942,7 @@ { "Input": "答えは116です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "116", @@ -3959,7 +3959,7 @@ { "Input": "答えは106です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "106", @@ -3976,7 +3976,7 @@ { "Input": "今のWTOの加盟国は161です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "161", @@ -4027,7 +4027,7 @@ { "Input": "鉛筆を3ダース買いました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3ダース", @@ -4044,7 +4044,7 @@ { "Input": "ペンが1ダース単位で売られています。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1ダース", @@ -4080,7 +4080,7 @@ { "Input": "1,234,567は素数ではありません。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1,234,567", @@ -4097,7 +4097,7 @@ { "Input": "1, 234, 567は素数ではありません。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1", @@ -4134,7 +4134,7 @@ { "Input": "答えは9.2321312です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "9.2321312", @@ -4151,7 +4151,7 @@ { "Input": "答えは-9.2321312です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-9.2321312", @@ -4168,7 +4168,7 @@ { "Input": "最大の負の整数は-1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-1", @@ -4185,7 +4185,7 @@ { "Input": "出生率は-5分の4です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-5分の4", @@ -4202,7 +4202,7 @@ { "Input": "答えは-1と5分の4です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-1と5分の4", @@ -4219,7 +4219,7 @@ { "Input": "3は奇数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3", @@ -4236,7 +4236,7 @@ { "Input": "答えは123456789101231です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "123456789101231", @@ -4253,7 +4253,7 @@ { "Input": "答えは-123456789101231です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-123456789101231", @@ -4270,7 +4270,7 @@ { "Input": "答えは -123456789101231です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-123456789101231", @@ -4287,7 +4287,7 @@ { "Input": "1は最小の正の整数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1", @@ -4304,7 +4304,7 @@ { "Input": "答えは1万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1万", @@ -4321,7 +4321,7 @@ { "Input": "答えは10万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "10万", @@ -4338,7 +4338,7 @@ { "Input": "答えは100億です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "100億", @@ -4355,7 +4355,7 @@ { "Input": "答え-1万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-1万", @@ -4372,7 +4372,7 @@ { "Input": "答えは200万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "200万", @@ -4389,7 +4389,7 @@ { "Input": "答えは1兆です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1兆", @@ -4406,7 +4406,7 @@ { "Input": "3は素数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3", @@ -4423,7 +4423,7 @@ { "Input": "答えは21兆です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21兆", @@ -4440,7 +4440,7 @@ { "Input": "答えは21兆300です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21兆300", @@ -4457,7 +4457,7 @@ { "Input": "331は奇数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "331", @@ -4474,7 +4474,7 @@ { "Input": "20万2000は実数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20万2000", @@ -4491,7 +4491,7 @@ { "Input": "2200は奇数ではありません。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2200", @@ -4508,7 +4508,7 @@ { "Input": "200.03は小数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "200.03", @@ -4525,7 +4525,7 @@ { "Input": "答えは200.71です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "200.71", @@ -4580,7 +4580,7 @@ { "Input": "答えは3万2200です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3万2200", @@ -4597,7 +4597,7 @@ { "Input": "70は整数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "70", @@ -4614,7 +4614,7 @@ { "Input": "52は偶数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "52", @@ -4631,7 +4631,7 @@ { "Input": "答えは2と4分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2と4分の1", @@ -4648,7 +4648,7 @@ { "Input": "答えは4分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4分の3", @@ -4665,7 +4665,7 @@ { "Input": "ピザを8分の1だけ食べました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "8分の1", @@ -4682,7 +4682,7 @@ { "Input": "ケーキがまだ8分の5くらい残っています。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "8分の5", @@ -4699,7 +4699,7 @@ { "Input": "水をバケツの4分の3入れます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4分の3", @@ -4716,7 +4716,7 @@ { "Input": "答えは20と5分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20と5分の3", @@ -4733,7 +4733,7 @@ { "Input": "5分の23は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の23", @@ -4750,7 +4750,7 @@ { "Input": "答えは23と5分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "23と5分の3", @@ -4784,7 +4784,7 @@ { "Input": "答えは1と2分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1と2分の1", @@ -4801,7 +4801,7 @@ { "Input": "答えは1と4分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1と4分の1", @@ -4818,7 +4818,7 @@ { "Input": "答えは5と4分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5と4分の1", @@ -4835,7 +4835,7 @@ { "Input": "答えは100と4分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "100と4分の3", @@ -4852,7 +4852,7 @@ { "Input": "100分の1が答えです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "100分の1", @@ -5021,7 +5021,7 @@ { "Input": "夏休みの宿題が5分の1終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の1", @@ -5055,7 +5055,7 @@ { "Input": "夏休みの宿題が5分の3終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の3", @@ -5072,7 +5072,7 @@ { "Input": "5分の20は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の20", @@ -5089,7 +5089,7 @@ { "Input": "3と5分の1は帯分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3と5分の1", @@ -5106,7 +5106,7 @@ { "Input": "5分の21は帯分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の21", @@ -5123,7 +5123,7 @@ { "Input": "答えは25分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "25分の1", @@ -5140,7 +5140,7 @@ { "Input": "答えは21分の3です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21分の3", @@ -5157,7 +5157,7 @@ { "Input": "25分の20はまだ約分できます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "25分の20", @@ -5174,7 +5174,7 @@ { "Input": "答えは5分の130です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の130", @@ -5191,7 +5191,7 @@ { "Input": "答えは35分の100です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "35分の100", @@ -5208,7 +5208,7 @@ { "Input": "答えは5分の132です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の132", @@ -5225,7 +5225,7 @@ { "Input": "答えは130と5分の2です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "130と5分の2", @@ -5242,7 +5242,7 @@ { "Input": "答えは105分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "105分の1", @@ -5259,7 +5259,7 @@ { "Input": "答えは1005分の100です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1005分の100", @@ -5293,7 +5293,7 @@ { "Input": "答えは3分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3分の1", @@ -5310,7 +5310,7 @@ { "Input": "答えは20分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20分の1", @@ -5327,7 +5327,7 @@ { "Input": "答えは100分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "100分の1", @@ -5344,7 +5344,7 @@ { "Input": "答えは125分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "125分の1", @@ -5361,7 +5361,7 @@ { "Input": "5分の9500はいくつですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "5分の9500", @@ -5378,7 +5378,7 @@ { "Input": "答えは-5分の9500です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-5分の9500", @@ -5395,7 +5395,7 @@ { "Input": "答えは-1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-1", @@ -5412,7 +5412,7 @@ { "Input": "答えは-35分の100です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-35分の100", @@ -5446,7 +5446,7 @@ { "Input": "答えは-5.5です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-5.5", @@ -5463,7 +5463,7 @@ { "Input": "答えは-5です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-5", @@ -5480,7 +5480,7 @@ { "Input": "答えは4分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4分の1", @@ -5497,7 +5497,7 @@ { "Input": "答えは8分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "8分の1", @@ -5514,7 +5514,7 @@ { "Input": "答えは21分の1です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21分の1", @@ -5531,7 +5531,7 @@ { "Input": "答えは8分の5です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "8分の5", @@ -5548,7 +5548,7 @@ { "Input": "答えは1234567です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1234567", @@ -5565,7 +5565,7 @@ { "Input": "4万と4万は同じです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4万", @@ -5592,7 +5592,7 @@ { "Input": "現在、中国の人口は14億1402万1100人です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "14億1402万1100", @@ -5609,7 +5609,7 @@ { "Input": "423 0000は二つの数値として認識されます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "423", @@ -5663,7 +5663,7 @@ { "Input": "0は0です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "0", @@ -5690,7 +5690,7 @@ { "Input": "2018年5月17日にいつでも会えますか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2018", @@ -5727,7 +5727,7 @@ { "Input": "私の電話番号は、プラス1の222の2222の2222です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1", @@ -5774,7 +5774,7 @@ { "Input": "私はあなたに1000万あげることができます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1000万", @@ -5791,7 +5791,7 @@ { "Input": "私はあなたに321元をあげることができます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "321", @@ -5808,7 +5808,7 @@ { "Input": "4321は有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4321", @@ -5825,7 +5825,7 @@ { "Input": "4300と0は2つの有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4300", @@ -5862,7 +5862,7 @@ { "Input": "4000と321は2つの有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4000", @@ -5899,7 +5899,7 @@ { "Input": "300と200は2つの有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "300", @@ -5936,7 +5936,7 @@ { "Input": "300と-1は2つの有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "300", @@ -5973,7 +5973,7 @@ { "Input": "301は有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "301", @@ -6017,7 +6017,7 @@ { "Input": "テチマンで26人が事故死した。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "26", @@ -6034,7 +6034,7 @@ { "Input": "私は3年以内に1万ドル稼ぎたいです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3", @@ -6061,7 +6061,7 @@ { "Input": "私は3年で2000ドル稼ぎたいです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3", @@ -6088,7 +6088,7 @@ { "Input": "3分の2000は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3分の2000", @@ -6105,7 +6105,7 @@ { "Input": "20ドルが必要です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20", @@ -6121,17 +6121,17 @@ }, { "Input": "このボトルには水が180.25ミリリットル入れられます。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "このボトルには水が180ミリリットル入れられます。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "会社から自宅までの距離は29キロメートルです。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { @@ -6143,18 +6143,18 @@ }, { "Input": "毎日この薬を0.25 ミリリットル飲んでください。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "1メートルは数字ではありません。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "答えは百九十二です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百九十二", @@ -6222,7 +6222,7 @@ { "Input": "この算数の問題の答えは、百三と三分の二です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百三と三分の二", @@ -6239,7 +6239,7 @@ { "Input": "倍率は十六です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "十六", @@ -6256,7 +6256,7 @@ { "Input": "宿題の三分の二が終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三分の二", @@ -6273,7 +6273,7 @@ { "Input": "答えは百十六です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百十六", @@ -6290,7 +6290,7 @@ { "Input": "答えは百六です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百六", @@ -6307,7 +6307,7 @@ { "Input": "今のWTOの加盟国は百六十一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百六十一", @@ -6324,7 +6324,7 @@ { "Input": "一兆分の一の大きさは目に見えません", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一兆分の一", @@ -6341,7 +6341,7 @@ { "Input": "百億分の一の大きさは目にみえないです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百億分の一", @@ -6358,7 +6358,7 @@ { "Input": "桃を半ダース買いました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "半ダース", @@ -6375,7 +6375,7 @@ { "Input": "鉛筆を三ダース買いました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三ダース", @@ -6392,7 +6392,7 @@ { "Input": "ペンが一ダース千円で売られています。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一ダース", @@ -6426,7 +6426,7 @@ { "Input": "百二十三万四千五百六十七は素数ではありません。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百二十三万四千五百六十七", @@ -6443,7 +6443,7 @@ { "Input": "一と二百三十四と五百六十七は有効な数字です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一", @@ -6514,7 +6514,7 @@ { "Input": "最大の負の整数はマイナス一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "マイナス一", @@ -6531,7 +6531,7 @@ { "Input": "出生率はマイナス五分の四です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "マイナス五分の四", @@ -6548,7 +6548,7 @@ { "Input": "答えはマイナス一と五分の四です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "マイナス一と五分の四", @@ -6565,7 +6565,7 @@ { "Input": "三は奇数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三", @@ -6582,7 +6582,7 @@ { "Input": "一は最小の正の整数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一", @@ -6599,7 +6599,7 @@ { "Input": "答えは一万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一万", @@ -6616,7 +6616,7 @@ { "Input": "答えは十万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "十万", @@ -6633,7 +6633,7 @@ { "Input": "答えは百億です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百億", @@ -6650,7 +6650,7 @@ { "Input": "答えはマイナス一万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "マイナス一万", @@ -6667,7 +6667,7 @@ { "Input": "答えは二百万です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二百万", @@ -6684,7 +6684,7 @@ { "Input": "答えは一兆です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一兆", @@ -6701,7 +6701,7 @@ { "Input": "三は素数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三", @@ -6718,7 +6718,7 @@ { "Input": "答えは二十一兆です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十一兆", @@ -6735,7 +6735,7 @@ { "Input": "答えは二十一兆三百です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十一兆三百", @@ -6752,7 +6752,7 @@ { "Input": "三百三十一は奇数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三百三十一", @@ -6769,7 +6769,7 @@ { "Input": "二十万二千は実数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十万二千", @@ -6786,7 +6786,7 @@ { "Input": "二千二百は奇数ではありません。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二千二百", @@ -6875,7 +6875,7 @@ { "Input": "答えは三万二千二百です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三万二千二百", @@ -6892,7 +6892,7 @@ { "Input": "七十は整数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "七十", @@ -6909,7 +6909,7 @@ { "Input": "五十二は偶数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五十二", @@ -6926,7 +6926,7 @@ { "Input": "答えは二と四分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二と四分の一", @@ -6943,7 +6943,7 @@ { "Input": "答えは四分の三です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "四分の三", @@ -6960,7 +6960,7 @@ { "Input": "ピザを八分の一だけ食べました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "八分の一", @@ -6977,7 +6977,7 @@ { "Input": "ケーキがまだ八分の五くらい残っています。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "八分の五", @@ -7013,7 +7013,7 @@ { "Input": "水をバケツの四分の三入れます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "四分の三", @@ -7030,7 +7030,7 @@ { "Input": "答えは二十と五分の三です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十と五分の三", @@ -7047,7 +7047,7 @@ { "Input": "五分の二十三は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五分の二十三", @@ -7064,7 +7064,7 @@ { "Input": "答えは二十三と五分の三です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十三と五分の三", @@ -7098,7 +7098,7 @@ { "Input": "答えは一と二分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一と二分の一", @@ -7115,7 +7115,7 @@ { "Input": "答えは一と四分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一と四分の一", @@ -7132,7 +7132,7 @@ { "Input": "答えは五と四分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五と四分の一", @@ -7149,7 +7149,7 @@ { "Input": "答えは百と四分の三です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百と四分の三", @@ -7166,7 +7166,7 @@ { "Input": "百分の一が答えです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百分の一", @@ -7335,7 +7335,7 @@ { "Input": "夏休みの宿題が五分の一終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五分の一", @@ -7369,7 +7369,7 @@ { "Input": "夏休みの宿題が五分の三終わりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五分の三", @@ -7386,7 +7386,7 @@ { "Input": "五分の二十は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五分の二十", @@ -7403,7 +7403,7 @@ { "Input": "三と五分の一は帯分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三と五分の一", @@ -7420,7 +7420,7 @@ { "Input": "五分の二十一は帯分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五分の二十一", @@ -7437,7 +7437,7 @@ { "Input": "答えは二十五分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十五分の一", @@ -7454,7 +7454,7 @@ { "Input": "答えは二十一分の三です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十一分の三", @@ -7471,7 +7471,7 @@ { "Input": "二十五分の二十はまだ約分できます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十五分の二十", @@ -7488,7 +7488,7 @@ { "Input": "答えは五分の百三十です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五分の百三十", @@ -7522,7 +7522,7 @@ { "Input": "答えは五分の百三十二です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五分の百三十二", @@ -7539,7 +7539,7 @@ { "Input": "答えは百三十と五分の二です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百三十と五分の二", @@ -7556,7 +7556,7 @@ { "Input": "答えは百五分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百五分の一", @@ -7573,7 +7573,7 @@ { "Input": "答えは千五分の百です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "千五分の百", @@ -7590,7 +7590,7 @@ { "Input": "答えは百二十一分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百二十一分の一", @@ -7607,7 +7607,7 @@ { "Input": "答えは三分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三分の一", @@ -7624,7 +7624,7 @@ { "Input": "答えは二十分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十分の一", @@ -7641,7 +7641,7 @@ { "Input": "答えは百分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百分の一", @@ -7658,7 +7658,7 @@ { "Input": "答えは百二十五分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百二十五分の一", @@ -7675,7 +7675,7 @@ { "Input": "五分の九千五百はいくつですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "五分の九千五百", @@ -7692,7 +7692,7 @@ { "Input": "答えはマイナス五分の九千五百です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "マイナス五分の九千五百", @@ -7709,7 +7709,7 @@ { "Input": "答えはマイナス一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "マイナス一", @@ -7726,7 +7726,7 @@ { "Input": "答えはマイナス三十五分の百です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "マイナス三十五分の百", @@ -7777,7 +7777,7 @@ { "Input": "答えはマイナス五です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "マイナス五", @@ -7794,7 +7794,7 @@ { "Input": "答えは四分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "四分の一", @@ -7811,7 +7811,7 @@ { "Input": "答えは八分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "八分の一", @@ -7828,7 +7828,7 @@ { "Input": "答えは二十一分の一です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十一分の一", @@ -7845,7 +7845,7 @@ { "Input": "答えは八分の五です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "八分の五", @@ -7862,7 +7862,7 @@ { "Input": "答えは百二十三万四千五百六十七です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百二十三万四千五百六十七", @@ -7879,7 +7879,7 @@ { "Input": "四万と四万は同じです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "四万", @@ -7978,7 +7978,7 @@ { "Input": "〇は〇です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "〇", @@ -8089,7 +8089,7 @@ { "Input": "私はあなたに一千万あげることができます。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一千万", @@ -8332,7 +8332,7 @@ { "Input": "テチマンで二十六人が事故死した。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十六", @@ -8368,7 +8368,7 @@ { "Input": "私は三年以内に一万ドル稼ぎたいです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三", @@ -8395,7 +8395,7 @@ { "Input": "私は三年で二千ドル稼ぎたいです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三", @@ -8422,7 +8422,7 @@ { "Input": "三分の二千は仮分数です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三分の二千", @@ -8439,7 +8439,7 @@ { "Input": "二十ドルが必要です。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "二十", @@ -8490,32 +8490,32 @@ }, { "Input": "シアトルへのファーストクラスの席を予約してください。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "一メートルは数字ではありません。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "あなたが言及したものは無効です。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "これはあなたが間違っています。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "どちらをあなたが準備しますか。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "あれは本当にいいです。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { @@ -8550,7 +8550,7 @@ }, { "Input": "2.5", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "2.5", @@ -8565,7 +8565,7 @@ }, { "Input": "400.5", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "400.5", @@ -8580,7 +8580,7 @@ }, { "Input": "答えは四ではなくて、五です。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "四", @@ -8604,7 +8604,7 @@ }, { "Input": "このコンピューターは二ドルです。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [] }, { @@ -8654,7 +8654,7 @@ }, { "Input": "五十", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "五十", @@ -8684,7 +8684,7 @@ }, { "Input": "四百五十", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "四百五十", @@ -8699,7 +8699,7 @@ }, { "Input": "9年8トン", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "9", @@ -8738,7 +8738,7 @@ }, { "Input": "これは5で、あれは4です。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "5", @@ -8804,7 +8804,7 @@ }, { "Input": "百九十九個", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "百九十九", @@ -8824,7 +8824,7 @@ }, { "Input": "マイナス3分のマイナス百五十七", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス3分のマイナス百五十七", @@ -8839,7 +8839,7 @@ }, { "Input": "1001", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1001", @@ -8854,7 +8854,7 @@ }, { "Input": "45642万15", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "45642万15", @@ -8869,7 +8869,7 @@ }, { "Input": "45億4004万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "45億4004万", @@ -8884,7 +8884,7 @@ }, { "Input": "4千万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4千万", @@ -8929,7 +8929,7 @@ }, { "Input": "千五十", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "千五十", @@ -8944,7 +8944,7 @@ }, { "Input": "十万七千八百五十四", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "十万七千八百五十四", @@ -9027,7 +9027,7 @@ }, { "Input": "1万250", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1万250", @@ -9042,7 +9042,7 @@ }, { "Input": "二千三百五十", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "二千三百五十", @@ -9057,7 +9057,7 @@ }, { "Input": "9百万4百", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "9百万4百", @@ -9072,7 +9072,7 @@ }, { "Input": "3896万4965", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "3896万4965", @@ -9112,7 +9112,7 @@ }, { "Input": "20万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "20万", @@ -9142,7 +9142,7 @@ }, { "Input": "54600", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "54600", @@ -9157,7 +9157,7 @@ }, { "Input": "4005万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4005万", @@ -9172,7 +9172,7 @@ }, { "Input": "五分の一", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "五分の一", @@ -9187,7 +9187,7 @@ }, { "Input": "四百六十", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "四百六十", @@ -9217,7 +9217,7 @@ }, { "Input": "これは5ではなく、201です。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "5", @@ -9241,7 +9241,7 @@ }, { "Input": "25分の1014", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "25分の1014", @@ -9276,7 +9276,7 @@ }, { "Input": "1234万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1234万", @@ -9291,7 +9291,7 @@ }, { "Input": "105千万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "105千万", @@ -9306,7 +9306,7 @@ }, { "Input": "15.7", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "15.7", @@ -9321,7 +9321,7 @@ }, { "Input": "40万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "40万", @@ -9336,7 +9336,7 @@ }, { "Input": "4000万6000", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4000万6000", @@ -9408,7 +9408,7 @@ }, { "Input": "6足", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "6", @@ -9471,7 +9471,7 @@ }, { "Input": "150", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "150", @@ -9501,7 +9501,7 @@ }, { "Input": "十億六万五百六", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "十億六万五百六", @@ -9516,7 +9516,7 @@ }, { "Input": "9万4百", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "9万4百", @@ -9546,7 +9546,7 @@ }, { "Input": "10012.15", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10012.15", @@ -9566,7 +9566,7 @@ }, { "Input": "十六万五百六", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "十六万五百六", @@ -9581,7 +9581,7 @@ }, { "Input": "マイナス405億404万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス405億404万", @@ -9596,7 +9596,7 @@ }, { "Input": "4004万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4004万", @@ -9635,7 +9635,7 @@ }, { "Input": "100056", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "100056", @@ -9650,7 +9650,7 @@ }, { "Input": "十足", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "十", @@ -9665,7 +9665,7 @@ }, { "Input": "千六百", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "千六百", @@ -9695,7 +9695,7 @@ }, { "Input": "四十四", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "四十四", @@ -9710,7 +9710,7 @@ }, { "Input": "2.2億", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "2.2億", @@ -9725,7 +9725,7 @@ }, { "Input": "15", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "15", @@ -9769,7 +9769,7 @@ }, { "Input": "101万1000", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "101万1000", @@ -9814,7 +9814,7 @@ }, { "Input": "3/5", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "3/5", @@ -9829,7 +9829,7 @@ }, { "Input": "6,544", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "6,544", @@ -9886,7 +9886,7 @@ }, { "Input": "10012", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10012", @@ -9901,7 +9901,7 @@ }, { "Input": "10足", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10", @@ -10012,7 +10012,7 @@ }, { "Input": "50ダース", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "50ダース", @@ -10057,7 +10057,7 @@ }, { "Input": "明ちゃんは指が10本あります。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10", @@ -10072,7 +10072,7 @@ }, { "Input": "九万四千", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "九万四千", @@ -10087,7 +10087,7 @@ }, { "Input": "1050", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1050", @@ -10102,7 +10102,7 @@ }, { "Input": "3足", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "3", @@ -10117,7 +10117,7 @@ }, { "Input": "10", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10", @@ -10132,7 +10132,7 @@ }, { "Input": "10250", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10250", @@ -10147,7 +10147,7 @@ }, { "Input": "マイナス45億404万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス45億404万", @@ -10162,7 +10162,7 @@ }, { "Input": "152", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "152", @@ -10177,7 +10177,7 @@ }, { "Input": "1,234,567", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1,234,567", @@ -10192,7 +10192,7 @@ }, { "Input": "7万5千4百", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "7万5千4百", @@ -10207,7 +10207,7 @@ }, { "Input": "75400", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "75400", @@ -10222,7 +10222,7 @@ }, { "Input": "4,565", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4,565", @@ -10237,7 +10237,7 @@ }, { "Input": "0.5", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "0.5", @@ -10287,7 +10287,7 @@ }, { "Input": "100分の2", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "100分の2", @@ -10302,7 +10302,7 @@ }, { "Input": "二千四百五十", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "二千四百五十", @@ -10317,7 +10317,7 @@ }, { "Input": "0.23456", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "0.23456", @@ -10332,7 +10332,7 @@ }, { "Input": "数量は一ではないですが、五です。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "一", @@ -10356,7 +10356,7 @@ }, { "Input": "マイナス10012", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス10012", @@ -10371,7 +10371,7 @@ }, { "Input": "16分の5", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "16分の5", @@ -10386,7 +10386,7 @@ }, { "Input": "10018.15", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10018.15", @@ -10451,7 +10451,7 @@ }, { "Input": "これは四川ではなく、五です。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "五", @@ -10466,7 +10466,7 @@ }, { "Input": "900万400", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "900万400", @@ -10511,7 +10511,7 @@ }, { "Input": "16万506", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "16万506", @@ -10526,7 +10526,7 @@ }, { "Input": "1000万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1000万", @@ -10541,7 +10541,7 @@ }, { "Input": "マイナス3分のマイナス157", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス3分のマイナス157", @@ -10672,7 +10672,7 @@ }, { "Input": "130", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "130", @@ -10687,7 +10687,7 @@ }, { "Input": "450", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "450", @@ -10798,7 +10798,7 @@ }, { "Input": "1005", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1005", @@ -10813,7 +10813,7 @@ }, { "Input": "百万四", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "百万四", @@ -10852,7 +10852,7 @@ }, { "Input": "答えは四で、五ではないです。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "四", @@ -10876,7 +10876,7 @@ }, { "Input": "十億", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "十億", @@ -10911,7 +10911,7 @@ }, { "Input": "4.78兆", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4.78兆", @@ -10956,7 +10956,7 @@ }, { "Input": "五億六", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "五億六", @@ -11019,7 +11019,7 @@ }, { "Input": "4万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4万", @@ -11049,7 +11049,7 @@ }, { "Input": "10万56", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10万56", @@ -11079,7 +11079,7 @@ }, { "Input": "百五十二", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "百五十二", @@ -11147,7 +11147,7 @@ }, { "Input": "400余り", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "400", @@ -11162,7 +11162,7 @@ }, { "Input": "12", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "12", @@ -11177,7 +11177,7 @@ }, { "Input": "78万506", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "78万506", @@ -11222,7 +11222,7 @@ }, { "Input": "100対", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "100", @@ -11237,7 +11237,7 @@ }, { "Input": "九百九十", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "九百九十", @@ -11252,7 +11252,7 @@ }, { "Input": "4000万6千", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4000万6千", @@ -11267,7 +11267,7 @@ }, { "Input": "1万12", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1万12", @@ -11297,7 +11297,7 @@ }, { "Input": "16分の2225", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "16分の2225", @@ -11317,7 +11317,7 @@ }, { "Input": "250", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "250", @@ -11332,7 +11332,7 @@ }, { "Input": "百五十", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "百五十", @@ -11347,7 +11347,7 @@ }, { "Input": "1000004", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1000004", @@ -11362,7 +11362,7 @@ }, { "Input": "4兆", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4兆", @@ -11377,7 +11377,7 @@ }, { "Input": "2.7890e-1", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "2.7890e-1", @@ -11422,7 +11422,7 @@ }, { "Input": "5億6", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "5億6", @@ -11437,7 +11437,7 @@ }, { "Input": "マイナス10", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス10", @@ -11452,7 +11452,7 @@ }, { "Input": "三分の百五十七", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "三分の百五十七", @@ -11467,7 +11467,7 @@ }, { "Input": "50対のイヤリング", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "50", @@ -11482,7 +11482,7 @@ }, { "Input": "これは一ではなくて、9台です。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "一", @@ -11506,7 +11506,7 @@ }, { "Input": "2300.1", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "2300.1", @@ -11551,7 +11551,7 @@ }, { "Input": "10ダースのリンゴ", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10ダース", @@ -11566,7 +11566,7 @@ }, { "Input": "45622", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "45622", @@ -11581,7 +11581,7 @@ }, { "Input": "3分の157", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "3分の157", @@ -11596,7 +11596,7 @@ }, { "Input": "マイナス32", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス32", @@ -11668,7 +11668,7 @@ }, { "Input": "六", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "六", @@ -11703,7 +11703,7 @@ }, { "Input": "500分の2333", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "500分の2333", @@ -11718,7 +11718,7 @@ }, { "Input": "千二百三十四万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "千二百三十四万", @@ -11733,7 +11733,7 @@ }, { "Input": "3千9百65", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "3千9百65", @@ -11781,7 +11781,7 @@ }, { "Input": "150対", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "150", @@ -11796,7 +11796,7 @@ }, { "Input": "マイナス三十二", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス三十二", @@ -11811,7 +11811,7 @@ }, { "Input": "1万3千", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1万3千", @@ -11846,7 +11846,7 @@ }, { "Input": "マイナス一万", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス一万", @@ -11876,7 +11876,7 @@ }, { "Input": "1ダース", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "1ダース", @@ -11891,7 +11891,7 @@ }, { "Input": "10斤", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10", @@ -11999,7 +11999,7 @@ }, { "Input": "11.92億", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "11.92億", @@ -12029,7 +12029,7 @@ }, { "Input": "5分の1", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "5分の1", @@ -12044,7 +12044,7 @@ }, { "Input": "九十二万四千", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "九十二万四千", @@ -12074,7 +12074,7 @@ }, { "Input": "5,450", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "5,450", @@ -12137,7 +12137,7 @@ }, { "Input": "靴下5足で9.9です。", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "5", @@ -12161,7 +12161,7 @@ }, { "Input": "シングルランキングトップ3のブランド", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "3", @@ -12191,7 +12191,7 @@ }, { "Input": "七万五千四百", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "七万五千四百", @@ -12206,7 +12206,7 @@ }, { "Input": "二分の一", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "二分の一", @@ -12221,7 +12221,7 @@ }, { "Input": "4億", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "4億", @@ -12236,7 +12236,7 @@ }, { "Input": "9万400", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "9万400", @@ -12251,7 +12251,7 @@ }, { "Input": "100", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "100", @@ -12281,7 +12281,7 @@ }, { "Input": "マイナス三分のマイナス百五十七", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "マイナス三分のマイナス百五十七", @@ -12326,7 +12326,7 @@ }, { "Input": "2450", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "2450", @@ -12356,7 +12356,7 @@ }, { "Input": "五兆六十二億四万五千二百", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "五兆六十二億四万五千二百", @@ -12436,7 +12436,7 @@ }, { "Input": "九", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "九", @@ -12511,7 +12511,7 @@ }, { "Input": "5千2百36", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "5千2百36", @@ -12526,7 +12526,7 @@ }, { "Input": "10億6万506", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "10億6万506", @@ -12699,7 +12699,7 @@ }, { "Input": "2,204.62", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "2,204.62", @@ -12729,7 +12729,7 @@ }, { "Input": "零", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "零", @@ -12744,7 +12744,7 @@ }, { "Input": "の総和は零となるため二次電流は流れず", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "零", @@ -12759,7 +12759,7 @@ }, { "Input": "0123", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "0123", @@ -12819,7 +12819,7 @@ }, { "Input": "零 一 二 三", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "零", @@ -12861,7 +12861,7 @@ }, { "Input": "零十", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "零十", @@ -12876,7 +12876,7 @@ }, { "Input": "零十三", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "零十三", @@ -12936,7 +12936,7 @@ }, { "Input": "にじゅうさん", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "にじゅうさん", @@ -12951,7 +12951,7 @@ }, { "Input": "きゅうじゅうなな", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "きゅうじゅうなな", @@ -13071,7 +13071,7 @@ }, { "Input": "いっせんまん さんぜんまん はっせんまん", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "いっせんまん", @@ -13137,7 +13137,7 @@ }, { "Input": "さんぜん はっせん", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "さんぜん", @@ -13264,5 +13264,133 @@ "End": 54 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Japanese/OrdinalModel.json b/Specs/Number/Japanese/OrdinalModel.json index 6322b88375..35fa049815 100644 --- a/Specs/Number/Japanese/OrdinalModel.json +++ b/Specs/Number/Japanese/OrdinalModel.json @@ -1,7 +1,6 @@ [ { "Input": "だい12", - "NotSupported": "python", "Results": [ { "Text": "だい12", @@ -18,7 +17,6 @@ }, { "Input": "第二百五十", - "NotSupported": "python", "Results": [ { "Text": "第二百五十", @@ -35,7 +33,6 @@ }, { "Input": "だい二百五十", - "NotSupported": "python", "Results": [ { "Text": "だい二百五十", @@ -52,7 +49,6 @@ }, { "Input": "第250", - "NotSupported": "python", "Results": [ { "Text": "第250", @@ -69,7 +65,6 @@ }, { "Input": "だい250", - "NotSupported": "python", "Results": [ { "Text": "だい250", @@ -86,7 +81,6 @@ }, { "Input": "だい一億", - "NotSupported": "python", "Results": [ { "Text": "だい一億", @@ -103,7 +97,6 @@ }, { "Input": "第一億", - "NotSupported": "python", "Results": [ { "Text": "第一億", @@ -120,7 +113,6 @@ }, { "Input": "だい一万回だい十万回", - "NotSupported": "python", "Results": [ { "Text": "だい一万", @@ -198,7 +190,6 @@ }, { "Input": "第1位第2位第3位第4位", - "NotSupported": "python", "Results": [ { "Text": "第1", @@ -265,7 +256,6 @@ }, { "Input": "第三万回", - "NotSupported": "python", "Results": [ { "Text": "第三万", @@ -516,7 +506,7 @@ { "Input": "三兆番目の数字はなんですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "三兆番目", @@ -534,7 +524,7 @@ { "Input": "百兆番目の数字はなんですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "百兆番目", @@ -905,7 +895,7 @@ }, { "Input": "一兆番目の数字はなんですか。", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "一兆番目", @@ -1014,7 +1004,7 @@ { "Input": "前から30番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "30番目", @@ -1032,7 +1022,7 @@ { "Input": "前から2番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2番目", @@ -1050,7 +1040,7 @@ { "Input": "前から20番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20番目", @@ -1068,7 +1058,7 @@ { "Input": "前から25番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "25番目", @@ -1104,7 +1094,7 @@ { "Input": "200番目の数字はなんですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "200番目", @@ -1122,7 +1112,7 @@ { "Input": "シアトルへの1等級の席を予約しなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "1等", @@ -1140,7 +1130,7 @@ { "Input": "私は1番目のが好きです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1番目", @@ -1158,7 +1148,7 @@ { "Input": "1番目の単語を話しなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1番目", @@ -1176,7 +1166,7 @@ { "Input": "彼女は2位になりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2位", @@ -1262,7 +1252,7 @@ { "Input": "前から11番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "11番目", @@ -1280,7 +1270,7 @@ { "Input": "前から21番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21番目", @@ -1298,7 +1288,7 @@ { "Input": "125番目の数字はなんですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "125番目", @@ -1407,7 +1397,7 @@ { "Input": "前から30番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "30番目", @@ -1425,7 +1415,7 @@ { "Input": "前から2番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2番目", @@ -1443,7 +1433,7 @@ { "Input": "前から20番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "20番目", @@ -1461,7 +1451,7 @@ { "Input": "前から25番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "25番目", @@ -1497,7 +1487,7 @@ { "Input": "200番目の数字はなんですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "200番目", @@ -1533,7 +1523,7 @@ { "Input": "私は1番目のが好きです。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "1番目", @@ -1551,7 +1541,7 @@ { "Input": "1番目の単語を話しなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1番目", @@ -1569,7 +1559,7 @@ { "Input": "彼女は2位になりました。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "2位", @@ -1655,7 +1645,7 @@ { "Input": "前から11番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "11番目", @@ -1673,7 +1663,7 @@ { "Input": "前から21番目の席に座りなさい。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "21番目", @@ -1691,7 +1681,7 @@ { "Input": "125番目の数字はなんですか。", "IgnoreResolution": true, - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "125番目", diff --git a/Specs/Number/Japanese/PercentModel.json b/Specs/Number/Japanese/PercentModel.json deleted file mode 100644 index e512e93a89..0000000000 --- a/Specs/Number/Japanese/PercentModel.json +++ /dev/null @@ -1,3127 +0,0 @@ -[ - { - "Input": "今日は九パーセントの確率は雨", - "NotSupported": "python", - "Results": [ - { - "Text": "九パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "9%" - }, - "Start": 3, - "End": 8 - } - ] - }, - { - "Input": "この車は19パーセントの確率が遅れた", - "NotSupported": "python", - "Results": [ - { - "Text": "19パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "19%" - }, - "Start": 4, - "End": 10 - } - ] - }, - { - "Input": "彼女は50パーセントこのことはできません", - "NotSupported": "python", - "Results": [ - { - "Text": "50パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 3, - "End": 9 - } - ] - }, - { - "Input": "共有29.5パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "29.5パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "29.5%" - }, - "Start": 2, - "End": 10 - } - ] - }, - { - "Input": "彼は13,000.2パーセント告白失败", - "NotSupported": "python", - "Results": [ - { - "Text": "13,000.2パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "13000.2%" - }, - "Start": 2, - "End": 14 - } - ] - }, - { - "Input": "彼は3500パーセント告白失败", - "NotSupported": "python", - "Results": [ - { - "Text": "3500パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "3500%" - }, - "Start": 2, - "End": 10 - } - ] - }, - { - "Input": "僕2,100パーセント告白失败", - "NotSupported": "python", - "Results": [ - { - "Text": "2,100パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "2100%" - }, - "Start": 1, - "End": 10 - } - ] - }, - { - "Input": "僕1,123パーセント告白失败", - "Comment": "PendingValidation", - "NotSupported": "python", - "Results": [ - { - "Text": "1,123パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "1123%" - }, - "Start": 1, - "End": 10 - } - ] - }, - { - "Input": "今日は3.2kパーセントの確率で雪が降る", - "NotSupported": "python", - "Results": [ - { - "Text": "3.2kパーセント", - "TypeName": "percentage", - "Resolution": { - "value": "3200%" - }, - "Start": 3, - "End": 11 - } - ] - }, - { - "Input": "今日は3.2kパ ーセ ントの確率で雪が降る", - "NotSupported": "python", - "Results": [ - { - "Text": "3.2kパ ーセ ント", - "TypeName": "percentage", - "Resolution": { - "value": "3200%" - }, - "Start": 3, - "End": 13 - } - ] - }, - { - "Input": "今日は15kパ ーセ ントの確率で雪が降る", - "NotSupported": "python", - "Results": [ - { - "Text": "15kパ ーセ ント", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 3, - "End": 12 - } - ] - }, - { - "Input": "今日は120パ ーセ ントの確率で雪が降る", - "NotSupported": "python", - "Results": [ - { - "Text": "120パ ーセ ント", - "TypeName": "percentage", - "Resolution": { - "value": "120%" - }, - "Start": 3, - "End": 12 - } - ] - }, - { - "Input": "今日は9,999パ ーセ ントの確率で雪が降る", - "NotSupported": "python", - "Results": [ - { - "Text": "9,999パ ーセ ント", - "TypeName": "percentage", - "Resolution": { - "value": "9999%" - }, - "Start": 3, - "End": 14 - } - ] - }, - { - "Input": "2.4パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "2.4パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "-22.2%", - "NotSupported": "python", - "Results": [ - { - "Text": "-22.2%", - "TypeName": "percentage", - "Resolution": { - "value": "-22.2%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "22%", - "NotSupported": "python", - "Results": [ - { - "Text": "22%", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "-122%", - "NotSupported": "python", - "Results": [ - { - "Text": "-122%", - "TypeName": "percentage", - "Resolution": { - "value": "-122%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "22パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "22パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "120パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "120パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "120%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "15kパーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "15kパーセント", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "1,111パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "1,111パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "1111%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "9,999パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "9,999パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "9999%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "56.2パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "56.2パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "56.2%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "3.2パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "3.2パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "3.2%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "12.56パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "12.56パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "12.56%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "0.4パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "0.4パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "0.4%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "15,123パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "15,123パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "15123%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "111,111パーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "111,111パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "111111%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "15kパーセント", - "NotSupported": "python", - "Results": [ - { - "Text": "15kパーセント", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "5.5%", - "NotSupported": "python", - "Results": [ - { - "Text": "5.5%", - "TypeName": "percentage", - "Resolution": { - "value": "5.5%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "2.4パ ー セ ン ト", - "NotSupported": "python", - "Results": [ - { - "Text": "2.4パ ー セ ン ト", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "52.5 k パ ー セ ン ト", - "NotSupported": "python", - "Results": [ - { - "Text": "52.5 k パ ー セ ン ト", - "TypeName": "percentage", - "Resolution": { - "value": "52500%" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "今日この服は5割引になります", - "NotSupported": "python", - "Results": [ - { - "Text": "5割引", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 6, - "End": 8 - } - ] - }, - { - "Input": "今日この服はの5.6割引になります", - "NotSupported": "python", - "Results": [ - { - "Text": "5.6割引", - "TypeName": "percentage", - "Resolution": { - "value": "56%" - }, - "Start": 7, - "End": 11 - } - ] - }, - { - "Input": "今日この服はの2.5割引になります", - "NotSupported": "python", - "Results": [ - { - "Text": "2.5割引", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 7, - "End": 11 - } - ] - }, - { - "Input": "9割", - "NotSupported": "python", - "Results": [ - { - "Text": "9割", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "7.2割", - "NotSupported": "python", - "Results": [ - { - "Text": "7.2割", - "TypeName": "percentage", - "Resolution": { - "value": "72%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "10 割", - "NotSupported": "python", - "Results": [ - { - "Text": "10 割", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "10 割", - "NotSupported": "python", - "Results": [ - { - "Text": "10 割", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "十 割", - "NotSupported": "python", - "Results": [ - { - "Text": "十 割", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "9.9割", - "NotSupported": "python", - "Results": [ - { - "Text": "9.9割", - "TypeName": "percentage", - "Resolution": { - "value": "99%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "10割", - "NotSupported": "python", - "Results": [ - { - "Text": "10割", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "十割", - "NotSupported": "python", - "Results": [ - { - "Text": "十割", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "2.5割", - "NotSupported": "python", - "Results": [ - { - "Text": "2.5割", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "2割", - "NotSupported": "python", - "Results": [ - { - "Text": "2割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "2割,2.5割,2.1割,2割", - "NotSupported": "python", - "Results": [ - { - "Text": "2割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "2.5割", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 3, - "End": 6 - }, - { - "Text": "2.1割", - "TypeName": "percentage", - "Resolution": { - "value": "21%" - }, - "Start": 8, - "End": 11 - }, - { - "Text": "2割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 13, - "End": 14 - } - ] - }, - { - "Input": "五割", - "NotSupported": "python", - "Results": [ - { - "Text": "五割", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "クラスの女子は3割を占める", - "NotSupported": "python", - "Results": [ - { - "Text": "3割", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 7, - "End": 8 - } - ] - }, - { - "Input": "クラスの女子は5割半を占める", - "NotSupported": "python", - "Results": [ - { - "Text": "5割半", - "TypeName": "percentage", - "Resolution": { - "value": "55%" - }, - "Start": 7, - "End": 9 - } - ] - }, - { - "Input": "女子学生は七割半を占めている", - "NotSupported": "python", - "Results": [ - { - "Text": "七割半", - "TypeName": "percentage", - "Resolution": { - "value": "75%" - }, - "Start": 5, - "End": 7 - } - ] - }, - { - "Input": "女子学生は3.8割を占めている", - "NotSupported": "python", - "Results": [ - { - "Text": "3.8割", - "TypeName": "percentage", - "Resolution": { - "value": "38%" - }, - "Start": 5, - "End": 8 - } - ] - }, - { - "Input": "女子学生は三割を占めている", - "NotSupported": "python", - "Results": [ - { - "Text": "三割", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 5, - "End": 6 - } - ] - }, - { - "Input": "今シーズンの打率は3割8分7厘でした", - "NotSupported": "python", - "Results": [ - { - "Text": "3割8分7厘", - "TypeName": "percentage", - "Resolution": { - "value": "38.7%" - }, - "Start": 9, - "End": 14 - } - ] - }, - { - "Input": "回答率は100%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 4, - "End": 7 - } - ] - }, - { - "Input": "ムンバイの電車の乗車率は240%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "240%", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 12, - "End": 15 - } - ] - }, - { - "Input": "20%の人がパソコンを持っていません。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "20%", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "30%の人が犬を飼っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "30%", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "10%の人がパスポートを持っていません。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "10%", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "私の体脂肪率は22%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "22%", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 7, - "End": 9 - } - ] - }, - { - "Input": "ムンバイのバスの乗車率は210%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "210%", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 12, - "End": 15 - } - ] - }, - { - "Input": "今年の売り上げは前年比の-5%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "-5%", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 12, - "End": 14 - } - ] - }, - { - "Input": "回答率は100パーセントです。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "100パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 4, - "End": 11 - } - ] - }, - { - "Input": "ムンバイの電車の乗車率は240パーセントです。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "240パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 12, - "End": 19 - } - ] - }, - { - "Input": "20パーセントの人がパソコンを持っていません。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "20パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "10パーセントの人がパスポートを持っていません。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "10パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "私の体脂肪率は22パーセントです。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "22パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 7, - "End": 13 - } - ] - }, - { - "Input": "ムンバイのバスの乗車率は210パーセントです。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "210パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 12, - "End": 19 - } - ] - }, - { - "Input": "今年の売り上げは前年比の-5パーセントでした。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "-5パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 12, - "End": 18 - } - ] - }, - { - "Input": "2割の人がパソコンを持っていません。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "2割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "3割の人が犬を飼っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "3割", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "1割の人がパスポートを持っていません。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "1割", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "この問題の回答率は100%だ。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 9, - "End": 12 - } - ] - }, - { - "Input": "今日の会議の出席率は20%だ。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "20%", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 10, - "End": 12 - } - ] - }, - { - "Input": "江戸川区のインド人の割合は10%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "10%", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 13, - "End": 15 - } - ] - }, - { - "Input": "詳細については次のURLをご確認ください。 http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859.", - "NotSupportedByDesign": "java, javascript, python", - "Results": [] - }, - { - "Input": "次のURLを参考にしてくだい。 https://www.test.com/search?q=30%25%2020%", - "NotSupportedByDesign": "java, javascript, python", - "Results": [] - }, - { - "Input": "回答率は100%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 4, - "End": 7 - } - ] - }, - { - "Input": "ムンバイの電車の乗車率は240%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "240%", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 12, - "End": 15 - } - ] - }, - { - "Input": "20%の人がパソコンを持っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "20%", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "10%の人がパソコンを持っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "10%", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "売り上げは前年度比−5%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "-5%", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 9, - "End": 11 - } - ] - }, - { - "Input": "回答率は百%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "百%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 4, - "End": 5 - } - ] - }, - { - "Input": "ムンバイの電車の乗車率は二百四十%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "二百四十%", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 12, - "End": 16 - } - ] - }, - { - "Input": "二十%の人がパソコンを持っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "二十%", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "十%の人がパソコンを持っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "十%", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "売り上げは前年度比マイナス五%です。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "マイナス五%", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 9, - "End": 14 - } - ] - }, - { - "Input": "回答率は百パーセントです。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "百パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 4, - "End": 9 - } - ] - }, - { - "Input": "ムンバイの電車の乗車率は二百四十パーセントです。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "二百四十パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 12, - "End": 20 - } - ] - }, - { - "Input": "二十パーセントの人がパソコンを持っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "二十パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "十パーセントの人がパソコンを持っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "十パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "売り上げは前年度比マイナス五パーセントです。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "マイナス五パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 9, - "End": 18 - } - ] - }, - { - "Input": "二割の人がパソコンを持っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "二割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "一割の人がパソコンを持っています。", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "一割", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "2,123ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2,123ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "2123%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "2.4ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2.4ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "15,000ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "15,000ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "-22.20%", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "-22.20%", - "TypeName": "percentage", - "Resolution": { - "value": "-22.2%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "111,111ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "111,111ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "111111%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "8割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "8割引", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "二割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "二割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "25パーセント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "25パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "6.5割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "6.5割", - "TypeName": "percentage", - "Resolution": { - "value": "65%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "二十~三十パーセント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "1,075ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "1,075ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "1075%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "12.54ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12.54ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "12.56%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "七十五万ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "七十五万ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "750000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "4.5ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "4.5ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "4.5%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "一万二千ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "一万二千ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "12000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": " http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859を訪ねてください", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "僕1,123パーセント告白失败", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "1,123パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "1123%" - }, - "Start": 1, - "End": 10 - } - ] - }, - { - "Input": "15,123ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "15,123ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "15123%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "120.5/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "120.5/100", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "2割|2.5割|2.1割|2割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "2.5割", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 3, - "End": 6 - }, - { - "Text": "2.1割", - "TypeName": "percentage", - "Resolution": { - "value": "21%" - }, - "Start": 8, - "End": 11 - }, - { - "Text": "2割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 13, - "End": 14 - } - ] - }, - { - "Input": "0.4ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "0.4ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "0.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "75.2ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "75.2ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "75.2%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百分の百二十点五", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の百二十点五", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "10日間株の引け値が七〇%が1を超える", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "七〇%", - "Start": 10, - "End": 12, - "TypeName": "percentage", - "Resolution": { - "value": "70%" - } - } - ] - }, - { - "Input": "20~30ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "百分の2.4", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の2.4", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "15,123ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "15,123ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "15123%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "九割|五割|八点五割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "九割", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "五割", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 3, - "End": 4 - }, - { - "Text": "八点五割", - "TypeName": "percentage", - "Resolution": { - "value": "85%" - }, - "Start": 6, - "End": 9 - } - ] - }, - { - "Input": "百分の1,111", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の1,111", - "TypeName": "percentage", - "Resolution": { - "value": "1111%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百分の2", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の2", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "2/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2/100", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "2割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2割", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "2.5割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2.5割", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "12ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "12%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "一割引|四点五割引|一点五割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "一割引", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 2 - }, - { - "Text": "四点五割引", - "TypeName": "percentage", - "Resolution": { - "value": "55%" - }, - "Start": 4, - "End": 8 - }, - { - "Text": "一点五割引", - "TypeName": "percentage", - "Resolution": { - "value": "85%" - }, - "Start": 10, - "End": 14 - } - ] - }, - { - "Input": "百分の120", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の120", - "TypeName": "percentage", - "Resolution": { - "value": "120%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百分の三万二千", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の三万二千", - "TypeName": "percentage", - "Resolution": { - "value": "3200%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "9.5割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "9.5割", - "TypeName": "percentage", - "Resolution": { - "value": "95%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "100056.33パーセント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "100056.33パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "100056.33%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "9割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "9割", - "TypeName": "percentage", - "Resolution": { - "value": "90%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "0.1割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "0.1割引", - "TypeName": "percentage", - "Resolution": { - "value": "99%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "五割引き", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "五割引き", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "600%", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "600%", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "六点五割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "六点五割", - "TypeName": "percentage", - "Resolution": { - "value": "65%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "百五十ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百五十ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "150%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "12,056.33ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12,056.33ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "100056.33%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "7.6割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "7.6割", - "TypeName": "percentage", - "Resolution": { - "value": "76%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "12/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12/100", - "TypeName": "percentage", - "Resolution": { - "value": "12%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百分の9,999", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の9,999", - "TypeName": "percentage", - "Resolution": { - "value": "9999%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "一万五千ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "一万五千ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "半額", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "半額", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "2.8割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2.8割引", - "TypeName": "percentage", - "Resolution": { - "value": "72%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "6.5割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "6.5割", - "TypeName": "percentage", - "Resolution": { - "value": "65%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "5.50パーセント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "5.50パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "5.5%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "アップル引き割り九割引き", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "九割引き", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 8, - "End": 11 - } - ] - }, - { - "Input": "56.2/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "56.2/100", - "TypeName": "percentage", - "Resolution": { - "value": "56.2%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "二十ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "二十ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "600ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "600ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "52.5/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "52.5/100", - "TypeName": "percentage", - "Resolution": { - "value": "52.5%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "七十五ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "七十五ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "75%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "百分の2.2上昇した", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の2.2", - "TypeName": "percentage", - "Resolution": { - "value": "2.2%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "二十?三十ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "七十五点二ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "七十五点二ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "75.2%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "150ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "150ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "150%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "6.2割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "6.2割引", - "TypeName": "percentage", - "Resolution": { - "value": "38%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "20ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "20ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百分の一点五", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の一点五", - "TypeName": "percentage", - "Resolution": { - "value": "1.5%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "三割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "三割", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "零点一割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "零点一割引", - "TypeName": "percentage", - "Resolution": { - "value": "99%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "百分の525,000", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の525,000", - "TypeName": "percentage", - "Resolution": { - "value": "52500%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "百分の千百二十三", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の千百二十三", - "TypeName": "percentage", - "Resolution": { - "value": "1123%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "50%", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "50%", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "3,000/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "3,000/100", - "TypeName": "percentage", - "Resolution": { - "value": "3000%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "アルコール量6%のビールと32.5%の白酒", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "6%", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 6, - "End": 7 - }, - { - "Text": "32.5%", - "TypeName": "percentage", - "Resolution": { - "value": "32.5%" - }, - "Start": 13, - "End": 17 - } - ] - }, - { - "Input": "百分の1,500", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の1,500", - "TypeName": "percentage", - "Resolution": { - "value": "15000%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "1,669/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "1,669/100", - "TypeName": "percentage", - "Resolution": { - "value": "1669%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "百パーセント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "10割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "10割", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "百分の2イコール百分の二、2%と同じだ。", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の2", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 0, - "End": 3 - }, - { - "Text": "百分の二", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 8, - "End": 11 - }, - { - "Text": "2%", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 13, - "End": 14 - } - ] - }, - { - "Input": "八割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "八割引", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "12.56ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12.56ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "12.56%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "千七十五ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "千七十五ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "1075%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "百二十パーセント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百二十パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "るくポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "るくポイント", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "5/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "5/100", - "TypeName": "percentage", - "Resolution": { - "value": "5%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "0.4ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "0.4ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "0.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "百分の22", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の22", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "百分の三点二", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の三点二", - "TypeName": "percentage", - "Resolution": { - "value": "3.2%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "百分の一百二十点五", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の一百二十点五", - "TypeName": "percentage", - "Resolution": { - "value": "120.5%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "12ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "12%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "3.5割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "3.5割引", - "TypeName": "percentage", - "Resolution": { - "value": "65%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "二点四ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "二点四ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "百分の669", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "百分の669", - "TypeName": "percentage", - "Resolution": { - "value": "669%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "2,123ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2,123ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "2123%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "3.5割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "3.5割", - "TypeName": "percentage", - "Resolution": { - "value": "35%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "2.2/500", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "2.4ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2.4ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "6.9割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "6.9割引", - "TypeName": "percentage", - "Resolution": { - "value": "31%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "100パーセント」", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "100パーセント」", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "マイナス122%", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "マイナス122%", - "TypeName": "percentage", - "Resolution": { - "value": "-122%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "7.2割", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "7.2割", - "TypeName": "percentage", - "Resolution": { - "value": "72%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "5パーセント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "5パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "5%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "2.4/100", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2.4/100", - "TypeName": "percentage", - "Resolution": { - "value": "2.4%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "12,000ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12,000ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "12000%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "四分の一の割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "四分の一の割引", - "TypeName": "percentage", - "Resolution": { - "value": "75%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "2割引|2.5割引|2.1割引|2割引", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "2割引", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 2 - }, - { - "Text": "2.5割引", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 4, - "End": 8 - }, - { - "Text": "2.1割引", - "TypeName": "percentage", - "Resolution": { - "value": "21%" - }, - "Start": 10, - "End": 14 - }, - { - "Text": "2割引", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 16, - "End": 18 - } - ] - }, - { - "Input": "六ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "六ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "6%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "75ポイント", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "75ポイント", - "TypeName": "percentage", - "Resolution": { - "value": "75%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "https://www.test.com/search?q=30%25%2020%を訪ねてください", - "NotSupported": "dotnet, javascript, python, java", - "Results": [] - }, - { - "Input": "アルコール量が5から20パーセントの商品を探す", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "20パーセント", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 10, - "End": 16 - } - ] - }, - { - "Input": "金融市場で運用する資金運用事業を合わせた財投総額も過去最大の同二%減の四十九兆九千五百九十二億円となっている。", - "NotSupported": "python,javascript", - "Results": [ - { - "Text": "二%", - "TypeName": "percentage", - "Resolution": { - "value": "2%" - }, - "Start": 31, - "End": 32 - } - ] - } -] \ No newline at end of file diff --git a/Specs/Number/Korean/NumberModel.json b/Specs/Number/Korean/NumberModel.json index 2c0b3e3194..5587d0851f 100644 --- a/Specs/Number/Korean/NumberModel.json +++ b/Specs/Number/Korean/NumberModel.json @@ -4136,5 +4136,133 @@ "Input": "오늘 내일", "NotSupportedByDesign": "javascript,python,java", "Results": [] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Korean/PercentModel.json b/Specs/Number/Korean/PercentModel.json deleted file mode 100644 index d9c8b4090b..0000000000 --- a/Specs/Number/Korean/PercentModel.json +++ /dev/null @@ -1,402 +0,0 @@ -[ - { - "Input": "100%", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ] - }, - { - "Input": " 100% ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ] - }, - { - "Input": " 100 퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ] - }, - { - "Input": " 100 프로", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 프로", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ] - }, - { - "Input": "240 퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "240 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - } - } - ] - }, - { - "Input": "20프로", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20프로", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - } - } - ] - }, - { - "Input": "이십 퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "이십 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - } - } - ] - }, - { - "Input": "삼십 퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "삼십 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - } - } - ] - }, - { - "Input": "백퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "백퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ] - }, - { - "Input": "백 퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "백 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ] - }, - { - "Input": "십퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "십퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - } - } - ] - }, - { - "Input": "이십이 퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "이십이 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - } - } - ] - }, - { - "Input": "이백십 퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "이백십 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - } - } - ] - }, - { - "Input": "십 퍼센트", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "십 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - } - } - ] - }, - { - "Input": "-5퍼센트가 필요합니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "-5퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - } - } - ] - }, - { - "Input": "100% 맞습니다", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "100% 틀렸습니다", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "100 퍼센트 정답입니다", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "100 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "100 퍼센티지의 승률", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "100 퍼센티지", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "240 퍼센트의 수익률", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "240 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "이십 퍼센트 할인 중", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "이십 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "삼십 퍼센티지의 승률", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "삼십 퍼센티지", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "백 퍼센트 이길 겁니다", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "백 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "십 퍼센트만 올려주세요", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "십 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "이십이 퍼센트로 앞서나가고 있습니다", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "이십이 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "이백십 퍼센트의 수익률", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "이백십 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "십 퍼센트는 내 몫이다", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "십 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "마이너스 오 퍼센트만 필요해", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "마이너스 오 퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 로 가면 된다", - "NotSupportedByDesign": "java, javascript, python", - "Results": [] - }, - { - "Input": "https://www.test.com/search?q=30%25%2020% 로 가면 된다", - "NotSupportedByDesign": "java, javascript, python", - "Results": [] - } -] diff --git a/Specs/Number/Korean/PercentModelPercentMode.json b/Specs/Number/Korean/PercentModelPercentMode.json deleted file mode 100644 index 9aa42cd492..0000000000 --- a/Specs/Number/Korean/PercentModelPercentMode.json +++ /dev/null @@ -1,132 +0,0 @@ -[ - { - "Input": "100%", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ] - }, - { - "Input": "이십 퍼센트", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "이십퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - } - } - ] - }, - { - "Input": "백퍼센트", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "백퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - } - } - ] - }, - { - "Input": "이십퍼센트", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "이십퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - } - } - ] - }, - { - "Input": "삼분의 일", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "삼분의 일", - "TypeName": "percentage", - "Resolution": { - "value": "33.3333333333333%" - } - } - ] - }, - { - "Input": "이분의 일", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "이분의 일", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - } - } - ] - }, - { - "Input": "사분의 일의", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "사분의 일의", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - } - } - ] - }, - { - "Input": "이십오퍼센트", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "이십오퍼센트", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - } - } - ] - }, - { - "Input": "절반의", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "절반의", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - } - } - ] - }, - { - "Input": "반의", - "NotSupportedByDesign": "dotNet,javascript,python,java", - "Results": [ - { - "Text": "반의", - "TypeName": "percentage", - "Resolution": { - "value": "50%" - } - } - ] - } -] \ No newline at end of file diff --git a/Specs/Number/Portuguese/NumberModel.json b/Specs/Number/Portuguese/NumberModel.json index 1a5a953d89..2cb0842504 100644 --- a/Specs/Number/Portuguese/NumberModel.json +++ b/Specs/Number/Portuguese/NumberModel.json @@ -151,7 +151,7 @@ }, { "Input": "mil e cem", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -183,7 +183,7 @@ }, { "Input": "mil e duzentos", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -410,7 +410,7 @@ }, { "Input": "tres milhoes e sete", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -427,7 +427,7 @@ }, { "Input": "tres milhoes e quarenta e sete", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -594,7 +594,7 @@ }, { "Input": "quinhentos e treze milhoes e quatrocentos mil", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -641,7 +641,7 @@ }, { "Input": "tres trilhoes quatrocentos e cinquenta e cinco bilhoes duzentos e vinte e oito milhoes e quinhentos e cinquenta e seis mil", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -763,7 +763,7 @@ }, { "Input": "só tenho mil e cem reais", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -1320,7 +1320,7 @@ }, { "Input": "hum mil e três", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -1801,7 +1801,7 @@ }, { "Input": "dois mil e duzentos", - "NotSupported": "dotnet,javascript,java,python", + "NotSupported": "dotnet,javascript,java", "Comment": "Temporarily disabled as subtype is incorrect", "Results": [ { @@ -2712,5 +2712,133 @@ "End": 37 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Portuguese/PercentModel.json b/Specs/Number/Portuguese/PercentModel.json deleted file mode 100644 index 48dbf4eef9..0000000000 --- a/Specs/Number/Portuguese/PercentModel.json +++ /dev/null @@ -1,707 +0,0 @@ -[ - { - "Input": "100%", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 por cento", - "Results": [ - { - "Text": "100 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 13 - } - ] - }, - { - "Input": " cem por cento", - "Results": [ - { - "Text": "cem por cento", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 13 - } - ] - }, - { - "Input": "243 por cento", - "Results": [ - { - "Text": "243 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "243%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "vinte por cento", - "Results": [ - { - "Text": "vinte por cento", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "trinta e cinco por cento", - "Results": [ - { - "Text": "trinta e cinco por cento", - "TypeName": "percentage", - "Resolution": { - "value": "35%" - }, - "Start": 0, - "End": 23 - } - ] - }, - { - "Input": "quinhentos e trinta e cinco por cento", - "Results": [ - { - "Text": "quinhentos e trinta e cinco por cento", - "TypeName": "percentage", - "Resolution": { - "value": "535%" - }, - "Start": 0, - "End": 36 - } - ] - }, - { - "Input": "10 por cento", - "Results": [ - { - "Text": "10 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "dez por cento", - "Results": [ - { - "Text": "dez por cento", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "tres milhoes cinquenta e dois mil trezentos e quarenta e sete por cento", - "Results": [ - { - "Text": "tres milhoes cinquenta e dois mil trezentos e quarenta e sete por cento", - "TypeName": "percentage", - "Resolution": { - "value": "3052347%" - }, - "Start": 0, - "End": 70 - } - ] - }, - { - "Input": "algo como uns 11%", - "Results": [ - { - "Text": "11%", - "TypeName": "percentage", - "Resolution": { - "value": "11%" - }, - "Start": 14, - "End": 16 - } - ] - }, - { - "Input": "claro, somente uns 15 por cento", - "Results": [ - { - "Text": "15 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "15%" - }, - "Start": 19, - "End": 30 - } - ] - }, - { - "Input": "sim, nada mais que vinte e cinco por cento", - "Results": [ - { - "Text": "vinte e cinco por cento", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 19, - "End": 41 - } - ] - }, - { - "Input": "derrame cem por cento do liquido", - "Results": [ - { - "Text": "cem por cento", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 8, - "End": 20 - } - ] - }, - { - "Input": "um percentual de 25%", - "Results": [ - { - "Text": "25%", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 17, - "End": 19 - } - ] - }, - { - "Input": "uma percentagem de trinta e seis por cento do total", - "Results": [ - { - "Text": "trinta e seis por cento", - "TypeName": "percentage", - "Resolution": { - "value": "36%" - }, - "Start": 19, - "End": 41 - } - ] - }, - { - "Input": "um percentual de oitenta e quatro por cento", - "Results": [ - { - "Text": "oitenta e quatro por cento", - "TypeName": "percentage", - "Resolution": { - "value": "84%" - }, - "Start": 17, - "End": 42 - } - ] - }, - { - "Input": " 101231,2353%", - "Results": [ - { - "Text": "101231,2353%", - "TypeName": "percentage", - "Resolution": { - "value": "101231,2353%" - }, - "Start": 1, - "End": 12 - } - ] - }, - { - "Input": "-101231,4323%", - "Results": [ - { - "Text": "-101231,4323%", - "TypeName": "percentage", - "Resolution": { - "value": "-101231,4323%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": " -89101231,5127%", - "Results": [ - { - "Text": "-89101231,5127%", - "TypeName": "percentage", - "Resolution": { - "value": "-89101231,5127%" - }, - "Start": 1, - "End": 15 - } - ] - }, - { - "Input": " - 89101231,5127%", - "Results": [ - { - "Text": "- 89101231,5127%", - "TypeName": "percentage", - "Resolution": { - "value": "-89101231,5127%" - }, - "Start": 1, - "End": 16 - } - ] - }, - { - "Input": ",23456000%", - "Results": [ - { - "Text": ",23456000%", - "TypeName": "percentage", - "Resolution": { - "value": "0,23456%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "4,800%", - "Results": [ - { - "Text": "4,800%", - "TypeName": "percentage", - "Resolution": { - "value": "4,8%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "4,8 por cento", - "Results": [ - { - "Text": "4,8 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "4,8%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": " -89101231,5127 por cento", - "Results": [ - { - "Text": "-89101231,5127 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "-89101231,5127%" - }, - "Start": 1, - "End": 24 - } - ] - }, - { - "Input": "-89101231,5127 por cento", - "Results": [ - { - "Text": "-89101231,5127 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "-89101231,5127%" - }, - "Start": 0, - "End": 23 - } - ] - }, - { - "Input": " - 89101231,5127 por cento", - "Results": [ - { - "Text": "- 89101231,5127 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "-89101231,5127%" - }, - "Start": 1, - "End": 25 - } - ] - }, - { - "Input": " -1,1234567 por cento", - "Results": [ - { - "Text": "-1,1234567 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "-1,1234567%" - }, - "Start": 1, - "End": 20 - } - ] - }, - { - "Input": "1.234.567,51274 por cento", - "Results": [ - { - "Text": "1.234.567,51274 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "1234567,51274%" - }, - "Start": 0, - "End": 24 - } - ] - }, - { - "Input": ",08 por cento", - "Results": [ - { - "Text": ",08 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "0,08%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "9,2321312%", - "Results": [ - { - "Text": "9,2321312%", - "TypeName": "percentage", - "Resolution": { - "value": "9,2321312%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": " -9,2321312 por cento", - "Results": [ - { - "Text": "-9,2321312 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "-9,2321312%" - }, - "Start": 1, - "End": 20 - } - ] - }, - { - "Input": "1e10%", - "Results": [ - { - "Text": "1e10%", - "TypeName": "percentage", - "Resolution": { - "value": "10000000000%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "1,1^23 por cento", - "Results": [ - { - "Text": "1,1^23 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "8,95430243255239%" - }, - "Start": 0, - "End": 15 - } - ] - }, - { - "Input": "quarenta e sete virgula vinte e oito por cento", - "Results": [ - { - "Text": "quarenta e sete virgula vinte e oito por cento", - "TypeName": "percentage", - "Resolution": { - "value": "47,28%" - }, - "Start": 0, - "End": 45 - } - ] - }, - { - "Input": "tres quintos por cento", - "Results": [ - { - "Text": "tres quintos por cento", - "TypeName": "percentage", - "Resolution": { - "value": "0,6%" - }, - "Start": 0, - "End": 21 - } - ] - }, - { - "Input": "dois virgula cinco por cento", - "Results": [ - { - "Text": "dois virgula cinco por cento", - "TypeName": "percentage", - "Resolution": { - "value": "2,5%" - }, - "Start": 0, - "End": 27 - } - ] - }, - { - "Input": "um quinto por cento", - "Results": [ - { - "Text": "um quinto por cento", - "TypeName": "percentage", - "Resolution": { - "value": "0,2%" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "um bilionesimo por cento", - "Results": [ - { - "Text": "um bilionesimo por cento", - "TypeName": "percentage", - "Resolution": { - "value": "1E-09%" - }, - "Start": 0, - "End": 23 - } - ] - }, - { - "Input": "um vinte e um avos por cento", - "Results": [ - { - "Text": "um vinte e um avos por cento", - "TypeName": "percentage", - "Resolution": { - "value": "0,0476190476190476%" - }, - "Start": 0, - "End": 27 - } - ] - }, - { - "Input": "cento e trinta e tres vinte e um avos por cento", - "Results": [ - { - "Text": "cento e trinta e tres vinte e um avos por cento", - "TypeName": "percentage", - "Resolution": { - "value": "6,33333333333333%" - }, - "Start": 0, - "End": 46 - } - ] - }, - { - "Input": "vinte e dois trinta avos por cento", - "Results": [ - { - "Text": "vinte e dois trinta avos por cento", - "TypeName": "percentage", - "Resolution": { - "value": "0,733333333333333%" - }, - "Start": 0, - "End": 33 - } - ] - }, - { - "Input": "tres dois milesimos por cento", - "Results": [ - { - "Text": "tres dois milesimos por cento", - "TypeName": "percentage", - "Resolution": { - "value": "0,0015%" - }, - "Start": 0, - "End": 28 - } - ] - }, - { - "Input": "cento e trinta quintos por cento", - "Results": [ - { - "Text": "cento e trinta quintos por cento", - "TypeName": "percentage", - "Resolution": { - "value": "26%" - }, - "Start": 0, - "End": 31 - } - ] - }, - { - "Input": "cento e trinta e dois quintos por cento", - "Results": [ - { - "Text": "cento e trinta e dois quintos por cento", - "TypeName": "percentage", - "Resolution": { - "value": "26,4%" - }, - "Start": 0, - "End": 38 - } - ] - }, - { - "Input": "um sobre tres por cento", - "Results": [ - { - "Text": "um sobre tres por cento", - "TypeName": "percentage", - "Resolution": { - "value": "0,333333333333333%" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "1 sobre 3 por cento", - "Results": [ - { - "Text": "1 sobre 3 por cento", - "TypeName": "percentage", - "Resolution": { - "value": "0,333333333333333%" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "3/4%", - "Results": [ - { - "Text": "3/4%", - "TypeName": "percentage", - "Resolution": { - "value": "0,75%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "2/3%", - "Results": [ - { - "Text": "2/3%", - "TypeName": "percentage", - "Resolution": { - "value": "0,666666666666667%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "você pode ir para http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 para mais detalhes", - "NotSupported": "javascript", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/Number/Spanish/NumberModel.json b/Specs/Number/Spanish/NumberModel.json index 8efa057f36..105bc5158c 100644 --- a/Specs/Number/Spanish/NumberModel.json +++ b/Specs/Number/Spanish/NumberModel.json @@ -3275,5 +3275,133 @@ { "Input": "billons", "Results": [] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Spanish/OrdinalModelSuppressExtendedTypes.json b/Specs/Number/Spanish/OrdinalModelSuppressExtendedTypes.json index a42286bd43..c9e5a89497 100644 --- a/Specs/Number/Spanish/OrdinalModelSuppressExtendedTypes.json +++ b/Specs/Number/Spanish/OrdinalModelSuppressExtendedTypes.json @@ -61,7 +61,7 @@ }, { "Input": "cuadragesimo septimo", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "cuadragesimo septimo", diff --git a/Specs/Number/Spanish/PercentModel.json b/Specs/Number/Spanish/PercentModel.json deleted file mode 100644 index 220bc82a56..0000000000 --- a/Specs/Number/Spanish/PercentModel.json +++ /dev/null @@ -1,908 +0,0 @@ -[ - { - "Input": "100%", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 por ciento", - "Results": [ - { - "Text": "100 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 14 - } - ] - }, - { - "Input": " cien por cien", - "Results": [ - { - "Text": "cien por cien", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 13 - } - ] - }, - { - "Input": "cien por ciento", - "Results": [ - { - "Text": "cien por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "243 por ciento", - "Results": [ - { - "Text": "243 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "243%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "veinte por ciento", - "Results": [ - { - "Text": "veinte por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "treinta y cinco por ciento", - "Results": [ - { - "Text": "treinta y cinco por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "35%" - }, - "Start": 0, - "End": 25 - } - ] - }, - { - "Input": "quinientos treinta y cinco por ciento", - "Results": [ - { - "Text": "quinientos treinta y cinco por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "535%" - }, - "Start": 0, - "End": 36 - } - ] - }, - { - "Input": "10 por ciento", - "Results": [ - { - "Text": "10 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "diez por ciento", - "Results": [ - { - "Text": "diez por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "tres millones cincuenta y dos mil trescientos cuarenta y siete por ciento", - "Results": [ - { - "Text": "tres millones cincuenta y dos mil trescientos cuarenta y siete por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "3052347%" - }, - "Start": 0, - "End": 72 - } - ] - }, - { - "Input": "tres millones cuatrocientos cincuenta y dos mil trescientos cuarenta y siete por ciento", - "Results": [ - { - "Text": "tres millones cuatrocientos cincuenta y dos mil trescientos cuarenta y siete por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "3452347%" - }, - "Start": 0, - "End": 86 - } - ] - }, - { - "Input": "trece millones cuatrocientos cincuenta y dos mil trescientos cuarenta y siete por ciento", - "Results": [ - { - "Text": "trece millones cuatrocientos cincuenta y dos mil trescientos cuarenta y siete por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "13452347%" - }, - "Start": 0, - "End": 87 - } - ] - }, - { - "Input": "quinientos trece millones cuatrocientos cincuenta y dos mil trescientos cuarenta y siete por ciento", - "Results": [ - { - "Text": "quinientos trece millones cuatrocientos cincuenta y dos mil trescientos cuarenta y siete por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "513452347%" - }, - "Start": 0, - "End": 98 - } - ] - }, - { - "Input": "quinientos trece millones cuatrocientos cincuenta y dos mil trescientos cuarenta por ciento", - "Results": [ - { - "Text": "quinientos trece millones cuatrocientos cincuenta y dos mil trescientos cuarenta por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "513452340%" - }, - "Start": 0, - "End": 90 - } - ] - }, - { - "Input": "quinientos trece millones cuatrocientos cincuenta y dos mil trescientos por ciento", - "Results": [ - { - "Text": "quinientos trece millones cuatrocientos cincuenta y dos mil trescientos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "513452300%" - }, - "Start": 0, - "End": 81 - } - ] - }, - { - "Input": "quinientos trece millones cuatrocientos cincuenta y dos mil por ciento", - "Results": [ - { - "Text": "quinientos trece millones cuatrocientos cincuenta y dos mil por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "513452000%" - }, - "Start": 0, - "End": 69 - } - ] - }, - { - "Input": "tres billones cuatrocientos cincuenta y cinco mil doscientos veintiocho millones quinientos cincuenta y seis mil ochocientos treinta y dos por ciento", - "Results": [ - { - "Text": "tres billones cuatrocientos cincuenta y cinco mil doscientos veintiocho millones quinientos cincuenta y seis mil ochocientos treinta y dos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "3455228556832%" - }, - "Start": 0, - "End": 148 - } - ] - }, - { - "Input": "algo asi como un 11%", - "Results": [ - { - "Text": "11%", - "TypeName": "percentage", - "Resolution": { - "value": "11%" - }, - "Start": 17, - "End": 19 - } - ] - }, - { - "Input": "claro, solamente un 15 por ciento", - "Results": [ - { - "Text": "15 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "15%" - }, - "Start": 20, - "End": 32 - } - ] - }, - { - "Input": "si, nada mas un veinticinco por ciento", - "Results": [ - { - "Text": "veinticinco por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 16, - "End": 37 - } - ] - }, - { - "Input": "todo, dejame el cien por cien del combustible", - "Results": [ - { - "Text": "cien por cien", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 16, - "End": 28 - } - ] - }, - { - "Input": "un porcentaje del 25%", - "Results": [ - { - "Text": "25%", - "TypeName": "percentage", - "Resolution": { - "value": "25%" - }, - "Start": 18, - "End": 20 - } - ] - }, - { - "Input": "un porcentaje del treinta y seis por ciento del total", - "Results": [ - { - "Text": "treinta y seis por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "36%" - }, - "Start": 18, - "End": 42 - } - ] - }, - { - "Input": "un porcentaje del ochenta y cuatro por cien solamente", - "Results": [ - { - "Text": "ochenta y cuatro por cien", - "TypeName": "percentage", - "Resolution": { - "value": "84%" - }, - "Start": 18, - "End": 42 - } - ] - }, - { - "Input": " 101231,2353%", - "Results": [ - { - "Text": "101231,2353%", - "TypeName": "percentage", - "Resolution": { - "value": "101231,2353%" - }, - "Start": 1, - "End": 12 - } - ] - }, - { - "Input": "-101231,4323%", - "Results": [ - { - "Text": "-101231,4323%", - "TypeName": "percentage", - "Resolution": { - "value": "-101231,4323%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": " -89101231,5127 por ciento", - "Results": [ - { - "Text": "-89101231,5127 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "-89101231,5127%" - }, - "Start": 1, - "End": 25 - } - ] - }, - { - "Input": " -1,1234567 por cien", - "Results": [ - { - "Text": "-1,1234567 por cien", - "TypeName": "percentage", - "Resolution": { - "value": "-1,1234567%" - }, - "Start": 1, - "End": 19 - } - ] - }, - { - "Input": "1.234.567,51274 por ciento", - "Results": [ - { - "Text": "1.234.567,51274 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "1234567,51274%" - }, - "Start": 0, - "End": 25 - } - ] - }, - { - "Input": ",23456000%", - "Results": [ - { - "Text": ",23456000%", - "TypeName": "percentage", - "Resolution": { - "value": "0,23456%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "4,800%", - "Results": [ - { - "Text": "4,800%", - "TypeName": "percentage", - "Resolution": { - "value": "4,8%" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": ",08 por ciento", - "Results": [ - { - "Text": ",08 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,08%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "9,2321312%", - "Results": [ - { - "Text": "9,2321312%", - "TypeName": "percentage", - "Resolution": { - "value": "9,2321312%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": " -9,2321312 por cien", - "Results": [ - { - "Text": "-9,2321312 por cien", - "TypeName": "percentage", - "Resolution": { - "value": "-9,2321312%" - }, - "Start": 1, - "End": 19 - } - ] - }, - { - "Input": "1e10%", - "Results": [ - { - "Text": "1e10%", - "TypeName": "percentage", - "Resolution": { - "value": "10000000000%" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "1,1^23 por ciento", - "Results": [ - { - "Text": "1,1^23 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "8,95430243255239%" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "siete con cincuenta por ciento", - "Results": [ - { - "Text": "siete con cincuenta por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "7,5%" - }, - "Start": 0, - "End": 29 - } - ] - }, - { - "Input": "cuarenta y siete coma veintiocho por ciento", - "Results": [ - { - "Text": "cuarenta y siete coma veintiocho por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "47,28%" - }, - "Start": 0, - "End": 42 - } - ] - }, - { - "Input": "trescientos cuarenta y siete con quinientos doce por ciento", - "Results": [ - { - "Text": "trescientos cuarenta y siete con quinientos doce por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "347,512%" - }, - "Start": 0, - "End": 58 - } - ] - }, - { - "Input": "dos mil trescientos cuarenta y siete coma mil quinientos setenta y ocho por ciento", - "Results": [ - { - "Text": "dos mil trescientos cuarenta y siete coma mil quinientos setenta y ocho por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "2347,1578%" - }, - "Start": 0, - "End": 81 - } - ] - }, - { - "Input": "cincuenta y dos mil trescientos cuarenta y siete con doscientos por ciento", - "Results": [ - { - "Text": "cincuenta y dos mil trescientos cuarenta y siete con doscientos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "52347,2%" - }, - "Start": 0, - "End": 73 - } - ] - }, - { - "Input": "cuatrocientos cincuenta y dos mil trescientos cuarenta y siete coma veintidos por ciento", - "Results": [ - { - "Text": "cuatrocientos cincuenta y dos mil trescientos cuarenta y siete coma veintidos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "452347,22%" - }, - "Start": 0, - "End": 87 - } - ] - }, - { - "Input": "tres quintos por ciento", - "Results": [ - { - "Text": "tres quintos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,6%" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "dos coma cinco por ciento", - "Results": [ - { - "Text": "dos coma cinco por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "2,5%" - }, - "Start": 0, - "End": 24 - } - ] - }, - { - "Input": "un quinto por ciento", - "Results": [ - { - "Text": "un quinto por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,2%" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "un billonesimo por cien", - "Results": [ - { - "Text": "un billonesimo por cien", - "TypeName": "percentage", - "Resolution": { - "value": "1E-12%" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "un veintiunavo por ciento", - "Results": [ - { - "Text": "un veintiunavo por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,0476190476190476%" - }, - "Start": 0, - "End": 24 - } - ] - }, - { - "Input": "ciento treinta y tres veintiunavos por ciento", - "Results": [ - { - "Text": "ciento treinta y tres veintiunavos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "6,33333333333333%" - }, - "Start": 0, - "End": 44 - } - ] - }, - { - "Input": "ciento treinta con tres veintiunavos por ciento", - "Results": [ - { - "Text": "ciento treinta con tres veintiunavos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "130,142857142857%" - }, - "Start": 0, - "End": 46 - } - ] - }, - { - "Input": "veintidos treintavos por ciento", - "Results": [ - { - "Text": "veintidos treintavos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,733333333333333%" - }, - "Start": 0, - "End": 30 - } - ] - }, - { - "Input": "tres dosmilesimos por ciento", - "Results": [ - { - "Text": "tres dosmilesimos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,0015%" - }, - "Start": 0, - "End": 27 - } - ] - }, - { - "Input": "tres veintemilesimos por ciento", - "Results": [ - { - "Text": "tres veintemilesimos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,00015%" - }, - "Start": 0, - "End": 30 - } - ] - }, - { - "Input": "ciento treinta quintos por ciento", - "Results": [ - { - "Text": "ciento treinta quintos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "26%" - }, - "Start": 0, - "End": 32 - } - ] - }, - { - "Input": "cien treintaicincoavos por ciento", - "Results": [ - { - "Text": "cien treintaicincoavos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "2,85714285714286%" - }, - "Start": 0, - "End": 32 - } - ] - }, - { - "Input": "ciento treinta y dos cincoavos por ciento", - "Results": [ - { - "Text": "ciento treinta y dos cincoavos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "26,4%" - }, - "Start": 0, - "End": 40 - } - ] - }, - { - "Input": "ciento treinta con dos cincoavos por ciento", - "Results": [ - { - "Text": "ciento treinta con dos cincoavos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "130,4%" - }, - "Start": 0, - "End": 42 - } - ] - }, - { - "Input": "ciento treinta y dos quintos por ciento", - "Results": [ - { - "Text": "ciento treinta y dos quintos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "26,4%" - }, - "Start": 0, - "End": 38 - } - ] - }, - { - "Input": "ciento treinta con dos quintos por ciento", - "Results": [ - { - "Text": "ciento treinta con dos quintos por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "130,4%" - }, - "Start": 0, - "End": 40 - } - ] - }, - { - "Input": "uno sobre tres por ciento", - "Results": [ - { - "Text": "uno sobre tres por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,333333333333333%" - }, - "Start": 0, - "End": 24 - } - ] - }, - { - "Input": "1 sobre 3 por ciento", - "Results": [ - { - "Text": "1 sobre 3 por ciento", - "TypeName": "percentage", - "Resolution": { - "value": "0,333333333333333%" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "3/4%", - "Results": [ - { - "Text": "3/4%", - "TypeName": "percentage", - "Resolution": { - "value": "0,75%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "2/3%", - "Results": [ - { - "Text": "2/3%", - "TypeName": "percentage", - "Resolution": { - "value": "0,666666666666667%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "puedes ir a http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 para más detalles", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "puedes ir a https://www.test.com/search?q=30%25%2020% para más detalles", - "NotSupported": "javascript", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/Number/SpanishMexican/NumberModel.json b/Specs/Number/SpanishMexican/NumberModel.json index 7859aff01f..5cc9598557 100644 --- a/Specs/Number/SpanishMexican/NumberModel.json +++ b/Specs/Number/SpanishMexican/NumberModel.json @@ -166,5 +166,133 @@ "End": 17 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Swedish/NumberModel.json b/Specs/Number/Swedish/NumberModel.json index 808c819f68..e2d63cd3c8 100644 --- a/Specs/Number/Swedish/NumberModel.json +++ b/Specs/Number/Swedish/NumberModel.json @@ -1,7 +1,7 @@ [ { "Input": "192.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "192", @@ -17,7 +17,7 @@ }, { "Input": "192.168.1.2", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "192", @@ -63,34 +63,34 @@ }, { "Input": "vätskan på 180,25ml", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "vätskan på 180ml", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": " 29km väg ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": " den 4 maj ", "Comments": "Should be handled by the date extractor? Currently resolves as a number.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "vätskan på ,25ml", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": ",08", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": ",08", @@ -108,12 +108,12 @@ "Input": "en", "Comments": "Resolves as 1. 'en' corresponds to 'a' or 'an' in english.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": ",23456000", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": ",23456000", @@ -129,7 +129,7 @@ }, { "Input": "4,800", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "4,800", @@ -145,7 +145,7 @@ }, { "Input": "etthundratrettiotvå femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "etthundratrettiotvå femtedelar", @@ -161,7 +161,7 @@ }, { "Input": "sexton", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "sexton", @@ -177,7 +177,7 @@ }, { "Input": "två tredjedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "två tredjedelar", @@ -193,7 +193,7 @@ }, { "Input": "etthundrasexton", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "etthundrasexton", @@ -209,7 +209,7 @@ }, { "Input": "etthundrasex", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "etthundrasex", @@ -240,7 +240,7 @@ }, { "Input": "en triljondel", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "en triljondel", @@ -256,7 +256,7 @@ }, { "Input": "etthundra triljontedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "etthundra triljontedelar", @@ -287,7 +287,7 @@ }, { "Input": "Jag köpte ett halvt dussin ägg", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ett halvt dussin", @@ -303,7 +303,7 @@ }, { "Input": "Jag köpte ett dussin ägg", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ett dussin", @@ -319,7 +319,7 @@ }, { "Input": "Jag köpte två dussin ägg", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "två dussin", @@ -335,7 +335,7 @@ }, { "Input": " 3 dussin", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "3 dussin", @@ -351,7 +351,7 @@ }, { "Input": "ett dussin", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "ett dussin", @@ -367,7 +367,7 @@ }, { "Input": " tre dussin ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "tre dussin", @@ -383,7 +383,7 @@ }, { "Input": " trehundratvå dussin", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "trehundratvå dussin", @@ -399,7 +399,7 @@ }, { "Input": "1 234 567", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1 234 567", @@ -415,7 +415,7 @@ }, { "Input": "1, 234, 567", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "1", @@ -451,7 +451,7 @@ }, { "Input": "9,2321312", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "9,2321312", @@ -467,7 +467,7 @@ }, { "Input": " -9,2321312", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-9,2321312", @@ -483,7 +483,7 @@ }, { "Input": " -1", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "-1", @@ -499,7 +499,7 @@ }, { "Input": "4/5", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "4/5", @@ -515,7 +515,7 @@ }, { "Input": "- 4/5", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "- 4/5", @@ -531,7 +531,7 @@ }, { "Input": "-4/5", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-4/5", @@ -547,7 +547,7 @@ }, { "Input": "- 1 4/5", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "- 1 4/5", @@ -563,7 +563,7 @@ }, { "Input": "tre", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tre", @@ -579,7 +579,7 @@ }, { "Input": " 123456789101231", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "123456789101231", @@ -595,7 +595,7 @@ }, { "Input": "-123456789101231", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-123456789101231", @@ -611,7 +611,7 @@ }, { "Input": " -123456789101231", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-123456789101231", @@ -627,7 +627,7 @@ }, { "Input": "1", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1", @@ -643,7 +643,7 @@ }, { "Input": "10k", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "10k", @@ -659,7 +659,7 @@ }, { "Input": "100k", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "100k", @@ -675,7 +675,7 @@ }, { "Input": "10G", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "10g", @@ -706,7 +706,7 @@ }, { "Input": "2 miljoner", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "2 miljoner", @@ -722,7 +722,7 @@ }, { "Input": "1 triljon", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1 triljon", @@ -738,7 +738,7 @@ }, { "Input": " tre ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tre", @@ -754,7 +754,7 @@ }, { "Input": "en triljon", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en triljon", @@ -770,7 +770,7 @@ }, { "Input": "tjugoen triljoner", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tjugoen triljoner", @@ -786,7 +786,7 @@ }, { "Input": "tjugoen triljonertrehundra", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tjugoen triljonertrehundra", @@ -802,7 +802,7 @@ }, { "Input": "femtio två", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "femtio två", @@ -820,7 +820,7 @@ "Input": "Tre hundra trettio en", "Comments": "This expression currently resolves as 2 numbers", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "Tre hundra trettio en", @@ -836,7 +836,7 @@ }, { "Input": "1e10", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1e10", @@ -852,7 +852,7 @@ }, { "Input": "1,1^23", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1,1^23", @@ -868,7 +868,7 @@ }, { "Input": " 322 hundra ", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "322 hundra", @@ -884,7 +884,7 @@ }, { "Input": "sjuttio", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "sjuttio", @@ -900,7 +900,7 @@ }, { "Input": "2 1/4", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "2 1/4", @@ -916,7 +916,7 @@ }, { "Input": "3/4", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "3/4", @@ -932,7 +932,7 @@ }, { "Input": "en åttondel", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en åttondel", @@ -948,7 +948,7 @@ }, { "Input": "fem åttondelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "fem åttondelar", @@ -964,7 +964,7 @@ }, { "Input": "en halv", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en halv", @@ -980,7 +980,7 @@ }, { "Input": "tre kvarts", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tre kvarts", @@ -996,7 +996,7 @@ }, { "Input": "tjugo och tre femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tjugo och tre femtedelar", @@ -1012,7 +1012,7 @@ }, { "Input": "en miljontvåtusentvåhundratre femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en miljontvåtusentvåhundratre femtedelar", @@ -1028,7 +1028,7 @@ }, { "Input": "en och en halv", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en och en halv", @@ -1044,7 +1044,7 @@ }, { "Input": "en och en fjärdedel", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en och en fjärdedel", @@ -1060,7 +1060,7 @@ }, { "Input": "fem och en kvarts", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "fem och en kvarts", @@ -1076,7 +1076,7 @@ }, { "Input": "etthundra och tre kvarts", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "etthundra och tre kvarts", @@ -1092,7 +1092,7 @@ }, { "Input": "en hundradel", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en hundradel", @@ -1108,7 +1108,7 @@ }, { "Input": "1,1^+23", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1,1^+23", @@ -1124,7 +1124,7 @@ }, { "Input": "2,5^-1", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "2,5^-1", @@ -1140,7 +1140,7 @@ }, { "Input": "-2500^-1", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-2500^-1", @@ -1156,7 +1156,7 @@ }, { "Input": "-1,1^+23", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-1,1^+23", @@ -1172,7 +1172,7 @@ }, { "Input": "-2,5^-1", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-2,5^-1", @@ -1188,7 +1188,7 @@ }, { "Input": "-1,1^--23", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-1,1^--23", @@ -1204,7 +1204,7 @@ }, { "Input": "-127,32e13", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-127,32e13", @@ -1220,7 +1220,7 @@ }, { "Input": "12,32e+15", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "12,32e+15", @@ -1236,7 +1236,7 @@ }, { "Input": "-12e-1", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "-12e-1", @@ -1252,7 +1252,7 @@ }, { "Input": "1,2b", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1,2b", @@ -1268,7 +1268,7 @@ }, { "Input": "en femtedel", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en femtedel", @@ -1284,7 +1284,7 @@ }, { "Input": "etthundra tusen triljondelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "etthundra tusen triljondelar", @@ -1300,7 +1300,7 @@ }, { "Input": "tre femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tre femtedelar", @@ -1316,7 +1316,7 @@ }, { "Input": "tjugo femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tjugo femtedelar", @@ -1332,7 +1332,7 @@ }, { "Input": "tre och en femtedel", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tre och en femtedel", @@ -1348,7 +1348,7 @@ }, { "Input": "tjugoen femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tjugoen femtedelar", @@ -1364,7 +1364,7 @@ }, { "Input": "två tjugoförstedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "två tjugoförstedelar", @@ -1380,7 +1380,7 @@ }, { "Input": "en tjugoförstedels andel", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en tjugoförstedels", @@ -1396,7 +1396,7 @@ }, { "Input": "en tjugo femtedel", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en tjugo femtedel", @@ -1412,7 +1412,7 @@ }, { "Input": "tre tjugoförstedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tre tjugoförstedelar", @@ -1428,7 +1428,7 @@ }, { "Input": "hans andel var de resterande tre tjugoförstedelarna", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tre tjugoförstedelarna", @@ -1444,7 +1444,7 @@ }, { "Input": "tjugo tjugo femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tjugo tjugo femtedelar", @@ -1460,7 +1460,7 @@ }, { "Input": "etthundratrettio femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "etthundratrettio femtedelar", @@ -1476,7 +1476,7 @@ }, { "Input": "etthundra trettiotvå femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "etthundra trettiotvå femtedelar", @@ -1492,7 +1492,7 @@ }, { "Input": "etthundraentusen femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "etthundraentusen femtedelar", @@ -1508,7 +1508,7 @@ }, { "Input": "ett genom tre", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "ett genom tre", @@ -1524,7 +1524,7 @@ }, { "Input": "1 delat med tjugoett", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1 delat med tjugoett", @@ -1540,7 +1540,7 @@ }, { "Input": "1 delat med etthundratjugoett", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1 delat med etthundratjugoett", @@ -1556,7 +1556,7 @@ }, { "Input": "1 genom tre", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1 genom tre", @@ -1572,7 +1572,7 @@ }, { "Input": "1 delat med 3", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1 delat med 3", @@ -1588,7 +1588,7 @@ }, { "Input": "ett delat med 3", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "ett delat med 3", @@ -1619,7 +1619,7 @@ }, { "Input": "ett delat på tjugo", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "ett delat på tjugo", @@ -1635,7 +1635,7 @@ }, { "Input": "ett genom etthundra", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "ett genom etthundra", @@ -1651,7 +1651,7 @@ }, { "Input": "hur mycket är nittiofem hundra femtedelar?", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "nittiofem hundra femtedelar", @@ -1667,7 +1667,7 @@ }, { "Input": "Boka en förstaklassbiljett till Seattle", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en", @@ -1683,7 +1683,7 @@ }, { "Input": "Svaret är negativt nittiofem hundra femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "negativt nittiofem hundra femtedelar", @@ -1699,7 +1699,7 @@ }, { "Input": "Svaret är minus nittiofem hundra femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "minus nittiofem hundra femtedelar", @@ -1715,7 +1715,7 @@ }, { "Input": "Svaret är minus ett", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "minus ett", @@ -1731,7 +1731,7 @@ }, { "Input": "Svaret är minus etthundratrettio femtedelar", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "minus etthundratrettio femtedelar", @@ -1747,7 +1747,7 @@ }, { "Input": "Svaret är negativt ett delat på 20", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "negativt ett delat på 20", @@ -1763,7 +1763,7 @@ }, { "Input": "Svaret är minus fem komma fem", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "minus fem komma fem", @@ -1779,7 +1779,7 @@ }, { "Input": "Svaret är minus 5", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "minus 5", @@ -1797,7 +1797,7 @@ "Input": "en - fjärdedel", "Comment": "Currently resolves as 0,2. Need to decide whether this construct should be resolved as fraction, as number and fraction or simply ignore. This construct is not used in sweden.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en - fjärdedel", @@ -1815,7 +1815,7 @@ "Input": "en-åttondel", "Comment": "Currently resolves as 0,11111... Need to decide whether this construct should be resolved as fraction, as number and fraction or simply ignore. This construct is not used in sweden.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en-åttondel", @@ -1833,7 +1833,7 @@ "Input": "fem - åttondelar", "Comment": "Currently resolves as 0,07692... Need to decide whether this construct should be resolved as fraction, as number and fraction or simply ignore. This construct is not used in sweden.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "fem - åttondelar", @@ -1851,7 +1851,7 @@ "Input": "nittio - fem hundra-femtedelar", "Comment": "Currently resolves as 0,9047... Need to decide whether this construct should be resolved as fraction, as number and fraction or simply ignore. This construct is not used in sweden.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "nittio - fem hundra-femtedelar", @@ -1867,7 +1867,7 @@ }, { "Input": "en av tre", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en av tre", @@ -1883,7 +1883,7 @@ }, { "Input": "1 av tjugo ett", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1 av tjugo ett", @@ -1899,7 +1899,7 @@ }, { "Input": "fem åttondelar av", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "fem åttondelar", @@ -1915,7 +1915,7 @@ }, { "Input": "40 000 är samma som 40 000", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "40 000", @@ -1941,7 +1941,7 @@ }, { "Input": "Just nu är Kinas befolkningsmängd 1 414 021 100.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1 414 021 100", @@ -1957,7 +1957,7 @@ }, { "Input": "423 0000 tolkas som två tal.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "423", @@ -1993,7 +1993,7 @@ }, { "Input": "1 234 567,89 är ett giltigt talformat.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "1 234 567,89", @@ -2019,7 +2019,7 @@ }, { "Input": "noll är 0", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "noll", @@ -2046,7 +2046,7 @@ { "Input": "Har du tid att träffas 2018-05-17?", "Comment": "The original spec says 5/17/2018. Swedish dates are written as yyyy-MM-DD", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "2018", @@ -2082,7 +2082,7 @@ }, { "Input": "Mitt telefonnummer är +46(0)403123123123", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "46", @@ -2118,7 +2118,7 @@ }, { "Input": "Jag kan ge dig 10M.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "10m", @@ -2135,7 +2135,7 @@ { "Input": "1m är inte ett tal.", "Comment": "1m is ignored, but 'ett' resolves as 1, which is expected.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "ett", @@ -2153,7 +2153,7 @@ "Input": "Jag kan ge dig 3 hundra 21 yuan.", "Comment": "Currently resolves as 2 numbers.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "3 hundra 21", @@ -2170,7 +2170,7 @@ "Input": "4 tusen 3 hundra 21 är ett giltigt tal.", "Comment": "Currently resolves as 4 numbers.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "4 tusen 3 hundra 21", @@ -2187,7 +2187,7 @@ "Input": "4 tusen 3 hundra 0 är två giltiga tal.", "Comment": "Currently resolves as 4 numbers.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "4 tusen 3 hundra", @@ -2223,7 +2223,7 @@ "Input": "4000 3 hundra 21 är två giltiga tal.", "Comment": "Currently resolves as 4 numbers.", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "4000", @@ -2258,7 +2258,7 @@ }, { "Input": "3 hundra och 2 hundra är två giltiga tal.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "3 hundra", @@ -2294,7 +2294,7 @@ }, { "Input": "3 hundra och 2,12 hundra är två giltiga tal.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "3 hundra", @@ -2330,7 +2330,7 @@ }, { "Input": "3 hundra och negativt ett är två giltiga tal.", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "3 hundra", @@ -2368,7 +2368,7 @@ "Input": "3 hundra en är giltiga tal.", "Comment": "Currently resolves into two numbers", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "3 hundra en", @@ -2384,7 +2384,7 @@ }, { "Input": "tvåhundra", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [ { "Text": "tvåhundra", @@ -2400,27 +2400,27 @@ }, { "Input": "The one you mentioned is invalid", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [] }, { "Input": "This one you is not correct", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [] }, { "Input": "Which one do you prefer?", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [] }, { "Input": "That one is really good", - "NotSupportedByDesign": "javascript, java, python", + "NotSupportedByDesign": "javascript, java ", "Results": [] }, { "Input": "I vissa länder kan du skriva 5.00 eller 5,00.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "5.00", @@ -2446,7 +2446,7 @@ }, { "Input": "Tjugosex människor dör i olycka i Techiman", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tjugosex", @@ -2462,7 +2462,7 @@ }, { "Input": "mer än hälften av människorna kom hit.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "hälften", @@ -2478,7 +2478,7 @@ }, { "Input": "Jag vill tjäna $10000 inom 3 år", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "10000", @@ -2504,7 +2504,7 @@ }, { "Input": "Jag vill tjäna $2000 under 3 år", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "2000", @@ -2530,7 +2530,7 @@ }, { "Input": "2000 genom 3", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "2000 genom 3", @@ -2546,7 +2546,7 @@ }, { "Input": "$20", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "20", @@ -2562,7 +2562,7 @@ }, { "Input": "resultatet är ⅔", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "⅔", @@ -2578,7 +2578,7 @@ }, { "Input": "resultatet är ¾", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "¾", @@ -2594,7 +2594,7 @@ }, { "Input": "resultatet är ⅙ och ibland ½", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "⅙", @@ -2617,5 +2617,133 @@ "End": 27 } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } ] diff --git a/Specs/Number/Swedish/OrdinalModel.json b/Specs/Number/Swedish/OrdinalModel.json index 0bf772fb97..5716e0ed42 100644 --- a/Specs/Number/Swedish/OrdinalModel.json +++ b/Specs/Number/Swedish/OrdinalModel.json @@ -1,7 +1,7 @@ [ { "Input": "radera sista meningen i anteckningen", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "sista", @@ -18,7 +18,7 @@ }, { "Input": "Menar du \"nästa\" eller \"sista\"?", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "nästa", @@ -46,7 +46,7 @@ }, { "Input": "Menar du \"näste\" eller \"siste\"?", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "näste", @@ -74,7 +74,7 @@ }, { "Input": "Visa mig näst sista.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "näst sista", @@ -91,7 +91,7 @@ }, { "Input": "Gå till föregående sida.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "föregående", @@ -108,7 +108,7 @@ }, { "Input": "Visa mig den som kommer efter sista.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "efter sista", @@ -125,7 +125,7 @@ }, { "Input": "Visa mig den som kommer före den siste.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "före den siste", @@ -142,7 +142,7 @@ }, { "Input": "Visa mig nästa.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "nästa", @@ -159,7 +159,7 @@ }, { "Input": "Visa mig nästa möte.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "nästa", @@ -176,7 +176,7 @@ }, { "Input": "Visa de 2 sista posterna.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "sista", @@ -193,7 +193,7 @@ }, { "Input": "Jag vill ha de nästa 3 böckerna.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "nästa", @@ -210,7 +210,7 @@ }, { "Input": "Jag vill ha sista kakan.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "sista", @@ -227,7 +227,7 @@ }, { "Input": "etthundratjugofemte", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "etthundratjugofemte", @@ -244,7 +244,7 @@ }, { "Input": "Ge mig nästa.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "nästa", @@ -261,7 +261,7 @@ }, { "Input": "11:e", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "11:e", @@ -279,7 +279,7 @@ }, { "Input": "Gå till den 11:e raden", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "11:e", @@ -296,7 +296,7 @@ }, { "Input": "elfte", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "elfte", @@ -314,7 +314,7 @@ }, { "Input": "Gå till den elfte raden", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "elfte", @@ -331,7 +331,7 @@ }, { "Input": "tredje", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "tredje", @@ -349,7 +349,7 @@ }, { "Input": "Gå till den tredje raden", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "tredje", @@ -366,7 +366,7 @@ }, { "Input": "tjugoförsta", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "tjugoförsta", @@ -383,7 +383,7 @@ }, { "Input": "tjugoförste", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "tjugoförste", @@ -400,7 +400,7 @@ }, { "Input": "tvåhundrade", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "tvåhundrade", @@ -438,7 +438,7 @@ }, { "Input": "Jag tycker om den förste.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "förste", @@ -455,7 +455,7 @@ }, { "Input": "Säg första ordet.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "första", @@ -472,7 +472,7 @@ }, { "Input": "Hon slutade på andra plats!", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "andra", @@ -489,7 +489,7 @@ }, { "Input": "Den före den sista är den rätta", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "före den sista", @@ -506,7 +506,7 @@ }, { "Input": "Jag vill köpa den tredje från slutet", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "tredje från slutet", @@ -523,7 +523,7 @@ }, { "Input": "Jag menade den före den sista.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "före den sista", @@ -540,7 +540,7 @@ }, { "Input": "Jag menar den nuvarande", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "nuvarande", @@ -557,7 +557,7 @@ }, { "Input": "Se nuvarande sida", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "nuvarande", @@ -574,7 +574,7 @@ }, { "Input": "Visa poster som finns före nuvarande period", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "före nuvarande", @@ -591,7 +591,7 @@ }, { "Input": "hundrade", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "hundrade", @@ -608,7 +608,7 @@ }, { "Input": "126:e", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "126:e", @@ -625,7 +625,7 @@ }, { "Input": "Det är den hundratjugosjätte gången hittills i år.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": " hundratjugosjätte", @@ -642,7 +642,7 @@ }, { "Input": "Visa mig den tredje från slutet.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "tredje från slutet", @@ -659,7 +659,7 @@ }, { "Input": "Glöm förra gången.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "förra", @@ -676,7 +676,7 @@ }, { "Input": "Förskolebarn efter nuvarande vård", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "efter nuvarande", @@ -693,7 +693,7 @@ }, { "Input": "Förslaget är i linje med tidigare ställningstaganden", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "tidigare", @@ -710,7 +710,7 @@ }, { "Input": "Jag säger till innan sista psalmen.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "innan sista", @@ -727,7 +727,7 @@ }, { "Input": "Åtminstone inte den senaste veckan.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "senaste", diff --git a/Specs/Number/Swedish/OrdinalModelSuppressExtendedTypes.json b/Specs/Number/Swedish/OrdinalModelSuppressExtendedTypes.json index 6fc716b728..623a7a243b 100644 --- a/Specs/Number/Swedish/OrdinalModelSuppressExtendedTypes.json +++ b/Specs/Number/Swedish/OrdinalModelSuppressExtendedTypes.json @@ -1,67 +1,67 @@ [ { "Input": "radera sista meningen i anteckningen", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Menar du \"nästa\" eller \"sista\"?", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Menar du \"näste\" eller \"siste\"?", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Visa mig näst sista.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Gå till föregående sida.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Visa mig den som kommer efter sista.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Visa mig den som kommer före den siste.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Visa mig nästa.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Visa mig nästa möte.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Visa de 2 sista posterna.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Jag vill ha de nästa 3 böckerna.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "Jag vill ha sista kakan.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [] }, { "Input": "elfte", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript, java", "Results": [ { "Text": "elfte", diff --git a/Specs/Number/Swedish/PercentModel.json b/Specs/Number/Swedish/PercentModel.json deleted file mode 100644 index 71be31c840..0000000000 --- a/Specs/Number/Swedish/PercentModel.json +++ /dev/null @@ -1,147 +0,0 @@ -[ - { - "Input": "100%", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": " 100% ", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "100%", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": " 100 procent", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "100 procent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 1, - "End": 11 - } - ] - }, - { - "Input": "240 procent", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "240 procent", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "tjugo procent", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "tjugo procent", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "trettio procent", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "trettio procent", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "etthundra procent", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "etthundra procent", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "10 procent", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "10 procent", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "behöver bara minus fem procent", - "NotSupportedByDesign": "javascript, java, python", - "Results": [ - { - "Text": "minus fem procent", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 13, - "End": 29 - } - ] - }, - { - "Input": "You can go to http://proquest.umi.com/pqdweb?RQT=305&SQ=issn%280024%2D9114%29%20and%20%28ti%28Using%203D%20CAD%20to%20design%20a%20dog%29%20or%20startpage%28158%29%29%20and%20volume%2872%29%20and%20issue%289%29%20and%20pdn%28%3E01%2F01%2F2000%20AND%20%3C12%2F31%2F2000%29&clientId=17859 for more details.", - "NotSupportedByDesign": "javascript, java, python", - "Results": [] - }, - { - "Input": "You can go to https://www.test.com/search?q=30%25%2020%", - "NotSupportedByDesign": "javascript, java, python", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/Number/Turkish/NumberModel.json b/Specs/Number/Turkish/NumberModel.json index 9d189ae019..71d1ee1db1 100644 --- a/Specs/Number/Turkish/NumberModel.json +++ b/Specs/Number/Turkish/NumberModel.json @@ -1,7 +1,7 @@ [ { "Input": "192", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "192", @@ -17,7 +17,7 @@ { "Input": "192.168.1.2", "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "192", @@ -344,7 +344,7 @@ }, { "Input": "-1", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "-1", @@ -404,7 +404,7 @@ }, { "Input": "123456789101231", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "123456789101231", @@ -419,7 +419,7 @@ }, { "Input": "-123456789101231", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "-123456789101231", @@ -434,7 +434,7 @@ }, { "Input": " -123456789101231", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "-123456789101231", @@ -449,7 +449,7 @@ }, { "Input": "1", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1", @@ -464,7 +464,7 @@ }, { "Input": "10k", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10k", @@ -479,7 +479,7 @@ }, { "Input": "100k", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "100k", @@ -494,7 +494,7 @@ }, { "Input": "10G", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10g", @@ -509,7 +509,7 @@ }, { "Input": "- 10 k", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "- 10 k", @@ -659,7 +659,7 @@ }, { "Input": "2,33 k", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "2,33 k", @@ -704,7 +704,7 @@ }, { "Input": "1e10", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1e10", @@ -1109,7 +1109,7 @@ }, { "Input": "1,2b", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1,2b", @@ -1634,7 +1634,7 @@ }, { "Input": "1234567", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1234567", @@ -1761,7 +1761,7 @@ }, { "Input": "17/05/2018'de buluşma?", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "17", @@ -1794,7 +1794,7 @@ }, { "Input": "Telefon numaram +1-222-2222/2222", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "1", @@ -2150,5 +2150,133 @@ } } ] + }, + { + "Input": "-0e63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0e49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0e-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0e-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0e-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0e-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] + }, + { + "Input": "-0^63", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^63", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "0^49", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^49", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 3 + } + ] + }, + { + "Input": "0^-23", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "0^-23", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "-0^-17", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "-0^-17", + "TypeName": "number", + "Resolution": { + "subtype": "power", + "value": "0" + }, + "Start": 0, + "End": 5 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/Number/Turkish/OrdinalModelSuppressExtendedTypes.json b/Specs/Number/Turkish/OrdinalModelSuppressExtendedTypes.json index 2e5cc2e079..ce1dd12471 100644 --- a/Specs/Number/Turkish/OrdinalModelSuppressExtendedTypes.json +++ b/Specs/Number/Turkish/OrdinalModelSuppressExtendedTypes.json @@ -1,47 +1,47 @@ [ { "Input": "önceki", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Sonraki", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Bir önceki", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "ilki", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "İlki", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "Sonuncusu", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "son", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "sonuncu", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { "Input": "en son", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [] }, { diff --git a/Specs/Number/Turkish/PercentModel.json b/Specs/Number/Turkish/PercentModel.json deleted file mode 100644 index da7c4291c2..0000000000 --- a/Specs/Number/Turkish/PercentModel.json +++ /dev/null @@ -1,169 +0,0 @@ -[ - { - "Input": "%100", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "%100", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "yüzde 100", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yüzde 100", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "yüzde 240", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yüzde 240", - "TypeName": "percentage", - "Resolution": { - "value": "240%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "yüzde yirmi", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yüzde yirmi", - "TypeName": "percentage", - "Resolution": { - "value": "20%" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "yüzde otuz", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yüzde otuz", - "TypeName": "percentage", - "Resolution": { - "value": "30%" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "yüzde yüz", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yüzde yüz", - "TypeName": "percentage", - "Resolution": { - "value": "100%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "yüzde 10", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yüzde 10", - "TypeName": "percentage", - "Resolution": { - "value": "10%" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "yüzde yirmi iki", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yüzde yirmi iki", - "TypeName": "percentage", - "Resolution": { - "value": "22%" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "210'un yüzdesi", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "210'un yüzdesi", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "yüzde 210", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "yüzde 210", - "TypeName": "percentage", - "Resolution": { - "value": "210%" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "eksi yüzde beş", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "eksi yüzde beş", - "TypeName": "percentage", - "Resolution": { - "value": "-5%" - }, - "Start": 0, - "End": 13 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Arabic/CurrencyModel.json b/Specs/NumberWithUnit/Arabic/CurrencyModel.json new file mode 100644 index 0000000000..8b0c830832 --- /dev/null +++ b/Specs/NumberWithUnit/Arabic/CurrencyModel.json @@ -0,0 +1,321 @@ +[ + { + "Input": "أصبح زميله في فريق فولهام جوني هاينز أول لاعب بقيمة 100 جنيه إسترليني", + "Results": [ + { + "Text": "100 جنيه إسترليني", + "TypeName": "currency", + "Resolution": { + "value": "100", + "unit": "Egyptian pound" + }, + "Start": 52, + "End": 68 + } + ] + }, + { + "Input": "10 دولارات ليست كثيرة، 10 يورو", + "Results": [ + { + "Text": "10 دولارات", + "Start": 0, + "End": 9, + "TypeName": "currency", + "Resolution": { + "unit": "Dollar", + "value": "10" + } + }, + { + "Text": "10 يورو", + "Start": 23, + "End": 29, + "TypeName": "currency", + "Resolution": { + "unit": "Euro", + "value": "10" + } + } + ] + }, + { + "Input": "أرغب في شراء هذا المنتج مقابل 125 يورو.", + "Results": [ + { + "Text": "125 يورو", + "TypeName": "currency", + "Resolution": { + "value": "125", + "unit": "Euro", + "isoCurrency": "EUR" + }, + "Start": 30, + "End": 37 + } + ] + }, + { + "Input": "التذاكر: 5 يورو، 10 يورو، 20 يورو، 50 يورو، 100 يورو، 200 يورو، 500 يورو.", + "Results": [ + { + "Text": "5 يورو", + "Start": 9, + "End": 14, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "5" + } + }, + { + "Text": "10 يورو", + "Start": 17, + "End": 23, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "10" + } + }, + { + "Text": "20 يورو", + "Start": 26, + "End": 32, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "20" + } + }, + { + "Text": "50 يورو", + "Start": 35, + "End": 41, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "50" + } + }, + { + "Text": "100 يورو", + "Start": 44, + "End": 51, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "100" + } + }, + { + "Text": "200 يورو", + "Start": 54, + "End": 61, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "200" + } + }, + { + "Text": "500 يورو", + "Start": 64, + "End": 71, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "500" + } + } + ] + }, + { + "Input": "أرغب في شراء هذا المنتج مقابل 11.50 يورو", + "Results": [ + { + "Text": "11.50 يورو", + "TypeName": "currency", + "Resolution": { + "value": "11.5", + "unit": "Euro", + "isoCurrency": "EUR" + }, + "Start": 30, + "End": 39 + } + ] + }, + { + "Input": "أرغب في شراء هذا المنتج بمبلغ 60,000 جنيه إسترليني", + "Results": [ + { + "Text": "60,000 جنيه إسترليني", + "TypeName": "currency", + "Resolution": { + "value": "60000", + "unit": "Egyptian pound" + }, + "Start": 30, + "End": 49 + } + ] + }, + { + "Input": "لقد فزت للتو بألفي دولار!", + "Results": [ + { + "Text": "بألفي دولار", + "TypeName": "currency", + "Resolution": { + "value": "2000", + "unit": "Dollar" + }, + "Start": 13, + "End": 23 + } + ] + }, + { + "Input": "إيجار تلك الشقة هو 5 آلاف يورو", + "Results": [ + { + "Text": "5 آلاف يورو", + "TypeName": "currency", + "Resolution": { + "value": "5000", + "unit": "Euro" + }, + "Start": 19, + "End": 29 + } + ] + }, + { + "Input": "أنا مدين لك بستة دولارات مقابل عملية الشراء هذه", + "Results": [ + { + "Text": "بستة دولارات", + "TypeName": "currency", + "Resolution": { + "value": "6", + "unit": "Dollar" + }, + "Start": 12, + "End": 23 + } + ] + }, + { + "Input": "أخذنا العبارة التي كلفتنا مع60 دولارًا كنديًا فقط الضريبة", + "Results": [ + { + "Text": "60 دولارًا كنديًا", + "TypeName": "currency", + "Resolution": { + "value": "60", + "unit": "Canadian dollar" + }, + "Start": 28, + "End": 44 + } + ] + }, + { + "Input": "لدي خمسة عشر قرشا متبقية بعد التبادل", + "Results": [ + { + "Text": "خمسة عشر قرشا", + "TypeName": "currency", + "Resolution": { + "value": "15", + "unit": "Pence" + }, + "Start": 4, + "End": 16 + } + ] + }, + { + "Input": "3283 الدولارات", + "Results": [ + { + "Text": "3283 الدولارات", + "TypeName": "currency", + "Resolution": { + "value": "3283", + "unit": "Dollar" + }, + "Start": 0, + "End": 13 + } + ] + }, + { + "Input": "15 دولارًا و 15 سنتًا", + "Results": [ + { + "Text": "15 دولارًا و 15 سنتًا", + "TypeName": "currency", + "Resolution": { + "value": "15.15", + "unit": "Dollar" + }, + "Start": 0, + "End": 20 + } + ] + }, + { + "Input": "عشرون جنيها", + "Results": [ + { + "Text": "عشرون جنيها", + "TypeName": "currency", + "Resolution": { + "value": "20", + "unit": "Pound" + }, + "Start": 0, + "End": 10 + } + ] + }, + { + "Input": "خمسمائة ريال سعودي", + "Results": [ + { + "Text": "خمسمائة ريال سعودي", + "TypeName": "currency", + "Resolution": { + "value": "500", + "unit": "Saudi riyal" + }, + "Start": 0, + "End": 17 + } + ] + }, + { + "Input": "خمسمائة جنيه مصري", + "Results": [ + { + "Text": "خمسمائة جنيه مصري", + "TypeName": "currency", + "Resolution": { + "value": "500", + "unit": "Egyptian pound" + }, + "Start": 0, + "End": 16 + } + ] + } +] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Catalan/CurrencyModel.json b/Specs/NumberWithUnit/Catalan/CurrencyModel.json new file mode 100644 index 0000000000..362beeb6bb --- /dev/null +++ b/Specs/NumberWithUnit/Catalan/CurrencyModel.json @@ -0,0 +1,277 @@ +[ + { + "Input": "el seu company d'equip de Fulham Johnny Haynes es va convertir en el primer jugador de £ 100", + "Results": [ + { + "Text": "£ 100", + "TypeName": "currency", + "Resolution": { + "value": "100", + "unit": "Lliura" + }, + "Start": 87, + "End": 91 + } + ] + }, + { + "Input": "$10 no són gaires, €10 ", + "Results": [ + { + "Text": "$10", + "Start": 0, + "End": 2, + "TypeName": "currency", + "Resolution": { + "unit": "Dòlar", + "value": "10" + } + }, + { + "Text": "€10", + "Start": 19, + "End": 21, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "10" + } + } + ] + }, + { + "Input": "M'agradaria comprar aquest article per 125 EUR.", + "Results": [ + { + "Text": "125 eur", + "TypeName": "currency", + "Resolution": { + "value": "125", + "unit": "Euro", + "isoCurrency": "EUR" + }, + "Start": 39, + "End": 45 + } + ] + }, + { + "Input": "Bitllets: 5 €, 10 €, 20 €, 50 €, 100 €, 200 €, 500 €.", + "Results": [ + { + "Text": "5 €", + "Start": 10, + "End": 12, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "5" + } + }, + { + "Text": "10 €", + "Start": 15, + "End": 18, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "10" + } + }, + { + "Text": "20 €", + "Start": 21, + "End": 24, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "20" + } + }, + { + "Text": "50 €", + "Start": 27, + "End": 30, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "50" + } + }, + { + "Text": "100 €", + "Start": 33, + "End": 37, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "100" + } + }, + { + "Text": "200 €", + "Start": 40, + "End": 44, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "200" + } + }, + { + "Text": "500 €", + "Start": 47, + "End": 51, + "TypeName": "currency", + "Resolution": { + "isoCurrency": "EUR", + "unit": "Euro", + "value": "500" + } + } + ] + }, + { + "Input": "2 milions de dòlars nord-americans", + "Results": [ + { + "Text": "2 milions de dòlars nord-americans", + "TypeName": "currency", + "Resolution": { + "value": "2000000", + "unit": "Dòlar nord-americà", + "isoCurrency": "USD" + }, + "Start": 0, + "End": 33 + } + ] + }, + { + "Input": "80 centaus", + "Results": [ + { + "Text": "80 centaus", + "TypeName": "currency", + "Resolution": { + "value": "80", + "unit": "Centavo" + }, + "Start": 0, + "End": 9 + } + ] + }, + { + "Input": "345 $", + "Results": [ + { + "Text": "345 $", + "TypeName": "currency", + "Resolution": { + "value": "345", + "unit": "Dòlar" + }, + "Start": 0, + "End": 4 + } + ] + }, + { + "Input": "cent deu dòlars i catorze cèntims", + "Results": [ + { + "Text": "cent deu dòlars i catorze cèntims", + "TypeName": "currency", + "Resolution": { + "value": "110,14", + "unit": "Dòlar" + }, + "Start": 0, + "End": 32 + } + ] + }, + { + "Input": "Necessito tres mil cinc-cents euros", + "Results": [ + { + "Text": "tres mil cinc-cents euros", + "TypeName": "currency", + "Resolution": { + "value": "3500", + "unit": "Euro" + }, + "Start": 10, + "End": 34 + } + ] + }, + { + "Input": "Em pots donar mig milió d'euros, si us plau?", + "Results": [ + { + "Text": "mig milió d'euros", + "TypeName": "currency", + "Resolution": { + "value": "500000", + "unit": "Euro" + }, + "Start": 14, + "End": 30 + } + ] + }, + { + "Input": "pots donar-me quatre milions i mig d'euros?, si us plau?", + "Results": [ + { + "Text": "quatre milions i mig d'euros", + "TypeName": "currency", + "Resolution": { + "value": "4500000", + "unit": "Euro" + }, + "Start": 14, + "End": 41 + } + ] + }, + { + "Input": "pots donar-me quatre milions i mig d'euros?, si us plau?", + "Results": [ + { + "Text": "quatre milions i mig d'euros", + "TypeName": "currency", + "Resolution": { + "value": "4500000", + "unit": "Euro" + }, + "Start": 14, + "End": 41 + } + ] + }, + { + "Input": "Em pots donar mig milió de dòlars, si us plau?", + "Results": [ + { + "Text": "mig milió de dòlars", + "TypeName": "currency", + "Resolution": { + "value": "500000", + "unit": "Dòlar" + }, + "Start": 14, + "End": 32 + } + ] + } +] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Chinese/AgeModel.json b/Specs/NumberWithUnit/Chinese/AgeModel.json deleted file mode 100644 index 268797f6f0..0000000000 --- a/Specs/NumberWithUnit/Chinese/AgeModel.json +++ /dev/null @@ -1,153 +0,0 @@ -[ - { - "Input": "当她五岁的时候,她学会了骑自行车", - "Results": [ - { - "Text": "五岁", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 2, - "End": 3 - } - ] - }, - { - "Input": "我只有29岁!", - "Results": [ - { - "Text": "29岁", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 3, - "End": 5 - } - ] - }, - { - "Input": "这件事发生在宝宝只有十个月大的时候.", - "Results": [ - { - "Text": "十个月大", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 10, - "End": 13 - } - ] - }, - { - "Input": "十二月初出生的话已经三周大了", - "Results": [ - { - "Text": "三周大", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 10, - "End": 12 - } - ] - }, - { - "Input": "她出生于1945年5月8号,现在60岁了", - "Results": [ - { - "Text": "60岁", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 16, - "End": 18 - } - ] - }, - { - "Input": "她已经满七周岁了,可以上小学了", - "Results": [ - { - "Text": "七周岁", - "TypeName": "age", - "Resolution": { - "value": "7", - "unit": "Year" - }, - "Start": 4, - "End": 6 - } - ] - }, - { - "Input": "90天大的小孩应该去医院做检查", - "Results": [ - { - "Text": "90天大", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "70 - 90天大的小孩应该去医院做检查", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "90天大", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 5, - "End": 8 - } - ] - }, - { - "Input": "十二周岁", - "Results": [ - { - "Text": "十二周岁", - "TypeName": "age", - "Resolution": { - "value": "12", - "unit": "Year" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "他已经有十二周大了", - "Results": [ - { - "Text": "十二周大", - "TypeName": "age", - "Resolution": { - "value": "12", - "unit": "Week" - }, - "Start": 4, - "End": 7 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Chinese/DimensionModel.json b/Specs/NumberWithUnit/Chinese/DimensionModel.json deleted file mode 100644 index e1da06f1fe..0000000000 --- a/Specs/NumberWithUnit/Chinese/DimensionModel.json +++ /dev/null @@ -1,525 +0,0 @@ -[ - { - "Input": "去年,潜江虾稻产业综合产值突破180亿元,带动就业超10万人,龙虾养殖户户平增收16000元,带动全省养殖小龙虾387万亩。", - "Results": [ - { - "Text": "387万亩", - "TypeName": "dimension", - "Resolution": { - "value": "3870000", - "unit": "Mu" - }, - "Start": 56, - "End": 60 - } - ] - }, - { - "Input": "阳西辣椒火辣上市日均20万公斤远销珠三角", - "Results": [ - { - "Text": "20万公斤", - "TypeName": "dimension", - "Resolution": { - "value": "200000", - "unit": "Kilogram" - }, - "Start": 10, - "End": 14 - } - ] - }, - { - "Input": "如今身高168公分", - "Results": [ - { - "Text": "168公分", - "TypeName": "dimension", - "Resolution": { - "value": "168", - "unit": "Centimeter" - }, - "Start": 4, - "End": 8 - } - ] - }, - { - "Input": "澳联邦警察与维州警方在墨尔本缴获近一吨冰毒,为澳洲史上最大冰毒走私案。(澳洲联邦警察局 ...", - "Results": [ - { - "Text": "一吨", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Ton" - }, - "Start": 17, - "End": 18 - } - ] - }, - { - "Input": "如今身高168cm", - "Results": [ - { - "Text": "168cm", - "TypeName": "dimension", - "Resolution": { - "value": "168", - "unit": "Centimeter" - }, - "Start": 4, - "End": 8 - } - ] - }, - { - "Input": "如今身高168CM", - "Results": [ - { - "Text": "168cm", - "TypeName": "dimension", - "Resolution": { - "value": "168", - "unit": "Centimeter" - }, - "Start": 4, - "End": 8 - } - ] - }, - { - "Input": "这里水深超过250m", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "250m", - "TypeName": "dimension", - "Resolution": { - "value": "250", - "unit": "Meter" - }, - "Start": 6, - "End": 9 - } - ] - }, - { - "Input": "dimension是什么意思", - "Results": [] - }, - { - "Input": "今天2:00 pm, 你将会收到一个惊喜!", - "NotSupported": "java", - "Results": [] - }, - { - "Input": "一位名叫杰克的男生", - "NotSupported": "javascript, python, java, dotnet", - "Comment": "Ambiguous with other uses of 位 as measure word, especially 一位", - "Results": [] - }, - { - "Input": "一位是最小的存储单位", - "NotSupported": "javascript, python, java, dotnet", - "Results": [ - { - "Text": "一位", - "Start": 0, - "End": 1, - "TypeName": "dimension", - "Resolution": { - "unit": "Bit", - "value": "1" - } - } - ] - }, - { - "Input": "一吨半", - "Results": [ - { - "Text": "一吨半", - "TypeName": "dimension", - "Resolution": { - "value": "1.5", - "unit": "Ton" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "两米半", - "Results": [ - { - "Text": "两米半", - "TypeName": "dimension", - "Resolution": { - "value": "2.5", - "unit": "Meter" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "三斤半", - "Results": [ - { - "Text": "三斤半", - "TypeName": "dimension", - "Resolution": { - "value": "3.5", - "unit": "Jin" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "十五斤半", - "Results": [ - { - "Text": "十五斤半", - "TypeName": "dimension", - "Resolution": { - "value": "15.5", - "unit": "Jin" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "12千米", - "Results": [ - { - "Text": "12千米", - "TypeName": "dimension", - "Resolution": { - "value": "12", - "unit": "Kilometer" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "2.3千克", - "Results": [ - { - "Text": "2.3千克", - "TypeName": "dimension", - "Resolution": { - "value": "2.3", - "unit": "Kilogram" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "1千克", - "Results": [ - { - "Text": "1千克", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Kilogram" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "三百米", - "Results": [ - { - "Text": "三百米", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Meter" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "四十克", - "Results": [ - { - "Text": "四十克", - "TypeName": "dimension", - "Resolution": { - "value": "40", - "unit": "Gram" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "三千比特", - "NotSupported": "javascript", - "Results": [ - { - "Text": "三千比特", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Kilobit" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "五十兆字节", - "Results": [ - { - "Text": "五十兆字节", - "TypeName": "dimension", - "Resolution": { - "value": "50", - "unit": "Megabyte" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "六千字节", - "Results": [ - { - "Text": "六千字节", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Kilobyte" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "一千比特", - "NotSupported": "javascript", - "Results": [ - { - "Text": "一千比特", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Kilobit" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "1兆赫兹", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "1兆赫兹", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Megahertz" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "100赫兹", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "100赫兹", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Hertz" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "一百千瓦", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "一百千瓦", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Kilowatt" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "323千卡", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "323千卡", - "TypeName": "dimension", - "Resolution": { - "value": "323", - "unit": "Kilocalorie" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "两万两", - "NotSupported":"java", - "Results": [ - { - "Text": "两万两", - "TypeName": "dimension", - "Resolution": { - "value": "20000", - "unit": "Liang" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "二两", - "NotSupported":"java", - "Results": [ - { - "Text": "二两", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Liang" - }, - "Start": 0, - "End": 1 - } - ] - }, - { - "Input": "三十两", - "NotSupported":"java", - "Results": [ - { - "Text": "三十两", - "TypeName": "dimension", - "Resolution": { - "value": "30", - "unit": "Liang" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "三千两百两", - "NotSupported":"java", - "Results": [ - { - "Text": "三千两百两", - "TypeName": "dimension", - "Resolution": { - "value": "3200", - "unit": "Liang" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "1234两", - "NotSupported":"java", - "Results": [ - { - "Text": "1234两", - "TypeName": "dimension", - "Resolution": { - "value": "1234", - "unit": "Liang" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "负0.2千米", - "Results": [ - { - "Text": "负0.2千米", - "TypeName": "dimension", - "Resolution": { - "value": "-0.2", - "unit": "Kilometer" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "负13.5千米", - "Results": [ - { - "Text": "负13.5千米", - "TypeName": "dimension", - "Resolution": { - "value": "-13.5", - "unit": "Kilometer" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "成人每天需要摄入2.4微克的维生素B12", - "Results": [ - { - "Text": "2.4微克", - "TypeName": "dimension", - "Resolution": { - "value": "2.4", - "unit": "Microgram" - }, - "Start": 8, - "End": 12 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Chinese/TemperatureModel.json b/Specs/NumberWithUnit/Chinese/TemperatureModel.json deleted file mode 100644 index 34e6009444..0000000000 --- a/Specs/NumberWithUnit/Chinese/TemperatureModel.json +++ /dev/null @@ -1,153 +0,0 @@ -[ - { - "Input": "设置恒温器为85度", - "Results": [ - { - "Text": "85度", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 6, - "End": 8 - } - ] - }, - { - "Input": "把温度升高5度", - "Results": [ - { - "Text": "5度", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 5, - "End": 6 - } - ] - }, - { - "Input": "正常的温度是华氏温度98.6度", - "Results": [ - { - "Text": "华氏温度98.6度", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 6, - "End": 14 - } - ] - }, - { - "Input": "华氏温度100度", - "Results": [ - { - "Text": "华氏温度100度", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "20摄氏度", - "Results": [ - { - "Text": "20摄氏度", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "外面的温度是98度", - "Results": [ - { - "Text": "98度", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degree" - }, - "Start": 6, - "End": 8 - } - ] - }, - { - "Input": "你能把华氏温度51度转换为摄氏度吗", - "Results": [ - { - "Text": "华氏温度51度", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 3, - "End": 9 - }, - { - "Text": "摄氏度", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 13, - "End": 15 - } - ] - }, - { - "Input": "Annatalk请给我一些数目", - "NotSupported": "javascript", - "Comment": "Temporary regression", - "Results": [] - }, - { - "Input": "他烧到了39°C那么高", - "Results": [ - { - "Text": "39°c", - "TypeName": "temperature", - "Resolution": { - "value": "39", - "unit": "C" - }, - "Start": 4, - "End": 7 - } - ] - }, - { - "Input": "温度的单位是°C吗", - "Results": [ - { - "Text": "°c", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 6, - "End": 7 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Dutch/AgeModel.json b/Specs/NumberWithUnit/Dutch/AgeModel.json deleted file mode 100644 index 01dee8bc29..0000000000 --- a/Specs/NumberWithUnit/Dutch/AgeModel.json +++ /dev/null @@ -1,284 +0,0 @@ -[ - { - "Input": "Toen ze vijf jaar oud was, heeft ze leren fietsen.", - "Results": [ - { - "Text": "vijf jaar oud", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 8, - "End": 20 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Dit verhaal is 10 jaar oud.", - "Results": [ - { - "Text": "10 jaar oud", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Year" - }, - "Start": 15, - "End": 25 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Ik ben pas 29 jaar.", - "Results": [ - { - "Text": "29 jaar", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 11, - "End": 17 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Nu, op 95 jarige leeftijd, inzichten veranderen.", - "Results": [ - { - "Text": "95 jarige leeftijd", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Year" - }, - "Start": 7, - "End": 24 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "De Chinese Muur is meer dan 500 jaar oud en is langer dan 5000 mijl.", - "Results": [ - { - "Text": "500 jaar oud", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Year" - }, - "Start": 28, - "End": 39 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Zij is 60 jaar oud; zij is geboren op 8 mei 1945.", - "Results": [ - { - "Text": "60 jaar oud", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 7, - "End": 17 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "25% van de gevallen zijn niet gediagnostiseerd tot een leeftijd van 3 jaar.", - "Results": [ - { - "Text": "3 jaar", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Year" - }, - "Start": 68, - "End": 73 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Wanneer komt er druk om een afspraak van één jaar na te komen?", - "Results": [ - { - "Text": "één jaar", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Year" - }, - "Start": 41, - "End": 48 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Het gebeurde toen de baby pas tien maanden was.", - "Results": [ - { - "Text": "tien maanden", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 30, - "End": 41 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Het bestuursvoorstel is 8 maanden.", - "Results": [ - { - "Text": "8 maanden", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Month" - }, - "Start": 24, - "End": 32 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Ongeveer 50% van de gevallen worden gediagnostiseerd wanneer ze achttien maanden oud zijn.", - "Results": [ - { - "Text": "achttien maanden oud", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Month" - }, - "Start": 64, - "End": 83 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Het is mogelijk, maar in 2006 was 95% jonger dan drie maanden.", - "Results": [ - { - "Text": "drie maanden", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Month" - }, - "Start": 49, - "End": 60 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Als we doorgaan in december, is het project 3 weken oud.", - "Results": [ - { - "Text": "3 weken oud", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 44, - "End": 54 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Op 6-jarige leeftijd kun je al Kerst vieren.", - "Results": [ - { - "Text": "6-jarige leeftijd", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Year" - }, - "Start": 3, - "End": 19 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Een energie factuur van 90 dagen is erg oud", - "Results": [ - { - "Text": "90 dagen", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 24, - "End": 31 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "Hij is tussen de 40 en 50 jaar.", - "Results": [ - { - "Text": "50 jaar", - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "50" - }, - "Start": 23, - "End": 29 - } - ], - "NotSupportedByDesign": "javascript, java" - }, - { - "Input": "De vrouw die Kavanaugh beschuldigt, Christine Blasey Ford, hield bij de hoorzitting vol dat zij er '100 procent zeker' van is dat zij op 15-jarige leeftijd is overrompeld en aangerand door een destijds 17-jarige Kavanaugh.", - "Results": [ - { - "Text": "15-jarige leeftijd", - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "15" - }, - "Start": 137, - "End": 154 - }, - { - "Text": "17-jarige", - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "17" - }, - "Start": 202, - "End": 210 - } - ], - "NotSupportedByDesign": "javascript, java" - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Dutch/CurrencyModel.json b/Specs/NumberWithUnit/Dutch/CurrencyModel.json index a2a6e4840e..3507b0782b 100644 --- a/Specs/NumberWithUnit/Dutch/CurrencyModel.json +++ b/Specs/NumberWithUnit/Dutch/CurrencyModel.json @@ -188,8 +188,8 @@ } } ], - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java" + "NotSupported": "dotnet,python", + "NotSupportedByDesign": "javascript,java" }, { "Input": "Een kwartje is 25 cent.", diff --git a/Specs/NumberWithUnit/Dutch/DimensionModel.json b/Specs/NumberWithUnit/Dutch/DimensionModel.json deleted file mode 100644 index a44b039645..0000000000 --- a/Specs/NumberWithUnit/Dutch/DimensionModel.json +++ /dev/null @@ -1,1193 +0,0 @@ -[ - { - "Input": "75ml", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Milliliter", - "subtype": "Volume" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Het grootste nadeel is de dikte van 3 inch, groot genoeg voor een consultant om het beschrijven als plomp.", - "Results": [ - { - "Text": "3 inch", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Inch", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "een tornado woekerde door een gebied van tien kilometer lang, waardoor ten minste veertien mensen om het leven zijn gekomen en tientallen huizen verwoest zijn.", - "Results": [ - { - "Text": "tien kilometer", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Kilometer", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Er is meer dan 10 1/2 kilometer kabel en snoer nodig om het allemaal aan te sluiten, en 23 computers.", - "Results": [ - { - "Text": "10 1/2 kilometer", - "TypeName": "dimension", - "Resolution": { - "value": "10,5", - "unit": "Kilometer", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "de reis van 6 kilometer naar mijn vliegveld hotel dat eerder op de dag 20 minuten duurde, duurde nu meer dan drie uur.", - "Results": [ - { - "Text": "6 kilometer", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Kilometer", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " In de gehele industrie daalde de olieproductie in dit land met 500.000 vaten per dag in de eerste acht maanden van dit jaar. ", - "Results": [ - { - "Text": "500.000 vaten", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Barrel", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " het is wat 1) verklaart waarom we zijn als, nou ja, onszelf in plaats van bo jackson; 2) waarschuwt dat het mogelijk is om te verdrinken in een meer dat gemiddeld twee voet diep is; en 3) voorspelt dat 10.000 apen die vóór 10.000 worden geplaatst, 1, 118 publiceerbare rock 'n' roll-tunes produceren.", - "Results": [ - { - "Text": "twee voet", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Foot", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " op 19 mei begon de fda met het vasthouden van Chinese paddestoelen in 68 ons blikken nadat meer dan 100 mensen in Mississippi, New York en Pennsylvania ziek werden door het eten van bedorven champignons.", - "Results": [ - { - "Text": "68 ons", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Ounce", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " Dhr. Hulings gnoof dat hij al zijn aandelen verkocht een week voor de markt 190 punten kelderde op 13 oktober, en hij gebruikt het geld om een 45 hectare groot paardenbedrijf te kopen.", - "Results": [ - { - "Text": "45 hectare", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Hectare", - "subtype": "Area" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "dan, om van deze tuintjes vrij letterlijk kamers te maken, had mvr. Bartlett raamloze wanden (baksteen, traliewerk, haag) van acht tot tien voet hoog gemaakt, waardoor haar interieurs in dag-lange stygische schaduwen worden geworpen", - "Results": [ - { - "Text": "tien voet", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Foot", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "'management wil geen verrassingen', merkt jack zaves op, die als brandstofservicedirecteur bij American Airlines jaarlijks ongeveer 2,4 miljard liter vliegtuigbrandstof koopt.", - "Results": [ - { - "Text": "2,4 miljard liter", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Liter", - "subtype": "Volume" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " een 10-liter waterkoeler was op de vloer gevallen en bedrenkte de rode vloerbedekking. ", - "Results": [ - { - "Text": "10-liter", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Liter", - "subtype": "Volume" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " in de buurt, dartelen zes dolfijnen in een zeewateraquarium van 1,5 miljoen liter. ", - "Results": [ - { - "Text": "1,5 miljoen liter", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Liter", - "subtype": "Volume" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " en deze baby is meer dan twee pond.", - "Results": [ - { - "Text": "twee pond", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Pound", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "ik vertrouw mensen die niet eten, niet, zei ms. Volokh, hoewel ze zelf een paar jaar geleden stopte met het eten van lunch om 25 pond te laten vallen. ", - "Results": [ - { - "Text": "25 pond", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Pound", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " Shell, een dochteronderneming van Royal Dutch / Shell Group, mag 0,9 biljoen kubieke voet exporteren, en Golf, een afdeling van Olympia & York Developments ltd. zal worden toegestaan om te exporteren ", - "Results": [ - { - "Text": "0,9 biljoen kubieke voet", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "unit": "Cubic foot", - "subtype": "Volume" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " Het zwembad heeft een inhoud van 2500 kuub", - "Results": [ - { - "Text": "2500 kuub", - "TypeName": "dimension", - "Resolution": { - "value": "2500", - "unit": "Cubic meter", - "subtype": "Volume" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " De belangrijkste elementen van de wetgeving, zoals die momenteel worden weergegeven, zijn: - een beperking van de hoeveelheid onroerend goed die een gezin kan bezitten, tot 660 vierkante meter in de zes grootste steden van de natie, maar meer in kleinere steden en plattelandsgebieden.", - "Results": [ - { - "Text": "660 vierkante meter", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Square meter", - "subtype": "Area" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " Tigrische legers zijn nu 200 mijl ten noorden van Addis Ababa en bedreigen de stad Dese, die de heer Mengistu 's hoofdstad zou afsnijden van de haven van Assab, via welke alle brandstof en andere benodigdheden Addis Ababa bereiken.", - "Results": [ - { - "Text": "200 mijl", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Mile", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " hij zei dat een van de computers drie meter over de vloer gleed. ", - "Results": [ - { - "Text": "drie meter", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Meter", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " de kern van het bezit is 190.000 vierkante meter ongelooflijk duur vastgoed in de wijk Marunouchi, het zakelijke en financiële centrum van Tokio, vaak gekscherend 'Mitsubishi-dorp' genoemd. ''", - "Results": [ - { - "Text": "190.000 vierkante meter", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Square meter", - "subtype": "Area" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " de satelliet, gebouwd door hughes voor de internationale telecommunicatiesatellietorganisatie, maakt deel uit van een contract van 700 miljoen dollar dat in 1982 aan Hughes werd toegekend om vijf satellieten van drie ton te ontwikkelen.", - "Results": [ - { - "Text": "drie ton", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Ton", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " in een rapport uit 1996 over biologische wapens, waarschuwde het centrum voor strategische en internationale studies, een onderzoeksinstelling voor overheidsbeleid in Washington, dat het voor potentiële terroristen gemakkelijk was om biologische wapens te verzamelen _ met behulp van commerciële apparatuur met een capaciteit van 130 liter. ", - "Results": [ - { - "Text": "130 liter", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Liter", - "subtype": "Volume" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " uit de gegevens van de handelsgroep over de gegevens van de handelsafdeling bleek dat de invoer in augustus, het op een na grootste maandelijkse totaal van het jaar, met 5% steeg ten opzichte van 1.458.000 ton in juli, maar onder het niveau van vorig jaar in juni 1988.", - "Results": [ - { - "Text": "1.458.000 ton", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Ton", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " bij nummer 1, sloeg Singh een 9-ijzeren naderingsschot tot op zes voet van de beker.", - "Results": [ - { - "Text": "zes voet", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Foot", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " dus wanneer het psylliumgewas van volgend jaar in maart wordt geoogst, kan het kleiner zijn dan de 16.000 ton van de afgelopen paar jaar - precies op de top van de psylliumboom.", - "Results": [ - { - "Text": "16.000 ton", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Ton", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " de 486 is de afstammeling van een lange reeks intel-chips die de markt begon te domineren sinds IBM de 16-bit 8088-chip koos voor zijn eerste personal computer. ", - "Results": [ - { - "Text": "16-bit", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "Bit", - "subtype": "Information" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " de `` jiotto caspita '' kan op meer dan 188 mijl per uur rennen, aldus een woordvoerder van het bedrijf.", - "Results": [ - { - "Text": "188 mijl per uur", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Mile per hour", - "subtype": "Speed" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "de marine heeft een helikopterlandingszone opgezet op slechts 100 meter van een mobiele operatiekamer, net aan de rand van Bagdad.", - "Results": [ - { - "Text": "100 meter", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Meter", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " Caltran is van plan om een tweede dek toe te voegen voor bussen en carpools boven de mediaan van een 2,5 mijl lang stuk van de havenfiet net ten zuiden van Los Angeles, in de buurt van het gedenkteken Coliseum. ", - "Results": [ - { - "Text": "2,5 mijl", - "TypeName": "dimension", - "Resolution": { - "value": "2,5", - "unit": "Mile", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " op mijn rit van vier mijl naar het hoofdkwartier van de boerderij elke ochtend, rijd ik langs nog vier lege huizen.", - "Results": [ - { - "Text": "vier mijl", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Mile", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " we zijn beledigd, zei Langa van het Grieks-katholieke hoofdkwartier, zo'n 325 kilometer ten noordwesten van Boekarest. ", - "Results": [ - { - "Text": "325 kilometer", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilometer", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Rotich is een kleine (5 voet", - "Results": [ - { - "Text": "5 voet", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Foot", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "4 inch) 28 - jarige die pas drie jaar geleden serieus begon te rennen en tot deze maand niet binnen competitie had gedaan. ", - "Results": [ - { - "Text": "4 inch", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Inch", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " racebaan park (minnesota) in shakopee is een verharde ovaal van 1/4 mijl. ", - "Results": [ - { - "Text": "1/4 mijl", - "TypeName": "dimension", - "Resolution": { - "value": "0,25", - "unit": "Mile", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " Castlecrag Mountain ligt ten zuiden van Moat Lake, 1,6 km ten westen van Mount Frink langs dezelfde rand lijn.", - "Results": [ - { - "Text": "1,6 km", - "TypeName": "dimension", - "Resolution": { - "value": "1,6", - "unit": "Kilometer", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " de javadi-heuvels liggen op ongeveer 17 km van Ambur.", - "Results": [ - { - "Text": "17 km", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Kilometer", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " Na meer dan twee uur rond het meer in Michigan in de buurt van de expositie te hebben gevlogen, heeft commandant hugo eckener het 776-voet luchtschip geland op de nabijgelegen curtiss-wright luchthaven in glenview. ", - "Results": [ - { - "Text": "776-voet", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Foot", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "het knooppunt met snelweg 35 en snelweg 115 naar Lindsay en Peterborough (afrit 436) ligt 500 meter ten oosten van Bennett Road. ", - "Results": [ - { - "Text": "500 meter", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Meter", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " in 1995 introduceerde Canon de eerste commercieel verkrijgbare SLR-lens met interne beeldstabilisatie, bijv. 75 - 300 mm f / 4 - 5. 6 is usm. ", - "Results": [ - { - "Text": "300 mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Millimeter", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " Sterling Armaments uit Dagenham, Essex produceerde een conversiekit bestaande uit een nieuwe 7,62 mm vat, magazijn, afzuigkap en uitwerper voor commerciële verkoop. ", - "Results": [ - { - "Text": "7,62 mm", - "TypeName": "dimension", - "Resolution": { - "value": "7,62", - "unit": "Millimeter", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " het project kost $46.8 miljoen, en is bedoeld om de productiecapaciteit van het bedrijf met 25% te verhogen tot 34.500 metrische ton koperkathodes per jaar. ", - "Results": [ - { - "Text": "34.500 metrische ton", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Metric ton", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " de productie van canadese staal - ingots bedroeg 291.890 ton in de week eindigend op 7 oktober, 14. 8% meer dan het totaal van de vorige week, zei een Federaal agentschap. ", - "Results": [ - { - "Text": "291.890 ton", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Ton", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "De floridapanters hebben leefgebieden tussen de 190 km2.", - "Results": [ - { - "Text": "190 km2", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Square kilometer", - "subtype": "Area" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " een metrische ton is gelijk aan 2.204,62 pond. ", - "Results": [ - { - "Text": "een metrische ton", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Metric ton", - "subtype": "Weight" - } - }, - { - "Text": "2.204,62 pond", - "TypeName": "dimension", - "Resolution": { - "value": "2204,62", - "unit": "Pound", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Ik ben een man", - "Results": [], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Ik heb grote voeten", - "Results": [], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Ik leef op grote voet", - "Results": [], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Mijn internetverbindig is 500 Mb per seconde ", - "Results": [ - { - "Text": "500 mb", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Megabit", - "subtype": "Information" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Dit bestand is wel driehonderd MB groot!", - "Results": [ - { - "Text": "driehonderd mb", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Megabyte", - "subtype": "Information" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Dit bestand is maar tweehonderd kB groot!", - "Results": [ - { - "Text": "tweehonderd kb", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Kilobyte", - "subtype": "Information" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Dit bestand is maar tweehonderd KB groot!", - "Comment": "KB is also supported as it is a very common mistake seen in data we mined.", - "Results": [ - { - "Text": "tweehonderd kb", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Kilobyte", - "subtype": "Information" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Dit bestand is maar acht mb groot!", - "Comment": "mb is also supported as it is a very common mistake seen in data we mined.", - "Results": [ - { - "Text": "acht mb", - "TypeName": "dimension", - "Resolution": { - "value": "8", - "unit": "Megabit", - "subtype": "Information" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Ik heb een nieuwe hardeschijf gekocht van 2 terabyte", - "Results": [ - { - "Text": "2 terabyte", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Terabyte", - "subtype": "Information" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Ben je gek? Ik ga niet fietsen als het meer dan 10 km is...", - "Results": [ - { - "Text": "10 km", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Kilometer", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "De grootte van een voetbalveld varieert dus van 6400 vierkante meter tot 7140 m² en is gemiddeld 6770 m^2.", - "Results": [ - { - "Text": "6400 vierkante meter", - "TypeName": "dimension", - "Resolution": { - "unit": "Square meter", - "value": "6400", - "subtype": "Area" - } - }, - { - "Text": "7140 m²", - "TypeName": "dimension", - "Resolution": { - "unit": "Square meter", - "value": "7140", - "subtype": "Area" - } - }, - { - "Text": "6770 m^2", - "TypeName": "dimension", - "Resolution": { - "unit": "Square meter", - "value": "6770", - "subtype": "Area" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Deze planeet staat twintig lichtjaar van ons vandaan", - "Results": [ - { - "Text": "twintig lichtjaar", - "TypeName": "dimension", - "Resolution": { - "value": "20", - "unit": "Light year", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Ik heb alweer een boete voor mijn snelheid, ik reed tachtig km/u waar je 30 kilometer per uur mag.", - "Results": [ - { - "Text": "tachtig km/u", - "TypeName": "dimension", - "Resolution": { - "value": "80", - "unit": "Kilometer per hour", - "subtype": "Speed" - } - }, - { - "Text": "30 kilometer per uur", - "TypeName": "dimension", - "Resolution": { - "value": "30", - "unit": "Kilometer per hour", - "subtype": "Speed" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Meter per seconde is een afgeleide SI-eenheid voor snelheid. Het symbool is m/s. Een snelheid van 1 m/s komt overeen met het afleggen van 1 meter in 1 seconde.", - "Results": [ - { - "Text": "1 m/s", - "TypeName": "dimension", - "Resolution": { - "unit": "Meter per second", - "value": "1", - "subtype": "Speed" - } - }, - { - "Text": "1 meter", - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "value": "1", - "subtype": "Length" - } - }, - { - "Text": "meter per seconde", - "TypeName": "dimension", - "Resolution": { - "unit": "Meter per second", - "value": null, - "subtype": "Speed" - } - }, - { - "Text": "m/s", - "TypeName": "dimension", - "Resolution": { - "unit": "Meter per second", - "value": null, - "subtype": "Speed" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "1 theelepel is tussen de 3 en 15 gram.", - "Results": [ - { - "Text": "1 theelepel", - "TypeName": "dimension", - "Resolution": { - "unit": "Teaspoon", - "value": "1", - "subtype": "Volume" - } - }, - { - "Text": "15 gram", - "TypeName": "dimension", - "Resolution": { - "unit": "Gram", - "value": "15", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": " 1 eetlepel is tussen de 8 en 30 gram", - "Results": [ - { - "Text": "1 eetlepel", - "TypeName": "dimension", - "Resolution": { - "unit": "Tablespoon", - "value": "1", - "subtype": "Volume" - } - }, - { - "Text": "30 gram", - "TypeName": "dimension", - "Resolution": { - "unit": "Gram", - "value": "30", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Een ha is gelijk aan tienduizend m²", - "Results": [ - { - "Text": "een ha", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Hectare", - "subtype": "Area" - } - }, - { - "Text": "tienduizend m²", - "TypeName": "dimension", - "Resolution": { - "value": "10000", - "unit": "Square meter", - "subtype": "Area" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Een are is gelijk aan honderd m2", - "Results": [ - { - "Text": "een are", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Acre", - "subtype": "Area" - } - }, - { - "Text": "honderd m2", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Square meter", - "subtype": "Area" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Een verouderde benaming is voor nanometer is millimicron.", - "Results": [ - { - "Text": "nanometer", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Nanometer", - "subtype": "Length" - } - }, - { - "Text": "millimicron", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Nanometer", - "subtype": "Length" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Een studentenkamer kost in Amsterdam gemiddeld bijna 31 euro per vierkante meter.", - "Results": [ - { - "Text": "vierkante meter", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Square meter", - "subtype": "Area" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Zeer geregeld krijg ik mails van mensen die iets zeggen als: 'Hoi, ik ben Karin en ik ben 1,65m en 70 kilo, heb ik dan een gezond gewicht?'", - "Results": [ - { - "Text": "1,65m", - "TypeName": "dimension", - "Resolution": { - "value": "1,65", - "unit": "Meter", - "subtype": "Length" - } - }, - { - "Text": "70 kilo", - "TypeName": "dimension", - "Resolution": { - "value": "70", - "unit": "Kilogram", - "subtype": "Weight" - } - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "90 graden draaien", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "90 graden", - "Start": 0, - "End": 8, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "90" - } - } - ] - }, - { - "Input": "draai links 45 graden", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "45 graden", - "Start": 12, - "End": 20, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "45" - } - } - ] - }, - { - "Input": "De hoek is 0,8rad", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "0,8rad", - "Start": 11, - "End": 16, - "TypeName": "dimension", - "Resolution": { - "unit": "Radian", - "subtype": "Angle", - "value": "0,8" - } - } - ] - }, - { - "Input": "maak een halve draai", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "een halve draai", - "Start": 5, - "End": 19, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "0,5" - } - } - ] - }, - { - "Input": "roteer 3 slagen", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "3 slagen", - "Start": 7, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "3" - } - } - ] - }, - { - "Input": "de temperatuur is 24 graden", - "NotSupported": "java, python, javascript", - "Results": [] - }, - { - "Input": "Water kookt bij 100° Celsius", - "NotSupported": "java, python, javascript", - "Results": [] - }, - { - "Input": "max. capaciteit is 100t", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "100t", - "Start": 19, - "End": 22, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Ton", - "value": "100" - } - } - ] - } -] diff --git a/Specs/NumberWithUnit/Dutch/TemperatureModel.json b/Specs/NumberWithUnit/Dutch/TemperatureModel.json deleted file mode 100644 index 187ffd261c..0000000000 --- a/Specs/NumberWithUnit/Dutch/TemperatureModel.json +++ /dev/null @@ -1,634 +0,0 @@ -[ - { - "Input": "de temperatuur buiten is 40 graden Celsius", - "Results": [ - { - "Text": "40 graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 25, - "End": 41 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "het is 90 Fahrenheit in Texas", - "Results": [ - { - "Text": "90 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 7, - "End": 19 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "-5 graden Fahrenheit", - "Results": [ - { - "Text": "-5 graden fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 19 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "6 gr. C", - "Results": [ - { - "Text": "6 gr. c", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 6 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "98,6 graden F is de normale temperatuur", - "Results": [ - { - "Text": "98,6 graden f", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 0, - "End": 12 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Zet de temperatuur op 30 graden Celsius", - "Results": [ - { - "Text": "30 graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 22, - "End": 38 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "normale temperatuur is 98,6 graden Fahrenheit", - "Results": [ - { - "Text": "98,6 graden fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 23, - "End": 44 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "100 graden F", - "Results": [ - { - "Text": "100 graden f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 11 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "20 graden C", - "Results": [ - { - "Text": "20 graden c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 10 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "100,2 graden Fahrenheit is laag", - "Results": [ - { - "Text": "100,2 graden fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "100,2", - "unit": "F" - }, - "Start": 0, - "End": 22 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "10,5 Celsius", - "Results": [ - { - "Text": "10,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10,5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "20 graden Celsius", - "Results": [ - { - "Text": "20 graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 16 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "20,3 Celsius", - "Results": [ - { - "Text": "20,3 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20,3", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "34,5 Celsius", - "Results": [ - { - "Text": "34,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "34,5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "de temperatuur buiten is 30 graden", - "Results": [ - { - "Text": "30 graden", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "Degree" - }, - "Start": 25, - "End": 33 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "zet de thermostaat op 85°", - "Results": [ - { - "Text": "85°", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 22, - "End": 24 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "verhoog de temperatuur met 5 graden", - "Results": [ - { - "Text": "5 graden", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 27, - "End": 34 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "zet de temperatuur op 70 graden F", - "Results": [ - { - "Text": "70 graden f", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 22, - "End": 32 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "verhoog de temperatuur met 20 graden", - "Results": [ - { - "Text": "20 graden", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degree" - }, - "Start": 27, - "End": 35 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "zet de temperatuur op 100 graden", - "Results": [ - { - "Text": "100 graden", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 22, - "End": 31 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "hou de temperatuur op 75 graden F", - "Results": [ - { - "Text": "75 graden f", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 22, - "End": 32 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "laat de temperatuur 40 Celsius zijn", - "Results": [ - { - "Text": "40 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 20, - "End": 29 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "laat de temperatuur 50 graden zijn", - "Results": [ - { - "Text": "50 graden", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degree" - }, - "Start": 20, - "End": 28 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "converteer 10 graden Celsius to Fahrenheit", - "Results": [ - { - "Text": "10 graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 11, - "End": 27 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 32, - "End": 41 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "34,9 graden Celsius naar Fahrenheit", - "Results": [ - { - "Text": "34,9 graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": "34,9", - "unit": "C" - }, - "Start": 0, - "End": 18 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 25, - "End": 34 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "converteer 200 graden Celsius naar Fahrenheit", - "Results": [ - { - "Text": "200 graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 11, - "End": 28 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 35, - "End": 44 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "Fahrenheit naar Celsius: 101 Fahrenheit is hoeveel graden Celsius", - "Results": [ - { - "Text": "101 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - }, - "Start": 25, - "End": 38 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 9 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 16, - "End": 22 - }, - { - "Text": "graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 51, - "End": 64 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "50 graden Celsius naar Fahrenheit", - "Results": [ - { - "Text": "50 graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - }, - "Start": 0, - "End": 16 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 23, - "End": 32 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "zou je 51 Fahrenheit naar graden Celsius kunnen converteren?", - "Results": [ - { - "Text": "51 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 7, - "End": 19 - }, - { - "Text": "graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 26, - "End": 39 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "converteer 106 graden Fahrenheit naar graden Celsius", - "Results": [ - { - "Text": "106 graden fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 11, - "End": 31 - }, - { - "Text": "graden celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 38, - "End": 51 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "converteer 45 graden Fahrenheit naar Celsius", - "Results": [ - { - "Text": "45 graden fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "F" - }, - "Start": 11, - "End": 30 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 37, - "End": 43 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "hoe converteer je - 20 graden Fahrenheit naar Celsius", - "Results": [ - { - "Text": "- 20 graden fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 18, - "End": 39 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 46, - "End": 52 - } - ], - "NotSupportedByDesign": "javascript,java" - }, - { - "Input": "draai een hoek van 45 graden", - "NotSupported": "java, python, javascript", - "Results": [] - }, - { - "Input": "Draai 90°", - "NotSupported": "java, python, javascript", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/English/AgeModel.json b/Specs/NumberWithUnit/English/AgeModel.json deleted file mode 100644 index 8b6f3b2356..0000000000 --- a/Specs/NumberWithUnit/English/AgeModel.json +++ /dev/null @@ -1,279 +0,0 @@ -[ - { - "Input": "When she was five years old, she learned to ride a bike.", - "Results": [ - { - "Text": "five years old", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 13, - "End": 26 - } - ] - }, - { - "Input": "This saga is ten years old.", - "Results": [ - { - "Text": "ten years old", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Year" - }, - "Start": 13, - "End": 25 - } - ] - }, - { - "Input": "I'm only 29 years old!", - "Results": [ - { - "Text": "29 years old", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 9, - "End": 20 - } - ] - }, - { - "Input": "Now, after ninety five years of age, perspectives change.", - "Results": [ - { - "Text": "ninety five years of age", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Year" - }, - "Start": 11, - "End": 34 - } - ] - }, - { - "Input": "The Great Wall of China is more than 500 years old and extends for more than 5,000 miles.", - "Results": [ - { - "Text": "500 years old", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Year" - }, - "Start": 37, - "End": 49 - } - ] - }, - { - "Input": "She's 60 years old; she was born in May 8, 1945.", - "Results": [ - { - "Text": "60 years old", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 6, - "End": 17 - } - ] - }, - { - "Input": "25% of cases are not diagnosed until around 3 years of age.", - "Results": [ - { - "Text": "3 years of age", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Year" - }, - "Start": 44, - "End": 57 - } - ] - }, - { - "Input": "When will there be pressure to fulfil a promise that is one year old?", - "Results": [ - { - "Text": "one year old", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Year" - }, - "Start": 56, - "End": 67 - } - ] - }, - { - "Input": "It happened when the baby was only ten months old.", - "Results": [ - { - "Text": "ten months old", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 35, - "End": 48 - } - ] - }, - { - "Input": "The committee proposal is 8 months old.", - "Results": [ - { - "Text": "8 months old", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Month" - }, - "Start": 26, - "End": 37 - } - ] - }, - { - "Input": "Aproximately 50% of cases are diagnosed at around eighteen months of age.", - "Results": [ - { - "Text": "eighteen months of age", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Month" - }, - "Start": 50, - "End": 71 - } - ] - }, - { - "Input": "It is possible, but in 2006 95% of them were younger than three months old.", - "Results": [ - { - "Text": "three months old", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Month" - }, - "Start": 58, - "End": 73 - } - ] - }, - { - "Input": "If we go ahead in December, it will be three weeks old.", - "Results": [ - { - "Text": "three weeks old", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 39, - "End": 53 - } - ] - }, - { - "Input": "At 6 weeks of age, one can already celebrate Christmas.", - "Results": [ - { - "Text": "6 weeks of age", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Week" - }, - "Start": 3, - "End": 16 - } - ] - }, - { - "Input": "A 90 day old utilities bill is quite late.", - "Results": [ - { - "Text": "90 day old", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 2, - "End": 11 - } - ] - }, - { - "Input": "He is about 40 - 50 years old.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "50 years old", - "Start": 17, - "End": 28, - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "50" - } - } - ] - }, - { - "Input": "The patient is a 87 yo man with history of hypertension, GERD, and chronic phase CML.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "87 yo", - "Start": 17, - "End": 21, - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "87" - } - } - ] - }, - { - "Input": "Yo dude!", - "NotSupported": "javascript, java", - "Results": [] - }, - { - "Input": "The patient is a man of age 87 with history of hypertension, GERD, and chronic phase CML.", - "Results": [ - { - "Text": "age 87", - "Start": 24, - "End": 29, - "TypeName": "age", - "Resolution": { - "unit": "Age", - "value": "87" - } - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/English/CurrencyModel.json b/Specs/NumberWithUnit/English/CurrencyModel.json index aba9f3a7e0..9a216228bb 100644 --- a/Specs/NumberWithUnit/English/CurrencyModel.json +++ b/Specs/NumberWithUnit/English/CurrencyModel.json @@ -1953,7 +1953,7 @@ }, { "Input": "10 $ is not much, nor is 10 €", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "10 $", @@ -1980,7 +1980,7 @@ }, { "Input": "Banknotes: 5 €, 10 €, 20 €, 50 €, 100 €, 200 €, 500 €.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "5 €", @@ -2132,7 +2132,7 @@ }, { "Input": "10 $ 30 cent", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "10 $ 30 cent", @@ -2270,7 +2270,7 @@ }, { "Input": "I would like to buy this item for USD 200.", - "NotSupported": "python, java, javascript", + "NotSupported": "java, javascript", "Results": [ { "Text": "usd 200", @@ -2287,7 +2287,7 @@ }, { "Input": "I would like to buy this item for EUR 125.", - "NotSupported": "python, java, javascript", + "NotSupported": "java, javascript", "Results": [ { "Text": "eur 125", @@ -2304,7 +2304,7 @@ }, { "Input": "I would like to buy this item for GBP 350.", - "NotSupported": "python, java, javascript", + "NotSupported": "java, javascript", "Results": [ { "Text": "gbp 350", @@ -2321,7 +2321,7 @@ }, { "Input": "It costs half million usd.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "half million usd", @@ -2338,7 +2338,7 @@ }, { "Input": "It costs quarter million us dollars.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "quarter million us dollars", @@ -2355,7 +2355,7 @@ }, { "Input": "It costs a quarter million us dollars.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "a quarter million us dollars", @@ -2372,7 +2372,7 @@ }, { "Input": "It costs three quarters billion us dollars.", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "three quarters billion us dollars", @@ -2389,7 +2389,7 @@ }, { "Input": "Supply limit: ₿21,000,000", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "₿21,000,000", @@ -2405,7 +2405,7 @@ }, { "Input": "He has lost a laptop containing 10000 bitcoins", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "10000 bitcoins", @@ -2421,7 +2421,7 @@ }, { "Input": "each block mined is now 6.25 BTC", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "6.25 btc", @@ -2437,7 +2437,7 @@ }, { "Input": "2 satoshis one day will be worth something", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "2 satoshis", @@ -2453,7 +2453,7 @@ }, { "Input": "it costs only 15 dollars and 15.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "15 dollars and 15", @@ -2469,7 +2469,7 @@ }, { "Input": "it costs only 15 dollars 50.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "15 dollars 50", @@ -2485,7 +2485,7 @@ }, { "Input": "usd$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "usd$ 15", @@ -2502,7 +2502,7 @@ }, { "Input": "mxn$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "mxn$ 15", @@ -2519,7 +2519,7 @@ }, { "Input": "aud$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "aud$ 15", @@ -2536,7 +2536,7 @@ }, { "Input": "cad$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "cad$ 15", @@ -2553,7 +2553,7 @@ }, { "Input": "nzd$15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "nzd$15", @@ -2585,6 +2585,84 @@ } ] }, + { + "Input": "A total of BBD 40 million was charged", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "bbd 40 million", + "TypeName": "currency", + "Resolution": { + "value": "40000000", + "unit": "Barbadian dollar", + "isoCurrency": "BBD" + }, + "Start": 11, + "End": 24 + } + ] + }, + { + "Input": "Could you give me a loan of 4 xbt?", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "4 xbt", + "TypeName": "currency", + "Resolution": { + "value": "4", + "unit": "Bitcoin" + }, + "Start": 28, + "End": 32 + } + ] + }, + { + "Input": "I can donate RMB 5600", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "rmb 5600", + "TypeName": "currency", + "Resolution": { + "value": "5600", + "unit": "Chinese yuan", + "isoCurrency": "CNY" + }, + "Start": 13, + "End": 20 + } + ] + }, + { + "Input": "A sum of GBP 300 was received and EUR 250 was spent", + "NotSupported": "dotnet, javascript, java", + "Results": [ + { + "Text": "gbp 300", + "TypeName": "currency", + "Resolution": { + "value": "300", + "unit": "British pound", + "isoCurrency": "GBP" + }, + "Start": 9, + "End": 15 + }, + { + "Text": "eur 250", + "TypeName": "currency", + "Resolution": { + "value": "250", + "unit": "Euro", + "isoCurrency": "EUR" + }, + "Start": 34, + "End": 40 + } + ] + }, { "Input": "USD115.5", "NotSupported": "javascript, python, java", @@ -2604,7 +2682,7 @@ }, { "Input": "115USD", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "115usd", @@ -2621,7 +2699,7 @@ }, { "Input": "115.5USD", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "115.5usd", @@ -2699,7 +2777,7 @@ }, { "Input": "The price starts at USD 22.5 million.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "usd 22.5 million", @@ -2716,7 +2794,7 @@ }, { "Input": "It costs 15 dollars 50.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "15 dollars 50", @@ -2732,7 +2810,7 @@ }, { "Input": "It costs 15 dollars and 50.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "15 dollars and 50", @@ -2748,7 +2826,7 @@ }, { "Input": "The subscription will increase to 17 USD 25.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "17 usd 25", @@ -2832,7 +2910,7 @@ }, { "Input": "The cost is 500 USD,100 times more than expected.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "500 usd", @@ -2865,7 +2943,7 @@ }, { "Input": "I counted the dollars thousand of times.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "dollars", @@ -2980,5 +3058,53 @@ } } ] + }, + { + "Input": "The total is 50 pound and 60 pence", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "50 pound and 60 pence", + "TypeName": "currency", + "Resolution": { + "value": "50.6", + "unit": "Pound" + }, + "Start": 13, + "End": 33 + } + ] + }, + { + "Input": "1 pound and 1 penny", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "1 pound and 1 penny", + "TypeName": "currency", + "Resolution": { + "value": "1.01", + "unit": "Pound" + }, + "Start": 0, + "End": 18 + } + ] + }, + { + "Input": "3 pounds and 22p and something else", + "NotSupported": "java, javascript", + "Results": [ + { + "Text": "3 pounds and 22p", + "TypeName": "currency", + "Resolution": { + "value": "3.22", + "unit": "Pound" + }, + "Start": 0, + "End": 15 + } + ] } ] diff --git a/Specs/NumberWithUnit/English/DimensionModel.json b/Specs/NumberWithUnit/English/DimensionModel.json deleted file mode 100644 index 0de69fba8c..0000000000 --- a/Specs/NumberWithUnit/English/DimensionModel.json +++ /dev/null @@ -1,1507 +0,0 @@ -[ - { - "Input": "You weight 200lbs.", - "Results": [ - { - "Text": "200lbs", - "Start": 11, - "End": 16, - "TypeName": "dimension", - "Resolution": { - "unit": "Pound", - "subtype": "Weight", - "value": "200" - } - } - ] - }, - { - "Input": "75ml", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "subtype": "Volume", - "unit": "Milliliter" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "its greatest drawback may be its 3-inch thickness , big enough for one consultant to describe it as clunky.", - "Results": [ - { - "Text": "3-inch", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "subtype": "Length", - "unit": "Inch" - }, - "Start": 33, - "End": 38 - } - ] - }, - { - "Input": "a twister roared through an area about ten miles long there , killing at least fourteen people and turning dozens of homes into rubble.", - "Results": [ - { - "Text": "ten miles", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "subtype": "Length", - "unit": "Mile" - }, - "Start": 39, - "End": 47 - } - ] - }, - { - "Input": "it takes more than 10 1/2 miles of cable and wire to hook it all up , and 23 computers.", - "Results": [ - { - "Text": "10 1/2 miles", - "TypeName": "dimension", - "Resolution": { - "value": "10.5", - "subtype": "Length", - "unit": "Mile" - }, - "Start": 19, - "End": 30 - } - ] - }, - { - "Input": "the six-mile trip to my airport hotel that had taken 20 minutes earlier in the day took more than three hours.", - "Results": [ - { - "Text": "six-mile", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "subtype": "Length", - "unit": "Mile" - }, - "Start": 4, - "End": 11 - } - ] - }, - { - "Input": "industrywide , oil production in this country fell by 500,000 barrels a day to barrels in the first eight months of this year.", - "Results": [ - { - "Text": "500,000 barrels", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "subtype": "Volume", - "unit": "Barrel" - }, - "Start": 54, - "End": 68 - } - ] - }, - { - "Input": "it ' s what 1 ) explains why we are like , well , ourselves rather than bo jackson ; 2 ) cautions that it ' s possible to drown in a lake that averages two feet deep ; and 3 ) predicts that 10 , 000 monkeys placed before 10 , 000 pianos would produce 1 , 118 publishable rock ' n ' roll tunes.", - "Results": [ - { - "Text": "two feet", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "subtype": "Length", - "unit": "Foot" - }, - "Start": 152, - "End": 159 - } - ] - }, - { - "Input": "on may 19 , the fda began detaining chinese mushrooms in 68-ounce cans after more than 100 people in mississippi , new york and pennsylvania became ill from eating tainted mushrooms.", - "Results": [ - { - "Text": "68-ounce", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "subtype": "Weight", - "unit": "Ounce" - }, - "Start": 57, - "End": 64 - } - ] - }, - { - "Input": "mr . hulings gloats that he sold all his stocks a week before the market plummeted 190 points on oct . 13 , and he is using the money to help buy a 45-acre horse farm.", - "Results": [ - { - "Text": "45-acre", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "subtype": "Area", - "unit": "Acre" - }, - "Start": 148, - "End": 154 - } - ] - }, - { - "Input": "then , to make these gardenettes quite literally rooms , ms . bartlett had thrown up windowless walls (brick, lattice, hedge ) eight to 10 feet tall, casting her interiors into day - long stygian shade.", - "Results": [ - { - "Text": "10 feet", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "subtype": "Length", - "unit": "Foot" - }, - "Start": 136, - "End": 142 - } - ] - }, - { - "Input": "` ` management does n ' t want surprises , ' ' notes jack zaves , who , as fuel - services director at american airlines , buys some 2.4 billion gallons of jet fuel a year.", - "Results": [ - { - "Text": "2.4 billion gallons", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "subtype": "Weight", - "unit": "Gallon" - }, - "Start": 133, - "End": 151 - } - ] - }, - { - "Input": "a 10-gallon water cooler had toppled onto the floor , soaking the red carpeting.", - "Results": [ - { - "Text": "10-gallon", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "subtype": "Weight", - "unit": "Gallon" - }, - "Start": 2, - "End": 10 - } - ] - }, - { - "Input": "nearby , six dolphins will frolic in a 1.5 million gallon saltwater aquarium.", - "Results": [ - { - "Text": "1.5 million gallon", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "subtype": "Weight", - "unit": "Gallon" - }, - "Start": 39, - "End": 56 - } - ] - }, - { - "Input": "and this baby is over two pounds.", - "Results": [ - { - "Text": "two pounds", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "subtype": "Weight", - "unit": "Pound" - }, - "Start": 22, - "End": 31 - } - ] - }, - { - "Input": "``i don't trust people who don't eat,'' said ms. volokh, though she herself stopped eating lunch a few years ago to drop 25 pounds.", - "Results": [ - { - "Text": "25 pounds", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "subtype": "Weight", - "unit": "Pound" - }, - "Start": 121, - "End": 129 - } - ] - }, - { - "Input": "shell , a subsidiary of royal dutch / shell group , will be allowed to export 0.9 trillion cubic feet , and gulf , a unit of olympia & york developments ltd. will be allowed to export", - "Results": [ - { - "Text": "0.9 trillion cubic feet", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "subtype": "Volume", - "unit": "Cubic foot" - }, - "Start": 78, - "End": 100 - } - ] - }, - { - "Input": "highlights of the bills , as currently framed , are : - - a restriction on the amount of real estate one family can own , to 660 square meters in the nation ' s six largest cities , but more in smaller cities and rural areas.", - "Results": [ - { - "Text": "660 square meters", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "subtype": "Area", - "unit": "Square meter" - }, - "Start": 125, - "End": 141 - } - ] - }, - { - "Input": "tigrean armies are now 200 miles north of addis ababa , threatening the town of dese , which would cut off mr . mengistu ' s capital from the port of assab , through which all fuel and other supplies reach addis ababa.", - "Results": [ - { - "Text": "200 miles", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "subtype": "Length", - "unit": "Mile" - }, - "Start": 23, - "End": 31 - } - ] - }, - { - "Input": "he said that one of the computers took a three-foot trip sliding across the floor.", - "Results": [ - { - "Text": "three-foot", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "subtype": "Length", - "unit": "Foot" - }, - "Start": 41, - "End": 50 - } - ] - }, - { - "Input": "the core of its holdings is 190,000 square meters of incredibly expensive property in the marunouchi district , the business and financial center of tokyo , often jokingly called ` ` mitsubishi village. ' '", - "Results": [ - { - "Text": "190,000 square meters", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "subtype": "Area", - "unit": "Square meter" - }, - "Start": 28, - "End": 48 - } - ] - }, - { - "Input": "the satellite , built by hughes for the international telecommunications satellite organization , is part of a $ 700 million contract awarded to hughes in 1982 to develop five of the three-ton satellites.", - "Results": [ - { - "Text": "three-ton", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "subtype": "Weight", - "unit": "Ton" - }, - "Start": 183, - "End": 191 - } - ] - }, - { - "Input": "in a 1996 report on biological weapons , the center for strategic and international studies , a public policy research institution in washington , warned that it was easy for would - be terrorists to assemble biological weapons _ using commercial equipment with a capacity of 130 gallons.", - "Results": [ - { - "Text": "130 gallons", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "subtype": "Weight", - "unit": "Gallon" - }, - "Start": 276, - "End": 286 - } - ] - }, - { - "Input": "the trade group ' s compilation of commerce department data showed that august imports , the second largest monthly total of the year , were up 5 % from july ' s 1,458,000 tons but below last year ' s high of in june 1988.", - "Results": [ - { - "Text": "1,458,000 tons", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "subtype": "Weight", - "unit": "Ton" - }, - "Start": 162, - "End": 175 - } - ] - }, - { - "Input": "at no . 1 , singh hit a 9 - iron approach shot to within six feet of the cup.", - "Results": [ - { - "Text": "six feet", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "subtype": "Length", - "unit": "Foot" - }, - "Start": 57, - "End": 64 - } - ] - }, - { - "Input": "so when next year ' s psyllium crop is harvested in march , it may be smaller than the 16,000 metric tons of the past few years - - right at the crest of the psyllium boom.", - "Results": [ - { - "Text": "16,000 metric tons", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "subtype": "Weight", - "unit": "Metric ton" - }, - "Start": 87, - "End": 104 - } - ] - }, - { - "Input": "the 486 is the descendant of a long series of intel chips that began dominating the market ever since ibm picked the 16-bit 8088 chip for its first personal computer.", - "Results": [ - { - "Text": "16-bit", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "subtype": "Information", - "unit": "Bit" - }, - "Start": 117, - "End": 122 - } - ] - }, - { - "Input": "the ` ` jiotto caspita ' ' can run at over 188 miles an hour , a company spokesman said.", - "Results": [ - { - "Text": "188 miles an hour", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "subtype": "Speed", - "unit": "Mile per hour" - }, - "Start": 43, - "End": 59 - } - ] - }, - { - "Input": "the navy has set up a helicopter landing zone just a 100 meters from a mobile operating room , just on the outskirts of baghdad.", - "Results": [ - { - "Text": "100 meters", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "subtype": "Length", - "unit": "Meter" - }, - "Start": 53, - "End": 62 - } - ] - }, - { - "Input": "caltrans plans to add a second deck for buses and car pools above the median of a 2.5-mile stretch of the harbor freeway just south of los angeles , near the memorial coliseum.", - "Results": [ - { - "Text": "2.5-mile", - "TypeName": "dimension", - "Resolution": { - "value": "2.5", - "subtype": "Length", - "unit": "Mile" - }, - "Start": 82, - "End": 89 - } - ] - }, - { - "Input": "on my four-mile drive to farm headquarters each morning , i drive by another four empty houses.", - "Results": [ - { - "Text": "four-mile", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "subtype": "Length", - "unit": "Mile" - }, - "Start": 6, - "End": 14 - } - ] - }, - { - "Input": "we are insulted, said langa from the greek catholic headquarters , some 325 kilometer northwest of bucharest.", - "Results": [ - { - "Text": "325 kilometer", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "subtype": "Length", - "unit": "Kilometer" - }, - "Start": 72, - "End": 84 - } - ] - }, - { - "Input": "rotich is a tiny ( 5 feet", - "Results": [ - { - "Text": "5 feet", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "subtype": "Length", - "unit": "Foot" - }, - "Start": 19, - "End": 24 - } - ] - }, - { - "Input": "4 inches) 28 - year - old who did not start running seriously until three years ago and had not competed indoors until this month.", - "Results": [ - { - "Text": "4 inches", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "subtype": "Length", - "unit": "Inch" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "raceway park ( minnesota ) in shakopee is a 1/4 mile paved oval.", - "Results": [ - { - "Text": "1/4 mile", - "TypeName": "dimension", - "Resolution": { - "value": "0.25", - "subtype": "Length", - "unit": "Mile" - }, - "Start": 44, - "End": 51 - } - ] - }, - { - "Input": "castlecrag mountain is located south of moat lake , 1.6 km west of mount frink along the same ridge line.", - "Results": [ - { - "Text": "1.6 km", - "TypeName": "dimension", - "Resolution": { - "value": "1.6", - "subtype": "Length", - "unit": "Kilometer" - }, - "Start": 52, - "End": 57 - } - ] - }, - { - "Input": "the javadi hills are located about 17 km from ambur.", - "Results": [ - { - "Text": "17 km", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "subtype": "Length", - "unit": "Kilometer" - }, - "Start": 35, - "End": 39 - } - ] - }, - { - "Input": "after circling lake michigan near the exposition for two hours , commander hugo eckener landed the 776-foot airship at the nearby curtiss - wright airport in glenview.", - "Results": [ - { - "Text": "776-foot", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "subtype": "Length", - "unit": "Foot" - }, - "Start": 99, - "End": 106 - } - ] - }, - { - "Input": "the interchange with highway 35 and highway 115 to lindsay and peterborough ( exit 436 ) lies 500 metres east of bennett road.", - "Results": [ - { - "Text": "500 metres", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "subtype": "Length", - "unit": "Meter" - }, - "Start": 94, - "End": 103 - } - ] - }, - { - "Input": "in 1995 canon introduced the first commercially available slr lens with internal image stabilization , ef 75 -300mm f / 4 - 5 . 6 is usm.", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "300mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "subtype": "Length", - "unit": "Millimeter" - }, - "Start": 110, - "End": 114 - } - ] - }, - { - "Input": "sterling armaments of dagenham , essex produced a conversion kit comprising a new 7.62mm barrel , magazine , extractor and ejector for commercial sale.", - "Results": [ - { - "Text": "7.62mm", - "TypeName": "dimension", - "Resolution": { - "value": "7.62", - "subtype": "Length", - "unit": "Millimeter" - }, - "Start": 82, - "End": 87 - } - ] - }, - { - "Input": "the project costs $ 46 . 8 million , and is intended to boost the company ' s production capacity by 25 % to 34,500 metric tons of copper cathode a year.", - "Results": [ - { - "Text": "34,500 metric tons", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "subtype": "Weight", - "unit": "Metric ton" - }, - "Start": 109, - "End": 126 - } - ] - }, - { - "Input": "canadian steel - ingot production totaled 291,890 metric tons in the week ended oct . 7 , up 14 . 8 % from the preceding week ' s total of , statistics canada , a federal agency , said.", - "Results": [ - { - "Text": "291,890 metric tons", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "subtype": "Weight", - "unit": "Metric ton" - }, - "Start": 42, - "End": 60 - } - ] - }, - { - "Input": "florida panthers live in home ranges between 190 km2.", - "Results": [ - { - "Text": "190 km2", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "subtype": "Area", - "unit": "Square kilometer" - }, - "Start": 45, - "End": 51 - } - ] - }, - { - "Input": "a metric ton is equal to 2,204.62 pounds.", - "Results": [ - { - "Text": "2,204.62 pounds", - "TypeName": "dimension", - "Resolution": { - "value": "2204.62", - "subtype": "Weight", - "unit": "Pound" - }, - "Start": 25, - "End": 39 - }, - { - "Text": "metric ton", - "TypeName": "dimension", - "Resolution": { - "value": null, - "subtype": "Weight", - "unit": "Metric ton" - }, - "Start": 2, - "End": 11 - } - ] - }, - { - "Input": "I'm a man.", - "Results": [] - }, - { - "Input": "Send them a quick DM and ask for their email address", - "Results": [] - }, - { - "Input": "1m is equal to 10 dm", - "Results": [ - { - "Text": "1m", - "Start": 0, - "End": 1, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - }, - { - "Text": "10 dm", - "Start": 15, - "End": 19, - "TypeName": "dimension", - "Resolution": { - "unit": "Decimeter", - "subtype": "Length", - "value": "10" - } - } - ] - }, - { - "Input": "He has a pen that is 10 \" long.", - "NotSupported": "java", - "Results": [ - { - "Text": "10 \"", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "subtype": "Length", - "unit": "Inch" - }, - "Start": 21, - "End": 24 - } - ] - }, - { - "Input": "The size of this file is 100 mb", - "Results": [ - { - "Text": "100 mb", - "TypeName": "dimension", - "Resolution": { - "unit": "Megabit", - "subtype": "Information", - "value": "100" - }, - "Start": 25, - "End": 30 - } - ] - }, - { - "Input": "The size of this file is 100 MB", - "Results": [ - { - "Text": "100 mb", - "TypeName": "dimension", - "Resolution": { - "unit": "Megabyte", - "subtype": "Information", - "value": "100" - }, - "Start": 25, - "End": 30 - } - ] - }, - { - "Input": "I'll give you a surprise at 2:00 pm", - "NotSupported": "java", - "Results": [] - }, - { - "Input": "He said: 2 pm is 2 picometer", - "Results": [ - { - "Text": "2 pm", - "Start": 9, - "End": 12, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "subtype": "Length", - "value": "2" - } - }, - { - "Text": "2 picometer", - "Start": 17, - "End": 27, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "subtype": "Length", - "value": "2" - } - } - ] - }, - { - "Input": "that one mile can provide.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "one mile", - "Start": 5, - "End": 12, - "TypeName": "dimension", - "Resolution": { - "unit": "Mile", - "subtype": "Length", - "value": "1" - } - } - ] - }, - { - "Input": "I ' m tired", - "NotSupported": "javascript, java", - "Results": [] - }, - { - "Input": "I'm 1.8m tall.", - "Results": [ - { - "Text": "1.8m", - "Start": 4, - "End": 7, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1.8" - } - } - ] - }, - { - "Input": "It cost 1.8M dollars.", - "Results": [] - }, - { - "Input": "1 m 1 m", - "Results": [ - { - "Text": "1 m", - "Start": 0, - "End": 2, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - }, - { - "Text": "1 m", - "Start": 4, - "End": 6, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - } - ] - }, - { - "Input": "1 m x 1 m", - "Results": [ - { - "Text": "1 m", - "Start": 0, - "End": 2, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - }, - { - "Text": "1 m", - "Start": 6, - "End": 8, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - } - ] - }, - { - "Input": "The submarine mein weigh 25 lakh tonnes", - "Results": [ - { - "Text": "25 lakh tonnes", - "TypeName": "dimension", - "Resolution": { - "value": "2500000", - "subtype": "Weight", - "unit": "Ton" - }, - "Start": 25, - "End": 38 - } - ] - }, - { - "Input": "The length is 12 m 2 dm more or less", - "NotSupported": "javascript, java, python", - "Results": [ - { - "Text": "12 m", - "TypeName": "dimension", - "Resolution": { - "value": "12", - "subtype": "Length", - "unit": "Meter" - }, - "Start": 14, - "End": 17 - }, - { - "Text": "2 dm", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "subtype": "Length", - "unit": "Decimeter" - }, - "Start": 19, - "End": 22 - } - ] - }, - { - "Input": "The length is 12 ft 2 in more or less", - "NotSupported": "javascript, java, python", - "Results": [ - { - "Text": "12 ft", - "TypeName": "dimension", - "Resolution": { - "value": "12", - "subtype": "Length", - "unit": "Foot" - }, - "Start": 14, - "End": 18 - }, - { - "Text": "2 in", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "subtype": "Length", - "unit": "Inch" - }, - "Start": 20, - "End": 23 - } - ] - }, - { - "Input": "3 tablespoons butter, melted, and 1/2 cup olive oil", - "NotSupported": "javascript, java, python", - "Results": [ - { - "Text": "3 tablespoons", - "Start": 0, - "End": 12, - "TypeName": "dimension", - "Resolution": { - "subtype": "Volume", - "unit": "Tablespoon", - "value": "3" - } - }, - { - "Text": "1/2 cup", - "Start": 34, - "End": 40, - "TypeName": "dimension", - "Resolution": { - "subtype": "Volume", - "unit": "Cup", - "value": "0.5" - } - } - ] - }, - { - "Input": "½ teaspoon baking powder", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "½ teaspoon", - "Start": 0, - "End": 9, - "TypeName": "dimension", - "Resolution": { - "subtype": "Volume", - "unit": "Teaspoon", - "value": "0.5" - } - } - ] - }, - { - "Input": "10 Kilometers per hour could also be informally written as 10kph, 10kmph, or 10km/hr", - "Results": [ - { - "Text": "10 kilometers per hour", - "Start": 0, - "End": 21, - "TypeName": "dimension", - "Resolution": { - "subtype": "Speed", - "unit": "Kilometer per hour", - "value": "10" - } - }, - { - "Text": "10kph", - "Start": 59, - "End": 63, - "TypeName": "dimension", - "Resolution": { - "subtype": "Speed", - "unit": "Kilometer per hour", - "value": "10" - } - }, - { - "Text": "10kmph", - "Start": 66, - "End": 71, - "TypeName": "dimension", - "Resolution": { - "subtype": "Speed", - "unit": "Kilometer per hour", - "value": "10" - } - }, - { - "Text": "10km/hr", - "Start": 77, - "End": 83, - "TypeName": "dimension", - "Resolution": { - "subtype": "Speed", - "unit": "Kilometer per hour", - "value": "10" - } - } - ] - }, - { - "Input": "A coin weighing one drachma is known as a stater", - "NotSupported": "javascript, java, python", - "Results": [ - { - "Text": "one drachma", - "Start": 16, - "End": 26, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Dram", - "value": "1" - } - } - ] - }, - { - "Input": "james t. kirk", - "NotSupported": "javascript, java, python", - "Results": [] - }, - { - "Input": "50 meters per millisecond, 50 centimeters/millisecond, and 50 km/ms all use non-standard units.", - "NotSupported": "javascript, java, python", - "Results": [ - { - "Text": "50 meters per millisecond", - "Start": 0, - "End": 24, - "TypeName": "dimension", - "Resolution": { - "subtype": "Speed", - "unit": "Meter per millisecond", - "value": "50" - } - }, - { - "Text": "50 centimeters/millisecond", - "Start": 27, - "End": 52, - "TypeName": "dimension", - "Resolution": { - "subtype": "Speed", - "unit": "Centimeter per millisecond", - "value": "50" - } - }, - { - "Text": "50 km/ms", - "Start": 59, - "End": 66, - "TypeName": "dimension", - "Resolution": { - "subtype": "Speed", - "unit": "Kilometer per millisecond", - "value": "50" - } - } - ] - }, - { - "Input": "The weight is 20 (kg)", - "Results": [ - { - "Text": "20 (kg)", - "Start": 14, - "End": 20, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Kilogram", - "value": "20" - } - } - ] - }, - { - "Input": "The weight is 20 [kg]", - "Results": [ - { - "Text": "20 [kg]", - "Start": 14, - "End": 20, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Kilogram", - "value": "20" - } - } - ] - }, - { - "Input": "The weight is 20 {kg}", - "Results": [ - { - "Text": "20 {kg}", - "Start": 14, - "End": 20, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Kilogram", - "value": "20" - } - } - ] - }, - { - "Input": "The weight is 20 ", - "Results": [ - { - "Text": "20 ", - "Start": 14, - "End": 20, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Kilogram", - "value": "20" - } - } - ] - }, - { - "Input": "The weight is 150 microgram", - "Results": [ - { - "Text": "150 microgram", - "Start": 14, - "End": 26, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Microgram", - "value": "150" - } - } - ] - }, - { - "Input": "The weight is 120 μg", - "Results": [ - { - "Text": "120 μg", - "Start": 14, - "End": 19, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Microgram", - "value": "120" - } - } - ] - }, - { - "Input": "24703L202", - "Results": [] - }, - { - "Input": "24703 L-202", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "24703m212", - "Results": [] - }, - { - "Input": "24703 m212", - "Results": [] - }, - { - "Input": "24703m2", - "Results": [ - { - "Text": "24703m2", - "TypeName": "dimension", - "Resolution": { - "value": "24703", - "subtype": "Area", - "unit": "Square meter" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "scp-173m", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "scp2-173m", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "scp-173 m", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "scp173m", - "Results": [] - }, - { - "Input": "The recommended symbol in the United States and United Kingdom when communicating medical information is mcg", - "Results": [ - { - "Text": "mcg", - "TypeName": "dimension", - "Resolution": { - "value": null, - "subtype": "Weight", - "unit": "Microgram" - }, - "Start": 105, - "End": 107 - } - ] - }, - { - "Input": "Ten samples from the Camarones river valley had an average of 37.8 microgrammes per gramme", - "Results": [ - { - "Text": "37.8 microgrammes", - "TypeName": "dimension", - "Resolution": { - "value": "37.8", - "subtype": "Weight", - "unit": "Microgram" - }, - "Start": 62, - "End": 78 - }, - { - "Text": "gramme", - "TypeName": "dimension", - "Resolution": { - "value": null, - "subtype": "Weight", - "unit": "Gram" - }, - "Start": 84, - "End": 89 - } - ] - }, - { - "Input": "rotate 90 degrees", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "90 degrees", - "Start": 7, - "End": 16, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "90" - } - } - ] - }, - { - "Input": "turn left 45 degrees", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "45 degrees", - "Start": 10, - "End": 19, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "45" - } - } - ] - }, - { - "Input": "The angle is 0.8rad", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "0.8rad", - "Start": 13, - "End": 18, - "TypeName": "dimension", - "Resolution": { - "unit": "Radian", - "subtype": "Angle", - "value": "0.8" - } - } - ] - }, - { - "Input": "make a half turn", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "a half turn", - "Start": 5, - "End": 15, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "0.5" - } - } - ] - }, - { - "Input": "rotate 3 turns", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "3 turns", - "Start": 7, - "End": 13, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "3" - } - } - ] - }, - { - "Input": "the temperature is 24 degrees", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "Water boils at 100° Celsius", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "the Max. capacity is 100t and Max. outreach is 48m", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "100t", - "Start": 21, - "End": 24, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Ton", - "value": "100" - } - }, - { - "Text": "48m", - "Start": 47, - "End": 49, - "TypeName": "dimension", - "Resolution": { - "subtype": "Length", - "unit": "Meter", - "value": "48" - } - } - ] - }, - { - "Input": "Put out the bad news on New Year's Eve, or a Friday at 6pm, too late for the TV news.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "However, takeaway deliveries are permitted only until 11pm under the government restrictions.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "Get together for 2 in april", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "It has also doubled its work force to 50,000 in 2020, becoming South Koreas third-largest private-sector employer.", - "NotSupported": "javascript", - "Results": [] - } -] diff --git a/Specs/NumberWithUnit/English/TemperatureModel.json b/Specs/NumberWithUnit/English/TemperatureModel.json deleted file mode 100644 index 5d32fce896..0000000000 --- a/Specs/NumberWithUnit/English/TemperatureModel.json +++ /dev/null @@ -1,647 +0,0 @@ -[ - { - "Input": "the temperature outside is 40 deg celsius", - "Results": [ - { - "Text": "40 deg celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 27, - "End": 40 - } - ] - }, - { - "Input": "its 90 fahrenheit in texas", - "Results": [ - { - "Text": "90 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 4, - "End": 16 - } - ] - }, - { - "Input": "-5 degree fahrenheit", - "Results": [ - { - "Text": "-5 degree fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "6 deg c", - "Results": [ - { - "Text": "6 deg c", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "98.6 degrees f is normal temperature", - "Results": [ - { - "Text": "98.6 degrees f", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "set the temperature to 30 degrees celsius", - "Results": [ - { - "Text": "30 degrees celsius", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 23, - "End": 40 - } - ] - }, - { - "Input": "normal temperature is 98.6 degrees fahrenheit", - "Results": [ - { - "Text": "98.6 degrees fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 22, - "End": 44 - } - ] - }, - { - "Input": "100 degrees f", - "Results": [ - { - "Text": "100 degrees f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "20 degrees c", - "Results": [ - { - "Text": "20 degrees c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "100.2 degrees farenheit is low", - "Results": [ - { - "Text": "100.2 degrees farenheit", - "TypeName": "temperature", - "Resolution": { - "value": "100.2", - "unit": "F" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "10.5 celcius", - "Results": [ - { - "Text": "10.5 celcius", - "TypeName": "temperature", - "Resolution": { - "value": "10.5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 degrees celsius", - "Results": [ - { - "Text": "20 degrees celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 17 - } - ] - }, - { - "Input": "20.3 celsius", - "Results": [ - { - "Text": "20.3 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20.3", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "34.5 celcius", - "Results": [ - { - "Text": "34.5 celcius", - "TypeName": "temperature", - "Resolution": { - "value": "34.5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "the temperature outside is 98 degrees", - "Results": [ - { - "Text": "98 degrees", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degree" - }, - "Start": 27, - "End": 36 - } - ] - }, - { - "Input": "set the thermostat to 85°", - "Results": [ - { - "Text": "85°", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 22, - "End": 24 - } - ] - }, - { - "Input": "raise the temperature by 5 degrees", - "Results": [ - { - "Text": "5 degrees", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 25, - "End": 33 - } - ] - }, - { - "Input": "set the temperature to 70 degrees f", - "Results": [ - { - "Text": "70 degrees f", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 23, - "End": 34 - } - ] - }, - { - "Input": "raise the temperature by 20 degrees", - "Results": [ - { - "Text": "20 degrees", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degree" - }, - "Start": 25, - "End": 34 - } - ] - }, - { - "Input": "set the temperature to 100 degrees", - "Results": [ - { - "Text": "100 degrees", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 23, - "End": 33 - } - ] - }, - { - "Input": "keep the temperature at 75 degrees f", - "Results": [ - { - "Text": "75 degrees f", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 24, - "End": 35 - } - ] - }, - { - "Input": "let the temperature be at 40 celsius", - "Results": [ - { - "Text": "40 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 26, - "End": 35 - } - ] - }, - { - "Input": "let the temperature be at 50 deg. ", - "Results": [ - { - "Text": "50 deg.", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degree" - }, - "Start": 26, - "End": 32 - } - ] - }, - { - "Input": "convert 10 celsius to fahrenheit", - "Results": [ - { - "Text": "10 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 8, - "End": 17 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 22, - "End": 31 - } - ] - }, - { - "Input": "34.9 centigrate to farenheit", - "Results": [ - { - "Text": "34.9 centigrate", - "TypeName": "temperature", - "Resolution": { - "value": "34.9", - "unit": "C" - }, - "Start": 0, - "End": 14 - }, - { - "Text": "farenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 19, - "End": 27 - } - ] - }, - { - "Input": "convert 200 celsius into fahrenheit", - "Results": [ - { - "Text": "200 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 8, - "End": 18 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 25, - "End": 34 - } - ] - }, - { - "Input": "fahrenheit to celsius 101 fahrenheit is how much celsius", - "Results": [ - { - "Text": "101 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - }, - "Start": 22, - "End": 35 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 9 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 14, - "End": 20 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 49, - "End": 55 - } - ] - }, - { - "Input": "50 degrees celsius to fahrenheit", - "Results": [ - { - "Text": "50 degrees celsius", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - }, - "Start": 0, - "End": 17 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 22, - "End": 31 - } - ] - }, - { - "Input": "could you convert 51 fahrenheit to degrees celsius", - "Results": [ - { - "Text": "51 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 18, - "End": 30 - }, - { - "Text": "degrees celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 35, - "End": 49 - } - ] - }, - { - "Input": "convert 106 degree fahrenheit to degrees celsius", - "Results": [ - { - "Text": "106 degree fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 8, - "End": 28 - }, - { - "Text": "degrees celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 33, - "End": 47 - } - ] - }, - { - "Input": "convert 45 degrees fahrenheit to celsius", - "Results": [ - { - "Text": "45 degrees fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "F" - }, - "Start": 8, - "End": 28 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 33, - "End": 39 - } - ] - }, - { - "Input": "how to convert - 20 degrees fahrenheit to celsius", - "Results": [ - { - "Text": "- 20 degrees fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 15, - "End": 37 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 42, - "End": 48 - } - ] - }, - { - "Input": "Jane Doe, 123 Random Street, Cloud City, PA 23456 F Block", - "NotSupported": "javascript,python,java", - "Results": [] - }, - { - "Input": "SCP-173C", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "turn a 45 degrees angle", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "Rotate 90°", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "Operating profit and funds from operations for 2020 were $765 million or 14.7C/ per security.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "The March 2021 C.P.I. forecast is the median estimate in a Bloomberg survey of economists, as of the morning of April 12.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "Qs cash profits for the first half of fiscal 2021, announced on Thursday, rose 9 per cent to $165 million, led by a turnaround in its retail banking arm, and its interim dividend by 11c to 17c a share.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "Ford routinely sells more than 800,000 F-Series pickups ", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "Direct Relief, which has long worked with FedEx, also partnered with the shipping giant to charter a Boeing 777F to transport supplies to India free of cost", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "The 13F filing provides one of the first examples of how a hedge fund attempted to capitalize on the distressed remains of Archegos.", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "When must 13F be filed?", - "NotSupported": "javascript", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/French/AgeModel.json b/Specs/NumberWithUnit/French/AgeModel.json deleted file mode 100644 index a0c2e634d1..0000000000 --- a/Specs/NumberWithUnit/French/AgeModel.json +++ /dev/null @@ -1,273 +0,0 @@ -[ - { - "Input": "Quand elle avait cinq ans, elle a appris à aller à une bicyclette", - "Results": [ - { - "Text": "cinq ans", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Ans" - }, - "Start": 17, - "End": 24 - } - ] - }, - { - "Input": "Cette saga a dix ans.", - "Results": [ - { - "Text": "dix ans", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Ans" - }, - "Start": 13, - "End": 19 - } - ] - }, - { - "Input": "J'ai seulement 29 ans!", - "Results": [ - { - "Text": "29 ans", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Ans" - }, - "Start": 15, - "End": 20 - } - ] - }, - { - "Input": "Maintenant, après trente cinq ans, mes perspectives changent", - "Results": [ - { - "Text": "trente cinq ans", - "TypeName": "age", - "Resolution": { - "value": "35", - "unit": "Ans" - }, - "Start": 18, - "End": 32 - } - ] - }, - { - "Input": "La Grande Muraille de Chine a plus de 500 ans et prolonge au-dessus de 5000 miles", - "Results": [ - { - "Text": "500 ans", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Ans" - }, - "Start": 38, - "End": 44 - } - ] - }, - { - "Input": "Elle est 60 ans; elle est née dans le 8 mai 1945", - "Results": [ - { - "Text": "60 ans", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Ans" - }, - "Start": 9, - "End": 14 - } - ] - }, - { - "Input": "25 % de cas ne sont pas diagnostiqués jusqu'à autour de 3 ans.", - "Results": [ - { - "Text": "3 ans", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Ans" - }, - "Start": 56, - "End": 60 - } - ] - }, - { - "Input": "Quand sera là la pression pour accomplir une promesse qui est un ans?", - "Results": [ - { - "Text": "un ans", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Ans" - }, - "Start": 62, - "End": 67 - } - ] - }, - { - "Input": "C'est arrivé quand le bébé était seulement dix mois.", - "Results": [ - { - "Text": "dix mois", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Mois" - }, - "Start": 43, - "End": 50 - } - ] - }, - { - "Input": "La proposition de comité est 8 mois.", - "Results": [ - { - "Text": "8 mois", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Mois" - }, - "Start": 29, - "End": 34 - } - ] - }, - { - "Input": "50 % de cas sont diagnostiqués a peus peu près dix-huit mois d'âge", - "Results": [ - { - "Text": "dix-huit mois d'âge", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Mois" - }, - "Start": 47, - "End": 65 - } - ] - }, - { - "Input": "C'est possible, mais en 2006 95 % d'entre eux étaient plus jeunes que trois mois.", - "Results": [ - { - "Text": "trois mois", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Mois" - }, - "Start": 70, - "End": 79 - } - ] - }, - { - "Input": "Si nous avançons en décembre ce sera trois semaines vieilles", - "Results": [ - { - "Text": "trois semaines", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Semaines" - }, - "Start": 37, - "End": 50 - } - ] - }, - { - "Input": "à l'âge de 6 semaines, on peut déjà fêter Noël", - "Results": [ - { - "Text": "6 semaines", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Semaines" - }, - "Start": 11, - "End": 20 - } - ] - }, - { - "Input": "Un 90 jour la vieille facture est tres tard", - "Results": [ - { - "Text": "90 jour", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Jour" - }, - "Start": 3, - "End": 9 - } - ] - }, - { - "Input": "Il a environ 40 - 50 ans", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "50 ans", - "TypeName": "age", - "Resolution": { - "unit": "Ans", - "value": "50" - }, - "Start": 18, - "End": 23 - } - ] - }, - { - "Input": "Maintenant, après quatre-vingt-quinze ans, mes perspectives changent", - "Results": [ - { - "Text": "quatre-vingt-quinze ans", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Ans" - }, - "Start": 18, - "End": 40 - } - ] - }, - { - "Input": "Maintenant, après quatre vingt quinze ans, mes perspectives changent", - "Results": [ - { - "Text": "quatre vingt quinze ans", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Ans" - }, - "Start": 18, - "End": 40 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/French/DimensionModel.json b/Specs/NumberWithUnit/French/DimensionModel.json deleted file mode 100644 index ecccac5680..0000000000 --- a/Specs/NumberWithUnit/French/DimensionModel.json +++ /dev/null @@ -1,906 +0,0 @@ -[ - { - "Input": "75 litre", - "Results": [ - { - "Text": "75 litre", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Litre", - "subtype": "Volume" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "75 L", - "Results": [ - { - "Text": "75 l", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Litre", - "subtype": "Volume" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "75ml", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Millilitre", - "subtype": "Volume" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "son plus grand inconvénient peut être son épaisseur de 3 pouces, assez grand pour un consultant pour le décrire comme maladroit.", - "Results": [ - { - "Text": "3 pouces", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Pouce", - "subtype": "Length" - }, - "Start": 55, - "End": 62 - } - ] - }, - { - "Input": "Un ouragan a hurlé par une zone environ 20 dm de long là, tuant au moins quatorze personnes et transformant des douzaines de maisons dans des décombres.", - "Results": [ - { - "Text": "20 dm", - "TypeName": "dimension", - "Resolution": { - "value": "20", - "unit": "Décimètres", - "subtype": "Length" - }, - "Start": 40, - "End": 44 - } - ] - }, - { - "Input": "il faut plus de 10 1/2 mile de câble et de fil pour tout accrocher, et 23 ordinateurs.", - "Results": [ - { - "Text": "10 1/2 mile", - "TypeName": "dimension", - "Resolution": { - "value": "10,5", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 16, - "End": 26 - } - ] - }, - { - "Input": "le voyage de six hectometre à mon hôtel de l'aéroport qui avait pris 20 minutes plus tôt dans la journée a pris plus de trois heures.", - "Results": [ - { - "Text": "six hectometre", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Hectomètre", - "subtype": "Length" - }, - "Start": 13, - "End": 26 - } - ] - }, - { - "Input": "Dans l'ensemble de l'industrie, la production de pétrole dans ce pays a chuté de 500000 barils par jour en barils au cours des huit premiers mois de cette année.", - "Results": [ - { - "Text": "500000 barils", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Baril", - "subtype": "Volume" - }, - "Start": 81, - "End": 93 - } - ] - }, - { - "Input": "c'est ce qui 1) explique pourquoi nous sommes, eh bien, nous plutôt que bo jackson; 2) prévient qu'il est possible de se noyer dans un lac de deux pieds de profondeur en moyenne; et 3) prédit que 10 000 singes placés avant 10 000 pianos produiraient 1 118 morceaux de rock 'n' roll publiables.", - "Results": [ - { - "Text": "deux pieds", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Pied", - "subtype": "Length" - }, - "Start": 142, - "End": 151 - } - ] - }, - { - "Input": "Le 19 mai, la FDA a commencé à détenir des champignons chinois dans des boîtes de 68 onces après que plus de 100 personnes à Mississippi, à New York et en Pennsylvanie sont tombées malades en mangeant des champignons contaminés.", - "Results": [ - { - "Text": "68 onces", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Onces", - "subtype": "Volume" - }, - "Start": 82, - "End": 89 - } - ] - }, - { - "Input": "Monsieur hulings se réjouit qu'il ait vendu toutes ses actions une semaine avant que le marché ait chuté de 190 points le oct. 13, et il utilise l'argent pour aider à acheter une ferme de chevaux de 45 acres.", - "Results": [ - { - "Text": "45 acres", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Acre", - "subtype": "Area" - }, - "Start": 199, - "End": 206 - } - ] - }, - { - "Input": "Alors, pour faire ces gardenettes tout à fait littéralement les pièces, Mme bartlett avaient jeté des murs sans fenêtre (la brique, le treillis, la haie) huit à 10 pieds de haut, lançant ses intérieurs dans le jour - la nuance longtemps stygienne.", - "Results": [ - { - "Text": "10 pieds", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Pied", - "subtype": "Length" - }, - "Start": 161, - "End": 168 - } - ] - }, - { - "Input": "La gestion ne veut pas de surprises, ' ' cite jack zaves, qui, comme le carburant - le directeur de services aux compagnies aériennes américaines, achète environ 2,4 milliard de gallons de kérosène une année.", - "Results": [ - { - "Text": "2,4 milliard de gallons", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Gallon", - "subtype": "Volume" - }, - "Start": 162, - "End": 184 - } - ] - }, - { - "Input": "un refroidisseur d'eau de 10 gallons avait renversé sur le sol, trempant la moquette rouge.", - "Results": [ - { - "Text": "10 gallons", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Gallon", - "subtype": "Volume" - }, - "Start": 26, - "End": 35 - } - ] - }, - { - "Input": "à proximité, six dauphins s'ébattent dans un aquarium d'eau salée de 1,5 million de gallons.", - "Results": [ - { - "Text": "1,5 million de gallons", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Gallon", - "subtype": "Volume" - }, - "Start": 69, - "End": 90 - } - ] - }, - { - "Input": "et ce bébé est plus de deux livres.", - "Results": [ - { - "Text": "deux livres", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Livre", - "subtype": "Weight" - }, - "Start": 23, - "End": 33 - } - ] - }, - { - "Input": "Je n'ai pas confiance en gens(peuple) qui ne mangent pas, a dit Mme volokh, quoiqu'elle-même elle ait arrêté de déjeuner il y a quelques années pour laisser tomber 25 livres.", - "Results": [ - { - "Text": "25 livres", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Livre", - "subtype": "Weight" - }, - "Start": 164, - "End": 172 - } - ] - }, - { - "Input": "Le poids est de 150 microgrammes", - "Results": [ - { - "Text": "150 microgrammes", - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Microgramme", - "value": "150" - }, - "Start": 16, - "End": 31 - } - ] - }, - { - "Input": "Le poids est de 120 ug", - "Results": [ - { - "Text": "120 ug", - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Microgramme", - "value": "120" - }, - "Start": 16, - "End": 21 - } - ] - }, - { - "Input": "On permettra la coquille, une filiale de hollandais royal / le groupe de coquille(d'obus), exporter 0,9 billion de pieds cubes et le golfe, une unité d'Olympie et on permettra aux développements york ltd. d'exporter", - "Results": [ - { - "Text": "0,9 billion de pieds cubes", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "unit": "Pieds cube", - "subtype": "Volume" - }, - "Start": 100, - "End": 125 - } - ] - }, - { - "Input": "Les points culminants des factures, comme actuellement encadré, sont: - - une restriction du montant d'immobilier une famille peut posséder, à 660 mètres carrés dans la nation ' s six villes les plus grandes, mais plus dans de plus petites villes et des zones rurales.", - "Results": [ - { - "Text": "660 mètres carrés", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Mètre carré", - "subtype": "Area" - }, - "Start": 143, - "End": 159 - } - ] - }, - { - "Input": "Tigrean des armées sont maintenant 200 miles au nord d'Addis-Ababa, menaçant la ville de dese, qui couperait mengistu ' s le capital(la capitale) du port d'assab, par lequel tout le carburant et d'autres provisions atteignent Addis-Ababa.", - "Results": [ - { - "Text": "200 miles", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 35, - "End": 43 - } - ] - }, - { - "Input": "Il a dit qu'un des ordinateurs a pris un voyage de trois pieds glissant à sur le sol.", - "Results": [ - { - "Text": "trois pieds", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Pied", - "subtype": "Length" - }, - "Start": 51, - "End": 61 - } - ] - }, - { - "Input": "Le coeur de ses participations est 190000 mètres carrés de propriété incroyablement chère dans le quartier marunouchi, le centre d'affaires et financier de Tokyo, souvent en plaisantant appelé 'mitsubishi le village. '", - "Results": [ - { - "Text": "190000 mètres carrés", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Mètre carré", - "subtype": "Area" - }, - "Start": 35, - "End": 54 - } - ] - }, - { - "Input": "Le satellite, construit par Hughes pour l'organisation de satellite de télécommunications internationale, fait partie d'un contrat de 700 millions $ attribué à Hughes en 1982 pour développer cinq des trois-tonnes satellites.", - "Results": [ - { - "Text": "trois-tonnes", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Tonne", - "subtype": "Weight" - }, - "Start": 200, - "End": 211 - } - ] - }, - { - "Input": "Dans des 1996 armes biologiques de rapport sur, le centre pour des études stratégiques et internationales, une institution de recherche de politique publique à Washington, a averti que c'était facile pour - être des terroristes pour assembler des armes biologiques _ l'utilisation de l'équipement commercial avec une capacité de 130 gallons.", - "Results": [ - { - "Text": "130 gallons", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Gallon", - "subtype": "Volume" - }, - "Start": 329, - "End": 339 - } - ] - }, - { - "Input": "Le groupe commercial ' s la compilation de données de département de commerce a montré cet août des importations, le deuxième plus grand total mensuel de année, étaient en hausse de 5 % de juillet ' s 1.458.000,00 tonnes, mais au-dessous de lannée dernière ' s haut d'en juin 1988", - "Results": [ - { - "Text": "1.458.000,00 tonnes", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Tonne", - "subtype": "Weight" - }, - "Start": 201, - "End": 219 - } - ] - }, - { - "Input": "À Non. 1, singh frappe des 9 - le coup d'approche de fer à dans six pieds de la tasse(coupe).", - "Results": [ - { - "Text": "six pieds", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Pied", - "subtype": "Length" - }, - "Start": 64, - "End": 72 - } - ] - }, - { - "Input": "Ainsi quand l'année prochaine(suivante) ' s psyllium la récolte(culture) est récolté dans marche, cela peut être plus petit que les 16.000,00 tonnes métriques de quelques années passées - - directement à la crête du boom de psyllium.", - "Results": [ - { - "Text": "16.000,00 tonnes métriques", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Tonne métrique", - "subtype": "Weight" - }, - "Start": 132, - "End": 157 - } - ] - }, - { - "Input": "Les 486 sont le descendant d'une longue série des puces Intel qui ont commencé à dominer le marché depuis qu'IBM a choisi la 8088 puce 16 bits pour son premier ordinateur individuel.", - "Results": [ - { - "Text": "16 bits", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "Bit", - "subtype": "Information" - }, - "Start": 135, - "End": 141 - } - ] - }, - { - "Input": "le Jiotto caspita ' ' peut fonctionner(courir) à plus de 188 miles a l'heure, un porte-parole d'entreprise a dit.", - "Results": [ - { - "Text": "188 miles a l'heure", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Miles par heure", - "subtype": "Speed" - }, - "Start": 57, - "End": 75 - } - ] - }, - { - "Input": "La marine a installé(configuré) un hélicoptère posant la zone juste 100 mètres d'une salle d'opération mobile, juste à la périphérie de Bagdad.", - "Results": [ - { - "Text": "100 mètres", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Mètres", - "subtype": "Length" - }, - "Start": 68, - "End": 77 - } - ] - }, - { - "Input": "Caltrans planifie d'ajouter un deuxième niveau pour des bus et des co-voiturages au-dessus de la médiane d'une période 2,5-km de l'autoroute de port juste au sud de Los Angeles, près du mémorial le Colisée.", - "Results": [ - { - "Text": "2,5-km", - "TypeName": "dimension", - "Resolution": { - "value": "2,5", - "unit": "Kilomètres", - "subtype": "Length" - }, - "Start": 119, - "End": 124 - } - ] - }, - { - "Input": "Sur mon énergie(promenade en voiture) de quatre mi pour cultiver le siège social chaque matin, je conduis(roule) par quatre autres maisons vides.", - "Results": [ - { - "Text": "quatre mi", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 41, - "End": 49 - } - ] - }, - { - "Input": "Nous sommes insultés, a dit langa du siège social catholique grec, nord-ouest environ de 325 kilomètres de Bucarest.", - "Results": [ - { - "Text": "325 kilomètres", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilomètres", - "subtype": "Length" - }, - "Start": 89, - "End": 102 - } - ] - }, - { - "Input": "Rotich est un minuscule (5 millimètres", - "Results": [ - { - "Text": "5 millimètres", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Millimètres", - "subtype": "Length" - }, - "Start": 25, - "End": 37 - } - ] - }, - { - "Input": "40 centimètres) 28 - l'année - vieux qui n'a pas commencé à fonctionner(courir) sérieusement jusqu'à il y a trois ans et n'avaient pas rivalisé à l'intérieur jusqu'à ce mois.", - "Results": [ - { - "Text": "40 centimètres", - "TypeName": "dimension", - "Resolution": { - "value": "40", - "unit": "Centimètres", - "subtype": "Length" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "Le parc de circuit (le Minnesota) dans shakopee est un 1/4 kilomètre a pavé ovale.", - "Results": [ - { - "Text": "1/4 kilomètre", - "TypeName": "dimension", - "Resolution": { - "value": "0,25", - "unit": "Kilomètres", - "subtype": "Length" - }, - "Start": 55, - "End": 67 - } - ] - }, - { - "Input": "Castlecrag la montagne est placé(localisé) au sud de lac de douves, 1,6 km à l'ouest de mont(support) frink le long de la même ligne d'arête.", - "Results": [ - { - "Text": "1,6 km", - "TypeName": "dimension", - "Resolution": { - "value": "1,6", - "unit": "Kilomètres", - "subtype": "Length" - }, - "Start": 68, - "End": 73 - } - ] - }, - { - "Input": "Les collines javadi sont placées(localisées) environ 17 km d'ambur.", - "Results": [ - { - "Text": "17 km", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Kilomètres", - "subtype": "Length" - }, - "Start": 53, - "End": 57 - } - ] - }, - { - "Input": "Après le lac Michigan tournant près de exposition pendant deux heures, commandant Hugo eckener a posé le dirigeable de 776 mètres à curtiss voisin - wright aéroport dans glenview.", - "Results": [ - { - "Text": "776 mètres", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Mètres", - "subtype": "Length" - }, - "Start": 119, - "End": 128 - } - ] - }, - { - "Input": "échange avec la autoroute) 35 et la autoroute) 115 à Lindsay et peterborough (quitte 436) des mensonges 500 mètres à est de route de Bennett.", - "Results": [ - { - "Text": "500 mètres", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Mètres", - "subtype": "Length" - }, - "Start": 104, - "End": 113 - } - ] - }, - { - "Input": "En 1995 le canon a présenté la première lentille slr disponible dans le commerce avec la stabilisation d'image interne, ef 75 - 300mm f / 4 - 5. 6 est usm.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "300mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Millimètres", - "subtype": "Length" - }, - "Start": 128, - "End": 132 - } - ] - }, - { - "Input": "Les armements de sterling de dagenham, Essex a produit un kit de conversion comprenant un nouveau 7,62mm le baril, le magazine, extracteur et éjecteur pour la vente commerciale.", - "Results": [ - { - "Text": "7,62mm", - "TypeName": "dimension", - "Resolution": { - "value": "7,62", - "unit": "Millimètres", - "subtype": "Length" - }, - "Start": 98, - "End": 103 - }, - { - "Text": "baril", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Baril", - "subtype": "Volume" - }, - "Start": 108, - "End": 112 - } - ] - }, - { - "Input": "Le projet coûte 46 $. 8 millions et est destiné pour stimuler l'entreprise ' s la capacité de production de 25 % à 34500 tonnes métriques de cathode de cuivre une année.", - "Results": [ - { - "Text": "34500 tonnes métriques", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Tonne métrique", - "subtype": "Weight" - }, - "Start": 115, - "End": 136 - } - ] - }, - { - "Input": "Acier canadien - la production de lingot a totalisé 291890 tonnes métriques la semaine fini le 7 octobre, en haut 14. 8 % de la semaine précédente ' s le total de, la statistique le Canada, une agence fédérale, a dit.", - "Results": [ - { - "Text": "291890 tonnes métriques", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Tonne métrique", - "subtype": "Weight" - }, - "Start": 52, - "End": 74 - } - ] - }, - { - "Input": "Les panthères de la Floride vivent dans des gammes domestiques entre 190 km2.", - "Results": [ - { - "Text": "190 km2", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Kilomètre carré", - "subtype": "Area" - }, - "Start": 69, - "End": 75 - } - ] - }, - { - "Input": "Une t.métrique est égale à 2.204,62 livres.", - "Results": [ - { - "Text": "2.204,62 livres", - "TypeName": "dimension", - "Resolution": { - "value": "2204,62", - "unit": "Livre", - "subtype": "Weight" - }, - "Start": 27, - "End": 41 - } - ] - }, - { - "Input": "M. Kersaudy veut porter plainte.", - "Results": [] - }, - { - "Input": "M . Kersaudy veut porter plainte.", - "Results": [] - }, - { - "Input": "m", - "Comment": "Exact unit match to the input should be supported always", - "Results": [ - { - "Text": "m", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Mètres", - "subtype": "Length" - }, - "Start": 0, - "End": 0 - } - ] - }, - { - "Input": "nous chantons l'internationale", - "Results": [] - }, - { - "Input": "tourner à 90 degrés", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "90 degrés", - "Start": 10, - "End": 18, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "90" - } - } - ] - }, - { - "Input": "tourner à gauche à 45 degrés", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "45 degrés", - "Start": 19, - "End": 27, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "45" - } - } - ] - }, - { - "Input": "L'angle est de 0.8rad", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "0.8rad", - "Start": 15, - "End": 20, - "TypeName": "dimension", - "Resolution": { - "unit": "Radian", - "subtype": "Angle", - "value": "0,8" - } - } - ] - }, - { - "Input": "faire un demi tour", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "un demi tour", - "Start": 6, - "End": 17, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "0,5" - } - } - ] - }, - { - "Input": "faire 3 tours", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "3 tours", - "Start": 6, - "End": 12, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "3" - } - } - ] - }, - { - "Input": "la température est de 24 degrés", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "L'eau bout à 100° Celsius", - "NotSupported": "java, javascript, python", - "Results": [] - } -] diff --git a/Specs/NumberWithUnit/French/TemperatureModel.json b/Specs/NumberWithUnit/French/TemperatureModel.json deleted file mode 100644 index 3442bf9729..0000000000 --- a/Specs/NumberWithUnit/French/TemperatureModel.json +++ /dev/null @@ -1,748 +0,0 @@ -[ - { - "Input": "La température l'extérieur est 40 deg celsius", - "Results": [ - { - "Text": "40 deg celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 31, - "End": 44 - } - ] - }, - { - "Input": "C'est 90 fahrenheit au texas", - "Results": [ - { - "Text": "90 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 6, - "End": 18 - } - ] - }, - { - "Input": "-5 degrés fahrenheit", - "Results": [ - { - "Text": "-5 degrés fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "6 deg c", - "Results": [ - { - "Text": "6 deg c", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "25 deg f", - "Results": [ - { - "Text": "25 deg f", - "TypeName": "temperature", - "Resolution": { - "value": "25", - "unit": "F" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "200 centigrade", - "Results": [ - { - "Text": "200 centigrade", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "250 deg centigrade", - "Results": [ - { - "Text": "250 deg centigrade", - "TypeName": "temperature", - "Resolution": { - "value": "250", - "unit": "C" - }, - "Start": 0, - "End": 17 - } - ] - }, - { - "Input": "98,6 degrés f est normal température", - "Results": [ - { - "Text": "98,6 degrés f", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "régler la température à 30 degrés celsius", - "Results": [ - { - "Text": "30 degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 24, - "End": 40 - } - ] - }, - { - "Input": "la température normale est de 98,6 degrés fahrenheit", - "Results": [ - { - "Text": "98,6 degrés fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 30, - "End": 51 - } - ] - }, - { - "Input": "100 degrés f", - "Results": [ - { - "Text": "100 degrés f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 degrés c", - "Results": [ - { - "Text": "20 degrés c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "100,2 degrés fahrenheit est bas", - "Results": [ - { - "Text": "100,2 degrés fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "100,2", - "unit": "F" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "10,5 celsius", - "Results": [ - { - "Text": "10,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10,5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 degrés celsius", - "Results": [ - { - "Text": "20 degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "20,3 celsius", - "Results": [ - { - "Text": "20,3 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20,3", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "34,5 celsius", - "Results": [ - { - "Text": "34,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "34,5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "the température outside is 98 degrés", - "Results": [ - { - "Text": "98 degrés", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degré" - }, - "Start": 27, - "End": 35 - } - ] - }, - { - "Input": "régler le thermostat à 85 °", - "Results": [ - { - "Text": "85 °", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degré" - }, - "Start": 23, - "End": 26 - } - ] - }, - { - "Input": "augmenter la température de 5 degrés", - "Results": [ - { - "Text": "5 degrés", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degré" - }, - "Start": 28, - "End": 35 - } - ] - }, - { - "Input": "régler la température à 70 degrés f", - "Results": [ - { - "Text": "70 degrés f", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 24, - "End": 34 - } - ] - }, - { - "Input": "augmenter la température de 20 degrés", - "Results": [ - { - "Text": "20 degrés", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degré" - }, - "Start": 28, - "End": 36 - } - ] - }, - { - "Input": "régler la température à 100 degrés", - "Results": [ - { - "Text": "100 degrés", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degré" - }, - "Start": 24, - "End": 33 - } - ] - }, - { - "Input": "garder la température à 75 degrés f", - "Results": [ - { - "Text": "75 degrés f", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 24, - "End": 34 - } - ] - }, - { - "Input": "laissez la température à 40 degrés celsius", - "Results": [ - { - "Text": "40 degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 25, - "End": 41 - } - ] - }, - { - "Input": "Laisser la température à 50 deg.", - "Results": [ - { - "Text": "50 deg.", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degré" - }, - "Start": 25, - "End": 31 - } - ] - }, - { - "Input": "convertir 10 celsius en fahrenheit", - "Results": [ - { - "Text": "10 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 10, - "End": 19 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 24, - "End": 33 - } - ] - }, - { - "Input": "34,9 centigrade à fahrenheit", - "Results": [ - { - "Text": "34,9 centigrade", - "TypeName": "temperature", - "Resolution": { - "value": "34,9", - "unit": "C" - }, - "Start": 0, - "End": 14 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 18, - "End": 27 - } - ] - }, - { - "Input": "convertir 200 celsius celsius en fahrenheit", - "Results": [ - { - "Text": "200 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 10, - "End": 20 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 22, - "End": 28 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 33, - "End": 42 - } - ] - }, - { - "Input": "fahrenheit à celsius 101 fahrenheit est combien celsius", - "Results": [ - { - "Text": "101 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - }, - "Start": 21, - "End": 34 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 9 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 13, - "End": 19 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 48, - "End": 54 - } - ] - }, - { - "Input": "50 degrés celsius celsius à fahrenheit", - "Results": [ - { - "Text": "50 degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - }, - "Start": 0, - "End": 16 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 18, - "End": 24 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 28, - "End": 37 - } - ] - }, - { - "Input": "pourriez-vous convertir 51 fahrenheit en degrés celsius", - "Results": [ - { - "Text": "51 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 24, - "End": 36 - }, - { - "Text": "degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 41, - "End": 54 - } - ] - }, - { - "Input": "convertir 106 degrés fahrenheit en degrés celsius", - "Results": [ - { - "Text": "106 degrés fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 10, - "End": 30 - }, - { - "Text": "degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 35, - "End": 48 - } - ] - }, - { - "Input": "convertir 45 degrés fahrenheit en degrés celsius", - "Results": [ - { - "Text": "45 degrés fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "F" - }, - "Start": 10, - "End": 29 - }, - { - "Text": "degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 34, - "End": 47 - } - ] - }, - { - "Input": "comment convertir - 20 degrés fahrenheit en degrés celsius", - "Results": [ - { - "Text": "- 20 degrés fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 18, - "End": 39 - }, - { - "Text": "degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 44, - "End": 57 - } - ] - }, - { - "Input": "Convertir 106 Kelvin", - "Results": [ - { - "Text": "106 kelvin", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "Kelvin" - }, - "Start": 10, - "End": 19 - } - ] - }, - { - "Input": "Convertir 106 kelvin a degrés celsius", - "Results": [ - { - "Text": "106 kelvin", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "Kelvin" - }, - "Start": 10, - "End": 19 - }, - { - "Text": "degrés celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 23, - "End": 36 - } - ] - }, - { - "Input": "convertir 200k K en degrés fahrenheit", - "Results": [ - { - "Text": "200k k", - "TypeName": "temperature", - "Resolution": { - "value": "200000", - "unit": "Kelvin" - }, - "Start": 10, - "End": 15 - }, - { - "Text": "degrés fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 20, - "End": 36 - } - ] - }, - { - "Input": "tourner à un angle de 45 degrés", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "Rotation 90°", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "La température l'extérieur est 4000000 de degrés", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "4000000 de degrés", - "TypeName": "temperature", - "Resolution": { - "value": "4000000", - "unit": "Degré" - }, - "Start": 31, - "End": 47 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/German/AgeModel.json b/Specs/NumberWithUnit/German/AgeModel.json deleted file mode 100644 index c370ff480e..0000000000 --- a/Specs/NumberWithUnit/German/AgeModel.json +++ /dev/null @@ -1,229 +0,0 @@ -[ - { - "Input": "Als sie 5 Jahre alt war, lernte sie Fahrrad fahren.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "5 jahre alt", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 8, - "End": 18 - } - ] - }, - { - "Input": "Diese Sage ist zehn Jahre alt.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "zehn jahre alt", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Year" - }, - "Start": 15, - "End": 28 - } - ] - }, - { - "Input": "Ich bin nur 29 Jahre alt!", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "29 jahre alt", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 12, - "End": 23 - } - ] - }, - { - "Input": "Jetzt, mit einem Alter von 95 Jahren, hat man eine andere Perspektive.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "95 jahren", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Year" - }, - "Start": 27, - "End": 35 - } - ] - }, - { - "Input": "Die große Mauer von China ist mehr als 500 Jahre alt und erstreckt sich über 5000 Meilen.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "500 jahre alt", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Year" - }, - "Start": 39, - "End": 51 - } - ] - }, - { - "Input": "Sie ist 60 Jahre alt. Sie wurde am 8. May 1945 geboren.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "60 jahre alt", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 8, - "End": 19 - } - ] - }, - { - "Input": "25% aller Fälle werden bis zu einem Alter von 3 Jahren nicht diagnostiziert.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "3 jahren", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Year" - }, - "Start": 46, - "End": 53 - } - ] - }, - { - "Input": "Es ist passiert als das Baby nur zehn Monate alt war.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "zehn monate alt", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 33, - "End": 47 - } - ] - }, - { - "Input": "Das Angebot des Komitees ist 8 Monate her.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "8 monate", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Month" - }, - "Start": 29, - "End": 36 - } - ] - }, - { - "Input": "Es ist möglich, allerdings waren 2006 95% von ihnen jünger als drei Monate alt.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "drei monate alt", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Month" - }, - "Start": 63, - "End": 77 - } - ] - }, - { - "Input": "Wenn wir im Dezember weiter machen, wird es drei Wochen alt sein.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "drei wochen alt", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 44, - "End": 58 - } - ] - }, - { - "Input": "Im Alter von 6 Wochen kann man schon Weihnachten feiern.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "6 wochen", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Week" - }, - "Start": 13, - "End": 20 - } - ] - }, - { - "Input": "Er ist ungefähr 40 - 50 Jahre alt.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "50 jahre alt", - "Start": 21, - "End": 32, - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "50" - } - } - ] - }, - { - "Input": "Woche oder Wochen", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/German/DimensionModel.json b/Specs/NumberWithUnit/German/DimensionModel.json deleted file mode 100644 index 78d555511a..0000000000 --- a/Specs/NumberWithUnit/German/DimensionModel.json +++ /dev/null @@ -1,516 +0,0 @@ -[ - { - "Input": "75ml", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Milliliter", - "subtype": "Volume" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "Das Ding ist mindestens 3 Zoll breit.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "3 zoll", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Inch", - "subtype": "Length" - }, - "Start": 24, - "End": 29 - } - ] - }, - { - "Input": "Da müssen noch 3 Teelöffel Salz rein.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "3 teelöffel", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Teaspoon", - "subtype": "Volume" - }, - "Start": 15, - "End": 25 - } - ] - }, - { - "Input": "Auf dem Oktoberfest wurden bisher insgesamt ca. achtzig Millionen liter Bier ausgeschenkt.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "achtzig millionen liter", - "TypeName": "dimension", - "Resolution": { - "value": "80000000", - "unit": "Liter", - "subtype": "Volume" - }, - "Start": 48, - "End": 70 - } - ] - }, - { - "Input": "Ein Fußballfeld ist zwischen 4.050 m² und 10.800 m² groß.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "4.050 m²", - "TypeName": "dimension", - "Resolution": { - "value": "4050", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 29, - "End": 36 - }, - { - "Text": "10.800 m²", - "TypeName": "dimension", - "Resolution": { - "value": "10800", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 42, - "End": 50 - } - ] - }, - { - "Input": "Eine Geschwindigkeitsbegrenzung von 120 km/h macht auf der Autobahn keinen Sinn.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "120 km/h", - "TypeName": "dimension", - "Resolution": { - "value": "120", - "unit": "Kilometer per hour", - "subtype": "Speed" - }, - "Start": 36, - "End": 43 - } - ] - }, - { - "Input": "Dafür brauchen wir mindestens 12 Kubikmeter Beton.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "12 kubikmeter", - "TypeName": "dimension", - "Resolution": { - "value": "12", - "unit": "Cubic meter", - "subtype": "Volume" - }, - "Start": 30, - "End": 42 - } - ] - }, - { - "Input": "Ein Pfund Hack bitte.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "ein pfund", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "Das dürften ca. 50 Gigabyte an Daten sein die übertragen werden müssen.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "50 gigabyte", - "TypeName": "dimension", - "Resolution": { - "value": "50", - "unit": "Gigabyte", - "subtype": "Information" - }, - "Start": 16, - "End": 26 - } - ] - }, - { - "Input": "Dreizehn Meilen westlich von hier liegt die nächste Stadt.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "dreizehn meilen", - "TypeName": "dimension", - "Resolution": { - "value": "13", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "Ein Tennisfeld(Einzel) ist 195,63 Quadratmeter groß. Für Doppel sind es 260,76 Quadratmeter. Dagegen wirkt eine Tischtennisfeld mit 4,18m^2 mickrig.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "195,63 quadratmeter", - "TypeName": "dimension", - "Resolution": { - "value": "195,63", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 27, - "End": 45 - }, - { - "Text": "260,76 quadratmeter", - "TypeName": "dimension", - "Resolution": { - "value": "260,76", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 72, - "End": 90 - }, - { - "Text": "4,18m^2", - "TypeName": "dimension", - "Resolution": { - "value": "4,18", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 132, - "End": 138 - } - ] - }, - { - "Input": "Während der 4004-Prozessor noch eine Strukturgröße von 10 μm hatte, werden die Prozessoren mit der Skylake-Architektur mit 14 nm gefertigt. Toshibas NAND-Flashspeicher von 2013 hatte eine von 19 Nanometern.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "10 μm", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Micrometer", - "subtype": "Length" - }, - "Start": 55, - "End": 59 - }, - { - "Text": "14 nm", - "TypeName": "dimension", - "Resolution": { - "value": "14", - "unit": "Nanometer", - "subtype": "Length" - }, - "Start": 123, - "End": 127 - }, - { - "Text": "19 nanometern", - "TypeName": "dimension", - "Resolution": { - "value": "19", - "unit": "Nanometer", - "subtype": "Length" - }, - "Start": 192, - "End": 204 - } - ] - }, - { - "Input": "Das Licht bewegt sich mit 299.792.458 Metern pro Sekunde durch den leeren Raum.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "299.792.458 metern pro sekunde", - "TypeName": "dimension", - "Resolution": { - "value": "299792458", - "unit": "Meter per second", - "subtype": "Speed" - }, - "Start": 26, - "End": 55 - } - ] - }, - { - "Input": "Bei 500Km ist Pause.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "500km", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 4, - "End": 8 - } - ] - }, - { - "Input": "Eine BGM-109 erreich eine Höchstgeschwindigkeit von 878 km/h bzw. 244 Metern pro Sekunde", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "878 km/h", - "TypeName": "dimension", - "Resolution": { - "value": "878", - "unit": "Kilometer per hour", - "subtype": "Speed" - }, - "Start": 52, - "End": 59 - }, - { - "Text": "244 metern pro sekunde", - "TypeName": "dimension", - "Resolution": { - "value": "244", - "unit": "Meter per second", - "subtype": "Speed" - }, - "Start": 66, - "End": 87 - } - ] - }, - { - "Input": "Wir brauchen da noch einen Teelöffel Salz.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "einen teelöffel", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Teaspoon", - "subtype": "Volume" - }, - "Start": 21, - "End": 35 - } - ] - }, - { - "Input": "Sekunde", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "2:00 pm", - "NotSupported": "java", - "Results": [] - }, - { - "Input": "12 Pfund Tasse Kaffee", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "12 pfund", - "TypeName": "dimension", - "Resolution": { - "value": "12", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "12-Pfund-Tasse Kaffee", - "NotSupportedByDesign": "python", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "12-pfund", - "TypeName": "dimension", - "Resolution": { - "value": "12", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "12 - Pfund - Tasse Kaffee", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "12 - pfund", - "TypeName": "dimension", - "Resolution": { - "value": "12", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "um 90 Grad drehen", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "90 grad", - "Start": 3, - "End": 9, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "90" - } - } - ] - }, - { - "Input": "links abbiegen 45 Grad", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "45 grad", - "Start": 15, - "End": 21, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "45" - } - } - ] - }, - { - "Input": "Der Winkel beträgt 0,8rad", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "0,8rad", - "Start": 19, - "End": 24, - "TypeName": "dimension", - "Resolution": { - "unit": "Radian", - "subtype": "Angle", - "value": "0,8" - } - } - ] - }, - { - "Input": "eine halbe Turn machen", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "eine halbe turn", - "Start": 0, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "0,5" - } - } - ] - }, - { - "Input": "3 Turn drehen", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "3 turn", - "Start": 0, - "End": 5, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "3" - } - } - ] - }, - { - "Input": "die temperatur beträgt 24 grad", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "Wasser kocht bei 100° Celsius", - "NotSupported": "java, javascript, python", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/German/TemperatureModel.json b/Specs/NumberWithUnit/German/TemperatureModel.json deleted file mode 100644 index 9d1db50391..0000000000 --- a/Specs/NumberWithUnit/German/TemperatureModel.json +++ /dev/null @@ -1,212 +0,0 @@ -[ - { - "Input": "Draußen sind es 40 °Celsius.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "40 °celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 16, - "End": 26 - } - ] - }, - { - "Input": "in Texas sind es 90 Grad Fahrenheit", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "90 grad fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 17, - "End": 34 - } - ] - }, - { - "Input": "-5 Grad Fahrenheit", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "-5 grad fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 17 - } - ] - }, - { - "Input": "6 Grad Celsius", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "6 grad celsius", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "Heute waren es 8 Grad Celsius, das sind 5 Kelvin mehr als gestern!", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "8 grad celsius", - "TypeName": "temperature", - "Resolution": { - "value": "8", - "unit": "C" - }, - "Start": 15, - "End": 28 - }, - { - "Text": "5 kelvin", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "K" - }, - "Start": 40, - "End": 47 - } - ] - }, - { - "Input": "Heute sollen es bis zu 35 °C im Schatten werden.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "35 °c", - "TypeName": "temperature", - "Resolution": { - "value": "35", - "unit": "C" - }, - "Start": 23, - "End": 27 - } - ] - }, - { - "Input": "Heute sollen es bis zu fünfunddreißig °C im Schatten werden.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "fünfunddreißig °c", - "TypeName": "temperature", - "Resolution": { - "value": "35", - "unit": "C" - }, - "Start": 23, - "End": 39 - } - ] - }, - { - "Input": "Im Dezember Betrug die Durchschnittstemperatur in Deutschland 2,6 Grad. Die bisher höchste Temperatur von 40,3 Grad wurde im August 2015 gemessen.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "2,6 grad", - "TypeName": "temperature", - "Resolution": { - "value": "2,6", - "unit": "Degree" - }, - "Start": 62, - "End": 69 - }, - { - "Text": "40,3 grad", - "TypeName": "temperature", - "Resolution": { - "value": "40,3", - "unit": "Degree" - }, - "Start": 106, - "End": 114 - } - ] - }, - { - "Input": "Morgen werden es in Hamburg 18 °C.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "18 °c", - "TypeName": "temperature", - "Resolution": { - "value": "18", - "unit": "C" - }, - "Start": 28, - "End": 32 - } - ] - }, - { - "Input": "14 Celsius entsprechen 57,2 Fahrenheit.", - "NotSupportedByDesign": "python", - "NotSupported": "javascript", - "Results": [ - { - "Text": "14 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "14", - "unit": "C" - }, - "Start": 0, - "End": 9 - }, - { - "Text": "57,2 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "57,2", - "unit": "F" - }, - "Start": 23, - "End": 37 - } - ] - }, - { - "Input": "einen 45 Grad Winkel drehen", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "90° drehen", - "NotSupported": "java, javascript, python", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Hindi/AgeModel.json b/Specs/NumberWithUnit/Hindi/AgeModel.json deleted file mode 100644 index 57f3d34998..0000000000 --- a/Specs/NumberWithUnit/Hindi/AgeModel.json +++ /dev/null @@ -1,343 +0,0 @@ -[ - { - "Input": "जब वह पांच वर्ष की थी, उसने बाइक चलाना सीख लिया था।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "पांच वर्ष की थी", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 6, - "End": 20 - } - ] - }, - { - "Input": "यह कहानी दस साल पुरानी है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "दस साल पुरानी", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Year" - }, - "Start": 9, - "End": 21 - } - ] - }, - { - "Input": "मैं केवल 29 साल का हूं!", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "29 साल का", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 9, - "End": 17 - } - ] - }, - { - "Input": "अब, पंचानबे साल की आयु के बाद, नजरिया बदल जाता है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "पंचानबे साल की आयु", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Year" - }, - "Start": 4, - "End": 21 - } - ] - }, - { - "Input": "चीन की दीवार 500 साल से ज़्यादा पुरानी है और 5,000 मील से ज़्यादा लंबी है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500 साल से ज़्यादा पुरानी", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Year" - }, - "Start": 13, - "End": 36 - } - ] - }, - { - "Input": "उनकी उमर 60 साल है; वह 4 मई, 1945 में पैदा हुई थीं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "60 साल", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 9, - "End": 14 - } - ] - }, - { - "Input": "करीबन 3 साल की उमर तक 25% मामलों का पता नहीं चलता है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3 साल की उमर", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Year" - }, - "Start": 6, - "End": 17 - } - ] - }, - { - "Input": "उस एक साल पुराने वादे को पूरा करने का दबाव कब आएगा?", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "एक साल पुराने", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Year" - }, - "Start": 3, - "End": 15 - } - ] - }, - { - "Input": "यह तब हुआ था जब बच्चा केवल दस महीने का था.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "दस महीने का", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 27, - "End": 37 - } - ] - }, - { - "Input": "समिति प्रस्ताव 8 महीने पहले की है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "8 महीने पहले की", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Month" - }, - "Start": 15, - "End": 29 - } - ] - }, - { - "Input": "लगभग 50% मामलों का पता अठारह महीने की उम्र में लग जाता है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "अठारह महीने की उम्र", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Month" - }, - "Start": 23, - "End": 41 - } - ] - }, - { - "Input": "यह संभव है, लेकिन 2006 में उनमें से 95% तीन महीने से कम उम्र के थे।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "तीन महीने", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Month" - }, - "Start": 40, - "End": 48 - } - ] - }, - { - "Input": "यदि हम दिसंबर में आगे बढ़ते हैं, तो यह तीन हफ़्ते पुरानी होगी।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "तीन हफ़्ते पुरानी", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 38, - "End": 53 - } - ] - }, - { - "Input": "6 हफ़्ते की उम्र में, कोई क्रिसमस मना सकता है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "6 हफ़्ते की उम्र", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Week" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "उपभोग की कोई 90 दिन पुरानी बिल के लिए बहुत देर हो चुकी होती है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "90 दिन पुरानी", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 13, - "End": 25 - } - ] - }, - { - "Input": "वह लगभग 40 - 50 साल का है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50 साल का", - "Start": 13, - "End": 21, - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "50" - } - } - ] - }, - { - "Input": "वह करीब फोर्टी-फ़िफ़्टी यर्स के हैं", - "Comment": "Code-mixed for when the value as well as the unit retains pronounciation from English, but is transliterated to Devanagari.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "फ़िफ़्टी यर्स के", - "TypeName": "age", - "Resolution": { - "value": "50", - "unit": "Year" - }, - "Start": 15, - "End": 28 - } - ] - }, - { - "Input": "यह बच्चा केवल सिक्स वीक्स का था", - "Comment": "Code-mixed for when the value as well as the unit retains pronounciation from English, but is transliterated to Devanagari.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "सिक्स वीक्स का", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Week" - }, - "Start": 14, - "End": 27 - } - ] - }, - { - "Input": "वह करीब forty-fifty years के हैं", - "Comment": "Code-mixed for when all words except the numeric value and it's unit are in Devanagari, and the rest in Roman.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "fifty years", - "TypeName": "age", - "Resolution": { - "value": "50", - "unit": "Year" - }, - "Start": 14, - "End": 24 - } - ] - }, - { - "Input": "यह बच्चा केवल six weeks का था", - "Comment": "Code-mixed for when both the age as well as unit is in Roman script, and the other words are in Devanagari", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "six weeks का", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Week" - }, - "Start": 14, - "End": 25 - } - ] - }, - { - "Input": "मैं केवल twenty nine year का हूं", - "Comment": "Code-mixed for when both Devanagari and Roman scripts are used (numeric value and unit in Roman, and the rest in Devanagari).", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "twenty nine year का", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 9, - "End": 27 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Hindi/DimensionModel.json b/Specs/NumberWithUnit/Hindi/DimensionModel.json deleted file mode 100644 index ced6a4301f..0000000000 --- a/Specs/NumberWithUnit/Hindi/DimensionModel.json +++ /dev/null @@ -1,888 +0,0 @@ -[ - { - "Input": "आपका वजन 200 पाउंड.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 पाउंड", - "Start": 9, - "End": 17, - "TypeName": "dimension", - "Resolution": { - "unit": "Pound", - "subtype": "Weight", - "value": "200" - } - } - ] - }, - { - "Input": "75ml", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Milliliter", - "subtype": "Volume" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "इसकी सबसे बड़ी खामी इसकी 3-इंच की मोटाई हो सकती है, इतनी बड़ी कि कोई एक सलाहकार इसे क्लंकी कह सकता है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3-इंच", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Inch", - "subtype": "Length" - }, - "Start": 24, - "End": 28 - } - ] - }, - { - "Input": "एक चक्रवाद इस क्षेत्र में आया और करीब दस मील तक चला, जिससे कम से कम चौदह लोग मारे गए और दर्जनों घर गिर गए।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "दस मील", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 38, - "End": 43 - } - ] - }, - { - "Input": "इस सभी को जोड़ने में 10 1/2 मील का केबल और तार लगता है, और 23 कम्प्यूटर.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 1/2 मील", - "TypeName": "dimension", - "Resolution": { - "value": "10.5", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 20, - "End": 29 - } - ] - }, - { - "Input": "मेरे एयरपोर्ट वाले होटल तक की यह छह मील की यात्रा जिसे पूरा करने में आज दिन में पहले 20 मिनट लगे थे उसमें तीन से ज़्यादा घंटे लग गए।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "छह मील", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 33, - "End": 38 - } - ] - }, - { - "Input": "पूरे उद्योग में, इस देश का तेल उत्पादन इस साल के पहले आठ महीनों में घटकर 500,000 बैरल प्रतिदिन तक घट गया.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500,000 बैरल", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Volume unit", - "subtype": "Volume" - }, - "Start": 73, - "End": 84 - } - ] - }, - { - "Input": "यही है वो 1 ) बताता है कि क्यों हम वैसे हैं जैसे हम हैं बजाय बो जैकसन के ; 2 )चेतावनी देता है कि ऐसे जलाशय में भी डूबने की संभावना होती है जिसकी गहराई औसतन दो फ़ीट होती है; और 3 ) भविष्यवाणी करती है कि 10 , 000 पियानो के सामने 10 , 000 बंदर रखने से 1 , 118 प्रकाशन योग्य रॉक-एन-रॉल गाने बन सकते हैं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "दो फ़ीट", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 156, - "End": 161 - } - ] - }, - { - "Input": "मई 19 को , खाद्य प्रसंस्करण प्राधिकरण ने 68-आउंस वाले मशरूम के डब्बों को सीज करना शुरू दिया जब दिल्ली, चंडीढ़ और लखनऊ में 100 से ज़्यादा लोग इस प्रदूषित मशरूम के खाने बीमार पर गए।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "68-आउंस", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Ounce", - "subtype": "Weight" - }, - "Start": 41, - "End": 47 - } - ] - }, - { - "Input": "श्री सिन्हा डींग हांकते हैं कि उन्होंने अपने सभी शेयर 13 अक्टूबर को बाजार के 190 अंक गिरने से पहले बेच दिए थे , और वह उन पैसों की मदद से एक 45-एकड़ की घोड़ों का फार्म खरीद रहे हैं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "45-एकड़", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Acre", - "subtype": "Area" - }, - "Start": 140, - "End": 145 - } - ] - }, - { - "Input": "फिर , इन छोटे बगीचों में जगह बनाने के लिए श्रीमती शर्मा ने आठ से 10 फीट ऊंची बिना खिड़की की (ईंट, मिट्टी और झाड़ियों से बनी) दीवार खड़ी कर दी , जिससे उनके घर का इंटीरियर लंबे छायादार क्षेत्र में बदल गया।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 फीट", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 65, - "End": 70 - } - ] - }, - { - "Input": "` ` प्रबंधन को कोई सरप्राइज़ नहीं चाहिए, ' ' पवन दुग्गल कहते हैं , जो , एयर इंडिया की इंधन सेवा के निदेशक के तौर पर , हर साल लगभग 2.4 बिलियन गैलन का जेट इंधन खरीदते हैं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2.4 बिलियन गैलन", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 129, - "End": 143 - } - ] - }, - { - "Input": "एक 10-गैलन का वाटर कूलर फर्श पर गिर गया , जिससे पूरा लाल कारपेट भीग गया।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10-गैलन", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 3, - "End": 9 - } - ] - }, - { - "Input": "पास ही, 1.5 मिलियन गैलन के खारे पानी वाले अक्वैरियम में छह डॉल्फ़िन अठखेलियां करेंगे।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1.5 मिलियन गैलन", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 8, - "End": 22 - } - ] - }, - { - "Input": "और यह बच्चा दो पाउंड से ज़्यादा है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "दो पाउंड", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 12, - "End": 19 - } - ] - }, - { - "Input": "``जो लोग खाते नहीं हैं उनपर मुझे विश्वास नहीं होता,'' श्रीमती शर्मा ने कहा, हालांकि उन्होंने खुद कुछ साल पहले लंच खाना बंद कर अपना वजन 25 पाउंड कम किया है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "25 पाउंड", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 135, - "End": 142 - } - ] - }, - { - "Input": "रॉयल डच की एक सहयोगी / सहभागी कंपनी, शेल को 0.9 ट्रिलियन क्यूबिक फीट निर्यात करने की अनुमति दी जाएगी, और गल्फ़ , ओलंपिया और यॉर्क डेवलपमेंट लि. की एक एक इकाई, को निर्यात की अनुमति दी जाएगी", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "0.9 ट्रिलियन क्यूबिक फीट", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "unit": "Cubic foot", - "subtype": "Volume" - }, - "Start": 44, - "End": 67 - } - ] - }, - { - "Input": "वर्तमान में तैयार किए गए बिलों के मुख्य बिंदु हैं: - - एक परिवार कितने जमीन का मालिक हो सकता है उस पर एक प्रतिबंध , देश के छह सबसे बड़े शहरों में 660 वर्ग मीटर में, लेकिन छोटे शहरों और ग्रामीण इलाकों में उससे ज़्यादा।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "660 वर्ग मीटर", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 146, - "End": 158 - } - ] - }, - { - "Input": "टिग्रियन आर्मी अब अदीस अबाबा से 200 मील उत्तर में है, जिससे शहर को नुकसान का खतरा है , जिससे श्री महेंद्र की पोर्ट असब की संपत्ति को खतरा है , जिसके माध्यम से सभी ईंधन और अन्य आपूर्ति एडिस अबाबा तक पहुंचती हैं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 मील", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 32, - "End": 38 - } - ] - }, - { - "Input": "उन्होंने कहा कि उनमें से एक कंप्यूटर फर्श पर फिसल कर तीन फीट आगे तक चली गई।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "तीन फीट", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 53, - "End": 59 - } - ] - }, - { - "Input": "इसके होल्डिंग्स का मूल मारकुंची जिले में 190,000 वर्ग मीटर की अविश्वसनीय रूप से महंगी संपत्ति है, जो टोकियो का व्यापार और वित्तीय केंद्र में है, जिसे अक्सर मजाक में `` मित्सुबिशी गांव कहा जाता है। ''", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "190,000 वर्ग मीटर", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 41, - "End": 57 - } - ] - }, - { - "Input": "उपग्रह, अंतर्राष्ट्रीय दूरसंचार उपग्रह संगठन के लिए ह्यूस द्वारा निर्मित, 1982 में ह्यूस को तीन टन के पांच उपग्रहों को विकसित करने के लिए $ 700 मिलियन के अनुबंध का हिस्सा है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "तीन टन", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 92, - "End": 97 - } - ] - }, - { - "Input": "जैविक हथियारों पर 1996 की रिपोर्ट में, सामरिक और अंतर्राष्ट्रीय अध्ययन केंद्र, वॉशिंगटन में एक सार्वजनिक नीति अनुसंधान संस्थान, ने चेतावनी दी कि - संभावी अतंकवादियों के लिए जैविक हथियारों को इकट्ठा करना आसान था _ 130 गैलन की क्षमता वाले वाणिज्यिक उपकरणों का उपयोग करना।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "130 गैलन", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 213, - "End": 220 - } - ] - }, - { - "Input": "वाणिज्य विभाग के डेटा के व्यापार समूह के संकलन से पता चला है कि वर्ष का दूसरा सबसे बड़ा मासिक कुल संवर्धित आयात, जुलाई के 1,458,000 टन से 5% ऊपर था, लेकिन पिछले साल 1988 के जून में उच्च स्तर से नीचे था।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1,458,000 टन", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 122, - "End": 133 - } - ] - }, - { - "Input": "क्रमांक 1 पर, सिंह ने 9 - आइरन के एक प्याले को छह फीट कप के भीतर मारा।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "छह फीट", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 47, - "End": 52 - } - ] - }, - { - "Input": "इसलिए जब अगले साल की गेहूं की फसल मार्च में काटी जाएगी, तो यह पिछले कुछ सालों के 16,000 मीट्रिक टन से भी कम हो सकती है - - गेहूं बूम के शिखर पर।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "16,000 मीट्रिक टन", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Metric ton", - "subtype": "Weight" - }, - "Start": 81, - "End": 97 - } - ] - }, - { - "Input": "486 इंटेल चिप्स की एक लंबी श्रृंखला का वंशज है जो आईबीएम के अपने पहले निजी कंप्यूटर के लिए 16-बिट 8088 चिप को चुनने के बाद से बाजार पर हावी होना शुरू हो गया।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "16-बिट", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "Bit", - "subtype": "Information" - }, - "Start": 91, - "End": 96 - } - ] - }, - { - "Input": "कंपनी के एक प्रवक्ता ने कहा कि ` ` जिओतो केस्पिता '' 188 मील प्रति घंटे से अधिक की रफ्तार से चल सकती है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "188 मील प्रति घंटे", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Mile per hour", - "subtype": "Speed" - }, - "Start": 53, - "End": 70 - } - ] - }, - { - "Input": "नौसेना ने एक मोबाइल ऑपरेटिंग रूम से सिर्फ 100 मीटर की दूरी पर एक हेलिकॉप्टर लैंडिंग जोन की स्थापना की है, जो बगदाद के बाहरी इलाके में है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 मीटर", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Meter", - "subtype": "Length" - }, - "Start": 42, - "End": 49 - } - ] - }, - { - "Input": "कैल्ट्रान मेमोरियल कॉलेज़ियम के पास, लॉस एंजिल्स के दक्षिण में बंदरगाह फ्रीवे के 2.5 मील की दूरी के बीच बसों और कार पूल के लिए एक दूसरे डेक को जोड़ने की योजना है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2.5 मील", - "TypeName": "dimension", - "Resolution": { - "value": "2.5", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 80, - "End": 86 - } - ] - }, - { - "Input": "प्रत्येक सुबह अपने फार्महाउस के चार-मील लंबे रास्ते पर, मैं चार और खाली घरों से होकर गुजरता हूं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "चार-मील", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 32, - "End": 38 - } - ] - }, - { - "Input": "बुखारेस्ट से लगभग 325 किलोमीटर उत्तर पश्चिम, ग्रीक कैथोलिक मुख्यालय के लांगा ने कहा कि हम अपमानित हैं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "325 किलोमीटर", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 18, - "End": 29 - } - ] - }, - { - "Input": "रोटिच एक छोटा (5 फीट", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5 फीट", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 15, - "End": 19 - } - ] - }, - { - "Input": "4 इंच) 28 - वर्षीय जो तीन साल पहले तक गंभीरता से दौड़ना शुरू नहीं किया था और इस महीने तक इनडोर प्रतिस्पर्धा नहीं की थी।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "4 इंच", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Inch", - "subtype": "Length" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "शकोपी में रेसवे पार्क (मिनेसोटा) एक 1/4 मील का पक्का ओवल है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1/4 मील", - "TypeName": "dimension", - "Resolution": { - "value": "0.25", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 36, - "End": 42 - } - ] - }, - { - "Input": "कैसलक्रैग पर्वत, मोट लेक के दक्षिण में स्थित है, जो एक ही रिज लाइन के साथ माउंट फ्रिंक के 1.6 किमी पश्चिम में है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1.6 किमी", - "TypeName": "dimension", - "Resolution": { - "value": "1.6", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 90, - "End": 97 - } - ] - }, - { - "Input": "जावड़ी की पहाडि़यां अंबर से लगभग 17 किमी दूर स्थित हैं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "17 किमी", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 33, - "End": 39 - } - ] - }, - { - "Input": "दो घंटे तक लेक मिशिगन के प्रदर्शन स्थल के पास घूमने के बाद, कमांडर रमेश गुलाटी ने मंगलोर में पास के कर्टिस - राइट हवाई अड्डे पर 776 फुट हवाई जहाज उतारा।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "776 फुट", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 128, - "End": 134 - } - ] - }, - { - "Input": "राजमार्ग 35 और राजमार्ग 115 से लिंडसे और पीटरबरो (निकास 436) के साथ इंटरचेंज 500 मीटर पूर्व बेनेट रोड पर स्थित है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500 मीटर", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Meter", - "subtype": "Length" - }, - "Start": 77, - "End": 84 - } - ] - }, - { - "Input": "1995 में कैनन ने आंतरिक छवि स्थिरीकरण के साथ पहला व्यावसायिक रूप से उपलब्ध एसएलआर लेंस, 75-300 मिमी एफ / 4 - 5 पेश किया। 6 usm है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "300 मिमी", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Millimeter", - "subtype": "Length" - }, - "Start": 91, - "End": 98 - } - ] - }, - { - "Input": "डेगनहम के स्टर्लिंग आर्मामेंट, एसेक्स ने एक रूपांतरण किट का उत्पादन किया जिसमें वाणिज्यिक बिक्री के लिए एक नया 7.62 मिमी बैरल, पत्रिका, एक्सट्रैक्टर और बेदखलदार शामिल थे।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "7.62 मिमी", - "TypeName": "dimension", - "Resolution": { - "value": "7.62", - "unit": "Millimeter", - "subtype": "Length" - }, - "Start": 111, - "End": 119 - } - ] - }, - { - "Input": "परियोजना की लागत $ 46 .8 मिलियन है, और एक वर्ष में कंपनी की उत्पादन क्षमता 25% से बढ़ाकर 34,500 मीट्रिक टन तांबे के कैथोड करने का इरादा है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "34,500 मीट्रिक टन", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Metric ton", - "subtype": "Weight" - }, - "Start": 89, - "End": 105 - } - ] - }, - { - "Input": "अक्तूबर 7 को खत्म होने वाले सप्ताह में कैनेडियन स्टील - इंगॉट का कुल 291,890 मीट्रिक टन था , जो कि पिछले हफ्ते के कुल उत्पादन से 14 . 8% अधिक थी , एक संघीय एजेंसी, सांख्यिकी कनाडा, ने कहा।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "291,890 मीट्रिक टन", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Metric ton", - "subtype": "Weight" - }, - "Start": 69, - "End": 86 - } - ] - }, - { - "Input": "फ्लोरिडा के पैंथर 190 वर्ग किमी के बीच घर की सीमाओं में रहते हैं।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "190 वर्ग किमी", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Square kilometer", - "subtype": "Area" - }, - "Start": 18, - "End": 30 - } - ] - }, - { - "Input": "एक मीट्रिक टन 2,204.62 पाउंड के बराबर है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "एक मीट्रिक टन", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Metric ton", - "subtype": "Weight" - }, - "Start": 0, - "End": 12 - }, - { - "Text": "2,204.62 पाउंड", - "TypeName": "dimension", - "Resolution": { - "value": "2204.62", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 14, - "End": 27 - } - ] - }, - { - "Input": "मैं एक आदमी हूँ।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "उन्हें तुरंत एक डीएम भेजें और उनका ईमेल पता पूछें", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "1 मी 10 डेसीमीटर के बराबर है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1 मी", - "Start": 0, - "End": 3, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - }, - { - "Text": "10 डेसीमीटर", - "Start": 5, - "End": 15, - "TypeName": "dimension", - "Resolution": { - "unit": "Decimeter", - "subtype": "Length", - "value": "10" - } - } - ] - }, - { - "Input": "इस फ़ाइल का आकार 100 एमबी है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 एमबी", - "TypeName": "dimension", - "Resolution": { - "unit": "Megabyte", - "subtype": "Information", - "value": "100" - }, - "Start": 17, - "End": 24 - } - ] - }, - { - "Input": "मैं आपको 2:00 बजे एक सरप्राइज दूंगा", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "उन्होंने कहा: 2 पीएम 2 पिकोमीटर है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2 पीएम", - "Start": 14, - "End": 19, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "subtype": "Length", - "value": "2" - } - }, - { - "Text": "2 पिकोमीटर", - "Start": 21, - "End": 30, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "subtype": "Length", - "value": "2" - } - } - ] - }, - { - "Input": "वह एक मील दे सकता है।", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "एक मील", - "Start": 3, - "End": 8, - "TypeName": "dimension", - "Resolution": { - "unit": "Mile", - "subtype": "Length", - "value": "1" - } - } - ] - }, - { - "Input": "मैं थक गया हूँ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Hindi/TemperatureModel.json b/Specs/NumberWithUnit/Hindi/TemperatureModel.json deleted file mode 100644 index 9c500290bb..0000000000 --- a/Specs/NumberWithUnit/Hindi/TemperatureModel.json +++ /dev/null @@ -1,875 +0,0 @@ -[ - { - "Input": "बाहर का तापमान 40 डिग्री सेल्सियस है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "40 डिग्री सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 15, - "End": 32 - } - ] - }, - { - "Input": "टेक्सास में 90 फ़ॉरेनहाइट चल रहा है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "90 फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 12, - "End": 23 - } - ] - }, - { - "Input": "-5 डिग्री फ़ॉरेनहाइट", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "-5 डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "6 डिग्री से.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "6 डिग्री से.", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "98.6 डिग्री फ़ॉ. सामान्य तापमान होता है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "98.6 डिग्री फ़ॉ.", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "टेंपरेचर को 30 डिग्री सेल्सियस सेट करें", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "30 डिग्री सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 12, - "End": 29 - } - ] - }, - { - "Input": "सामान्य तापमान 98.6 डिग्री फ़ॉरेनहाइट होता है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "98.6 डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 15, - "End": 35 - } - ] - }, - { - "Input": "100 डिग्री फ़ॉ.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 डिग्री फ़ॉ.", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "20 डिग्री से.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20 डिग्री से.", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "100.2 डिग्री फ़ॉरेनहाइट कम होता है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100.2 डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "100.2", - "unit": "F" - }, - "Start": 0, - "End": 21 - } - ] - }, - { - "Input": "10.5 सेल्सियस", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10.5 सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "10.5", - "unit": "C" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "20 डिग्री सेल्सियस", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20 डिग्री सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 17 - } - ] - }, - { - "Input": "20.3 सेल्सियस", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20.3 सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "20.3", - "unit": "C" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "34.5 सेल्सियस", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "34.5 सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "34.5", - "unit": "C" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "बाहर का तामपना 98 डिग्री है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "98 डिग्री", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degree" - }, - "Start": 15, - "End": 23 - } - ] - }, - { - "Input": "थर्मोस्टैट को 85° पर सेट कीजिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "85°", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 14, - "End": 16 - } - ] - }, - { - "Input": "तापमान को 5 डिग्री से बढ़ाइए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5 डिग्री", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 10, - "End": 17 - } - ] - }, - { - "Input": "तापमान को 70 डिग्री फ़ॉ. सेट करिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "70 डिग्री फ़ॉ.", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 10, - "End": 22 - } - ] - }, - { - "Input": "तापमान 20 डिग्री बढ़ाएं", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20 डिग्री", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degree" - }, - "Start": 7, - "End": 15 - } - ] - }, - { - "Input": "तापमान को 100 डिग्री पर सेट कीजिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 डिग्री", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 10, - "End": 19 - } - ] - }, - { - "Input": "तापमान को 75 डिग्री फ़ॉ. रखिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "75 डिग्री फ़ॉ.", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 10, - "End": 22 - } - ] - }, - { - "Input": "तापमान को 40 सेल्सियस पर रहने दीजिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "40 सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 10, - "End": 20 - } - ] - }, - { - "Input": "तापमान को 50 डि. पर रहने दीजिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50 डि.", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degree" - }, - "Start": 10, - "End": 15 - } - ] - }, - { - "Input": "10 सेल्सियस को फ़ॉरेनहाइट में बदलिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 0, - "End": 10 - }, - { - "Text": "फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 15, - "End": 23 - } - ] - }, - { - "Input": "34.9 सेंटिग्रेड से फ़ॉरेनहाइट", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "34.9 सेंटिग्रेड", - "TypeName": "temperature", - "Resolution": { - "value": "34.9", - "unit": "C" - }, - "Start": 0, - "End": 14 - }, - { - "Text": "फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 19, - "End": 27 - } - ] - }, - { - "Input": "200 सेल्सियस सेल्सियस को फ़ॉरेनहाइट में बदलिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 0, - "End": 11 - }, - { - "Text": "सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 13, - "End": 20 - }, - { - "Text": "फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 25, - "End": 33 - } - ] - }, - { - "Input": "फ़ॉरेनहाइट से सेल्सियस 101 फ़ॉरेनहाइट कितना सेल्सियस होता है", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "101 फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - }, - "Start": 22, - "End": 34 - }, - { - "Text": "फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 8 - }, - { - "Text": "सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 13, - "End": 20 - }, - { - "Text": "सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 42, - "End": 49 - } - ] - }, - { - "Input": "50 डिग्री सेल्सियस सेल्सियस से फ़ॉरेनहाइट", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50 डिग्री सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - }, - "Start": 0, - "End": 17 - }, - { - "Text": "सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 19, - "End": 26 - }, - { - "Text": "फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 31, - "End": 39 - } - ] - }, - { - "Input": "क्या आप 51 फ़ॉरेनहाइट को डिग्री सेल्सियस में बदल सकते हैं", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "51 फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 8, - "End": 19 - }, - { - "Text": "डिग्री सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 24, - "End": 38 - } - ] - }, - { - "Input": "106 डिग्री फ़ॉरेनहाइट को डिग्री सेल्सियस में बदलिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "106 डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 0, - "End": 19 - }, - { - "Text": "डिग्री सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 24, - "End": 38 - } - ] - }, - { - "Input": "45 डिग्री फ़ॉरेनहाइट को सेल्सियस में बदलिए", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "45 डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "F" - }, - "Start": 0, - "End": 18 - }, - { - "Text": "सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 23, - "End": 30 - } - ] - }, - { - "Input": "कैसे कनवर्ट करें - 20 डिग्री फ़ॉरेनहाइट से सेल्सियस", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "- 20 डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 17, - "End": 37 - }, - { - "Text": "सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 42, - "End": 49 - } - ] - }, - { - "Input": "कार में ठंडी ज़्यादा है, कूलिंग बढ़ाकर कर 24 डिग्री से. पर कर दो.", - "Comment": "Codemixing", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "24 डिग्री से.", - "TypeName": "temperature", - "Resolution": { - "value": "24", - "unit": "C" - }, - "Start": 40, - "End": 52 - } - ] - }, - { - "Input": "एसी के टेंपरेचर को मिनिमम 24 डिग्री से. पर ही रखना चाहिए.", - "Comment": "Codemixing", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "24 डिग्री से.", - "TypeName": "temperature", - "Resolution": { - "value": "24", - "unit": "C" - }, - "Start": 26, - "End": 38 - } - ] - }, - { - "Input": "दिल्ली का temperature तो अब 49 डिग्री तक पहुंच चुका है.", - "Comment": "Codemixing", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "49 डिग्री", - "TypeName": "temperature", - "Resolution": { - "value": "49", - "unit": "Degree" - }, - "Start": 28, - "End": 36 - } - ] - }, - { - "Input": "50 degree celsius का मतलब कितना फ़ॉरेनहाइट होता है?", - "Comment": "Codemixing", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50 degree celsius", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - }, - "Start": 0, - "End": 16 - }, - { - "Text": "फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 32, - "End": 40 - } - ] - }, - { - "Input": "-५ डिग्री फ़ॉरेनहाइट", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "-५ डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "६ डिग्री से.", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "६ डिग्री से.", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "९८.६ डिग्री फ़ॉ. सामान्य तापमान होता है", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "९८.६ डिग्री फ़ॉ.", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "टेंपरेचर को ३० डिग्री सेल्सियस सेट कर", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "३० डिग्री सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 12, - "End": 29 - } - ] - }, - { - "Input": "सामान्य तापमान ९८.६ डिग्री फ़ॉरेनहाइट होता है", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "९८.६ डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 15, - "End": 35 - } - ] - }, - { - "Input": "१०० डिग्री फ़ॉ.", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "१०० डिग्री फ़ॉ.", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "२० डिग्री से.", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "२० डिग्री से.", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "१००.२ डिग्री फ़ॉरेनहाइट कम होता ह", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "१००.२ डिग्री फ़ॉरेनहाइट", - "TypeName": "temperature", - "Resolution": { - "value": "100.2", - "unit": "F" - }, - "Start": 0, - "End": 21 - } - ] - }, - { - "Input": "१०.५ सेल्सियस", - "NotSupportedByDesign": "javascript,python,java", - "Comment": "Devanagari Script", - "Results": [ - { - "Text": "१०.५ सेल्सियस", - "TypeName": "temperature", - "Resolution": { - "value": "10.5", - "unit": "C" - }, - "Start": 0, - "End": 12 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Italian/AgeModel.json b/Specs/NumberWithUnit/Italian/AgeModel.json deleted file mode 100644 index 9fdc4299b7..0000000000 --- a/Specs/NumberWithUnit/Italian/AgeModel.json +++ /dev/null @@ -1,244 +0,0 @@ -[ - { - "Input": "Quando aveva cinque anni, imparò ad andare in bicicletta.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "cinque anni", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Anno" - }, - "Start": 13, - "End": 23 - } - ] - }, - { - "Input": "Questa saga è vecchia dieci anni.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "dieci anni", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Anno" - }, - "Start": 22, - "End": 31 - } - ] - }, - { - "Input": "Ho solo 29 anni!", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "29 anni", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Anno" - }, - "Start": 8, - "End": 14 - } - ] - }, - { - "Input": "Adesso, dopo novantacinque anni di età, le prospettive cambiano.", - "NotSupported": "dotnet", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "novantacinque anni di età", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Anno" - }, - "Start": 13, - "End": 37 - } - ] - }, - { - "Input": "La Grande Muraglia cinese ha più di 500 anni e si estende per più di 5,000 miglia.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "500 anni", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Anno" - }, - "Start": 36, - "End": 43 - } - ] - }, - { - "Input": "Lei ha 60 anni; è nata l'8 maggio 1945.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "60 anni", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Anno" - }, - "Start": 7, - "End": 13 - } - ] - }, - { - "Input": "Il 25% dei casi non viene diagnosticato fino a circa 3 anni di età.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "3 anni di età", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Anno" - }, - "Start": 53, - "End": 65 - } - ] - }, - { - "Input": "Quando ci sarà la pressione di adempiere ad una promessa che ha un anno?", - "NotSupported": "dotnet", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "un anno", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Anno" - }, - "Start": 64, - "End": 70 - } - ] - }, - { - "Input": "è successo quando il bambino aveva solo dieci mesi.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "dieci mesi", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Mese" - }, - "Start": 40, - "End": 49 - } - ] - }, - { - "Input": "La proposta del comitato ha 8 mesi.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "8 mesi", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Mese" - }, - "Start": 28, - "End": 33 - } - ] - }, - { - "Input": "Approssimativamente il 50% dei casi viene diagnosticato intorno ai diciotto mesi di età.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "diciotto mesi di età", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Mese" - }, - "Start": 67, - "End": 86 - } - ] - }, - { - "Input": "è possiblie, ma nel 2006 95% di loro erano più giovani di tre mesi.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "tre mesi", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Mese" - }, - "Start": 58, - "End": 65 - } - ] - }, - { - "Input": "Se andiamo avanti a Dicembre, avrà tre settimane.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "tre settimane", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Settimana" - }, - "Start": 35, - "End": 47 - } - ] - }, - { - "Input": "A 6 settimane di età, si può già festeggiare il Natale.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "6 settimane di età", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Settimana" - }, - "Start": 2, - "End": 19 - } - ] - }, - { - "Input": "Una bolletta delle utenze di 90 giorni è piuttosto tardi.", - "NotSupportedByDesign": "python, javascript, python", - "Results": [ - { - "Text": "90 giorni", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Giorno" - }, - "Start": 29, - "End": 37 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Italian/CurrencyModel.json b/Specs/NumberWithUnit/Italian/CurrencyModel.json index 6f3317bfac..28a579a494 100644 --- a/Specs/NumberWithUnit/Italian/CurrencyModel.json +++ b/Specs/NumberWithUnit/Italian/CurrencyModel.json @@ -1543,7 +1543,7 @@ }, { "Input": "costa solo 15 dollari e 15 centesimi.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "15 dollari e 15 centesimi", @@ -1559,7 +1559,7 @@ }, { "Input": "costa solo tredici euro e quarantacinque cent.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "tredici euro e quarantacinque cent", @@ -1575,7 +1575,7 @@ }, { "Input": "costa solo 15 dollari e 15.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "15 dollari e 15", @@ -1591,7 +1591,7 @@ }, { "Input": "costa solo 15 dollari 50.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "15 dollari 50", @@ -1689,5 +1689,37 @@ "End": 5 } ] + }, + { + "Input": "Ho bisogno di dollari 996", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "dollari 996", + "TypeName": "currency", + "Resolution": { + "value": "996", + "unit": "Dollar" + }, + "Start": 14, + "End": 24 + } + ] + }, + { + "Input": "dollari 4", + "NotSupported": "javascript, java", + "Results": [ + { + "Text": "dollari 4", + "TypeName": "currency", + "Resolution": { + "value": "4", + "unit": "Dollar" + }, + "Start": 0, + "End": 8 + } + ] } ] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Italian/DimensionModel.json b/Specs/NumberWithUnit/Italian/DimensionModel.json deleted file mode 100644 index b5c5efd7f7..0000000000 --- a/Specs/NumberWithUnit/Italian/DimensionModel.json +++ /dev/null @@ -1,900 +0,0 @@ -[ - { - "Input": "75ml", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Millilitro", - "subtype": "Volume" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "il suo più grande svantaggio potrebbe essere il suo spessore di 3 pollici , grande abbastanza da ocnsentire ad un consulente di descriverlo come ingombrante.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "3 pollici", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Pollice", - "subtype": "Length" - }, - "Start": 64, - "End": 72 - } - ] - }, - { - "Input": "un tornado ha attraversato un'area lunga circa dieci miglia , uccidendo almeno quattordici persone e trasformando decine di case in macerie.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "dieci miglia", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Miglio", - "subtype": "Length" - }, - "Start": 47, - "End": 58 - } - ] - }, - { - "Input": "ha preso molto di più di 10 1/2 miglia di cavo e filo per agganciale tutto , e 23 computer .", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "10 1/2 miglia", - "TypeName": "dimension", - "Resolution": { - "value": "10,5", - "unit": "Miglio", - "subtype": "Length" - }, - "Start": 25, - "End": 37 - } - ] - }, - { - "Input": "il viaggio di sei miglia al mio hotel in aeroporto che doveva prendere 20 minuti prima nella giornata ha preso più di tre ore.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "sei miglia", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Miglio", - "subtype": "Length" - }, - "Start": 14, - "End": 23 - } - ] - }, - { - "Input": "industrywide , la produzione di olio in questo paese è sceso di 500.000 barili al giorno rispetto ai barili nei primi otto mesi di quest'anno.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "500.000 barili", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Barile", - "subtype": "Volume" - }, - "Start": 64, - "End": 77 - } - ] - }, - { - "Input": "è quello che 1 ) spiega perchè noi siamo come , beh , noi stessi invece che bo jackson ; 2 ) avverte che è possibile affogare in un lago che è in media profondo due piedi ; e 3 ) prevede che 10 . 000 scimmie collocate prima di 10 . 000 pianoforti produrranno 1 . 118 brani pubblicabili di rock ' n ' roll.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "due piedi", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Piede", - "subtype": "Length" - }, - "Start": 161, - "End": 169 - } - ] - }, - { - "Input": "il 19 maggio, fda, ha iniziato a trattenere funghi cinesi il scatole da 68 once dopo che più di 100 persone in mississippi, new york e pennsylvania si sono ammalati mangiando funghi contaminati.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "68 once", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Oncia", - "subtype": "Weight" - }, - "Start": 72, - "End": 78 - } - ] - }, - { - "Input": "mr . hulings si compiace che ha venduto tutte le sue azioni una settimana prima che il mercato crollasse di 190 punti il 13 ottobre , e sta usando i soldi per comprare un maneggio di 45 acri.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "45 acri", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Acro", - "subtype": "Area" - }, - "Start": 183, - "End": 189 - } - ] - }, - { - "Input": "quindi, per far diventare questo gardenettes letteralmente una stanza, ha abbattuto muri senza finestre (mattone, lattice, siepe) alti da otto a 10 piedi, proiettando i suoi interni in sfumature di un lungo giorno stigio.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "10 piedi", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Piede", - "subtype": "Length" - }, - "Start": 145, - "End": 152 - } - ] - }, - { - "Input": "` ` l'amministrazione non vuole sorprese, ' ' osserva jack zaves , che , come direttore dei servizi di carburante delle compagnie aeree americane, compra circa 2,4 miliardi di galloni di carburante per aerei all'anno.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "2,4 miliardi di galloni", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Gallone", - "subtype": "Volume" - }, - "Start": 160, - "End": 182 - } - ] - }, - { - "Input": "un raffredatore di acqua da 10 galloni si è rovesciato sul pavimento , bagnando il tappeto rosso.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "10 galloni", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Gallone", - "subtype": "Volume" - }, - "Start": 28, - "End": 37 - } - ] - }, - { - "Input": "nelle vicinanze, sei delfini salteranno in un acquario da 1,5 milioni di galloni di acqua salata.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "1,5 milioni di galloni", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Gallone", - "subtype": "Volume" - }, - "Start": 58, - "End": 79 - } - ] - }, - { - "Input": "e questo bambino è più di due libbre.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "due libbre", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Libbra", - "subtype": "Weight" - }, - "Start": 26, - "End": 35 - } - ] - }, - { - "Input": "``non mi fido delle persone che non mangiano,'' ha detto ms. volokh, anche se lei stessa ha smesso di mangiare qualche anno fa per perdere 25 libbre.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "25 libbre", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Libbra", - "subtype": "Weight" - }, - "Start": 139, - "End": 147 - } - ] - }, - { - "Input": "shell , una filiale di royal dutch / shell group , gli sarà concesso di esportare 0,9 trilioni di piedi cubi , e gulf , una unità di olympia & york developments ltd. gli sarà concesso di esportare", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "0,9 trilioni di piedi cubi", - "TypeName": "dimension", - "Resolution": { - "value": "9E+17", - "unit": "Piede cubo", - "subtype": "Volume" - }, - "Start": 82, - "End": 107 - } - ] - }, - { - "Input": "i punti salienti del documento, come attualmente inquadrati , sono: - - una restrizione sulla quantità di beni immobili che una famiglia può possedere , a 660 metri quadri nelle sei città più grandi della nazione , ma di più nelle città più piccole e nelle aree rurali.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "660 metri quadri", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Metro quadrato", - "subtype": "Area" - }, - "Start": 155, - "End": 170 - } - ] - }, - { - "Input": "gli eserciti di tigrea sono ora 200 miglia a nord di addis ababa , minacciando la cittè di dese , che taglierebbe fuori il capitale di mr . mengistu ' s dal porto di assab , grazie al quale tutto il combustibile e e le altre forniture raggiungono addis ababa.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "200 miglia", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Miglio", - "subtype": "Length" - }, - "Start": 32, - "End": 41 - } - ] - }, - { - "Input": "ha detto che uno dei computer ha intrapreso un viaggio di tre piedi scivolando sul pavimento.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "tre piedi", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Piede", - "subtype": "Length" - }, - "Start": 58, - "End": 66 - } - ] - }, - { - "Input": "il cuore delle sue partecipazioni è 190.000 metri quadri di proprietà incredibilmente costose nel distretto marunouchi , il centro finanziario ed economico di tokyo , spesso chiamato scherzosamente` ` mitsubishi village. ' '", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "190.000 metri quadri", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Metro quadrato", - "subtype": "Area" - }, - "Start": 36, - "End": 55 - } - ] - }, - { - "Input": "il satellite, costruito da hughes per la international telecommunications satellite organization , è parte di un contratto da $ 700 milioni conferiti a hughes nel 1982 per sviluppare cinque satelliti da tre tonnellate.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "tre tonnellate", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Tonnellata", - "subtype": "Weight" - }, - "Start": 203, - "End": 216 - } - ] - }, - { - "Input": "in un rapporto del 1996 sulle armi biologiche, il centro per gli studi strategici e internazionali, un istituto di ricerca di politica pubblica a washington , avvisano che era molto facile per aspiranti terroristi assemblare armi biologiche _ usando attrezzatura commerciale con una capacità di 130 galloni.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "130 galloni", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Gallone", - "subtype": "Volume" - }, - "Start": 296, - "End": 306 - } - ] - }, - { - "Input": "la raccolta dei dati del dipartimento del commercio del gruppo ha mostrato le importazioni agosto , il secondo totale mensile più grande dell'anno, era sopra del 5 % dalle 1.458.000 tonnellate di luglio ma al di sotto del massimo dell'anno scorso, nel giugno 1988.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "1.458.000 tonnellate", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Tonnellata", - "subtype": "Weight" - }, - "Start": 172, - "End": 191 - } - ] - }, - { - "Input": "al n . 1 , singh ha colpito un ferro 9 lanciando a meno di sei piedi dalla coppa.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "sei piedi", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Piede", - "subtype": "Length" - }, - "Start": 59, - "End": 67 - } - ] - }, - { - "Input": "così quando il raccolto di psyllium del prossimo anno viene raccolto a marzo , forse sarà più piccolo delle 16.000 tonnellate dei cinque anni scorsi - - proprio sulla cresta del boom del pysllium.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "16.000 tonnellate", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Tonnellata", - "subtype": "Weight" - }, - "Start": 108, - "End": 124 - } - ] - }, - { - "Input": "il 486 è il discendente di una lunga serie di chip intel che hanno iniziato a dominare il merceto da quando ibm utilizzò il chip a 16-bit 8088 pr i suoi primi personal computer.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "16-bit", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "Bit", - "subtype": "Information" - }, - "Start": 131, - "End": 136 - } - ] - }, - { - "Input": "Il 'jiotto caspita' può correre oltre i 188 miglia all'ora, disse un portavoce dell'azienda.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "188 miglia all'ora", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Miglia all'ora", - "subtype": "Speed" - }, - "Start": 40, - "End": 57 - } - ] - }, - { - "Input": "la marina ha allestito una zona di atterraggio per elicotteri a soli 100 metri da una sala operatoria mobile, proprio alla periferia di Baghdad.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "100 metri", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Metro", - "subtype": "Length" - }, - "Start": 69, - "End": 77 - } - ] - }, - { - "Input": "caltrans prevede di aggiungere un secondo ponte per autobus e parcheggi sopra la media di un tratto di 2,5 miglia dell'autostrada del porto appena a sud di Los Angeles, vicino al colosseo.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "2,5 miglia", - "TypeName": "dimension", - "Resolution": { - "value": "2,5", - "unit": "Miglio", - "subtype": "Length" - }, - "Start": 103, - "End": 112 - } - ] - }, - { - "Input": "sulla mia guida di quattro miglia al quartier generale della fattoria ogni mattina, guido da altre quattro case vuote.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "quattro miglia", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Miglio", - "subtype": "Length" - }, - "Start": 19, - "End": 32 - } - ] - }, - { - "Input": "siamo insultati, ha detto langa dal quartier generale greco cattolico, a circa 325 chilometri a nord-ovest di Bucarest.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "325 chilometri", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Chilometro", - "subtype": "Length" - }, - "Start": 79, - "End": 92 - } - ] - }, - { - "Input": "rotich è un piccolo ( 5 piedi", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "5 piedi", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Piede", - "subtype": "Length" - }, - "Start": 22, - "End": 28 - } - ] - }, - { - "Input": "4 pollici) 28enne che non ha iniziato a correre seriamente fino a tre anni fa e non ha gareggiato in casa fino a questo mese.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "4 pollici", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Pollice", - "subtype": "Length" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "raceway park (minnesota) a Shakopee è un ovale pavimentato di 1/4 di miglio.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "1/4 di miglio", - "TypeName": "dimension", - "Resolution": { - "value": "0,25", - "unit": "Miglio", - "subtype": "Length" - }, - "Start": 62, - "End": 74 - } - ] - }, - { - "Input": "La montagna di castlecrag si trova a sud del lago del fossato, a 1,6 km a ovest del monte frink lungo la stessa linea di cresta.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "1,6 km", - "TypeName": "dimension", - "Resolution": { - "value": "1,6", - "unit": "Chilometro", - "subtype": "Length" - }, - "Start": 65, - "End": 70 - } - ] - }, - { - "Input": "le colline di javadi si trovano a circa 17 km da ambur.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "17 km", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Chilometro", - "subtype": "Length" - }, - "Start": 40, - "End": 44 - } - ] - }, - { - "Input": "dopo aver circondato il lago Michigan in prossimità dell'esposizione per due ore, il comandante hugo eckener ha atterrato il dirigibile di 776 piedi nel vicino aeroporto di curtiss-wright a glenview.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "776 piedi", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Piede", - "subtype": "Length" - }, - "Start": 139, - "End": 147 - } - ] - }, - { - "Input": "lo svincolo con l'autostrada 35 e l'autostrada 115 per Lindsay e Peterborough (uscita 436) si trova a 500 metri ad est di Bennett Road.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "500 metri", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Metro", - "subtype": "Length" - }, - "Start": 102, - "End": 110 - } - ] - }, - { - "Input": "nel 1995 Canon ha introdotto il primo obiettivo SLR disponibile in commercio con stabilizzazione dell'immagine interna, ef 75-300mm f / 4-5.6 è usm.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "300mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Millimetro", - "subtype": "Length" - }, - "Start": 126, - "End": 130 - } - ] - }, - { - "Input": "Gli sterili armamenti di dagenham, essex produssero un kit di conversione comprendente un nuovo barilotto da 7,62 mm, un caricatore, un estrattore e un eiettore per la vendita commerciale.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "7,62 mm", - "TypeName": "dimension", - "Resolution": { - "value": "7,62", - "unit": "Millimetro", - "subtype": "Length" - }, - "Start": 109, - "End": 115 - } - ] - }, - { - "Input": "il progetto costa $ 46. 8 milioni, e ha lo scopo di aumentare la capacità produttiva dell'azienda del 25% a 34.500 tonnellate di catodo di rame all'anno.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "34.500 tonnellate", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Tonnellata", - "subtype": "Weight" - }, - "Start": 108, - "End": 124 - } - ] - }, - { - "Input": "acciaio canadese - la produzione di lingotti ha totalizzato 291.890 tonnellate nella settimana terminata il 7 ott., in aumento del 14. 8% dal totale della settimana precedente, ha detto statistiche canada, un'agenzia federale.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "291.890 tonnellate", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Tonnellata", - "subtype": "Weight" - }, - "Start": 60, - "End": 77 - } - ] - }, - { - "Input": "le pantere florida vivono in una gamma di case tra 190 km2.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "190 km2", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Chilometro quadrato", - "subtype": "Area" - }, - "Start": 51, - "End": 57 - } - ] - }, - { - "Input": "una tonnellata è pari a 2.204,62 libbre.", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "una tonnellata", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Tonnellata", - "subtype": "Weight" - }, - "Start": 0, - "End": 13 - }, - { - "Text": "2.204,62 libbre", - "TypeName": "dimension", - "Resolution": { - "value": "2204,62", - "unit": "Libbra", - "subtype": "Weight" - }, - "Start": 24, - "End": 38 - } - ] - }, - { - "Input": "l'amministrazione", - "NotSupported": "javascript, python, java", - "Results": [] - }, - { - "Input": "l ' autostrada", - "NotSupported": "javascript, python, java", - "Results": [] - }, - { - "Input": "Ci sono 20 l d'acqua qui.", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "20 l", - "Start": 8, - "End": 11, - "TypeName": "dimension", - "Resolution": { - "unit": "Litro", - "subtype": "Volume", - "value": "20" - } - } - ] - }, - { - "Input": "Ci sono 10l d'acqua qui.", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "10l", - "Start": 8, - "End": 10, - "TypeName": "dimension", - "Resolution": { - "unit": "Litro", - "subtype": "Volume", - "value": "10" - } - } - ] - }, - { - "Input": "ruotare di 90 gradi", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "90 gradi", - "Start": 11, - "End": 18, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "90" - } - } - ] - }, - { - "Input": "girare a sinistra di 45 gradi", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "45 gradi", - "Start": 21, - "End": 28, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "45" - } - } - ] - }, - { - "Input": "L'angolo è 0,8rad", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "0,8rad", - "Start": 11, - "End": 16, - "TypeName": "dimension", - "Resolution": { - "unit": "Radian", - "subtype": "Angle", - "value": "0,8" - } - } - ] - }, - { - "Input": "fare mezzo giro", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "mezzo giro", - "Start": 5, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "0,5" - } - } - ] - }, - { - "Input": "ruota di 3 giri", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "3 giri", - "Start": 9, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "3" - } - } - ] - }, - { - "Input": "la temperatura è di 24 gradi", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "L'acqua bolle a 100°C", - "NotSupported": "java, javascript, python", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Italian/TemperatureModel.json b/Specs/NumberWithUnit/Italian/TemperatureModel.json deleted file mode 100644 index 5c0d40d0ca..0000000000 --- a/Specs/NumberWithUnit/Italian/TemperatureModel.json +++ /dev/null @@ -1,634 +0,0 @@ -[ - { - "Input": "la temperatura esterna è di 40 gradi celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "40 gradi celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 28, - "End": 43 - } - ] - }, - { - "Input": "In texas ci sono 90 fahrenheit", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "90 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 17, - "End": 29 - } - ] - }, - { - "Input": "-5 gradi fahrenheit", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "-5 gradi fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "6 gradi celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "6 gradi celsius", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "98,6 gradi f è una temperatura normale", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "98,6 gradi f", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "imposta la temperatura a 30 gradi celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "30 gradi celsius", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 25, - "End": 40 - } - ] - }, - { - "Input": "normalmente la temperatura è di 98,6 gradi fahrenheit", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "98,6 gradi fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 32, - "End": 52 - } - ] - }, - { - "Input": "100 gradi f", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "100 gradi f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "20 gradi c", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "20 gradi c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "100,2 gradi farenheit sono pochi", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "100,2 gradi farenheit", - "TypeName": "temperature", - "Resolution": { - "value": "100,2", - "unit": "F" - }, - "Start": 0, - "End": 20 - } - ] - }, - { - "Input": "10,5 celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "10,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10,5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 gradi celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "20 gradi celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 15 - } - ] - }, - { - "Input": "20,3 celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "20,3 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20,3", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "34,5 celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "34,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "34,5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "la temperatura esterna è di 98 gradi", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "98 gradi", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degree" - }, - "Start": 28, - "End": 35 - } - ] - }, - { - "Input": "imposta il termostato a 85°", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "85°", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 24, - "End": 26 - } - ] - }, - { - "Input": "alza la temperatura di 5 gradi", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "5 gradi", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 23, - "End": 29 - } - ] - }, - { - "Input": "imposta la temperatura a 70 gradi f", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "70 gradi f", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 25, - "End": 34 - } - ] - }, - { - "Input": "alza la temperatura di 20 gradi", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "20 gradi", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degree" - }, - "Start": 23, - "End": 30 - } - ] - }, - { - "Input": "imposta la temperatura a 100 gradi", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "100 gradi", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 25, - "End": 33 - } - ] - }, - { - "Input": "mantieni la temperatura a 75 gradi f", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "75 gradi f", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 26, - "End": 35 - } - ] - }, - { - "Input": "let the temperatura be at 40 celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "40 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 26, - "End": 35 - } - ] - }, - { - "Input": "lascia la temperatura a 50 gradi", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "50 gradi", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degree" - }, - "Start": 24, - "End": 31 - } - ] - }, - { - "Input": "converti 10 celsius in fahrenheit", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "10 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 9, - "End": 18 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 23, - "End": 32 - } - ] - }, - { - "Input": "34,9 centigradi in farenheit", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "34,9 centigradi", - "TypeName": "temperature", - "Resolution": { - "value": "34,9", - "unit": "C" - }, - "Start": 0, - "End": 14 - }, - { - "Text": "farenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 19, - "End": 27 - } - ] - }, - { - "Input": "converti 200 celsius celsius in fahrenheit", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "200 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - } - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - } - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - } - } - ] - }, - { - "Input": "fahrenheit in celsius 101 fahrenheit è troppo celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "101 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - } - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - } - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - } - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - } - } - ] - }, - { - "Input": "50 gradi celsius celsius in fahrenheit", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "50 gradi celsius", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - } - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - } - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - } - } - ] - }, - { - "Input": "puoi convertire 51 fahrenheit in gradi celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "51 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 16, - "End": 28 - }, - { - "Text": "gradi celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 33, - "End": 45 - } - ] - }, - { - "Input": "converti 106 gradi fahrenheit in gradi celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "106 gradi fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 9, - "End": 28 - }, - { - "Text": "gradi celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 33, - "End": 45 - } - ] - }, - { - "Input": "converti 45 gradi fahrenheit in celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "45 gradi fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "F" - }, - "Start": 9, - "End": 27 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 32, - "End": 38 - } - ] - }, - { - "Input": "come convertire - 20 gradi fahrenheit in celsius", - "NotSupportedByDesign": "python,javascript,python", - "Results": [ - { - "Text": "- 20 gradi fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 16, - "End": 36 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 41, - "End": 47 - } - ] - }, - { - "Input": "girare un angolo di 45 gradi", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "Ruota di 90°", - "NotSupported": "java, javascript, python", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Japanese/AgeModel.json b/Specs/NumberWithUnit/Japanese/AgeModel.json deleted file mode 100644 index 32c4ed22b6..0000000000 --- a/Specs/NumberWithUnit/Japanese/AgeModel.json +++ /dev/null @@ -1,279 +0,0 @@ -[ - { - "Input": "私は29歳です。", - "NotSupported": "python", - "Results": [ - { - "Text": "29歳", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 2, - "End": 4 - } - ] - }, - { - "Input": "これは、赤ちゃんがわずか10ヶ月だったときに起こった", - "NotSupported": "python", - "Results": [ - { - "Text": "10ヶ月", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 12, - "End": 15 - } - ] - }, - { - "Input": "12月初旬に生まれたのはすでに3週間です", - "NotSupported": "python", - "Results": [ - { - "Text": "3週間", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 15, - "End": 17 - } - ] - }, - { - "Input": "彼女は1945年5月8日に生まれ、現在60歳です。", - "NotSupported": "python", - "Results": [ - { - "Text": "60歳", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 19, - "End": 21 - } - ] - }, - { - "Input": "彼女はもう7歳になったので,小学校に行くことができた", - "NotSupported": "python", - "Results": [ - { - "Text": "7歳", - "TypeName": "age", - "Resolution": { - "value": "7", - "unit": "Year" - }, - "Start": 5, - "End": 6 - } - ] - }, - { - "Input": "90日齢の子供は病院に行って検査をするべきです", - "NotSupported": "python", - "Results": [ - { - "Text": "90日齢", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "70-90日齢の子は、テストのために病院に行く必要があります", - "NotSupported": "javascript, python", - "Results": [ - { - "Text": "90日齢", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 3, - "End": 6 - } - ] - }, - { - "Input": "完成に一〇年の歳月を要する", - "NotSupported": "python", - "Results": [] - }, - { - "Input": "12才", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12才", - "TypeName": "age", - "Resolution": { - "value": "12", - "unit": "Year" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "彼はもう生まれてから12週たったよ。", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "12週", - "TypeName": "age", - "Resolution": { - "value": "12", - "unit": "Week" - }, - "Start": 10, - "End": 12 - } - ] - }, - { - "Input": "彼女は5歳の時に、自転車を漕げるようになった。", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "5歳", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 3, - "End": 4 - } - ] - }, - { - "Input": "彼女は1945年5月8日生まれで、今は六十才だ。", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "六十才", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 19, - "End": 21 - } - ] - }, - { - "Input": "この事件はまだ赤ちゃんが10ヶ月の時に起きたことだ。", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "10ヶ月", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 12, - "End": 15 - } - ] - }, - { - "Input": "12月初生まれならば、もう三歳だね", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "三歳", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 13, - "End": 14 - } - ] - }, - { - "Input": "彼女はもう7歳になったから、小学校に行けるよ。", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "7歳", - "TypeName": "age", - "Resolution": { - "value": "7", - "unit": "Year" - }, - "Start": 5, - "End": 6 - } - ] - }, - { - "Input": "生まれて70日から九十日も立つ子供は病院へ検査しに行くべきだ。", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "九十日", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 9, - "End": 11 - } - ] - }, - { - "Input": "私はまだ29才だよ!", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "29才", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 4, - "End": 6 - } - ] - }, - { - "Input": "生まれて90日も立つ子供は病院へ検査しに行くべきだ。", - "NotSupported": "dotnet, javascript, python, java", - "Results": [ - { - "Text": "90日", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 4, - "End": 6 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Japanese/CurrencyModel.json b/Specs/NumberWithUnit/Japanese/CurrencyModel.json index 0956089ccc..22903d1ad6 100644 --- a/Specs/NumberWithUnit/Japanese/CurrencyModel.json +++ b/Specs/NumberWithUnit/Japanese/CurrencyModel.json @@ -1,7 +1,7 @@ [ { "Input": "今日の日経平均は2222円13銭です。", - "NotSupported": "python", + "Results": [ { "Text": "2222円13銭", @@ -18,12 +18,12 @@ }, { "Input": "次の停車駅は銭函", - "NotSupported": "python", + "Results": [] }, { "Input": "35億円", - "NotSupported": "python", + "Results": [ { "Text": "35億円", @@ -40,7 +40,7 @@ }, { "Input": "そのシュークリームは1個\\100です", - "NotSupported": "python", + "Results": [ { "Text": "\\100", @@ -62,7 +62,7 @@ }, { "Input": "1,280円", - "NotSupported": "python", + "Results": [ { "Text": "1,280円", @@ -79,7 +79,7 @@ }, { "Input": "その中で、四川の彩友の中で1注1000万人民元の基本的なトップ賞を得ました。", - "NotSupported": "python", + "Results": [ { "Text": "1000万人民元", @@ -96,7 +96,7 @@ }, { "Input": "今回の受賞終了後、賞池の金額が36.57億人民元に上った。", - "NotSupported": "python", + "Results": [ { "Text": "36.57億人民元", @@ -113,7 +113,7 @@ }, { "Input": "1ユーロでいいです。", - "NotSupported": "python", + "Results": [ { "Text": "1ユーロ", @@ -130,7 +130,7 @@ }, { "Input": "両替1.0753ドル", - "NotSupported": "python", + "Results": [ { "Text": "1.0753ドル", @@ -147,7 +147,7 @@ }, { "Input": "両替1.0092スイス・フラン", - "NotSupported": "python", + "Results": [ { "Text": "1.0092スイス・フラン", @@ -164,7 +164,7 @@ }, { "Input": "2016年は合併などで直接投資し、中国の資金は1200億ドルが流出した", - "NotSupported": "python", + "Results": [ { "Text": "1200億ドル", @@ -181,7 +181,7 @@ }, { "Input": "宝安科学技術会社は、国際精密な15人の株主と買収協議を締結し、1株当たり1.95香港ドルで", - "NotSupported": "python", + "Results": [ { "Text": "1.95香港ドル", @@ -198,7 +198,7 @@ }, { "Input": "中央銀行は期限切れの5306億ニュー台湾ドルを確定する", - "NotSupported": "python", + "Results": [ { "Text": "5306億ニュー台湾ドル", @@ -215,7 +215,7 @@ }, { "Input": "東芝はもう1万億円で取引銀行に融資を申請した", - "NotSupported": "python", + "Results": [ { "Text": "1万億円", @@ -232,7 +232,7 @@ }, { "Input": "445ナイラで両替する", - "NotSupported": "python", + "Results": [ { "Text": "445ナイラ", @@ -249,7 +249,7 @@ }, { "Input": "15ドル", - "NotSupported": "python", + "Results": [ { "Text": "15ドル", @@ -266,7 +266,7 @@ }, { "Input": "10ドル", - "NotSupported": "python", + "Results": [ { "Text": "10ドル", @@ -283,7 +283,7 @@ }, { "Input": "りんごが1ドル割引する", - "NotSupported": "python", + "Results": [ { "Text": "1ドル", @@ -300,7 +300,7 @@ }, { "Input": "このパソコンは2ドルです", - "NotSupported": "python", + "Results": [ { "Text": "2ドル", @@ -317,7 +317,7 @@ }, { "Input": "このパソコンは2ドル3セントです。", - "NotSupported": "python", + "Results": [ { "Text": "2ドル3セント", @@ -334,7 +334,7 @@ }, { "Input": "中国移動の年間収入は$ 48.2 万で、とてもすごいです", - "NotSupported": "python", + "Results": [ { "Text": "$ 48.2 万", @@ -350,7 +350,7 @@ }, { "Input": "中国移動の年間収入はus$ 48.2 万で、とてもすごいです", - "NotSupported": "python", + "Results": [ { "Text": "us$ 48.2 万", @@ -367,7 +367,7 @@ }, { "Input": "高田は毎日€ 1.5 かかります", - "NotSupported": "python", + "Results": [ { "Text": "€ 1.5", @@ -384,7 +384,7 @@ }, { "Input": "彼女がいた後、小山は毎月£ 512.5を多く支出しています。", - "NotSupported": "python", + "Results": [ { "Text": "£ 512.5", @@ -400,7 +400,7 @@ }, { "Input": "彼女がいた後、小山は毎月545パナマ・バルボアを多く支出しています。", - "NotSupported": "python", + "Results": [ { "Text": "545パナマ・バルボア", @@ -417,7 +417,7 @@ }, { "Input": "小山は毎月545ドルと5セントを多く支出しています。", - "NotSupported": "python", + "Results": [ { "Text": "545ドルと5セント", @@ -434,7 +434,7 @@ }, { "Input": "この本は5人民元と3角です", - "NotSupported": "python", + "Results": [ { "Text": "5人民元と3角", @@ -451,7 +451,7 @@ }, { "Input": "ドルはアメリカの通貨です。", - "NotSupported": "python", + "Results": [ { "Text": "ドル", @@ -468,7 +468,7 @@ }, { "Input": "ユーロはEU圏の通貨です。", - "NotSupported": "python", + "Results": [ { "Text": "ユーロ", @@ -485,7 +485,7 @@ }, { "Input": "この自転車は100ユーロと30です。", - "NotSupported": "python", + "Results": [ { "Text": "100ユーロと30", @@ -502,7 +502,7 @@ }, { "Input": "十ドル", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "十ドル", @@ -519,7 +519,7 @@ }, { "Input": "8億人民元", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "8億人民元", @@ -536,7 +536,7 @@ }, { "Input": "東芝の再編はもう一万億円が必要、取引銀行に借り入れを申請した。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "一万億円", @@ -553,7 +553,7 @@ }, { "Input": "その中で、四川省の彩民一口で一千万人民元の基本大賞あたりました。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "一千万人民元", @@ -570,7 +570,7 @@ }, { "Input": "1.0753ドルを交換します", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1.0753ドル", @@ -587,7 +587,7 @@ }, { "Input": "ある人が江蘇省に15人民元でロト引いてたら1600萬の大あたりました 賞金プールは36.57億人民元となってます", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "15人民元", @@ -615,7 +615,7 @@ }, { "Input": "このスマホケースはお前の5ドルと俺の三人民元かかります", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "5ドル", @@ -643,7 +643,7 @@ }, { "Input": "10円5銭", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "10円5銭", @@ -660,7 +660,7 @@ }, { "Input": "このパソコンは2ドル3セントとなってます", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2ドル3セント", @@ -678,7 +678,7 @@ { "Input": "人民元八千元", "Comment": "Currency does not support split units (e.g. '人民元30元')", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "人民元八千元", @@ -723,7 +723,7 @@ }, { "Input": "1.0092スイスフランを交換します", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1.0092スイスフラン", @@ -740,7 +740,7 @@ }, { "Input": "今回抽選後、賞金プールは36.57億人民元まで到達", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "36.57億人民元", @@ -757,7 +757,7 @@ }, { "Input": "中国人民銀行の5306億台湾ドルの預金証書が期限切れになりました", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "5306億台湾ドル", @@ -774,7 +774,7 @@ }, { "Input": "宝安テクノロジーはIPE GROUP LIMITEDの株主15人と買収契約をサインしました。一株あたり1.95香港ドル", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1.95香港ドル", @@ -791,7 +791,7 @@ }, { "Input": "千円あります", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "千円", @@ -808,7 +808,7 @@ }, { "Input": "このスマホケースは五元三角で大丈夫です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "五元三角", @@ -825,7 +825,7 @@ }, { "Input": "appleの割引一ドル", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "一ドル", @@ -842,7 +842,7 @@ }, { "Input": "人民元 米ドル", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "人民元", @@ -870,7 +870,7 @@ }, { "Input": "50元6角3分", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "50元6角3分", @@ -887,7 +887,7 @@ }, { "Input": "二千十六年、買収などの直接投資において、中国のキャッシュアウトフロー纯额は千二百億ドルも到達", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "千二百億ドル", @@ -904,7 +904,7 @@ }, { "Input": "このパソコンは2ドルとなってます", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "2ドル", @@ -921,7 +921,7 @@ }, { "Input": "445ナイラ到達で交換できます", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "445ナイラ", @@ -938,7 +938,7 @@ }, { "Input": "1ユーロで大丈夫です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "1ユーロ", @@ -956,7 +956,7 @@ { "Input": "人民元五十元", "Comment": "Currency does not support split units (e.g. '人民元30元')", - "NotSupported": "dotnet, javascript, python, java", + "NotSupported": "dotnet, javascript, java", "Results": [ { "Text": "人民元五十元", @@ -973,7 +973,7 @@ }, { "Input": "金融市場で運用する資金運用事業を合わせた財投総額も過去最大の同二%減の四十九兆九千五百九十二億円となっている。", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "四十九兆九千五百九十二億円", @@ -990,7 +990,7 @@ }, { "Input": "これは 零円です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "零円", @@ -1024,7 +1024,7 @@ }, { "Input": "私 は その 買い物 で あなた に ろく どる 仮 ています", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "ろく どる", @@ -1040,7 +1040,7 @@ }, { "Input": "これは 7万円です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "7万円", @@ -1057,7 +1057,7 @@ }, { "Input": "これは7万円です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "7万円", @@ -1074,7 +1074,7 @@ }, { "Input": "これは 7万円です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "7万円", @@ -1091,7 +1091,7 @@ }, { "Input": "これは 7 万 円 です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "7 万 円", @@ -1108,7 +1108,7 @@ }, { "Input": "これは 700円です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "700円", @@ -1125,7 +1125,7 @@ }, { "Input": "これは 七万円です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "七万円", @@ -1142,7 +1142,7 @@ }, { "Input": "これは 7百円です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "7百円", @@ -1159,7 +1159,7 @@ }, { "Input": "これは 7千円です", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "7千円", diff --git a/Specs/NumberWithUnit/Japanese/DimensionModel.json b/Specs/NumberWithUnit/Japanese/DimensionModel.json deleted file mode 100644 index 0bae506e39..0000000000 --- a/Specs/NumberWithUnit/Japanese/DimensionModel.json +++ /dev/null @@ -1,1034 +0,0 @@ -[ - { - "Input": "あなたの体重は200ポンドです。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200ポンド", - "Start": 7, - "End": 12, - "TypeName": "dimension", - "Resolution": { - "unit": "Pound", - "value": "200" - } - } - ] - }, - { - "Input": "75ミリリットル", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "75ミリリットル", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Milliliter" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "その最大の欠点は、一人のコンサルタントが扱いにくいと述べるほどの3インチの厚みかもしれない。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3インチ", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Inch" - }, - "Start": 32, - "End": 35 - } - ] - }, - { - "Input": "竜巻が10マイルにわたってそのエリアを轟き過ぎ、少なくとも14人が亡くなり数十軒の住宅はがれきと化した。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10マイル", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Mile" - }, - "Start": 3, - "End": 7 - } - ] - }, - { - "Input": "それを23台のコンピューターとすべて接続するためには、10.5マイル以上のケーブルと電線が必要だ。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10.5マイル", - "TypeName": "dimension", - "Resolution": { - "value": "10.5", - "unit": "Mile" - }, - "Start": 27, - "End": 33 - } - ] - }, - { - "Input": "私が泊まる空港のホテルまでの6マイルの道のりを早朝には20分で行けたのに、3時間以上もかかった。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "6マイル", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Mile" - }, - "Start": 14, - "End": 17 - } - ] - }, - { - "Input": "それが、1 ) なぜ、やはり自分たちはボー・ジャクソンとは違うのかを説明する。2 ) 平均水深が2フィートの湖で溺れる可能性があると警告する。そして 3 ) 1万台のピアノの前に1万匹のサルを並べると1, 118 曲の出版可能なロックンロールの曲がうまれると予測する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2フィート", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Foot" - }, - "Start": 48, - "End": 52 - } - ] - }, - { - "Input": "ミシシッピー州、ニューヨーク州、ペンシルバニア州の100人以上が汚染されたキノコを食べ健康を害したことをうけ、5月19日に米食品医薬品局は、68オンス缶中国産キノコの拘禁を始めた。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "68オンス", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Ounce" - }, - "Start": 70, - "End": 74 - } - ] - }, - { - "Input": "ハーリング市は、10月13日に市場が190ポイント暴落する一週間前にすべての株を売却したので、そのお金が45エーカーの馬牧場を購入の助けになるとほくそ笑んだ。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "45エーカー", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Acre" - }, - "Start": 52, - "End": 57 - } - ] - }, - { - "Input": "そしてこれらのガーデネットを実際の部屋にするためにバートレットさんは、8フィートから10フィートの高さの窓のない壁(レンガ、格子、垣根)を急いで建ててて室内が一日中真っ暗な陰になるようにした。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "8フィート", - "TypeName": "dimension", - "Resolution": { - "value": "8", - "unit": "Foot" - }, - "Start": 35, - "End": 39 - }, - { - "Text": "10フィート", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Foot" - }, - "Start": 42, - "End": 47 - } - ] - }, - { - "Input": "アメリカン航空の燃料業務取締役として年間約24億ガロンのジェット燃料を購入するジャック・ザベスは、「経営者は不意打ちは望まない。」と言及する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "24億ガロン", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Gallon" - }, - "Start": 21, - "End": 26 - } - ] - }, - { - "Input": "10ガロンの冷水が床に倒れ、赤いカーペットはびしょ濡れになった。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10ガロン", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Gallon" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "近くで、6 ぴきのイルカは 海水水族館の150万ガロンの水で戯れるだろう。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "150万ガロン", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Gallon" - }, - "Start": 20, - "End": 26 - } - ] - }, - { - "Input": "そしてこの赤ちゃんは、2ポンドを超えている。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2ポンド", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Pound" - }, - "Start": 11, - "End": 14 - } - ] - }, - { - "Input": "ヴォロクさんは「私は食事しない人は信用しない。」と言ったが、彼女自身25ポンド痩せるために数年前から昼食をとらなくなった。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "25ポンド", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Pound" - }, - "Start": 34, - "End": 38 - } - ] - }, - { - "Input": "ロイヤル・ダッチ・シェルグループの子会社であるシェルは、0.9兆立方フィートの輸出を許可され、また、 オリンピア・アンド・ヨーク・ディベロプメンツの一部であるガルフは輸出を許可される。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "0.9兆立方フィート", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "unit": "Cubic foot" - }, - "Start": 28, - "End": 37 - } - ] - }, - { - "Input": "現在枠組みされている法案の主要部は、 小さい農村部を除き国の6 大都市の場合、一家族が所有できる不動産は660平方メートルに規制されている。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "660平方メートル", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Square meter" - }, - "Start": 52, - "End": 60 - } - ] - }, - { - "Input": "ティグレイ軍隊は現在、アジスアベバ北部 200マイルでデセの町を脅かしており、それによりアジスアベバにとってのすべての燃料やその他 の供給源であるアッサブ港からのメンギストゥ氏の原資が断ち切られることになる。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200マイル", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Mile" - }, - "Start": 20, - "End": 25 - } - ] - }, - { - "Input": "コンピューターの一台が3フィートも床の上を滑ったと彼は言った。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3フィート", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Foot" - }, - "Start": 11, - "End": 15 - } - ] - }, - { - "Input": "保有の中核は、東京のビジネスおよび金融の中心であり、よく「三菱村」と冗談めかして呼ばれる丸の内地区にある 19万平方メートルの巨額な土地である。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "19万平方メートル", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Square meter" - }, - "Start": 53, - "End": 61 - } - ] - }, - { - "Input": "ヒューズが国際電気通信衛生機構につくった人工衛星は、1982年に3トンの人工衛星5基を開発するためにヒューズが得た 7億ドル契約の一部であった。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3トン", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Ton" - }, - "Start": 32, - "End": 34 - } - ] - }, - { - "Input": "1996年の生物兵器に関する報告書によると、ワシントンにある民間の政策調査機関である戦略国際問題研究所 は、130ガロン容量の業務用機器を使用して生物兵器を形成するのは、自称テロリストたちにとっては容易であると警告した。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "130ガロン", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Gallon" - }, - "Start": 54, - "End": 59 - } - ] - }, - { - "Input": "一番ホールでシンは、9番アイアンでアプローチショットをカップから6フィート内に打った。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "6フィート", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Foot" - }, - "Start": 32, - "End": 36 - } - ] - }, - { - "Input": "よって、来年三月のオオバコ収穫時には、ちょうどオオバコブームが絶頂だった過去数年よりも収穫量が1万6千メートルトン少ないかもしれない。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1万6千メートルトン", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Metric ton" - }, - "Start": 47, - "End": 56 - } - ] - }, - { - "Input": "486 は、IBMが 初期のパソコン用に16ビット8088 チップを採用して以来、市場を支配し始めたインテルチップの長いシリーズの系列である。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "16ビット", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "Bit" - }, - "Start": 20, - "End": 24 - } - ] - }, - { - "Input": "「ジオット・キャスピタ」は、時速188マイル以上で走行可能だと会社の広報担当は言った。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "時速188マイル", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Mile per hour" - }, - "Start": 14, - "End": 21 - } - ] - }, - { - "Input": "海軍は、バグダッド郊外の移動式運転室から 100メートルのところにヘリコプター用の着陸ゾーンを準備した。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100メートル", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Meter" - }, - "Start": 21, - "End": 27 - } - ] - }, - { - "Input": "カリフォルニア運輸局は、ロサンゼルスのすぐ南、メモリアルコロシアム付近のハーバーフリーウェイの中央分離帯の上に 全長2.5マイルの二つ目のバス用デッキとカープールを追加する計画をたてている。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2.5マイル", - "TypeName": "dimension", - "Resolution": { - "value": "2.5", - "unit": "Mile" - }, - "Start": 58, - "End": 63 - } - ] - }, - { - "Input": "毎朝、農園本部に行くまでの4マイルの道のりで、4 軒の空き家を通り過ぎる。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "4マイル", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Mile" - }, - "Start": 13, - "End": 16 - } - ] - }, - { - "Input": "我々は侮辱されたと、ブカレストの北西約 325キロメートルにあるギリシャカトリック本部のランガは言った。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "325キロメートル", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilometer" - }, - "Start": 20, - "End": 28 - } - ] - }, - { - "Input": "ロティックは、3年ほど前から真剣に走り始め、今月になるまでインドア競技には出場したことのなかった小さな(5フィート4インチ)の28歳である。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5フィート", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Foot" - }, - "Start": 52, - "End": 56 - }, - { - "Text": "4インチ", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Inch" - }, - "Start": 57, - "End": 60 - } - ] - }, - { - "Input": "ミネソタ州シャコピーのレースウェイパークは、1/4マイルの舗装されたオーバルだ。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1/4マイル", - "TypeName": "dimension", - "Resolution": { - "value": "0.25", - "unit": "Mile" - }, - "Start": 22, - "End": 27 - } - ] - }, - { - "Input": "キャッスルクラグ山は、モート湖の南、そしてフリンク山の西 1.6キロメートルの同じ稜線に位置する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1.6キロメートル", - "TypeName": "dimension", - "Resolution": { - "value": "1.6", - "unit": "Kilometer" - }, - "Start": 29, - "End": 37 - } - ] - }, - { - "Input": "ジャバディヒルズは、アンブルから約 17キロメートルのところに位置する。 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "17キロメートル", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Kilometer" - }, - "Start": 18, - "End": 25 - } - ] - }, - { - "Input": "展示会場近くのミシガン湖を二時間まわった後、 ヒューゴ・エッケナー指揮官は、776フィートの飛行船をグレンビューのカーティスライト空港付近に着陸させた。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "776フィート", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Foot" - }, - "Start": 38, - "End": 44 - } - ] - }, - { - "Input": "高速道路の 35番と 115番のリンジーとピーターボロー(436番出口) へのインターチェンジは、ベネット通りの東 500メートルにある。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500メートル", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Meter" - }, - "Start": 58, - "End": 64 - } - ] - }, - { - "Input": "1995 年にキャノンは、 内部画像安定を搭載したSLRレンズ ef 75 -300ミリ f / 4 - 5 . 6 is usm を初めて商品化した。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "300ミリ", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Millimeter" - }, - "Start": 39, - "End": 43 - } - ] - }, - { - "Input": "ダゲナムのスターリング・アーマメンツ社は、 商業販売用に 新しい7.62ミリバレル、弾倉、エキストラクター、エジェクターで構成される変換キットを生産した。 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "7.62ミリ", - "TypeName": "dimension", - "Resolution": { - "value": "7.62", - "unit": "Millimeter" - }, - "Start": 32, - "End": 37 - } - ] - }, - { - "Input": "そのプロジェクトは、4680 万ドルかけて会社の生産能力を年間25 %増の銅陰極3 万 4,500メートルトンにする予定である。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3 万 4,500メートルトン", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Metric ton" - }, - "Start": 40, - "End": 54 - } - ] - }, - { - "Input": "連邦政府関係機関のカナダ統計局によると、カナダ鋼地金の生産量は、10月7日終わりの週で総量29万1,890メートルトンで前の週の総生産量の14 . 8 % 増となった。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "29万1,890メートルトン", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Metric ton" - }, - "Start": 45, - "End": 58 - } - ] - }, - { - "Input": "フロリダプーマは、190平方キロメートル圏内を行動圏にして生息する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "190平方キロメートル", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Square kilometer" - }, - "Start": 9, - "End": 19 - } - ] - }, - { - "Input": "1メートルトンは、 2,204.62ポンドに等しい。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1メートルトン", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Metric ton" - }, - "Start": 0, - "End": 6 - }, - { - "Text": "2,204.62ポンド", - "TypeName": "dimension", - "Resolution": { - "value": "2204.62", - "unit": "Pound" - }, - "Start": 10, - "End": 20 - } - ] - }, - { - "Input": "私は男だ。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "さっとダイレクトメールを送って、E メールアドレスをききなさい。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "1メートルは、10デシメートルに等しい。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1メートル", - "Start": 0, - "End": 4, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "value": "1" - } - }, - { - "Text": "10デシメートル", - "Start": 7, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Decimeter", - "value": "10" - } - } - ] - }, - { - "Input": "このファイルのサイズは、100メガバイトだ。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100メガバイト", - "TypeName": "dimension", - "Resolution": { - "unit": "Megabit", - "value": "100" - }, - "Start": 12, - "End": 19 - } - ] - }, - { - "Input": " 午後の2時に君にサプライズが用意してあるよ。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "2pmとは、 2 ピクトメーターのことだと彼は言った。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2pm", - "Start": 0, - "End": 2, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "value": "2" - } - }, - { - "Text": "2 ピクトメーター", - "Start": 7, - "End": 15, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "value": "2" - } - } - ] - }, - { - "Input": "それなら1マイルは準備できる。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1マイル", - "Start": 4, - "End": 7, - "TypeName": "dimension", - "Resolution": { - "unit": "Mile", - "value": "1" - } - } - ] - }, - { - "Input": "2pmとは、2ピクトメーターのことだと彼は言った。", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "2pm", - "Start": 0, - "End": 2, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "value": "2" - } - }, - { - "Text": "2ピクトメーター", - "Start": 6, - "End": 13, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "value": "2" - } - } - ] - }, - { - "Input": "今の身長は百六十八センチです", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "百六十八センチ", - "TypeName": "dimension", - "Resolution": { - "value": "168", - "unit": "Centimeter" - }, - "Start": 5, - "End": 11 - } - ] - }, - { - "Input": "dimensionってどういう意味ですか", - "NotSupported": "javascript, python, java", - "Results": [] - }, - { - "Input": "ここの水深は250メートル超え", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "250メートル", - "TypeName": "dimension", - "Resolution": { - "value": "250", - "unit": "Meter" - }, - "Start": 6, - "End": 12 - } - ] - }, - { - "Input": "身長はいま、168cmも到達しました", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "168cm", - "TypeName": "dimension", - "Resolution": { - "value": "168", - "unit": "Centimeter" - }, - "Start": 6, - "End": 10 - } - ] - }, - { - "Input": "去年、チンジャンの蝦米共同産業の生産額が百八十億人民元突破、十万人の就業も促進し、ロブスターの養殖農家平均で一万六千元増収し、全省のロブスター養殖業を三百八十七ムー引っ張しました。", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "三百八十七ムー", - "TypeName": "dimension", - "Resolution": { - "value": "387", - "unit": "Mu" - }, - "Start": 75, - "End": 81 - } - ] - }, - { - "Input": "今となって、身長は168センチになった", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "168センチ", - "TypeName": "dimension", - "Resolution": { - "value": "168", - "unit": "Centimeter" - }, - "Start": 9, - "End": 14 - } - ] - }, - { - "Input": "オーストラリアとビクトリアの警察がモルボルンで一トン近いのメタンフェタミンを鹵獲。オーストラリア史上最大のメタンフェタミン密輸案件となっております。(オーストラリア連邦警察)", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "一トン", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Ton" - }, - "Start": 23, - "End": 25 - } - ] - }, - { - "Input": "今日の午後二時、サプライズがあります!", - "NotSupported": "javascript, python, java", - "Results": [] - }, - { - "Input": "陽西の唐辛子絶賛発売中、毎日平均で二十万キログラムも珠江デルタで完売", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "二十万キログラム", - "TypeName": "dimension", - "Resolution": { - "value": "200000", - "unit": "Kilogram" - }, - "Start": 17, - "End": 24 - } - ] - }, - { - "Input": "速度は毎秒23メートルです", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "毎秒23メートル", - "TypeName": "dimension", - "Resolution": { - "unit": "Meter per second", - "value": "23" - }, - "Start": 3, - "End": 10 - } - ] - }, - { - "Input": "速度は時速120キロメートルです", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "時速120キロメートル", - "TypeName": "dimension", - "Resolution": { - "unit": "Kilometer per hour", - "value": "120" - }, - "Start": 3, - "End": 13 - } - ] - }, - { - "Input": "我々は侮辱されたと、ブカレストの北西約 325キロにあるギリシャカトリック本部のランガは言った。", - "Comment": "'キロ' (kilo) can be used for both 'kilometer' and 'kilogram' and its meaning is disambiguated by context.", - "NotSupportedByDesign": "dotnet,javascript,python,java", - "Results": [ - { - "Text": "325キロ", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilometer" - }, - "Start": 20, - "End": 24 - } - ] - }, - { - "Input": "キャッスルクラグ山は、モート湖の南、そしてフリンク山の西 1.6キロの同じ稜線に位置する。", - "Comment": "'キロ' (kilo) can be used for both 'kilometer' and 'kilogram' and its meaning is disambiguated by context.", - "NotSupportedByDesign": "dotnet,javascript,python,java", - "Results": [ - { - "Text": "1.6キロ", - "TypeName": "dimension", - "Resolution": { - "value": "1.6", - "unit": "Kilometer" - }, - "Start": 29, - "End": 33 - } - ] - }, - { - "Input": "陽西の唐辛子絶賛発売中、毎日平均で二十万キロも珠江デルタで完売", - "Comment": "'キロ' (kilo) can be used for both 'kilometer' and 'kilogram' and its meaning is disambiguated by context.", - "NotSupported": "dotnet,javascript, python, java", - "Results": [ - { - "Text": "二十万キロ", - "TypeName": "dimension", - "Resolution": { - "value": "200000", - "unit": "Kilogram" - }, - "Start": 17, - "End": 21 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Japanese/TemperatureModel.json b/Specs/NumberWithUnit/Japanese/TemperatureModel.json deleted file mode 100644 index 456fdb8a28..0000000000 --- a/Specs/NumberWithUnit/Japanese/TemperatureModel.json +++ /dev/null @@ -1,700 +0,0 @@ -[ - { - "Input": "外の気温は、摂氏 40度です。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏 40度", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 6, - "End": 11 - } - ] - }, - { - "Input": "テキサスは、気温華氏 90度です。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏 90度", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 8, - "End": 13 - } - ] - }, - { - "Input": "華氏 マイナス 5度", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏 マイナス 5度", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "摂氏6度", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏6度", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "華氏98.6度は、平熱です。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏98.6度", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "温度を摂氏30度に設定する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏30度", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 3, - "End": 7 - } - ] - }, - { - "Input": "平熱は、華氏98.6度です。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏98.6度", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 4, - "End": 10 - } - ] - }, - { - "Input": "華氏100度", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏100度", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "摂氏20度", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏20度", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "華氏100.2度は、低いです。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏100.2度", - "TypeName": "temperature", - "Resolution": { - "value": "100.2", - "unit": "F" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "摂氏 10.5度", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏 10.5度", - "TypeName": "temperature", - "Resolution": { - "value": "10.5", - "unit": "C" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "摂氏 20.3度", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏 20.3度", - "TypeName": "temperature", - "Resolution": { - "value": "20.3", - "unit": "C" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "摂氏 34.5度", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏 34.5度", - "TypeName": "temperature", - "Resolution": { - "value": "34.5", - "unit": "C" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "外の気温は、華氏98度です。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏98度", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "F" - }, - "Start": 6, - "End": 10 - } - ] - }, - { - "Input": "サーモスタットを85度に設定する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "85度", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 8, - "End": 10 - } - ] - }, - { - "Input": "温度を5度上げる。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5度", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 3, - "End": 4 - } - ] - }, - { - "Input": "温度を華氏70度に設定する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏70度", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 3, - "End": 7 - } - ] - }, - { - "Input": "温度を20度上げる。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20度", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degree" - }, - "Start": 3, - "End": 5 - } - ] - }, - { - "Input": "温度を100度に設定する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100度", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 3, - "End": 6 - } - ] - }, - { - "Input": "温度を華氏75度に保つ。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏75度", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 3, - "End": 7 - } - ] - }, - { - "Input": "温度を摂氏40度にする。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏40度", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 3, - "End": 7 - } - ] - }, - { - "Input": "温度を50度にする。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50度", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degree" - }, - "Start": 3, - "End": 5 - } - ] - }, - { - "Input": "摂氏10度を華氏に変換する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "摂氏10度", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 0, - "End": 4 - }, - { - "Text": "華氏", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 6, - "End": 7 - } - ] - }, - { - "Input": "華氏から摂氏に。華氏101度は摂氏で何度か。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏101度", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - }, - "Start": 8, - "End": 13 - }, - { - "Text": "華氏", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "摂氏", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 4, - "End": 5 - }, - { - "Text": "摂氏", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 15, - "End": 16 - } - ] - }, - { - "Input": "華氏51度を摂氏に変換してもらえますか。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏51度", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 0, - "End": 4 - }, - { - "Text": "摂氏", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 6, - "End": 7 - } - ] - }, - { - "Input": "華氏106度を摂氏に変換する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏106度", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 0, - "End": 5 - }, - { - "Text": "摂氏", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 7, - "End": 8 - } - ] - }, - { - "Input": "華氏45度を摂氏に変換する。", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏45度", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "F" - }, - "Start": 0, - "End": 4 - }, - { - "Text": "摂氏", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 6, - "End": 7 - } - ] - }, - { - "Input": "華氏マイナス20度を摂氏に変換する方法", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏マイナス20度", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 0, - "End": 8 - }, - { - "Text": "摂氏", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 10, - "End": 11 - } - ] - }, - { - "Input": "外の気温は98度です", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "98度", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degree" - }, - "Start": 5, - "End": 7 - } - ] - }, - { - "Input": "アンナトークで数をいつかください", - "Comment": "Temporary regression", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "サーモスタットを八十五度まで設置しましょう", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "八十五度", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 8, - "End": 11 - } - ] - }, - { - "Input": "通常は華氏温度98.6度となります", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏温度98.6度", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 3, - "End": 11 - } - ] - }, - { - "Input": "彼は三十九度まで高熱があるよ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "三十九度", - "TypeName": "temperature", - "Resolution": { - "value": "39", - "unit": "Degree" - }, - "Start": 2, - "End": 5 - } - ] - }, - { - "Input": "温度を5度上げましょう", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5度", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 3, - "End": 4 - } - ] - }, - { - "Input": "温度の単位って℃ですか", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "℃", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 7, - "End": 7 - } - ] - }, - { - "Input": "華氏温度とすれば100度です", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100度", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 8, - "End": 11 - }, - { - "Text": "華氏温度", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "華氏温度の51度を摂氏温度に変換できるか", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "華氏温度の51度", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 0, - "End": 7 - }, - { - "Text": "摂氏温度", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 9, - "End": 12 - } - ] - }, - { - "Input": "20℃", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20℃", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 2 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Korean/AgeModel.json b/Specs/NumberWithUnit/Korean/AgeModel.json deleted file mode 100644 index 43c5b82899..0000000000 --- a/Specs/NumberWithUnit/Korean/AgeModel.json +++ /dev/null @@ -1,272 +0,0 @@ -[ - { - "Input": "그녀가 다섯 살 때, 그녀는 자전거 타는 것을 배웠다.", - "Comment": "Failed to parse number.", - "NotSupportedByDesign": "javascript,python,java", - "IgnoreResolution": "true", - "Results": [ - { - "Text": "다섯 살", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - } - } - ] - }, - { - "Input": "이 전설은 십 년이 되었다.", - "Comment": "The unit '년' (years) is ambiguous and does not specifically refer to age (it can be used in other contexts e.g. date or duration).", - "NotSupportedByDesign": "dotnet,javascript,python,java", - "Results": [ - { - "Text": "십 년", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Year" - } - } - ] - }, - { - "Input": "나는 겨우 29살이야!", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "29살", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - } - } - ] - }, - { - "Input": "이제, 아흔다섯 살이 지나면, 관점이 바뀐다.", - "Comment": "Failed to parse number.", - "NotSupportedByDesign": "javascript,python,java", - "IgnoreResolution": "true", - "Results": [ - { - "Text": "아흔다섯 살", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Year" - } - } - ] - }, - { - "Input": "중국의 만리장성은 500년 이상 되었고, 5,000마일 이상 뻗어 있다.", - "Comment": "The unit '년' (years) is ambiguous and does not specifically refer to age (it can be used in other contexts e.g. date or duration).", - "NotSupportedByDesign": "dotnet,javascript,python,java", - "Results": [ - { - "Text": "500년", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Year" - } - } - ] - }, - { - "Input": "그녀는 60살이고; 1945년 5월 8일에 태어났다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "60살", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - } - } - ] - }, - { - "Input": "사례의 25%는 약 3살이 될 때까지 진단되지 않습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3살", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Year" - } - } - ] - }, - { - "Input": "일 년짜리 약속을 이행해야 하는 압박이 언제 있는가?", - "Comment": "The input translates to 'When is the pressure to fulfill our one-year promise?' and does not represent an age but a duration.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "일 년", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Year" - } - } - ] - }, - { - "Input": "아기가 태어난 지 십 개월 밖에 되지 않았을 때의 일이다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "십 개월", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - } - } - ] - }, - { - "Input": "위원회의 제안은 8개월이 되었다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "8개월", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Month" - } - } - ] - }, - { - "Input": "대략 50%의 사례가 약 십 팔 개월에 진단됩니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "십 팔 개월", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Month" - } - } - ] - }, - { - "Input": "가능하지만, 2006년에는 95%가 삼 개월 미만이었다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "삼 개월", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Month" - } - } - ] - }, - { - "Input": "우리가 12월에 진행한다면, 그것은 삼 주가 될 것이다. ", - "Comment": "In Korean there are no unambiguous expressions for 'weeks' and 'days' intended as age.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "삼 주", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - } - } - ] - }, - { - "Input": "6주의 나이에, 벌써 크리스마스를 축하할 수 있다.", - "Comment": "In Korean there are no unambiguous expressions for 'weeks' and 'days' intended as age.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "6주", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Week" - } - } - ] - }, - { - "Input": "90일이 된 공과금 청구서는 꽤 늦었다.", - "Comment": "Failed to extract number attached to unit.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "90일", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - } - } - ] - }, - { - "Input": "그는 약 40 - 50 세이다", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50 세", - "Start": 10, - "End": 13, - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "50" - } - } - ] - }, - { - "Input": "이 전설은 십 세이 되었다.", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "십 세", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Year" - } - } - ] - }, - { - "Input": "중국의 만리장성은 500살 이상 되었고, 5,000마일 이상 뻗어 있다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500살", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Year" - } - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Korean/DimensionModel.json b/Specs/NumberWithUnit/Korean/DimensionModel.json deleted file mode 100644 index 0145adc23f..0000000000 --- a/Specs/NumberWithUnit/Korean/DimensionModel.json +++ /dev/null @@ -1,850 +0,0 @@ -[ - { - "Input": "당신의 몸무게는 200 파운드입니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 파운드", - "Start": 9, - "End": 15, - "TypeName": "dimension", - "Resolution": { - "unit": "Pound", - "value": "200" - } - } - ] - }, - { - "Input": "75 밀리리터 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "75 밀리리터", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Milliliter" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "그것의 가장 큰 단점은 3 인치 두께 일 수 있습니다. 컨설턴트가 그것을 투박하다고 묘사하기에 충분하다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3 인치", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Inch" - }, - "Start": 13, - "End": 16 - } - ] - }, - { - "Input": "트위스터가 거기에서 10 마일 정도 떨어진 지역을 강타하여 적어도 14 명이 사망하고 수십 채의 집이 잔해로 변했습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 마일", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Mile" - }, - "Start": 11, - "End": 15 - } - ] - }, - { - "Input": "케이블과 전선을 10.5 마일 이상 연결하고 23 대의 컴퓨터를 연결합니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10.5 마일", - "TypeName": "dimension", - "Resolution": { - "value": "10.5", - "unit": "Mile" - }, - "Start": 9, - "End": 15 - } - ] - }, - { - "Input": "그날 아침에 20 분 걸린 공항 호텔로 가는 6 마일 길이 3 시간 이상 걸렸다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "6 마일", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Mile" - }, - "Start": 25, - "End": 28 - } - ] - }, - { - "Input": "산업 전반에 걸쳐,이 국가의 석유 생산량은 올해 첫 8 개월 동안 하루 50 만 배럴 감소했다.", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "50 만 배럴", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Barrel" - }, - "Start": 40, - "End": 46 - } - ] - }, - { - "Input": "그것은 1) 왜 우리가 잭슨보다 오히려 우리 자신과 같은지를 설명한다. 2) 평균 2 피트 깊이의 호수에서 익사하는 것이 가능하다는 주의이다 ; 그리고 3) 만 마리가 넘는 원숭이가 만 대가 넘는 피아노 앞에서 만 천 백 십팔 곡의 발행 가능한 락 앤 롤 (rock 'n'roll) 곡을 만들 것이라고 예측합니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2 피트", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Foot" - }, - "Start": 46, - "End": 49 - } - ] - }, - { - "Input": "5월 19일, fda는 미시시피, 뉴욕 및 펜실베니아에 사는 백 명 이상의 사람들이 오염된 버섯 복용으로 병에 걸린 후에 68 온스 캔의 중국 버섯을 억류하기 시작했습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "68 온스", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Ounce" - }, - "Start": 68, - "End": 72 - } - ] - }, - { - "Input": "헐링 씨는 10월 19일 시장이 190 포인트 떨어지기 일주일 전에 그의 주식을 모두 판 것에 매우 흡족해하고 있으며, 그 돈을 45 에이커의 말 농장을 사기 위해 유용하게 사용할 것이다. .", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "45 에이커", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Acre" - }, - "Start": 73, - "End": 78 - } - ] - }, - { - "Input": "이 정원들을 말 그대로 방으로 만들기 위해 바틀렛 씨는 8 ~ 10 피트 높이의 창문 없는 벽 (벽돌, 격자, 울타리)을 만들어 내부에 하루 종일 깜깜한그늘을 만들었다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 피트", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Foot" - }, - "Start": 35, - "End": 39 - } - ] - }, - { - "Input": "아메리칸 항공의 연료 서비스 담당 이사인 잭 제너브 (jack zaves)는 연내 제트 연료 24억 갤런을 구매하는 '경영진은 놀라움을 원하고 있지 않다.' 고 언급했다. ", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "24억 갤런", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Gallon" - }, - "Start": 52, - "End": 57 - } - ] - }, - { - "Input": "10 갤런의 물 냉각기가 바닥에 엎어져서 붉은 카펫을 흠뻑 적셨다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 갤런", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Gallon" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "인근에 있는 여섯 마리의 돌고래는 150만 갤런의 바닷물 수족관에서 즐겁게 놀 것입니다.", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "150만 갤런", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Gallon" - }, - "Start": 19, - "End": 25 - } - ] - }, - { - "Input": "그리고 이 아기의 무게는 2 파운드가 넘는다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2 파운드", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Pound" - }, - "Start": 14, - "End": 18 - } - ] - }, - { - "Input": "Volokh 씨는 몇 년 전 25 파운드를 빼기 위해 점심을 먹지 않았음에도 불구하고, '나는 먹지 않는 사람들을 신뢰하지 않는다.'고 말했다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "25 파운드", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Pound" - }, - "Start": 16, - "End": 21 - } - ] - }, - { - "Input": "로얄 더치 쉘 그룹의 자회사인 쉘은 9천억 입방 피트를 수출할 수 있으며, 올림피아 & 요크 사의 걸프도 수출할 수 있습니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "9천억 입방 피트", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "unit": "Cubic foot" - }, - "Start": 20, - "End": 28 - } - ] - }, - { - "Input": "현재 법안의 주요 내용은 다음과 같습니다: 한 가족이 소유 할 수있는 부동산의 양은 전국 6 대 도시들에서는 660 평방 미터이지만, 작은 도시와 농촌 지역의 경우는 더 소유할 수 있습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "660 평방 미터", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Square meter" - }, - "Start": 62, - "End": 70 - } - ] - }, - { - "Input": "티그리안 군대는 현재 아디스 아바바에서 북쪽 200 마일에 있으며, 모든 연료 및 다른 물품들이 도달하는 아사브 항구로부터 맹기스투를 차단할 수 있게 데제 마을을 위협하고 있다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 마일", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Mile" - }, - "Start": 25, - "End": 30 - } - ] - }, - { - "Input": "그는 컴퓨터 중 한 대가 바닥을 가로질러 3 피트나 미끄러졌다고 말했다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3 피트", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Foot" - }, - "Start": 23, - "End": 26 - } - ] - }, - { - "Input": "이 자산의 핵심은 도쿄의 비즈니스 및 금융 중심지인 마루 노우치 지구의 19만 평방 미터에 이르는 엄청나게 비싼 건물입니다. 흔히 농담으로 '미츠비시 빌리지 (mitsubishi village)'라고 불립니다. ''", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "19만 평방 미터", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Square meter" - }, - "Start": 40, - "End": 48 - } - ] - }, - { - "Input": "휴즈가 국제 통신 위성 조직을 위해 만든 위성은 1982년 3 톤 인공위성 중 다섯 대를 개발하기 위해 휴즈에게 수여한 7 억 달러 계약의 일부분이다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3 톤", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Ton" - }, - "Start": 33, - "End": 35 - } - ] - }, - { - "Input": "1996년 생물 무기에 관한 보고서에서 워싱턴 소재 공공 정책 연구 기관인 전략 국제 연구 센터는 테러리스트가 130 갤런 용량의 상용 장비를 사용하여 생물 무기를 조립하는 것은 쉽다고 경고했다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "130 갤런", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Gallon" - }, - "Start": 62, - "End": 67 - } - ] - }, - { - "Input": "무역 그룹의 상무부 자료를 종합해 보면, 그 해 두 번째로 큰 월 수입인 8월 수입은 7월의 145만 8천 톤에서 5% 증가했지만 1988년 6월의 작년 최고치보다 낮은 수치를 보였다.", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "145만 8천 톤", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Ton" - }, - "Start": 53, - "End": 61 - } - ] - }, - { - "Input": "1번 싱은 컵에서 6 피트 이내에 있는 9번 아이언 어프로치 샷을 쳤다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "6 피트", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Foot" - }, - "Start": 10, - "End": 13 - } - ] - }, - { - "Input": "그래서 내년 3월에 실리엄 작물이 수확되면, 이는 실리엄 수확의 절정기였던 바로 지난 몇 년간의 만 6천 미터톤보다 적을 수 있습니다.", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "만 6천 미터톤", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Metric ton" - }, - "Start": 55, - "End": 62 - } - ] - }, - { - "Input": "486은 ibm이 최초의 개인용 컴퓨터 용으로 16 비트 8088 칩을 채택한 이래로 시장을 장악하기 시작한 인텔 칩의 긴 시리즈의 후속품입니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "16 비트", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "Bit" - }, - "Start": 26, - "End": 30 - } - ] - }, - { - "Input": "회사 대변인은 'jiotto caspita'는 시속 188 마일 이상 달릴 수 있다고 말했다.", - "Comment": "Unit split around the number, literally 'per hour 188 miles'.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "시속 188 마일", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Mile per hour" - }, - "Start": 26, - "End": 34 - } - ] - }, - { - "Input": "해군은 바그다드 외곽의 이동 수술실에서 불과 100 미터 거리에 헬기 착륙장을 설치했다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 미터", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Meter" - }, - "Start": 25, - "End": 30 - } - ] - }, - { - "Input": "caltrans는 메모리얼 콜로세움 근처, 로스 앤젤레스 바로 남쪽에있는 2.5 마일 상당의 항구 고속도로 구간 중앙에 버스 및 카풀을 위한 두 번째 데크를 추가할 계획입니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2.5 마일", - "TypeName": "dimension", - "Resolution": { - "value": "2.5", - "unit": "Mile" - }, - "Start": 41, - "End": 46 - } - ] - }, - { - "Input": "매일 아침 농장 본부로 4 마일을 운전하면서 또 다른 네 개의 빈 집 근처를 지나갑니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "4 마일", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Mile" - }, - "Start": 14, - "End": 17 - } - ] - }, - { - "Input": "부카레스트에서 북서쪽으로 325 킬로미터 떨어진 그리스 카톨릭 본부의 랑가는 모욕당했다고 말했다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "325 킬로미터", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilometer" - }, - "Start": 14, - "End": 21 - } - ] - }, - { - "Input": "rotich는 5 피트로 작습니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5 피트", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Foot" - }, - "Start": 9, - "End": 12 - } - ] - }, - { - "Input": "4 인치, 28 세. 3 년 전까지는 진지하게 달리기를 시작하지 않았고 이번 달까지 실내에서 경쟁하지 못했습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "4 인치", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Inch" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "shakopee에 있는 경마장 공원 (미네소타)은 0.25 마일 포장된 타원형입니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "0.25 마일", - "TypeName": "dimension", - "Resolution": { - "value": "0.25", - "unit": "Mile" - }, - "Start": 29, - "End": 35 - } - ] - }, - { - "Input": "castlecrag 산은 같은 능선에 있는 마운트 frink에서 1.6 킬로미터 서쪽 해자의 남쪽에 위치해 있습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1.6 킬로미터", - "TypeName": "dimension", - "Resolution": { - "value": "1.6", - "unit": "Kilometer" - }, - "Start": 36, - "End": 43 - } - ] - }, - { - "Input": "javadi 언덕은 ambur에서 약 17 킬로미터 떨어져 있습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "17 킬로미터", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Kilometer" - }, - "Start": 21, - "End": 27 - } - ] - }, - { - "Input": "박람회 근처 미시간 호수를 2 시간 동안 돌고 난 후, 휴고 엑커 지휘관은 776 피트 비행선을 가까운 글렌 뷰에 있는 커티스 - 라이트 공항 근처에 착륙시켰습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "776 피트", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Foot" - }, - "Start": 42, - "End": 47 - } - ] - }, - { - "Input": "린지와 페테르보로우(출구 436) 고속도로 35번과 고속도로 115번 교차로는 벤넷 도로에서 동쪽으로 500 미터 떨어져 있습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500 미터", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Meter" - }, - "Start": 57, - "End": 62 - } - ] - }, - { - "Input": "1995년 캐논은 영상 흔들림 방지 기능을 갖춘 최초의 상용 SLR 렌즈인 ef 75 -300mm f / 4-5를 출시했습니다. 6은 usm입니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "300mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "subtype": "Length", - "unit": "Millimeter" - }, - "Start": 49, - "End": 53 - } - ] - }, - { - "Input": "에섹스 다겐햄 소재 스털링 군비 회사가 상업 판매용 7.62 밀리미터 배럴, 탄창, 추출기 그리고 배출기로 구성된 변환 키트를 생산했습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "7.62 밀리미터", - "TypeName": "dimension", - "Resolution": { - "value": "7.62", - "unit": "Millimeter" - }, - "Start": 29, - "End": 37 - } - ] - }, - { - "Input": "프로젝트 비용은 4천 680만 달러입니다. 연간 구리 캐소드 생산량을 3만 4천 500 미터톤으로 25 % 증대시킬 계획이다.", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "3만 4천 500 미터톤", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Metric ton" - }, - "Start": 39, - "End": 51 - } - ] - }, - { - "Input": "연방 정부 기관인 캐나다 통계청은 캐나다 강철 주괴 생산이 10월 7일 주말 29만 천 890 미터톤을 기록했으며, 이는 전주의 총 생산량보다 8 퍼센트가 많은 수치라고 밝혔다. ", - "Comment": "Failed to extract number.", - "NotSupportedByDesign": "javascript,python,java", - "NotSupported": "dotnet", - "Results": [ - { - "Text": "29만 천 890 미터톤", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Metric ton" - }, - "Start": 43, - "End": 55 - } - ] - }, - { - "Input": "플로리다 팬더는 190 제곱 킬로미터 상당의 집에서 살고 있습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "190 제곱 킬로미터", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Square kilometer" - }, - "Start": 9, - "End": 19 - } - ] - }, - { - "Input": "미터톤은 2204.62 파운드와 같습니다.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2204.62 파운드", - "TypeName": "dimension", - "Resolution": { - "value": "2204.62", - "unit": "Pound" - }, - "Start": 5, - "End": 15 - }, - { - "Text": "미터톤", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Ton" - }, - "Start": 0, - "End": 2 - } - ] - }, - { - "Input": "나는 남자입니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "메세지를 빨리 보내고 이메일 주소를 요청하십시오.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "1 미터는 10 데시미터와 같습니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1 미터", - "Start": 0, - "End": 3, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "value": "1" - } - }, - { - "Text": "10 데시미터", - "Start": 6, - "End": 12, - "TypeName": "dimension", - "Resolution": { - "unit": "Decimeter", - "value": "10" - } - } - ] - }, - { - "Input": "이 파일의 크기는 100 메가바이트입니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 메가바이트", - "TypeName": "dimension", - "Resolution": { - "unit": "Megabyte", - "value": "100" - }, - "Start": 10, - "End": 18 - } - ] - }, - { - "Input": "오후 2시에 놀래켜 줄게. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [] - }, - { - "Input": "그는 2 pm은 2 피코미터라고 말했다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2 pm", - "Start": 3, - "End": 6, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "value": "2" - } - }, - { - "Text": "2 피코미터", - "Start": 9, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "value": "2" - } - } - ] - }, - { - "Input": "1 마일을 제공할 수 있습니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1 마일", - "Start": 0, - "End": 3, - "TypeName": "dimension", - "Resolution": { - "unit": "Mile", - "value": "1" - } - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Korean/TemperatureModel.json b/Specs/NumberWithUnit/Korean/TemperatureModel.json deleted file mode 100644 index 7658c29d4c..0000000000 --- a/Specs/NumberWithUnit/Korean/TemperatureModel.json +++ /dev/null @@ -1,634 +0,0 @@ -[ - { - "Input": "외부 온도는 섭씨 40도입니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 40도", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 7, - "End": 12 - } - ] - }, - { - "Input": "텍사스는 화씨 90도입니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 90도", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 5, - "End": 10 - } - ] - }, - { - "Input": "화씨 마이너스 5도", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 마이너스 5도", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "섭씨 6도", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 6도", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "화씨 98.6도는 정상 온도입니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 98.6도", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "온도를 섭씨 30도로 설정하십시오. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 30도", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 4, - "End": 9 - } - ] - }, - { - "Input": "정상 온도는 화씨 98.6도입니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 98.6도", - "TypeName": "temperature", - "Resolution": { - "value": "98.6", - "unit": "F" - }, - "Start": 7, - "End": 14 - } - ] - }, - { - "Input": "화씨 100 도 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 100 도", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "섭씨 20 도 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 20 도", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "화씨 100.2도는 낮다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 100.2도", - "TypeName": "temperature", - "Resolution": { - "value": "100.2", - "unit": "F" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "10.5도 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10.5도", - "TypeName": "temperature", - "Resolution": { - "value": "10.5", - "unit": "Degree" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "섭씨 20도 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 20도", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "섭씨 20.3", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 20.3", - "TypeName": "temperature", - "Resolution": { - "value": "20.3", - "unit": "C" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "섭씨 34.5 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 34.5", - "TypeName": "temperature", - "Resolution": { - "value": "34.5", - "unit": "C" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "외부 온도는 98도입니다. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "98도", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degree" - }, - "Start": 7, - "End": 9 - } - ] - }, - { - "Input": "온도 조절기를 85도로 설정하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "85도", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 8, - "End": 10 - } - ] - }, - { - "Input": "온도를 5도 올리세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5도", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 4, - "End": 5 - } - ] - }, - { - "Input": "온도를 화씨 70도로 설정하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 70도", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 4, - "End": 9 - } - ] - }, - { - "Input": "온도를 20도 올리세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20도", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degree" - }, - "Start": 4, - "End": 6 - } - ] - }, - { - "Input": "온도를 100도로 설정하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100도", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 4, - "End": 7 - } - ] - }, - { - "Input": "온도를 화씨 75도로 유지하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 75도", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 4, - "End": 9 - } - ] - }, - { - "Input": "온도를 섭씨 40도로 하세요.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 40도", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 4, - "End": 9 - } - ] - }, - { - "Input": "온도를 50도로 하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50도", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degree" - }, - "Start": 4, - "End": 6 - } - ] - }, - { - "Input": "섭씨 10도를 화씨로 변환하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 10도", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 0, - "End": 5 - }, - { - "Text": "화씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 8, - "End": 9 - } - ] - }, - { - "Input": "섭씨 34.9도를 화씨로", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 34.9도", - "TypeName": "temperature", - "Resolution": { - "value": "34.9", - "unit": "C" - }, - "Start": 0, - "End": 7 - }, - { - "Text": "화씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 10, - "End": 11 - } - ] - }, - { - "Input": "섭씨 200도를 화씨로 변환하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 200도", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 0, - "End": 6 - }, - { - "Text": "화씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 9, - "End": 10 - } - ] - }, - { - "Input": "화씨를 섭씨로 화씨 101도는 섭씨 몇 도입니까? ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 101도", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - }, - "Start": 8, - "End": 14 - }, - { - "Text": "화씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 1 - }, - { - "Text": "섭씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 4, - "End": 5 - }, - { - "Text": "섭씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 17, - "End": 18 - } - ] - }, - { - "Input": "섭씨 50도 섭씨를 화씨로 ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "섭씨 50도", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - }, - "Start": 0, - "End": 5 - }, - { - "Text": "섭씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 7, - "End": 8 - }, - { - "Text": "화씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 11, - "End": 12 - } - ] - }, - { - "Input": "화씨 51도를 섭씨로 변환해 주시겠습니까?", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 51도", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 0, - "End": 5 - }, - { - "Text": "섭씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 8, - "End": 9 - } - ] - }, - { - "Input": "화씨 106도를 섭씨로 변환하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 106도", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 0, - "End": 6 - }, - { - "Text": "섭씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 9, - "End": 10 - } - ] - }, - { - "Input": "화씨 45도를 섭씨로 변환하세요. ", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 45도", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "F" - }, - "Start": 0, - "End": 5 - }, - { - "Text": "섭씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 8, - "End": 9 - } - ] - }, - { - "Input": "화씨 마이너스 20도를 섭씨로 어떻게 변환하나요?", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "화씨 마이너스 20도", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 0, - "End": 10 - }, - { - "Text": "섭씨", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 13, - "End": 14 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Portuguese/AgeModel.json b/Specs/NumberWithUnit/Portuguese/AgeModel.json deleted file mode 100644 index a33700aee6..0000000000 --- a/Specs/NumberWithUnit/Portuguese/AgeModel.json +++ /dev/null @@ -1,262 +0,0 @@ -[ - { - "Input": "Quando tinha cinco anos, aprendeu a andar de bicicleta.", - "Results": [ - { - "Text": "cinco anos", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Ano" - }, - "Start": 13, - "End": 22 - } - ] - }, - { - "Input": "Esta saga remonta a quase dez anos atrás.", - "Results": [ - { - "Text": "dez anos", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Ano" - }, - "Start": 26, - "End": 33 - } - ] - }, - { - "Input": "Só tenho 29 anos!", - "Results": [ - { - "Text": "29 anos", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Ano" - }, - "Start": 9, - "End": 15 - } - ] - }, - { - "Input": "Agora com noventa e cinco anos tens perspectiva das coisas.", - "Results": [ - { - "Text": "noventa e cinco anos", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Ano" - }, - "Start": 10, - "End": 29 - } - ] - }, - { - "Input": "A Grande Muralha da China tem mais de 500 anos e se extende por mais de 5,000 milhas.", - "Results": [ - { - "Text": "500 anos", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Ano" - }, - "Start": 38, - "End": 45 - } - ] - }, - { - "Input": "Já tem 60 anos, pois nasceu em 8 de maio de 1945.", - "Results": [ - { - "Text": "60 anos", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Ano" - }, - "Start": 7, - "End": 13 - } - ] - }, - { - "Input": "25% dos casos não são diagnosticados até por volta dos tres anos.", - "Results": [ - { - "Text": "tres anos", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Ano" - }, - "Start": 55, - "End": 63 - } - ] - }, - { - "Input": "Quando haverá pressão para comprir essa promessa feita há um ano?", - "Results": [ - { - "Text": "um ano", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Ano" - }, - "Start": 58, - "End": 63 - } - ] - }, - { - "Input": "Aconteceu quando era um bebê e tinha apenas dez meses.", - "Results": [ - { - "Text": "dez meses", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Mês" - }, - "Start": 44, - "End": 52 - } - ] - }, - { - "Input": "A proposta da comissão já tem 8 meses de idade.", - "Results": [ - { - "Text": "8 meses", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Mês" - }, - "Start": 30, - "End": 36 - } - ] - }, - { - "Input": "Aproximadamente 50% dos casos são diagnosticados aos dezoito meses de idade.", - "Results": [ - { - "Text": "dezoito meses", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Mês" - }, - "Start": 53, - "End": 65 - } - ] - }, - { - "Input": "É possível, mas em 2006 95% delas tinham menos de tres meses de vida.", - "Results": [ - { - "Text": "tres meses", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Mês" - }, - "Start": 50, - "End": 59 - } - ] - }, - { - "Input": "Se seguirmos adiante no período de dezembro, terão tres semanas de existência.", - "Results": [ - { - "Text": "tres semanas", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Semana" - }, - "Start": 51, - "End": 62 - } - ] - }, - { - "Input": "Às 6 semanas de idade já comemora o Natal.", - "Results": [ - { - "Text": "6 semanas", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Semana" - }, - "Start": 3, - "End": 11 - } - ] - }, - { - "Input": "Outras matérias primas devem ser usadas num prazo de cinco dias.", - "Results": [ - { - "Text": "cinco dias", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Dia" - }, - "Start": 53, - "End": 62 - } - ] - }, - { - "Input": "Uma conta vencida a 90 dias está bem atrasada.", - "Results": [ - { - "Text": "90 dias", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Dia" - }, - "Start": 20, - "End": 26 - } - ] - }, - { - "Input": "Ele tem cerca de 40 - 50 anos", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "50 anos", - "Start": 22, - "End": 28, - "TypeName": "age", - "Resolution": { - "unit": "Ano", - "value": "50" - } - } - ] - }, - { - "Input": "Semana ou semanas", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Portuguese/CurrencyModel.json b/Specs/NumberWithUnit/Portuguese/CurrencyModel.json deleted file mode 100644 index b0679c0c24..0000000000 --- a/Specs/NumberWithUnit/Portuguese/CurrencyModel.json +++ /dev/null @@ -1,1932 +0,0 @@ -[ - { - "Input": "Condado de Montgomery, md. - - $ 75 milhões de obrigações gerais, Série b , bens consolidados de melhoramento público de 1989 , através do Manufacturers Hanover Trust co. group.", - "Results": [ - { - "Text": "$ 75 milhões", - "TypeName": "currency", - "Resolution": { - "value": "75000000", - "unit": "Dólar" - }, - "Start": 31, - "End": 42 - } - ] - }, - { - "Input": "Conglomerado finlandês Nokia ( oy ab ) diz que chegou a um acordo para comprar a companhia de cabo holandesa NKF kabel b.v. por 420 milhoes de marcos finlandeses", - "Results": [ - { - "Text": "420 milhoes de marcos finlandeses", - "TypeName": "currency", - "Resolution": { - "value": "420000000", - "unit": "Marco finlandês" - }, - "Start": 128, - "End": 160 - } - ] - }, - { - "Input": "Nacional pagour a Siegel e Shuster $ 94.000 para cancelar todas as reclamacoes.", - "Results": [ - { - "Text": "$ 94.000", - "TypeName": "currency", - "Resolution": { - "value": "94000", - "unit": "Dólar" - }, - "Start": 35, - "End": 42 - } - ] - }, - { - "Input": "Servicos da dinámica general co., uma unidade do Dinámica General corp., ganhou um contrato do exército de $ 48,2 milhoes para establecer facilidades de manutenção para os veículos com rastreamento no Paquistão.", - "Results": [ - { - "Text": "$ 48,2 milhoes", - "TypeName": "currency", - "Resolution": { - "value": "48200000", - "unit": "Dólar" - }, - "Start": 107, - "End": 120 - } - ] - }, - { - "Input": "O preço do segundo simulador oscila em torno de C$ 16,4 milhoes", - "Results": [ - { - "Text": "c$ 16,4 milhoes", - "TypeName": "currency", - "Resolution": { - "value": "16400000", - "unit": "Dólar canadense" - }, - "Start": 48, - "End": 62 - } - ] - }, - { - "Input": "Golar Gas Holding co., uma subsidiaria do Gotaas-Larsen Shipping corp., oferece $ 280 milhoes pelas hipotecas preferenciais, vía os mercados de capitais da Merrill Linch.", - "Results": [ - { - "Text": "$ 280 milhoes", - "TypeName": "currency", - "Resolution": { - "value": "280000000", - "unit": "Dólar" - }, - "Start": 80, - "End": 92 - } - ] - }, - { - "Input": "Bard/Ems tinha em 1988 vendas de cerca de $ 14 milhões, segundo Birtcher.", - "Results": [ - { - "Text": "$ 14 milhões", - "TypeName": "currency", - "Resolution": { - "value": "14000000", - "unit": "Dólar" - }, - "Start": 42, - "End": 53 - } - ] - }, - { - "Input": "Os preços do acordo começam em $ 12.345.", - "Results": [ - { - "Text": "$ 12.345", - "TypeName": "currency", - "Resolution": { - "value": "12345", - "unit": "Dólar" - }, - "Start": 31, - "End": 38 - } - ] - }, - { - "Input": "Batman havia acumulado mais de $247 milhoes nas bilheterias até hoje, tornando-se o filme de maior bilheteria da Warner Bros.", - "Results": [ - { - "Text": "$247 milhoes", - "TypeName": "currency", - "Resolution": { - "value": "247000000", - "unit": "Dólar" - }, - "Start": 31, - "End": 42 - } - ] - }, - { - "Input": "O patrimonio liquido de Coyle foi estimado em £ 8,10 milhões em Outubro de 2014.", - "Results": [ - { - "Text": "£ 8,10 milhões", - "TypeName": "currency", - "Resolution": { - "value": "8100000", - "unit": "Libra" - }, - "Start": 46, - "End": 59 - } - ] - }, - { - "Input": "Os ingressos liquidos por interesse cairam uns 27% no trimestre a $ 254 milhões", - "Results": [ - { - "Text": "$ 254 milhões", - "TypeName": "currency", - "Resolution": { - "value": "254000000", - "unit": "Dólar" - }, - "Start": 66, - "End": 78 - } - ] - }, - { - "Input": "Um tribunal de apelacoes federal anulou uma regulacao de gas natural que havía impedido que as companhis de gasoductos passassem aos clientes o gasto de $ um bilhão em custos de contratos controversos", - "Results": [ - { - "Text": "$ um bilhão", - "TypeName": "currency", - "Resolution": { - "value": "1000000000", - "unit": "Dólar" - }, - "Start": 153, - "End": 163 - } - ] - }, - { - "Input": "O trimestre de 1988 também incluiu ganancias únicas por um total de aproximadamente $ 35 milhões.", - "Results": [ - { - "Text": "$ 35 milhões", - "TypeName": "currency", - "Resolution": { - "value": "35000000", - "unit": "Dólar" - }, - "Start": 84, - "End": 95 - } - ] - }, - { - "Input": "Y.J.Park e sua familia subsistiram durante quatro anos para comprar um pequeno apartamento aqui, mas descobriram que quanto mais perto eles estavam de chegar a juntar os $ 40.000 que originalmente necesitavam, mais subia o preco.", - "Results": [ - { - "Text": "$ 40.000", - "TypeName": "currency", - "Resolution": { - "value": "40000", - "unit": "Dólar" - }, - "Start": 170, - "End": 177 - } - ] - }, - { - "Input": "E. Robert Wallach foi sentenciado por um juiz de Nova York a seis anos de prisão e uma multa de $250.000 por sua extorção no escândalo de Wedtech.", - "Results": [ - { - "Text": "$250.000", - "TypeName": "currency", - "Resolution": { - "value": "250000", - "unit": "Dólar" - }, - "Start": 96, - "End": 103 - } - ] - }, - { - "Input": "Um artigo publicado na quarta na pesquisa económica do Oriente Medio revela que o Iraque pediu a seus clientes que paguem 50 centavos a mais por barril de petróleo sobre o preço oficial do petróleo a 1 de dezembro em uma conta que não está sob a supervisão das nações unidas.", - "Results": [ - { - "Text": "50 centavos", - "TypeName": "currency", - "Resolution": { - "value": "50", - "unit": "Centavo" - }, - "Start": 122, - "End": 132 - } - ] - }, - { - "Input": "A divisão Chevrolet da General Motors Corp., reagindo às vendas lentas, disse que oferecerá descontos de $ 800 em sua Beretta 1990, a versión de duas portas de sua linha base de automóveis compactos.", - "Results": [ - { - "Text": "$ 800", - "TypeName": "currency", - "Resolution": { - "value": "800", - "unit": "Dólar" - }, - "Start": 105, - "End": 109 - } - ] - }, - { - "Input": "(El almacenista también tomó $ 125 milhões de bonos Junior SCI TV como pago parcial para los activos de TV).", - "Results": [ - { - "Text": "$ 125 milhões", - "TypeName": "currency", - "Resolution": { - "value": "125000000", - "unit": "Dólar" - }, - "Start": 29, - "End": 41 - } - ] - }, - { - "Input": "En el mercado nacional de venta libre, las acciones de Scimed cayeron 2,75 dólares.", - "Results": [ - { - "Text": "2,75 dólares", - "TypeName": "currency", - "Resolution": { - "value": "2,75", - "unit": "Dólar" - }, - "Start": 70, - "End": 81 - } - ] - }, - { - "Input": "Ao mesmo tempo, os investidores estimam que a reestructuração reduziria os débitos em aproximadamente USD$ 90 milhões.", - "Results": [ - { - "Text": "usd$ 90 milhões", - "TypeName": "currency", - "Resolution": { - "value": "90000000", - "unit": "Dólar estadunidense" - }, - "Start": 102, - "End": 116 - } - ] - }, - { - "Input": "Los gastos de capital en 1990 aumentarán ligeramente, dijo Mr.Marous, de un estimado de $ 470 milhões este año", - "Results": [ - { - "Text": "$ 470 milhões", - "TypeName": "currency", - "Resolution": { - "value": "470000000", - "unit": "Dólar" - }, - "Start": 88, - "End": 100 - } - ] - }, - { - "Input": "Shearson \"realmente solo tiene $ 300 milhões de capital\", dice el sr. Bowman de S&P.", - "Results": [ - { - "Text": "$ 300 milhões", - "TypeName": "currency", - "Resolution": { - "value": "300000000", - "unit": "Dólar" - }, - "Start": 31, - "End": 43 - } - ] - }, - { - "Input": "Puede ser directo (él quiere el dinero para alimento) o increíblemente enrevesado; su hermana está en este momento cerca de la muerte en Hoboken, ha perdido su cartera y tiene sólo $ 1,22 en cambio para poner un billete de autobús, y no le das la diferencia?", - "Results": [ - { - "Text": "$ 1,22", - "TypeName": "currency", - "Resolution": { - "value": "1,22", - "unit": "Dólar" - }, - "Start": 181, - "End": 186 - } - ] - }, - { - "Input": "El contrato de diciembre subió 1,20 centavos", - "Results": [ - { - "Text": "1,20 centavos", - "TypeName": "currency", - "Resolution": { - "value": "1,2", - "unit": "Centavo" - }, - "Start": 31, - "End": 43 - } - ] - }, - { - "Input": "Walter Kirchberger, un analista de Painewebber inc., dijo que ofrecer a los interesados un precio más alto de $ 70 por acción es \"un método bastante efectivo de bloquear\" la oferta.", - "Results": [ - { - "Text": "$ 70", - "TypeName": "currency", - "Resolution": { - "value": "70", - "unit": "Dólar" - }, - "Start": 110, - "End": 113 - } - ] - }, - { - "Input": "Las ventas netas para el tercer trimestre de este año fueron de $ 14 milhões más que el año pasado.", - "Results": [ - { - "Text": "$ 14 milhões", - "TypeName": "currency", - "Resolution": { - "value": "14000000", - "unit": "Dólar" - }, - "Start": 64, - "End": 75 - } - ] - }, - { - "Input": "La compañía matriz del primer banco nacional de Chicago, con 48.000 milhões de dólares en activos, dijo que se reservó de absorber pérdidas en préstamos e inversiones en países con dificultades financieras.", - "Results": [ - { - "Text": "48.000 milhões de dólares", - "TypeName": "currency", - "Resolution": { - "value": "48000000000", - "unit": "Dólar" - }, - "Start": 61, - "End": 85 - } - ] - }, - { - "Input": "Fluor Corp. dijo que se le adjudicó un contrato de $ 300 milhões para prestar servicios de ingeniería y gestión de la construcción en una mina de cobre en Irian Jaya, Indonesia, para una unidad de Freeport-McMoran Copper co.", - "Results": [ - { - "Text": "$ 300 milhões", - "TypeName": "currency", - "Resolution": { - "value": "300000000", - "unit": "Dólar" - }, - "Start": 51, - "End": 63 - } - ] - }, - { - "Input": "La bolsa americana dijo que un asiento fue vendido por $ 5.000 desde la venta anterior el viernes pasado.", - "Results": [ - { - "Text": "$ 5.000", - "TypeName": "currency", - "Resolution": { - "value": "5000", - "unit": "Dólar" - }, - "Start": 55, - "End": 61 - } - ] - }, - { - "Input": "Warner Communications Inc., que está siendo adquirida por Time Warner, ha presentado una demanda por violación de contrato de um bilhão de dólares contra Sony y dos productores.", - "Results": [ - { - "Text": "um bilhão de dólares", - "TypeName": "currency", - "Resolution": { - "value": "1000000000", - "unit": "Dólar" - }, - "Start": 126, - "End": 145 - } - ] - }, - { - "Input": "En agosto, Asarco, a través de su subsidiaria Lac d'amiante Du Québec, vendió el interés restante de un tercio en una sociedad limitada minera de amianto en Canadá por $ 11,7 milhões.", - "Results": [ - { - "Text": "$ 11,7 milhões", - "TypeName": "currency", - "Resolution": { - "value": "11700000", - "unit": "Dólar" - }, - "Start": 168, - "End": 181 - } - ] - }, - { - "Input": "En 1988, las exportaciones de juguetes y juegos de producción nacional cayeron un 19% desde 1987 hasta alcanzar los 10050 milhões de dólares de Hong Kong.", - "Results": [ - { - "Text": "10050 milhões de dólares de hong kong", - "TypeName": "currency", - "Resolution": { - "value": "10050000000", - "unit": "Dólar de Hong Kong" - }, - "Start": 116, - "End": 152 - } - ] - }, - { - "Input": "Las ventas del cuarto trimestre fiscal crecieron cerca de 18% a $ 1,17 bilhões en comparacion com o ano anterior.", - "Results": [ - { - "Text": "$ 1,17 bilhões", - "TypeName": "currency", - "Resolution": { - "value": "1170000000", - "unit": "Dólar" - }, - "Start": 64, - "End": 77 - } - ] - }, - { - "Input": "Durante la primera hora de ayer, los precios cayeron hasta 1/4 de punto, o bajaron alrededor de $ 2,50 por cada monto nominal.", - "Results": [ - { - "Text": "$ 2,50", - "TypeName": "currency", - "Resolution": { - "value": "2,5", - "unit": "Dólar" - }, - "Start": 96, - "End": 101 - } - ] - }, - { - "Input": "New Jersey, por ejemplo, se le pidió que aceptara $ 300.000, pero se negó", - "Results": [ - { - "Text": "$ 300.000", - "TypeName": "currency", - "Resolution": { - "value": "300000", - "unit": "Dólar" - }, - "Start": 50, - "End": 58 - } - ] - }, - { - "Input": "Las ventas subieron 6,2% a $ 1,45 bilhões", - "Results": [ - { - "Text": "$ 1,45 bilhões", - "TypeName": "currency", - "Resolution": { - "value": "1450000000", - "unit": "Dólar" - }, - "Start": 27, - "End": 40 - } - ] - }, - { - "Input": "A partir de ayer por la tarde, los reembolsos representaron menos del 15% de la posición total de efectivo de alrededor de $ 2 bilhões de los fondos de acciones de fidelidad.", - "Results": [ - { - "Text": "$ 2 bilhões", - "TypeName": "currency", - "Resolution": { - "value": "2000000000", - "unit": "Dólar" - }, - "Start": 123, - "End": 133 - } - ] - }, - { - "Input": "Onvia. Com Inc., bajó 34 centavos", - "Results": [ - { - "Text": "34 centavos", - "TypeName": "currency", - "Resolution": { - "value": "34", - "unit": "Centavo" - }, - "Start": 22, - "End": 32 - } - ] - }, - { - "Input": "El nuevo folleto dice que si la adquisición hubiera sido completada antes, las ganancias antes de impuestos \"habrían sido insuficientes para cubrir sus cargos fijos, incluyendo intereses sobre títulos de deuda\", por aproximadamente $ 62,7 milhões en el primer semestre de 1989.", - "Results": [ - { - "Text": "$ 62,7 milhões", - "TypeName": "currency", - "Resolution": { - "value": "62700000", - "unit": "Dólar" - }, - "Start": 232, - "End": 245 - } - ] - }, - { - "Input": "Filenet señaló que tenía efectivo y valores negociables por un total de $ 22,5 milhões en septiembre.", - "Results": [ - { - "Text": "$ 22,5 milhões", - "TypeName": "currency", - "Resolution": { - "value": "22500000", - "unit": "Dólar" - }, - "Start": 72, - "End": 85 - } - ] - }, - { - "Input": "Para los 20 restaurantes más caros de la ciudad, el precio de una cena aumentó a $ 63,45, también hubo un aumento del 8 por ciento.", - "Results": [ - { - "Text": "$ 63,45", - "TypeName": "currency", - "Resolution": { - "value": "63,45", - "unit": "Dólar" - }, - "Start": 81, - "End": 87 - } - ] - }, - { - "Input": "Trans Mundo Airlines Inc., ofreciendo billetes senior de 150 milhões de dólares, a través de Drexel Burnham.", - "Results": [ - { - "Text": "150 milhões de dólares", - "TypeName": "currency", - "Resolution": { - "value": "150000000", - "unit": "Dólar" - }, - "Start": 57, - "End": 78 - } - ] - }, - { - "Input": "El fettuccine con champiñones portobello cuesta $ 8,50.", - "Results": [ - { - "Text": "$ 8,50", - "TypeName": "currency", - "Resolution": { - "value": "8,5", - "unit": "Dólar" - }, - "Start": 48, - "End": 53 - } - ] - }, - { - "Input": "El delivery de marzo terminó con un anticipo de 14,27 centavos", - "Results": [ - { - "Text": "14,27 centavos", - "TypeName": "currency", - "Resolution": { - "value": "14,27", - "unit": "Centavo" - }, - "Start": 48, - "End": 61 - } - ] - }, - { - "Input": "En el tercer trimestre de 1988 fue de $ 75,3 milhões", - "Results": [ - { - "Text": "$ 75,3 milhões", - "TypeName": "currency", - "Resolution": { - "value": "75300000", - "unit": "Dólar" - }, - "Start": 38, - "End": 51 - } - ] - }, - { - "Input": "La confianza de los demandantes del protector del dalkon $ 2,38 bilhões fue establecida", - "Results": [ - { - "Text": "$ 2,38 bilhões", - "TypeName": "currency", - "Resolution": { - "value": "2380000000", - "unit": "Dólar" - }, - "Start": 57, - "End": 70 - } - ] - }, - { - "Input": "Los términos de la oferta pusieron un valor de 528 milhões de francos por 32,99% de participación", - "Results": [ - { - "Text": "528 milhões de francos", - "TypeName": "currency", - "Resolution": { - "value": "528000000", - "unit": "Franco" - }, - "Start": 47, - "End": 68 - } - ] - }, - { - "Input": "Rusia aceptó un préstamo del Banco Mundial de US$ 150 milhões para combatir la propagación del sida y la tuberculosis, poniendo fin a un proceso de negociación que duró cuatro años, dijeron el viernes funcionarios del Banco Mundial.", - "Results": [ - { - "Text": "us$ 150 milhões", - "TypeName": "currency", - "Resolution": { - "value": "150000000", - "unit": "Dólar estadunidense" - }, - "Start": 46, - "End": 60 - } - ] - }, - { - "Input": "El pacto de la campana anterior estaba valorado en alrededor de $ 98 por acción", - "Results": [ - { - "Text": "$ 98", - "TypeName": "currency", - "Resolution": { - "value": "98", - "unit": "Dólar" - }, - "Start": 64, - "End": 67 - } - ] - }, - { - "Input": "Un distribuidor dijo que la conversación fue que la firma vendió cerca de 500 milhões de dólares de bonos de 30 años", - "Results": [ - { - "Text": "500 milhões de dólares", - "TypeName": "currency", - "Resolution": { - "value": "500000000", - "unit": "Dólar" - }, - "Start": 74, - "End": 95 - } - ] - }, - { - "Input": "Para el tercer trimestre, Sears dijo que sus ingresos totales aumentaron 4. 8% a $ 13180 milhões a un año antes.", - "Results": [ - { - "Text": "$ 13180 milhões", - "TypeName": "currency", - "Resolution": { - "value": "13180000000", - "unit": "Dólar" - }, - "Start": 81, - "End": 95 - } - ] - }, - { - "Input": "Para los nueve meses, el etil dijo que la red cayó 2% o $ 1,40 por acción", - "Results": [ - { - "Text": "$ 1,40", - "TypeName": "currency", - "Resolution": { - "value": "1,4", - "unit": "Dólar" - }, - "Start": 56, - "End": 61 - } - ] - }, - { - "Input": "Las expectativas de los analistas sugieren un déficit en cuenta corriente de septiembre de 1. 6 bilhões ($ 2,54 bilhões), comparado con los 2MM de agosto en déficit.", - "Results": [ - { - "Text": "$ 2,54 bilhões", - "TypeName": "currency", - "Resolution": { - "value": "2540000000", - "unit": "Dólar" - }, - "Start": 105, - "End": 118 - } - ] - }, - { - "Input": "125 milhões de dólares australianos de eurobonos de cupón, a un precio de 50,9375 para producir 15,06% menos comisiones a través de Hambros Bank ltd.", - "Results": [ - { - "Text": "125 milhões de dólares australianos", - "TypeName": "currency", - "Resolution": { - "value": "125000000", - "unit": "Dólar australiano" - }, - "Start": 0, - "End": 34 - } - ] - }, - { - "Input": "El viernes, el secretario jefe del gabinete anunció que ocho ministros del gabinete habían recibido cinco milhões de ienes de la industria", - "Results": [ - { - "Text": "cinco milhões de ienes", - "TypeName": "currency", - "Resolution": { - "value": "5000000", - "unit": "Yen" - }, - "Start": 100, - "End": 121 - } - ] - }, - { - "Input": "Incluyendo 450.000 yenes por el primer ministro Toshiki Kaifu", - "Results": [ - { - "Text": "450.000 yenes", - "TypeName": "currency", - "Resolution": { - "value": "450000", - "unit": "Yen" - }, - "Start": 11, - "End": 23 - } - ] - }, - { - "Input": "Dóllar : 143,80 yenes, arriba de 0,95; 1.8500 pontos, arriba de 0,0085.", - "Results": [ - { - "Text": "143,80 yenes", - "TypeName": "currency", - "Resolution": { - "value": "143,8", - "unit": "Yen" - }, - "Start": 9, - "End": 20 - } - ] - }, - { - "Input": "Orkem S.A., un fabricante francés de productos químicos controlados por el Estado, está haciendo una oferta amistosa de 470 penies por acción para los 59,2% de UK", - "Results": [ - { - "Text": "470 penies", - "TypeName": "currency", - "Resolution": { - "value": "470", - "unit": "Pêni" - }, - "Start": 120, - "End": 129 - } - ] - }, - { - "Input": "Agosto, el gasto ajustado de las familias asalariadas disminuyó 0,6% a 309.381 yenes de un año antes.", - "Results": [ - { - "Text": "309.381 yenes", - "TypeName": "currency", - "Resolution": { - "value": "309381", - "unit": "Yen" - }, - "Start": 71, - "End": 83 - } - ] - }, - { - "Input": "Sr. Bowder dijo que los C$ 300 milhões de ingresos...", - "Results": [ - { - "Text": "c$ 300 milhões", - "TypeName": "currency", - "Resolution": { - "value": "300000000", - "unit": "Dólar canadense" - }, - "Start": 24, - "End": 37 - } - ] - }, - { - "Input": "Ascendería a alrededor de C$ 1,34 por acción.", - "Results": [ - { - "Text": "c$ 1,34", - "TypeName": "currency", - "Resolution": { - "value": "1,34", - "unit": "Dólar canadense" - }, - "Start": 26, - "End": 32 - } - ] - }, - { - "Input": "Los precios de los huevos promediaron 64,2 centavos la docena.", - "Results": [ - { - "Text": "64,2 centavos", - "TypeName": "currency", - "Resolution": { - "value": "64,2", - "unit": "Centavo" - }, - "Start": 38, - "End": 50 - } - ] - }, - { - "Input": "Aún así, dijo que espera que las ventas para 1989 sean del orden de los 20.000 milhões de francos, lo que refleja la facturación anticipada de dos grandes contratos en la segunda mitad del año.", - "Results": [ - { - "Text": "20.000 milhões de francos", - "TypeName": "currency", - "Resolution": { - "value": "20000000000", - "unit": "Franco" - }, - "Start": 72, - "End": 96 - } - ] - }, - { - "Input": "La transacción pidió a Murdoch's News International, una unidad de noticias australia corp., para suscribir una emisión de derechos valorada en 6,65 bilhões de pesetas.", - "Results": [ - { - "Text": "6,65 bilhões de pesetas", - "TypeName": "currency", - "Resolution": { - "value": "6650000000", - "unit": "Peseta" - }, - "Start": 144, - "End": 166 - } - ] - }, - { - "Input": "Fujitsu ltd dijo que quiere retirar su polémica oferta de um yen para diseñar un sistema de computadoras de agua para la ciudad de hiroshima.", - "Results": [ - { - "Text": "um yen", - "TypeName": "currency", - "Resolution": { - "value": "1", - "unit": "Yen" - }, - "Start": 58, - "End": 63 - } - ] - }, - { - "Input": "250 milhões de florins holandeses de 7 3/4% de bonos debidos nov. 15, 1999, a un precio de 101 1/4 para dar 7. 57% do preço de emisión y 7. 86% menos los honorarios completos, vía el banco del amro.", - "Results": [ - { - "Text": "250 milhões de florins holandeses", - "TypeName": "currency", - "Resolution": { - "value": "250000000", - "unit": "Florim holandês" - }, - "Start": 0, - "End": 32 - } - ] - }, - { - "Input": "Además, el banco tiene la opción de comprar una participación de 30,84% en BIP societe generale después de enero. 1.1990 a 1.015 francos por acción.", - "Results": [ - { - "Text": "1.015 francos", - "TypeName": "currency", - "Resolution": { - "value": "1015", - "unit": "Franco" - }, - "Start": 123, - "End": 135 - } - ] - }, - { - "Input": "Sus acciones se deslizaron en los últimos tratos para cerrar um centavo", - "Results": [ - { - "Text": "um centavo", - "TypeName": "currency", - "Resolution": { - "value": "1", - "unit": "Centavo" - }, - "Start": 61, - "End": 70 - } - ] - }, - { - "Input": "Por acción menor a 197 penies.", - "Results": [ - { - "Text": "197 penies", - "TypeName": "currency", - "Resolution": { - "value": "197", - "unit": "Pêni" - }, - "Start": 19, - "End": 28 - } - ] - }, - { - "Input": "Su beneficio operativo trimestral mejoró a 361 milhões de libras", - "Results": [ - { - "Text": "361 milhões de libras", - "TypeName": "currency", - "Resolution": { - "value": "361000000", - "unit": "Libra" - }, - "Start": 43, - "End": 63 - } - ] - }, - { - "Input": "El año pasado, el valor bruto de producción de las empresas del municipio de toda la ciudad se rompió por 100 milhões de yuans por primera vez, ocupando el primer lugar en toda la provincia.", - "Results": [ - { - "Text": "100 milhões de yuans", - "TypeName": "currency", - "Resolution": { - "value": "100000000", - "unit": "Yuan chinês" - }, - "Start": 106, - "End": 125 - } - ] - }, - { - "Input": "Los guardabosques consiguieron guardar £ 50 milhões ahorrados por el consejo de Baxendale-Walker.", - "Results": [ - { - "Text": "£ 50 milhões", - "TypeName": "currency", - "Resolution": { - "value": "50000000", - "unit": "Libra" - }, - "Start": 39, - "End": 50 - } - ] - }, - { - "Input": "A su vez, francis leung pak-to ha acordado vender una participación de 8% en PCCW a telefónica por 323 milhões de euros.", - "Results": [ - { - "Text": "323 milhões de euros", - "TypeName": "currency", - "Resolution": { - "value": "323000000", - "unit": "Euro" - }, - "Start": 99, - "End": 118 - } - ] - }, - { - "Input": "La UEFA acusó a ferguson de desacreditar el juego con sus comentarios, y el 1 de mayo de ese año fue multado con 10.000 francos suicos.", - "Results": [ - { - "Text": "10.000 francos suicos", - "TypeName": "currency", - "Resolution": { - "value": "10000", - "unit": "Franco suíço" - }, - "Start": 113, - "End": 133 - } - ] - }, - { - "Input": "El IPL firmó a las líneas aéreas de martín pescador como el socio oficial del árbitro para la serie en un reparto (aproximadamente £ 15 milhões).", - "Results": [ - { - "Text": "£ 15 milhões", - "TypeName": "currency", - "Resolution": { - "value": "15000000", - "unit": "Libra" - }, - "Start": 131, - "End": 142 - } - ] - }, - { - "Input": "Los ingresos de la industria electrónica de adelaide ha crecido en alrededor del 15% anual desde 1990, y en 2011 supera os $ 4 bilhões.", - "Results": [ - { - "Text": "$ 4 bilhões", - "TypeName": "currency", - "Resolution": { - "value": "4000000000", - "unit": "Dólar" - }, - "Start": 123, - "End": 133 - } - ] - }, - { - "Input": "Abel y sus asociados ofrecen 4 milhoes de dólares por hacer los efectos de la película.", - "Results": [ - { - "Text": "4 milhoes de dólares", - "TypeName": "currency", - "Resolution": { - "value": "4000000", - "unit": "Dólar" - }, - "Start": 29, - "End": 48 - } - ] - }, - { - "Input": "Malone demandó a 20th century-fox por $ 1,6 milhões por incumplimiento de contrato.", - "Results": [ - { - "Text": "$ 1,6 milhões", - "TypeName": "currency", - "Resolution": { - "value": "1600000", - "unit": "Dólar" - }, - "Start": 38, - "End": 50 - } - ] - }, - { - "Input": "En 2003, Bayern Munich prestó € 2 milhões a Dortmund por un par de meses para pagar su nómina.", - "Results": [ - { - "Text": "€ 2 milhões", - "TypeName": "currency", - "Resolution": { - "value": "2000000", - "unit": "Euro" - }, - "Start": 30, - "End": 40 - } - ] - }, - { - "Input": "Lockheed Martin y el gobierno de los Estados Unidos intensamente presionaron para el contrato de US$ 10 bilhões de la India para 126 aviones de combate.", - "Results": [ - { - "Text": "us$ 10 bilhões", - "TypeName": "currency", - "Resolution": { - "value": "10000000000", - "unit": "Dólar estadunidense" - }, - "Start": 97, - "End": 110 - } - ] - }, - { - "Input": "Según la firma de investigación NPD, el precio de venta promedio de todas las PC portátiles de las ventanas ha caído de $ 659 en octubre de 2008 a", - "Results": [ - { - "Text": "$ 659", - "TypeName": "currency", - "Resolution": { - "value": "659", - "unit": "Dólar" - }, - "Start": 120, - "End": 124 - } - ] - }, - { - "Input": "Tel flotó en la bolsa australiana a $ 2 por acción en noviembre de 1997.", - "Results": [ - { - "Text": "$ 2", - "TypeName": "currency", - "Resolution": { - "value": "2", - "unit": "Dólar" - }, - "Start": 36, - "End": 38 - } - ] - }, - { - "Input": "El stand del este (la avenida de Worcester) se terminó en 1934 y esta capacidad aumentada a alrededor 80.000 espectadores pero costó £ 60.000.", - "Results": [ - { - "Text": "£ 60.000", - "TypeName": "currency", - "Resolution": { - "value": "60000", - "unit": "Libra" - }, - "Start": 133, - "End": 140 - } - ] - }, - { - "Input": "Su compañero de equipo Fulham Johnny Haynes se convirtió en el primer jugador de £ 100.", - "Results": [ - { - "Text": "£ 100", - "TypeName": "currency", - "Resolution": { - "value": "100", - "unit": "Libra" - }, - "Start": 81, - "End": 85 - } - ] - }, - { - "Input": "Para los nueve meses, la red de AMR subió 15% a $ 415,9 milhões", - "Results": [ - { - "Text": "$ 415,9 milhões", - "TypeName": "currency", - "Resolution": { - "value": "415900000", - "unit": "Dólar" - }, - "Start": 48, - "End": 62 - } - ] - }, - { - "Input": "El precio de la acción de la aerolínea ya está muy por debajo del nivel de 210 penies visto después de que la compañía anunció la emisión de derechos a fines de septiembre.", - "Results": [ - { - "Text": "210 penies", - "TypeName": "currency", - "Resolution": { - "value": "210", - "unit": "Pêni" - }, - "Start": 75, - "End": 84 - } - ] - }, - { - "Input": "Rolling Stone observó, \"Harpercollins adquirió el proyecto de libro por $ 3 milhoes en 2008.", - "Results": [ - { - "Text": "$ 3 milhoes", - "TypeName": "currency", - "Resolution": { - "value": "3000000", - "unit": "Dólar" - }, - "Start": 72, - "End": 82 - } - ] - }, - { - "Input": "Su conclusión fue un pronunciamiento terso que $ 48 \"no es adecuado\"", - "Results": [ - { - "Text": "$ 48", - "TypeName": "currency", - "Resolution": { - "value": "48", - "unit": "Dólar" - }, - "Start": 47, - "End": 50 - } - ] - }, - { - "Input": "2013, la edición de la revista forbes presenta a Keith en la portada con el título música country's $ 500 milhoes.", - "Results": [ - { - "Text": "$ 500 milhoes", - "TypeName": "currency", - "Resolution": { - "value": "500000000", - "unit": "Dólar" - }, - "Start": 100, - "End": 112 - } - ] - }, - { - "Input": "Harry Ferguson nos demandó por el uso ilegal de sus patentes pidiendo una indemnización de £ 90 milhões, resuelto fuera de la corte en 1952.", - "Results": [ - { - "Text": "£ 90 milhões", - "TypeName": "currency", - "Resolution": { - "value": "90000000", - "unit": "Libra" - }, - "Start": 91, - "End": 102 - } - ] - }, - { - "Input": "Aerosmith firmó con Columbia a mediados de 1972 por $ 125.000 y publicó su álbum debut, Aerosmith.", - "Results": [ - { - "Text": "$ 125.000", - "TypeName": "currency", - "Resolution": { - "value": "125000", - "unit": "Dólar" - }, - "Start": 52, - "End": 60 - } - ] - }, - { - "Input": "Fue una de las mayores adquisiciones de Coke desde que compró Odwalla Inc. por $ 186 milhões en 2001.", - "Results": [ - { - "Text": "$ 186 milhões", - "TypeName": "currency", - "Resolution": { - "value": "186000000", - "unit": "Dólar" - }, - "Start": 79, - "End": 91 - } - ] - }, - { - "Input": "Apple y Creative llegaron a un acuerdo, con Apple pagando $ 100 milhões a Creative y Creative para unir-se ao programa de acesórios \"feito para ipod\".", - "Results": [ - { - "Text": "$ 100 milhões", - "TypeName": "currency", - "Resolution": { - "value": "100000000", - "unit": "Dólar" - }, - "Start": 58, - "End": 70 - } - ] - }, - { - "Input": "A su vez, francis leung pak-a ha acordado vender una participación de 8% en PCCW a telefónica por 323 milhões de euros.", - "Results": [ - { - "Text": "323 milhões de euros", - "TypeName": "currency", - "Resolution": { - "value": "323000000", - "unit": "Euro" - }, - "Start": 98, - "End": 117 - } - ] - }, - { - "Input": "Malone demandó a 20th century-fox por 1,6 milhoes de dólares por incumplimiento de contrato;", - "Results": [ - { - "Text": "1,6 milhoes de dólares", - "TypeName": "currency", - "Resolution": { - "value": "1600000", - "unit": "Dólar" - }, - "Start": 38, - "End": 59 - } - ] - }, - { - "Input": "En 2003, Bayern munich prestó € 2 milhões a Dortmund por un par de meses para pagar su nómina.", - "Results": [ - { - "Text": "€ 2 milhões", - "TypeName": "currency", - "Resolution": { - "value": "2000000", - "unit": "Euro" - }, - "Start": 30, - "End": 40 - } - ] - }, - { - "Input": "Lockheed martin y el gobierno de los estados unidos intensamente presionaron para el contrato de US$ 10 bilhões de la India para 126 aviones de combate.", - "Results": [ - { - "Text": "us$ 10 bilhões", - "TypeName": "currency", - "Resolution": { - "value": "10000000000", - "unit": "Dólar estadunidense" - }, - "Start": 97, - "End": 110 - } - ] - }, - { - "Input": "La presentación de hart-scott se revisa y se resuelve cualquier problema antimonopolio. Por lo general, hart-scott se utiliza ahora para dar a los gerentes de las firmas objetivo noticias tempranas de una oferta y la oportunidad de utilizar la revisión regulatoria como una táctica de retraso. El impuesto de 20.000 dólares sería un pequeño costo en un acuerdo de varios billones de dólares, pero un grave obstáculo para miles de pequeños acuerdos amistosos.", - "Results": [ - { - "Text": "20.000 dólares", - "TypeName": "currency", - "Resolution": { - "value": "20000", - "unit": "Dólar" - }, - "Start": 309, - "End": 322 - }, - { - "Text": "dólares", - "TypeName": "currency", - "Resolution": { - "value": null, - "unit": "Dólar" - }, - "Start": 383, - "End": 389 - } - ] - }, - { - "Input": "El fideicomiso de rentas nacionales de bienes raíces dijo que reanudará los pagos de dividendos con un dividendo de 12 centavos de dólar que se pagará el 6 de noviembre a las acciones de récord el 25 de octubre.", - "Results": [ - { - "Text": "12 centavos", - "TypeName": "currency", - "Resolution": { - "value": "12", - "unit": "Centavo" - }, - "Start": 116, - "End": 126 - }, - { - "Text": "dólar", - "TypeName": "currency", - "Resolution": { - "value": null, - "unit": "Dólar" - }, - "Start": 131, - "End": 135 - } - ] - }, - { - "Input": "Eu ganhei duzentos BTC.", - "Results": [ - { - "Text": "duzentos btc", - "TypeName": "currency", - "Resolution": { - "value": "200", - "unit": "Bitcoin" - }, - "Start": 10, - "End": 21 - } - ] - }, - { - "Input": "custou apenas 15 dólares e 15 centavos.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "15 dólares e 15 centavos", - "TypeName": "currency", - "Resolution": { - "value": "15,15", - "unit": "Dólar" - }, - "Start": 14, - "End": 37 - } - ] - }, - { - "Input": "custou apenas treze euros e quarenta e cinco centavos.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "treze euros e quarenta e cinco centavos", - "TypeName": "currency", - "Resolution": { - "value": "13,45", - "unit": "Euro" - }, - "Start": 14, - "End": 52 - } - ] - }, - { - "Input": "custa apenas 15 dólares e 15.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "15 dólares e 15", - "TypeName": "currency", - "Resolution": { - "value": "15,15", - "unit": "Dólar" - }, - "Start": 13, - "End": 27 - } - ] - }, - { - "Input": "custa apenas 15 dólares 50.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "15 dólares 50", - "TypeName": "currency", - "Resolution": { - "value": "15,5", - "unit": "Dólar" - }, - "Start": 13, - "End": 25 - } - ] - }, - { - "Input": "custa apenas 15 dólares com 50.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "15 dólares com 50", - "TypeName": "currency", - "Resolution": { - "value": "15,5", - "unit": "Dólar" - }, - "Start": 13, - "End": 29 - } - ] - }, - { - "Input": "custa apenas 25 euros com 50.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "25 euros com 50", - "TypeName": "currency", - "Resolution": { - "value": "25,5", - "unit": "Euro" - }, - "Start": 13, - "End": 27 - } - ] - }, - { - "Input": "custa apenas 3 euros com 99 centavos.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "3 euros com 99 centavos", - "TypeName": "currency", - "Resolution": { - "value": "3,99", - "unit": "Euro" - }, - "Start": 13, - "End": 35 - } - ] - }, - { - "Input": "usd$ 15", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "usd$ 15", - "TypeName": "currency", - "Resolution": { - "value": "15", - "unit": "Dólar estadunidense", - "isoCurrency": "USD" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "mxn$ 15", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "mxn$ 15", - "TypeName": "currency", - "Resolution": { - "value": "15", - "unit": "Peso mexicano", - "isoCurrency": "MXN" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "aud$ 15", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "aud$ 15", - "TypeName": "currency", - "Resolution": { - "value": "15", - "unit": "Dólar australiano", - "isoCurrency": "AUD" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "cad$ 15", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "cad$ 15", - "TypeName": "currency", - "Resolution": { - "value": "15", - "unit": "Dólar canadense", - "isoCurrency": "CAD" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "nzd$15", - "NotSupported": "javascript, python, java", - "Results": [ - { - "Text": "nzd$15", - "TypeName": "currency", - "Resolution": { - "value": "15", - "unit": "Dólar neozelandês", - "isoCurrency": "NZD" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "15 dólares e 15 centavos, por favor", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "15 dólares e 15 centavos", - "TypeName": "currency", - "Resolution": { - "value": "15,15", - "unit": "Dólar" - }, - "Start": 0, - "End": 23 - } - ] - }, - { - "Input": "Eles perderam 75 USD milhões nos últimos três anos.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "75 usd milhões", - "TypeName": "currency", - "Resolution": { - "value": "75000000", - "unit": "Dólar estadunidense", - "isoCurrency": "USD" - }, - "Start": 14, - "End": 27 - } - ] - }, - { - "Input": "Os preços do negócio começam em dólares 22,5 milhões.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "dólares 22,5 milhões", - "TypeName": "currency", - "Resolution": { - "value": "22500000", - "unit": "Dólar" - }, - "Start": 32, - "End": 51 - } - ] - }, - { - "Input": "Os preços do negócio começam em dólar 22500000.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "dólar 22500000", - "TypeName": "currency", - "Resolution": { - "value": "22500000", - "unit": "Dólar" - }, - "Start": 32, - "End": 45 - } - ] - }, - { - "Input": "Por 15 dólares 50 você pode almoçar e jantar", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "15 dólares 50", - "TypeName": "currency", - "Resolution": { - "value": "15,5", - "unit": "Dólar" - }, - "Start": 4, - "End": 16 - } - ] - }, - { - "Input": "Por 15 USD 50 você pode almoçar e jantar.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "15 usd 50", - "TypeName": "currency", - "Resolution": { - "value": "15,5", - "unit": "Dólar estadunidense", - "isoCurrency": "USD" - }, - "Start": 4, - "End": 12 - } - ] - }, - { - "Input": "Eles pagaram 75 USD milhões, mas o preço na verdade foi de 50 milhões USD. E se tivessem mais 15 USD 50, teriam pago 80 USD milhões.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "75 usd milhões", - "TypeName": "currency", - "Resolution": { - "value": "75000000", - "unit": "Dólar estadunidense", - "isoCurrency": "USD" - }, - "Start": 13, - "End": 26 - }, - { - "Text": "50 milhões usd", - "TypeName": "currency", - "Resolution": { - "value": "50000000", - "unit": "Dólar estadunidense", - "isoCurrency": "USD" - }, - "Start": 59, - "End": 72 - }, - { - "Text": "15 usd 50", - "TypeName": "currency", - "Resolution": { - "value": "15,5", - "unit": "Dólar estadunidense", - "isoCurrency": "USD" - }, - "Start": 94, - "End": 102 - }, - { - "Text": "80 usd milhões", - "TypeName": "currency", - "Resolution": { - "value": "80000000", - "unit": "Dólar estadunidense", - "isoCurrency": "USD" - }, - "Start": 117, - "End": 130 - } - ] - }, - { - "Input": "O custo é de 500 USD,100 vezes mais do que o esperado.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "500 usd", - "TypeName": "currency", - "Resolution": { - "value": "500", - "unit": "Dólar estadunidense", - "isoCurrency": "USD" - }, - "Start": 13, - "End": 19 - } - ] - }, - { - "Input": "Um é obrigado a pagar três mil dólares duzentas vezes.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "três mil dólares", - "TypeName": "currency", - "Resolution": { - "value": "3000", - "unit": "Dólar" - }, - "Start": 22, - "End": 37 - } - ] - }, - { - "Input": "Eu contei os dólares milhares de vezes.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "dólares", - "TypeName": "currency", - "Resolution": { - "value": null, - "unit": "Dólar" - }, - "Start": 13, - "End": 19 - } - ] - }, - { - "Input": "O preço era na verdade 50 milhões de dólares.", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "50 milhões de dólares", - "TypeName": "currency", - "Resolution": { - "value": "50000000", - "unit": "Dólar" - }, - "Start": 23, - "End": 43 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Portuguese/DimensionModel.json b/Specs/NumberWithUnit/Portuguese/DimensionModel.json deleted file mode 100644 index 7a1558984a..0000000000 --- a/Specs/NumberWithUnit/Portuguese/DimensionModel.json +++ /dev/null @@ -1,1026 +0,0 @@ -[ - { - "Input": "são 180,25ml liquidos", - "Results": [ - { - "Text": "180,25ml", - "TypeName": "dimension", - "Resolution": { - "value": "180,25", - "unit": "Mililitro", - "subtype": "Volume" - }, - "Start": 4, - "End": 11 - } - ] - }, - { - "Input": "sao 180ml líquidos", - "Results": [ - { - "Text": "180ml", - "TypeName": "dimension", - "Resolution": { - "value": "180", - "unit": "Mililitro", - "subtype": "Volume" - }, - "Start": 4, - "End": 8 - } - ] - }, - { - "Input": " 29km caminhando ", - "Results": [ - { - "Text": "29km", - "TypeName": "dimension", - "Resolution": { - "value": "29", - "unit": "Quilômetro", - "subtype": "Length" - }, - "Start": 1, - "End": 4 - } - ] - }, - { - "Input": "são ,25ml liquidos", - "Results": [ - { - "Text": ",25ml", - "TypeName": "dimension", - "Resolution": { - "value": "0,25", - "unit": "Mililitro", - "subtype": "Volume" - }, - "Start": 4, - "End": 8 - } - ] - }, - { - "Input": "75ml", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Mililitro", - "subtype": "Volume" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "Su mayor inconveniente puede ser su espesor de 3 polegadas, lo suficientemente grande como para que un consultor lo describa como \"clunky\".", - "Results": [ - { - "Text": "3 polegadas", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Polegada", - "subtype": "Length" - }, - "Start": 47, - "End": 57 - } - ] - }, - { - "Input": "Se necesita más de 10 1/2 milhas de cable y alambre para conectar todo y 23 equipos", - "Results": [ - { - "Text": "10 1/2 milhas", - "TypeName": "dimension", - "Resolution": { - "value": "10,5", - "unit": "Milha", - "subtype": "Length" - }, - "Start": 19, - "End": 31 - } - ] - }, - { - "Input": "Es lo que 1) explica por qué somos como nosotros mismos en lugar de Bo Jackson; 2) advierte que es posible ahogarse en un lago que promedia dois pés de profundidad; y 3) predice que 10.000 monos colocados ante 10.000 pianos producirían 1.118 melodías publicitables del rock'n'roll.", - "Results": [ - { - "Text": "dois pés", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Pé", - "subtype": "Length" - }, - "Start": 140, - "End": 147 - } - ] - }, - { - "Input": "El sr. Hulings se regodea que vendió todas sus acciones una semana antes de que el mercado se desplomara 190 puntos en oct. 13, y está utilizando el dinero para ayudar a comprar una granja de caballos de 45 acres.", - "Results": [ - { - "Text": "45 acres", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Acre", - "subtype": "Area" - }, - "Start": 204, - "End": 211 - } - ] - }, - { - "Input": "Bartlett había levantado paredes sin ventanas (ladrillo, enrejado, seto) de ocho a dez pés de altura, convirtiendo sus interiores en una sombra stygiana de un día.", - "Results": [ - { - "Text": "dez pés", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Pé", - "subtype": "Length" - }, - "Start": 83, - "End": 89 - } - ] - }, - { - "Input": "'La administración no quiere sorpresas', comenta Jack Zaves, quien, como director de servicios de combustible de American Airlines, compra unos 2.400 milhões de galoes de combustible para aviones ao ano.", - "Results": [ - { - "Text": "2.400 milhões de galoes", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Galão", - "subtype": "Volume" - }, - "Start": 144, - "End": 166 - } - ] - }, - { - "Input": "Un refrigerador de agua de 10 galoes había caído no solo, empapando la alfombra roja.", - "Results": [ - { - "Text": "10 galoes", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Galão", - "subtype": "Volume" - }, - "Start": 27, - "End": 35 - } - ] - }, - { - "Input": "Cerca, seis delfines se divertirán en un acuario de agua salada de 1,5 milhoes de galões.", - "Results": [ - { - "Text": "1,5 milhoes de galões", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Galão", - "subtype": "Volume" - }, - "Start": 67, - "End": 87 - } - ] - }, - { - "Input": "Y este bebé tiene más de duas libras.", - "Results": [ - { - "Text": "duas libras", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Libra", - "subtype": "Weight" - }, - "Start": 25, - "End": 35 - } - ] - }, - { - "Input": "No confío en las personas que no comen, dijo ms. Volokh, aunque ella misma dejó de comer el almuerzo hace unos años para bajar 25 libras.", - "Results": [ - { - "Text": "25 libras", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Libra", - "subtype": "Weight" - }, - "Start": 127, - "End": 135 - } - ] - }, - { - "Input": "Un tornado rugió através de un area de umas dez milhas de área, matando ao menos a catorce personas y convirtiendo decenas de hogares en escombros", - "Results": [ - { - "Text": "dez milhas", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Milha", - "subtype": "Length" - }, - "Start": 44, - "End": 53 - } - ] - }, - { - "Input": "Shell, una subsidiaria del grupo real holandés, se le permitirá exportar 0,9 bilhões de pés cúbicos, y el Golfo, una unidad de olympia & york developments ltd. se permitirá exportar", - "Results": [ - { - "Text": "0,9 bilhões de pés cúbicos", - "TypeName": "dimension", - "Resolution": { - "value": "900000000", - "unit": "Pé cúbico", - "subtype": "Volume" - }, - "Start": 73, - "End": 98 - } - ] - }, - { - "Input": "Ejércitos Tigrean ahora están 200 milhas ao norte de Addis Ababa, amenazando la ciudad de éstos, que cortaría la capital de Mengistu desde el puerto de Assab, a través del cual todos los combustibles y otros suministros llegan a Addis Ababa.", - "Results": [ - { - "Text": "200 milhas", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Milha", - "subtype": "Length" - }, - "Start": 30, - "End": 39 - } - ] - }, - { - "Input": "Dijo que una de las pc tomó un viaje de tres pes deslizándose por el suelo.", - "Results": [ - { - "Text": "tres pes", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Pé", - "subtype": "Length" - }, - "Start": 40, - "End": 47 - } - ] - }, - { - "Input": "El núcleo de sus propiedades es de 190.000 metros quadrados de propiedad increíblemente caras en el distrito de Marunouchi, el centro financiero y de negocios de Tokyo, a menudo en broma llamada 'pueblo Mitsubishi'", - "Results": [ - { - "Text": "190.000 metros quadrados", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Metro quadrado", - "subtype": "Area" - }, - "Start": 35, - "End": 58 - } - ] - }, - { - "Input": "El satélite, construido por Hughes para la organización internacional de satélites de telecomunicaciones, forma parte de un contrato de 700 millones de dólares otorgado a Hughes en 1982 para desarrollar cinco satélites de tres toneladas.", - "Results": [ - { - "Text": "tres toneladas", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Tonelada", - "subtype": "Weight" - }, - "Start": 222, - "End": 235 - } - ] - }, - { - "Input": "En un informe de 1996 sobre armas biológicas, el centro de estudios estratégicos e internacionales, una institución de investigación de políticas públicas en Washington, advirtió que era fácil para los posibles terroristas montar armas biológicas utilizando equipo comercial con una capacidad de 130 galoes.", - "Results": [ - { - "Text": "130 galoes", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Galão", - "subtype": "Volume" - }, - "Start": 296, - "End": 305 - } - ] - }, - { - "Input": "La recopilación de datos del departamento de comercio del grupo de comercio mostró que las importaciones de Agosto, el segundo mayor mensual del año, subieron un 5% respecto de las 1.458.000 toneladas de julio, pero por debajo del máximo del año pasado en junio de 1988.", - "Results": [ - { - "Text": "1.458.000 toneladas", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Tonelada", - "subtype": "Weight" - }, - "Start": 181, - "End": 199 - } - ] - }, - { - "Input": "El 1 de noviembre, Singh tiró a unos seis pés de la taza", - "Results": [ - { - "Text": "seis pés", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Pé", - "subtype": "Length" - }, - "Start": 37, - "End": 44 - } - ] - }, - { - "Input": "Una t.métrica es igual a 2.204,62 libras.", - "Results": [ - { - "Text": "2.204,62 libras", - "TypeName": "dimension", - "Resolution": { - "value": "2204,62", - "unit": "Libra", - "subtype": "Weight" - }, - "Start": 25, - "End": 39 - }, - { - "Text": "t.métrica", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Tonelada métrica", - "subtype": "Weight" - }, - "Start": 4, - "End": 12 - } - ] - }, - { - "Input": "Por lo que cuando el cultivo de psyllium del año que viene se coseche en marzo, puede ser menor que las 16.000 toneladas métricas de los últimos años, justo en la cresta del boom del psyllium.", - "Results": [ - { - "Text": "16.000 toneladas métricas", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Tonelada métrica", - "subtype": "Weight" - }, - "Start": 104, - "End": 128 - } - ] - }, - { - "Input": "El 486 es el descendiente de una larga serie de chips Intel que comenzó a dominar el mercado desde que IBM eligió el chip de 16 bits 8088 para su primera computadora personal.", - "Results": [ - { - "Text": "16 bits", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "bit", - "subtype": "Information" - }, - "Start": 125, - "End": 131 - } - ] - }, - { - "Input": "El ''jiotto caspita'' puede funcionar a más de 188 milhas por hora, dijo un portavoz de la compañía.", - "Results": [ - { - "Text": "188 milhas por hora", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Milha por hora", - "subtype": "Speed" - }, - "Start": 47, - "End": 65 - } - ] - }, - { - "Input": "La marina de guerra ha instalado una zona de aterrizaje para helicópteros de apenas 100 metros en una sala de operaciones móvil, apenas en las cercanías de Bagdad.", - "Results": [ - { - "Text": "100 metros", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Metro", - "subtype": "Length" - }, - "Start": 84, - "End": 93 - } - ] - }, - { - "Input": "Caltrans planea añadir una segunda cubierta para autobuses y las flotas de autos por encima de la mediana de un tramo de 2,5 milhas de la autopista Harbor, ao sul de Los Ángeles, cerca del coliseo conmemorativo.", - "Results": [ - { - "Text": "2,5 milhas", - "TypeName": "dimension", - "Resolution": { - "value": "2,5", - "unit": "Milha", - "subtype": "Length" - }, - "Start": 121, - "End": 130 - } - ] - }, - { - "Input": "Em minha viaje de quatro milhas a la sede de la granja cada mañana, conduje por otras quatro casas vacías.", - "Results": [ - { - "Text": "quatro milhas", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Milha", - "subtype": "Length" - }, - "Start": 18, - "End": 30 - } - ] - }, - { - "Input": "Fuimos insultados, dijo Langa desde el cuartel general católico griego, a unos 325 quilometro ao noroeste de Bucarest.", - "Results": [ - { - "Text": "325 quilometro", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Quilômetro", - "subtype": "Length" - }, - "Start": 79, - "End": 92 - } - ] - }, - { - "Input": "Rotich es un pequeño (5 pés", - "Results": [ - { - "Text": "5 pés", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Pé", - "subtype": "Length" - }, - "Start": 22, - "End": 26 - } - ] - }, - { - "Input": "4 polegadas) de 28 años de edad que no comenzó a correr en serio hasta hace tres años y no había competido en el interior hasta este mes.", - "Results": [ - { - "Text": "4 polegadas", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Polegada", - "subtype": "Length" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "Raceway park (Minnesota) en Shakopee es un óvalo pavimentado de 1/4 de milha.", - "Results": [ - { - "Text": "1/4 de milha", - "TypeName": "dimension", - "Resolution": { - "value": "0,25", - "unit": "Milha", - "subtype": "Length" - }, - "Start": 64, - "End": 75 - } - ] - }, - { - "Input": "Castlecrag montaña está situado ao sul do lago Moat, 1,6 km ao oeste del monte Frink a lo largo de la misma línea de cresta.", - "Results": [ - { - "Text": "1,6 km", - "TypeName": "dimension", - "Resolution": { - "value": "1,6", - "unit": "Quilômetro", - "subtype": "Length" - }, - "Start": 53, - "End": 58 - } - ] - }, - { - "Input": "Las colinas de Javadi se encuentran a unos 17 km de Ambur.", - "Results": [ - { - "Text": "17 km", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Quilômetro", - "subtype": "Length" - }, - "Start": 43, - "End": 47 - } - ] - }, - { - "Input": "Después de rodear el lago Michigan cerca de la exposición durante dos horas, el comandante Hugo Eckener aterrizó la aeronave de 776 pes en el cercano aeropuerto Curtiss-Wright en Glenview.", - "Results": [ - { - "Text": "776 pes", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Pé", - "subtype": "Length" - }, - "Start": 128, - "End": 134 - } - ] - }, - { - "Input": "El intercambio con la carretera 35 y la carretera 115 a Lindsay y Peterborough (salida 436) se encuentra a 500 metros ao leste de la carretera Bennett.", - "Results": [ - { - "Text": "500 metros", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Metro", - "subtype": "Length" - }, - "Start": 107, - "End": 116 - } - ] - }, - { - "Input": "Em 1995 a Cannon introduziu a primeira lente SLR disponível comercialmente com estabilização de imagem interna, 75 - 300 mm f / 4 - 5. 6 es usm.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "300 mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Milímetro", - "subtype": "Length" - }, - "Start": 117, - "End": 122 - } - ] - }, - { - "Input": "Los aspectos más destacados de los proyectos de ley son: -- una restricción de la cantidad de bienes raíces que una familia puede poseer, a 660 metros quadrados en las seis ciudades más grandes de la nación, pero más en ciudades pequeñas y áreas rurales.", - "Results": [ - { - "Text": "660 metros quadrados", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Metro quadrado", - "subtype": "Area" - }, - "Start": 140, - "End": 159 - } - ] - }, - { - "Input": "El proyecto cuesta 46,8 millones de dólares, y está destinado a aumentar la capacidad de producción de la empresa en un 25% a 34.500 toneladas métricas de cátodos de cobre ao ano.", - "Results": [ - { - "Text": "34.500 toneladas métricas", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Tonelada métrica", - "subtype": "Weight" - }, - "Start": 126, - "End": 150 - } - ] - }, - { - "Input": "La producción canadiense de lingotes de acero totalizó 291.890 toneladas métricas en la semana terminada el oct. 7, un 14,8% más que el total de la semana anterior, informó Statistics Canada, una agencia federal.", - "Results": [ - { - "Text": "291.890 toneladas métricas", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Tonelada métrica", - "subtype": "Weight" - }, - "Start": 55, - "End": 80 - } - ] - }, - { - "Input": "Las panteras floridas viven en el hogar que se extiende por 190 km2.", - "Results": [ - { - "Text": "190 km2", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Quilômetro quadrado", - "subtype": "Area" - }, - "Start": 60, - "End": 66 - } - ] - }, - { - "Input": "Un asteroide de uma milha de ancho nos golpea, en promedio, sólo una vez cada trescientos mil años.", - "Results": [ - { - "Text": "uma milha", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Milha", - "subtype": "Length" - }, - "Start": 16, - "End": 24 - } - ] - }, - { - "Input": "Sin embargo, Premier incorporó el tren de potencia Nissan A12 (1.171 cc y 52 bhp) en lugar del motor Fiat original junto con una caja de cambios manual de Nissan.", - "Results": [ - { - "Text": "1.171 cc", - "TypeName": "dimension", - "Resolution": { - "value": "1171", - "unit": "Centímetro cúbico", - "subtype": "Volume" - }, - "Start": 63, - "End": 70 - } - ] - }, - { - "Input": "En toda la industria, la producción de petróleo en este país se redujo en 500.000 barris diarios a [] barris nos primeiros oito meses deste año.", - "Results": [ - { - "Text": "500.000 barris", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Barril", - "subtype": "Volume" - }, - "Start": 74, - "End": 87 - }, - { - "Text": "barris", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Barril", - "subtype": "Volume" - }, - "Start": 102, - "End": 107 - } - ] - }, - { - "Input": "Sterling Armaments de Dagenham, Essex produjo un kit de conversión que comprende un nuevo barril de 7,62 mm, una revista, un extractor y un eyector para la venta comercial.", - "Results": [ - { - "Text": "7,62 mm", - "TypeName": "dimension", - "Resolution": { - "value": "7,62", - "unit": "Milímetro", - "subtype": "Length" - }, - "Start": 100, - "End": 106 - }, - { - "Text": "barril", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Barril", - "subtype": "Volume" - }, - "Start": 90, - "End": 95 - } - ] - }, - { - "Input": "El 19 de mayo, la FDA comenzó a detener las setas chinas en latas de 68 oncas después de que más de 100 personas en Mississippi, Nueva York y Pennsylvania se enfermaron a comer hongos contaminados.", - "Results": [ - { - "Text": "68 oncas", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Onça", - "subtype": "Weight" - }, - "Start": 69, - "End": 76 - } - ] - }, - { - "Input": "El viaje de seis milhas de meu hotel ao aeropuerto que debería tardar 20 minutos, tardó más de tres horas.", - "Results": [ - { - "Text": "seis milhas", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Milha", - "subtype": "Length" - }, - "Start": 12, - "End": 22 - } - ] - }, - { - "Input": "2:00 pm", - "NotSupported": "java", - "Results": [] - }, - { - "Input": "girar 90 graus", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "90 graus", - "Start": 6, - "End": 13, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "90" - } - } - ] - }, - { - "Input": "vire à esquerda 45 graus", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "45 graus", - "Start": 16, - "End": 23, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "45" - } - } - ] - }, - { - "Input": "O ângulo é 0,8rad", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "0,8rad", - "Start": 11, - "End": 16, - "TypeName": "dimension", - "Resolution": { - "unit": "Radian", - "subtype": "Angle", - "value": "0,8" - } - } - ] - }, - { - "Input": "dar meia volta", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "meia volta", - "Start": 4, - "End": 13, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "0,5" - } - } - ] - }, - { - "Input": "girar 3 voltas", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "3 voltas", - "Start": 6, - "End": 13, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "3" - } - } - ] - }, - { - "Input": "a temperatura é 24 graus", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "A água ferve a 100° Celsius", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "1.450.000 t de julio", - "Results": [ - { - "Text": "1.450.000 t", - "TypeName": "dimension", - "Resolution": { - "value": "1450000", - "unit": "Tonelada", - "subtype": "Weight" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "Massa de aproximadamente 11.000 t métricas.", - "Results": [ - { - "Text": "11.000 t métricas", - "TypeName": "dimension", - "Resolution": { - "value": "11000", - "unit": "Tonelada métrica", - "subtype": "Weight" - }, - "Start": 25, - "End": 41 - } - ] - }, - { - "Input": "Compartimento para computador até 19 in.", - "Results": [ - { - "Text": "19 in", - "TypeName": "dimension", - "Resolution": { - "value": "19", - "unit": "Polegada", - "subtype": "Length" - }, - "Start": 34, - "End": 38 - } - ] - }, - { - "Input": "Atinge 10 mi por hora durante mais de 5 horas.", - "Results": [ - { - "Text": "10 mi por hora", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Milha por hora", - "subtype": "Speed" - }, - "Start": 7, - "End": 20 - } - ] - }, - { - "Input": "vou fazer um dia", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "lançamento em três dois um...", - "NotSupported": "javascript", - "Results": [] - }, - { - "Input": "o diâmetro é de 23 um.", - "Results": [ - { - "Text": "23 um", - "TypeName": "dimension", - "Resolution": { - "value": "23", - "unit": "Micrômetro", - "subtype": "Length" - }, - "Start": 16, - "End": 20 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Portuguese/TemperatureModel.json b/Specs/NumberWithUnit/Portuguese/TemperatureModel.json deleted file mode 100644 index c7dbe9c15b..0000000000 --- a/Specs/NumberWithUnit/Portuguese/TemperatureModel.json +++ /dev/null @@ -1,827 +0,0 @@ -[ - { - "Input": "A temperatura externa é de 40 graus Celsius", - "Results": [ - { - "Text": "40 graus celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "Grau Celsius" - }, - "Start": 27, - "End": 42 - } - ] - }, - { - "Input": "Faz 90 fahrenheit no Texas", - "Results": [ - { - "Text": "90 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "Grau Fahrenheit" - }, - "Start": 4, - "End": 16 - } - ] - }, - { - "Input": "Converter 10 celsius em fahrenheit", - "Results": [ - { - "Text": "10 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "Grau Celsius" - }, - "Start": 10, - "End": 19 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Fahrenheit" - }, - "Start": 24, - "End": 33 - } - ] - }, - { - "Input": "-5 graus Fahrenheit", - "Results": [ - { - "Text": "-5 graus fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "Grau Fahrenheit" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "6 graus centígrados", - "Results": [ - { - "Text": "6 graus centígrados", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "98,6 graus f é uma temperatura normal", - "Results": [ - { - "Text": "98,6 graus f", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "Grau Fahrenheit" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "Ajuste a temperatura para 30 graus celsius", - "Results": [ - { - "Text": "30 graus celsius", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "Grau Celsius" - }, - "Start": 26, - "End": 41 - } - ] - }, - { - "Input": "A temperatura normal é 98,6 graus Fahrenheit", - "Results": [ - { - "Text": "98,6 graus fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "Grau Fahrenheit" - }, - "Start": 23, - "End": 43 - } - ] - }, - { - "Input": "100 graus f", - "Results": [ - { - "Text": "100 graus f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Grau Fahrenheit" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "20 Graus c", - "Results": [ - { - "Text": "20 graus c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "100 °f", - "Results": [ - { - "Text": "100 °f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Grau Fahrenheit" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "20 °c", - "Results": [ - { - "Text": "20 °c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "100,2 Graus Fahrenheit é baixo", - "Results": [ - { - "Text": "100,2 graus fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "100,2", - "unit": "Grau Fahrenheit" - }, - "Start": 0, - "End": 21 - } - ] - }, - { - "Input": "34,9 centígrado pra fahrenheit", - "Results": [ - { - "Text": "34,9 centígrado", - "TypeName": "temperature", - "Resolution": { - "value": "34,9", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 14 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Fahrenheit" - }, - "Start": 20, - "End": 29 - } - ] - }, - { - "Input": "converter 200 celsius em fahrenheit", - "Results": [ - { - "Text": "200 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "Grau Celsius" - }, - "Start": 10, - "End": 20 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Fahrenheit" - }, - "Start": 25, - "End": 34 - } - ] - }, - { - "Input": "converter 200 K em fahrenheit", - "Results": [ - { - "Text": "200 k", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "Kelvin" - }, - "Start": 10, - "End": 14 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Fahrenheit" - }, - "Start": 19, - "End": 28 - } - ] - }, - { - "Input": "fahrenheit pra celsius, quantos celsius são 101 fahrenheit", - "Results": [ - { - "Text": "101 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "Grau Fahrenheit" - }, - "Start": 44, - "End": 57 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Fahrenheit" - }, - "Start": 0, - "End": 9 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Celsius" - }, - "Start": 15, - "End": 21 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Celsius" - }, - "Start": 32, - "End": 38 - } - ] - }, - { - "Input": "50 graus centígrados celsius em fahrenheit", - "Results": [ - { - "Text": "50 graus centígrados", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 19 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Celsius" - }, - "Start": 21, - "End": 27 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Fahrenheit" - }, - "Start": 32, - "End": 41 - } - ] - }, - { - "Input": "Poderias converter 51 fahrenheit em graus celsius", - "Results": [ - { - "Text": "51 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "Grau Fahrenheit" - }, - "Start": 19, - "End": 31 - }, - { - "Text": "graus celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Celsius" - }, - "Start": 36, - "End": 48 - } - ] - }, - { - "Input": "Converter 106 graus Fahrenheit em graus centígrados", - "Results": [ - { - "Text": "106 graus fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "Grau Fahrenheit" - }, - "Start": 10, - "End": 29 - }, - { - "Text": "graus centígrados", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Celsius" - }, - "Start": 34, - "End": 50 - } - ] - }, - { - "Input": "Converter 106 K em graus centígrados", - "Results": [ - { - "Text": "106 k", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "Kelvin" - }, - "Start": 10, - "End": 14 - }, - { - "Text": "graus centígrados", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Celsius" - }, - "Start": 19, - "End": 35 - } - ] - }, - { - "Input": "Converter 45 graus Fahrenheit a Celsius", - "Results": [ - { - "Text": "45 graus fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "Grau Fahrenheit" - }, - "Start": 10, - "End": 28 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Celsius" - }, - "Start": 32, - "End": 38 - } - ] - }, - { - "Input": "Como converter - 20 graus Fahrenheit para Celsius", - "Results": [ - { - "Text": "- 20 graus fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "Grau Fahrenheit" - }, - "Start": 15, - "End": 35 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grau Celsius" - }, - "Start": 42, - "End": 48 - } - ] - }, - { - "Input": "10,5 celsius", - "Results": [ - { - "Text": "10,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10,5", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 graus celsius", - "Results": [ - { - "Text": "20 graus celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 15 - } - ] - }, - { - "Input": "20,3 celsius", - "Results": [ - { - "Text": "20,3 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20,3", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "34,5 celsius", - "Results": [ - { - "Text": "34,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "34,5", - "unit": "Grau Celsius" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "A temperatura exterior é de 98 graus", - "Results": [ - { - "Text": "98 graus", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Grau" - }, - "Start": 28, - "End": 35 - } - ] - }, - { - "Input": "Ajuste o termostato em 85 °", - "Results": [ - { - "Text": "85 °", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Grau" - }, - "Start": 23, - "End": 26 - } - ] - }, - { - "Input": "Ajuste o termostato em 85°", - "Results": [ - { - "Text": "85°", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Grau" - }, - "Start": 23, - "End": 25 - } - ] - }, - { - "Input": "Aumente a temperatura em 5 graus", - "Results": [ - { - "Text": "5 graus", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Grau" - }, - "Start": 25, - "End": 31 - } - ] - }, - { - "Input": "Ajuste a temperatura para 70 graus f", - "Results": [ - { - "Text": "70 graus f", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "Grau Fahrenheit" - }, - "Start": 26, - "End": 35 - } - ] - }, - { - "Input": "Aumentar a temperatura em 20 grau", - "Results": [ - { - "Text": "20 grau", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Grau" - }, - "Start": 26, - "End": 32 - } - ] - }, - { - "Input": "Ajuste a temperatura a 100 graus", - "Results": [ - { - "Text": "100 graus", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Grau" - }, - "Start": 23, - "End": 31 - } - ] - }, - { - "Input": "Ajuste a temperatura a 100 Kelvin", - "Results": [ - { - "Text": "100 kelvin", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Kelvin" - }, - "Start": 23, - "End": 32 - } - ] - }, - { - "Input": "Mantenha a temperatura de 75 graus f", - "Results": [ - { - "Text": "75 graus f", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "Grau Fahrenheit" - }, - "Start": 26, - "End": 35 - } - ] - }, - { - "Input": "Deixe que a temperatura fique em 40 centígrados", - "Results": [ - { - "Text": "40 centígrados", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "Grau Celsius" - }, - "Start": 33, - "End": 46 - } - ] - }, - { - "Input": "Deixe a temperatura em 50 graus.", - "Results": [ - { - "Text": "50 graus", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Grau" - }, - "Start": 23, - "End": 30 - } - ] - }, - { - "Input": "virar um ângulo de 45 graus", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "Girar 90°", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "A temperature hoje chegou aos 37ºc.", - "Results": [ - { - "Text": "37ºc", - "Start": 30, - "End": 33, - "TypeName": "temperature", - "Resolution": { - "unit": "Grau Celsius", - "value": "37" - } - } - ] - }, - { - "Input": "30º C é muito quente.", - "Results": [ - { - "Text": "30º c", - "Start": 0, - "End": 4, - "TypeName": "temperature", - "Resolution": { - "unit": "Grau Celsius", - "value": "30" - } - } - ] - }, - { - "Input": "E que baixou para 36,6ºC.", - "Results": [ - { - "Text": "36,6ºc", - "Start": 18, - "End": 23, - "TypeName": "temperature", - "Resolution": { - "unit": "Grau Celsius", - "value": "36,6" - } - } - ] - }, - { - "Input": "Questionada sobre essa diferença de 0,4º C desde esses tempos até agora não seria apenas resultado de um aperfeiçoamento tecnológico, Julie Parsonnet responde que não.", - "Results": [ - { - "Text": "0,4º c", - "Start": 36, - "End": 41, - "TypeName": "temperature", - "Resolution": { - "unit": "Grau Celsius", - "value": "0,4" - } - } - ] - }, - { - "Input": "E 100 ºC?", - "Results": [ - { - "Text": "100 ºc", - "Start": 2, - "End": 7, - "TypeName": "temperature", - "Resolution": { - "unit": "Grau Celsius", - "value": "100" - } - } - ] - }, - { - "Input": "E 100 °C?", - "Results": [ - { - "Text": "100 °c", - "Start": 2, - "End": 7, - "TypeName": "temperature", - "Resolution": { - "unit": "Grau Celsius", - "value": "100" - } - } - ] - }, - { - "Input": "A temperature hoje chegou aos 99º f.", - "Results": [ - { - "Text": "99º f", - "Start": 30, - "End": 34, - "TypeName": "temperature", - "Resolution": { - "unit": "Grau Fahrenheit", - "value": "99" - } - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Spanish/AgeModel.json b/Specs/NumberWithUnit/Spanish/AgeModel.json deleted file mode 100644 index ba5381114a..0000000000 --- a/Specs/NumberWithUnit/Spanish/AgeModel.json +++ /dev/null @@ -1,262 +0,0 @@ -[ - { - "Input": "Cuando tenía cinco años, hacía meriendas de mentira con mis muñecas.", - "Results": [ - { - "Text": "cinco años", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Año" - }, - "Start": 13, - "End": 22 - } - ] - }, - { - "Input": "Esta saga se remonta a casi diez años atrás.", - "Results": [ - { - "Text": "diez años", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Año" - }, - "Start": 28, - "End": 36 - } - ] - }, - { - "Input": "¡Mi pelo ya está gris y sólo tengo 29 años!", - "Results": [ - { - "Text": "29 años", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Año" - }, - "Start": 35, - "End": 41 - } - ] - }, - { - "Input": "Ahora cuenta noventa y cinco años: tiene una perspectiva de las cosas y tiene memoria.", - "Results": [ - { - "Text": "noventa y cinco años", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Año" - }, - "Start": 13, - "End": 32 - } - ] - }, - { - "Input": "La Gran Muralla china tiene más de 500 años y se extiende más de 5,000 millas.", - "Results": [ - { - "Text": "500 años", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Año" - }, - "Start": 35, - "End": 42 - } - ] - }, - { - "Input": "Ya tiene 60 años, pues en principio nació el 8 de mayo de 1945.", - "Results": [ - { - "Text": "60 años", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Año" - }, - "Start": 9, - "End": 15 - } - ] - }, - { - "Input": "Y al 25% no se les diagnostica hasta que tienen casi tres años.", - "Results": [ - { - "Text": "tres años", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Año" - }, - "Start": 53, - "End": 61 - } - ] - }, - { - "Input": "¿Cuándo se va aplicar una presión seria para cumplir realmente esa promesa formulada hace un año?", - "Results": [ - { - "Text": "un año", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Año" - }, - "Start": 90, - "End": 95 - } - ] - }, - { - "Input": "La sublevación se produjo cuando yo era un bebé y tenía tan solo diez meses.", - "Results": [ - { - "Text": "diez meses", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Mes" - }, - "Start": 65, - "End": 74 - } - ] - }, - { - "Input": "La propuesta de la Comisión tiene ya 8 meses.", - "Results": [ - { - "Text": "8 meses", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Mes" - }, - "Start": 37, - "End": 43 - } - ] - }, - { - "Input": "A alrededor del 50% de ellos no se les diagnostica hasta los dieciocho meses de edad.", - "Results": [ - { - "Text": "dieciocho meses", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Mes" - }, - "Start": 61, - "End": 75 - } - ] - }, - { - "Input": "Es posible, pero en 2006 mataron a 330 000 focas arpa y el 95% de ellas tenían menos de tres meses.", - "Results": [ - { - "Text": "tres meses", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Mes" - }, - "Start": 88, - "End": 97 - } - ] - }, - { - "Input": "Si seguimos adelante con la resolución en el período parcial de sesiones de diciembre, tendrá para entonces tres semanas de antigüedad.", - "Results": [ - { - "Text": "tres semanas", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Semana" - }, - "Start": 108, - "End": 119 - } - ] - }, - { - "Input": "También pueden revocar su consentimiento hasta que el hijo haya cumplido 6 semanas de edad.", - "Results": [ - { - "Text": "6 semanas", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Semana" - }, - "Start": 73, - "End": 81 - } - ] - }, - { - "Input": "Otras materias primas deberán utilizarse en un plazo de cinco días.", - "Results": [ - { - "Text": "cinco días", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Día" - }, - "Start": 56, - "End": 65 - } - ] - }, - { - "Input": "Para clubes de los demás países, una cuenta vencida por 90 días se considera morosa.", - "Results": [ - { - "Text": "90 días", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Día" - }, - "Start": 56, - "End": 62 - } - ] - }, - { - "Input": "Tiene unos 40 - 50 años", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "50 años", - "Start": 16, - "End": 22, - "TypeName": "age", - "Resolution": { - "unit": "Año", - "value": "50" - } - } - ] - }, - { - "Input": "semana o semanas", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Spanish/CurrencyModel.json b/Specs/NumberWithUnit/Spanish/CurrencyModel.json index 07eb9f045c..5fbd6ffa93 100644 --- a/Specs/NumberWithUnit/Spanish/CurrencyModel.json +++ b/Specs/NumberWithUnit/Spanish/CurrencyModel.json @@ -1666,7 +1666,7 @@ }, { "Input": "mxn$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "mxn$ 15", @@ -1751,7 +1751,7 @@ }, { "Input": "Los precios del acuerdo comienzan en dólar 22,5 millones.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "dólar 22,5 millones", @@ -1767,7 +1767,7 @@ }, { "Input": "Los precios del acuerdo comienzan en dólar 22500000.", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "dólar 22500000", @@ -1783,7 +1783,7 @@ }, { "Input": "Por 15 dolares 50 puedes almorzar y cenar", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "15 dolares 50", @@ -1799,7 +1799,7 @@ }, { "Input": "Por 15 USD 50 puedes almorzar y cenar", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "15 usd 50", @@ -1883,7 +1883,7 @@ }, { "Input": "Obtén 2 meses por MXN$ 20", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "mxn$ 20", @@ -1900,7 +1900,7 @@ }, { "Input": "Obtén 2 meses por 20 MXN$", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript ", "Results": [ { "Text": "20 mxn$", diff --git a/Specs/NumberWithUnit/Spanish/DimensionModel.json b/Specs/NumberWithUnit/Spanish/DimensionModel.json deleted file mode 100644 index 79fb7ef893..0000000000 --- a/Specs/NumberWithUnit/Spanish/DimensionModel.json +++ /dev/null @@ -1,872 +0,0 @@ -[ - { - "Input": "75ml", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Mililitro", - "subtype": "Volume" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "Su mayor inconveniente puede ser su espesor de 3 pulgadas, lo suficientemente grande como para que un consultor lo describa como \"clunky\".", - "Results": [ - { - "Text": "3 pulgadas", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Pulgada", - "subtype": "Length" - }, - "Start": 47, - "End": 56 - } - ] - }, - { - "Input": "Un tornado rugió a través de un area de unas diez millas de largo allí, matando al menos a catorce personas y convirtiendo decenas de hogares en escombros", - "Results": [ - { - "Text": "diez millas", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Milla", - "subtype": "Length" - }, - "Start": 45, - "End": 55 - } - ] - }, - { - "Input": "Se necesita más de 10 1/2 millas de cable y alambre para conectar todo y 23 equipos", - "Results": [ - { - "Text": "10 1/2 millas", - "TypeName": "dimension", - "Resolution": { - "value": "10,5", - "unit": "Milla", - "subtype": "Length" - }, - "Start": 19, - "End": 31 - } - ] - }, - { - "Input": "El viaje de seis millas de mi hotel al aeropuerto que debería tardar 20 minutos, tardó más de tres horas.", - "Results": [ - { - "Text": "seis millas", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Milla", - "subtype": "Length" - }, - "Start": 12, - "End": 22 - } - ] - }, - { - "Input": "Es lo que 1) explica por qué somos como nosotros mismos en lugar de Bo Jackson; 2) advierte que es posible ahogarse en un lago que promedia dos pies de profundidad; y 3) predice que 10.000 monos colocados ante 10.000 pianos producirían 1.118 melodías publicitables del rock'n'roll.", - "Results": [ - { - "Text": "dos pies", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Pie", - "subtype": "Length" - }, - "Start": 140, - "End": 147 - } - ] - }, - { - "Input": "El 19 de mayo, la FDA comenzó a detener las setas chinas en latas de 68 onzas después de que más de 100 personas en Mississippi, Nueva York y Pennsylvania se enfermaron al comer hongos contaminados.", - "Results": [ - { - "Text": "68 onzas", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Onza", - "subtype": "Weight" - }, - "Start": 69, - "End": 76 - } - ] - }, - { - "Input": "El sr. Hulings se regodea que vendió todas sus acciones una semana antes de que el mercado se desplomara 190 puntos en oct. 13, y está utilizando el dinero para ayudar a comprar una granja de caballos de 45 acres.", - "Results": [ - { - "Text": "45 acres", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Acre", - "subtype": "Area" - }, - "Start": 204, - "End": 211 - } - ] - }, - { - "Input": "Bartlett había levantado paredes sin ventanas (ladrillo, enrejado, seto) de ocho a diez pies de alto, convirtiendo sus interiores en una sombra stygiana de un día.", - "Results": [ - { - "Text": "diez pies", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Pie", - "subtype": "Length" - }, - "Start": 83, - "End": 91 - } - ] - }, - { - "Input": "'La administración no quiere sorpresas', comenta Jack Zaves, quien, como director de servicios de combustible de American Airlines, compra unos 2.400 millones de galones de combustible para aviones al año.", - "Results": [ - { - "Text": "2.400 millones de galones", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Galón", - "subtype": "Volume" - }, - "Start": 144, - "End": 168 - } - ] - }, - { - "Input": "Un refrigerador de agua de 10 galones había caído al suelo, empapando la alfombra roja.", - "Results": [ - { - "Text": "10 galones", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Galón", - "subtype": "Volume" - }, - "Start": 27, - "End": 36 - } - ] - }, - { - "Input": "Cerca, seis delfines se divertirán en un acuario de agua salada de 1,5 millones de galones.", - "Results": [ - { - "Text": "1,5 millones de galones", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Galón", - "subtype": "Volume" - }, - "Start": 67, - "End": 89 - } - ] - }, - { - "Input": "Y este bebé tiene más de dos libras.", - "Results": [ - { - "Text": "dos libras", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Libra", - "subtype": "Weight" - }, - "Start": 25, - "End": 34 - } - ] - }, - { - "Input": "No confío en las personas que no comen, dijo ms. Volokh, aunque ella misma dejó de comer el almuerzo hace unos años para bajar 25 libras.", - "Results": [ - { - "Text": "25 libras", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Libra", - "subtype": "Weight" - }, - "Start": 127, - "End": 135 - } - ] - }, - { - "Input": "Shell, una subsidiaria del grupo real holandés, se le permitirá exportar 0,9 billones de pies cúbicos, y el Golfo, una unidad de olympia & york developments ltd. se permitirá exportar", - "Results": [ - { - "Text": "0,9 billones de pies cúbicos", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "unit": "Pie cúbico", - "subtype": "Volume" - }, - "Start": 73, - "End": 100 - } - ] - }, - { - "Input": "Ejércitos Tigrean ahora están 200 millas al norte de Addis Ababa, amenazando la ciudad de éstos, que cortaría la capital de Mengistu desde el puerto de Assab, a través del cual todos los combustibles y otros suministros llegan a Addis Ababa.", - "Results": [ - { - "Text": "200 millas", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Milla", - "subtype": "Length" - }, - "Start": 30, - "End": 39 - } - ] - }, - { - "Input": "Dijo que una de las pc tomó un viaje de tres pies deslizándose por el suelo.", - "Results": [ - { - "Text": "tres pies", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Pie", - "subtype": "Length" - }, - "Start": 40, - "End": 48 - } - ] - }, - { - "Input": "El núcleo de sus propiedades es de 190.000 metros cuadrados de propiedad increíblemente caras en el distrito de Marunouchi, el centro financiero y de negocios de Tokyo, a menudo en broma llamada 'pueblo Mitsubishi'", - "Results": [ - { - "Text": "190.000 metros cuadrados", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Metro cuadrado", - "subtype": "Area" - }, - "Start": 35, - "End": 58 - } - ] - }, - { - "Input": "El satélite, construido por Hughes para la organización internacional de satélites de telecomunicaciones, forma parte de un contrato de 700 millones de dólares otorgado a Hughes en 1982 para desarrollar cinco satélites de tres toneladas.", - "Results": [ - { - "Text": "tres toneladas", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Tonelada", - "subtype": "Weight" - }, - "Start": 222, - "End": 235 - } - ] - }, - { - "Input": "En un informe de 1996 sobre armas biológicas, el centro de estudios estratégicos e internacionales, una institución de investigación de políticas públicas en Washington, advirtió que era fácil para los posibles terroristas montar armas biológicas utilizando equipo comercial con una capacidad de 130 galones.", - "Results": [ - { - "Text": "130 galones", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Galón", - "subtype": "Volume" - }, - "Start": 296, - "End": 306 - } - ] - }, - { - "Input": "La recopilación de datos del departamento de comercio del grupo de comercio mostró que las importaciones de Agosto, el segundo mayor mensual del año, subieron un 5% respecto de las 1.458.000 toneladas de julio, pero por debajo del máximo del año pasado en junio de 1988.", - "Results": [ - { - "Text": "1.458.000 toneladas", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Tonelada", - "subtype": "Weight" - }, - "Start": 181, - "End": 199 - } - ] - }, - { - "Input": "El 1 de noviembre, Singh tiró a unos seis pies de la taza", - "Results": [ - { - "Text": "seis pies", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Pie", - "subtype": "Length" - }, - "Start": 37, - "End": 45 - } - ] - }, - { - "Input": "Una t.métrica es igual a 2.204,62 libras.", - "Results": [ - { - "Text": "una t.métrica", - "Start": 0, - "End": 12, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Tonelada métrica", - "value": "1" - } - }, - { - "Text": "2.204,62 libras", - "TypeName": "dimension", - "Resolution": { - "value": "2204,62", - "unit": "Libra", - "subtype": "Weight" - }, - "Start": 25, - "End": 39 - } - ] - }, - { - "Input": "Por lo que cuando el cultivo de psyllium del año que viene se coseche en marzo, puede ser menor que las 16.000 toneladas métricas de los últimos años, justo en la cresta del boom del psyllium.", - "Results": [ - { - "Text": "16.000 toneladas métricas", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Tonelada métrica", - "subtype": "Weight" - }, - "Start": 104, - "End": 128 - } - ] - }, - { - "Input": "El 486 es el descendiente de una larga serie de chips Intel que comenzó a dominar el mercado desde que IBM eligió el chip de 16 bits 8088 para su primera computadora personal.", - "Results": [ - { - "Text": "16 bits", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "bit", - "subtype": "Information" - }, - "Start": 125, - "End": 131 - } - ] - }, - { - "Input": "El ''jiotto caspita'' puede funcionar a más de 188 millas por hora, dijo un portavoz de la compañía.", - "Results": [ - { - "Text": "188 millas por hora", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Milla por hora", - "subtype": "Speed" - }, - "Start": 47, - "End": 65 - } - ] - }, - { - "Input": "La marina de guerra ha instalado una zona de aterrizaje para helicópteros de apenas 100 metros en una sala de operaciones móvil, apenas en las cercanías de Bagdad.", - "Results": [ - { - "Text": "100 metros", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Metro", - "subtype": "Length" - }, - "Start": 84, - "End": 93 - } - ] - }, - { - "Input": "Caltrans planea añadir una segunda cubierta para autobuses y las flotas de autos por encima de la mediana de un tramo de 2,5 millas de la autopista Harbor, al sur de Los Ángeles, cerca del coliseo conmemorativo.", - "Results": [ - { - "Text": "2,5 millas", - "TypeName": "dimension", - "Resolution": { - "value": "2,5", - "unit": "Milla", - "subtype": "Length" - }, - "Start": 121, - "End": 130 - } - ] - }, - { - "Input": "En mi viaje de cuatro millas a la sede de la granja cada mañana, conduje por otras cuatro casas vacías.", - "Results": [ - { - "Text": "cuatro millas", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Milla", - "subtype": "Length" - }, - "Start": 15, - "End": 27 - } - ] - }, - { - "Input": "Fuimos insultados, dijo Langa desde el cuartel general católico griego, a unos 325 kilómetros al noroeste de Bucarest.", - "Results": [ - { - "Text": "325 kilómetros", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilómetro", - "subtype": "Length" - }, - "Start": 79, - "End": 92 - } - ] - }, - { - "Input": "Rotich es un pequeño (5 pies", - "Results": [ - { - "Text": "5 pies", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Pie", - "subtype": "Length" - }, - "Start": 22, - "End": 27 - } - ] - }, - { - "Input": "4 pulgadas) de 28 años de edad que no comenzó a correr en serio hasta hace tres años y no había competido en el interior hasta este mes.", - "Results": [ - { - "Text": "4 pulgadas", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Pulgada", - "subtype": "Length" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "Raceway park (Minnesota) en Shakopee es un óvalo pavimentado de 1/4 de milla.", - "Results": [ - { - "Text": "1/4 de milla", - "TypeName": "dimension", - "Resolution": { - "value": "0,25", - "unit": "Milla", - "subtype": "Length" - }, - "Start": 64, - "End": 75 - } - ] - }, - { - "Input": "Castlecrag montaña está situado al sur del lago Moat, 1,6 km al oeste del monte Frink a lo largo de la misma línea de cresta.", - "Results": [ - { - "Text": "1,6 km", - "TypeName": "dimension", - "Resolution": { - "value": "1,6", - "unit": "Kilómetro", - "subtype": "Length" - }, - "Start": 54, - "End": 59 - } - ] - }, - { - "Input": "Las colinas de Javadi se encuentran a unos 17 km de Ambur.", - "Results": [ - { - "Text": "17 km", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Kilómetro", - "subtype": "Length" - }, - "Start": 43, - "End": 47 - } - ] - }, - { - "Input": "Después de rodear el lago Michigan cerca de la exposición durante dos horas, el comandante Hugo Eckener aterrizó la aeronave de 776 pies en el cercano aeropuerto Curtiss-Wright en Glenview.", - "Results": [ - { - "Text": "776 pies", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Pie", - "subtype": "Length" - }, - "Start": 128, - "End": 135 - } - ] - }, - { - "Input": "El intercambio con la carretera 35 y la carretera 115 a Lindsay y Peterborough (salida 436) se encuentra a 500 metros al este de la carretera Bennett.", - "Results": [ - { - "Text": "500 metros", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Metro", - "subtype": "Length" - }, - "Start": 107, - "End": 116 - } - ] - }, - { - "Input": "En 1995 Cannon introdujo la primera lente SLR comercialmente disponible con estabilización de imagen interna, 75 - 300 mm f / 4 - 5. 6 es usm.", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "300 mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Milímetro", - "subtype": "Length" - }, - "Start": 115, - "End": 120 - } - ] - }, - { - "Input": "Los aspectos más destacados de los proyectos de ley son: -- una restricción de la cantidad de bienes raíces que una familia puede poseer, a 660 metros cuadrados en las seis ciudades más grandes de la nación, pero más en ciudades pequeñas y áreas rurales.", - "Results": [ - { - "Text": "660 metros cuadrados", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Metro cuadrado", - "subtype": "Area" - }, - "Start": 140, - "End": 159 - } - ] - }, - { - "Input": "El proyecto cuesta 46,8 millones de dólares, y está destinado a aumentar la capacidad de producción de la empresa en un 25% a 34.500 toneladas métricas de cátodos de cobre al año.", - "Results": [ - { - "Text": "34.500 toneladas métricas", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Tonelada métrica", - "subtype": "Weight" - }, - "Start": 126, - "End": 150 - } - ] - }, - { - "Input": "La producción canadiense de lingotes de acero totalizó 291.890 toneladas métricas en la semana terminada el oct. 7, un 14,8% más que el total de la semana anterior, informó Statistics Canada, una agencia federal.", - "Results": [ - { - "Text": "291.890 toneladas métricas", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Tonelada métrica", - "subtype": "Weight" - }, - "Start": 55, - "End": 80 - } - ] - }, - { - "Input": "Las panteras floridas viven en el hogar que se extiende por 190 km2.", - "Results": [ - { - "Text": "190 km2", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Kilómetro cuadrado", - "subtype": "Area" - }, - "Start": 60, - "End": 66 - } - ] - }, - { - "Input": "Un asteroide de una milla de ancho nos golpea, en promedio, sólo una vez cada trescientos mil años.", - "Results": [ - { - "Text": "una milla", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Milla", - "subtype": "Length" - }, - "Start": 16, - "End": 24 - } - ] - }, - { - "Input": "Sin embargo, Premier incorporó el tren de potencia Nissan A12 (1.171 cc y 52 bhp) en lugar del motor Fiat original junto con una caja de cambios manual de Nissan.", - "Results": [ - { - "Text": "1.171 cc", - "TypeName": "dimension", - "Resolution": { - "value": "1171", - "unit": "Centímetro cúbico", - "subtype": "Volume" - }, - "Start": 63, - "End": 70 - } - ] - }, - { - "Input": "En toda la industria, la producción de petróleo en este país se redujo en 500.000 barriles diarios a [] barriles en los primeros ocho meses de este año.", - "Results": [ - { - "Text": "500.000 barriles", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Barril", - "subtype": "Volume" - }, - "Start": 74, - "End": 89 - }, - { - "Text": "barriles", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Barril", - "subtype": "Volume" - }, - "Start": 104, - "End": 111 - } - ] - }, - { - "Input": "Sterling Armaments de Dagenham, Essex produjo un kit de conversión que comprende un nuevo barril de 7,62 mm, una revista, un extractor y un eyector para la venta comercial.", - "Results": [ - { - "Text": "7,62 mm", - "TypeName": "dimension", - "Resolution": { - "value": "7,62", - "unit": "Milímetro", - "subtype": "Length" - }, - "Start": 100, - "End": 106 - }, - { - "Text": "barril", - "TypeName": "dimension", - "Resolution": { - "value": null, - "unit": "Barril", - "subtype": "Volume" - }, - "Start": 90, - "End": 95 - } - ] - }, - { - "Input": "2:00 pm", - "NotSupported": "java", - "Results": [] - }, - { - "Input": "girar 90 grados", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "90 grados", - "Start": 6, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "90" - } - } - ] - }, - { - "Input": "girar a la izquierda 45 grados", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "45 grados", - "Start": 21, - "End": 29, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "45" - } - } - ] - }, - { - "Input": "el angulo es 0.8rad", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "0.8rad", - "Start": 13, - "End": 18, - "TypeName": "dimension", - "Resolution": { - "unit": "Radian", - "subtype": "Angle", - "value": "0,8" - } - } - ] - }, - { - "Input": "dar media vuelta", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "media vuelta", - "Start": 4, - "End": 15, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "0,5" - } - } - ] - }, - { - "Input": "girar 3 vueltas", - "NotSupported": "java, javascript, python", - "Results": [ - { - "Text": "3 vueltas", - "Start": 6, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "3" - } - } - ] - }, - { - "Input": "la temperatura es de 24 grados", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "El agua hierve a 100° Celsius", - "NotSupported": "java, javascript, python", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Spanish/TemperatureModel.json b/Specs/NumberWithUnit/Spanish/TemperatureModel.json deleted file mode 100644 index b0e0a01084..0000000000 --- a/Specs/NumberWithUnit/Spanish/TemperatureModel.json +++ /dev/null @@ -1,807 +0,0 @@ -[ - { - "Input": "La temperatura exterior es de 40 grados Celsius", - "Results": [ - { - "Text": "40 grados celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "Grado Celsius" - }, - "Start": 30, - "End": 46 - } - ] - }, - { - "Input": "Hace 90 fahrenheit en Texas", - "Results": [ - { - "Text": "90 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "Grado Fahrenheit" - }, - "Start": 5, - "End": 17 - } - ] - }, - { - "Input": "Convertir 10 celsius a fahrenheit", - "Results": [ - { - "Text": "10 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "Grado Celsius" - }, - "Start": 10, - "End": 19 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Fahrenheit" - }, - "Start": 23, - "End": 32 - } - ] - }, - { - "Input": "-5 grados Fahrenheit", - "Results": [ - { - "Text": "-5 grados fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "Grado Fahrenheit" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "6 grados centígrados", - "Results": [ - { - "Text": "6 grados centígrados", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "98,6 grados f es temperatura normal", - "Results": [ - { - "Text": "98,6 grados f", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "Grado Fahrenheit" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "Ajuste la temperatura a 30 grados celsius", - "Results": [ - { - "Text": "30 grados celsius", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "Grado Celsius" - }, - "Start": 24, - "End": 40 - } - ] - }, - { - "Input": "La temperatura normal es 98,6 grados Fahrenheit", - "Results": [ - { - "Text": "98,6 grados fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "Grado Fahrenheit" - }, - "Start": 25, - "End": 46 - } - ] - }, - { - "Input": "100 grados f", - "Results": [ - { - "Text": "100 grados f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Grado Fahrenheit" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 Grados c", - "Results": [ - { - "Text": "20 grados c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "100 °f", - "Results": [ - { - "Text": "100 °f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Grado Fahrenheit" - }, - "Start": 0, - "End": 5 - } - ] - }, - { - "Input": "20 °c", - "Results": [ - { - "Text": "20 °c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "100,2 Grados Fahrenheit es bajo", - "Results": [ - { - "Text": "100,2 grados fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "100,2", - "unit": "Grado Fahrenheit" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "34,9 centígrado a fahrenheit", - "Results": [ - { - "Text": "34,9 centígrado", - "TypeName": "temperature", - "Resolution": { - "value": "34,9", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 14 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Fahrenheit" - }, - "Start": 18, - "End": 27 - } - ] - }, - { - "Input": "convertir 200 celsius celsius en fahrenheit", - "Results": [ - { - "Text": "200 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "Grado Celsius" - }, - "Start": 10, - "End": 20 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 22, - "End": 28 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Fahrenheit" - }, - "Start": 33, - "End": 42 - } - ] - }, - { - "Input": "convertir 200 K en fahrenheit", - "Results": [ - { - "Text": "200 k", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "Kelvin" - }, - "Start": 10, - "End": 14 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Fahrenheit" - }, - "Start": 19, - "End": 28 - } - ] - }, - { - "Input": "fahrenheit a celsius, cuantos celsius son 101 fahrenheit", - "Results": [ - { - "Text": "101 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "Grado Fahrenheit" - }, - "Start": 42, - "End": 55 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Fahrenheit" - }, - "Start": 0, - "End": 9 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 13, - "End": 19 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 30, - "End": 36 - } - ] - }, - { - "Input": "50 grados centígrados celsius a fahrenheit", - "Results": [ - { - "Text": "50 grados centígrados", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 20 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 22, - "End": 28 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Fahrenheit" - }, - "Start": 32, - "End": 41 - } - ] - }, - { - "Input": "Podría convertir 51 fahrenheit en grados celsius", - "Results": [ - { - "Text": "51 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "Grado Fahrenheit" - }, - "Start": 17, - "End": 29 - }, - { - "Text": "grados celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 34, - "End": 47 - } - ] - }, - { - "Input": "Convertir 106 grados Fahrenheit a grados centígrados", - "Results": [ - { - "Text": "106 grados fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "Grado Fahrenheit" - }, - "Start": 10, - "End": 30 - }, - { - "Text": "grados centígrados", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 34, - "End": 51 - } - ] - }, - { - "Input": "Convertir 106 K a grados centígrados", - "Results": [ - { - "Text": "106 k", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "Kelvin" - }, - "Start": 10, - "End": 14 - }, - { - "Text": "grados centígrados", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 18, - "End": 35 - } - ] - }, - { - "Input": "Convertir 45 grados Fahrenheit a Celsius", - "Results": [ - { - "Text": "45 grados fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "Grado Fahrenheit" - }, - "Start": 10, - "End": 29 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 33, - "End": 39 - } - ] - }, - { - "Input": "Cómo convertir - 20 grados Fahrenheit a Celsius", - "Results": [ - { - "Text": "- 20 grados fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "Grado Fahrenheit" - }, - "Start": 15, - "End": 36 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "Grado Celsius" - }, - "Start": 40, - "End": 46 - } - ] - }, - { - "Input": "10,5 celsius", - "Results": [ - { - "Text": "10,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10,5", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 grados celsius", - "Results": [ - { - "Text": "20 grados celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "20,3 celsius", - "Results": [ - { - "Text": "20,3 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20,3", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "34,5 celsius", - "Results": [ - { - "Text": "34,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "34,5", - "unit": "Grado Celsius" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "La temperatura exterior es de 98 grados", - "Results": [ - { - "Text": "98 grados", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Grado" - }, - "Start": 30, - "End": 38 - } - ] - }, - { - "Input": "Ajuste el termostato a 85 °", - "Results": [ - { - "Text": "85 °", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Grado" - }, - "Start": 23, - "End": 26 - } - ] - }, - { - "Input": "Ajuste el termostato a 85°", - "Results": [ - { - "Text": "85°", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Grado" - }, - "Start": 23, - "End": 25 - } - ] - }, - { - "Input": "Aumentar la temperatura en 5 grados", - "Results": [ - { - "Text": "5 grados", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Grado" - }, - "Start": 27, - "End": 34 - } - ] - }, - { - "Input": "Ajuste la temperatura a 70 grados f", - "Results": [ - { - "Text": "70 grados f", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "Grado Fahrenheit" - }, - "Start": 24, - "End": 34 - } - ] - }, - { - "Input": "Aumentar la temperatura en 20 grados", - "Results": [ - { - "Text": "20 grados", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Grado" - }, - "Start": 27, - "End": 35 - } - ] - }, - { - "Input": "Ajuste la temperatura a 100 grados", - "Results": [ - { - "Text": "100 grados", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Grado" - }, - "Start": 24, - "End": 33 - } - ] - }, - { - "Input": "Ajuste la temperatura a 100 Kelvin", - "Results": [ - { - "Text": "100 kelvin", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Kelvin" - }, - "Start": 24, - "End": 33 - } - ] - }, - { - "Input": "Mantener la temperatura a 75 grados f", - "Results": [ - { - "Text": "75 grados f", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "Grado Fahrenheit" - }, - "Start": 26, - "End": 36 - } - ] - }, - { - "Input": "Deje que la temperatura esté a 40 centígrados", - "Results": [ - { - "Text": "40 centígrados", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "Grado Celsius" - }, - "Start": 31, - "End": 44 - } - ] - }, - { - "Input": "Deje que la temperatura esté a 50 grados.", - "Results": [ - { - "Text": "50 grados", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Grado" - }, - "Start": 31, - "End": 39 - } - ] - }, - { - "Input": "girar un ángulo de 45 grados", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "Girar 90°", - "NotSupported": "java, javascript, python", - "Results": [] - }, - { - "Input": "E 100 ºC?", - "Results": [ - { - "Text": "100 ºc", - "Start": 2, - "End": 7, - "TypeName": "temperature", - "Resolution": { - "unit": "Grado Celsius", - "value": "100" - } - } - ] - }, - { - "Input": "E 100 °C?", - "Results": [ - { - "Text": "100 °c", - "Start": 2, - "End": 7, - "TypeName": "temperature", - "Resolution": { - "unit": "Grado Celsius", - "value": "100" - } - } - ] - }, - { - "Input": "Es necesario calentar la cuajada hasta 37ºC", - "Results": [ - { - "Text": "37ºc", - "Start": 39, - "End": 42, - "TypeName": "temperature", - "Resolution": { - "unit": "Grado Celsius", - "value": "37" - } - } - ] - }, - { - "Input": "Temperatura corporal média já não é 37º C", - "Results": [ - { - "Text": "37º c", - "Start": 36, - "End": 40, - "TypeName": "temperature", - "Resolution": { - "unit": "Grado Celsius", - "value": "37" - } - } - ] - }, - { - "Input": "E que baixou para 36,6ºC.", - "Results": [ - { - "Text": "36,6ºc", - "Start": 18, - "End": 23, - "TypeName": "temperature", - "Resolution": { - "unit": "Grado Celsius", - "value": "36,6" - } - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Swedish/AgeModel.json b/Specs/NumberWithUnit/Swedish/AgeModel.json deleted file mode 100644 index 03c8cd6571..0000000000 --- a/Specs/NumberWithUnit/Swedish/AgeModel.json +++ /dev/null @@ -1,324 +0,0 @@ -[ - { - "Input": "När hon var fem år gammal lärde hon sig cykla.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "fem år gammal", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 12, - "End": 24 - } - ] - }, - { - "Input": "Denna saga är tio år gammal.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "tio år gammal", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Year" - }, - "Start": 14, - "End": 26 - } - ] - }, - { - "Input": "Jag är bara 29 år gammal!", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "29 år gammal", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 12, - "End": 23 - } - ] - }, - { - "Input": "Nu, vid nittiofem års ålder, förändras perspektiven.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "nittiofem års ålder", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Year" - }, - "Start": 8, - "End": 26 - } - ] - }, - { - "Input": "Kinesiska muren är mer än 500 år gammal och sträcker sig över mer än 8000 kilometer.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "500 år gammal", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Year" - }, - "Start": 26, - "End": 38 - } - ] - }, - { - "Input": "Hon är 60 år gammal. Hon föddes den 8 maj, 1945.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "60 år gammal", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 7, - "End": 18 - } - ] - }, - { - "Input": "25% av fallen diagnosticeras inte förrän vid 3 års ålder.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "3 års ålder", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Year" - }, - "Start": 45, - "End": 55 - } - ] - }, - { - "Input": "När kommer kravet att infria ett löfte som är ett år gammalt?", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "ett år gammalt", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Year" - }, - "Start": 46, - "End": 59 - } - ] - }, - { - "Input": "Det hände då barnet bara var tio månader gammalt.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "tio månader gammalt", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 29, - "End": 47 - } - ] - }, - { - "Input": "Kommitténs förslag är 8 månader gammalt.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "8 månader gammalt", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Month" - }, - "Start": 22, - "End": 38 - } - ] - }, - { - "Input": "Uppskattningsvis 50% av fallen diagnosticeras vid ungefär arton månaders ålder.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "arton månaders ålder", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Month" - }, - "Start": 58, - "End": 77 - } - ] - }, - { - "Input": "Det är möjligt, men 2006 var 95% av dem yngre än tre månader gamla.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "tre månader gamla", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Month" - }, - "Start": 49, - "End": 65 - } - ] - }, - { - "Input": "Om vi fortsätter i december kommer det vara tre veckor gammalt.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "tre veckor gammalt", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 44, - "End": 61 - } - ] - }, - { - "Input": "Vid 6 veckors ålder kan man redan börja fira jul.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "6 veckors ålder", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Week" - }, - "Start": 4, - "End": 18 - } - ] - }, - { - "Input": "En 90 dagar gammal vattenräkning är ganska gammal.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "90 dagar gammal", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 3, - "End": 17 - } - ] - }, - { - "Input": "Han är ungefär 40 - 50 år gammal.", - "NotSupportedByDesign": "javascript, python, java", - "NotSupported": "javascript, java", - "Results": [ - { - "Text": "50 år gammal", - "Start": 20, - "End": 31, - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "50" - } - } - ] - }, - { - "Input": "En 3-åring är väldigt nyfiken!", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "3-åring", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Year" - }, - "Start": 3, - "End": 9 - } - ] - }, - { - "Input": "Vi har just köpt ett 5-årigt sto.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "5-årigt", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 21, - "End": 27 - } - ] - }, - { - "Input": "Han är 25 år.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "25 år", - "TypeName": "age", - "Resolution": { - "value": "25", - "unit": "Year" - }, - "Start": 7, - "End": 11 - } - ] - }, - { - "Input": "Fölet är bara dagsgammalt.", - "NotSupportedByDesign": "dotnet, javascript, python, java", - "Comment": "The word 'dagsgammal(t)' w/out prefix should resolve as 1 day.", - "Results": [ - { - "Text": "dagsgammalt", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Day" - }, - "Start": 14, - "End": 24 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Swedish/CurrencyModel.json b/Specs/NumberWithUnit/Swedish/CurrencyModel.json index cc9d1fde73..1887219c03 100644 --- a/Specs/NumberWithUnit/Swedish/CurrencyModel.json +++ b/Specs/NumberWithUnit/Swedish/CurrencyModel.json @@ -1,7 +1,7 @@ [ { "Input": "bilen kostar 250000 kronor", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "250000 kronor", @@ -17,7 +17,7 @@ }, { "Input": "Priset är 100元!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "100元", @@ -33,7 +33,7 @@ }, { "Input": "Svenske pizzamiljardären säljer aktier för 70 miljoner kronor", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "70 miljoner kronor", @@ -49,7 +49,7 @@ }, { "Input": "det finska företaget köpte tillgångar till ett värde av 420 miljoner finska mark .", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "420 miljoner finska mark", @@ -65,7 +65,7 @@ }, { "Input": "DNB Markets sänker riktkursen för Ericsson till 134 kronor från 138 kronor. Rekommendationen köp upprepas. Det framgår av en analys. Aktien byter ägare på 102,60 kronor i skrivande stund på torsdagsförmiddagen.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "134 kronor", @@ -101,7 +101,7 @@ }, { "Input": "Bara under måndagens rally i de svaga aktierna tappade blankare på de sju reseaktierna Carnival Corp, Expedia Group, Booking Holdings Inc , Royal Caribbean Group, American Airlines Group Wynn Resorts och Norwegian Cruise Line Holdings, 2,35 miljarder dollar.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "2,35 miljarder dollar", @@ -117,7 +117,7 @@ }, { "Input": "priset för den andra simulatorn varierar med 16,4 miljoner US$", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "16,4 miljoner us$", @@ -134,7 +134,7 @@ }, { "Input": "Man från Örebro satsade 48 kronor på V75 – vann 1,4 miljoner kronor: Hade ingen aning", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "48 kronor", @@ -160,7 +160,7 @@ }, { "Input": "Hans bidrag var 5 euro och 50 cent", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "5 euro och 50 cent", @@ -175,7 +175,7 @@ }, { "Input": "Hans bidrag var €5,90", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "€5,90", @@ -190,7 +190,7 @@ }, { "Input": "Det amerkanska försvaret investerade 2 miljarder amerikanska dollar i forskning rörande AI.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "2 miljarder amerikanska dollar", @@ -207,7 +207,7 @@ }, { "Input": "coyle ' s förmögenhet uppskattades till £ 8.10 miljoner i oktober 2014 .", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "£ 8.10 miljoner", @@ -223,7 +223,7 @@ }, { "Input": "inkomsträntan sjönk med 27 % under kvartalet till $ 254 miljoner.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "$ 254 miljoner", @@ -239,7 +239,7 @@ }, { "Input": "inkomsträntan sjönk med 27 % under kvartalet till 254 miljoner SEK.", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "254 miljoner sek", @@ -257,7 +257,7 @@ { "Input": "du får 30 spänn för alltihop.", "Comment": "spänn is slang for swedish krona", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "30 spänn", @@ -274,7 +274,7 @@ }, { "Input": "30 SEK", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "30 sek", @@ -291,7 +291,7 @@ }, { "Input": "SEK 30", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "sek 30", @@ -308,7 +308,7 @@ }, { "Input": "Budgeten är SEK 30000000", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "sek 30000000", @@ -325,7 +325,7 @@ }, { "Input": "Budgeten är SEK 30 miljoner", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "sek 30 miljoner", @@ -342,7 +342,7 @@ }, { "Input": "Budgeten är NOK 30 miljoner", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "nok 30 miljoner", @@ -359,7 +359,7 @@ }, { "Input": "Budgeten är DKK 30 miljoner", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "dkk 30 miljoner", @@ -376,7 +376,7 @@ }, { "Input": "Budgeten är GBP 30 miljoner", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "gbp 30 miljoner", @@ -393,7 +393,7 @@ }, { "Input": "Budgeten är USD 30 miljoner", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "usd 30 miljoner", @@ -410,7 +410,7 @@ }, { "Input": "En krona är 100 öre", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "en krona", @@ -436,7 +436,7 @@ }, { "Input": "Grattis! Du har nått slutet av testerna. Räcker 100 spänn som tack för besväret?", - "NotSupportedByDesign": "javascript, python, java", + "NotSupportedByDesign": "javascript , java", "Results": [ { "Text": "100 spänn", @@ -453,7 +453,7 @@ }, { "Input": "det kostar bara 15 dollar och 15 cent.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "15 dollar och 15 cent", @@ -469,7 +469,7 @@ }, { "Input": "det kostar bara tretton euro och fyrtiofem cent.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "tretton euro och fyrtiofem cent", @@ -486,7 +486,7 @@ }, { "Input": "det kostar bara 15 dollar och 15.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "15 dollar och 15", @@ -502,7 +502,7 @@ }, { "Input": "det kostar bara 15 dollar 50.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "15 dollar 50", @@ -518,7 +518,7 @@ }, { "Input": "usd$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "usd$ 15", @@ -535,7 +535,7 @@ }, { "Input": "mxn$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "mxn$ 15", @@ -552,7 +552,7 @@ }, { "Input": "aud$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "aud$ 15", @@ -569,7 +569,7 @@ }, { "Input": "cad$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "cad$ 15", @@ -586,7 +586,7 @@ }, { "Input": "nzd$15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "nzd$15", @@ -603,12 +603,12 @@ }, { "Input": "Se till att rymma västkustens tidszon", - "NotSupported": "javascript,python,java", + "NotSupported": "javascript ,java", "Results": [] }, { "Input": "vi har 100 Att", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "100 att", diff --git a/Specs/NumberWithUnit/Swedish/DimensionModel.json b/Specs/NumberWithUnit/Swedish/DimensionModel.json deleted file mode 100644 index ce14c77429..0000000000 --- a/Specs/NumberWithUnit/Swedish/DimensionModel.json +++ /dev/null @@ -1,1112 +0,0 @@ -[ - { - "Input": "75ml", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "75ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Milliliter", - "subtype": "Volume" - }, - "Start": 0, - "End": 3 - } - ] - }, - { - "Input": "Den största nackdelen är dess tjocklek på 3 tum, stor nog för att kallas klumpig.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "3 tum", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Inch", - "subtype": "Length" - }, - "Start": 42, - "End": 46 - } - ] - }, - { - "Input": "en tornado blåste igenom längs tio miles. Minst 14 människor dödades och dussintals lämnades hemlösa.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "tio miles", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 31, - "End": 39 - } - ] - }, - { - "Input": "det krävs mer än 10 1/2 miles med kabel för att koppla upp alla 23 datorerna.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "10 1/2 miles", - "TypeName": "dimension", - "Resolution": { - "value": "10,5", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 17, - "End": 28 - } - ] - }, - { - "Input": "resan på sextio kilometer som tidigare på dagen tagit 20 minuter tog nu mer än tre timmar.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "sextio kilometer", - "TypeName": "dimension", - "Resolution": { - "value": "60", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 9, - "End": 24 - } - ] - }, - { - "Input": "sett till hela industrin , föll oljeproduktionen i detta land med 500000 fat per dag under de första åtta månaderna detta år.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "500000 fat", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Barrel", - "subtype": "Weight" - }, - "Start": 66, - "End": 75 - } - ] - }, - { - "Input": "det är vad som 1 ) förklarar varför vi är , ja , oss själva snarare än bo jackson ; 2 ) varnar för att det är möjligt att drunkna i en sjö som i genomsnitt är två fot djup ; och 3 ) förutsäger att 10 , 000 apor placerade framför 10 , 000 pianon skulle producerae 1 , 118 publicerbara rock ' n ' roll sånger.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "två fot", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 159, - "End": 165 - } - ] - }, - { - "Input": "den 19 maj , började fda internera kinesiska svampar in 68-grams burkar efter att mer än 100 människor i mississippi , new york och pennsylvania blev sjuka efter att de hade ätit skämda svampar.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "68-grams", - "TypeName": "dimension", - "Resolution": { - "value": "68", - "unit": "Gram", - "subtype": "Weight" - }, - "Start": 56, - "End": 63 - } - ] - }, - { - "Input": "mr . hulings berättade skadeglatt att han sålde alla sina aktier en vecka innan marknaden rasade med 190 punkter den 13 okt , och han använder pengarna till att köpa en 45ha hästgård.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "45ha", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Square hectometer", - "subtype": "Area" - }, - "Start": 169, - "End": 172 - } - ] - }, - { - "Input": "sen , för att göra dessa trädgårdstält till veritabla rum , hade ms . bartlett slängt upp fönsterlösa väggar (tegel, puts, häck ) åtta till 10 fot högt, vilket medförde att insidan föll i en dags - lång skugga.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "10 fot", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 140, - "End": 145 - } - ] - }, - { - "Input": "` ` ledningen gillar inte överraskningar , ' ' noterar jack zaves , som , i egenskap av fuel - services director på american airlines , köper 2,4 miljarder gallons med flygbränsle per år.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "2,4 miljarder gallons", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 142, - "End": 162 - } - ] - }, - { - "Input": "en vattenkylare på 10-gallon hade vält ned på golvet och blött ned den röda mattan.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "10-gallon", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 19, - "End": 27 - } - ] - }, - { - "Input": "i närheten plaskade sex delfiner runt i tanken med 1,5 miljoner gallon saltvatten.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1,5 miljoner gallon", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 51, - "End": 69 - } - ] - }, - { - "Input": "och hans barn väger mer än 2 kilo.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "2 kilo", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Kilogram", - "subtype": "Weight" - }, - "Start": 27, - "End": 32 - } - ] - }, - { - "Input": "``jag litar inte på människor som inte äter,'' sa ms. volokh, även om hon själv slutade äta lunch för några år sedan för att gå ner 15kg.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "15kg", - "TypeName": "dimension", - "Resolution": { - "value": "15", - "unit": "Kilogram", - "subtype": "Weight" - }, - "Start": 132, - "End": 135 - } - ] - }, - { - "Input": "Vikten är 150 mikrogram", - "Results": [ - { - "Text": "150 mikrogram", - "Start": 10, - "End": 22, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Microgram", - "value": "150" - } - } - ] - }, - { - "Input": "Vikten är 120 μg", - "Results": [ - { - "Text": "120 μg", - "Start": 10, - "End": 15, - "TypeName": "dimension", - "Resolution": { - "subtype": "Weight", - "unit": "Microgram", - "value": "120" - } - } - ] - }, - { - "Input": "shell , ett dotterföretag till royal dutch / shell group , kommer att tillåtas exportera 0,9 biljoner kubikfot , och gulf , en enhet inom olympia & york developments ltd. kommer tillåtas exportera", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "0,9 biljoner kubikfot", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "unit": "Cubic foot", - "subtype": "Volume" - }, - "Start": 89, - "End": 109 - } - ] - }, - { - "Input": "viktiga punkter i dekretet , som det ser ut nu , är : - - en begränsning på 660 kvadratmeter för vad en familj kan äga , i landets sex största städer , men mer i mindre städer.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "660 kvadratmeter", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 76, - "End": 91 - } - ] - }, - { - "Input": "tigrean armies are now 200 miles north of addis ababa , threatening the town of dese , which would cut off mr . mengistu ' s capital from the port of assab , through which all fuel and other supplies reach addis ababa.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "200 miles", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 23, - "End": 31 - } - ] - }, - { - "Input": "han sa att hans en av datorerna gled 3 meter längs golvet.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "3 meter", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Meter", - "subtype": "Length" - }, - "Start": 37, - "End": 43 - } - ] - }, - { - "Input": "kärnan i hans innehav är 190000 kvadratmeter oerhört värdefulla fastigheter i marunouchi distriktet , affärs- och finanscentrat i Tokyo, ofta skämtsamt kallat ` ` mitsubishi village. ' '", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "190000 kvadratmeter", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 25, - "End": 43 - } - ] - }, - { - "Input": "satelliten , byggd av hughes för den internationella kommunikationssattelitorganisationen , är en del av ett $ 700 miljoners-kontrakt som tilldelades hughes 1982 för att utveckla fem av tre-tons satteliterna.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "tre-tons", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 186, - "End": 193 - } - ] - }, - { - "Input": "in a 1996 report on biological weapons , the center for strategic and international studies , a public policy research institution in washington , warned that it was easy for would - be terrorists to assemble biological weapons _ using commercial equipment with a capacity of 130 gallons.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "130 gallons", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 276, - "End": 286 - } - ] - }, - { - "Input": "the trade group ' s compilation of commerce department data showed that august imports , the second largest monthly total of the year , were up 5 % from july ' s 1458000 ton but below last year ' s high of in june 1988.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1458000 ton", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 162, - "End": 172 - } - ] - }, - { - "Input": "vid nr . 1 , slog singh ett slag med en järn 9:a som hamnade mindre än sex fot från koppen.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "sex fot", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 71, - "End": 77 - } - ] - }, - { - "Input": "så när nästa års ' s psyllium-gröda skördas i mars, är den kanske mindre än de 16000 ton de senaste åren - - just vid toppen av psyllium-boomen.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "16000 ton", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 79, - "End": 87 - } - ] - }, - { - "Input": "the 486 is the descendant of a long series of intel chips that began dominating the market ever since ibm picked the 16-bit 8088 chip for its first personal computer.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "16-bit", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "Bit", - "subtype": "Information" - }, - "Start": 117, - "End": 122 - } - ] - }, - { - "Input": "Detta: ` ` jiotto caspita ' ' kan köra i över 188 kilometer per timme , som en talesman för företaget yttryckte det..", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "188 kilometer per timme", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Kilometer per hour", - "subtype": "Speed" - }, - "Start": 46, - "End": 68 - } - ] - }, - { - "Input": "flottan har satt upp en landningsplats för helikoptrar 100 meter från en mobil kommandocentral i utkanten av Stockholm.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "100 meter", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Meter", - "subtype": "Length" - }, - "Start": 55, - "End": 63 - } - ] - }, - { - "Input": "trafikverket planerar att lägga till en upphöjd väg för bussar och bilpendlare för ca halva sträckningen, som är 25,5km, mellan Malmö och Sankt Olof.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "25,5km", - "TypeName": "dimension", - "Resolution": { - "value": "25,5", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 113, - "End": 118 - } - ] - }, - { - "Input": "på min 4-kilometers resa varje morgon kör jag förbi fyra tomma hus.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "4-kilometers", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 7, - "End": 18 - } - ] - }, - { - "Input": "vi är förolämpade, sa langa från det grekiskkatolska högkvarteret, ca 325 kilometer nordost om bukarest.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "325 kilometer", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 70, - "End": 82 - } - ] - }, - { - "Input": "rotich är korta ( 5 fot", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "5 fot", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 18, - "End": 22 - } - ] - }, - { - "Input": "4 inches) 28 - år - gammal som inte började springa seriöst förrän för tre år sedan och som inte hade tävlat inomhus förrän denna månad.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "4 inches", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Inch", - "subtype": "Length" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "raceway park ( minnesota ) i shakopee är en 1/4 kilometer belagd oval.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1/4 kilometer", - "TypeName": "dimension", - "Resolution": { - "value": "0,25", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 44, - "End": 56 - } - ] - }, - { - "Input": "castlecrag mountain är beläget söder om moat-sjön , 1,6 km väster om frinkberget längs samma bergskam.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1,6 km", - "TypeName": "dimension", - "Resolution": { - "value": "1,6", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 52, - "End": 57 - } - ] - }, - { - "Input": "javadi-kullarna är belägna ungefär 17 km från Anbur.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "17 km", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 35, - "End": 39 - } - ] - }, - { - "Input": "efter att de cirkulerat i två timmar runt lake michigan nära utställning landade kapten hugo lang 776-fots luftfarkosten vid närbelägna curtiss - wright flygplatsen i glenview.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "776-fots", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 98, - "End": 105 - } - ] - }, - { - "Input": "korsningen med highway 35 och highway 115 mot lindsay och peterborough ( avfart 436 ) ligger 500 meter öster om bennett road.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "500 meter", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Meter", - "subtype": "Length" - }, - "Start": 93, - "End": 101 - } - ] - }, - { - "Input": "1995 introducerade canon det första kommersiellt gångbara slr-objektivet med inbyggd bildstabilisering; ef 75 -300mm f / 4 - 5 . 6 is usm.", - "NotSupportedByDesign": "javascript, python, java", - "NotSupported": "java, javascript", - "Results": [ - { - "Text": "300mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Millimeter", - "subtype": "Length" - }, - "Start": 111, - "End": 115 - } - ] - }, - { - "Input": "sterling armaments i dagenham , essex producerade ett konverteringskit som bestod av en ny 7,62mm pipa , magasin , extractor och utkastare kommersiellt.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "7,62mm", - "TypeName": "dimension", - "Resolution": { - "value": "7,62", - "unit": "Millimeter", - "subtype": "Length" - }, - "Start": 91, - "End": 96 - } - ] - }, - { - "Input": "projektet kostar $ 46 , 8 million , och är avsett att öka företaget ' s produktionskapacitet med 25 % till 34500 ton kopparkatoder per år.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "34500 ton", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 107, - "End": 115 - } - ] - }, - { - "Input": "canadian steels - pelletsproduktion uppgick till 291890 ton veckan som slutade den 7 okt, en ökning med 7 , upp 14 . 8 % jämfört med föregående veckas totalproduktion , meddelade statistikbyrån.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "291890 ton", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 49, - "End": 58 - } - ] - }, - { - "Input": "floridapantrar lever i revir mellan 190 km2.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "190 km2", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Square kilometer", - "subtype": "Area" - }, - "Start": 36, - "End": 42 - } - ] - }, - { - "Input": "Jag är en man.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - }, - { - "Input": "Skicka ett snabbt DM och fråga efter deras e-post adress", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - }, - { - "Input": "1m är lika med 10 dm", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1m", - "Start": 0, - "End": 1, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - }, - { - "Text": "10 dm", - "Start": 15, - "End": 19, - "TypeName": "dimension", - "Resolution": { - "unit": "Decimeter", - "subtype": "Length", - "value": "10" - } - } - ] - }, - { - "Input": "Han har en penna som är 10 \" lång.", - "NotSupportedByDesign": "javascript, python, java", - "NotSupported": "java", - "Results": [ - { - "Text": "10 \"", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Inch", - "subtype": "Length" - }, - "Start": 24, - "End": 27 - } - ] - }, - { - "Input": "Storleken på denna fil är 100 mb", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "100 mb", - "TypeName": "dimension", - "Resolution": { - "unit": "Megabit", - "subtype": "Information", - "value": "100" - }, - "Start": 26, - "End": 31 - } - ] - }, - { - "Input": "Storleken på denna fil är 100 MB", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "100 mb", - "TypeName": "dimension", - "Resolution": { - "unit": "Megabyte", - "subtype": "Information", - "value": "100" - }, - "Start": 26, - "End": 31 - } - ] - }, - { - "Input": "Jag överraskar dig 14:00", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - }, - { - "Input": "Han sade: 2 pm är 2 pikometer", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "2 pm", - "Start": 10, - "End": 13, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "subtype": "Length", - "value": "2" - } - }, - { - "Text": "2 pikometer", - "Start": 18, - "End": 28, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "subtype": "Length", - "value": "2" - } - } - ] - }, - { - "Input": "som en mile kan ge.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "en mile", - "Start": 4, - "End": 10, - "TypeName": "dimension", - "Resolution": { - "unit": "Mile", - "subtype": "Length", - "value": "1" - } - } - ] - }, - { - "Input": "I ' m tired", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - }, - { - "Input": "Jag är 1,8m lång.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1,8m", - "Start": 7, - "End": 10, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1,8" - } - } - ] - }, - { - "Input": "Det kostar 1.8M dollar.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [] - }, - { - "Input": "1 m 1 m", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1 m", - "Start": 0, - "End": 2, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - }, - { - "Text": "1 m", - "Start": 4, - "End": 6, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - } - ] - }, - { - "Input": "1 m x 1 m", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1 m", - "Start": 0, - "End": 2, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - }, - { - "Text": "1 m", - "Start": 6, - "End": 8, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - } - ] - }, - { - "Input": "Längden är 12 m 2 dm mer eller mindre", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "12 m", - "TypeName": "dimension", - "Resolution": { - "value": "12", - "unit": "Meter", - "subtype": "Length" - }, - "Start": 11, - "End": 14 - }, - { - "Text": "2 dm", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Decimeter", - "subtype": "Length" - }, - "Start": 16, - "End": 19 - } - ] - }, - { - "Input": "rotera 90 grader", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "90 grader", - "Start": 7, - "End": 15, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "90" - } - } - ] - }, - { - "Input": "sväng vänster 45 grader", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "45 grader", - "Start": 14, - "End": 22, - "TypeName": "dimension", - "Resolution": { - "unit": "Degree", - "subtype": "Angle", - "value": "45" - } - } - ] - }, - { - "Input": "Vinkeln är 0,8rad", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "0,8rad", - "Start": 11, - "End": 16, - "TypeName": "dimension", - "Resolution": { - "unit": "Radian", - "subtype": "Angle", - "value": "0,8" - } - } - ] - }, - { - "Input": "vrid ett halvt varv", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "ett halvt varv", - "Start": 5, - "End": 18, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "0,5" - } - } - ] - }, - { - "Input": "rotera 3 varv", - "NotSupportedByDesign": "java, javascript, python", - "Results": [ - { - "Text": "3 varv", - "Start": 7, - "End": 12, - "TypeName": "dimension", - "Resolution": { - "unit": "Turn", - "subtype": "Angle", - "value": "3" - } - } - ] - }, - { - "Input": "temperaturen är 24 grader", - "NotSupportedByDesign": "java, javascript, python", - "Results": [] - }, - { - "Input": "Vatten kokar vid 100° Celsius", - "NotSupportedByDesign": "java, javascript, python", - "Results": [] - } -] diff --git a/Specs/NumberWithUnit/Swedish/TemperatureModel.json b/Specs/NumberWithUnit/Swedish/TemperatureModel.json deleted file mode 100644 index cf9fe68e14..0000000000 --- a/Specs/NumberWithUnit/Swedish/TemperatureModel.json +++ /dev/null @@ -1,660 +0,0 @@ -[ - { - "Input": "utanför är temperaturen 40 gr celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "40 gr celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 24, - "End": 36 - } - ] - }, - { - "Input": "det är 90 fahrenheit i texas", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "90 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 7, - "End": 19 - } - ] - }, - { - "Input": "-5 grader fahrenheit", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "-5 grader fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "6 gr. C", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "6 gr. c", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "C" - }, - "Start": 0, - "End": 6 - } - ] - }, - { - "Input": "98,6 grader f är normal temperatur", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "98,6 grader f", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "ställ in temperaturen på 30 grader celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "30 grader celsius", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 25, - "End": 41 - } - ] - }, - { - "Input": "normal temperatur är 98,6 grader fahrenheit", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "98,6 grader fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 21, - "End": 42 - } - ] - }, - { - "Input": "100 grader f", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "100 grader f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 grader c", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "20 grader c", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "100,2 grader fahrenheit är lågt", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "100,2 grader fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "100,2", - "unit": "F" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "10,5 celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "10,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10,5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "20 grader celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "20 grader celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 16 - } - ] - }, - { - "Input": "20,3 celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "20,3 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "20,3", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "34,5 celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "34,5 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "34,5", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "utanför är temperaturen 98 grader", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "98 grader", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degree" - }, - "Start": 24, - "End": 32 - } - ] - }, - { - "Input": "ställ in termostaten på 85°", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "85°", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 24, - "End": 26 - } - ] - }, - { - "Input": "höj temperaturen med 5 grader", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "5 grader", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 21, - "End": 28 - } - ] - }, - { - "Input": "ställ in temperaturen på 70 grader f", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "70 grader f", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 25, - "End": 35 - } - ] - }, - { - "Input": "höj temperaturen med 20 grader", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "20 grader", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degree" - }, - "Start": 21, - "End": 29 - } - ] - }, - { - "Input": "ställ in temperaturen på 100 grader", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "100 grader", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 25, - "End": 34 - } - ] - }, - { - "Input": "behåll temperaturen på 75 grader f", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "75 grader f", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 23, - "End": 33 - } - ] - }, - { - "Input": "lämna temperaturen på 40 celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "40 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 22, - "End": 31 - } - ] - }, - { - "Input": "lämna temperaturen på 50 gr.", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "50 gr.", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degree" - }, - "Start": 22, - "End": 27 - } - ] - }, - { - "Input": "omvandla 10 celsius till fahrenheit", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "10 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 9, - "End": 18 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 25, - "End": 34 - } - ] - }, - { - "Input": "34,9 celsiusgrader till fahrenheit", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "34,9 celsiusgrader", - "TypeName": "temperature", - "Resolution": { - "value": "34,9", - "unit": "C" - }, - "Start": 0, - "End": 17 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 24, - "End": 33 - } - ] - }, - { - "Input": "omvandla 200 celsius till fahrenheit", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "200 celsius", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 9, - "End": 19 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 26, - "End": 35 - } - ] - }, - { - "Input": "fahrenheit till celsius 101 fahrenheit är så mycket celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "101 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - }, - "Start": 24, - "End": 37 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 9 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 16, - "End": 22 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 52, - "End": 58 - } - ] - }, - { - "Input": "50 grader celsius till fahrenheit", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "50 grader celsius", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - }, - "Start": 0, - "End": 16 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 23, - "End": 32 - } - ] - }, - { - "Input": "skulle du kunna omvandla 51 fahrenheit till grader celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "51 fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 25, - "End": 37 - }, - { - "Text": "grader celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 44, - "End": 57 - } - ] - }, - { - "Input": "omvandla 106 grader fahrenheit till grader celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "106 grader fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 9, - "End": 29 - }, - { - "Text": "grader celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 36, - "End": 49 - } - ] - }, - { - "Input": "omvandla 1 grad fahrenheit till celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1 grad fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "1", - "unit": "F" - }, - "Start": 9, - "End": 25 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 32, - "End": 38 - } - ] - }, - { - "Input": "omvandla 1 grad celsius till fahrenheit", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "1 grad celsius", - "TypeName": "temperature", - "Resolution": { - "value": "1", - "unit": "C" - }, - "Start": 9, - "End": 22 - }, - { - "Text": "fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 29, - "End": 38 - } - ] - }, - { - "Input": "hur man omvandlar - 20 grader fahrenheit till celsius", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "- 20 grader fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 18, - "End": 39 - }, - { - "Text": "celsius", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 46, - "End": 52 - } - ] - }, - { - "Input": "gör en 45 graders vinkel", - "NotSupportedByDesign": "java, javascript, python", - "Results": [] - }, - { - "Input": "Rotera 90°", - "NotSupportedByDesign": "java, javascript, python", - "Results": [] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Turkish/AgeModel.json b/Specs/NumberWithUnit/Turkish/AgeModel.json deleted file mode 100644 index 8d09b02214..0000000000 --- a/Specs/NumberWithUnit/Turkish/AgeModel.json +++ /dev/null @@ -1,290 +0,0 @@ -[ - { - "Input": "Beş yaşındayken bisiklete binmeyi öğrendi", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "beş yaşındayken", - "TypeName": "age", - "Resolution": { - "value": "5", - "unit": "Year" - }, - "Start": 0, - "End": 14 - } - ] - }, - { - "Input": "Bu efsane on yaşında", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "on yaşında", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Year" - }, - "Start": 10, - "End": 19 - } - ] - }, - { - "Input": "Ben sadece 29 yaşındayım", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "29 yaşındayım", - "TypeName": "age", - "Resolution": { - "value": "29", - "unit": "Year" - }, - "Start": 11, - "End": 23 - } - ] - }, - { - "Input": "Şimdi, doksan beş yaş sonra, bakış açısı değişir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "doksan beş yaş", - "TypeName": "age", - "Resolution": { - "value": "95", - "unit": "Year" - }, - "Start": 7, - "End": 20 - } - ] - }, - { - "Input": "Çin Seddi 500 yaşından fazladır ve uzunluğu 5.000 milden fazladır", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500 yaşından", - "TypeName": "age", - "Resolution": { - "value": "500", - "unit": "Year" - }, - "Start": 10, - "End": 21 - } - ] - }, - { - "Input": "O 60 yaşında; 8 Mayıs 1945'te doğdu", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "60 yaşında", - "TypeName": "age", - "Resolution": { - "value": "60", - "unit": "Year" - }, - "Start": 2, - "End": 11 - } - ] - }, - { - "Input": "Vakaların %25'i 3 yaş civarına kadar tanılanmıyor", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3 yaş", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Year" - }, - "Start": 16, - "End": 20 - } - ] - }, - { - "Input": "Bir yıllık bir vaadi yerine getirmek için baskı ne zaman olacak?", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "bir yıllık", - "TypeName": "age", - "Resolution": { - "value": "1", - "unit": "Year" - }, - "Start": 0, - "End": 9 - } - ] - }, - { - "Input": "bebek yalnızca on aylıkken bu oldu", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "on aylıkken", - "TypeName": "age", - "Resolution": { - "value": "10", - "unit": "Month" - }, - "Start": 15, - "End": 25 - } - ] - }, - { - "Input": "komite önerisi 8 aylık", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "8 aylık", - "TypeName": "age", - "Resolution": { - "value": "8", - "unit": "Month" - }, - "Start": 15, - "End": 21 - } - ] - }, - { - "Input": "vakaların yaklaşık %50'si 18 yaş civarında tanılandı", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "18 yaş", - "TypeName": "age", - "Resolution": { - "value": "18", - "unit": "Year" - }, - "Start": 26, - "End": 31 - } - ] - }, - { - "Input": "bu mümkün, ancak 2006'da onların %95'i üç aydan daha küçüktü", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "üç aydan", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Month" - }, - "Start": 39, - "End": 46 - } - ] - }, - { - "Input": "eğer Aralık'ta devam edersek üç haftalık olacak", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "üç haftalık", - "TypeName": "age", - "Resolution": { - "value": "3", - "unit": "Week" - }, - "Start": 29, - "End": 39 - } - ] - }, - { - "Input": "6 haftalıkken Noel'i bile kutlayabilir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "6 haftalıkken", - "TypeName": "age", - "Resolution": { - "value": "6", - "unit": "Week" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "90 günlük bir elektrik faturası epey geçtir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "90 günlük", - "TypeName": "age", - "Resolution": { - "value": "90", - "unit": "Day" - }, - "Start": 0, - "End": 8 - } - ] - }, - { - "Input": "o 40 - 50 yaşında", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50 yaşında", - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "50" - }, - "Start": 7, - "End": 16 - } - ] - }, - { - "Input": "Henüz 17 yaşındasın", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "17 yaşındasın", - "TypeName": "age", - "Resolution": { - "unit": "Year", - "value": "17" - }, - "Start": 6, - "End": 18 - } - ] - }, - { - "Input": "Bebek 20 günlükmüş", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20 günlükmüş", - "TypeName": "age", - "Resolution": { - "unit": "Day", - "value": "20" - }, - "Start": 6, - "End": 17 - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Turkish/CurrencyModel.json b/Specs/NumberWithUnit/Turkish/CurrencyModel.json index d887faf7b5..328a751898 100644 --- a/Specs/NumberWithUnit/Turkish/CurrencyModel.json +++ b/Specs/NumberWithUnit/Turkish/CurrencyModel.json @@ -242,7 +242,7 @@ }, { "Input": "genel motorlar corp.'un yavaş satışlara tepki gösteren chevrolet bölümü, çekirdek kompakt otomobil hattının iki kapılı versiyonu olan 1990 beretta'sında 800 $'lık indirim yapacağını söyledi", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "800 $", @@ -339,7 +339,7 @@ }, { "Input": "walter kirchberger, painewebber şirketinden bir analist, hisse sahiplerine daha yüksek, 70 $ - hisse fiyatı teklifin stena - tiphook teklifini bloke etmenin oldukça etkili bir yöntemi olduğunu söyledi.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "70 $", @@ -724,7 +724,7 @@ }, { "Input": "önceki Bellsouth anlaşması, yaklaşık 98 $'lık bir payla değerlendi.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "98 $", @@ -1119,7 +1119,7 @@ }, { "Input": "npd araştırma firmasına göre, tüm taşınabilir pencerelerin ortalama satış fiyatı ekim 2008'de 659 $'dan düştü", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "659 $", @@ -1151,7 +1151,7 @@ }, { "Input": "fulham takım arkadaşı johnny haynes ilk 100 £'lik oyuncu oldu.", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "100 £", @@ -1477,7 +1477,7 @@ }, { "Input": "Hey, maliyeti 100 元!", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "100 元", @@ -1494,7 +1494,7 @@ }, { "Input": "Bu kitabın maliyeti 100 ₡", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "100 ₡", @@ -1511,7 +1511,7 @@ }, { "Input": "Bisikleti almak için 100 ₾ harcadım", - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript ,java", "Results": [ { "Text": "100 ₾", @@ -1712,7 +1712,7 @@ }, { "Input": "usd$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "usd$ 15", @@ -1729,7 +1729,7 @@ }, { "Input": "mxn$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "mxn$ 15", @@ -1746,7 +1746,7 @@ }, { "Input": "aud$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "aud$ 15", @@ -1763,7 +1763,7 @@ }, { "Input": "cad$ 15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "cad$ 15", @@ -1780,7 +1780,7 @@ }, { "Input": "nzd$15", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript , java", "Results": [ { "Text": "nzd$15", diff --git a/Specs/NumberWithUnit/Turkish/DimensionModel.json b/Specs/NumberWithUnit/Turkish/DimensionModel.json deleted file mode 100644 index 5a5f73093e..0000000000 --- a/Specs/NumberWithUnit/Turkish/DimensionModel.json +++ /dev/null @@ -1,989 +0,0 @@ -[ - { - "Input": "Ağırlığın 200 libre", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 libre", - "TypeName": "dimension", - "Resolution": { - "unit": "Pound", - "subtype": "Weight", - "value": "200" - }, - "Start": 10, - "End": 18 - } - ] - }, - { - "Input": "75 ml", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "75 ml", - "TypeName": "dimension", - "Resolution": { - "value": "75", - "unit": "Milliliter", - "subtype": "Volume" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "En büyük dezavantajı, bir danışman tarafından kullanıisız olarak tanımlaması için yeterince büyük olan 3 inç kalınlığında olması olabilir.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "3 inç", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Inch", - "subtype": "Length" - }, - "Start": 103, - "End": 107 - } - ] - }, - { - "Input": "yaklaşık on mil uzunluğundaki bir alanda en az on dört kişiyi öldürdü ve düzinelerce evi moloz haline getirdi.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "on mil", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 9, - "End": 14 - } - ] - }, - { - "Input": "hepsini bağlamak için 10 1/2 milden fazla kablo ve tel ve 23 bilgisayar gerekiyor", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 1/2 milden", - "TypeName": "dimension", - "Resolution": { - "value": "10,5", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 22, - "End": 34 - } - ] - }, - { - "Input": "Günde 20 dakika önce almış olan havaalanı otelime altı mil seyahat üç saatten fazla sürdü.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "altı mil", - "TypeName": "dimension", - "Resolution": { - "value": "6", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 50, - "End": 57 - } - ] - }, - { - "Input": "Endüstri çapında bu ülkede petrol üretimi, bu yılın ilk sekiz ayında varil başına günde 500.000 varil düştü.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500.000 varil", - "TypeName": "dimension", - "Resolution": { - "value": "500000", - "unit": "Barrel", - "subtype": "Weight" - }, - "Start": 88, - "End": 100 - } - ] - }, - { - "Input": "bu ne 1) neden bo jackson yerine kendimiz gibi olduğumuzu açıklıyor; 2) ortalama iki fit derinliğinde bir gölde boğulma ihtimaline dikkat eder; ve 3) 10.000 piyanodan önce yerleştirilmiş 10.000 maymunun yayınlanabilecek rock'n'roll melodileri üreteceğini tahmin ediyor.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iki fit", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 81, - "End": 87 - } - ] - }, - { - "Input": "Bay. Hulings, piyasada bir hafta önce tüm hisse senetlerini sattığını ve 13 Ekim'de 190 puanlık bir düşüş yaşadığını ve 45 dönümlük bir at çiftliği satın almak için parayı kullandığını söylüyor.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "45 dönümlük", - "TypeName": "dimension", - "Resolution": { - "value": "45", - "unit": "Acre", - "subtype": "Area" - }, - "Start": 120, - "End": 130 - } - ] - }, - { - "Input": "Daha sonra, bu bahçeleri kelimenin tam anlamıyla sessiz odalar haline getirmek için Bayan Bartlett, sekiz ila 10 fit yüksekliğindeki penceresiz duvarları (tuğla, kafes, çit) atıp içlerini gün boyu süren styjian gölgesine yöneltti.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 fit", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 110, - "End": 115 - } - ] - }, - { - "Input": "'yönetim sürpriz istemiyor' diye not alan Amerikan havayolları yakıt hizmetleri müdürü Jack Zaves, yılda 2,4 milyar galon jet yakıt satın alıyor.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2,4 milyar galon", - "TypeName": "dimension", - "Resolution": { - "value": "2400000000", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 105, - "End": 120 - } - ] - }, - { - "Input": "10 galonluk bir su soğutucusu, kırmızı halıyı ıslatmak için zemine çarptı.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 galonluk", - "TypeName": "dimension", - "Resolution": { - "value": "10", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 0, - "End": 10 - } - ] - }, - { - "Input": "yakınlarda altı yunus 1,5 milyon galonluk tuzlu su akvaryumu içerisinde uçacak.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1,5 milyon galonluk", - "TypeName": "dimension", - "Resolution": { - "value": "1500000", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 22, - "End": 40 - } - ] - }, - { - "Input": "ve bu bebek iki libreden fazla.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iki libreden", - "TypeName": "dimension", - "Resolution": { - "value": "2", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 12, - "End": 23 - } - ] - }, - { - "Input": "'Yemeyen insanlara güvenmiyorum' dedi Bayan Volokh, birkaç yıl önce kendisi 25 libre vermek için öğle yemeği yemeyi bırakmasına rağmen.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "25 libre", - "TypeName": "dimension", - "Resolution": { - "value": "25", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 76, - "End": 83 - } - ] - }, - { - "Input": "Kraliyet Hollanda / Shell grubunun bir iştiraki olan Shell, 0,9 trilyon fit küp ihracata izin verecek ve Olympia & York geliştirme şirketinin bir birimi olan körfez ihracatına izin verilecek", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "0,9 trilyon fit küp", - "TypeName": "dimension", - "Resolution": { - "value": "900000000000", - "unit": "Cubic foot", - "subtype": "Volume" - }, - "Start": 60, - "End": 78 - } - ] - }, - { - "Input": "Halihazırda faturaların öne çıkan özellikleri şunlardır: - Bir ailenin sahip olabileceği gayrimenkul miktarında bir kısıtlama ve ülkenin en büyük altı şehrinde 660 metrekare, ancak daha küçük şehirlerde ve kırsal alanlarda daha fazla.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "660 metrekare", - "TypeName": "dimension", - "Resolution": { - "value": "660", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 160, - "End": 172 - } - ] - }, - { - "Input": "Tigrean orduları şu anda addis ababa'nın 200 mil kuzeyinde, Bay Mengistu'nun başkentini assab limanından kesecek ve tüm yakıtların ve diğer malzemelerin addis ababa'ya ulaştığı Dese kentini tehdit ediyor.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 mil", - "TypeName": "dimension", - "Resolution": { - "value": "200", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 41, - "End": 47 - } - ] - }, - { - "Input": "Bilgisayarlardan birinin zeminde kayan üç ayakla gittiğini söyledi.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "üç ayakla", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 39, - "End": 47 - } - ] - }, - { - "Input": "Holdinglerin merkezi, Tokyo'nun ticaret ve finans merkezi olan Marunouchi bölgesinde, sıklıkla 'mitsubishi köyü' esprisiyle adlandırılan, inanılmaz pahalı mülk 190.000 metrekaredir.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "190.000 metrekaredir", - "TypeName": "dimension", - "Resolution": { - "value": "190000", - "unit": "Square meter", - "subtype": "Area" - }, - "Start": 160, - "End": 179 - } - ] - }, - { - "Input": "Hughes'un uluslararası telekomünikasyon uydu organizasyonu için yaptırdığı uydu, 1982'de Hughes'a verilen ve üç ton uydudan beşini geliştirmek için verilen 700 milyon dolarlık bir sözleşmenin parçası.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "üç ton", - "TypeName": "dimension", - "Resolution": { - "value": "3", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 109, - "End": 114 - } - ] - }, - { - "Input": "Biyolojik silahlar üzerine yapılan 1996 tarihli bir raporda, Washington'daki bir kamu politikaları araştırma kurumu olan stratejik ve uluslararası çalışmaların merkezi, 130 galon kapasiteli ticari teçhizat kullanarak biyolojik silahların birleştirilmesinin kolay olacağı konusunda uyarıda bulundu.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "130 galon", - "TypeName": "dimension", - "Resolution": { - "value": "130", - "unit": "Gallon", - "subtype": "Weight" - }, - "Start": 169, - "End": 177 - } - ] - }, - { - "Input": "Ticaret grubunun ticaret departmanı verileri derlemesi, yılın ikinci en büyük toplamı olan ağustos ayındaki ithalatın Temmuz 1.458.000 tona göre% 5, ancak 1988 yılının Haziran ayında geçen yılın en yüksek seviyesinin altında olduğunu gösterdi.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1.458.000 tona", - "TypeName": "dimension", - "Resolution": { - "value": "1458000", - "unit": "Ton", - "subtype": "Weight" - }, - "Start": 125, - "End": 138 - } - ] - }, - { - "Input": "Bu nedenle, gelecek yılın psyllium mahsulü mart ayında hasat edildiğinde, psyllium patlamasının zirvesindeki son birkaç yılın 16.000 metrik tondan daha küçük olabilir.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "16.000 metrik tondan", - "TypeName": "dimension", - "Resolution": { - "value": "16000", - "unit": "Metric ton", - "subtype": "Weight" - }, - "Start": 126, - "End": 145 - } - ] - }, - { - "Input": "486, IBM'in ilk kişisel bilgisayarı için 16-bit 8088 yongasını seçmesinden bu yana piyasaya hakim olan uzun bir intel cips serisinin soyundan geliyor.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "16-bit", - "TypeName": "dimension", - "Resolution": { - "value": "16", - "unit": "Bit", - "subtype": "Information" - }, - "Start": 41, - "End": 46 - } - ] - }, - { - "Input": "Bir şirket sözcüsü, 'jiotto caspita' nın saatte 188 milden fazla koşabileceğini söyledi.", - "Comment": "Prefixed AND suffixed speed unit in Tukish", - "NotSupported": "dotnet", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "saatte 188 milden", - "TypeName": "dimension", - "Resolution": { - "value": "188", - "unit": "Mile per hour", - "subtype": "Speed" - }, - "Start": 41, - "End": 58 - } - ] - }, - { - "Input": "Donanma, Bağdat'ın eteklerinde, mobil operasyon odasına sadece 100 metre mesafede bir helikopter iniş bölgesi kurdu.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 metre", - "TypeName": "dimension", - "Resolution": { - "value": "100", - "unit": "Meter", - "subtype": "Length" - }, - "Start": 63, - "End": 71 - } - ] - }, - { - "Input": "Caltrans, anıtsal kolezyum yakınında, Los Angeles'in hemen güneyinde, 2,5 mil uzunluğundaki liman yolunun ortasının üzerindeki otobüsler ve araç havuzları için ikinci bir kat daha eklemeyi planlıyor.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2,5 mil", - "TypeName": "dimension", - "Resolution": { - "value": "2,5", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 70, - "End": 76 - } - ] - }, - { - "Input": "Her sabah çiftliğe dört mil yol gidişimde dört boş eve daha gidiyorum", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "dört mil", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 20, - "End": 27 - } - ] - }, - { - "Input": "Hakarete uğradık, dedi, Katolik genel merkezindeki Langa, bükreşin 325 kilometre kuzeybatısında.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "325 kilometre", - "TypeName": "dimension", - "Resolution": { - "value": "325", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 67, - "End": 79 - } - ] - }, - { - "Input": "Rotich küçük, 5 fit", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5 fit", - "TypeName": "dimension", - "Resolution": { - "value": "5", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 14, - "End": 18 - } - ] - }, - { - "Input": "4 inç) 28 yaşında, üç yıl öncesine kadar ciddi bir şekilde koşmaya başlamamış ve bu aya kadar içeride yarışmamış.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "4 inç", - "TypeName": "dimension", - "Resolution": { - "value": "4", - "unit": "Inch", - "subtype": "Length" - }, - "Start": 0, - "End": 4 - } - ] - }, - { - "Input": "shakopee'deki raceway park (minnesota) 1/4 mil oval döşemelidir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1/4 mil", - "TypeName": "dimension", - "Resolution": { - "value": "0,25", - "unit": "Mile", - "subtype": "Length" - }, - "Start": 39, - "End": 45 - } - ] - }, - { - "Input": "Castlecrag dağı, Moat gölünün güneyinde, aynı sırt hattı boyunca dağın 1,6 km batısındadır", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1,6 km", - "TypeName": "dimension", - "Resolution": { - "value": "1,6", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 71, - "End": 76 - } - ] - }, - { - "Input": "javadi tepeleri ambur'a yaklaşık 17 km uzaklıktadır.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "17 km", - "TypeName": "dimension", - "Resolution": { - "value": "17", - "unit": "Kilometer", - "subtype": "Length" - }, - "Start": 33, - "End": 37 - } - ] - }, - { - "Input": "iki saat boyunca fuarın yakınında Michigan gölünün etrafını dolaştırdıktan sonra komutan Hugo Eckener, hava gemisini glenview'deki yakındaki Curtiss - Wright havaalanına 776 fit yükseklikten indi.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "776 fit", - "TypeName": "dimension", - "Resolution": { - "value": "776", - "unit": "Foot", - "subtype": "Length" - }, - "Start": 170, - "End": 176 - } - ] - }, - { - "Input": "35 nolu karayolu ve 115 nolu karayolu ile lindsay ve peterborough arasındaki kavşak (çıkış 436), bennett yolunun 500 metre doğusundadır.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "500 metre", - "TypeName": "dimension", - "Resolution": { - "value": "500", - "unit": "Meter", - "subtype": "Length" - }, - "Start": 113, - "End": 121 - } - ] - }, - { - "Input": "1995 yılında Canon, dahili görüntü sabitleme özellikli ilk ticari slr lensi piyasaya sürdü, ef 75 -300 mm f / 4-5. 6 usm.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "300 mm", - "TypeName": "dimension", - "Resolution": { - "value": "300", - "unit": "Millimeter", - "subtype": "Length" - }, - "Start": 99, - "End": 104 - } - ] - }, - { - "Input": "Dagenham'ın Sterling silahları, Essex ticari satış için yeni 7,62mm namlu, şarjör, sökücü ve ejektör içeren bir dönüşüm kiti üretti.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "7,62mm", - "TypeName": "dimension", - "Resolution": { - "value": "7,62", - "unit": "Millimeter", - "subtype": "Length" - }, - "Start": 61, - "End": 66 - } - ] - }, - { - "Input": "Proje 46,8 milyon dolara mal oluyor ve şirketin üretim kapasitesini% 25 artırarak 34.500 metrik ton bakır katoduna yükseltmeyi amaçlıyor.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "34.500 metrik ton", - "TypeName": "dimension", - "Resolution": { - "value": "34500", - "unit": "Metric ton", - "subtype": "Weight" - }, - "Start": 82, - "End": 98 - } - ] - }, - { - "Input": "Kanada'da bir çelik külçe üretimi, 7 Ekim'de sona eren haftada 291.890 metrik tonu buldu ve Kanada'daki bir federal ajansın istatistiklerine göre, bir önceki haftaya göre% 14.8 arttı.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "291.890 metrik tonu", - "TypeName": "dimension", - "Resolution": { - "value": "291890", - "unit": "Metric ton", - "subtype": "Weight" - }, - "Start": 63, - "End": 81 - } - ] - }, - { - "Input": "florida panterleri 190 km2 civarında evlerde yaşamaktadır.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "190 km2", - "TypeName": "dimension", - "Resolution": { - "value": "190", - "unit": "Square kilometer", - "subtype": "Area" - }, - "Start": 19, - "End": 25 - } - ] - }, - { - "Input": "bir metrik ton, 2.204,62 libreye eşittir.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "bir metrik ton", - "TypeName": "dimension", - "Resolution": { - "value": "1", - "unit": "Metric ton", - "subtype": "Weight" - }, - "Start": 0, - "End": 13 - }, - { - "Text": "2.204,62 libreye", - "TypeName": "dimension", - "Resolution": { - "value": "2204,62", - "unit": "Pound", - "subtype": "Weight" - }, - "Start": 16, - "End": 31 - } - ] - }, - { - "Input": "1 m. 10 dm'ye eşittir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "1 m", - "Start": 0, - "End": 2, - "TypeName": "dimension", - "Resolution": { - "unit": "Meter", - "subtype": "Length", - "value": "1" - } - }, - { - "Text": "10 dm", - "Start": 5, - "End": 9, - "TypeName": "dimension", - "Resolution": { - "unit": "Decimeter", - "subtype": "Length", - "value": "10" - } - } - ] - }, - { - "Input": "Bu dosyanın boyutu 100 mb", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 mb", - "TypeName": "dimension", - "Resolution": { - "unit": "Megabit", - "subtype": "Information", - "value": "100" - }, - "Start": 19, - "End": 24 - } - ] - }, - { - "Input": "2 pm'nin 2 pikometre olduğunu söyledi", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "2 pm", - "Start": 0, - "End": 3, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "subtype": "Length", - "value": "2" - } - }, - { - "Text": "2 pikometre", - "Start": 9, - "End": 19, - "TypeName": "dimension", - "Resolution": { - "unit": "Picometer", - "subtype": "Length", - "value": "2" - } - } - ] - }, - { - "Input": "o bir mil sağlayabilir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "bir mil", - "Start": 2, - "End": 8, - "TypeName": "dimension", - "Resolution": { - "unit": "Mile", - "subtype": "Length", - "value": "1" - } - } - ] - }, - { - "Input": "Bu alan 20 kilometre kare büyüklüğündedir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20 kilometre kare", - "Start": 8, - "End": 24, - "TypeName": "dimension", - "Resolution": { - "unit": "Square kilometer", - "subtype": "Area", - "value": "20" - } - } - ] - }, - { - "Input": "Bu bölge iki hektometre kare büyüklüğe sahip", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "iki hektometre kare", - "Start": 9, - "End": 27, - "TypeName": "dimension", - "Resolution": { - "unit": "Square hectometer", - "subtype": "Area", - "value": "2" - } - } - ] - }, - { - "Input": "Bu bölge bir dekametre kare", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "bir dekametre kare", - "Start": 9, - "End": 26, - "TypeName": "dimension", - "Resolution": { - "unit": "Square decameter", - "subtype": "Area", - "value": "1" - } - } - ] - }, - { - "Input": "o bir metre kare", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "bir metre kare", - "Start": 2, - "End": 15, - "TypeName": "dimension", - "Resolution": { - "unit": "Square meter", - "subtype": "Area", - "value": "1" - } - } - ] - }, - { - "Input": "Alanın büyüklüğü 100 desimetre kare", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 desimetre kare", - "Start": 17, - "End": 34, - "TypeName": "dimension", - "Resolution": { - "unit": "Square decimeter", - "subtype": "Area", - "value": "100" - } - } - ] - }, - { - "Input": "Burası sekiz santimetre kare", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "sekiz santimetre kare", - "Start": 7, - "End": 27, - "TypeName": "dimension", - "Resolution": { - "unit": "Square centimeter", - "subtype": "Area", - "value": "8" - } - } - ] - }, - { - "Input": "Burası beş milimetre kare", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "beş milimetre kare", - "Start": 7, - "End": 24, - "TypeName": "dimension", - "Resolution": { - "unit": "Square millimeter", - "subtype": "Area", - "value": "5" - } - } - ] - }, - { - "Input": "Burası beş akreden büyük", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "beş akreden", - "Start": 7, - "End": 17, - "TypeName": "dimension", - "Resolution": { - "unit": "Acre", - "subtype": "Area", - "value": "5" - } - } - ] - }, - { - "Input": "On mililitrelik şişe", - "NotSupportedByDesign": "javascript, python, java", - "Results": [ - { - "Text": "on mililitrelik", - "Start": 0, - "End": 14, - "TypeName": "dimension", - "Resolution": { - "unit": "Milliliter", - "subtype": "Volume", - "value": "10" - } - } - ] - } -] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Turkish/TemperatureModel.json b/Specs/NumberWithUnit/Turkish/TemperatureModel.json deleted file mode 100644 index 6150733162..0000000000 --- a/Specs/NumberWithUnit/Turkish/TemperatureModel.json +++ /dev/null @@ -1,656 +0,0 @@ -[ - { - "Input": "dışarıda hava 40 santigrat", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "40 santigrat", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 14, - "End": 25 - } - ] - }, - { - "Input": "Texas'ta hava 90 fahrenhayt", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "90 fahrenhayt", - "TypeName": "temperature", - "Resolution": { - "value": "90", - "unit": "F" - }, - "Start": 14, - "End": 26 - } - ] - }, - { - "Input": "-5 derece fahrenheit", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "-5 derece fahrenheit", - "TypeName": "temperature", - "Resolution": { - "value": "-5", - "unit": "F" - }, - "Start": 0, - "End": 19 - } - ] - }, - { - "Input": "6 derece", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "6 derece", - "TypeName": "temperature", - "Resolution": { - "value": "6", - "unit": "Degree" - }, - "Start": 0, - "End": 7 - } - ] - }, - { - "Input": "98,6 derece f normal bir ısıdır", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "98,6 derece f", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 0, - "End": 12 - } - ] - }, - { - "Input": "ısıyı 30 santigrat derece ayarla", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "30 santigrat derece", - "TypeName": "temperature", - "Resolution": { - "value": "30", - "unit": "C" - }, - "Start": 6, - "End": 24 - } - ] - }, - { - "Input": "normal ısı 98,6 derece fahrenhayttır", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "98,6 derece fahrenhayttır", - "TypeName": "temperature", - "Resolution": { - "value": "98,6", - "unit": "F" - }, - "Start": 11, - "End": 35 - } - ] - }, - { - "Input": "100 derece f", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 derece f", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "F" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "200 derece c", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 derece c", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 0, - "End": 11 - } - ] - }, - { - "Input": "100,2 fahrenhayt derece düşüktür", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100,2 fahrenhayt derece", - "TypeName": "temperature", - "Resolution": { - "value": "100,2", - "unit": "F" - }, - "Start": 0, - "End": 22 - } - ] - }, - { - "Input": "10,5 santigrat", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10,5 santigrat", - "TypeName": "temperature", - "Resolution": { - "value": "10,5", - "unit": "C" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "20 santigrat derece", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20 santigrat derece", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "C" - }, - "Start": 0, - "End": 18 - } - ] - }, - { - "Input": "20,3 santigrat", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20,3 santigrat", - "TypeName": "temperature", - "Resolution": { - "value": "20,3", - "unit": "C" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "34,5 santigrat", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "34,5 santigrat", - "TypeName": "temperature", - "Resolution": { - "value": "34,5", - "unit": "C" - }, - "Start": 0, - "End": 13 - } - ] - }, - { - "Input": "dışarıda hava 98 derece", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "98 derece", - "TypeName": "temperature", - "Resolution": { - "value": "98", - "unit": "Degree" - }, - "Start": 14, - "End": 22 - } - ] - }, - { - "Input": "termostatı 85°ye ayarla", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "85°", - "TypeName": "temperature", - "Resolution": { - "value": "85", - "unit": "Degree" - }, - "Start": 11, - "End": 13 - } - ] - }, - { - "Input": "ısıyı 5 derece arttır", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "5 derece", - "TypeName": "temperature", - "Resolution": { - "value": "5", - "unit": "Degree" - }, - "Start": 6, - "End": 13 - } - ] - }, - { - "Input": "ısıyı 70 derece f'ye ayarla", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "70 derece f", - "TypeName": "temperature", - "Resolution": { - "value": "70", - "unit": "F" - }, - "Start": 6, - "End": 16 - } - ] - }, - { - "Input": "ısıyı 20 dereceye kur", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20 dereceye", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "Degree" - }, - "Start": 6, - "End": 16 - } - ] - }, - { - "Input": "ısıyı 100 dereceye kur", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "100 dereceye", - "TypeName": "temperature", - "Resolution": { - "value": "100", - "unit": "Degree" - }, - "Start": 6, - "End": 17 - } - ] - }, - { - "Input": "ısıyı 75 derece f'de sabitle", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "75 derece f", - "TypeName": "temperature", - "Resolution": { - "value": "75", - "unit": "F" - }, - "Start": 6, - "End": 16 - } - ] - }, - { - "Input": "ısı 40 santigratta kalsın", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "40 santigratta", - "TypeName": "temperature", - "Resolution": { - "value": "40", - "unit": "C" - }, - "Start": 4, - "End": 17 - } - ] - }, - { - "Input": "ısı 50 derecede kalsın", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50 derecede", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "Degree" - }, - "Start": 4, - "End": 14 - } - ] - }, - { - "Input": "10 santigratı fahrenhayta çevir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "10 santigratı", - "TypeName": "temperature", - "Resolution": { - "value": "10", - "unit": "C" - }, - "Start": 0, - "End": 12 - }, - { - "Text": "fahrenhayta", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 14, - "End": 24 - } - ] - }, - { - "Input": "34,9 santigratı fahrenhayta", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "34,9 santigratı", - "TypeName": "temperature", - "Resolution": { - "value": "34,9", - "unit": "C" - }, - "Start": 0, - "End": 14 - }, - { - "Text": "fahrenhayta", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 16, - "End": 26 - } - ] - }, - { - "Input": "200 santigratı fahrenhayta çevir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "200 santigratı", - "TypeName": "temperature", - "Resolution": { - "value": "200", - "unit": "C" - }, - "Start": 0, - "End": 13 - }, - { - "Text": "fahrenhayta", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 15, - "End": 25 - } - ] - }, - { - "Input": "fahrenhayttan santigrata, 101 fahrenhayt kaç santigrat eder", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "101 fahrenhayt", - "TypeName": "temperature", - "Resolution": { - "value": "101", - "unit": "F" - }, - "Start": 26, - "End": 39 - }, - { - "Text": "fahrenhayttan", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 0, - "End": 12 - }, - { - "Text": "santigrata", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 14, - "End": 23 - }, - { - "Text": "santigrat", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 45, - "End": 53 - } - ] - }, - { - "Input": "50 santigrat dereceyi fahrenhayta", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "50 santigrat dereceyi", - "TypeName": "temperature", - "Resolution": { - "value": "50", - "unit": "C" - }, - "Start": 0, - "End": 20 - }, - { - "Text": "fahrenhayta", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "F" - }, - "Start": 22, - "End": 32 - } - ] - }, - { - "Input": "51 fahrenhaytı santigrata çevirebilir misin", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "51 fahrenhaytı", - "TypeName": "temperature", - "Resolution": { - "value": "51", - "unit": "F" - }, - "Start": 0, - "End": 13 - }, - { - "Text": "santigrata", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 15, - "End": 24 - } - ] - }, - { - "Input": "106 derece fahrenhaytı santigrata çevir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "106 derece fahrenhaytı", - "TypeName": "temperature", - "Resolution": { - "value": "106", - "unit": "F" - }, - "Start": 0, - "End": 21 - }, - { - "Text": "santigrata", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 23, - "End": 32 - } - ] - }, - { - "Input": "45 derece fahrenhaytı santigrata çevir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "45 derece fahrenhaytı", - "TypeName": "temperature", - "Resolution": { - "value": "45", - "unit": "F" - }, - "Start": 0, - "End": 20 - }, - { - "Text": "santigrata", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 22, - "End": 31 - } - ] - }, - { - "Input": "-20 derece fahrenhayt santigrata nasıl çevrilir", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "-20 derece fahrenhayt", - "TypeName": "temperature", - "Resolution": { - "value": "-20", - "unit": "F" - }, - "Start": 0, - "End": 20 - }, - { - "Text": "santigrata", - "TypeName": "temperature", - "Resolution": { - "value": null, - "unit": "C" - }, - "Start": 22, - "End": 31 - } - ] - }, - { - "Input": "Sıcaklık 20 fahrenhayttı", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "20 fahrenhayttı", - "TypeName": "temperature", - "Resolution": { - "value": "20", - "unit": "F" - }, - "Start": 9, - "End": 23 - } - ] - }, - { - "Input": "Sıcaklık 25 derecenin üzerindeydi.", - "NotSupportedByDesign": "javascript,python,java", - "Results": [ - { - "Text": "25 derecenin", - "TypeName": "temperature", - "Resolution": { - "value": "25", - "unit": "Degree" - }, - "Start": 9, - "End": 20 - } - ] - } -] \ No newline at end of file