diff options
| author | krasimir <krasimir@chalmers.se> | 2009-09-08 08:40:28 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-09-08 08:40:28 +0000 |
| commit | 28a7c4b5c7659dc18166e06e914fb0a81c1c43bc (patch) | |
| tree | 3d4a866f0fe37d8b45230581c44f459d7ac16e3d /src/PGF/VisualizeTree.hs | |
| parent | 9940c44259fe3ee4501e324b4d1816a50d77fa37 (diff) | |
now the datatype Tree is only internal. All API functions are working with Expr directly. Commands gt, gr, p and rf filter out the output via the typechecker
Diffstat (limited to 'src/PGF/VisualizeTree.hs')
| -rw-r--r-- | src/PGF/VisualizeTree.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/PGF/VisualizeTree.hs b/src/PGF/VisualizeTree.hs index 4e8df64c0..8871e9f84 100644 --- a/src/PGF/VisualizeTree.hs +++ b/src/PGF/VisualizeTree.hs @@ -21,6 +21,7 @@ module PGF.VisualizeTree ( visualizeTrees, alignLinearize import PGF.CId (prCId) import PGF.Data +import PGF.Tree import PGF.Linearize import PGF.Macros (lookValCat) @@ -28,8 +29,8 @@ import Data.List (intersperse,nub) import Data.Char (isDigit) import qualified Text.ParserCombinators.ReadP as RP -visualizeTrees :: PGF -> (Bool,Bool) -> [Tree] -> String -visualizeTrees pgf funscats = unlines . map (prGraph False . tree2graph pgf funscats) +visualizeTrees :: PGF -> (Bool,Bool) -> [Expr] -> String +visualizeTrees pgf funscats = unlines . map (prGraph False . tree2graph pgf funscats . expr2tree) tree2graph :: PGF -> (Bool,Bool) -> Tree -> [String] tree2graph pgf (funs,cats) = prf [] where @@ -57,7 +58,7 @@ prGraph digr ns = concat $ map (++"\n") $ [graph ++ "{\n"] ++ ns ++ ["}"] where -- word alignments from Linearize.linearizesMark -- words are chunks like {[0,1,1,0] old} -alignLinearize :: PGF -> Tree -> String +alignLinearize :: PGF -> Expr -> String alignLinearize pgf = prGraph True . lin2graph . linsMark where linsMark t = [s | la <- cncnames pgf, s <- take 1 (linearizesMark pgf la t)] |
