From 142b2f7776c02e0cb8a2c0d34e905252b83e68eb Mon Sep 17 00:00:00 2001 From: Llywelwyn Date: Sat, 9 Sep 2023 09:37:57 +0100 Subject: [PATCH] ... -> a_ordinal_a --- src/inflect_rs.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/inflect_rs.rs b/src/inflect_rs.rs index 95cc2f9..fdf1741 100644 --- a/src/inflect_rs.rs +++ b/src/inflect_rs.rs @@ -2315,3 +2315,33 @@ fn pl_adj_poss_keys() -> Regex { ); return Regex::new(&pattern).expect("Failed to compile regex"); } + +fn a_abbrev() -> Regex { + return Regex::new( + r"^(?:FJO|[HLMNS]Y\.|RY[EO]|SQU|(?:F[LR]?|[HL]|MN?|N|RH?|S[CHKLMNPTVW]?|X(?:YL)?) [AEIOU])[FHLMNRSX][A-Z]" + ).expect("Failed to compile regex"); +} + +fn a_y_cons() -> Regex { + return Regex::new(r"^(y(b[lor]|cl[ea]|fere|gg|p[ios]|rou|tt))").expect( + "Failed to compile regex" + ); +} + +fn a_explicit_a() -> Regex { + return Regex::new(r"^((?:unabomber|unanimous|US))").expect("Failed to compile regex"); +} + +fn a_explicit_an() -> Regex { + return Regex::new(r"^((?:euler|hour(?!i)|heir|honest|hono[ur]|mpeg))").expect( + "Failed to compile regex" + ); +} + +fn a_ordinal_a() -> Regex { + return Regex::new(r"^([aefhilmnorsx]-?th)").expect("Failed to compile regex"); +} + +fn a_ordinal_an() -> Regex { + return Regex::new(r"^([bcdgjkpqtuvwyz]-?th)").expect("Failed to compile regex"); +}