diff options
| author | bjorn <bjorn@bringert.net> | 2008-10-20 14:51:42 +0000 |
|---|---|---|
| committer | bjorn <bjorn@bringert.net> | 2008-10-20 14:51:42 +0000 |
| commit | 6b8c9dd4c9a1e28ef22a1c1797143ffd8febef5d (patch) | |
| tree | 666ae8cd66ce5e36e2754880fc00fdfa0985f474 /src/GF | |
| parent | 05343e78a93bc7a248cab402fc1f0c92450f2a91 (diff) | |
Added PGF.Macros.mapConcretes
Diffstat (limited to 'src/GF')
| -rw-r--r-- | src/GF/Compile.hs | 2 | ||||
| -rw-r--r-- | src/GF/Compile/GrammarToGFCC.hs | 2 | ||||
| -rw-r--r-- | src/GF/Compile/OptimizeGFCC.hs | 9 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/GF/Compile.hs b/src/GF/Compile.hs index ed2481835..d4b3a9df3 100644 --- a/src/GF/Compile.hs +++ b/src/GF/Compile.hs @@ -41,7 +41,9 @@ import qualified Data.Set as Set import Data.List(nub) import PGF.Check +import PGF.CId import PGF.Data +import PGF.Macros -- | Compiles a number of source files and builds a 'PGF' structure for them. diff --git a/src/GF/Compile/GrammarToGFCC.hs b/src/GF/Compile/GrammarToGFCC.hs index 51a99e632..3b71bf28a 100644 --- a/src/GF/Compile/GrammarToGFCC.hs +++ b/src/GF/Compile/GrammarToGFCC.hs @@ -51,7 +51,7 @@ mkCanon2gfcc opts cnc gr = -- Adds parsers for all concretes addParsers :: Options -> D.PGF -> D.PGF -addParsers opts pgf = pgf { D.concretes = Map.map conv (D.concretes pgf) } +addParsers opts pgf = CM.mapConcretes conv pgf where conv cnc = cnc { D.parser = Just pinfo } where diff --git a/src/GF/Compile/OptimizeGFCC.hs b/src/GF/Compile/OptimizeGFCC.hs index c73d5bbcb..2a218e1bb 100644 --- a/src/GF/Compile/OptimizeGFCC.hs +++ b/src/GF/Compile/OptimizeGFCC.hs @@ -2,6 +2,7 @@ module GF.Compile.OptimizeGFCC where import PGF.CId import PGF.Data +import PGF.Macros import GF.Data.Operations @@ -16,9 +17,7 @@ optPGF :: PGF -> PGF optPGF = cseOptimize . suffixOptimize suffixOptimize :: PGF -> PGF -suffixOptimize pgf = pgf { - concretes = Map.map opt (concretes pgf) - } +suffixOptimize = mapConcretes opt where opt cnc = cnc { lins = Map.map optTerm (lins cnc), @@ -27,9 +26,7 @@ suffixOptimize pgf = pgf { } cseOptimize :: PGF -> PGF -cseOptimize pgf = pgf { - concretes = Map.map subex (concretes pgf) - } +cseOptimize = mapConcretes subex -- analyse word form lists into prefix + suffixes -- suffix sets can later be shared by subex elim |
