From 73b82413f502f5c4adf0c1aad44b272f9538532b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=B6rje=20Karlsson?= Date: Thu, 3 Mar 2022 17:53:59 +0800 Subject: [PATCH 1/9] [ES Temperature] Support informal degrees and fix issue in ES auto-gen for Units (#2877) (#2879) - Support informal degrees in PT and ES (#2877); - Fix issue in generation of Spanish unit resources; - Re-generate all resources across platforms. --- .../Portuguese/NumbersWithUnitDefinitions.cs | 4 +- .../Spanish/NumbersWithUnitDefinitions.cs | 8 +- .../resources/PortugueseNumericWithUnit.java | 4 +- .../resources/SpanishNumericWithUnit.java | 6 +- .../resources/portugueseNumericWithUnit.ts | 2 +- .../src/resources/spanishNumericWithUnit.ts | 20 ++++- .../packages/resource-generator/index.ts | 4 +- .../Portuguese-NumbersWithUnit.yaml | 4 +- Patterns/Spanish/Spanish-NumbersWithUnit.yaml | 7 +- .../resources/portuguese_numeric_with_unit.py | 4 +- .../resources/spanish_numeric_with_unit.py | 8 +- .../Portuguese/TemperatureModel.json | 90 +++++++++++++++++++ .../Spanish/TemperatureModel.json | 75 ++++++++++++++++ 13 files changed, 212 insertions(+), 24 deletions(-) diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/Portuguese/NumbersWithUnitDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/Portuguese/NumbersWithUnitDefinitions.cs index 40ea2f5715..2d2d21daf3 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/Portuguese/NumbersWithUnitDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/Portuguese/NumbersWithUnitDefinitions.cs @@ -762,8 +762,8 @@ public static class NumbersWithUnitDefinitions { { @"Kelvin", @"k|K|kelvin" }, { @"Grau Rankine", @"r|°r|°ra|grau rankine|graus rankine| rankine" }, - { @"Grau Celsius", @"°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|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit" }, + { @"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" } }; public static readonly Dictionary VolumeSuffixList = new Dictionary diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/Spanish/NumbersWithUnitDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/Spanish/NumbersWithUnitDefinitions.cs index a9fb458732..652d94d505 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/Spanish/NumbersWithUnitDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/Spanish/NumbersWithUnitDefinitions.cs @@ -577,7 +577,8 @@ public static class NumbersWithUnitDefinitions { @"Qəpik", @"QƏPIK" }, { @"Fils", @"FILS" }, { @"Poisha", @"POISHA" }, - { @"Kopiyka", @"KOPIYKA" }, + { @"Kapyeyka", @"KAPYEYKA" }, + { @"Kopyeyka", @"KOPYEYKA" }, { @"Centime", @"CENTIME" }, { @"Chetrum", @"CHETRUM" }, { @"Paisa", @"PAISA" }, @@ -633,6 +634,7 @@ public static class NumbersWithUnitDefinitions { @"Seniti", @"SENITI" }, { @"Millime", @"MILLIME" }, { @"Tennesi", @"TENNESI" }, + { @"Kopiyka", @"KOPIYKA" }, { @"Tiyin", @"TIYIN" }, { @"Hào", @"HAO" }, { @"Ngwee", @"NGWEE" }, @@ -767,8 +769,8 @@ public static class NumbersWithUnitDefinitions { { @"Kelvin", @"k|K|kelvin" }, { @"Rankine", @"r|rankine" }, - { @"Grado Celsius", @"°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados" }, - { @"Grado Fahrenheit", @"°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit" }, + { @"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" } diff --git a/Java/libraries/recognizers-text-number-with-unit/src/main/java/com/microsoft/recognizers/text/numberwithunit/resources/PortugueseNumericWithUnit.java b/Java/libraries/recognizers-text-number-with-unit/src/main/java/com/microsoft/recognizers/text/numberwithunit/resources/PortugueseNumericWithUnit.java index 65248f4bb5..636d905498 100644 --- a/Java/libraries/recognizers-text-number-with-unit/src/main/java/com/microsoft/recognizers/text/numberwithunit/resources/PortugueseNumericWithUnit.java +++ b/Java/libraries/recognizers-text-number-with-unit/src/main/java/com/microsoft/recognizers/text/numberwithunit/resources/PortugueseNumericWithUnit.java @@ -730,8 +730,8 @@ public class PortugueseNumericWithUnit { public static final ImmutableMap TemperatureSuffixList = ImmutableMap.builder() .put("Kelvin", "k|K|kelvin") .put("Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine") - .put("Grau Celsius", "°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") - .put("Grau Fahrenheit", "°f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit") + .put("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") + .put("Grau Fahrenheit", "°f|° f|ºf|º f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit") .put("Grau", "°|graus|grau") .build(); diff --git a/Java/libraries/recognizers-text-number-with-unit/src/main/java/com/microsoft/recognizers/text/numberwithunit/resources/SpanishNumericWithUnit.java b/Java/libraries/recognizers-text-number-with-unit/src/main/java/com/microsoft/recognizers/text/numberwithunit/resources/SpanishNumericWithUnit.java index eae825d1ff..5fd97ab7a6 100644 --- a/Java/libraries/recognizers-text-number-with-unit/src/main/java/com/microsoft/recognizers/text/numberwithunit/resources/SpanishNumericWithUnit.java +++ b/Java/libraries/recognizers-text-number-with-unit/src/main/java/com/microsoft/recognizers/text/numberwithunit/resources/SpanishNumericWithUnit.java @@ -560,6 +560,8 @@ public class SpanishNumericWithUnit { .put("Qəpik", "QƏPIK") .put("Fils", "FILS") .put("Poisha", "POISHA") + .put("Kapyeyka", "KAPYEYKA") + .put("Kopyeyka", "KOPYEYKA") .put("Centime", "CENTIME") .put("Chetrum", "CHETRUM") .put("Paisa", "PAISA") @@ -734,8 +736,8 @@ public class SpanishNumericWithUnit { public static final ImmutableMap TemperatureSuffixList = ImmutableMap.builder() .put("Kelvin", "k|K|kelvin") .put("Rankine", "r|rankine") - .put("Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados") - .put("Grado Fahrenheit", "°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit") + .put("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") + .put("Grado Fahrenheit", "°f|° f|ºf|º f|grado f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit") .put("Grado Réaumur", "°r|°re|grados r|grado réaumur|grados réaumur|réaumur") .put("Grado Delisle", "°d|grados d|grado delisle|grados delisle|delisle") .put("Grado", "°|grados|grado") diff --git a/JavaScript/packages/recognizers-number-with-unit/src/resources/portugueseNumericWithUnit.ts b/JavaScript/packages/recognizers-number-with-unit/src/resources/portugueseNumericWithUnit.ts index 40998b4a49..d50742a7ca 100644 --- a/JavaScript/packages/recognizers-number-with-unit/src/resources/portugueseNumericWithUnit.ts +++ b/JavaScript/packages/recognizers-number-with-unit/src/resources/portugueseNumericWithUnit.ts @@ -29,7 +29,7 @@ export namespace PortugueseNumericWithUnit { export const AmbiguousLengthUnitList = [ "mi","milha","milhas","\"" ]; export const SpeedSuffixList: ReadonlyMap = new Map([["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"],["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"]]); export const AmbiguousSpeedUnitList = [ "nó","no","nós","nos" ]; - export const TemperatureSuffixList: ReadonlyMap = new Map([["Kelvin", "k|K|kelvin"],["Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine"],["Grau Celsius", "°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|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"],["Grau", "°|graus|grau"]]); + export const TemperatureSuffixList: ReadonlyMap = new Map([["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"]]); export const VolumeSuffixList: ReadonlyMap = new Map([["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"]]); export const WeightSuffixList: ReadonlyMap = new Map([["Tonelada métrica", "tonelada métrica|tonelada metrica|toneladas métricas|toneladas metricas"],["Tonelada", "ton|tonelada|toneladas"],["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"]]); export const AngleSuffixList: ReadonlyMap = new Map([["Degree", "grau|graus|°"],["Radian", "radiano|radianos|rad"],["Turn", "volta|voltas"]]); diff --git a/JavaScript/packages/recognizers-number-with-unit/src/resources/spanishNumericWithUnit.ts b/JavaScript/packages/recognizers-number-with-unit/src/resources/spanishNumericWithUnit.ts index 794d563f1d..bba07b3227 100644 --- a/JavaScript/packages/recognizers-number-with-unit/src/resources/spanishNumericWithUnit.ts +++ b/JavaScript/packages/recognizers-number-with-unit/src/resources/spanishNumericWithUnit.ts @@ -1,5 +1,13 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// ------------------------------------------------------------------------------ import { BaseNumbers } from "./baseNumbers"; export namespace SpanishNumericWithUnit { @@ -7,8 +15,10 @@ export namespace SpanishNumericWithUnit { export const AmbiguousAgeUnitList = [ "años","año","meses","mes","semanas","semana","dias","días","día","dia" ]; export const AreaSuffixList: ReadonlyMap = new Map([["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"]]); export const AreaAmbiguousValues = [ "área","áreas" ]; - export const CurrencySuffixList: ReadonlyMap = new Map([["Dólar", "dólar|dólares"],["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"],["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"]]); - export const CompoundUnitConnectorRegex = `(?[^.])`; + export const CurrencySuffixList: ReadonlyMap = new Map([["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"],["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"]]); + export const CurrencyNameToIsoCodeMap: ReadonlyMap = new Map([["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"]]); + export const FractionalUnitNameToCodeMap: ReadonlyMap = new Map([["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"]]); + export const CompoundUnitConnectorRegex = `(?y|con)`; export const CurrencyPrefixList: ReadonlyMap = new Map([["Dobra", "db|std"],["Dólar", "$"],["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"],["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"]]); export const AmbiguousCurrencyUnitList = [ "le","db","std" ]; export const InformationSuffixList: ReadonlyMap = new Map([["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"]]); @@ -20,8 +30,12 @@ export namespace SpanishNumericWithUnit { export const ConnectorToken = `de`; export const SpeedSuffixList: ReadonlyMap = new Map([["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"]]); export const AmbiguousSpeedUnitList = [ "nudo","nudos" ]; - export const TemperatureSuffixList: ReadonlyMap = new Map([["Kelvin", "k|K|kelvin"],["Rankine", "r|rankine"],["Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"],["Grado Fahrenheit", "°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"]]); + export const TemperatureSuffixList: ReadonlyMap = new Map([["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"]]); export const VolumeSuffixList: ReadonlyMap = new Map([["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"]]); export const WeightSuffixList: ReadonlyMap = new Map([["Tonelada métrica", "tonelada métrica|toneladas métricas"],["Tonelada", "ton|tonelada|toneladas"],["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"]]); + export const AngleSuffixList: ReadonlyMap = new Map([["Degree", "grado|grados|°"],["Radian", "radián|radian|radianes|rad"],["Turn", "vuelta|vueltas"]]); + export const AmbiguousAngleUnitList = [ "vuelta","vueltas" ]; export const AmbiguityFiltersDict: ReadonlyMap = new Map([["null", "null"]]); + export const TemperatureAmbiguityFiltersDict: ReadonlyMap = new Map([["\\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|°))"]]); + export const DimensionAmbiguityFiltersDict: ReadonlyMap = new Map([["\\b(grados?|°)$", "\\b((grados?|°)\\s*(c(elsius|entígrado)?|f(ah?renheit)?)|(temperatura)(\\s+(\\p{L}+|\\d+)){0,4}\\s*(grados?\\b|°))"]]); } diff --git a/JavaScript/packages/resource-generator/index.ts b/JavaScript/packages/resource-generator/index.ts index 09604136e2..e12fc04342 100644 --- a/JavaScript/packages/resource-generator/index.ts +++ b/JavaScript/packages/resource-generator/index.ts @@ -31,7 +31,9 @@ class Startup { generator.generate(inputFilePath, outputFilePath, config.header.join('\n'), config.footer.join('\n')); } catch (err) { - console.log(`Error while creating the resource ${basename(outputFilePath)}`, err.toString()); + let msg = `Error while creating the resource ${basename(outputFilePath)} ${err.toString()}`; + console.log(msg); + throw err; } }); diff --git a/Patterns/Portuguese/Portuguese-NumbersWithUnit.yaml b/Patterns/Portuguese/Portuguese-NumbersWithUnit.yaml index bc77bc1d22..8d42f58396 100644 --- a/Patterns/Portuguese/Portuguese-NumbersWithUnit.yaml +++ b/Patterns/Portuguese/Portuguese-NumbersWithUnit.yaml @@ -929,8 +929,8 @@ TemperatureSuffixList: !dictionary entries: Kelvin: k|K|kelvin Grau Rankine: r|°r|°ra|grau rankine|graus rankine| rankine - Grau Celsius: °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|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit + 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 #VolumeExtractorConfiguration VolumeSuffixList: !dictionary diff --git a/Patterns/Spanish/Spanish-NumbersWithUnit.yaml b/Patterns/Spanish/Spanish-NumbersWithUnit.yaml index 94faa361c1..6a90f0a92e 100644 --- a/Patterns/Spanish/Spanish-NumbersWithUnit.yaml +++ b/Patterns/Spanish/Spanish-NumbersWithUnit.yaml @@ -802,7 +802,8 @@ FractionalUnitNameToCodeMap: !dictionary Qəpik: QƏPIK Fils: FILS Poisha: POISHA - Kopiyka: KAPYEYKA + Kapyeyka: KAPYEYKA + Kopyeyka: KOPYEYKA Centime: CENTIME Chetrum: CHETRUM Paisa: PAISA @@ -1004,8 +1005,8 @@ TemperatureSuffixList: !dictionary entries: Kelvin: k|K|kelvin Rankine: r|rankine - Grado Celsius: °c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados - Grado Fahrenheit: °f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit + 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 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 f05ae2e416..06f9dd0faf 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 @@ -688,8 +688,8 @@ class PortugueseNumericWithUnit: 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|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|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"), + ("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³"), 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 2a6da33839..7f824e54f6 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 @@ -540,7 +540,8 @@ class SpanishNumericWithUnit: ("Qəpik", "QƏPIK"), ("Fils", "FILS"), ("Poisha", "POISHA"), - ("Kopiyka", "KOPIYKA"), + ("Kapyeyka", "KAPYEYKA"), + ("Kopyeyka", "KOPYEYKA"), ("Centime", "CENTIME"), ("Chetrum", "CHETRUM"), ("Paisa", "PAISA"), @@ -596,6 +597,7 @@ class SpanishNumericWithUnit: ("Seniti", "SENITI"), ("Millime", "MILLIME"), ("Tennesi", "TENNESI"), + ("Kopiyka", "KOPIYKA"), ("Tiyin", "TIYIN"), ("Hào", "HAO"), ("Ngwee", "NGWEE"), @@ -691,8 +693,8 @@ class SpanishNumericWithUnit: AmbiguousSpeedUnitList = [r'nudo', r'nudos'] TemperatureSuffixList = dict([("Kelvin", "k|K|kelvin"), ("Rankine", "r|rankine"), - ("Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"), - ("Grado Fahrenheit", "°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit"), + ("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")]) diff --git a/Specs/NumberWithUnit/Portuguese/TemperatureModel.json b/Specs/NumberWithUnit/Portuguese/TemperatureModel.json index 4ad6063cb7..c57989aa60 100644 --- a/Specs/NumberWithUnit/Portuguese/TemperatureModel.json +++ b/Specs/NumberWithUnit/Portuguese/TemperatureModel.json @@ -718,5 +718,95 @@ "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" + } + } + ] } ] \ No newline at end of file diff --git a/Specs/NumberWithUnit/Spanish/TemperatureModel.json b/Specs/NumberWithUnit/Spanish/TemperatureModel.json index adbef6398a..b0e0a01084 100644 --- a/Specs/NumberWithUnit/Spanish/TemperatureModel.json +++ b/Specs/NumberWithUnit/Spanish/TemperatureModel.json @@ -728,5 +728,80 @@ "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 From 365d66fd9bfc23c2bd14a253492997372c148854 Mon Sep 17 00:00:00 2001 From: colm-dillon <72518145+colm-dillon@users.noreply.github.com> Date: Thu, 3 Mar 2022 11:35:43 +0000 Subject: [PATCH 2/9] [Python] Enabling SpanishMexican culture in Number/Unit/DateTimveV2 (#2878) * Enabling SpanishMexican culture in Number/Unit/DateTimveV2 * Update Spanish number specs according to review Co-authored-by: Colm Dillon --- .../date_time/date_time_recognizer.py | 6 ++ .../number_with_unit_recognizer.py | 23 +++++ .../recognizers_number/culture.py | 1 + .../number/chinese/parsers.py | 10 ++ .../number/english/parsers.py | 9 ++ .../number/french/parsers.py | 10 ++ .../number/german/parsers.py | 10 ++ .../number/japanese/parsers.py | 10 ++ .../number/number_recognizer.py | 19 ++++ .../recognizers_number/number/parsers.py | 93 +++++++++++++++---- .../number/portuguese/parsers.py | 10 ++ .../number/spanish/parsers.py | 10 ++ .../recognizers_text/culture.py | 1 + Python/tests/runner.py | 1 + Specs/Number/Spanish/NumberModel.json | 6 +- Specs/Number/SpanishMexican/NumberModel.json | 6 +- 16 files changed, 203 insertions(+), 22 deletions(-) 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 b721035fb4..3b961f4253 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 @@ -47,6 +47,12 @@ def initialize_configuration(self): 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), 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 172422317b..a76a7cc0e7 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 @@ -5,6 +5,7 @@ from typing import List 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 @@ -192,6 +193,28 @@ def initialize_configuration(self): )) # 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))))] + )) + # 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) diff --git a/Python/libraries/recognizers-number/recognizers_number/culture.py b/Python/libraries/recognizers-number/recognizers_number/culture.py index ebe62e84a2..840ff06d87 100644 --- a/Python/libraries/recognizers-number/recognizers_number/culture.py +++ b/Python/libraries/recognizers-number/recognizers_number/culture.py @@ -7,6 +7,7 @@ SUPPORTED_CULTURES = { Culture.English: LongFormatMode.DOUBLE_COMMA_DOT, Culture.Chinese: None, + Culture.SpanishMexican: LongFormatMode.DOUBLE_COMMA_DOT, Culture.Spanish: LongFormatMode.DOUBLE_DOT_COMMA, Culture.German: LongFormatMode.DOUBLE_DOT_COMMA, Culture.Portuguese: LongFormatMode.DOUBLE_DOT_COMMA, 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 f0c97d083b..857cc4df86 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/chinese/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/chinese/parsers.py @@ -162,6 +162,14 @@ def pair_regex(self) -> Pattern: 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 + def __init__(self, culture_info=None): if culture_info is None: culture_info = CultureInfo(Culture.Chinese) @@ -175,6 +183,8 @@ def __init__(self, culture_info=None): 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( 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 3ca389df07..60960e0b6a 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/english/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/english/parsers.py @@ -80,6 +80,13 @@ def written_integer_separator_texts(self) -> List[str]: 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 + + def is_multi_decimal_separator_culture(self) -> bool: + return self._is_multi_decimal_separator_culture + def __init__(self, culture_info=None): if culture_info is None: culture_info = CultureInfo(Culture.English) @@ -96,6 +103,8 @@ def __init__(self, culture_info=None): 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 self._cardinal_number_map = EnglishNumeric.CardinalNumberMap self._ordinal_number_map = EnglishNumeric.OrdinalNumberMap 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 c12efa3505..76409d2aa0 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/french/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/french/parsers.py @@ -81,6 +81,14 @@ def written_integer_separator_texts(self) -> List[str]: 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 + def __init__(self, culture_info=None): if culture_info is None: culture_info = CultureInfo(Culture.French) @@ -92,6 +100,8 @@ def __init__(self, culture_info=None): 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 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 5d8d244b4d..6f59d0deb6 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/german/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/german/parsers.py @@ -80,6 +80,14 @@ def written_integer_separator_texts(self) -> List[str]: 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 + def __init__(self, culture_info=None): if culture_info is None: culture_info = CultureInfo(Culture.German) @@ -91,6 +99,8 @@ def __init__(self, culture_info=None): 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 self._written_decimal_separator_texts = GermanNumeric.WrittenDecimalSeparatorTexts self._written_group_separator_texts = GermanNumeric.WrittenGroupSeparatorTexts 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 ce3eee0a2d..7cbe44346a 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/japanese/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/japanese/parsers.py @@ -158,6 +158,14 @@ def pair_regex(self) -> Pattern: 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 + def __init__(self, culture_info=None): if culture_info is None: culture_info = CultureInfo(Culture.Japanese) @@ -172,6 +180,8 @@ def __init__(self, culture_info=None): 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( 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 6d3cf1b658..9cbeedd0b7 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/number_recognizer.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/number_recognizer.py @@ -4,6 +4,7 @@ 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 @@ -123,6 +124,24 @@ def initialize_configuration(self): )) # 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() + )) + # endregion + # region Portuguese self.register_model('NumberModel', Culture.Portuguese, lambda options: NumberModel( AgnosticNumberParserFactory.get_parser( diff --git a/Python/libraries/recognizers-number/recognizers_number/number/parsers.py b/Python/libraries/recognizers-number/recognizers_number/number/parsers.py index f7431de137..05664bf69a 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/parsers.py @@ -1,6 +1,6 @@ # 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 @@ -8,6 +8,7 @@ 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 @@ -109,6 +110,16 @@ def normalize_token_set(self, tokens: List[str], context: ParseResult) -> List[s def resolve_composite_number(self, number_str: str) -> int: pass + @property + @abstractmethod + def non_standard_separator_variants(self) -> List[str]: + pass + + @property + @abstractmethod + def is_multi_decimal_separator_culture(self) -> bool: + pass + class BaseNumberParser(Parser): def __init__(self, config: NumberParserConfiguration): @@ -122,6 +133,8 @@ def __init__(self, config: NumberParserConfiguration): 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 @@ -175,6 +188,7 @@ def _digit_number_parse(self, ext_result: ExtractResult) -> ParseResult: result.length = ext_result.length result.text = ext_result.text result.type = ext_result.type + result.meta_data = MetaData() if not result.meta_data else result.meta_data # [1] 24 # [2] 12 32/33 @@ -363,7 +377,7 @@ def _power_number_parse(self, ext_result: ExtractResult) -> ParseResult: # [2] 1.1^-23 call_stack = list() scale = 10 - dot = False + decimal_separator_found = False negative = False tmp = 0 @@ -376,16 +390,16 @@ def _power_number_parse(self, ext_result: ExtractResult) -> ParseResult: call_stack.append(tmp) tmp = 0 scale = 10 - dot = False + decimal_separator_found = False negative = False elif c.isdigit(): - if dot: + if decimal_separator_found: tmp = tmp + scale * int(c) scale *= 0.1 else: tmp = tmp * scale + int(c) elif c == self.config.decimal_separator_char: - dot = True + decimal_separator_found = True scale = 0.1 elif c == '-': negative = not negative @@ -525,34 +539,81 @@ def __get_point_value(self, matches: List[str]) -> Decimal: return result - def __skip_non_decimal_separator(self, ch: str, distance: int, culture: CultureInfo) -> bool: + def __skip_non_decimal_separator(self, ch: str, distance_end, distance_start, + has_single_separator, prev_char, non_decimal_separator) -> bool: - decimal_length: int = 3 + result = False + decimal_length: int = 1 + 3 # Special cases for multi-language countries where decimal separators can be used interchangeably. Mostly informally. # Ex: South Africa, Namibia; Puerto Rico in ES; or in Canada for EN and FR. # "me pidio $5.00 prestados" and "me pidio $5,00 prestados" -> currency $5 - culture_regex: Pattern = RegExpUtility.get_safe_reg_exp( - r'^(en|es|fr)(-)?\b', flags=regex.I | regex.S) - return ch == self.config.non_decimal_separator_char and not(distance <= decimal_length and culture_regex.match(culture.code)) + if ch == non_decimal_separator: + result = True + + if self.config.is_multi_decimal_separator_culture and has_single_separator: + + if distance_end != decimal_length or (prev_char == '0' and distance_start == 1) or distance_start > 3: + result = False + + return result @precision(prec=15) def _get_digital_value(self, digits_str: str, power: int) -> Decimal: tmp: Decimal = Decimal(0) scale: Decimal = Decimal(10) - decimal_separator: bool = False + has_decimal_separator: bool = False str_length: int = len(digits_str) negative: bool = False fraction: bool = '/' in digits_str index: int = 0 + # As some languages use different separators depending on variant, some pre-processing is required to + # allow for unified processing. + + # Default separators from general language config + last_decimal_separator = -1 + last_non_decimal_separator = -1 + first_non_decimal_separator = sys.maxsize + decimal_separator = self.config.decimal_separator_char + non_decimal_separator = self.config.non_decimal_separator_char + has_single_separator = False + + if self.config.is_multi_decimal_separator_culture: + if self.is_non_standard_separator_variant: + decimal_separator = self.config.non_decimal_separator_char + non_decimal_separator = self.config.decimal_separator_char + + for i, c in enumerate(digits_str): + if c == decimal_separator: + last_decimal_separator = i + elif c == non_decimal_separator: + last_non_decimal_separator = i + 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): + + has_single_separator = True + + 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 + non_decimal_separator = temp_sep + call_stack: List[Decimal] = list() - for c in digits_str: + for i, c in enumerate(digits_str): + + prev_char = digits_str[i - 1] if i > 0 else '\0' skippable_non_decimal = self.__skip_non_decimal_separator( - c, str_length - index, self.config.culture_info) + 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): @@ -562,13 +623,13 @@ def _get_digital_value(self, digits_str: str, power: int) -> Decimal: call_stack.append(tmp) tmp = Decimal(0) elif c.isdigit(): - if decimal_separator: + if has_decimal_separator: tmp = getcontext().add(tmp, getcontext().multiply(scale, Decimal(c))) scale = getcontext().multiply(scale, Decimal(0.1)) else: tmp = getcontext().add(getcontext().multiply(tmp, scale), Decimal(c)) - elif c == self.config.decimal_separator_char or (not skippable_non_decimal and c == self.config.non_decimal_separator_char): - decimal_separator = True + elif c == decimal_separator or (not skippable_non_decimal and c == non_decimal_separator): + has_decimal_separator = True scale = Decimal(0.1) elif c == '-': negative = True 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 ce333a458b..ae705a30ad 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/portuguese/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/portuguese/parsers.py @@ -81,6 +81,14 @@ def written_integer_separator_texts(self) -> List[str]: 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 + def __init__(self, culture_info=None): if culture_info is None: culture_info = CultureInfo(Culture.Portuguese) @@ -92,6 +100,8 @@ def __init__(self, culture_info=None): 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 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 e21152db97..cae1de1b91 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/spanish/parsers.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/spanish/parsers.py @@ -81,6 +81,14 @@ def written_integer_separator_texts(self) -> List[str]: 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 + def __init__(self, culture_info=None): if culture_info is None: culture_info = CultureInfo(Culture.Spanish) @@ -97,6 +105,8 @@ def __init__(self, culture_info=None): 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) diff --git a/Python/libraries/recognizers-text/recognizers_text/culture.py b/Python/libraries/recognizers-text/recognizers_text/culture.py index 1b01fb2405..07f5ad1841 100644 --- a/Python/libraries/recognizers-text/recognizers_text/culture.py +++ b/Python/libraries/recognizers-text/recognizers_text/culture.py @@ -11,6 +11,7 @@ class Culture: Korean: str = 'ko-kr' Portuguese: str = 'pt-br' Spanish: str = 'es-es' + SpanishMexican: str = 'es-mx' Turkish: str = 'tr-tr' German: str = 'de-de' diff --git a/Python/tests/runner.py b/Python/tests/runner.py index 6e7b85c0f4..d4b062a1ed 100644 --- a/Python/tests/runner.py +++ b/Python/tests/runner.py @@ -81,6 +81,7 @@ def get_specs(recognizer, entity): 'Korean': Culture.Korean, 'Portuguese': Culture.Portuguese, 'Spanish': Culture.Spanish, + 'SpanishMexican': Culture.SpanishMexican, 'Turkish': Culture.Turkish, # 'German': Culture.German, } diff --git a/Specs/Number/Spanish/NumberModel.json b/Specs/Number/Spanish/NumberModel.json index 91c74a5e72..32f14410c3 100644 --- a/Specs/Number/Spanish/NumberModel.json +++ b/Specs/Number/Spanish/NumberModel.json @@ -2845,7 +2845,7 @@ }, { "Input": "0.0638, 0,0638, 1.000, 1,000, 0,683, 0.683, 1.111,11, 1111,13, 1111.13, 1111.121, 1111,121", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "0.0638", @@ -2961,7 +2961,7 @@ }, { "Input": "Tiquetes de avión baratos Madrid - Cozumel desde $ 1.234 (1234,00)", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "1.234", @@ -2987,7 +2987,7 @@ }, { "Input": "1.111,11, 1,111.11", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "1.111,11", diff --git a/Specs/Number/SpanishMexican/NumberModel.json b/Specs/Number/SpanishMexican/NumberModel.json index 20a5d040ee..7859aff01f 100644 --- a/Specs/Number/SpanishMexican/NumberModel.json +++ b/Specs/Number/SpanishMexican/NumberModel.json @@ -1,7 +1,7 @@ [ { "Input": "Tiquetes de avión baratos Madrid - Cozumel desde $ 1,234 (1234.00)", - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "1,234", @@ -27,7 +27,7 @@ }, { "Input": "0.0638, 0,0638, 1.000, 1,000, 0,683, 0.683, 1.111,11, 1111,13, 1111.13, 1111.121, 1111,121", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "0.0638", @@ -143,7 +143,7 @@ }, { "Input": "1.111,11, 1,111.11", - "NotSupported": "javascript, java, python", + "NotSupported": "javascript, java", "Results": [ { "Text": "1.111,11", From ff11e079a9d5ffe3fe09eb37fa74e387394c5dfa Mon Sep 17 00:00:00 2001 From: samhickey25 <66773253+samhickey25@users.noreply.github.com> Date: Thu, 3 Mar 2022 11:36:59 +0000 Subject: [PATCH 3/9] [Python] Add Portuguese support for DateTimeV2 (#2876) * Add Portuguese DateTime support in Python * Update Specs with Python changes * Fix Number import issue * Update specs according to build and review * Remove empty NotSupported fields from specs --- .../date_time/__init__.py | 1 + .../date_time/date_time_recognizer.py | 8 +- .../date_time/portuguese/__init__.py | 0 .../date_time/portuguese/base_configs.py | 90 +++++ .../date_time/portuguese/common_configs.py | 208 +++++++++++ .../portuguese/date_extractor_config.py | 237 ++++++++++++ .../portuguese/date_parser_config.py | 228 ++++++++++++ .../portuguese/dateperiod_extractor_config.py | 286 +++++++++++++++ .../portuguese/dateperiod_parser_config.py | 345 ++++++++++++++++++ .../portuguese/datetime_extractor_config.py | 163 +++++++++ .../portuguese/datetime_parser_config.py | 186 ++++++++++ .../datetimeperiod_extractor_config.py | 277 ++++++++++++++ .../datetimeperiod_parser_config.py | 218 +++++++++++ .../portuguese/duration_extractor_config.py | 142 +++++++ .../portuguese/duration_parser_config.py | 96 +++++ .../portuguese/holiday_extractor_config.py | 22 ++ .../portuguese/holiday_parser_config.py | 204 +++++++++++ .../portuguese/merged_extractor_config.py | 208 +++++++++++ .../portuguese/merged_parser_config.py | 114 ++++++ .../date_time/portuguese/parsers.py | 94 +++++ .../portuguese/set_extractor_config.py | 123 +++++++ .../date_time/portuguese/set_parser_config.py | 160 ++++++++ .../portuguese/time_extractor_config.py | 124 +++++++ .../portuguese/time_parser_config.py | 119 ++++++ .../portuguese/timeperiod_extractor_config.py | 126 +++++++ .../portuguese/timeperiod_parser_config.py | 129 +++++++ .../portuguese/timezone_extractor_config.py | 28 ++ .../recognizers_number/number/__init__.py | 1 + Specs/DateTime/Portuguese/DateExtractor.json | 120 +++--- Specs/DateTime/Portuguese/DateParser.json | 123 +++---- .../Portuguese/DatePeriodExtractor.json | 82 ++--- .../DateTime/Portuguese/DatePeriodParser.json | 72 ++-- .../Portuguese/DateTimeExtractor.json | 122 +++---- Specs/DateTime/Portuguese/DateTimeModel.json | 148 ++++---- Specs/DateTime/Portuguese/DateTimeParser.json | 110 +++--- .../Portuguese/DateTimePeriodExtractor.json | 60 +-- .../Portuguese/DateTimePeriodParser.json | 28 +- .../Portuguese/DurationExtractor.json | 42 +-- Specs/DateTime/Portuguese/DurationParser.json | 42 +-- .../DateTime/Portuguese/HolidayExtractor.json | 16 +- Specs/DateTime/Portuguese/HolidayParser.json | 20 +- .../DateTime/Portuguese/MergedExtractor.json | 20 +- Specs/DateTime/Portuguese/SetExtractor.json | 38 +- Specs/DateTime/Portuguese/SetParser.json | 34 +- Specs/DateTime/Portuguese/TimeExtractor.json | 116 +++--- Specs/DateTime/Portuguese/TimeParser.json | 86 +++-- .../Portuguese/TimePeriodExtractor.json | 60 +-- .../DateTime/Portuguese/TimePeriodParser.json | 36 +- 48 files changed, 4617 insertions(+), 695 deletions(-) create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/__init__.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/base_configs.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/common_configs.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/parsers.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_extractor_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_parser_config.py create mode 100644 Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timezone_extractor_config.py 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 3abd6819ac..cf208f8751 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 @@ -23,3 +23,4 @@ from .spanish import * from .chinese import * from .french import * +from .portuguese import * 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 3b961f4253..1ff248f242 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 @@ -19,6 +19,9 @@ 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 class DateTimeRecognizer(Recognizer[DateTimeOptions]): @@ -60,8 +63,9 @@ def initialize_configuration(self): )) self.register_model('DateTimeModel', Culture.Portuguese, lambda options: DateTimeModel( - None, - None + BaseMergedParser(PortugueseMergedParserConfiguration( + PortugueseCommonDateTimeParserConfiguration()), options), + BaseMergedExtractor(PortugueseMergedExtractorConfiguration(), options) )) def get_datetime_model(self, culture: str = None, fallback_to_default_culture: bool = True) -> Model: diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/__init__.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/__init__.py new file mode 100644 index 0000000000..e69de29bb2 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 new file mode 100644 index 0000000000..f3b6f877cd --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/base_configs.py @@ -0,0 +1,90 @@ +# 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.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 + ) 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 new file mode 100644 index 0000000000..417143930c --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/common_configs.py @@ -0,0 +1,208 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Dict, Pattern + +from recognizers_number import BaseNumberExtractor, BaseNumberParser +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 ..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_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 + + +class PortugueseCommonDateTimeParserConfiguration(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 time_zone_parser(self) -> BaseTimeZoneParser: + return self._time_zone_parser + + @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 day_of_month(self) -> Dict[str, int]: + return self._day_of_month + + @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): + BaseDateParserConfiguration.__init__(self) + + self._utility_configuration = PortugueseDateTimeUtilityConfiguration() + self._unit_map = PortugueseDateTime.UnitMap + self._unit_value_map = PortugueseDateTime.UnitValueMap + self._season_map = PortugueseDateTime.SeasonMap + self._cardinal_map = PortugueseDateTime.CardinalMap + self._day_of_week = PortugueseDateTime.DayOfWeek + self._month_of_year = PortugueseDateTime.MonthOfYear + self._numbers = PortugueseDateTime.Numbers + self._double_numbers = PortugueseDateTime.DoubleNumbers + self._cardinal_extractor = PortugueseCardinalExtractor() + 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)) 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 new file mode 100644 index 0000000000..af0173766e --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_extractor_config.py @@ -0,0 +1,237 @@ +# 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 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 ..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 + + +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 + + @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 + date_extractor_6 = PortugueseDateTime.DateExtractor8 + date_extractor_8 = PortugueseDateTime.DateExtractor6 + date_extractor_7 = PortugueseDateTime.DateExtractor9 + date_extractor_9 = PortugueseDateTime.DateExtractor7 + else: + date_extractor_4 = PortugueseDateTime.DateExtractor4 + date_extractor_5 = PortugueseDateTime.DateExtractor5 + date_extractor_6 = PortugueseDateTime.DateExtractor6 + date_extractor_8 = PortugueseDateTime.DateExtractor8 + date_extractor_7 = PortugueseDateTime.DateExtractor7 + date_extractor_9 = PortugueseDateTime.DateExtractor9 + + self._date_regex_list = [ + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateExtractor1), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DateExtractor2), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.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(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 new file mode 100644 index 0000000000..4096e1983b --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/date_parser_config.py @@ -0,0 +1,228 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Pattern, List, Dict +import regex + +from recognizers_text.utilities import RegExpUtility +from recognizers_number import BaseNumberExtractor, BaseNumberParser +from ...resources.portuguese_date_time import PortugueseDateTime +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 + + +class PortugueseDateParserConfiguration(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 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 relative_month_regex(self) -> Pattern: + return self._relative_month_regex + + @property + def utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + @property + def date_token_prefix(self) -> str: + return self._date_token_prefix + + # 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) + + 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 = ( + 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._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._relative_month_regex = RegExpUtility.get_safe_reg_exp( + PortugueseDateTime.RelativeMonthRegex) + self._utility_configuration = config.utility_configuration + self._date_token_prefix = PortugueseDateTime.DateTokenPrefix + self._check_both_before_after = PortugueseDateTime.CheckBothBeforeAfter + + def get_swift_day(self, source: str) -> int: + trimmed_text = self.__normalize(source.strip().lower()) + swift = 0 + + # 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'): + swift = 1 + elif trimmed_text == 'ontem': + swift = -1 + elif trimmed_text.endswith('dia depois de amanha') or trimmed_text.endswith('depois de amanha'): + swift = 2 + elif trimmed_text.endswith('anteontem') or trimmed_text.endswith('dia antes de ontem'): + swift = -2 + elif trimmed_text.endswith('ultimo dia'): + swift = -1 + + 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( + 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: + swift = -1 + + return swift + + def is_cardinal_last(self, source: str) -> bool: + trimmed_text = source.strip().lower() + 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') 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 new file mode 100644 index 0000000000..80357c063f --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_extractor_config.py @@ -0,0 +1,286 @@ +# 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.portuguese.extractors import PortugueseIntegerExtractor +from recognizers_number.number.portuguese.parsers import PortugueseNumberParserConfiguration +from ...resources.base_date_time import BaseDateTime +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 .date_extractor_config import PortugueseDateExtractorConfiguration +from .common_configs import PortugueseOrdinalExtractor, PortugueseCardinalExtractor + + +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 = [ + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.SimpleCasesRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.BetweenRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.OneWordPeriodRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthWithYearRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.MonthNumWithYearRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.YearRegex), + 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.QuarterRegex), + 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.YearPlusNumberRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.DecadeWithCenturyRegex), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.RelativeDecadeRegex), + 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) + + def get_between_token_index(self, source: str) -> MatchedIndex: + return MatchedIndex(True, source.rfind('between')) if source.endswith('between') else MatchedIndex(False, -1) + + def has_connector_token(self, source: str) -> bool: + match = self.range_connector_regex.search(source) + return len(match.group()) == len(source) if match else None 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 new file mode 100644 index 0000000000..bde6041fb2 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/dateperiod_parser_config.py @@ -0,0 +1,345 @@ +# 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_configs import BaseDateParserConfiguration +from ..base_dateperiod import DatePeriodParserConfiguration + + +class PortugueseDatePeriodParserConfiguration(DatePeriodParserConfiguration): + @property + def less_than_regex(self) -> Pattern: + return self._less_than_regex + + @property + def reference_date_period_regex(self) -> Pattern: + return self._reference_date_period_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 relative_regex(self) -> Pattern: + return self._relative_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 decade_with_century_regex(self) -> Pattern: + return self._decade_with_century_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 ago_regex(self) -> Pattern: + return self._ago_regex + + @property + def later_regex(self) -> Pattern: + return self._later_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 check_both_before_after(self) -> bool: + return self._check_both_before_after + + 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._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_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) + 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_with_week_day_range_regex = RegExpUtility.get_safe_reg_exp( + PortugueseDateTime.WeekWithWeekDayRangeRegex) + self._unspecific_end_of_range_regex = RegExpUtility.get_safe_reg_exp( + 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 + ) + + def get_swift_day_or_month(self, source: str) -> int: + trimmed_source = source.strip().lower() + swift = 0 + + if 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.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 PortugueseDateTime.FutureRegex) + + def is_year_to_date(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in PortugueseDateTime.YearToDateTerms) + + def is_month_to_date(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source == o for o in PortugueseDateTime.MonthToDateTerms) + + def is_week_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in PortugueseDateTime.WeekTerms) + + def is_weekend(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in PortugueseDateTime.WeekendTerms) + + def is_month_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in PortugueseDateTime.MonthTerms) + + def is_last_cardinal(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return not self.previous_prefix_regex.search(trimmed_source) is None + + def is_year_only(self, source: str) -> bool: + trimmed_source = source.strip().lower() + return any(trimmed_source.endswith(o) for o in PortugueseDateTime.YearTerms) 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 new file mode 100644 index 0000000000..cc15ec9825 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_extractor_config.py @@ -0,0 +1,163 @@ +# 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.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_configs import PortugueseDateTimeUtilityConfiguration +from .date_extractor_config import PortugueseDateExtractorConfiguration +from .time_extractor_config import PortugueseTimeExtractorConfiguration +from .duration_extractor_config import PortugueseDurationExtractorConfiguration + + +class PortugueseDateTimeExtractorConfiguration(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) -> PortugueseDateTimeUtilityConfiguration: + 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): + super().__init__() + 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._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 + ) + 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 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 new file mode 100644 index 0000000000..e76e8111bf --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetime_parser_config.py @@ -0,0 +1,186 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Pattern, Dict + +from recognizers_text.utilities import RegExpUtility +from recognizers_number.number.extractors import BaseNumberExtractor +from recognizers_number.number.parsers import BaseNumberParser +from ...resources.portuguese_date_time import PortugueseDateTime +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): + @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 utility_configuration(self) -> DateTimeUtilityConfiguration: + return self._utility_configuration + + def __init__(self, config: BaseDateParserConfiguration): + self._token_before_date = PortugueseDateTime.TokenBeforeDate + self._token_before_time = PortugueseDateTime.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( + 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) + 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) + 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.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 + + def get_matched_now_timex(self, source: str) -> MatchedTimex: + source = source.strip().lower() + + 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') + ): + timex = 'FUTURE_REF' + elif source.endswith('mente'): + timex = 'PAST_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 + + # TODO: replace with a regex + if (source.endswith('manha') or source.endswith('madrugada')) and hour >= 12: + result -= 12 + elif not (source.endswith('manha') or source.endswith('madrugada')) and hour < 12: + result += 12 + + return result + 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 new file mode 100644 index 0000000000..f8e52ba890 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_extractor_config.py @@ -0,0 +1,277 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# 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_duration import BaseDurationExtractor +from ..base_timeperiod import BaseTimePeriodExtractor +from ..base_datetime import BaseDateTimeExtractor +from ..base_timezone import BaseTimeZoneExtractor +from .date_extractor_config import PortugueseDateExtractorConfiguration +from .time_extractor_config import PortugueseTimeExtractorConfiguration +from .duration_extractor_config import PortugueseDurationExtractorConfiguration +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): + @property + def future_regex(self) -> BaseNumberExtractor: + return self._future_regex + + @property + def past_regex(self) -> BaseNumberExtractor: + return self._past_regex + + @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 options(self): + return self._options + + @property + def dmy_date_format(self) -> bool: + return self._dmy_date_format + + @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 time_zone_extractor(self) -> DateTimeExtractor: + return self._time_zone_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._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._simple_cases_regexes = [ + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PureNumFromTo), + 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._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 + ) + self._options = DateTimeOptions.NONE + self._check_both_before_after = PortugueseDateTime.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 regex.fullmatch(self.range_connector_regex, source) 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 new file mode 100644 index 0000000000..bb93a92dba --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/datetimeperiod_parser_config.py @@ -0,0 +1,218 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Pattern, Dict +import regex + +from recognizers_text.utilities import RegExpUtility +from ...resources.portuguese_date_time import PortugueseDateTime +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): + + @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(PortugueseDateTime.TimeOfDayRegex) + self._future_suffix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.FutureSuffixRegex) + self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.WithinNextPrefixRegex) + self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PreviousPrefixRegex) + self._cardinal_extractor = config.cardinal_extractor + self._am_desc_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.AmDescRegex) + self._pm_desc_regex = RegExpUtility.get_safe_reg_exp(PortugueseDateTime.PmDescRegex) + 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._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) + 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._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) + + @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 + + @property + def time_zone_parser(self) -> DateTimeParser: + return self._time_zone_parser + + def get_matched_time_range(self, source: str): + trimmed_source = source.strip() + + begin_hour = 0 + end_hour = 0 + end_min = 0 + + time_str = '' + return MatchedTimeRange(time_str, begin_hour, end_hour, end_min, False) + + 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/portuguese/duration_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_extractor_config.py new file mode 100644 index 0000000000..8780c8413c --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_extractor_config.py @@ -0,0 +1,142 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +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 ...resources.portuguese_date_time import PortugueseDateTime +from ..base_duration import DurationExtractorConfiguration + + +class PortugueseDurationExtractorConfiguration(DurationExtractorConfiguration): + + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @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 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) -> 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 + + 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._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._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( + 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._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._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 + self._special_number_unit_regex = None 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 new file mode 100644 index 0000000000..9ac5d37063 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/duration_parser_config.py @@ -0,0 +1,96 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Pattern, Dict + +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 ...resources.portuguese_date_time import PortugueseDateTime +from ..extractors import DateTimeExtractor +from ..base_duration import DurationParserConfiguration, BaseDurationExtractor +from .duration_extractor_config import PortugueseDurationExtractorConfiguration + + +class PortugueseDurationParserConfiguration(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( + 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_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) + self._inexact_number_unit_regex: Pattern = RegExpUtility.get_safe_reg_exp( + 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 new file mode 100644 index 0000000000..dbb19ce6ce --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_extractor_config.py @@ -0,0 +1,22 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# 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 + + +class PortugueseHolidayExtractorConfiguration(HolidayExtractorConfiguration): + + @property + def holiday_regexes(self) -> List[Pattern]: + return self._holiday_regexes + + 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) + ] 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 new file mode 100644 index 0000000000..b75442244b --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/holiday_parser_config.py @@ -0,0 +1,204 @@ +# 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 recognizers_text.utilities import RegExpUtility +from ..utilities import DateUtils +from ..base_holiday import BaseHolidayParserConfiguration +from ...resources.portuguese_date_time import PortugueseDateTime + + +class PortugueseHolidayParserConfiguration(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 sanitize_holiday_token(self, holiday: str) -> str: + return re.sub('[ \']', '', holiday) + + def __init__(self, config): + super().__init__() + self._holiday_regexes = [ + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex1), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.HolidayRegex2), + 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) + + 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) + ]) + + 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) + + 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 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 new file mode 100644 index 0000000000..a06dbc7eec --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_extractor_config.py @@ -0,0 +1,208 @@ +# 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 import PortugueseIntegerExtractor +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_holiday import BaseHolidayExtractor +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 .holiday_extractor_config import PortugueseHolidayExtractorConfiguration +from ...resources.base_date_time import BaseDateTime +from ..base_timezone import BaseTimeZoneExtractor +from .timezone_extractor_config import PortugueseTimeZoneExtractorConfiguration + + +class PortugueseMergedExtractorConfiguration(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 ambiguity_filters_dict(self) -> Pattern: + return self._ambiguity_filters_dict + + @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 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 + + @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 ambiguous_range_modifier_prefix(self) -> Pattern: + return self._ambiguous_range_modifier_prefix + + @property + def potential_ambiguous_range_regex(self) -> Pattern: + return self._from_to_regex + + @property + def number_ending_pattern(self) -> Pattern: + return self._number_ending_pattern + + @property + def superfluous_word_matcher(self) -> Pattern: + return self._superfluous_word_matcher + + @property + def fail_fast_regex(self) -> Pattern: + return self._fail_fast_regex + + @property + def term_filter_regexes(self) -> List[Pattern]: + return self._term_filter_regexes + + 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._single_ambiguous_month_regex = RegExpUtility.get_safe_reg_exp( + 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) + self._term_filter_regexes = None + self._unspecified_date_period_regex = RegExpUtility.get_safe_reg_exp( + PortugueseDateTime.UnspecificDatePeriodRegex + ) + 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._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 new file mode 100644 index 0000000000..4dd3c52388 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/merged_parser_config.py @@ -0,0 +1,114 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +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 ..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_datetimeperiod import BaseDateTimePeriodParser +from ..base_duration import BaseDurationParser +from ..base_set import BaseSetParser +from ..base_merged import MergedParserConfiguration +from ...resources.portuguese_date_time import PortugueseDateTime + + +class PortugueseMergedParserConfiguration(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 + + @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.__date_parser = config.date_parser + self.__time_parser = config.time_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.__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 new file mode 100644 index 0000000000..1a92f73482 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/parsers.py @@ -0,0 +1,94 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from datetime import datetime +import regex + +from recognizers_text.utilities import RegExpUtility +from ..utilities import DateTimeResolutionResult +from ..base_datetimeperiod import BaseDateTimePeriodParser +from ..base_time import BaseTimeParser +from ...resources import PortugueseDateTime +from .datetimeperiod_parser_config import PortugueseDateTimePeriodParserConfiguration + + +class PortugueseTimeParser(BaseTimeParser): + def __init__(self, config: PortugueseDateTimePeriodParserConfiguration): + BaseDateTimePeriodParser.__init__(self, config) + + def parse_specific_time_of_day(self, source: str, reference: datetime) -> DateTimeResolutionResult: + result = DateTimeResolutionResult() + trimmed_text = source.strip().lower() + + # Handle morning, afternoon.. + values = self.config.get_matched_time_range(trimmed_text) + if not values.success: + return result + + match = self.config.specific_time_of_day_regex.match(trimmed_text) + + if match and len(match.group()) == len(trimmed_text): + swift = self.config.get_swift_prefix(trimmed_text) + + date = reference + timedelta(days=swift) + date = date.replace(hour=0, minute=0, second=0) + day = date.day + month = date.month + year = date.year + + 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.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 + + # 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:])) + if matches: + match = matches[0] + before_str = trimmed_text[0:match.start() + match.end()].strip() + ers = self.config.date_extractor.extract(before_str, reference) + + if not ers: + return result + + pr = self.config.date_parser.parse(ers[0], reference) + + future_date = pr.value.future_value + past_date = pr.value.past_value + + result.timex = pr.timex_str + values.time_str + + 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.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) + ] + 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.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) + ] + + result.success = True + return result + + return result 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 new file mode 100644 index 0000000000..a161edea0e --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_extractor_config.py @@ -0,0 +1,123 @@ +# 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 new file mode 100644 index 0000000000..a50db0d663 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/set_parser_config.py @@ -0,0 +1,160 @@ +# 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 new file mode 100644 index 0000000000..659807e7ec --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_extractor_config.py @@ -0,0 +1,124 @@ +# 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.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 + + @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 + + @property + def pm_regex(self) -> Pattern: + return self._pm_regex + + @property + def am_regex(self) -> Pattern: + return self._am_regex + + 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._time_regex_list: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex1), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex2), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex3), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex4), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex5), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex6), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex7), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex8), + 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) + ] + 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()) 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 new file mode 100644 index 0000000000..a949776c8f --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/time_parser_config.py @@ -0,0 +1,119 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import List, Pattern, Dict +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 + + +class PortugueseTimeParserConfiguration(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 + + @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._time_regexes: List[Pattern] = [ + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex1), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex2), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex3), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex4), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex5), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex6), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex7), + RegExpUtility.get_safe_reg_exp(PortugueseDateTime.TimeRegex8), + 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) + ] + 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) + + 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'): + delta_min = 15 + elif prefix.startswith('menos um quarto'): + delta_min = -15 + else: + match = regex.search(self.less_than_one_hour, prefix) + 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[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'): + 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, 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, 'am') + if am_str: + if adjust.hour >= 12: + delta_hour -= 12 + else: + adjust.has_am = True + pm_str = RegExpUtility.get_group(match, 'pm') + if pm_str: + if adjust.hour < 12: + delta_hour = 12 + if regex.search(self.night_regex, pm_str): + if adjust.hour <= 3 or adjust.hour == 12: + if adjust.hour == 12: + adjust.hour = 0 + delta_hour = 0 + adjust.has_am = 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/portuguese/timeperiod_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_extractor_config.py new file mode 100644 index 0000000000..b0f95972eb --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_extractor_config.py @@ -0,0 +1,126 @@ +# 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_text.extractor import Extractor +from recognizers_number.number.portuguese.extractors import PortugueseIntegerExtractor +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_configs import PortugueseDateTimeUtilityConfiguration +from .time_extractor_config import PortugueseTimeExtractorConfiguration +from .timezone_extractor_config import PortugueseTimeZoneExtractorConfiguration +from ..utilities import DateTimeOptions + + +class PortugueseTimePeriodExtractorConfiguration(TimePeriodExtractorConfiguration): + + @property + def check_both_before_after(self) -> bool: + return self._check_both_before_after + + @property + def dmy_date_format(self) -> bool: + return self._dmy_date_format + + @property + def options(self): + return self._options + + @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 time_zone_extractor(self) -> DateTimeExtractor: + return self._time_zone_extractor + + def __init__(self): + super().__init__() + self._single_time_extractor = BaseTimeExtractor( + PortugueseTimeExtractorConfiguration()) + self._integer_extractor = PortugueseIntegerExtractor() + self.utility_configuration = PortugueseDateTimeUtilityConfiguration() + + self._simple_cases_regex: List[Pattern] = [ + 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) + ] + + 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: + 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_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def has_connector_token(self, source: str) -> MatchedIndex: + match = self.range_connector_regex.search(source) + if match: + return MatchedIndex(True, match.start()) + + return MatchedIndex(False, -1) + + def is_connector_token(self, source: str) -> MatchedIndex: + return self.range_connector_regex.search(source) 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 new file mode 100644 index 0000000000..8ab6d46d1a --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timeperiod_parser_config.py @@ -0,0 +1,129 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from typing import Pattern, Dict + +from recognizers_text.utilities import RegExpUtility +from recognizers_text.extractor import Extractor +from recognizers_number.number.portuguese.extractors import PortugueseIntegerExtractor +from ...resources.portuguese_date_time import PortugueseDateTime +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): + @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 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 + + @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._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._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) + self._numbers = PortugueseDateTime.Numbers + self._utility_configuration = config.utility_configuration + + def get_matched_timex_range(self, source: str) -> MatchedTimeRegex: + trimmed_text = source.strip().lower() + if trimmed_text.endswith('s'): + trimmed_text = trimmed_text[:-1] + + timex = '' + begin_hour = 0 + end_hour = 0 + end_min = 0 + + time_of_day = "" + if any(trimmed_text.endswith(o) for o in PortugueseDateTime.MorningTermList): + time_of_day = Constants.MORNING + elif any(trimmed_text.endswith(o) for o in PortugueseDateTime.AfternoonTermList): + time_of_day = Constants.AFTERNOON + elif any(trimmed_text.endswith(o) for o in PortugueseDateTime.EveningTermList): + time_of_day = Constants.EVENING + elif any(trimmed_text == o for o in PortugueseDateTime.DaytimeTermList): + time_of_day = Constants.DAYTIME + 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 + ) + + 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/portuguese/timezone_extractor_config.py b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timezone_extractor_config.py new file mode 100644 index 0000000000..7879c59323 --- /dev/null +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/date_time/portuguese/timezone_extractor_config.py @@ -0,0 +1,28 @@ +# 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 \ No newline at end of file diff --git a/Python/libraries/recognizers-number/recognizers_number/number/__init__.py b/Python/libraries/recognizers-number/recognizers_number/number/__init__.py index 33483010fa..6d6869574b 100644 --- a/Python/libraries/recognizers-number/recognizers_number/number/__init__.py +++ b/Python/libraries/recognizers-number/recognizers_number/number/__init__.py @@ -10,6 +10,7 @@ from .chinese import * from .french import * from .japanese import * +from .portuguese import * from .number_recognizer import * from .parser_factory import * from .utilities import * diff --git a/Specs/DateTime/Portuguese/DateExtractor.json b/Specs/DateTime/Portuguese/DateExtractor.json index 3ad9e1d2fa..3c6a6910db 100644 --- a/Specs/DateTime/Portuguese/DateExtractor.json +++ b/Specs/DateTime/Portuguese/DateExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Voltarei no 15", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "15", @@ -13,7 +13,7 @@ }, { "Input": "Voltarei em 22 de Abril", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "22 de Abril", @@ -25,7 +25,7 @@ }, { "Input": "Voltarei em 1-Jan", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1-Jan", @@ -37,17 +37,17 @@ }, { "Input": "nas ultimas 3 semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { "Input": "nas 3 semanas passadas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { "Input": "Voltarei em 1/Jan", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1/Jan", @@ -59,7 +59,7 @@ }, { "Input": "Voltarei no 2 de Outubro", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2 de Outubro", @@ -71,7 +71,7 @@ }, { "Input": "Voltarei em 12 de janeiro de 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12 de janeiro de 2016", @@ -83,7 +83,7 @@ }, { "Input": "Voltarei no 12 de Janeiro de 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12 de Janeiro de 2016", @@ -95,7 +95,7 @@ }, { "Input": "Voltarei na segunda-feira 12 de janeiro de 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "segunda-feira 12 de janeiro de 2016", @@ -107,7 +107,7 @@ }, { "Input": "Voltarei na segunda-feira, 12 de janeiro de 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "segunda-feira, 12 de janeiro de 2016", @@ -119,7 +119,7 @@ }, { "Input": "Voltarei em 02/22/2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "02/22/2016", @@ -131,7 +131,7 @@ }, { "Input": "Voltarei em 21/04/2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "21/04/2016", @@ -143,7 +143,7 @@ }, { "Input": "Voltarei em 21/04/16", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "21/04/16", @@ -155,7 +155,7 @@ }, { "Input": "Voltarei em 9-18-15", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "9-18-15", @@ -167,7 +167,7 @@ }, { "Input": "Voltarei em 4.22", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4.22", @@ -179,7 +179,7 @@ }, { "Input": "Voltarei em 4-22", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4-22", @@ -191,7 +191,7 @@ }, { "Input": "Voltarei em 4/22", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4/22", @@ -203,7 +203,7 @@ }, { "Input": "Voltarei em 22/04", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "22/04", @@ -215,7 +215,7 @@ }, { "Input": "Voltarei 4/22", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4/22", @@ -227,7 +227,7 @@ }, { "Input": "Voltarei 22/04", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "22/04", @@ -239,7 +239,7 @@ }, { "Input": "Voltarei em 2015/08/12", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015/08/12", @@ -251,7 +251,7 @@ }, { "Input": "Voltarei em 11/12, 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "11/12, 2016", @@ -263,7 +263,7 @@ }, { "Input": "Voltarei em 11/12/16", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "11/12/16", @@ -275,7 +275,7 @@ }, { "Input": "Voltarei em 11/12 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "11/12 2016", @@ -287,7 +287,7 @@ }, { "Input": "Voltarei em 1o de Jan", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1o de Jan", @@ -299,7 +299,7 @@ }, { "Input": "Voltarei em 28-Nov", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "28-Nov", @@ -311,7 +311,7 @@ }, { "Input": "Voltarei na Qua, 22 de Jan", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "Qua, 22 de Jan", @@ -323,7 +323,7 @@ }, { "Input": "Voltarei no primeiro de Jan", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "primeiro de Jan", @@ -335,7 +335,7 @@ }, { "Input": "Voltarei no vinte e um de Maio", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "vinte e um de Maio", @@ -347,7 +347,7 @@ }, { "Input": "Voltarei em Maio vinte e um", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "Maio vinte e um", @@ -359,7 +359,7 @@ }, { "Input": "Voltarei no segundo de Ago", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "segundo de Ago", @@ -371,7 +371,7 @@ }, { "Input": "Voltarei no vigésimo segundo de Junho", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "vigésimo segundo de Junho", @@ -383,7 +383,7 @@ }, { "Input": "Voltarei sexta-feira", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sexta-feira", @@ -395,7 +395,7 @@ }, { "Input": "Voltarei na sexta-feira", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sexta-feira", @@ -407,7 +407,7 @@ }, { "Input": "Voltarei nas sextas-feiras", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sextas-feiras", @@ -419,7 +419,7 @@ }, { "Input": "Voltarei aos sábados", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sábados", @@ -431,7 +431,7 @@ }, { "Input": "Voltarei hoje", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "hoje", @@ -443,7 +443,7 @@ }, { "Input": "Voltarei amanhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã", @@ -455,7 +455,7 @@ }, { "Input": "Voltei ontem", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ontem", @@ -467,7 +467,7 @@ }, { "Input": "Voltei no dia antes de ontem", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia antes de ontem", @@ -479,7 +479,7 @@ }, { "Input": "Voltei anteontem", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "anteontem", @@ -491,7 +491,7 @@ }, { "Input": "Voltarei no dia depois de amanhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia depois de amanhã", @@ -503,7 +503,7 @@ }, { "Input": "Voltarei depois de amanhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "depois de amanhã", @@ -515,7 +515,7 @@ }, { "Input": "Voltarei no dia seguinte", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia seguinte", @@ -527,7 +527,7 @@ }, { "Input": "Voltarei no proximo dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximo dia", @@ -539,7 +539,7 @@ }, { "Input": "Voltarei esta sexta-feira", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta sexta-feira", @@ -551,7 +551,7 @@ }, { "Input": "Voltarei proximo domingo", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximo domingo", @@ -563,7 +563,7 @@ }, { "Input": "Voltarei no domingo seguinte", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "domingo seguinte", @@ -575,7 +575,7 @@ }, { "Input": "Voltarei no ultimo domingo", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ultimo domingo", @@ -587,7 +587,7 @@ }, { "Input": "Voltarei no ultimo dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ultimo dia", @@ -599,7 +599,7 @@ }, { "Input": "Voltarei na sexta-feira desta semana", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sexta-feira desta semana", @@ -611,7 +611,7 @@ }, { "Input": "Voltarei no domingo da semana seguinte", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "domingo da semana seguinte", @@ -623,7 +623,7 @@ }, { "Input": "Voltarei no domingo da ultima semana", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "domingo da ultima semana", @@ -635,7 +635,7 @@ }, { "Input": "Voltarei em 15 de Junho 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "15 de Junho 2016", @@ -647,7 +647,7 @@ }, { "Input": "Voltarei em onze de maio", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "onze de maio", @@ -659,7 +659,7 @@ }, { "Input": "Voltarei em primeiro de maio", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "primeiro de maio", @@ -671,7 +671,7 @@ }, { "Input": "Voltarei na primeira sexta-feira de julho", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "na primeira sexta-feira de julho", @@ -683,7 +683,7 @@ }, { "Input": "Voltarei na primeira sexta-feira deste mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "na primeira sexta-feira deste mes", @@ -695,7 +695,6 @@ }, { "Input": "Você está livre em 13.5.2015", - "NotSupported": "python", "Results": [ { "Text": "13.5.2015", @@ -707,7 +706,6 @@ }, { "Input": "Você está livre em 2015.5.13", - "NotSupported": "python", "Results": [ { "Text": "2015.5.13", diff --git a/Specs/DateTime/Portuguese/DateParser.json b/Specs/DateTime/Portuguese/DateParser.json index b41ddce143..0bbc511943 100644 --- a/Specs/DateTime/Portuguese/DateParser.json +++ b/Specs/DateTime/Portuguese/DateParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "15", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2 de Out", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2-Out", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2/Out", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2 de Outubro", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12 de janeiro, 2016", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "segunda-feira 12 de janeiro, 2016", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "22/02/2016", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "21/04/2016", @@ -220,7 +220,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "21/04/16", @@ -244,7 +244,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "21-04-2016", @@ -268,7 +268,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4.22", @@ -292,7 +292,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4-22", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4/22", @@ -340,7 +340,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "22/04", @@ -364,7 +364,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4/22", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "22/04", @@ -412,7 +412,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015/08/12", @@ -436,7 +436,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "08/12,2015", @@ -460,7 +460,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "08/12,15", @@ -484,7 +484,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1o de Jan", @@ -508,7 +508,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1-Jan", @@ -532,7 +532,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "Qua, 22 de Jan", @@ -556,7 +556,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "primeiro de Jan", @@ -580,7 +580,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "vinte e um de Maio", @@ -604,7 +604,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "Maio vinte e um", @@ -628,7 +628,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dois de Ago", @@ -652,7 +652,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "vigesimo segundo de Junho", @@ -676,7 +676,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sexta", @@ -700,7 +700,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "6a", @@ -724,7 +724,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "hoje", @@ -748,7 +748,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã", @@ -772,7 +772,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ontem", @@ -796,7 +796,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "anteontem", @@ -820,7 +820,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "depois de amanha", @@ -844,7 +844,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia depois de amanha", @@ -868,7 +868,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próximo dia", @@ -892,7 +892,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia seguinte", @@ -916,7 +916,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "nesta sexta", @@ -940,7 +940,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximo domingo", @@ -964,7 +964,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ultimo domingo", @@ -988,7 +988,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sexta desta semana", @@ -1012,7 +1012,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "domingo da próxima semana", @@ -1036,7 +1036,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "domingo da última semana", @@ -1060,7 +1060,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "último dia", @@ -1084,7 +1084,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "15 de Junho de 2016", @@ -1108,7 +1108,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "na primeira sexta de julho", @@ -1132,7 +1132,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "na primeira sexta deste mes", @@ -1156,7 +1156,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12 de janeiro, 2018", @@ -1180,7 +1180,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "9-18-15", @@ -1204,7 +1204,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015/08/12", @@ -1228,7 +1228,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "08/12,2015", @@ -1252,7 +1252,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1o de Jan", @@ -1276,7 +1276,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "segundo de Ago", @@ -1300,7 +1300,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sexta-feira", @@ -1324,7 +1324,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia antes de ontem", @@ -1348,7 +1348,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximo dia", @@ -1372,7 +1372,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próximo domingo", @@ -1396,7 +1396,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "3-7-2017", @@ -1420,7 +1419,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "13.5.2015", @@ -1444,7 +1442,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "2015.5.13", @@ -1468,7 +1465,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "3-7-07", @@ -1492,7 +1488,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "3-7-27", @@ -1516,7 +1511,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "05/05/89", @@ -1540,7 +1534,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "05/05/71", diff --git a/Specs/DateTime/Portuguese/DatePeriodExtractor.json b/Specs/DateTime/Portuguese/DatePeriodExtractor.json index e0e7d58048..4859aaad1c 100644 --- a/Specs/DateTime/Portuguese/DatePeriodExtractor.json +++ b/Specs/DateTime/Portuguese/DatePeriodExtractor.json @@ -1,12 +1,12 @@ [ { "Input": "Me mudarei em 3 anos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { "Input": "Me mudarei próximos 3 anos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próximos 3 anos", @@ -18,12 +18,12 @@ }, { "Input": "Me mudarei em 3 semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { "Input": "Me mudarei próximas 3 semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próximas 3 semanas", @@ -35,7 +35,7 @@ }, { "Input": "Estarei fora de 4 até 22 deste mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4 até 22 deste mes", @@ -47,7 +47,7 @@ }, { "Input": "Estarei fora de 4 a 22 deste mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4 a 22 deste mes", @@ -59,7 +59,7 @@ }, { "Input": "Estarei fora desde o 3 até o 12 de Sept jajaja", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "desde o 3 até o 12 de Sept", @@ -71,7 +71,7 @@ }, { "Input": "Estarei fora de 4 a 23 do proximo mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4 a 23 do proximo mes", @@ -83,7 +83,7 @@ }, { "Input": "Estarei fora de 4 ao 23 deste mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4 ao 23 deste mes", @@ -143,7 +143,7 @@ }, { "Input": "Estarei fora esta semana", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta semana", @@ -155,7 +155,7 @@ }, { "Input": "Estarei fora em Setembro", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "em Setembro", @@ -167,7 +167,7 @@ }, { "Input": "Estarei fora nesse Setembro", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "nesse Setembro", @@ -179,7 +179,7 @@ }, { "Input": "Estive fora no ultimo sept", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ultimo sept", @@ -191,7 +191,7 @@ }, { "Input": "Estarei fora proximo junho", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximo junho", @@ -203,7 +203,7 @@ }, { "Input": "Estarei fora em junho 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "em junho 2016", @@ -215,7 +215,7 @@ }, { "Input": "Estarei fora em junho do proximo ano", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "em junho do proximo ano", @@ -227,7 +227,7 @@ }, { "Input": "Estarei fora este fim de semana", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "este fim de semana", @@ -239,7 +239,7 @@ }, { "Input": "Estarei fora a terceira semana deste mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "terceira semana deste mes", @@ -251,7 +251,7 @@ }, { "Input": "Estarei fora na ultima semana de julho", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "na ultima semana de julho", @@ -263,7 +263,7 @@ }, { "Input": "Estarei fora nos proximos 3 dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximos 3 dias", @@ -275,7 +275,7 @@ }, { "Input": "Estarei fora pelos proximos 3 meses", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximos 3 meses", @@ -299,7 +299,7 @@ }, { "Input": "Estive fora os ultimos 3 anos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ultimos 3 anos", @@ -407,7 +407,7 @@ }, { "Input": "Estarei fora desta sexta até o domingo seguinte", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "desta sexta até o domingo seguinte", @@ -467,7 +467,7 @@ }, { "Input": "Estarei fora 19-20 de Novembro", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "19-20 de Novembro", @@ -479,7 +479,7 @@ }, { "Input": "Estarei fora de 19 a 20 de Novembro", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "19 a 20 de Novembro", @@ -503,7 +503,7 @@ }, { "Input": "Estarei fora o terceiro trimestre de 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o terceiro trimestre de 2016", @@ -515,7 +515,7 @@ }, { "Input": "Estarei fora o terceiro trimestre deste ano", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o terceiro trimestre deste ano", @@ -527,7 +527,7 @@ }, { "Input": "Estarei fora em 2016 no terceiro trimestre", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2016 no terceiro trimestre", @@ -539,7 +539,7 @@ }, { "Input": "Estarei fora 2015.3", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015.3", @@ -551,7 +551,7 @@ }, { "Input": "Estarei fora 2015-3", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015-3", @@ -563,7 +563,7 @@ }, { "Input": "Estarei fora 2015/3", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015/3", @@ -575,7 +575,7 @@ }, { "Input": "Estarei fora 3/2015", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3/2015", @@ -587,7 +587,7 @@ }, { "Input": "Estarei fora na terceira semana de 2027", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "na terceira semana de 2027", @@ -599,7 +599,7 @@ }, { "Input": "Estarei fora a terceira semana do proximo ano", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "terceira semana do proximo ano", @@ -611,7 +611,7 @@ }, { "Input": "Estarei fora este verão", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "este verão", @@ -623,7 +623,7 @@ }, { "Input": "Estarei fora na primavera seguinte", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "na primavera seguinte", @@ -635,7 +635,7 @@ }, { "Input": "Estarei fora no verao", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "no verao", @@ -647,7 +647,7 @@ }, { "Input": "Estarei fora durante o verao", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o verao", @@ -659,7 +659,7 @@ }, { "Input": "Estarei fora no verao 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "no verao 2016", @@ -671,7 +671,7 @@ }, { "Input": "Estarei fora o verao de 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o verao de 2016", @@ -683,7 +683,7 @@ }, { "Input": "Estarei fora 4-23 do proximo mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4-23 do proximo mes", diff --git a/Specs/DateTime/Portuguese/DatePeriodParser.json b/Specs/DateTime/Portuguese/DatePeriodParser.json index 769e00a945..6a47cd7f78 100644 --- a/Specs/DateTime/Portuguese/DatePeriodParser.json +++ b/Specs/DateTime/Portuguese/DatePeriodParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4 a 22 deste mes", @@ -30,7 +30,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4-23 do proximo mes", @@ -56,7 +56,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "do dia 3 até o 12 de Set", @@ -82,7 +82,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4 até 23 do proximo mes", @@ -108,7 +108,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "desde o 4 até o 23 deste mes", @@ -186,7 +186,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4 a 22 de janeiro, 1995", @@ -238,7 +238,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta semana", @@ -264,7 +264,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "em Fevereiro", @@ -290,7 +290,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "este Setembro", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ultimo sept", @@ -342,7 +342,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximo junho", @@ -396,7 +396,7 @@ "ReferenceDateTime": "2016-11-07T00:00:00" }, "NotSupportedByDesign": "java", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "na ultima semana de julho", @@ -474,7 +474,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1o de Jan até Qua, 22 de Jan", @@ -578,7 +578,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "19-20 de Novembro", @@ -604,7 +604,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "19 até 20 de Novembro", @@ -656,7 +656,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015.3", @@ -682,7 +682,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015-3", @@ -708,7 +708,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2015/3", @@ -734,7 +734,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3/2015", @@ -812,7 +812,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "em junho 2016", @@ -838,7 +838,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "em junho do proximo ano", @@ -864,7 +864,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próximo ano", @@ -890,7 +890,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próximos 3 dias", @@ -916,7 +916,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximos 3 meses", @@ -942,7 +942,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "proximos 3 anos", @@ -994,7 +994,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ultimos 3 anos", @@ -1046,7 +1046,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "primeira semana de Out", @@ -1124,7 +1124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o terceiro trimestre de 2016", @@ -1150,7 +1150,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o terceiro trimestre deste ano", @@ -1176,7 +1176,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2016 no terceiro trimestre", @@ -1202,7 +1202,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "este verao", @@ -1222,7 +1222,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próxima primavera", @@ -1242,7 +1242,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "no verao", @@ -1262,7 +1262,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "verao", @@ -1282,7 +1282,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o verao 2016", @@ -1302,7 +1302,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "verao de 2016", diff --git a/Specs/DateTime/Portuguese/DateTimeExtractor.json b/Specs/DateTime/Portuguese/DateTimeExtractor.json index 888fe65d3a..63ad38a7b8 100644 --- a/Specs/DateTime/Portuguese/DateTimeExtractor.json +++ b/Specs/DateTime/Portuguese/DateTimeExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Vou voltar agora", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "agora", @@ -13,7 +13,7 @@ }, { "Input": "Vou voltar assim que possível", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "assim que possível", @@ -25,7 +25,7 @@ }, { "Input": "Vamos voltar assim que possamos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "assim que possamos", @@ -37,7 +37,7 @@ }, { "Input": "Vou voltar o mais rápido possível", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o mais rápido possível", @@ -49,7 +49,7 @@ }, { "Input": "Vou voltar o mais cedo possível", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o mais cedo possível", @@ -61,7 +61,7 @@ }, { "Input": "Vou voltar agora mesmo", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "agora mesmo", @@ -73,7 +73,7 @@ }, { "Input": "Vou voltar logo agora", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "logo agora", @@ -85,7 +85,7 @@ }, { "Input": "Vou voltar neste momento", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "neste momento", @@ -97,7 +97,7 @@ }, { "Input": "Vou voltar no 15 as 8:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "15 as 8:00", @@ -109,7 +109,7 @@ }, { "Input": "Vou voltar no 15 as 8:00:30", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "15 as 8:00:30", @@ -121,7 +121,7 @@ }, { "Input": "Vou voltar no 15, 8pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "15, 8pm", @@ -133,7 +133,7 @@ }, { "Input": "Vou voltar em 04/21/2016, 8:00pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "04/21/2016, 8:00pm", @@ -145,7 +145,7 @@ }, { "Input": "Vou voltar em 04/21/2016, 8:00:13pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "04/21/2016, 8:00:13pm", @@ -157,7 +157,7 @@ }, { "Input": "Vou voltar em 23 de Out às sete", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "23 de Out às sete", @@ -169,7 +169,7 @@ }, { "Input": "Vou voltar em 14 de Outubro 8:00am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro 8:00am", @@ -181,7 +181,7 @@ }, { "Input": "Vou voltar em 14 de Outubro as 8:00:00am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro as 8:00:00am", @@ -193,7 +193,7 @@ }, { "Input": "Vou voltar em 14 de Outubro, 8:00am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro, 8:00am", @@ -205,7 +205,7 @@ }, { "Input": "Vou voltar em 14 de Outubro, 8:00:01am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro, 8:00:01am", @@ -217,7 +217,7 @@ }, { "Input": "Vou voltar amanhã 8:00am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã 8:00am", @@ -229,7 +229,7 @@ }, { "Input": "Vou voltar amanhã cerca das 8:00am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã cerca das 8:00am", @@ -241,7 +241,7 @@ }, { "Input": "Vou voltar amanhã por volta das 8:00am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã por volta das 8:00am", @@ -253,7 +253,7 @@ }, { "Input": "Vou voltar amanhã pelas 8:00am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã pelas 8:00am", @@ -265,7 +265,7 @@ }, { "Input": "Vou voltar amanhã umas 8:00:05am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã umas 8:00:05am", @@ -277,7 +277,7 @@ }, { "Input": "Vou voltar na próxima sexta-feira as tres e meia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próxima sexta-feira as tres e meia", @@ -289,7 +289,7 @@ }, { "Input": "Vou voltar em 5 de Maio, 2016, 20 minutos depois das 8 da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "5 de Maio, 2016, 20 minutos depois das 8 da tarde", @@ -301,7 +301,7 @@ }, { "Input": "Vou voltar 8pm do 15", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm do 15", @@ -313,7 +313,7 @@ }, { "Input": "Vou voltar as sete no 15", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete no 15", @@ -325,7 +325,7 @@ }, { "Input": "Vo voltar as 8pm do próximo domingo", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm do próximo domingo", @@ -337,7 +337,7 @@ }, { "Input": "Vou voltar as 8pm de hoje", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm de hoje", @@ -349,7 +349,7 @@ }, { "Input": "Vou voltar 19:00, 2016-12-22", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "19:00, 2016-12-22", @@ -361,7 +361,7 @@ }, { "Input": "Vou voltar as 7 em ponto amanha", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7 em ponto amanha", @@ -373,7 +373,7 @@ }, { "Input": "Vou voltar amanhã pela manhã às 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã pela manhã às 7", @@ -385,7 +385,7 @@ }, { "Input": "Vou voltar 5:00 do domingo a tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "5:00 do domingo a tarde", @@ -397,7 +397,7 @@ }, { "Input": "Vou voltar as cinco e vinte amanha de manha", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cinco e vinte amanha de manha", @@ -409,7 +409,7 @@ }, { "Input": "Vou voltar as cinco e vinte da manha de amanha", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cinco e vinte da manha de amanha", @@ -421,7 +421,7 @@ }, { "Input": "Vou voltar 14 de outubro 8:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de outubro 8:00", @@ -433,7 +433,7 @@ }, { "Input": "Vou voltar as 7, esta manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7, esta manhã", @@ -445,7 +445,7 @@ }, { "Input": "Vou voltar esta noite as 8", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta noite as 8", @@ -457,7 +457,7 @@ }, { "Input": "Vou voltar as 8pm da tarde, Segunda-feira", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm da tarde, Segunda-feira", @@ -469,7 +469,7 @@ }, { "Input": "Vou voltar 8pm da noite, 1o de Janeiro", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm da noite, 1o de Janeiro", @@ -481,7 +481,7 @@ }, { "Input": "Vou voltar 8pm da noite, 1 de Janeiro", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm da noite, 1 de Janeiro", @@ -493,7 +493,7 @@ }, { "Input": "Vou voltar as 10pm desta noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "10pm desta noite", @@ -505,7 +505,7 @@ }, { "Input": "Vou voltar as 10pm esta noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "10pm esta noite", @@ -517,7 +517,7 @@ }, { "Input": "Vou voltar 8am de amanha", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8am de amanha", @@ -529,7 +529,7 @@ }, { "Input": "Vou voltar 8pm desta tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm desta tarde", @@ -541,7 +541,7 @@ }, { "Input": "Voltei esta manhã às 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta manhã às 7", @@ -553,7 +553,7 @@ }, { "Input": "Voltei esta manhã 7am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta manhã 7am", @@ -565,7 +565,7 @@ }, { "Input": "Voltei esta manha as sete", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta manha as sete", @@ -577,7 +577,7 @@ }, { "Input": "Volvtei esta manha as 7:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta manha as 7:00", @@ -589,7 +589,7 @@ }, { "Input": "Vou voltar esta noite as 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta noite as 7", @@ -601,7 +601,7 @@ }, { "Input": "Voltei esta noite as 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta noite as 7", @@ -613,7 +613,7 @@ }, { "Input": "para duas pessoas esta noite às 9:30 pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta noite às 9:30 pm", @@ -625,7 +625,7 @@ }, { "Input": "para duas pessoas esta noite às 9:30:31 pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta noite às 9:30:31 pm", @@ -637,7 +637,7 @@ }, { "Input": "Voltarei no final do dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "no final do dia", @@ -649,7 +649,7 @@ }, { "Input": "Voltarei ao fim do dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ao fim do dia", @@ -661,7 +661,7 @@ }, { "Input": "Voltarei ao fim do dia de amanha", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ao fim do dia de amanha", @@ -673,7 +673,7 @@ }, { "Input": "Voltarei amanhã ao terminar o dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã ao terminar o dia", @@ -685,7 +685,7 @@ }, { "Input": "Voltarei no fim do domingo", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "no fim do domingo", @@ -697,7 +697,7 @@ }, { "Input": "Vou voltar dia 5 as 4 a.m.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia 5 as 4 a.m.", @@ -709,7 +709,7 @@ }, { "Input": "Vou voltar 2016-12-16T12:23:59", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2016-12-16T12:23:59", @@ -721,7 +721,7 @@ }, { "Input": "Vou voltar 8pm do dia 15", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm do dia 15", diff --git a/Specs/DateTime/Portuguese/DateTimeModel.json b/Specs/DateTime/Portuguese/DateTimeModel.json index 2579c23311..ce0ace4bdb 100644 --- a/Specs/DateTime/Portuguese/DateTimeModel.json +++ b/Specs/DateTime/Portuguese/DateTimeModel.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "dom", @@ -79,7 +79,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "dom", @@ -154,7 +154,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã", @@ -209,7 +209,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -217,7 +217,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -225,7 +225,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -233,7 +233,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -241,7 +241,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -249,7 +249,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -257,7 +257,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -265,7 +265,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -273,7 +273,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "2000", @@ -298,7 +298,7 @@ "Context": { "ReferenceDateTime": "2018-09-28T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [] }, { @@ -306,7 +306,7 @@ "Context": { "ReferenceDateTime": "2019-08-05T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "terca-feira", @@ -355,7 +355,7 @@ "Context": { "ReferenceDateTime": "2019-08-05T00:01:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "terça", @@ -598,7 +598,7 @@ "Context": { "ReferenceDateTime": "2018-10-24T12:00:00" }, - "NotSupportedByDesign": "javascript,python,java", + "NotSupportedByDesign": "javascript,java", "Results": [ { "Text": "10/1-11/2/2017", @@ -623,7 +623,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "dia do trabalho", @@ -652,7 +652,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -660,7 +660,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "3 horas", @@ -689,7 +689,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "12 h", @@ -719,7 +719,7 @@ "ReferenceDateTime": "2020-05-25T12:00:00" }, "Comment": "The current resolution policy design will always result in a date for such entities. Policy change mechanism is in the backlog.", - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "dois meses atras", @@ -743,7 +743,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "30 minutos", @@ -775,7 +775,7 @@ "Context": { "ReferenceDateTime": "2020-05-30T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "uma e trinta", @@ -804,7 +804,7 @@ "Context": { "ReferenceDateTime": "2020-05-30T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "27/11 às 23", @@ -833,7 +833,7 @@ "Context": { "ReferenceDateTime": "2020-05-30T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sexta-feira em londres às 5", @@ -872,7 +872,7 @@ "Context": { "ReferenceDateTime": "2020-05-30T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sexta-feira em londres às 5 da tarde", @@ -901,7 +901,7 @@ "Context": { "ReferenceDateTime": "2020-05-30T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "30 minutos", @@ -925,7 +925,7 @@ "Context": { "ReferenceDateTime": "2020-05-30T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete do dia 15", @@ -964,7 +964,7 @@ "Context": { "ReferenceDateTime": "2020-05-30T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete da tarde do dia 15", @@ -1065,7 +1065,7 @@ "Context": { "ReferenceDateTime": "2020-05-30T12:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "10 min", @@ -1089,7 +1089,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "29/2", @@ -1118,7 +1118,7 @@ "Context": { "ReferenceDateTime": "2019-03-22T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "29/2", @@ -1147,7 +1147,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "29/2", @@ -1176,7 +1176,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "30/2", @@ -1200,7 +1200,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "29/2/2019", @@ -1224,7 +1224,7 @@ "Context": { "ReferenceDateTime": "2020-03-22T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "29/2/2020", @@ -1248,7 +1248,7 @@ "Context": { "ReferenceDateTime": "2019-09-18T18:00:00" }, - "NotSupported": "javascript,python,java", + "NotSupported": "javascript,java", "Results": [ { "Text": "28/2-1/3", @@ -1279,7 +1279,7 @@ "Context": { "ReferenceDateTime": "2019-09-18T18:00:00" }, - "NotSupported": "javascript,python,java", + "NotSupported": "javascript,java", "Results": [ { "Text": "29/2-1/3", @@ -1310,7 +1310,7 @@ "Context": { "ReferenceDateTime": "2019-09-18T18:00:00" }, - "NotSupported": "javascript,python,java", + "NotSupported": "javascript,java", "Results": [ { "Text": "29/2-1/3/2019", @@ -1406,7 +1406,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "2020/set/23", @@ -1430,7 +1430,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "23/set/2020", @@ -1454,7 +1454,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "23-2020-setembro", @@ -1478,7 +1478,7 @@ "Context": { "ReferenceDateTime": "2020-05-05T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "17/11", @@ -1546,7 +1546,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "sexta-feira de 23 às 4", @@ -1577,7 +1577,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "sexta-feira 23 a 4", @@ -1647,7 +1647,7 @@ "Context": { "ReferenceDateTime": "2021-03-15T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "sexta as 4", @@ -1802,7 +1802,7 @@ "Context": { "ReferenceDateTime": "2017-03-22T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "20 de junho", @@ -1908,7 +1908,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "tarde", @@ -1933,7 +1933,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "tarde", @@ -1958,7 +1958,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "tarde", @@ -1983,7 +1983,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "tarde", @@ -2083,7 +2083,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "meio dia", @@ -2132,7 +2132,7 @@ "Context": { "ReferenceDateTime": "2018-09-03T00:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "em 2 semanas", @@ -2206,7 +2206,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T12:30:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "último minuto", @@ -2281,7 +2281,7 @@ "Context": { "ReferenceDateTime": "2021-07-14T19:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "até 2010", @@ -2307,7 +2307,7 @@ "Context": { "ReferenceDateTime": "2021-07-14T19:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "até amanhã", @@ -2333,7 +2333,7 @@ "Context": { "ReferenceDateTime": "2021-07-14T19:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "ateh a manha", @@ -2383,7 +2383,7 @@ "Context": { "ReferenceDateTime": "2021-07-14T19:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "ate agosto", @@ -2416,7 +2416,7 @@ "Context": { "ReferenceDateTime": "2021-07-14T19:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "dia 12", @@ -2528,7 +2528,7 @@ "Context": { "ReferenceDateTime": "2021-07-14T19:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "a partir do dia 12", @@ -2561,7 +2561,7 @@ "Context": { "ReferenceDateTime": "2018-10-15T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "9 de agosto de 1971", @@ -2585,7 +2585,7 @@ "Context": { "ReferenceDateTime": "2018-10-15T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "9 de 8 de 1971", @@ -2609,7 +2609,7 @@ "Context": { "ReferenceDateTime": "2020-05-05T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "23 de novembro 1982", @@ -2633,7 +2633,7 @@ "Context": { "ReferenceDateTime": "2020-05-05T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "23 de novembro 82", @@ -2657,7 +2657,7 @@ "Context": { "ReferenceDateTime": "2020-05-05T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "23 novembro 1982", @@ -2681,7 +2681,7 @@ "Context": { "ReferenceDateTime": "2020-05-05T01:00:00" }, - "NotSupported": "javascript,python", + "NotSupported": "javascript", "Results": [ { "Text": "23 novembro 82", @@ -2905,7 +2905,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "7 horas", @@ -2934,7 +2934,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "7 horas", @@ -2958,7 +2958,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "7 horas", @@ -3006,7 +3006,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "5 e 45", @@ -3035,7 +3035,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [] }, { @@ -3043,7 +3043,7 @@ "Context": { "ReferenceDateTime": "2019-08-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "entre as 5 e as 7 da manha", @@ -3068,7 +3068,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "seis e meia", @@ -3097,7 +3097,7 @@ "Context": { "ReferenceDateTime": "2020-05-14T12:00:00" }, - "NotSupported": "javascript, python, java", + "NotSupported": "javascript, java", "Results": [ { "Text": "oito e quarenta e cinco", diff --git a/Specs/DateTime/Portuguese/DateTimeParser.json b/Specs/DateTime/Portuguese/DateTimeParser.json index 118ee8708a..cee799b4ad 100644 --- a/Specs/DateTime/Portuguese/DateTimeParser.json +++ b/Specs/DateTime/Portuguese/DateTimeParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "agora", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "assim que possivel", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "tao cedo quanto possamos", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "o mais rapido possivel", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "agora mesmo", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "logo agora", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "neste momento", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia 15 as 8:00", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia 15 as 8:00:20", @@ -244,7 +244,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cinco de maio as 4 a.m.", @@ -268,7 +268,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "04/21/2016, 8:00pm", @@ -292,7 +292,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "04/21/2016, 8:00:13pm", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "23 de Out as sete", @@ -340,7 +340,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro 8:00am", @@ -364,7 +364,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro 8:00:31am", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro, cerca das 8:00am", @@ -412,7 +412,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro as 8:00:31am", @@ -436,7 +436,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro, 8:00am", @@ -460,7 +460,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro, 8:00:26am", @@ -484,7 +484,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "5 de Maio, 2016, as cinco e vinte da tarde", @@ -508,7 +508,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm dia 15", @@ -532,7 +532,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm de hoje", @@ -556,7 +556,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "quinze para as oito de amanhã", @@ -580,7 +580,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "19:00, 2016-12-22", @@ -604,7 +604,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã 8:00am", @@ -628,7 +628,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã pela manhã às 7", @@ -652,7 +652,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:00 no próximo domingo a tarde", @@ -676,7 +676,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cinco e vinte amanhã pela manhã", @@ -724,7 +724,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "10 esta noite", @@ -748,7 +748,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta noite as 8", @@ -772,7 +772,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm da tarde, Domingo", @@ -796,7 +796,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm da tarde, primeiro de Jan", @@ -820,7 +820,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm da tarde, 1 Jan", @@ -844,7 +844,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "10pm desta noite", @@ -868,7 +868,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8am de hoje", @@ -892,7 +892,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm desta tarde", @@ -916,7 +916,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ao final do dia", @@ -940,7 +940,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ao fim do dia", @@ -964,7 +964,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ao final do dia de amanhã", @@ -988,7 +988,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ao fim do domingo", @@ -1012,7 +1012,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dia 15 as 8:00:24", @@ -1036,7 +1036,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "04/21/2016, 8:00pm", @@ -1060,7 +1060,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "04/21/2016, 8:00:24pm", @@ -1084,7 +1084,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro 8:00:13am", @@ -1108,7 +1108,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "14 de Outubro, 8:00:25am", @@ -1132,7 +1132,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm de hoje", @@ -1156,7 +1156,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm hoje", @@ -1180,7 +1180,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:00 do próximo domingo a tarde", @@ -1204,7 +1204,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm da tarde, 1o de Jan", @@ -1228,7 +1228,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4am desta madrugada", @@ -1252,7 +1252,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4pm desta tarde", @@ -1348,7 +1348,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta noite as 7", @@ -1372,7 +1372,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ontem a noite as 7", @@ -1396,7 +1396,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2016-12-16T12:23:59", @@ -1420,7 +1420,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete do dia 15", diff --git a/Specs/DateTime/Portuguese/DateTimePeriodExtractor.json b/Specs/DateTime/Portuguese/DateTimePeriodExtractor.json index be0cd39e03..459d9e3c3a 100644 --- a/Specs/DateTime/Portuguese/DateTimePeriodExtractor.json +++ b/Specs/DateTime/Portuguese/DateTimePeriodExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Estarei fora de cinco a sete hoje", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de cinco a sete hoje", @@ -13,7 +13,7 @@ }, { "Input": "Estarei fora hoje de cinco a sete", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "hoje de cinco a sete", @@ -25,7 +25,7 @@ }, { "Input": "Estarei fora de cinco a sete amanhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de cinco a sete amanhã", @@ -37,7 +37,7 @@ }, { "Input": "Estarei fora das 5 até as 6 no próximo domingo", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "das 5 até as 6 no próximo domingo", @@ -49,7 +49,7 @@ }, { "Input": "Estarei fora das 5 as 6pm no próximo domingo", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "das 5 as 6pm no próximo domingo", @@ -61,7 +61,7 @@ }, { "Input": "Estarei fora das 5 até as 6pm do próximo domingo", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "das 5 até as 6pm do próximo domingo", @@ -73,7 +73,7 @@ }, { "Input": "Estarei fora de 4pm a 5pm hoje", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4pm a 5pm hoje", @@ -85,7 +85,7 @@ }, { "Input": "Estarei fora de 4pm a 5pm de hoje", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4pm a 5pm de hoje", @@ -109,7 +109,7 @@ }, { "Input": "Estarei fora de 4pm a 5pm de amanhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4pm a 5pm de amanhã", @@ -121,7 +121,7 @@ }, { "Input": "Estarei fora de 4pm a 5pm de 2017-6-6", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4pm a 5pm de 2017-6-6", @@ -133,7 +133,7 @@ }, { "Input": "Estarei fora de 4pm a 5pm no 5 de Maio de 2018", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4pm a 5pm no 5 de Maio de 2018", @@ -145,7 +145,7 @@ }, { "Input": "Estarei fora de 4:00 a 5pm 5 de Maio, 2018", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4:00 a 5pm 5 de Maio, 2018", @@ -193,7 +193,7 @@ }, { "Input": "Estarei fora entre as 4pm e 5pm de hoje", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 4pm e 5pm de hoje", @@ -217,7 +217,7 @@ }, { "Input": "Voltarei à noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "noite", @@ -229,7 +229,7 @@ }, { "Input": "Voltarei de madrugada", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "madrugada", @@ -241,7 +241,7 @@ }, { "Input": "Voltarei esta tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta tarde", @@ -253,7 +253,7 @@ }, { "Input": "Voltei esta manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "esta manhã", @@ -265,7 +265,7 @@ }, { "Input": "Voltarei pela manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "manhã", @@ -277,7 +277,7 @@ }, { "Input": "Voltarei de manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "manhã", @@ -289,7 +289,7 @@ }, { "Input": "voltarei na próxima noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próxima noite", @@ -301,7 +301,7 @@ }, { "Input": "Voltei ontem à noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "ontem à noite", @@ -313,7 +313,7 @@ }, { "Input": "Voltei de noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "noite", @@ -325,7 +325,7 @@ }, { "Input": "Voltarei amanhã à noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "amanhã à noite", @@ -337,7 +337,7 @@ }, { "Input": "Voltarei próxima segunda-feira à tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próxima segunda-feira à tarde", @@ -349,7 +349,7 @@ }, { "Input": "Voltarei no 5 de maio de noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "5 de maio de noite", @@ -361,7 +361,7 @@ }, { "Input": "Vou rebobinar os últimos 3 minutos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "últimos 3 minutos", @@ -409,7 +409,7 @@ }, { "Input": "Vou voltar em 3 horas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -426,7 +426,7 @@ }, { "Input": "Vou voltar em 5 h", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] }, { @@ -455,7 +455,7 @@ }, { "Input": "Vou voltar no último minuto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "último minuto", @@ -467,7 +467,7 @@ }, { "Input": "Vou voltar na próxima hora", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próxima hora", diff --git a/Specs/DateTime/Portuguese/DateTimePeriodParser.json b/Specs/DateTime/Portuguese/DateTimePeriodParser.json index 1d8327c14b..b43eb39b0b 100644 --- a/Specs/DateTime/Portuguese/DateTimePeriodParser.json +++ b/Specs/DateTime/Portuguese/DateTimePeriodParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de cinco a sete hoje", @@ -56,7 +56,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6 em 4/22/2016", @@ -82,7 +82,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6 em 22 de Abril", @@ -108,7 +108,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6pm em 22 de Abril", @@ -134,7 +134,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6 em 1o de Jan", @@ -160,7 +160,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 3pm a 4pm amanhã", @@ -186,7 +186,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4pm de hoje até as 5pm de amanha", @@ -238,7 +238,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 4pm e 5pm hoje", @@ -498,7 +498,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "últimos 3 minutos", @@ -602,7 +602,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "último minuto", @@ -628,7 +628,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "próxima hora", @@ -654,7 +654,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 3:00 a 4:00 amanha", @@ -706,7 +706,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 3:00 a 4:00 de amanhã", @@ -732,7 +732,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de sete e meia a 4pm amanhã", diff --git a/Specs/DateTime/Portuguese/DurationExtractor.json b/Specs/DateTime/Portuguese/DurationExtractor.json index b1afd0aa34..e1c5bd5295 100644 --- a/Specs/DateTime/Portuguese/DurationExtractor.json +++ b/Specs/DateTime/Portuguese/DurationExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "me vou por 3h", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3h", @@ -13,7 +13,7 @@ }, { "Input": "me vou por 3 dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 dias", @@ -25,7 +25,7 @@ }, { "Input": "me vou por 3,5 anos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3,5 anos", @@ -37,7 +37,7 @@ }, { "Input": "me vou por 3 h", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 h", @@ -49,7 +49,7 @@ }, { "Input": "me vou por 3 horas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 horas", @@ -61,7 +61,7 @@ }, { "Input": "me vou 3 dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 dias", @@ -73,7 +73,7 @@ }, { "Input": "me vou por 3 meses", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 meses", @@ -85,7 +85,7 @@ }, { "Input": "me vou por 3 minutos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 minutos", @@ -97,7 +97,7 @@ }, { "Input": "me vou por 3 min", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 min", @@ -109,7 +109,7 @@ }, { "Input": "me vou por 3,5 segundos ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3,5 segundos", @@ -121,7 +121,7 @@ }, { "Input": "me vou por 123,45 seg", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "123,45 seg", @@ -133,7 +133,7 @@ }, { "Input": "me vou por duas semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "duas semanas", @@ -145,7 +145,7 @@ }, { "Input": "me vou 20 minutos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "20 minutos", @@ -157,7 +157,7 @@ }, { "Input": "me vou por vinte e quatro horas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "vinte e quatro horas", @@ -169,7 +169,7 @@ }, { "Input": "me vou por todo o dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todo o dia", @@ -181,7 +181,7 @@ }, { "Input": "me vou por toda a semana", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "toda a semana", @@ -193,7 +193,7 @@ }, { "Input": "estarei fora toda a semana", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "toda a semana", @@ -205,7 +205,7 @@ }, { "Input": "me vou por todo o mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todo o mes", @@ -217,7 +217,7 @@ }, { "Input": "me vou por todo o ano", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todo o ano", @@ -229,7 +229,7 @@ }, { "Input": "me vou por uma hora", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "uma hora", @@ -241,7 +241,7 @@ }, { "Input": "me vou por um ano", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "um ano", diff --git a/Specs/DateTime/Portuguese/DurationParser.json b/Specs/DateTime/Portuguese/DurationParser.json index 86c5c100af..2c1baed9c4 100644 --- a/Specs/DateTime/Portuguese/DurationParser.json +++ b/Specs/DateTime/Portuguese/DurationParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3h", @@ -28,7 +28,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 dias", @@ -52,7 +52,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3,5 anos", @@ -76,7 +76,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 h", @@ -100,7 +100,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 horas", @@ -124,7 +124,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 hrs", @@ -148,7 +148,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 hr", @@ -172,7 +172,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 meses", @@ -196,7 +196,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 minutos", @@ -220,7 +220,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 min", @@ -244,7 +244,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3,5 segundos", @@ -268,7 +268,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "123,45 seg", @@ -292,7 +292,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "duas semanas", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "20 minutos", @@ -340,7 +340,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "vinte e quatro horas", @@ -364,7 +364,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todo o dia", @@ -388,7 +388,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "toda a semana", @@ -412,7 +412,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todo o mes", @@ -436,7 +436,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todo o ano", @@ -460,7 +460,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "uma hora", @@ -484,7 +484,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "um dia", diff --git a/Specs/DateTime/Portuguese/HolidayExtractor.json b/Specs/DateTime/Portuguese/HolidayExtractor.json index 53b273af19..1aceadb0b3 100644 --- a/Specs/DateTime/Portuguese/HolidayExtractor.json +++ b/Specs/DateTime/Portuguese/HolidayExtractor.json @@ -2,7 +2,7 @@ { "TestType": "BasicTest", "Input": "Voltarei pro natal", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Start": 13, @@ -15,7 +15,7 @@ { "TestType": "BasicTest", "Input": "Estarei de volta pro natal do próximo ano", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Start": 21, @@ -28,7 +28,7 @@ { "TestType": "BasicTest", "Input": "Voltarei no dia de ação de graças", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Start": 12, @@ -41,7 +41,7 @@ { "TestType": "BasicTest", "Input": "Voltarei no dia dos pais", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Start": 12, @@ -54,7 +54,7 @@ { "TestType": "BasicTest", "Input": "Voltarei no dia de são francisco deste ano", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Start": 12, @@ -67,7 +67,7 @@ { "TestType": "BasicTest", "Input": "Voltarei no dia das mães de 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Start": 12, @@ -80,7 +80,7 @@ { "TestType": "BasicTest", "Input": "Voltarei no dia das mães 2016", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Start": 12, @@ -93,7 +93,7 @@ { "TestType": "BasicTest", "Input": "Voltarei no dia do trabalho", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Start": 12, diff --git a/Specs/DateTime/Portuguese/HolidayParser.json b/Specs/DateTime/Portuguese/HolidayParser.json index b649c0d6fb..a4f3eb2643 100644 --- a/Specs/DateTime/Portuguese/HolidayParser.json +++ b/Specs/DateTime/Portuguese/HolidayParser.json @@ -30,7 +30,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "XXXX-12-25", @@ -61,7 +61,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "XXXX-01-01", @@ -92,7 +92,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "XXXX-12-25", @@ -154,7 +154,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "XXXX-06-WXX-7-3", @@ -185,7 +185,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "2017-01-01", @@ -247,7 +247,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "2015-06-WXX-7-3", @@ -278,7 +278,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "XXXX-12-25", @@ -309,7 +309,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "XXXX-12-25", @@ -340,7 +340,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "XXXX-01-01", @@ -402,7 +402,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "TimexStr": "2015-06-WXX-7-3", diff --git a/Specs/DateTime/Portuguese/MergedExtractor.json b/Specs/DateTime/Portuguese/MergedExtractor.json index 642144a7d5..20466f2562 100644 --- a/Specs/DateTime/Portuguese/MergedExtractor.json +++ b/Specs/DateTime/Portuguese/MergedExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "isto é 2 dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "2 dias", @@ -13,7 +13,7 @@ }, { "Input": "isto é antes das 4pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "antes das 4pm", @@ -25,7 +25,7 @@ }, { "Input": "isto é antes das 4pm amanhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "antes das 4pm amanhã", @@ -37,7 +37,7 @@ }, { "Input": "isto é antes de amanhã às 4pm ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "antes de amanhã às 4pm", @@ -49,7 +49,7 @@ }, { "Input": "depois de 7/2 ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "depois de 7/2", @@ -61,7 +61,7 @@ }, { "Input": "depois do 7/2 ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "depois do 7/2", @@ -73,7 +73,7 @@ }, { "Input": "desde o 7/2 ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "desde o 7/2", @@ -85,7 +85,7 @@ }, { "Input": "desde 7/2 ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "desde 7/2", @@ -97,7 +97,7 @@ }, { "Input": "antes do 7/2 ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "antes do 7/2", @@ -109,7 +109,7 @@ }, { "Input": "antes de 7/2 ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "antes de 7/2", diff --git a/Specs/DateTime/Portuguese/SetExtractor.json b/Specs/DateTime/Portuguese/SetExtractor.json index df17bde17e..a626feb34a 100644 --- a/Specs/DateTime/Portuguese/SetExtractor.json +++ b/Specs/DateTime/Portuguese/SetExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "sairei semanalmente", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "semanalmente", @@ -13,7 +13,7 @@ }, { "Input": "sairei diariamente", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "diariamente", @@ -25,7 +25,7 @@ }, { "Input": "saí todo dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todo dia", @@ -37,7 +37,7 @@ }, { "Input": "minha saída diária", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "diária", @@ -49,7 +49,7 @@ }, { "Input": "sairei todos os dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todos os dias", @@ -61,7 +61,7 @@ }, { "Input": "sairei cada mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada mes", @@ -73,7 +73,7 @@ }, { "Input": "sairei todos os meses", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todos os meses", @@ -85,7 +85,7 @@ }, { "Input": "sairei todas as semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todas as semanas", @@ -97,7 +97,7 @@ }, { "Input": "sairei mensalmente", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "mensalmente", @@ -109,7 +109,7 @@ }, { "Input": "sairei anualmente", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "anualmente", @@ -121,7 +121,7 @@ }, { "Input": "salirei todos os anos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todos os anos", @@ -133,7 +133,7 @@ }, { "Input": "irei a cada dois dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada dois dias", @@ -145,7 +145,7 @@ }, { "Input": "virão cada tres semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada tres semanas", @@ -157,7 +157,7 @@ }, { "Input": "irei a cada 3 semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada 3 semanas", @@ -169,7 +169,7 @@ }, { "Input": "eu irei às 3pm todos os dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3pm todos os dias", @@ -193,7 +193,7 @@ }, { "Input": "sairei cada 15/4", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada 15/4", @@ -205,7 +205,7 @@ }, { "Input": "sairei todos os domingos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todos os domingos", @@ -217,7 +217,7 @@ }, { "Input": "sairei todas as segundas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todas as segundas", @@ -229,7 +229,7 @@ }, { "Input": "sairei cada domingo as 4pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada domingo as 4pm", diff --git a/Specs/DateTime/Portuguese/SetParser.json b/Specs/DateTime/Portuguese/SetParser.json index 087e4a4811..81cd30cdde 100644 --- a/Specs/DateTime/Portuguese/SetParser.json +++ b/Specs/DateTime/Portuguese/SetParser.json @@ -1,7 +1,7 @@ [ { "Input": "Sairei semanalmente", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "semanalmente", @@ -22,7 +22,7 @@ }, { "Input": "Sairei quinzenalmente", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "quinzenalmente", @@ -43,7 +43,7 @@ }, { "Input": "Sairei diariamente", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "diariamente", @@ -85,7 +85,7 @@ }, { "Input": "Sairei todos os dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todos os dias", @@ -106,7 +106,7 @@ }, { "Input": "Sairei a cada mes", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada mes", @@ -127,7 +127,7 @@ }, { "Input": "Sairei todos os meses", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todos os meses", @@ -148,7 +148,7 @@ }, { "Input": "Sairei todas as semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todas as semanas", @@ -169,7 +169,7 @@ }, { "Input": "Sairei anualmente", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "anualmente", @@ -190,7 +190,7 @@ }, { "Input": "Sairei todos os anos", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todos os anos", @@ -211,7 +211,7 @@ }, { "Input": "Me irei a cada dois dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada dois dias", @@ -232,7 +232,7 @@ }, { "Input": "Me irei a cada tres semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada tres semanas", @@ -253,7 +253,7 @@ }, { "Input": "Me irei a cada 3 semanas", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada 3 semanas", @@ -274,7 +274,7 @@ }, { "Input": "Vou-me às 3pm todos os dias", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3pm todos os dias", @@ -316,7 +316,7 @@ }, { "Input": "Sairei em cada 15/4", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada 15/4", @@ -337,7 +337,7 @@ }, { "Input": "Sairei todas as segundas-feiras", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "todas as segundas-feiras", @@ -358,7 +358,7 @@ }, { "Input": "Sairei toda segunda-feira", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "toda segunda-feira", @@ -379,7 +379,7 @@ }, { "Input": "Sairei cada segunda-feira as 4pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cada segunda-feira as 4pm", diff --git a/Specs/DateTime/Portuguese/TimeExtractor.json b/Specs/DateTime/Portuguese/TimeExtractor.json index fb3b0ef0a0..4a7ce77ac5 100644 --- a/Specs/DateTime/Portuguese/TimeExtractor.json +++ b/Specs/DateTime/Portuguese/TimeExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Voltarei as 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7", @@ -13,7 +13,7 @@ }, { "Input": "Voltarei as sete", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete", @@ -25,7 +25,7 @@ }, { "Input": "Voltarei às sete", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete", @@ -37,7 +37,7 @@ }, { "Input": "Voltarei às 7pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7pm", @@ -49,7 +49,7 @@ }, { "Input": "Voltarei as 7p.m.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7p.m.", @@ -61,7 +61,7 @@ }, { "Input": "Voltarei as 19", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "19", @@ -73,7 +73,7 @@ }, { "Input": "Voltarei as 7:56pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:56pm", @@ -85,7 +85,7 @@ }, { "Input": "Voltarei as 7:56:35pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:56:35pm", @@ -97,7 +97,7 @@ }, { "Input": "Voltarei as 7:56:35 pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:56:35 pm", @@ -109,7 +109,7 @@ }, { "Input": "Voltarei as 12:34", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12:34", @@ -121,7 +121,7 @@ }, { "Input": "Voltarei as 12:34:20", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12:34:20", @@ -133,7 +133,7 @@ }, { "Input": "Voltarei as T12:34:20", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "T12:34:20", @@ -145,7 +145,7 @@ }, { "Input": "Voltarei às 00:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "00:00", @@ -157,7 +157,7 @@ }, { "Input": "Voltarei as 00:00:30", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "00:00:30", @@ -169,7 +169,7 @@ }, { "Input": "São 7 em ponto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7 em ponto", @@ -181,7 +181,7 @@ }, { "Input": "São sete em ponto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete em ponto", @@ -193,7 +193,7 @@ }, { "Input": "Será às sete em ponto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete em ponto", @@ -205,7 +205,7 @@ }, { "Input": "São 8 da manha", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8 da manha", @@ -217,7 +217,7 @@ }, { "Input": "São 8 da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8 da manhã", @@ -229,7 +229,7 @@ }, { "Input": "São 8 da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8 da tarde", @@ -241,7 +241,7 @@ }, { "Input": "São 8 da noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8 da noite", @@ -253,7 +253,7 @@ }, { "Input": "São oito e meia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "oito e meia", @@ -265,7 +265,7 @@ }, { "Input": "São 8pm e meia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm e meia", @@ -277,7 +277,7 @@ }, { "Input": "São 30 mins depois das oito", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "30 mins depois das oito", @@ -289,7 +289,7 @@ }, { "Input": "São oito e quatro", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "oito e quatro", @@ -301,7 +301,7 @@ }, { "Input": "São oito e um quarto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "oito e um quarto", @@ -313,7 +313,7 @@ }, { "Input": "São quinze para as oito", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "quinze para as oito", @@ -325,7 +325,7 @@ }, { "Input": "São quinze pras oito", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "quinze pras oito", @@ -337,7 +337,7 @@ }, { "Input": "São dez para as nove", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "dez para as nove", @@ -349,7 +349,7 @@ }, { "Input": "Faltam 3 minutos para as oito", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 minutos para as oito", @@ -361,7 +361,7 @@ }, { "Input": "São sete e meia em ponto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e meia em ponto", @@ -373,7 +373,7 @@ }, { "Input": "São sete e meia da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e meia da tarde", @@ -385,7 +385,7 @@ }, { "Input": "São sete e meia da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e meia da manhã", @@ -397,7 +397,7 @@ }, { "Input": "São vinte para as oito da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "vinte para as oito da manhã", @@ -409,7 +409,7 @@ }, { "Input": "São oito e vinte e três da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "oito e vinte e três da manhã", @@ -421,7 +421,7 @@ }, { "Input": "Voltarei pela tarde as 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "pela tarde as 7", @@ -433,7 +433,7 @@ }, { "Input": "Voltarei à tarde às 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "à tarde às 7", @@ -445,7 +445,7 @@ }, { "Input": "Voltarei a tarde as 7:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "a tarde as 7:00", @@ -457,7 +457,7 @@ }, { "Input": "Voltarei à tarde às 7:00:14", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "à tarde às 7:00:14", @@ -469,7 +469,7 @@ }, { "Input": "Voltarei a tarde as quatro pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "a tarde as quatro pm", @@ -481,7 +481,7 @@ }, { "Input": "Voltarei as sete e trinta pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e trinta pm", @@ -493,7 +493,7 @@ }, { "Input": "Voltarei as cinco da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cinco da tarde", @@ -505,7 +505,7 @@ }, { "Input": "Voltarei as sete e trinta e cinco pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e trinta e cinco pm", @@ -517,7 +517,7 @@ }, { "Input": "Voltarei as onze e cinco", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "onze e cinco", @@ -529,7 +529,7 @@ }, { "Input": "Voltarei tres minutos para as cinco", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "tres minutos para as cinco", @@ -541,7 +541,7 @@ }, { "Input": "Voltarei as nove e trinta da noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "nove e trinta da noite", @@ -553,7 +553,7 @@ }, { "Input": "Voltarei as cinco e trinta da madrugada", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cinco e trinta da madrugada", @@ -565,7 +565,7 @@ }, { "Input": "Voltarei no meio da madrugada", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "meio da madrugada", @@ -577,7 +577,7 @@ }, { "Input": "É mais de meio da madrugada.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "meio da madrugada", @@ -589,7 +589,7 @@ }, { "Input": "Voltarei no meio da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "meio da manhã", @@ -601,7 +601,7 @@ }, { "Input": "Voltarei pelo meio da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "meio da manhã", @@ -613,7 +613,7 @@ }, { "Input": "Voltarei ao meio dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "meio dia", @@ -625,7 +625,7 @@ }, { "Input": "Voltarei de meio dia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "meio dia", @@ -637,7 +637,7 @@ }, { "Input": "Voltarei ao meio da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "meio da tarde", @@ -649,7 +649,7 @@ }, { "Input": "Voltarei a meia-noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "meia-noite", @@ -661,7 +661,7 @@ }, { "Input": "Voltarei 340pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "340pm", @@ -673,7 +673,7 @@ }, { "Input": "Voltarei 1140 a.m.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1140 a.m.", @@ -685,7 +685,7 @@ }, { "Input": "não há pm depois da la hora", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [] } ] \ No newline at end of file diff --git a/Specs/DateTime/Portuguese/TimeParser.json b/Specs/DateTime/Portuguese/TimeParser.json index cb1670b34c..f24ffd88e5 100644 --- a/Specs/DateTime/Portuguese/TimeParser.json +++ b/Specs/DateTime/Portuguese/TimeParser.json @@ -1,7 +1,7 @@ [ { "Input": "Voltarei as 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7", @@ -22,7 +22,7 @@ }, { "Input": "Voltarei às sete", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete", @@ -43,7 +43,7 @@ }, { "Input": "Voltarei as 7pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7pm", @@ -64,7 +64,7 @@ }, { "Input": "Voltarei as 7:56pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:56pm", @@ -85,7 +85,7 @@ }, { "Input": "Voltarei as 7:56:30pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:56:30pm", @@ -106,7 +106,7 @@ }, { "Input": "Voltarei as 7:56:30 pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:56:30 pm", @@ -127,7 +127,7 @@ }, { "Input": "Voltarei às 12:34", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12:34", @@ -148,7 +148,7 @@ }, { "Input": "Voltarei as 12:34:25 ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12:34:25", @@ -169,7 +169,7 @@ }, { "Input": "São 7 em ponto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7 em ponto", @@ -190,7 +190,7 @@ }, { "Input": "São sete em ponto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete em ponto", @@ -211,7 +211,7 @@ }, { "Input": "São 8 da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8 da manhã", @@ -232,7 +232,7 @@ }, { "Input": "São 8 da noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8 da noite", @@ -253,7 +253,7 @@ }, { "Input": "São 4 da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4 da tarde", @@ -274,7 +274,7 @@ }, { "Input": "São oito e meia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "oito e meia", @@ -295,7 +295,7 @@ }, { "Input": "São 8pm e meia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "8pm e meia", @@ -316,7 +316,7 @@ }, { "Input": "São 30 mins depois das oito", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "30 mins depois das oito", @@ -337,7 +337,7 @@ }, { "Input": "São oito e quinze", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "oito e quinze", @@ -358,7 +358,7 @@ }, { "Input": "São quinze depois das oito", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "quinze depois das oito", @@ -379,7 +379,7 @@ }, { "Input": "São quinze para as 9pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "quinze para as 9pm", @@ -400,7 +400,7 @@ }, { "Input": "Faltam 3 minutos para as oito", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 minutos para as oito", @@ -421,7 +421,7 @@ }, { "Input": "São sete e meia em ponto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e meia em ponto", @@ -442,7 +442,7 @@ }, { "Input": "São três e meia da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "três e meia da tarde", @@ -463,7 +463,7 @@ }, { "Input": "São sete e meia da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e meia da manhã", @@ -484,7 +484,7 @@ }, { "Input": "São 20 min depois das seis da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "20 min depois das seis da tarde", @@ -505,7 +505,7 @@ }, { "Input": "Voltarei pela tarde às 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "pela tarde às 7", @@ -526,7 +526,7 @@ }, { "Input": "Voltarei a tarde as 7", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "a tarde as 7", @@ -547,7 +547,7 @@ }, { "Input": "Voltarei a tarde as 7:00", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "a tarde as 7:00", @@ -568,7 +568,7 @@ }, { "Input": "Voltarei a tarde as 7:00:14", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "a tarde as 7:00:14", @@ -589,7 +589,7 @@ }, { "Input": "Voltarei a tarde as sete pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "a tarde as sete pm", @@ -610,7 +610,7 @@ }, { "Input": "Voltarei as sete e trinta pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e trinta pm", @@ -631,7 +631,7 @@ }, { "Input": "Voltarei as sete e trinta e cinco pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e trinta e cinco pm", @@ -652,7 +652,7 @@ }, { "Input": "Voltarei as onze e cinco pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "onze e cinco pm", @@ -673,7 +673,7 @@ }, { "Input": "Voltarei 340pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "340pm", @@ -694,7 +694,7 @@ }, { "Input": "Voltarei 1140 a.m.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "1140 a.m.", @@ -715,7 +715,7 @@ }, { "Input": "Voltarei as 7:56:13 pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "7:56:13 pm", @@ -736,7 +736,7 @@ }, { "Input": "Voltarei as 12:34:45 ", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "12:34:45", @@ -757,7 +757,7 @@ }, { "Input": "Voltarei a tarde as 7:00:25", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "a tarde as 7:00:25", @@ -778,7 +778,7 @@ }, { "Input": "Voltarei as sete e trinta am", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "sete e trinta am", @@ -799,7 +799,7 @@ }, { "Input": "Voltarei as onze e cinco", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "onze e cinco", @@ -820,7 +820,7 @@ }, { "Input": "Voltarei de 3 min para as cinco", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 min para as cinco", @@ -841,7 +841,7 @@ }, { "Input": "Voltarei as cinco e meia da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "cinco e meia da tarde", @@ -862,7 +862,7 @@ }, { "Input": "Voltarei à tarde às cinco e trinta", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "à tarde às cinco e trinta", @@ -883,7 +883,6 @@ }, { "Input": "Voltarei às 7h01", - "NotSupported": "python", "Results": [ { "Text": "7h01", @@ -904,7 +903,6 @@ }, { "Input": "Voltarei às 10h10 pm.", - "NotSupported": "python", "Results": [ { "Text": "10h10 pm", diff --git a/Specs/DateTime/Portuguese/TimePeriodExtractor.json b/Specs/DateTime/Portuguese/TimePeriodExtractor.json index 404f3fef00..36bcd3ca78 100644 --- a/Specs/DateTime/Portuguese/TimePeriodExtractor.json +++ b/Specs/DateTime/Portuguese/TimePeriodExtractor.json @@ -1,7 +1,7 @@ [ { "Input": "Estarei fora de 5 a 6pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6pm", @@ -13,7 +13,7 @@ }, { "Input": "Estarei fora das 5 as 6pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "das 5 as 6pm", @@ -25,7 +25,7 @@ }, { "Input": "Estarei fora de 5 as 6pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 as 6pm", @@ -37,7 +37,7 @@ }, { "Input": "Estarei fora das 5 até as 6pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "das 5 até as 6pm", @@ -49,7 +49,7 @@ }, { "Input": "Estarei fora de 5 a 6p.m.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6p.m.", @@ -61,7 +61,7 @@ }, { "Input": "Estarei fora de 5 a 6 da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6 da tarde", @@ -73,7 +73,7 @@ }, { "Input": "Estarei fora das 5 até as 6p.m.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "das 5 até as 6p.m.", @@ -85,7 +85,7 @@ }, { "Input": "Estarei fora entre as 5 e as 6p.m.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 5 e as 6p.m.", @@ -97,7 +97,7 @@ }, { "Input": "Estarei fora entre as 5 e 6p.m.", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 5 e 6p.m.", @@ -109,7 +109,7 @@ }, { "Input": "Estarei fora entre as 5 e as 6 da manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 5 e as 6 da manhã", @@ -121,7 +121,7 @@ }, { "Input": "Estarei fora entre as 5 e as seis da madrugada", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 5 e as seis da madrugada", @@ -133,7 +133,7 @@ }, { "Input": "Estarei fora desde as 4pm até as 5pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "desde as 4pm até as 5pm", @@ -145,7 +145,7 @@ }, { "Input": "Estarei fora das 4:00 até as 5pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4:00 até as 5pm", @@ -157,7 +157,7 @@ }, { "Input": "Estarei fora das 4:00 até as 7 em ponto", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4:00 até as 7 em ponto", @@ -169,7 +169,7 @@ }, { "Input": "Estarei fora de 3pm a sete e meia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 3pm a sete e meia", @@ -181,7 +181,7 @@ }, { "Input": "Estarei fora 4pm-5pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4pm-5pm", @@ -193,7 +193,7 @@ }, { "Input": "Estarei fora 4pm - 5pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4pm - 5pm", @@ -205,7 +205,7 @@ }, { "Input": "Estarei fora de 4pm a 5pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4pm a 5pm", @@ -217,7 +217,7 @@ }, { "Input": "Estarei fora de 4pm a cinco e meia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4pm a cinco e meia", @@ -229,7 +229,7 @@ }, { "Input": "Estarei fora de 4pm a cinco e trinta", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 4pm a cinco e trinta", @@ -241,7 +241,7 @@ }, { "Input": "Estarei fora de 3 da manhã até as 5pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 3 da manhã até as 5pm", @@ -253,7 +253,7 @@ }, { "Input": "Estarei fora das 3 da madrugada até as cinco da tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 da madrugada até as cinco da tarde", @@ -265,7 +265,7 @@ }, { "Input": "Estarei fora entre as 4pm e as cinco e meia", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 4pm e as cinco e meia", @@ -277,7 +277,7 @@ }, { "Input": "Estarei fora entre as 3 da manhã e as 5pm", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 3 da manhã e as 5pm", @@ -289,7 +289,7 @@ }, { "Input": "Nos vemos de manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "manhã", @@ -301,7 +301,7 @@ }, { "Input": "Nos vemos pela manhã", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "manhã", @@ -313,7 +313,7 @@ }, { "Input": "Nos vemos pela tarde", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "tarde", @@ -325,7 +325,7 @@ }, { "Input": "Te vejo à noite", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "noite", @@ -337,7 +337,7 @@ }, { "Input": "Nos vemos de madrugada", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "madrugada", @@ -349,7 +349,7 @@ }, { "Input": "Nos vemos na madrugada", - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "madrugada", diff --git a/Specs/DateTime/Portuguese/TimePeriodParser.json b/Specs/DateTime/Portuguese/TimePeriodParser.json index bd3bd72f16..13e155a4cb 100644 --- a/Specs/DateTime/Portuguese/TimePeriodParser.json +++ b/Specs/DateTime/Portuguese/TimePeriodParser.json @@ -4,7 +4,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6pm", @@ -30,7 +30,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a 6p.m.", @@ -56,7 +56,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "de 5 a sete da manhã", @@ -82,7 +82,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "das 5 até as 6 pm", @@ -108,7 +108,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 5 e 6pm", @@ -134,7 +134,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre 5pm e 6pm", @@ -160,7 +160,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 5 e 6 da tarde", @@ -186,7 +186,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "das 4pm até 5pm", @@ -212,7 +212,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4:00 até as 7 em ponto", @@ -238,7 +238,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4pm-5pm", @@ -264,7 +264,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "4pm - 5pm", @@ -290,7 +290,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "3 da manhã até as 5pm", @@ -316,7 +316,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 3 da madrugada e as 5pm", @@ -342,7 +342,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "entre as 4pm e 5pm", @@ -394,7 +394,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "manhã", @@ -420,7 +420,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "depois do meio dia", @@ -472,7 +472,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "tarde", @@ -498,7 +498,7 @@ "Context": { "ReferenceDateTime": "2016-11-07T16:12:00" }, - "NotSupported": "javascript, python", + "NotSupported": "javascript", "Results": [ { "Text": "manhã", From 3e520e5d94753c005db17c3e60aa20217dc5a8d6 Mon Sep 17 00:00:00 2001 From: aitelint <53436544+aitelint@users.noreply.github.com> Date: Fri, 11 Mar 2022 10:15:33 +0700 Subject: [PATCH 4/9] [KO Number] Fixed incorrect extraction of number from datetime mention (#2863) (#2892) Co-authored-by: aitelint --- .../Korean/NumbersDefinitions.cs | 4 ++-- Patterns/Korean/Korean-Numbers.yaml | 4 ++-- Specs/Number/Korean/NumberModel.json | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/Korean/NumbersDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/Korean/NumbersDefinitions.cs index 8f6679e37c..33ef3241df 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/Korean/NumbersDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/Korean/NumbersDefinitions.cs @@ -168,7 +168,7 @@ public static class NumbersDefinitions public const string PercentageRegex = @"(?<=백\s*분\s*의).+|.+(?=퍼\s*센\s*트*)|.*(?=[%%])|.+(?=프\s*로*)"; public static readonly string DoubleAndRoundRegex = $@"{ZeroToNineFullHalfRegex}+(\.{ZeroToNineFullHalfRegex}+)?{RoundNumberIntegerRegex}{{1,2}}(\s*(이상))?"; public const string FracSplitRegex = @"(와|과|분\s*의|중)"; - public const string ZeroToNineIntegerRegex = @"(영|령|공|(? Date: Sat, 12 Mar 2022 07:52:33 +0100 Subject: [PATCH 5/9] [.NET Timexlib] Fix timex-to-string conversion of English ordinals 11-13 (#2896) --- .../TestTimex.cs | 11 +++++++++++ .../English/TimexConvertEnglish.cs | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimex.cs b/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimex.cs index 63e30ba63c..1b890c29a0 100644 --- a/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimex.cs +++ b/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimex.cs @@ -127,6 +127,17 @@ public void DataTypes_Timex_FromTime() Assert.AreEqual("T23:59:30", TimexProperty.FromTime(new Time(23, 59, 30)).TimexValue); } + [TestMethod] + public void DataTypes_Timex_FromDateTime_ToString() + { + var timex = new TimexProperty("2022-03-11"); + Assert.AreEqual("11th March 2022", timex.ToString()); + timex = new TimexProperty("2022-03-12"); + Assert.AreEqual("12th March 2022", timex.ToString()); + timex = new TimexProperty("2022-03-13"); + Assert.AreEqual("13th March 2022", timex.ToString()); + } + private static void Roundtrip(string timex) { Assert.AreEqual(timex, new TimexProperty(timex).TimexValue); diff --git a/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/English/TimexConvertEnglish.cs b/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/English/TimexConvertEnglish.cs index d651f858bf..b57f023770 100644 --- a/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/English/TimexConvertEnglish.cs +++ b/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/English/TimexConvertEnglish.cs @@ -97,7 +97,10 @@ public static string ConvertDate(TimexProperty timex) } var date = timex.DayOfMonth.Value.ToString(CultureInfo.InvariantCulture); - var abbreviation = TimexConstantsEnglish.DateAbbreviation[int.Parse(date[date.Length - 1].ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture)]; + var dayOfMonth = int.Parse(date, CultureInfo.InvariantCulture); + + // Ordinals 11 to 13 are special in english as they end in th + var abbreviation = TimexConstantsEnglish.DateAbbreviation[(dayOfMonth is > 9 and < 14 ? 9 : dayOfMonth) % 10]; if (timex.Month != null) { From 45b0c3bf3148c350701755a1b66dbb7cd62f25f0 Mon Sep 17 00:00:00 2001 From: Andreia Gaita Date: Mon, 14 Mar 2022 12:51:18 +0100 Subject: [PATCH 6/9] [EN .NET] Workaround for TimexProperty.ToString() to not crash on DateTimeRanges (#2894) * Workaround for TimexProperty.ToString() to not crash on DateTimeRanges * Add TODO for fixing the TimexProperty date range representation properly according to review --- .../TestTimex.cs | 8 +++++++ .../English/TimexConvertEnglish.cs | 23 +++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimex.cs b/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimex.cs index 1b890c29a0..0aacb5a9f6 100644 --- a/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimex.cs +++ b/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimex.cs @@ -138,6 +138,14 @@ public void DataTypes_Timex_FromDateTime_ToString() Assert.AreEqual("13th March 2022", timex.ToString()); } + [TestMethod] + public void DataTypes_Timex_FromDateTimeRange_ToString() + { + // TODO: This test documents a workaround to avoid exceptions when calling TimexProperty.ToString(). Proper fix for date range representation is needed. + var timex = new TimexProperty("(2022-03-15T16,2022-03-15T18,PT2H)"); + Assert.AreEqual("15th March 2022 4PM", timex.ToString()); + } + private static void Roundtrip(string timex) { Assert.AreEqual(timex, new TimexProperty(timex).TimexValue); diff --git a/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/English/TimexConvertEnglish.cs b/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/English/TimexConvertEnglish.cs index b57f023770..cf75fc76c4 100644 --- a/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/English/TimexConvertEnglish.cs +++ b/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/English/TimexConvertEnglish.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Globalization; namespace Microsoft.Recognizers.Text.DataTypes.TimexExpression @@ -216,9 +217,27 @@ private static string ConvertDateTime(TimexProperty timex) private static string ConvertDateTimeRange(TimexProperty timex) { - if (timex.Types.Contains(Constants.TimexTypes.TimeRange)) + var parts = new List(); + + var types = timex.Types; + if (types.Contains(Constants.TimexTypes.Date)) + { + parts.Add(ConvertDate(timex)); + } + + if (types.Contains(Constants.TimexTypes.Time)) + { + parts.Add(ConvertTime(timex)); + } + + if (timex.PartOfDay is not null) + { + parts.Add(ConvertTimeRange(timex)); + } + + if (parts.Count > 0) { - return $"{ConvertDate(timex)} {ConvertTimeRange(timex)}"; + return string.Join(" ", parts); } // date + time + duration From 22f56fdb16901de379d24c599e46fae460dffb74 Mon Sep 17 00:00:00 2001 From: kevinwalshgen Date: Fri, 10 Jun 2022 16:33:51 +0100 Subject: [PATCH 7/9] NLU-2966: Fix failing tests --- .../datatypes_timex_expression/timex_helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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..f868f84f8d 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 @@ -164,9 +164,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 From c544eff6b6306f0cafc860047e300fc567f453d9 Mon Sep 17 00:00:00 2001 From: kevinwalshgen Date: Fri, 10 Jun 2022 16:36:13 +0100 Subject: [PATCH 8/9] Revert "NLU-2966: Fix failing tests" This reverts commit 22f56fdb16901de379d24c599e46fae460dffb74. --- .../datatypes_timex_expression/timex_helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 f868f84f8d..07fbf5a3ef 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 @@ -164,9 +164,9 @@ def timex_datetime_add(start, duration): @staticmethod def date_from_timex(timex): return date( - 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 + 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 ) @staticmethod From f11024b565c381959f83ccc791122550de410e60 Mon Sep 17 00:00:00 2001 From: Andrew Gradinari Date: Thu, 13 Apr 2023 15:04:05 +0100 Subject: [PATCH 9/9] Fix for German invalid dates --- .../German/DateTimeDefinitions.cs | 2 +- .../datetime/resources/GermanDateTime.java | 2 +- Patterns/German/German-DateTime.yaml | 2 +- .../resources/german_date_time.py | 2 +- Specs/DateTime/German/DateExtractor.json | 11 ++++ .../DateTime/German/DatePeriodExtractor.json | 16 +++++- Specs/DateTime/German/DateTimeModel.json | 52 +++++++++++++++++-- 7 files changed, 78 insertions(+), 9 deletions(-) diff --git a/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs b/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs index 379d2710f5..d10b0c09e0 100644 --- a/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs +++ b/.NET/Microsoft.Recognizers.Definitions.Common/German/DateTimeDefinitions.cs @@ -104,7 +104,7 @@ public static class DateTimeDefinitions public static readonly string DateExtractor4 = $@"\b({DayRegex}\s*{MonthNumRegex}\s*{DateYearRegex})\b"; public static readonly string DateExtractor5 = $@"\b(({WeekDayRegex})(\s+|\s*,\s*))?({DayRegex}\s*[/\\\-\.]\s*({MonthNumRegex}|{MonthRegex})\s*[/\\\-\.]\s*{DateYearRegex})\b(?!\s*[/\\\-\.]\s*\d+)"; public static readonly string DateExtractor6 = $@"^[.]"; - public static readonly string DateExtractor7 = $@"({DayRegex}\s*[\.]\s*{MonthNumRegex}[\.]){BaseDateTime.CheckDecimalRegex}"; + public static readonly string DateExtractor7 = $@"\b({DayRegex}\s*[\.]\s*{MonthNumRegex}[\.]){BaseDateTime.CheckDecimalRegex}"; public static readonly string DateExtractor8 = $@"(?<=\b(am)\s+){DayRegex}[/\\\.]{MonthNumRegex}([/\\\.]{DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\b"; public static readonly string DateExtractor9 = $@"\b({DayRegex}\s*/\s*{MonthNumRegex}((\s+|\s*,\s*){DateYearRegex})?){BaseDateTime.CheckDecimalRegex}\b"; public static readonly string DateExtractor10 = $@"^[.]"; diff --git a/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/GermanDateTime.java b/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/GermanDateTime.java index beae66f3eb..d695fb8a75 100644 --- a/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/GermanDateTime.java +++ b/Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/resources/GermanDateTime.java @@ -276,7 +276,7 @@ public class GermanDateTime { public static final String DateExtractor6 = "^[.]" .replace("{WeekDayRegex}", WeekDayRegex); - public static final String DateExtractor7 = "({DayRegex}\\s*[\\.]\\s*{MonthNumRegex}[\\.]){BaseDateTime.CheckDecimalRegex}" + public static final String DateExtractor7 = "\\b({DayRegex}\\s*[\\.]\\s*{MonthNumRegex}[\\.]){BaseDateTime.CheckDecimalRegex}" .replace("{MonthNumRegex}", MonthNumRegex) .replace("{DayRegex}", DayRegex) .replace("{BaseDateTime.CheckDecimalRegex}", BaseDateTime.CheckDecimalRegex); diff --git a/Patterns/German/German-DateTime.yaml b/Patterns/German/German-DateTime.yaml index 410ad403fd..88d4e28224 100644 --- a/Patterns/German/German-DateTime.yaml +++ b/Patterns/German/German-DateTime.yaml @@ -218,7 +218,7 @@ DateExtractor6: !nestedRegex def: ^[.] references: [ WeekDayRegex ] DateExtractor7: !nestedRegex - def: ({DayRegex}\s*[\.]\s*{MonthNumRegex}[\.]){BaseDateTime.CheckDecimalRegex} + def: \b({DayRegex}\s*[\.]\s*{MonthNumRegex}[\.]){BaseDateTime.CheckDecimalRegex} references: [ MonthNumRegex, DayRegex, BaseDateTime.CheckDecimalRegex ] DateExtractor8: !nestedRegex def: (?<=\b(am)\s+){DayRegex}[/\\\.]{MonthNumRegex}([/\\\.]{DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\b diff --git a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/german_date_time.py b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/german_date_time.py index 7c6db72999..d7fc777ef6 100644 --- a/Python/libraries/recognizers-date-time/recognizers_date_time/resources/german_date_time.py +++ b/Python/libraries/recognizers-date-time/recognizers_date_time/resources/german_date_time.py @@ -97,7 +97,7 @@ class GermanDateTime: DateExtractor4 = f'\\b({DayRegex}\\s*{MonthNumRegex}\\s*{DateYearRegex})\\b' DateExtractor5 = f'\\b(({WeekDayRegex})(\\s+|\\s*,\\s*))?({DayRegex}\\s*[/\\\\\\-\\.]\\s*({MonthNumRegex}|{MonthRegex})\\s*[/\\\\\\-\\.]\\s*{DateYearRegex})\\b(?!\\s*[/\\\\\\-\\.]\\s*\\d+)' DateExtractor6 = f'^[.]' - DateExtractor7 = f'({DayRegex}\\s*[\\.]\\s*{MonthNumRegex}[\\.]){BaseDateTime.CheckDecimalRegex}' + DateExtractor7 = f'\\b({DayRegex}\\s*[\\.]\\s*{MonthNumRegex}[\\.]){BaseDateTime.CheckDecimalRegex}' DateExtractor8 = f'(?<=\\b(am)\\s+){DayRegex}[/\\\\\\.]{MonthNumRegex}([/\\\\\\.]{DateYearRegex})?{BaseDateTime.CheckDecimalRegex}\\b' DateExtractor9 = f'\\b({DayRegex}\\s*/\\s*{MonthNumRegex}((\\s+|\\s*,\\s*){DateYearRegex})?){BaseDateTime.CheckDecimalRegex}\\b' DateExtractor10 = f'^[.]' diff --git a/Specs/DateTime/German/DateExtractor.json b/Specs/DateTime/German/DateExtractor.json index 3ca097d27a..96303d29bd 100644 --- a/Specs/DateTime/German/DateExtractor.json +++ b/Specs/DateTime/German/DateExtractor.json @@ -350,5 +350,16 @@ "Length": 26 } ] + }, + { + "Input": "Mein Geburtsdatum ist der 22.04.1990", + "Results": [ + { + "Text": "der 22.04.1990", + "Type": "date", + "Start": 22, + "Length": 14 + } + ] } ] diff --git a/Specs/DateTime/German/DatePeriodExtractor.json b/Specs/DateTime/German/DatePeriodExtractor.json index b229fabe32..d703399275 100644 --- a/Specs/DateTime/German/DatePeriodExtractor.json +++ b/Specs/DateTime/German/DatePeriodExtractor.json @@ -757,7 +757,7 @@ }, { "Input": "Zeigen Sie mir die Aufzeichnungen vom August 99", - "NotSupportedByDesign": "javascript", + "NotSupported": "javascript", "Results": [ { "Text": "August 99", @@ -766,5 +766,17 @@ "Length": 9 } ] + }, + { + "Input": "Ich komme am 32.04.2023 wieder.", + "NotSupported": "javascript", + "Results": [ + { + "Text": "04.2023", + "Type": "daterange", + "Start": 16, + "Length": 7 + } + ] } -] \ No newline at end of file +] diff --git a/Specs/DateTime/German/DateTimeModel.json b/Specs/DateTime/German/DateTimeModel.json index 2ecb46680f..7c6b8eca9f 100644 --- a/Specs/DateTime/German/DateTimeModel.json +++ b/Specs/DateTime/German/DateTimeModel.json @@ -286,7 +286,6 @@ "Context": { "ReferenceDateTime": "2016-11-07T00:00:00" }, - "NotSupported": "python", "Results": [ { "Text": "vom 12. januar 2016 bis zum 22.01.2016", @@ -3910,7 +3909,7 @@ "Context": { "ReferenceDateTime": "2018-11-07T00:00:00" }, - "NotSupported": "java, javascript, python", + "NotSupported": "java, javascript", "Results": [ { "Text": "so 27.02.2022", @@ -5604,5 +5603,52 @@ } } ] + }, + { + "Input": "Ich komme am 32.04.2023 wieder.", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "04.2023", + "Start": 16, + "End": 22, + "TypeName": "datetimeV2.daterange", + "Resolution": { + "values": [ + { + "timex": "2023-04", + "type": "daterange", + "start": "2023-04-01", + "end": "2023-05-01" + } + ] + } + } + ] + }, + { + "Input": "Mein Geburtsdatum ist der 22.04.1990", + "Context": { + "ReferenceDateTime": "2016-11-07T00:00:00" + }, + "Results": [ + { + "Text": "der 22.04.1990", + "Start": 22, + "End": 35, + "TypeName": "datetimeV2.date", + "Resolution": { + "values": [ + { + "timex": "1990-04-22", + "type": "date", + "value": "1990-04-22" + } + ] + } + } + ] } -] \ No newline at end of file +]