@@ -51,7 +51,7 @@ public static class DateTimeDefinitions
5151 public const string RelativeMonthRegex = @"(?<relmonth>(de\s+)?((este|pr[oó]ximo|([uú]ltim(o|as|os)))\s+mes)|(del\s+)?(mes\s+((que\s+viene)|pasado)))\b" ;
5252 public const string MonthRegex = @"\b(?<month>abr(\.|(il)?\b)|ago(\.|(sto)?\b)|dic(\.|(iembre)?\b)|feb(\.|(rero)?\b)|ene(\.|(ro)?\b)|ju[ln](\.|(io)?\b)|mar(\.|(zo)?\b)|may(\.|(o)?\b)|nov(\.|(iembre)?\b)|oct(\.|(ubre)?\b)|sep?t(\.|(iembre)?\b)|sep(\.|\b))" ;
5353 public static readonly string MonthSuffixRegex = $@ "(?<msuf>((del?|la|el)\s+)?({ RelativeMonthRegex } |{ MonthRegex } ))";
54- public const string DateUnitRegex = @"(?<unit>(año |(?<uoy>semana))(?<plural>s)?|(?<uoy>mes)(?<plural>es)?|(?<uoy>d[ií]a)(?<plural>s)?(?<business>\s+(h[aá]biles|laborales))?)\b" ;
54+ public const string DateUnitRegex = @"(?<unit>(a[nñ]o |(?<uoy>semana))(?<plural>s)?|(?<uoy>mes)(?<plural>es)?|(?<uoy>d[ií]a)(?<plural>s)?(?<business>\s+(h[aá]biles|laborales))?)\b" ;
5555 public const string PastRegex = @"(?<past>\b(pasad(a|o)(s)?|[uú]ltim[oa](s)?|anterior(es)?|previo(s)?)\b)" ;
5656 public const string FutureRegex = @"\b(siguiente(s)?|pr[oó]xim[oa](s)?)\b" ;
5757 public static readonly string SimpleCasesRegex = $@ "\b((desde(\s+el)?|entre|del?)\s+)?({ DayRegex } )\s*{ TillRegex } \s*({ DayRegex } )\s+{ MonthSuffixRegex } ((\s+|\s*,\s*)((en|del?)\s+)?{ YearRegex } )?\b";
@@ -83,7 +83,7 @@ public static class DateTimeDefinitions
8383 public static readonly string WhichWeekRegex = $@ "\b(semana)(\s*)(?<number>5[0-3]|[1-4]\d|0?[1-9])(\s+del?\s+({ YearRegex } |(?<order>pr[oó]ximo|[uú]ltimo|este)\s+año|año\s+(?<order>pasado)))?\b";
8484 public static readonly string WeekOfRegex = $@ "((del?|el|la)\s+)?(semana)(\s*)({ OfPrepositionRegex } |que\s+(inicia|comienza)\s+el|(que\s+va|a\s+partir)\s+del)";
8585 public static readonly string MonthOfRegex = $@ "(mes)(\s+)({ OfPrepositionRegex } )";
86- public const string RangeUnitRegex = @"\b(?<unit>años ?|mes(es)?|semanas?)\b" ;
86+ public const string RangeUnitRegex = @"\b(?<unit>a[nñ]os ?|mes(es)?|semanas?)\b" ;
8787 public const string BeforeAfterRegex = @"^[.]" ;
8888 public const string InConnectorRegex = @"\b(en)(?=\s*$)\b" ;
8989 public const string TodayNowRegex = @"\b(hoy|ahora|este entonces)\b" ;
@@ -178,7 +178,7 @@ public static class DateTimeDefinitions
178178 public const string DateTimeTimeOfDayRegex = @"\b(?<timeOfDay>mañana|madrugada|(?<pm>pasado\s+(el\s+)?medio\s?d[ií]a|tarde|noche))\b" ;
179179 public static readonly string PeriodTimeOfDayRegex = $@ "\b((en\s+(el|la|lo)?\s+)?({ LaterEarlyRegex } \s+)?(est[ae]\s+)?{ DateTimeTimeOfDayRegex } )\b";
180180 public static readonly string PeriodSpecificTimeOfDayRegex = $@ "\b(({ LaterEarlyRegex } \s+)?est[ae]\s+{ DateTimeTimeOfDayRegex } |({ StrictRelativeRegex } \s+{ PeriodTimeOfDayRegex } )|anoche)\b";
181- public const string UnitRegex = @"(?<unit>años ?|(bi|tri|cuatri|se)mestre|mes(es)?|semanas?|fin(es)?\s+de\s+semana|finde|d[ií]as?|horas?|hra?s?|hs?|minutos?|mins?|segundos?|segs?|noches?)\b" ;
181+ public const string UnitRegex = @"(?<unit>a[nñ]os ?|(bi|tri|cuatri|se)mestre|mes(es)?|semanas?|fin(es)?\s+de\s+semana|finde|d[ií]as?|horas?|hra?s?|hs?|minutos?|mins?|segundos?|segs?|noches?)\b" ;
182182 public const string ConnectorRegex = @"^(,|t|(para|y|a|en|por) las?|(\s*,\s*)?((cerca|alrededor)\s+)?(de\s+las?|del))$" ;
183183 public const string TimeHourNumRegex = @"(?<hour>veint(i(uno|dos|tres|cuatro)|e)|cero|uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieci(s([eé])is|siete|ocho|nueve))" ;
184184 public static readonly string PureNumFromTo = $@ "((\b(desde|de)\s+(la(s)?\s+)?)?({ BaseDateTime . HourRegex } |{ TimeHourNumRegex } )(?!\s+al?\b)(\s*(?<leftDesc>{ DescRegex } ))?|(\b(desde|de)\s+(la(s)?\s+)?)({ BaseDateTime . HourRegex } |{ TimeHourNumRegex } )(\s*(?<leftDesc>{ DescRegex } ))?)\s*{ TillRegex } \s*({ BaseDateTime . HourRegex } |{ TimeHourNumRegex } )\s*(?<rightDesc>{ PmRegex } |{ AmRegex } |{ DescRegex } )?";
@@ -225,14 +225,14 @@ public static class DateTimeDefinitions
225225 public const string MiddlePauseRegex = @"^[.]" ;
226226 public const string PrefixArticleRegex = @"\b(e[ln]\s+(d[ií]a\s+)?)" ;
227227 public const string OrRegex = @"^[.]" ;
228- public static readonly string SpecialYearTermsRegex = $@ "\b(({ SpecialYearPrefixes } \s+años ?\s+|años ?\s+({ SpecialYearPrefixes } \s+)?)(de\s+)?)";
228+ public static readonly string SpecialYearTermsRegex = $@ "\b(({ SpecialYearPrefixes } \s+a[nñ]os ?\s+|a[nñ]os ?\s+({ SpecialYearPrefixes } \s+)?)(de\s+)?)";
229229 public static readonly string YearPlusNumberRegex = $@ "\b({ SpecialYearTermsRegex } ((?<year>(\d{{2,4}}))|{ FullTextYearRegex } ))\b";
230230 public static readonly string NumberAsTimeRegex = $@ "\b({ WrittenTimeRegex } |{ HourRegex } (?<desc>\s*h(oras)?)?)\b";
231231 public static readonly string TimeBeforeAfterRegex = $@ "\b((?<=\b(antes|no\s+m[aá]s\s+tard(e|ar)\s+(de|a\s+las?)|por| después)\s+)({ WrittenTimeRegex } |{ HourNumRegex } |{ BaseDateTime . HourRegex } |{ MidTimeRegex } ))\b";
232232 public const string DateNumberConnectorRegex = @"^\s*(?<connector>a\s+las)\s*$" ;
233233 public const string CenturyRegex = @"^[.]" ;
234234 public const string DecadeRegex = @"(?<decade>diez|veinte|treinta|cuarenta|cincuenta|se[st]enta|ochenta|noventa)" ;
235- public static readonly string DecadeWithCenturyRegex = $@ "(los\s+)?((((d[ée]cada(\s+de)?)\s+)(((?<century>\d|1\d|2\d)?(?<decade>\d0))))|a[ñn]os\s+(((( dos\s+)?mil\s+)?({ WrittenOneHundredToNineHundredRegex } \s+)?{ DecadeRegex } )|(( dos\s+)?mil\s+)?({ WrittenOneHundredToNineHundredRegex } )(\s+{ DecadeRegex } ?)|(( dos\s+)?mil)(\s+{ WrittenOneHundredToNineHundredRegex } \s+)?{ DecadeRegex } ?))";
235+ public static readonly string DecadeWithCenturyRegex = $@ "(los\s+)?((((d[ée]cada(\s+de)?)\s+)(((?<century>\d|1\d|2\d)?(?<decade>\d0))))|a[ñn]os\s+((?<century>\d|1\d|2\d)?(?<decade>\d0)\b)|a[ñn]os\s+(((?<century>(( dos\s+)?mil\s+)?({ WrittenOneHundredToNineHundredRegex } \s+)?)? { DecadeRegex } )|(?<century>(( dos\s+)?mil\s+)?({ WrittenOneHundredToNineHundredRegex } )) (\s+{ DecadeRegex } ?)|(?<century>(( dos\s+)?mil)(\s+{ WrittenOneHundredToNineHundredRegex } \s+)?) { DecadeRegex } ?))";
236236 public static readonly string RelativeDecadeRegex = $@ "\b(((el|las?)\s+)?{ RelativeRegex } \s+((?<number>[\w,]+)\s+)?(d[eé]cada|decenio)s?)\b";
237237 public static readonly string ComplexDatePeriodRegex = $@ "(?:((de(sde)?)\s+)?(?<start>.+)\s*({ StrictTillRegex } )\s*(?<end>.+)|((entre)\s+)(?<start>.+)\s*({ RangeConnectorRegex } )\s*(?<end>.+))";
238238 public const string AmbiguousPointRangeRegex = @"^(mar\.?)$" ;
@@ -245,6 +245,8 @@ public static class DateTimeDefinitions
245245 {
246246 { @"años" , @"Y" } ,
247247 { @"año" , @"Y" } ,
248+ { @"anos" , @"Y" } ,
249+ { @"ano" , @"Y" } ,
248250 { @"meses" , @"MON" } ,
249251 { @"mes" , @"MON" } ,
250252 { @"trimestre" , @"3MON" } ,
@@ -287,6 +289,8 @@ public static class DateTimeDefinitions
287289 {
288290 { @"años" , 31536000 } ,
289291 { @"año" , 31536000 } ,
292+ { @"anos" , 31536000 } ,
293+ { @"ano" , 31536000 } ,
290294 { @"meses" , 2592000 } ,
291295 { @"mes" , 2592000 } ,
292296 { @"semanas" , 604800 } ,
@@ -639,7 +643,15 @@ public static class DateTimeDefinitions
639643 public static readonly string ModSuffixRegex = $@ "\b({ AgoRegex } |{ LaterRegex } |{ BeforeAfterRegex } |{ FutureSuffixRegex } |{ PastSuffixRegex } )\b";
640644 public static readonly Dictionary < string , int > WrittenDecades = new Dictionary < string , int >
641645 {
642- { @"" , 0 }
646+ { @"diez" , 10 } ,
647+ { @"veinte" , 20 } ,
648+ { @"treinta" , 30 } ,
649+ { @"cuarenta" , 40 } ,
650+ { @"cincuenta" , 50 } ,
651+ { @"sesenta" , 60 } ,
652+ { @"setenta" , 70 } ,
653+ { @"ochenta" , 80 } ,
654+ { @"noventa" , 90 }
643655 } ;
644656 public static readonly Dictionary < string , int > SpecialDecadeCases = new Dictionary < string , int >
645657 {
@@ -747,7 +759,9 @@ public static class DateTimeDefinitions
747759 public static readonly IList < string > YearTerms = new List < string >
748760 {
749761 @"año" ,
750- @"años"
762+ @"años" ,
763+ @"ano" ,
764+ @"anos"
751765 } ;
752766 public static readonly IList < string > YearToDateTerms = new List < string >
753767 {
@@ -770,7 +784,7 @@ public static class DateTimeDefinitions
770784 public const string MonthTypeRegex = @"(mes(es)?|mensual(es|mente)?)$" ;
771785 public const string QuarterTypeRegex = @"(trimestral(es|mente)?)$" ;
772786 public const string SemiAnnualTypeRegex = @"(semestral(es|mente)?)$" ;
773- public const string YearTypeRegex = @"(años ?|anual(mente)?)$" ;
787+ public const string YearTypeRegex = @"(a[nñ]os ?|anual(mente)?)$" ;
774788 public static readonly IList < string > ThisTerms = new List < string >
775789 {
776790 @"esta"
0 commit comments