diff options
| author | aarne <unknown> | 2005-11-14 15:03:40 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2005-11-14 15:03:40 +0000 |
| commit | f339b8839bcb25a57cb22baa3342032892f9be63 (patch) | |
| tree | 59b15d37579d5b5630d9ae5ac7a9d701cf3e09a4 /src/GF/UseGrammar | |
| parent | 505eb2ec5794e741d343e52be4f75da7b4980a62 (diff) | |
arbitrary lincat records; noparse pragmas
Diffstat (limited to 'src/GF/UseGrammar')
| -rw-r--r-- | src/GF/UseGrammar/Linear.hs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/GF/UseGrammar/Linear.hs b/src/GF/UseGrammar/Linear.hs index 6de767a06..24f7312c5 100644 --- a/src/GF/UseGrammar/Linear.hs +++ b/src/GF/UseGrammar/Linear.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/06/29 16:27:56 $ +-- > CVS $Date: 2005/11/14 16:03:41 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.18 $ +-- > CVS $Revision: 1.19 $ -- -- Linearization for canonical GF. AR 7\/6\/2003 ----------------------------------------------------------------------------- @@ -212,6 +212,16 @@ allLinTables gr c t = do gets (ps,t) = liftM (curry id ps . cc . map str2strings) $ strsFromTerm t cc = concat . intersperse ["/"] +-- | the value is a list of strings gathered from all fields + +allLinBranchFields :: CanonGrammar -> Ident -> A.Tree -> Err [String] +allLinBranchFields gr c trm = do + r <- linearizeNoMark gr c trm >>= expandLinTables gr + return [s | (_,t) <- allLinBranches r, s <- gets t] + where + gets t = concat [cc (map str2strings s) | Ok s <- [strsFromTerm t]] + cc = concat . intersperse ["/"] + prLinTable :: Bool -> [[(Label,[([Patt],[String])])]] -> [String] prLinTable pars = concatMap prOne . concat where prOne (lab,pss) = (if pars then ((prt lab) :) else id) (map pr pss) ---- |
