diff -Nru src-orig/edu/stanford/nlp/parser/ui/TreeJPanel.java src/edu/stanford/nlp/parser/ui/TreeJPanel.java --- src-orig/edu/stanford/nlp/parser/ui/TreeJPanel.java 2007-08-20 01:18:26.000000000 +0200 +++ src/edu/stanford/nlp/parser/ui/TreeJPanel.java 2007-12-02 18:52:56.000000000 +0100 @@ -201,6 +201,7 @@ public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Dimension space = getSize(); FontMetrics fM = pickFont(g2, tree, space); double width = width(tree, fM); @@ -259,5 +260,19 @@ frame.setVisible(true); frame.setVisible(true); } + + public Font pickFont() { + Font font = getFont(); + String name = font.getName(); + int style = font.getStyle(); + int size = ( maxFontSize + minFontSize ) / 2; + return new Font(name, style, size); + } -} + public Dimension getTreeDimension(Tree tree, Font font) { + FontMetrics fM = getFontMetrics(font); + double width = width(tree, fM); + double height = height(tree, fM); + return new Dimension((int)width, (int)height); + } +} diff -Nru src-orig/edu/stanford/nlp/trees/GrammaticalRelation.java src/edu/stanford/nlp/trees/GrammaticalRelation.java --- src-orig/edu/stanford/nlp/trees/GrammaticalRelation.java 2007-08-20 01:18:26.000000000 +0200 +++ src/edu/stanford/nlp/trees/GrammaticalRelation.java 2008-01-19 10:59:24.000000000 +0100 @@ -98,14 +98,14 @@ */ public static final GrammaticalRelation KILL = new GrammaticalRelation("KILL", "dummy relation kill", null, null, StringUtils.EMPTY_STRING_ARRAY); - private final String shortName; - private final String longName; - private GrammaticalRelation parent; - private List children = new ArrayList(); + protected String shortName; + protected String longName; + protected GrammaticalRelation parent; + protected List children = new ArrayList(); // a regexp for node values at which this relation can hold - private Pattern sourcePattern = null; - private List targetPatterns = new ArrayList(); - private String specific = null; // to hold the specific prep or conjunction associated with the grammatical relation + protected Pattern sourcePattern = null; + protected List targetPatterns = new ArrayList(); + protected String specific = null; // to hold the specific prep or conjunction associated with the grammatical relation public GrammaticalRelation(String shortName, String longName, @@ -136,7 +136,7 @@ } } - private void addChild(GrammaticalRelation child) { + protected void addChild(GrammaticalRelation child) { children.add(child); } @@ -212,6 +212,27 @@ return parent; } + /** + * Returns the children of this GrammaticalRelation. + */ + public List children() { + return children; + } + + /** + * Returns the source patterns of this GrammaticalRelation. + */ + public Pattern getSourcePattern() { + return sourcePattern; + } + + /** + * Returns the target patterns of this GrammaticalRelation. + */ + public List getTargetPatterns() { + return targetPatterns; + } + public boolean equals(GrammaticalRelation gr) { if(this.shortName.equals(gr.shortName) && this.specific == gr.specific) { return true; diff -Nru src-orig/edu/stanford/nlp/trees/tregex/TregexParser.java src/edu/stanford/nlp/trees/tregex/TregexParser.java --- src-orig/edu/stanford/nlp/trees/tregex/TregexParser.java 2007-08-20 01:18:26.000000000 +0200 +++ src/edu/stanford/nlp/trees/tregex/TregexParser.java 2008-02-19 07:32:42.000000000 +0100 @@ -467,6 +467,7 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; + underNegation = false; for (int i = 0; i < 22; i++) jj_la1[i] = -1; } @@ -492,6 +493,7 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; + underNegation = false; for (int i = 0; i < 22; i++) jj_la1[i] = -1; } @@ -515,6 +517,7 @@ token = new Token(); jj_ntk = -1; jj_gen = 0; + underNegation = false; for (int i = 0; i < 22; i++) jj_la1[i] = -1; }