From 3febb9da3e91dc11cd46f282d0edff2ea5890731 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 27 Jan 2026 22:04:47 +0100 Subject: words: add the 'rel' subcommand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a more general way to establish the relationship between two words. Signed-off-by: Miquel Sabaté Solà --- lib/mihi/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib') 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 for RelationKind { type Error = String; -- cgit v1.2.3