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/Data.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/runtime/haskell/PGF/Data.hs') diff --git a/src/runtime/haskell/PGF/Data.hs b/src/runtime/haskell/PGF/Data.hs index f82d33644..3e26cbd98 100644 --- a/src/runtime/haskell/PGF/Data.hs +++ b/src/runtime/haskell/PGF/Data.hs @@ -7,6 +7,8 @@ import PGF.Type import qualified Data.Map as Map import qualified Data.Set as Set import qualified Data.IntMap as IntMap +import qualified Data.IntSet as IntSet +import qualified GF.Data.TrieMap as TMap import Data.Array.IArray import Data.Array.Unboxed import Data.List @@ -42,6 +44,7 @@ data Concr = Concr { pproductions :: IntMap.IntMap (Set.Set Production), -- productions needed for parsing lproductions :: Map.Map CId (IntMap.IntMap (Set.Set Production)), -- productions needed for linearization cnccats :: Map.Map CId CncCat, + lexicon :: IntMap.IntMap (IntMap.IntMap (TMap.TrieMap Token IntSet.IntSet)), totalCats :: {-# UNPACK #-} !FId } -- cgit v1.2.3