From e89c483a06f16cfd1e6a1c472c06e70854058654 Mon Sep 17 00:00:00 2001 From: adelon <22380201+adelon@users.noreply.github.com> Date: Tue, 7 May 2024 18:16:11 +0200 Subject: Update noun guessing --- source/Syntax/Adapt.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') 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'))] -- cgit v1.2.3