ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brittfi...@apache.org
Subject svn commit: r1581102 - /ctakes/sandbox/ctakes-dictionary-lookup2/src/main/java/org/apache/ctakes/dictionary/lookup2/dictionary/AbstractRareWordDictionary.java
Date Mon, 24 Mar 2014 22:39:27 GMT
Author: brittfitch
Date: Mon Mar 24 22:39:27 2014
New Revision: 1581102

URL: http://svn.apache.org/r1581102
Log:
fix for UnsupportedOperationException when trying to add variant hits to an immutable collection.

Modified:
    ctakes/sandbox/ctakes-dictionary-lookup2/src/main/java/org/apache/ctakes/dictionary/lookup2/dictionary/AbstractRareWordDictionary.java

Modified: ctakes/sandbox/ctakes-dictionary-lookup2/src/main/java/org/apache/ctakes/dictionary/lookup2/dictionary/AbstractRareWordDictionary.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-dictionary-lookup2/src/main/java/org/apache/ctakes/dictionary/lookup2/dictionary/AbstractRareWordDictionary.java?rev=1581102&r1=1581101&r2=1581102&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-dictionary-lookup2/src/main/java/org/apache/ctakes/dictionary/lookup2/dictionary/AbstractRareWordDictionary.java
(original)
+++ ctakes/sandbox/ctakes-dictionary-lookup2/src/main/java/org/apache/ctakes/dictionary/lookup2/dictionary/AbstractRareWordDictionary.java
Mon Mar 24 22:39:27 2014
@@ -22,6 +22,7 @@ package org.apache.ctakes.dictionary.loo
 import org.apache.ctakes.dictionary.lookup2.util.FastLookupToken;
 import org.apache.ctakes.dictionary.lookup2.term.RareWordTerm;
 
+import java.util.ArrayList;
 import java.util.Collection;
 
 /**
@@ -69,7 +70,8 @@ abstract public class AbstractRareWordDi
       if ( fastLookupToken.getVariant() == null ) {
          return getRareWordHits( fastLookupToken.getText() );
       }
-      final Collection<RareWordTerm> terms = getRareWordHits( fastLookupToken.getText()
);
+      final Collection<RareWordTerm> terms = new ArrayList<RareWordTerm>();
+      terms.addAll( getRareWordHits( fastLookupToken.getText() ) );
       terms.addAll( getRareWordHits( fastLookupToken.getVariant() ) );
       return terms;
    }



Mime
View raw message