@Test public void testShow() { Parse p1 = Parse.parseParse(PARSE_STRING); StringBuffer parseString = new StringBuffer(); p1.show(parseString); Parse p2 = Parse.parseParse(parseString.toString()); Assert.assertEquals(p1, p2); }
public void show(StringBuffer sb) { int start; start = span.getStart(); if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append("("); sb.append(type).append(" "); } for (Iterator<Parse> i = parts.iterator(); i.hasNext();) { Parse c = i.next(); Span s = c.span; if (start < s.getStart()) { sb.append(encodeToken(text.substring(start, s.getStart()))); } c.show(sb); start = s.getEnd(); } if (start < span.getEnd()) { sb.append(encodeToken(text.substring(start, span.getEnd()))); } if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append(")"); } }
Parse implements Cloneable, Comparable<Parse> { public void show(StringBuffer sb) { int start; start = span.getStart(); if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append("("); sb.append(type).append(" "); } for (Iterator<Parse> i = parts.iterator(); i.hasNext();) { Parse c = i.next(); Span s = c.span; if (start < s.getStart()) { sb.append(encodeToken(text.substring(start, s.getStart()))); } c.show(sb); start = s.getEnd(); } if (start < span.getEnd()) { sb.append(encodeToken(text.substring(start, span.getEnd()))); } if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append(")"); } } }
Parse implements Cloneable, Comparable<Parse> { public void show(StringBuffer sb) { int start; start = span.getStart(); if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append("("); sb.append(type).append(" "); } for (Iterator<Parse> i = parts.iterator(); i.hasNext();) { Parse c = i.next(); Span s = c.span; if (start < s.getStart()) { sb.append(encodeToken(text.substring(start, s.getStart()))); } c.show(sb); start = s.getEnd(); } if (start < span.getEnd()) { sb.append(encodeToken(text.substring(start, span.getEnd()))); } if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append(")"); } } Parse(String text, Span span, String type, double p, int index);  Parse(String text, Span span, String type, double p, Parse h); }
Parse implements Cloneable, Comparable<Parse> { public void show(StringBuffer sb) { int start; start = span.getStart(); if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append("("); sb.append(type).append(" "); } for (Iterator<Parse> i = parts.iterator(); i.hasNext();) { Parse c = i.next(); Span s = c.span; if (start < s.getStart()) { sb.append(encodeToken(text.substring(start, s.getStart()))); } c.show(sb); start = s.getEnd(); } if (start < span.getEnd()) { sb.append(encodeToken(text.substring(start, span.getEnd()))); } if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append(")"); } } Parse(String text, Span span, String type, double p, int index);  Parse(String text, Span span, String type, double p, Parse h); @Override Object clone(); Parse clone(Parse node); Parse cloneRoot(Parse node, int parseIndex); static void useFunctionTags(boolean uft); void setType(String type); String getType(); Collection<Parse> getPreviousPunctuationSet(); void addPreviousPunctuation(Parse punct); Collection<Parse> getNextPunctuationSet(); void addNextPunctuation(Parse punct); void setNextPunctuation(Collection<Parse> punctSet); void setPrevPunctuation(Collection<Parse> punctSet); void insert(final Parse constituent); void show(StringBuffer sb); void show(); double getTagSequenceProb(); boolean complete(); String getCoveredText(); @Override String toString(); String getText(); Span getSpan(); double getProb(); void addProb(double logProb); Parse[] getChildren(); void setChild(int index, String label); void add(Parse daughter, HeadRules rules); void remove(int index); Parse adjoinRoot(Parse node, HeadRules rules, int parseIndex); Parse adjoin(Parse sister, HeadRules rules); void expandTopNode(Parse root); int getChildCount(); int indexOf(Parse child); Parse getHead(); int getHeadIndex(); String getLabel(); void setLabel(String label); void updateHeads(HeadRules rules); void updateSpan(); static void pruneParse(Parse parse); static void fixPossesives(Parse parse); static Parse parseParse(String parse); static Parse parseParse(String parse, GapLabeler gl); Parse getParent(); void setParent(Parse parent); boolean isPosTag(); boolean isFlat(); void isChunk(boolean ic); boolean isChunk(); Parse[] getTagNodes(); Parse[] getTokenNodes(); Parse getCommonParent(Parse node); @Override boolean equals(Object obj); @Override int hashCode(); int compareTo(Parse p); StringBuffer getDerivation(); void setDerivation(StringBuffer derivation); void showCodeTree(); static void addNames(String tag, Span[] names, Parse[] tokens); }
Parse implements Cloneable, Comparable<Parse> { public void show(StringBuffer sb) { int start; start = span.getStart(); if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append("("); sb.append(type).append(" "); } for (Iterator<Parse> i = parts.iterator(); i.hasNext();) { Parse c = i.next(); Span s = c.span; if (start < s.getStart()) { sb.append(encodeToken(text.substring(start, s.getStart()))); } c.show(sb); start = s.getEnd(); } if (start < span.getEnd()) { sb.append(encodeToken(text.substring(start, span.getEnd()))); } if (!type.equals(AbstractBottomUpParser.TOK_NODE)) { sb.append(")"); } } Parse(String text, Span span, String type, double p, int index);  Parse(String text, Span span, String type, double p, Parse h); @Override Object clone(); Parse clone(Parse node); Parse cloneRoot(Parse node, int parseIndex); static void useFunctionTags(boolean uft); void setType(String type); String getType(); Collection<Parse> getPreviousPunctuationSet(); void addPreviousPunctuation(Parse punct); Collection<Parse> getNextPunctuationSet(); void addNextPunctuation(Parse punct); void setNextPunctuation(Collection<Parse> punctSet); void setPrevPunctuation(Collection<Parse> punctSet); void insert(final Parse constituent); void show(StringBuffer sb); void show(); double getTagSequenceProb(); boolean complete(); String getCoveredText(); @Override String toString(); String getText(); Span getSpan(); double getProb(); void addProb(double logProb); Parse[] getChildren(); void setChild(int index, String label); void add(Parse daughter, HeadRules rules); void remove(int index); Parse adjoinRoot(Parse node, HeadRules rules, int parseIndex); Parse adjoin(Parse sister, HeadRules rules); void expandTopNode(Parse root); int getChildCount(); int indexOf(Parse child); Parse getHead(); int getHeadIndex(); String getLabel(); void setLabel(String label); void updateHeads(HeadRules rules); void updateSpan(); static void pruneParse(Parse parse); static void fixPossesives(Parse parse); static Parse parseParse(String parse); static Parse parseParse(String parse, GapLabeler gl); Parse getParent(); void setParent(Parse parent); boolean isPosTag(); boolean isFlat(); void isChunk(boolean ic); boolean isChunk(); Parse[] getTagNodes(); Parse[] getTokenNodes(); Parse getCommonParent(Parse node); @Override boolean equals(Object obj); @Override int hashCode(); int compareTo(Parse p); StringBuffer getDerivation(); void setDerivation(StringBuffer derivation); void showCodeTree(); static void addNames(String tag, Span[] names, Parse[] tokens); static final String BRACKET_LRB; static final String BRACKET_RRB; static final String BRACKET_LCB; static final String BRACKET_RCB; static final String BRACKET_LSB; static final String BRACKET_RSB; }