diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-01-27 22:04:47 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-01-27 22:04:47 +0100 |
| commit | 3febb9da3e91dc11cd46f282d0edff2ea5890731 (patch) | |
| tree | 5530278154bf17d639071c9bc97cfba5a839e2b2 /lib | |
| parent | 108bc6f0446c351b421ba62367e0f4eaf6c62461 (diff) | |
| download | mihi-3febb9da3e91dc11cd46f282d0edff2ea5890731.tar.gz mihi-3febb9da3e91dc11cd46f282d0edff2ea5890731.zip | |
words: add the 'rel' subcommand
This is a more general way to establish the relationship between two
words.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mihi/src/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/mihi/src/lib.rs b/lib/mihi/src/lib.rs index 1aabf29..237fe84 100644 --- a/lib/mihi/src/lib.rs +++ b/lib/mihi/src/lib.rs @@ -284,6 +284,19 @@ pub enum RelationKind { Gendered, } +// Needed for inquire's (Multi)Select. +impl std::fmt::Display for RelationKind { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Comparative => write!(f, "comparative form"), + Self::Superlative => write!(f, "superlative form"), + Self::Adverb => write!(f, "adverbial form"), + Self::Alternative => write!(f, "alternative word"), + Self::Gendered => write!(f, "alternative word because of gender"), + } + } +} + impl TryFrom<isize> for RelationKind { type Error = String; |
