mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
PGFToCFG should use the full production set because the lexicon is now split out
This commit is contained in:
@@ -37,7 +37,7 @@ pgfToCFG pgf lang = mkCFG (showCId (lookStartCat pgf)) extCats (startRules ++ co
|
|||||||
cnc = lookConcr pgf lang
|
cnc = lookConcr pgf lang
|
||||||
|
|
||||||
rules :: [(FId,Production)]
|
rules :: [(FId,Production)]
|
||||||
rules = [(fcat,prod) | (fcat,set) <- IntMap.toList (PGF.pproductions cnc)
|
rules = [(fcat,prod) | (fcat,set) <- IntMap.toList (PGF.productions cnc)
|
||||||
, prod <- Set.toList set]
|
, prod <- Set.toList set]
|
||||||
|
|
||||||
fcatCats :: Map FId Cat
|
fcatCats :: Map FId Cat
|
||||||
@@ -58,7 +58,7 @@ pgfToCFG pgf lang = mkCFG (showCId (lookStartCat pgf)) extCats (startRules ++ co
|
|||||||
|
|
||||||
topdownRules cat = f cat []
|
topdownRules cat = f cat []
|
||||||
where
|
where
|
||||||
f cat rules = maybe rules (Set.fold g rules) (IntMap.lookup cat (pproductions cnc))
|
f cat rules = maybe rules (Set.fold g rules) (IntMap.lookup cat (productions cnc))
|
||||||
|
|
||||||
g (PApply funid args) rules = (cncfuns cnc ! funid,args) : rules
|
g (PApply funid args) rules = (cncfuns cnc ! funid,args) : rules
|
||||||
g (PCoerce cat) rules = f cat rules
|
g (PCoerce cat) rules = f cat rules
|
||||||
|
|||||||
Reference in New Issue
Block a user