ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1813314 - /ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/lookup2/consumer/DefaultTermConsumer.java
Date Wed, 25 Oct 2017 15:08:49 GMT
Author: seanfinan
Date: Wed Oct 25 15:08:48 2017
New Revision: 1813314

URL: http://svn.apache.org/viewvc?rev=1813314&view=rev
Log:
Allow comma-separated semantic group codes in blacklist files.

Modified:
    ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/lookup2/consumer/DefaultTermConsumer.java

Modified: ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/lookup2/consumer/DefaultTermConsumer.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/lookup2/consumer/DefaultTermConsumer.java?rev=1813314&r1=1813313&r2=1813314&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/lookup2/consumer/DefaultTermConsumer.java
(original)
+++ ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/lookup2/consumer/DefaultTermConsumer.java
Wed Oct 25 15:08:48 2017
@@ -112,11 +112,15 @@ final public class DefaultTermConsumer e
                LOGGER.warn( "Blacklist line is not correct <semanticType>|<text>
format " + line );
                continue;
             }
-            final Integer key = attemptParseInt( splits[ 0 ] );
-            if ( caseSensitive ) {
-               blacklists.placeValue( key, splits[ 1 ].trim() );
-            } else {
-               blacklists.placeValue( key, splits[ 1 ].trim().toLowerCase() );
+            final String[] keys = splits[ 0 ].split( "," );
+            final String text = splits[ 1 ].trim();
+            for ( String key : keys ) {
+               final Integer num = attemptParseInt( key.trim() );
+               if ( caseSensitive ) {
+                  blacklists.placeValue( num, text );
+               } else {
+                  blacklists.placeValue( num, text.toLowerCase() );
+               }
             }
          }
       } catch ( IOException ioE ) {



Mime
View raw message