Skip to content

Commit

Permalink
Fix DateTime bug in all platform and add specs (#1544)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuying Zhu authored and tellarin committed Apr 25, 2019
1 parent aa3002e commit d8d4c28
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static class NumbersDefinitions
public const string NumberOrdinalRegex = @"(first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|thirtieth|fortieth|fiftieth|sixtieth|seventieth|eightieth|ninetieth)";
public const string RelativeOrdinalRegex = @"((next|previous) one|(the second|next) to last|the one before the last( one)?|the last but one|(ante)?penultimate|last|next|previous)";
public static readonly string BasicOrdinalRegex = $@"({NumberOrdinalRegex}|{RelativeOrdinalRegex})";
public static readonly string RelativeOrdinalFilterRegex = $@"(?<!-)(first|{RelativeOrdinalRegex})\s*({TwoToNineIntegerRegex}|[2-9]+)";
public static readonly string RelativeOrdinalFilterRegex = $@"(?<!-)(first|{RelativeOrdinalRegex})\s*({TwoToNineIntegerRegex}|[2-9]+)(?!\s*{RoundNumberIntegerRegex})";
public static readonly string SuffixBasicOrdinalRegex = $@"((((({TensNumberIntegerRegex}(\s+(and\s+)?|\s*-\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{AnIntRegex})(\s+{RoundNumberIntegerRegex})+)\s+(and\s+)?)*({TensNumberIntegerRegex}(\s+|\s*-\s*))?{BasicOrdinalRegex})";
public static readonly string SuffixRoundNumberOrdinalRegex = $@"(({AllIntRegex}\s+){RoundNumberOrdinalRegex})";
public static readonly string AllOrdinalRegex = $@"({SuffixBasicOrdinalRegex}|{SuffixRoundNumberOrdinalRegex})";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ public static String NumbersWithPlaceHolder(String placeholder) {
.replace("{NumberOrdinalRegex}", NumberOrdinalRegex)
.replace("{RelativeOrdinalRegex}", RelativeOrdinalRegex);

public static final String RelativeOrdinalFilterRegex = "(?<!-)(first|{RelativeOrdinalRegex})\\s*({TwoToNineIntegerRegex}|[2-9]+)"
public static final String RelativeOrdinalFilterRegex = "(?<!-)(first|{RelativeOrdinalRegex})\\s*({TwoToNineIntegerRegex}|[2-9]+)(?!\\s*{RoundNumberIntegerRegex})"
.replace("{RelativeOrdinalRegex}", RelativeOrdinalRegex)
.replace("{TwoToNineIntegerRegex}", TwoToNineIntegerRegex);
.replace("{TwoToNineIntegerRegex}", TwoToNineIntegerRegex)
.replace("{RoundNumberIntegerRegex}", RoundNumberIntegerRegex);

public static final String SuffixBasicOrdinalRegex = "((((({TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{AnIntRegex})(\\s+{RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*({TensNumberIntegerRegex}(\\s+|\\s*-\\s*))?{BasicOrdinalRegex})"
.replace("{TensNumberIntegerRegex}", TensNumberIntegerRegex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static String DoubleWithoutIntegralRegex(String placeholder) {
public static final String DoubleAllFloatRegex = "((?<=\\b){AllFloatRegex}(?=\\b))"
.replace("{AllFloatRegex}", AllFloatRegex);

public static final String NumberWithSuffixPercentage = "(?<!%)({BaseNumbers.NumberReplaceToken})(\\s*)(%(?!{BaseNumbers.NumberReplaceToken})|prozent\\b)"
public static final String NumberWithSuffixPercentage = "(?<!%)({BaseNumbers.NumberReplaceToken})(\\s*)(%(?!{BaseNumbers.NumberReplaceToken})|prozent(punkte)?\\b)"
.replace("{BaseNumbers.NumberReplaceToken}", BaseNumbers.NumberReplaceToken);

public static final String NumberWithPrefixPercentage = "(Prozent)(\\s*)({BaseNumbers.NumberReplaceToken})"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ public static String NumbersWithPlaceHolder(String placeholder) {

public static final String SimpleRoundOrdinalRegex = "(mil[eé]simo|millon[eé]sim[oa]|billon[eé]sim[oa]|trillon[eé]sim[oa]|cuatrillon[eé]sim[oa]|quintillon[eé]sim[oa]|sextillon[eé]sim[oa]|septillon[eé]sim[oa])";

public static final String OneToNineOrdinalRegex = "(primer[oa]|segund[oa]|tercer[oa]|cuart[oa]|quint[oa]|sext[oa]|s[eé]ptim[oa]|octav[oa]|noven[oa])";
public static final String OneToNineOrdinalRegex = "(primer[oa]?|segund[oa]|tercer[oa]?|cuart[oa]|quint[oa]|sext[oa]|s[eé]ptim[oa]|octav[oa]|noven[oa])";

public static final String TensOrdinalRegex = "(nonag[eé]sim[oa]|octog[eé]sim[oa]|septuag[eé]sim[oa]|sexag[eé]sim[oa]|quincuag[eé]sim[oa]|cuadrag[eé]sim[oa]|trig[eé]sim[oa]|vig[eé]sim[oa]|d[eé]cim[oa])";

public static final String HundredOrdinalRegex = "(cent[eé]sim[oa]|ducent[eé]sim[oa]|tricent[eé]sim[oa]|cuadringent[eé]sim[oa]|quingent[eé]sim[oa]|sexcent[eé]sim[oa]|septingent[eé]sim[oa]|octingent[eé]sim[oa]|noningent[eé]sim[oa])";

public static final String SpecialUnderHundredOrdinalRegex = "(und[eé]cim[oa]|duod[eé]cimo|decimoctav[oa])";

public static final String UnderHundredOrdinalRegex = "((({TensOrdinalRegex}(\\s)?)?{OneToNineOrdinalRegex})|{TensOrdinalRegex}|{SpecialUnderHundredOrdinalRegex})"
public static final String UnderHundredOrdinalRegex = "({SpecialUnderHundredOrdinalRegex}|(({TensOrdinalRegex}(\\s)?)?{OneToNineOrdinalRegex})|{TensOrdinalRegex})"
.replace("{TensOrdinalRegex}", TensOrdinalRegex)
.replace("{OneToNineOrdinalRegex}", OneToNineOrdinalRegex)
.replace("{SpecialUnderHundredOrdinalRegex}", SpecialUnderHundredOrdinalRegex);
Expand Down Expand Up @@ -408,7 +408,9 @@ public static String DoubleWithoutIntegralRegex(String placeholder) {
.put("noveno", 9L)
.put("novena", 9L)
.put("decimo", 10L)
.put("décimo", 10L)
.put("decima", 10L)
.put("décima", 10L)
.put("undecimo", 11L)
.put("undecima", 11L)
.put("duodecimo", 12L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export namespace EnglishNumeric {
export const NumberOrdinalRegex = `(first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|thirtieth|fortieth|fiftieth|sixtieth|seventieth|eightieth|ninetieth)`;
export const RelativeOrdinalRegex = `((next|previous) one|(the second|next) to last|the one before the last( one)?|the last but one|(ante)?penultimate|last|next|previous)`;
export const BasicOrdinalRegex = `(${NumberOrdinalRegex}|${RelativeOrdinalRegex})`;
export const RelativeOrdinalFilterRegex = `(?<!-)(first|${RelativeOrdinalRegex})\\s*(${TwoToNineIntegerRegex}|[2-9]+)`;
export const RelativeOrdinalFilterRegex = `(?<!-)(first|${RelativeOrdinalRegex})\\s*(${TwoToNineIntegerRegex}|[2-9]+)(?!\\s*${RoundNumberIntegerRegex})`;
export const SuffixBasicOrdinalRegex = `(((((${TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${ZeroToNineIntegerRegex})|${TensNumberIntegerRegex}|${ZeroToNineIntegerRegex}|${AnIntRegex})(\\s+${RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*(${TensNumberIntegerRegex}(\\s+|\\s*-\\s*))?${BasicOrdinalRegex})`;
export const SuffixRoundNumberOrdinalRegex = `((${AllIntRegex}\\s+)${RoundNumberOrdinalRegex})`;
export const AllOrdinalRegex = `(${SuffixBasicOrdinalRegex}|${SuffixRoundNumberOrdinalRegex})`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export namespace SpanishNumeric {
export const AllIntRegexWithLocks = `((?<=\\b)${AllIntRegex}(?=\\b))`;
export const AllIntRegexWithDozenSuffixLocks = `(?<=\\b)(((media\\s+)?\\s+docena)|(${AllIntRegex}\\s+(y|con)\\s+)?(${AllIntRegex}\\s+docenas?))(?=\\b)`;
export const SimpleRoundOrdinalRegex = `(mil[eé]simo|millon[eé]sim[oa]|billon[eé]sim[oa]|trillon[eé]sim[oa]|cuatrillon[eé]sim[oa]|quintillon[eé]sim[oa]|sextillon[eé]sim[oa]|septillon[eé]sim[oa])`;
export const OneToNineOrdinalRegex = `(primer[oa]|segund[oa]|tercer[oa]|cuart[oa]|quint[oa]|sext[oa]|s[eé]ptim[oa]|octav[oa]|noven[oa])`;
export const OneToNineOrdinalRegex = `(primer[oa]?|segund[oa]|tercer[oa]?|cuart[oa]|quint[oa]|sext[oa]|s[eé]ptim[oa]|octav[oa]|noven[oa])`;
export const TensOrdinalRegex = `(nonag[eé]sim[oa]|octog[eé]sim[oa]|septuag[eé]sim[oa]|sexag[eé]sim[oa]|quincuag[eé]sim[oa]|cuadrag[eé]sim[oa]|trig[eé]sim[oa]|vig[eé]sim[oa]|d[eé]cim[oa])`;
export const HundredOrdinalRegex = `(cent[eé]sim[oa]|ducent[eé]sim[oa]|tricent[eé]sim[oa]|cuadringent[eé]sim[oa]|quingent[eé]sim[oa]|sexcent[eé]sim[oa]|septingent[eé]sim[oa]|octingent[eé]sim[oa]|noningent[eé]sim[oa])`;
export const SpecialUnderHundredOrdinalRegex = `(und[eé]cim[oa]|duod[eé]cimo|decimoctav[oa])`;
export const UnderHundredOrdinalRegex = `(((${TensOrdinalRegex}(\\s)?)?${OneToNineOrdinalRegex})|${TensOrdinalRegex}|${SpecialUnderHundredOrdinalRegex})`;
export const UnderHundredOrdinalRegex = `(${SpecialUnderHundredOrdinalRegex}|((${TensOrdinalRegex}(\\s)?)?${OneToNineOrdinalRegex})|${TensOrdinalRegex})`;
export const UnderThousandOrdinalRegex = `(((${HundredOrdinalRegex}(\\s)?)?${UnderHundredOrdinalRegex})|${HundredOrdinalRegex})`;
export const OverThousandOrdinalRegex = `((${AllIntRegex})([eé]sim[oa]))`;
export const ComplexOrdinalRegex = `((${OverThousandOrdinalRegex}(\\s)?)?${UnderThousandOrdinalRegex}|${OverThousandOrdinalRegex})`;
Expand Down Expand Up @@ -99,7 +99,7 @@ export namespace SpanishNumeric {
export const HalfADozenRegex = `media\\s+docena`;
export const DigitalNumberRegex = `((?<=\\b)(mil|millones|mill[oó]n|billones|bill[oó]n|trillones|trill[oó]n|docenas?)(?=\\b))|((?<=(\\d|\\b))${BaseNumbers.MultiplierLookupRegex}(?=\\b))`;
export const CardinalNumberMap: ReadonlyMap<string, number> = new Map<string, number>([["cero", 0],["un", 1],["una", 1],["uno", 1],["dos", 2],["tres", 3],["cuatro", 4],["cinco", 5],["seis", 6],["siete", 7],["ocho", 8],["nueve", 9],["diez", 10],["once", 11],["doce", 12],["docena", 12],["docenas", 12],["trece", 13],["catorce", 14],["quince", 15],["dieciseis", 16],["dieciséis", 16],["diecisiete", 17],["dieciocho", 18],["diecinueve", 19],["veinte", 20],["ventiuna", 21],["ventiuno", 21],["veintiun", 21],["veintiún", 21],["veintiuno", 21],["veintiuna", 21],["veintidos", 22],["veintidós", 22],["veintitres", 23],["veintitrés", 23],["veinticuatro", 24],["veinticinco", 25],["veintiseis", 26],["veintiséis", 26],["veintisiete", 27],["veintiocho", 28],["veintinueve", 29],["treinta", 30],["cuarenta", 40],["cincuenta", 50],["sesenta", 60],["setenta", 70],["ochenta", 80],["noventa", 90],["cien", 100],["ciento", 100],["doscientas", 200],["doscientos", 200],["trescientas", 300],["trescientos", 300],["cuatrocientas", 400],["cuatrocientos", 400],["quinientas", 500],["quinientos", 500],["seiscientas", 600],["seiscientos", 600],["setecientas", 700],["setecientos", 700],["ochocientas", 800],["ochocientos", 800],["novecientas", 900],["novecientos", 900],["mil", 1000],["millon", 1000000],["millón", 1000000],["millones", 1000000],["billon", 1000000000000],["billón", 1000000000000],["billones", 1000000000000],["trillon", 1000000000000000000],["trillón", 1000000000000000000],["trillones", 1000000000000000000]]);
export const OrdinalNumberMap: ReadonlyMap<string, number> = new Map<string, number>([["primero", 1],["primera", 1],["primer", 1],["segundo", 2],["segunda", 2],["medio", 2],["media", 2],["tercero", 3],["tercera", 3],["tercer", 3],["tercio", 3],["cuarto", 4],["cuarta", 4],["quinto", 5],["quinta", 5],["sexto", 6],["sexta", 6],["septimo", 7],["septima", 7],["octavo", 8],["octava", 8],["noveno", 9],["novena", 9],["decimo", 10],["decima", 10],["undecimo", 11],["undecima", 11],["duodecimo", 12],["duodecima", 12],["decimotercero", 13],["decimotercera", 13],["decimocuarto", 14],["decimocuarta", 14],["decimoquinto", 15],["decimoquinta", 15],["decimosexto", 16],["decimosexta", 16],["decimoseptimo", 17],["decimoseptima", 17],["decimoctavo", 18],["decimoctava", 18],["decimonoveno", 19],["decimonovena", 19],["vigesimo", 20],["vigesima", 20],["trigesimo", 30],["trigesima", 30],["cuadragesimo", 40],["cuadragesima", 40],["quincuagesimo", 50],["quincuagesima", 50],["sexagesimo", 60],["sexagesima", 60],["septuagesimo", 70],["septuagesima", 70],["octogesimo", 80],["octogesima", 80],["nonagesimo", 90],["nonagesima", 90],["centesimo", 100],["centesima", 100],["ducentesimo", 200],["ducentesima", 200],["tricentesimo", 300],["tricentesima", 300],["cuadringentesimo", 400],["cuadringentesima", 400],["quingentesimo", 500],["quingentesima", 500],["sexcentesimo", 600],["sexcentesima", 600],["septingentesimo", 700],["septingentesima", 700],["octingentesimo", 800],["octingentesima", 800],["noningentesimo", 900],["noningentesima", 900],["milesimo", 1000],["milesima", 1000],["millonesimo", 1000000],["millonesima", 1000000],["billonesimo", 1000000000000],["billonesima", 1000000000000]]);
export const OrdinalNumberMap: ReadonlyMap<string, number> = new Map<string, number>([["primero", 1],["primera", 1],["primer", 1],["segundo", 2],["segunda", 2],["medio", 2],["media", 2],["tercero", 3],["tercera", 3],["tercer", 3],["tercio", 3],["cuarto", 4],["cuarta", 4],["quinto", 5],["quinta", 5],["sexto", 6],["sexta", 6],["septimo", 7],["septima", 7],["octavo", 8],["octava", 8],["noveno", 9],["novena", 9],["decimo", 10],["décimo", 10],["decima", 10],["décima", 10],["undecimo", 11],["undecima", 11],["duodecimo", 12],["duodecima", 12],["decimotercero", 13],["decimotercera", 13],["decimocuarto", 14],["decimocuarta", 14],["decimoquinto", 15],["decimoquinta", 15],["decimosexto", 16],["decimosexta", 16],["decimoseptimo", 17],["decimoseptima", 17],["decimoctavo", 18],["decimoctava", 18],["decimonoveno", 19],["decimonovena", 19],["vigesimo", 20],["vigesima", 20],["trigesimo", 30],["trigesima", 30],["cuadragesimo", 40],["cuadragesima", 40],["quincuagesimo", 50],["quincuagesima", 50],["sexagesimo", 60],["sexagesima", 60],["septuagesimo", 70],["septuagesima", 70],["octogesimo", 80],["octogesima", 80],["nonagesimo", 90],["nonagesima", 90],["centesimo", 100],["centesima", 100],["ducentesimo", 200],["ducentesima", 200],["tricentesimo", 300],["tricentesima", 300],["cuadringentesimo", 400],["cuadringentesima", 400],["quingentesimo", 500],["quingentesima", 500],["sexcentesimo", 600],["sexcentesima", 600],["septingentesimo", 700],["septingentesima", 700],["octingentesimo", 800],["octingentesima", 800],["noningentesimo", 900],["noningentesima", 900],["milesimo", 1000],["milesima", 1000],["millonesimo", 1000000],["millonesima", 1000000],["billonesimo", 1000000000000],["billonesima", 1000000000000]]);
export const PrefixCardinalMap: ReadonlyMap<string, number> = new Map<string, number>([["dos", 2],["tres", 3],["cuatro", 4],["cinco", 5],["seis", 6],["siete", 7],["ocho", 8],["nueve", 9],["diez", 10],["once", 11],["doce", 12],["trece", 13],["catorce", 14],["quince", 15],["dieciseis", 16],["dieciséis", 16],["diecisiete", 17],["dieciocho", 18],["diecinueve", 19],["veinte", 20],["ventiuna", 21],["veintiun", 21],["veintiún", 21],["veintidos", 22],["veintitres", 23],["veinticuatro", 24],["veinticinco", 25],["veintiseis", 26],["veintisiete", 27],["veintiocho", 28],["veintinueve", 29],["treinta", 30],["cuarenta", 40],["cincuenta", 50],["sesenta", 60],["setenta", 70],["ochenta", 80],["noventa", 90],["cien", 100],["doscientos", 200],["trescientos", 300],["cuatrocientos", 400],["quinientos", 500],["seiscientos", 600],["setecientos", 700],["ochocientos", 800],["novecientos", 900]]);
export const SuffixOrdinalMap: ReadonlyMap<string, number> = new Map<string, number>([["milesimo", 1000],["millonesimo", 1000000],["billonesimo", 1000000000000]]);
export const RoundNumberMap: ReadonlyMap<string, number> = new Map<string, number>([["mil", 1000],["milesimo", 1000],["millon", 1000000],["millón", 1000000],["millones", 1000000],["millonesimo", 1000000],["billon", 1000000000000],["billón", 1000000000000],["billones", 1000000000000],["billonesimo", 1000000000000],["trillon", 1000000000000000000],["trillón", 1000000000000000000],["trillones", 1000000000000000000],["trillonesimo", 1000000000000000000],["docena", 12],["docenas", 12],["k", 1000],["m", 1000000],["g", 1000000000],["b", 1000000000],["t", 1000000000000]]);
Expand Down
4 changes: 2 additions & 2 deletions Patterns/English/English-Numbers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ BasicOrdinalRegex: !nestedRegex
def: ({NumberOrdinalRegex}|{RelativeOrdinalRegex})
references: [ NumberOrdinalRegex, RelativeOrdinalRegex ]
RelativeOrdinalFilterRegex: !nestedRegex
def: (?<!-)(first|{RelativeOrdinalRegex})\s*({TwoToNineIntegerRegex}|[2-9]+)
references: [ RelativeOrdinalRegex, TwoToNineIntegerRegex ]
def: (?<!-)(first|{RelativeOrdinalRegex})\s*({TwoToNineIntegerRegex}|[2-9]+)(?!\s*{RoundNumberIntegerRegex})
references: [ RelativeOrdinalRegex, TwoToNineIntegerRegex, RoundNumberIntegerRegex ]
SuffixBasicOrdinalRegex: !nestedRegex
def: ((((({TensNumberIntegerRegex}(\s+(and\s+)?|\s*-\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{AnIntRegex})(\s+{RoundNumberIntegerRegex})+)\s+(and\s+)?)*({TensNumberIntegerRegex}(\s+|\s*-\s*))?{BasicOrdinalRegex})
references: [ TensNumberIntegerRegex, ZeroToNineIntegerRegex, AnIntRegex, RoundNumberIntegerRegex, BasicOrdinalRegex ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class EnglishNumeric:
NumberOrdinalRegex = f'(first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|thirtieth|fortieth|fiftieth|sixtieth|seventieth|eightieth|ninetieth)'
RelativeOrdinalRegex = f'((next|previous) one|(the second|next) to last|the one before the last( one)?|the last but one|(ante)?penultimate|last|next|previous)'
BasicOrdinalRegex = f'({NumberOrdinalRegex}|{RelativeOrdinalRegex})'
RelativeOrdinalFilterRegex = f'(?<!-)(first|{RelativeOrdinalRegex})\\s*({TwoToNineIntegerRegex}|[2-9]+)'
RelativeOrdinalFilterRegex = f'(?<!-)(first|{RelativeOrdinalRegex})\\s*({TwoToNineIntegerRegex}|[2-9]+)(?!\\s*{RoundNumberIntegerRegex})'
SuffixBasicOrdinalRegex = f'((((({TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*){ZeroToNineIntegerRegex})|{TensNumberIntegerRegex}|{ZeroToNineIntegerRegex}|{AnIntRegex})(\\s+{RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*({TensNumberIntegerRegex}(\\s+|\\s*-\\s*))?{BasicOrdinalRegex})'
SuffixRoundNumberOrdinalRegex = f'(({AllIntRegex}\\s+){RoundNumberOrdinalRegex})'
AllOrdinalRegex = f'({SuffixBasicOrdinalRegex}|{SuffixRoundNumberOrdinalRegex})'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class SpanishNumeric:
AllIntRegexWithLocks = f'((?<=\\b){AllIntRegex}(?=\\b))'
AllIntRegexWithDozenSuffixLocks = f'(?<=\\b)(((media\\s+)?\\s+docena)|({AllIntRegex}\\s+(y|con)\\s+)?({AllIntRegex}\\s+docenas?))(?=\\b)'
SimpleRoundOrdinalRegex = f'(mil[eé]simo|millon[eé]sim[oa]|billon[eé]sim[oa]|trillon[eé]sim[oa]|cuatrillon[eé]sim[oa]|quintillon[eé]sim[oa]|sextillon[eé]sim[oa]|septillon[eé]sim[oa])'
OneToNineOrdinalRegex = f'(primer[oa]|segund[oa]|tercer[oa]|cuart[oa]|quint[oa]|sext[oa]|s[eé]ptim[oa]|octav[oa]|noven[oa])'
OneToNineOrdinalRegex = f'(primer[oa]?|segund[oa]|tercer[oa]?|cuart[oa]|quint[oa]|sext[oa]|s[eé]ptim[oa]|octav[oa]|noven[oa])'
TensOrdinalRegex = f'(nonag[eé]sim[oa]|octog[eé]sim[oa]|septuag[eé]sim[oa]|sexag[eé]sim[oa]|quincuag[eé]sim[oa]|cuadrag[eé]sim[oa]|trig[eé]sim[oa]|vig[eé]sim[oa]|d[eé]cim[oa])'
HundredOrdinalRegex = f'(cent[eé]sim[oa]|ducent[eé]sim[oa]|tricent[eé]sim[oa]|cuadringent[eé]sim[oa]|quingent[eé]sim[oa]|sexcent[eé]sim[oa]|septingent[eé]sim[oa]|octingent[eé]sim[oa]|noningent[eé]sim[oa])'
SpecialUnderHundredOrdinalRegex = f'(und[eé]cim[oa]|duod[eé]cimo|decimoctav[oa])'
UnderHundredOrdinalRegex = f'((({TensOrdinalRegex}(\\s)?)?{OneToNineOrdinalRegex})|{TensOrdinalRegex}|{SpecialUnderHundredOrdinalRegex})'
UnderHundredOrdinalRegex = f'({SpecialUnderHundredOrdinalRegex}|(({TensOrdinalRegex}(\\s)?)?{OneToNineOrdinalRegex})|{TensOrdinalRegex})'
UnderThousandOrdinalRegex = f'((({HundredOrdinalRegex}(\\s)?)?{UnderHundredOrdinalRegex})|{HundredOrdinalRegex})'
OverThousandOrdinalRegex = f'(({AllIntRegex})([eé]sim[oa]))'
ComplexOrdinalRegex = f'(({OverThousandOrdinalRegex}(\\s)?)?{UnderThousandOrdinalRegex}|{OverThousandOrdinalRegex})'
Expand Down Expand Up @@ -201,7 +201,9 @@ class SpanishNumeric:
("noveno", 9),
("novena", 9),
("decimo", 10),
("décimo", 10),
("decima", 10),
("décima", 10),
("undecimo", 11),
("undecima", 11),
("duodecimo", 12),
Expand Down
Loading

0 comments on commit d8d4c28

Please sign in to comment.