diff options
| author | krasimir <krasimir@chalmers.se> | 2008-10-20 15:38:59 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2008-10-20 15:38:59 +0000 |
| commit | 41fb72ca6f2eb2299842cb86cf31aeb9e041046a (patch) | |
| tree | a4da5713470be6eaaba3ef9d37430c3836fccf0a /src | |
| parent | d327d9da6c25349757fb87f4cc8bcb3ba69ca8f4 (diff) | |
the literal categories were slowing down the parser 3 times. this is quick and dirty workaround until I find something cleverer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/PGF/Parsing/FCFG/Incremental.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/PGF/Parsing/FCFG/Incremental.hs b/src/PGF/Parsing/FCFG/Incremental.hs index 38c2e6c95..99d734f40 100644 --- a/src/PGF/Parsing/FCFG/Incremental.hs +++ b/src/PGF/Parsing/FCFG/Incremental.hs @@ -152,9 +152,14 @@ process fn !seqs !funs (item@(Active j ppos funid seqid args key0):items) acc ch items2 = case lookupPC (mkPK key k) (passive chart) of
Nothing -> items
Just id -> (Active j (ppos+1) funid seqid (updateAt d id args) key0) : items
- (acc2,items3) = foldForest (\funid args (lits,items) -> (lits,(Active k 0 funid (rhs funid r) args key) : items))
- (\lit s (acc,items) -> (fn (KS s) (Active j (ppos+1) funid seqid args key0) acc,items))
- (acc,items2) fid (forest chart)
+ items3 = foldForest (\funid args items -> Active k 0 funid (rhs funid r) args key : items)
+ (\_ _ items -> items)
+ items2 fid (forest chart)
+ acc2 = if fid < 0 -- literal category
+ then foldForest (\funid args acc -> acc)
+ (\lit s acc -> fn (KS s) (Active j (ppos+1) funid seqid args key0) acc)
+ acc fid (forest chart)
+ else acc
in case lookupAC key (active chart) of
Nothing -> process fn seqs funs items3 acc2 chart{active=insertAC key (Set.singleton item) (active chart)}
Just set | Set.member item set -> process fn seqs funs items acc chart
|
