Skip to content

Commit

Permalink
Fix desuffixing for crossproduct affixes
Browse files Browse the repository at this point in the history
This fixes lookup for words like "returns" that are defined by both a
prefix ("re") and a suffix ("s"). Previously the affix was mistakenly
formed with the text rather than the stem, so the stem was "return"
when it should've been "turn."
  • Loading branch information
the-mikedavis committed Aug 15, 2023
1 parent af70a33 commit 211a147
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ impl<'a> Checker<'a> {
if suffix_allowed
&& is_some_and(form.prefixes[0].as_ref(), |prefix| prefix.crossproduct)
{
for form2 in self.desuffix(word, suffix_flags, forbidden_flags, false, true) {
for form2 in
self.desuffix(&form.stem, suffix_flags, forbidden_flags, false, true)
{
forms.push(AffixForm {
text: form.text.clone(),
prefixes: form.prefixes.clone(),
Expand Down

0 comments on commit 211a147

Please sign in to comment.