From 69f2ae9794e402e3516c4aefdc7db752e2cb5310 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Tue, 3 Mar 2020 12:04:27 +0100 Subject: [PATCH] another sorting gives better recall in compound analysis in morphodict --- src/morphodict/MkMorphodict.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/morphodict/MkMorphodict.hs b/src/morphodict/MkMorphodict.hs index 5b202abb..aa62cadd 100644 --- a/src/morphodict/MkMorphodict.hs +++ b/src/morphodict/MkMorphodict.hs @@ -97,8 +97,10 @@ mkMorphoDict env = renames fls = [(mkFun (init f ++ [show i,last f]),l) | (i,(f,l)) <- zip [1..] fls] - findCompounds = getCompounds . sortOn cat_revforms - + findCompounds = getCompounds . sortOn cat_orthrevforms + + cat_orthrevforms (_,(cat,_:forms)) = (cat,[map (!!i) fss | let fss = map reverse forms, i <- [0..minimum (map length fss) - 1]]) + cat_revforms (_,(cat,_:forms)) = (cat,map reverse forms) revstem = head . snd . cat_revforms wforms (_,(_,_:forms)) = forms