diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-01-13 15:27:05 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-01-13 15:27:05 +0100 |
| commit | 43632164dcacb3424ccb9ceba76ddfd7586cb59c (patch) | |
| tree | 5c8d42f793326fecef757a7e60eb94ad45c13511 /crates/cli/src/words.rs | |
| parent | bb3bbcfd018816a80077a6c1f96f842d2bf5f3a4 (diff) | |
| parent | 472d7fb9d37ec838fc69692cf24c8cb4a68af47a (diff) | |
| download | mihi-43632164dcacb3424ccb9ceba76ddfd7586cb59c.tar.gz mihi-43632164dcacb3424ccb9ceba76ddfd7586cb59c.zip | |
Merge branch 'inflection'
Diffstat (limited to 'crates/cli/src/words.rs')
| -rw-r--r-- | crates/cli/src/words.rs | 216 |
1 files changed, 189 insertions, 27 deletions
diff --git a/crates/cli/src/words.rs b/crates/cli/src/words.rs index 7db84a2..23a3946 100644 --- a/crates/cli/src/words.rs +++ b/crates/cli/src/words.rs @@ -1,3 +1,6 @@ +use crate::inflection::print_full_inflection_for; +use crate::locale::current_locale; + use inquire::{Confirm, Editor, Select, Text}; use mihi::{Category, Gender, Language, Word}; use std::vec::IntoIter; @@ -148,15 +151,22 @@ fn get_initial_guess(value: &str) -> Word { return Word::from( second[0..second.len() - 2].to_string(), Category::Noun, - Some(5), + Some(3), None, Gender::Masculine, - "es".to_string(), + "is".to_string(), ); } } - Word::default() + Word::from( + value.to_string(), + Category::Unknown, + None, + None, + Gender::None, + String::from("-"), + ) } // Remove comments from the "flags" text that was provided. @@ -196,6 +206,7 @@ fn ask_for_word_based_on(enunciated: String, word: Word) -> Result<Word, String> else { return Err("abort!".to_string()); }; + let particle = particle.trim().to_string(); let categories = vec