From 7d58efb6600d164101c439cf8954de637ea35c34 Mon Sep 17 00:00:00 2001 From: krasimir Date: Tue, 14 Dec 2010 08:46:22 +0000 Subject: optimization in the parser for large lexicons. Now, the parser is slightly slower for grammars with a small lexicon but 3-4 times faster for the English Resource Grammar used in combination with Oxford Advanced Learners Dictionary --- src/runtime/haskell/PGF/Morphology.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/haskell/PGF/Morphology.hs') diff --git a/src/runtime/haskell/PGF/Morphology.hs b/src/runtime/haskell/PGF/Morphology.hs index 711f9c01d..d5a2d28bc 100644 --- a/src/runtime/haskell/PGF/Morphology.hs +++ b/src/runtime/haskell/PGF/Morphology.hs @@ -29,7 +29,7 @@ buildMorpho pgf lang = Morpho $ collectWords pinfo = Map.fromListWith (++) [(t, [(fun,lbls ! l)]) | (CncCat s e lbls) <- Map.elems (cnccats pinfo) , fid <- [s..e] - , PApply funid _ <- maybe [] Set.toList (IntMap.lookup fid (pproductions pinfo)) + , PApply funid _ <- maybe [] Set.toList (IntMap.lookup fid (productions pinfo)) , let CncFun fun lins = cncfuns pinfo ! funid , (l,seqid) <- assocs lins , sym <- elems (sequences pinfo ! seqid) -- cgit v1.2.3