summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAarne Ranta <aarne@chalmers.se>2018-12-01 09:32:22 +0100
committerAarne Ranta <aarne@chalmers.se>2018-12-01 09:32:22 +0100
commit831252eb81989584ea9bc5b0d7e146dc5f71ca67 (patch)
treef06f451dbadbdbd267107d3ee66501f05836344c /src
parentfdc5659f800bc37c51e3ddbdfdd0c8f3febb6b6c (diff)
dealing with ',' as syncategorematic token
Diffstat (limited to 'src')
-rw-r--r--src/runtime/haskell/PGF/VisualizeTree.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/haskell/PGF/VisualizeTree.hs b/src/runtime/haskell/PGF/VisualizeTree.hs
index 70c1f2f7f..c82d9e47e 100644
--- a/src/runtime/haskell/PGF/VisualizeTree.hs
+++ b/src/runtime/haskell/PGF/VisualizeTree.hs
@@ -802,7 +802,9 @@ getCncDepLabels =
Just new -> return new
_ -> lookup "*" (map snd rules)
)
- getToks = words . map (\c -> if elem c "\"," then ' ' else c)
+ getToks = map unquote . filter (/=",") . toks
+ toks s = case lex s of [(t,"")] -> [t] ; [(t,cc)] -> t:toks cc ; _ -> []
+ unquote s = case s of '"':cc@(_:_) | last cc == '"' -> init cc ; _ -> s
printCoNLL :: CoNLL -> String
printCoNLL = unlines . map (concat . intersperse "\t")