aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-01-12 15:43:27 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-01-13 15:22:21 +0100
commit472d7fb9d37ec838fc69692cf24c8cb4a68af47a (patch)
treeda5cbd971348e052b5b03b53ce1be3a4ae46b82d /lib
parenta6a46c403c780144e55a337a88af49fa9aa55acd (diff)
downloadmihi-472d7fb9d37ec838fc69692cf24c8cb4a68af47a.tar.gz
mihi-472d7fb9d37ec838fc69692cf24c8cb4a68af47a.zip
Various fixes on adjective inflection
This includes providing tests and fixes for feminine adjectives with contracted roots, and feminine versions of "unus nauta" adjectives. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/mihi/src/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/mihi/src/lib.rs b/lib/mihi/src/lib.rs
index 78400f2..57dc93f 100644
--- a/lib/mihi/src/lib.rs
+++ b/lib/mihi/src/lib.rs
@@ -999,11 +999,11 @@ fn contract_root(word: &Word, case: usize, number: usize, gender: usize) -> bool
return true;
}
- // Nominative/vocative singular are never contracted. The accusative is
- // only not contracted on neuter words.
+ // Nominative/vocative singular are only contracted for feminine nouns. The
+ // accusative is only not contracted on neuter words.
match case {
- 0 | 1 => false,
- 2 => gender != 3,
+ 0 | 1 => gender == Gender::Feminine as usize,
+ 2 => gender != Gender::Neuter as usize,
_ => true,
}
}
@@ -1095,7 +1095,8 @@ pub fn group_declension_inflections(
"SELECT id, number, gender, \"case\", value, declension_id, \
kind, tense, mood, voice, person, conjugation_id \
FROM forms \
- WHERE kind = ?1 AND gender = ?2",
+ WHERE kind = ?1 AND gender = ?2
+ ORDER BY id",
)
.unwrap();
let mut it = stmt.query([kind, &gender.to_string()]).unwrap();