summaryrefslogtreecommitdiff
path: root/source/Syntax
diff options
context:
space:
mode:
authoradelon <22380201+adelon@users.noreply.github.com>2024-05-07 18:16:11 +0200
committeradelon <22380201+adelon@users.noreply.github.com>2024-05-07 18:16:11 +0200
commite89c483a06f16cfd1e6a1c472c06e70854058654 (patch)
treee7d2557cc83e82450bd1500083d341f212753e7f /source/Syntax
parentb2f9f7900ccb4a569ed23e9ecf327564dbba2b7d (diff)
Update noun guessing
Diffstat (limited to 'source/Syntax')
-rw-r--r--source/Syntax/Adapt.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/Syntax/Adapt.hs b/source/Syntax/Adapt.hs
index 0896c08..b1237d2 100644
--- a/source/Syntax/Adapt.hs
+++ b/source/Syntax/Adapt.hs
@@ -313,6 +313,8 @@ guessNounPlural item = SgPl item (pluralize item)
pluralize :: LexicalPhrase -> LexicalPhrase
pluralize = \case
Just (Word w) : pat'@(Just w' : _) | isPreposition w' -> Just (Word (Text.snoc w 's')) : pat'
+ tok : Just (Word w) : pat'@(Just w' : _) | isPreposition w' -> tok : Just (Word (Text.snoc w 's')) : pat'
+ tok1 : tok2 : Just (Word w) : pat'@(Just w' : _) | isPreposition w' -> tok1 : tok2 : Just (Word (Text.snoc w 's')) : pat'
[Just (Word w)] -> [Just (Word (Text.snoc w 's'))]
[tok, Just (Word w)] -> [tok, Just (Word (Text.snoc w 's'))]
[tok, tok', Just (Word w)] -> [tok, tok', Just (Word (Text.snoc w 's'))]