Skip to content

Commit

Permalink
Merge pull request #43 from allo-media/master
Browse files Browse the repository at this point in the history
Release 2.5.1
  • Loading branch information
rtxm authored Aug 29, 2024
2 parents a9b0d95 + 11c6e8d commit 70069f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "text2num"
version = "2.5.0"
version = "2.5.1"
authors = ["Allo-Media <contact@allo-media.fr>"]
edition = "2021"
license = "MIT"
Expand Down
10 changes: 9 additions & 1 deletion src/lang/es/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ impl LangInterpretor for Spanish {
"seteciento" | "setecienta" | "septingentésimo" | "septingentésima" => b.put(b"700"),
"ochociento" | "ochocienta" | "octingentésimo" | "octingentésima" => b.put(b"800"),
"noveciento" | "novecienta" | "noningentésimo" | "noningentésima" => b.put(b"900"),
"mil" | "milésimo" | "milésima" if b.is_range_free(3, 5) => b.shift(3),
"mil" | "milésimo" | "milésima" if b.is_range_free(3, 5) => {
let peek = b.peek(2);
if peek == b"1" {
Err(Error::Overlap)
} else {
b.shift(3)
}
}
"millon" | "millón" | "millonésimo" | "millonésima" if b.is_range_free(6, 8) => {
b.shift(6)
}
Expand Down Expand Up @@ -315,6 +322,7 @@ mod tests {
assert_invalid!("veinte cuarto");
assert_invalid!("vigésimo decimocuarto");
assert_invalid!("diez cuarto");
assert_invalid!("uno mil");
}

#[test]
Expand Down

0 comments on commit 70069f8

Please sign in to comment.