summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF/VisualizeTree.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-01-17 17:05:21 +0000
committerkrasimir <krasimir@chalmers.se>2010-01-17 17:05:21 +0000
commitaf13bae2dfb9adaa7c4aa273961fc09cc7ba1b7a (patch)
tree74ba570e4d202dff02f330b50e11a0fa09b068a6 /src/runtime/haskell/PGF/VisualizeTree.hs
parent9e3d4c74dc807cb26bb36303d2157c70c0668a8e (diff)
now the linearization is completely based on PMCFG
Diffstat (limited to 'src/runtime/haskell/PGF/VisualizeTree.hs')
-rw-r--r--src/runtime/haskell/PGF/VisualizeTree.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/runtime/haskell/PGF/VisualizeTree.hs b/src/runtime/haskell/PGF/VisualizeTree.hs
index 429551f54..8e9b28740 100644
--- a/src/runtime/haskell/PGF/VisualizeTree.hs
+++ b/src/runtime/haskell/PGF/VisualizeTree.hs
@@ -102,7 +102,7 @@ graphvizDependencyTree format debug mlab ms pgf lang exp = case format of
ifd s = if debug then s else []
- pot = readPosText $ head $ linearizesMark pgf lang exp
+ pot = readPosText $ concat $ take 1 $ markLinearizes pgf lang exp
---- use Just str if you have str to match against
prelude = ["rankdir=LR ;", "node [shape = plaintext] ;"]
@@ -188,9 +188,7 @@ getDepLabels ss = Map.fromList [(mkCId f,ls) | f:ls <- map words ss]
---- nubrec and domins are quadratic, but could be (n log n)
graphvizParseTree :: PGF -> CId -> Expr -> String
-graphvizParseTree pgf lang = prGraph False . lin2tree pgf . linMark where
- linMark = head . linearizesMark pgf lang
- ---- use Just str if you have str to match against
+graphvizParseTree pgf lang = prGraph False . lin2tree pgf . concat . take 1 . markLinearizes pgf lang where
lin2tree pgf s = trace s $ prelude ++ nodes ++ links where
@@ -235,12 +233,12 @@ tag s = "<" ++ s ++ ">"
showp = init . tail . show
mtag = tag . ('n':) . uncommas
--- word alignments from Linearize.linearizesMark
+-- word alignments from Linearize.markLinearize
-- words are chunks like {[0,1,1,0] old}
graphvizAlignment :: PGF -> Expr -> String
graphvizAlignment pgf = prGraph True . lin2graph . linsMark where
- linsMark t = [s | la <- cncnames pgf, s <- take 1 (linearizesMark pgf la t)]
+ linsMark t = [concat (take 1 (markLinearizes pgf la t)) | la <- cncnames pgf]
lin2graph :: [String] -> [String]
lin2graph ss = trace (show ss) $ prelude ++ nodes ++ links