You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2012/05/07 11:40:10 UTC

svn commit: r1334941 - /opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitDocumentHandler.java

Author: joern
Date: Mon May  7 09:40:10 2012
New Revision: 1334941

URL: http://svn.apache.org/viewvc?rev=1334941&view=rev
Log:
OPENNLP-342 Fixed a bug in compound word handling, the text buffer was not cleared correctly.

Modified:
    opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitDocumentHandler.java

Modified: opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitDocumentHandler.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitDocumentHandler.java?rev=1334941&r1=1334940&r2=1334941&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitDocumentHandler.java (original)
+++ opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitDocumentHandler.java Mon May  7 09:40:10 2012
@@ -83,7 +83,7 @@ class ConstitDocumentHandler extends Def
       
       // insideCompoundElement
       if (attributes.getValue(COMPOUND_ATTR_NAME) != null) {
-        isCompoundWord = "yes".equals(COMPOUND_ATTR_NAME);
+        isCompoundWord = "yes".equals(attributes.getValue(COMPOUND_ATTR_NAME));
       }
       
       String cat = attributes.getValue("cat");
@@ -165,6 +165,8 @@ class ConstitDocumentHandler extends Def
         
         insideSentenceElement = false;
       }
+      
+      tokenBuffer.setLength(0);
     }
   }
 }