Skip to content

Commit 4567b8b

Browse files
authored
Merge pull request #52 from allo-media/master
Forgot to activate Portuguese.
2 parents b095803 + fa95515 commit 4567b8b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "text2num"
3-
version = "2.6.1"
3+
version = "2.6.2"
44
authors = ["Allo-Media <[email protected]>"]
55
edition = "2021"
66
license = "MIT"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Parse and convert numbers written in English, Dutch, Spanish, Portuguese (Europe & Brazil), German, Italian or French into their digit representation.
22

33
This crate provides a library for recognizing, parsing and transcribing into digits (base 10) numbers expressed in natural language.
4+
No IA involved: resources (and energy!) consumption as well as latency are very small.
45

56
## Examples
67

src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ In those cases, you'll probably get a stream of tokens of a certain type instead
100100
The `text2num` library can process those streams as long as the token type implements the [`Token trait`](word_to_digit::Token).
101101
102102
103-
# Example: substitutions in a token stream.
103+
# Example: substitutions in a token list.
104104
105105
We can show a simple example with `String` streams:
106106
@@ -128,9 +128,9 @@ impl Replace for BareToken {
128128
}
129129
130130
// Poor man's tokenizer
131-
let stream = "I have two hundreds and twenty dollars in my pocket".split_whitespace().map(|s| BareToken(s.to_string())).collect();
131+
let token_list = "I have two hundreds and twenty dollars in my pocket".split_whitespace().map(|s| BareToken(s.to_string())).collect();
132132
133-
let processed_stream = replace_numbers_in_stream(stream, &en, 10.0);
133+
let processed_stream = replace_numbers_in_stream(token_list, &en, 10.0);
134134
135135
assert_eq!(
136136
processed_stream.into_iter().map(|t| t.0).collect::<Vec<_>>(),
@@ -172,7 +172,7 @@ impl Token for DecodedWord<'_> {
172172
}
173173
174174
175-
// Simulate ASR output
175+
// Simulate real time (online) ASR output
176176
177177
let stream = [
178178
DecodedWord{ text: "i", start: 0, end: 100},
@@ -228,6 +228,7 @@ pub fn get_interpreter_for(language_code: &str) -> Option<Language> {
228228
"fr" => Some(Language::french()),
229229
"it" => Some(Language::italian()),
230230
"nl" => Some(Language::dutch()),
231+
"pt" => Some(Language::portuguese()),
231232
_ => None,
232233
}
233234
}

0 commit comments

Comments
 (0)