Tree tree = parse(arg, false);
if (tree == null) {
return;
}
// TODO: this might throw an exception if the parser doesn't support dependencies. Handle that cleaner?
GrammaticalStructure gs = parser.getTLPParams().getGrammaticalStructure(tree, parser.treebankLanguagePack().punctuationWordRejectFilter(), parser.getTLPParams().typedDependencyHeadFinder());
Collection<TypedDependency> deps = null;
switch (commandArgs.toUpperCase()) {
case "COLLAPSED_TREE":
deps = gs.typedDependenciesCollapsedTree();
break;
default:
throw new UnsupportedOperationException("Dependencies type not implemented: " + commandArgs);
}
OutputStreamWriter osw = new OutputStreamWriter(outStream, "utf-8");