public class ASemanticGraphPrinter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
COLON |
private static int |
DEFAULT_INDENT |
private static boolean |
DEFAULT_SHOW_ANNOS |
private static boolean |
DEFAULT_SHOW_INDICES |
private static boolean |
DEFAULT_SHOW_RELNS |
private static boolean |
DEFAULT_SHOW_TAGS |
private static boolean |
DEFAULT_SMART_INDENT |
private static int |
DEFAULT_WIDTH |
private int |
indent |
private static java.lang.String |
LPAREN |
private java.lang.StringBuffer |
out |
private static java.lang.String |
RPAREN |
private boolean |
showAnnos |
private boolean |
showIndices |
private boolean |
showRelns |
private boolean |
showTags |
private boolean |
smartIndent |
private static java.lang.String |
SPACE |
private java.util.Set<GraphNode> |
used |
private int |
width |
Constructor and Description |
---|
ASemanticGraphPrinter() |
ASemanticGraphPrinter(int width,
int indent,
boolean smartIndent,
boolean showRelns,
boolean showTags,
boolean showAnnos,
boolean showIndices) |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
formatLabel(GraphNode node) |
java.lang.String |
formatSemanticGraph(ASemanticGraph sgx)
Returns a pretty-printed string representation of the given semantic graph, on one or more lines.
|
private void |
formatSGNode(ASemanticGraph semanticGraphDecorator,
GraphNode node,
int spaces)
Appends to this.out a one-line or multi-line string representation of the given semantic graph, using the given number of spaces for indentation.
|
private void |
formatSGNodeMultiline(ASemanticGraph semanticGraphDecorator,
GraphNode node,
int spaces0)
Appends to this.out a multi-line string representation of the given semantic graph, using the given number of spaces for indentation.
|
private java.lang.String |
formatSGNodeOneline(ASemanticGraph sg,
GraphNode node) |
private void |
formatSGNodeOnelineHelper(ASemanticGraph sgx,
GraphNode node,
java.lang.StringBuffer sb,
java.util.Set<GraphNode> usedOneline) |
private static java.lang.String |
repeat(java.lang.String s,
int times) |
private static int |
sentIndex(GraphNode node) |
private static java.lang.String |
toStringCompleteFormat(GraphNode node) |
private static final java.lang.String LPAREN
private static final java.lang.String RPAREN
private static final java.lang.String SPACE
private static final java.lang.String COLON
private static final int DEFAULT_WIDTH
private static final int DEFAULT_INDENT
private static final boolean DEFAULT_SMART_INDENT
private static final boolean DEFAULT_SHOW_RELNS
private static final boolean DEFAULT_SHOW_TAGS
private static final boolean DEFAULT_SHOW_ANNOS
private static final boolean DEFAULT_SHOW_INDICES
private final int width
private final int indent
private final boolean smartIndent
private final boolean showRelns
private final boolean showTags
private final boolean showAnnos
private final boolean showIndices
private java.lang.StringBuffer out
private java.util.Set<GraphNode> used
public ASemanticGraphPrinter()
public ASemanticGraphPrinter(int width, int indent, boolean smartIndent, boolean showRelns, boolean showTags, boolean showAnnos, boolean showIndices)
public java.lang.String formatSemanticGraph(ASemanticGraph sgx)
sgx
- semantic graph artifactprivate void formatSGNode(ASemanticGraph semanticGraphDecorator, GraphNode node, int spaces)
semanticGraphDecorator
- semantic graph decoratornode
- nodespaces
- spacesprivate java.lang.String formatSGNodeOneline(ASemanticGraph sg, GraphNode node)
private void formatSGNodeOnelineHelper(ASemanticGraph sgx, GraphNode node, java.lang.StringBuffer sb, java.util.Set<GraphNode> usedOneline)
private void formatSGNodeMultiline(ASemanticGraph semanticGraphDecorator, GraphNode node, int spaces0)
semanticGraphDecorator
- semantic graph decoratornode
- nodespaces0
- spacesprivate java.lang.String formatLabel(GraphNode node)
private static java.lang.String repeat(java.lang.String s, int times)
private static int sentIndex(GraphNode node)
private static java.lang.String toStringCompleteFormat(GraphNode node)