forked from GitHub/gf-core
new option linerize -tabtreebank for tab-separated treebank generation
This commit is contained in:
@@ -275,6 +275,7 @@ pgfCommands = Map.fromList [
|
|||||||
("list","show all forms and variants, comma-separated on one line (cf. l -all)"),
|
("list","show all forms and variants, comma-separated on one line (cf. l -all)"),
|
||||||
("multi","linearize to all languages (default)"),
|
("multi","linearize to all languages (default)"),
|
||||||
("table","show all forms labelled by parameters"),
|
("table","show all forms labelled by parameters"),
|
||||||
|
("tabtreebank","show the tree and its linearizations on a tab-separated line"),
|
||||||
("treebank","show the tree and tag linearizations with language names")
|
("treebank","show the tree and tag linearizations with language names")
|
||||||
] ++ stringOpOptions,
|
] ++ stringOpOptions,
|
||||||
flags = [
|
flags = [
|
||||||
@@ -791,6 +792,9 @@ pgfCommands = Map.fromList [
|
|||||||
_ | isOpt "treebank" opts ->
|
_ | isOpt "treebank" opts ->
|
||||||
(showCId (abstractName pgf) ++ ": " ++ showExpr [] t) :
|
(showCId (abstractName pgf) ++ ": " ++ showExpr [] t) :
|
||||||
[showCId lang ++ ": " ++ s | lang <- optLangs pgf opts, s<-linear pgf opts lang t]
|
[showCId lang ++ ": " ++ s | lang <- optLangs pgf opts, s<-linear pgf opts lang t]
|
||||||
|
_ | isOpt "tabtreebank" opts ->
|
||||||
|
return $ concat $ intersperse "\t" $ (showExpr [] t) :
|
||||||
|
[s | lang <- optLangs pgf opts, s <- linear pgf opts lang t]
|
||||||
_ | isOpt "chunks" opts -> map snd $ linChunks pgf opts t
|
_ | isOpt "chunks" opts -> map snd $ linChunks pgf opts t
|
||||||
_ -> [s | lang <- optLangs pgf opts, s<-linear pgf opts lang t]
|
_ -> [s | lang <- optLangs pgf opts, s<-linear pgf opts lang t]
|
||||||
linChunks pgf opts t =
|
linChunks pgf opts t =
|
||||||
|
|||||||
Reference in New Issue
Block a user