ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1591985 [2/2] - in /ctakes/sandbox/dictionarytool: data/default/ doc/ example/ example/org/ example/org/apache/ example/org/apache/ctakes/ example/org/apache/ctakes/dictionarytool/ src/org/apache/ctakes/dictionarytool/ src/org/apache/ctake...
Date Fri, 02 May 2014 17:47:45 GMT
Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/CreatorProperties.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/CreatorProperties.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/CreatorProperties.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/CreatorProperties.java
Fri May  2 17:47:44 2014
@@ -9,6 +9,7 @@ import net.jcip.annotations.NotThreadSaf
  */
 @NotThreadSafe
 final public class CreatorProperties {
+   // Could have made this a singleton with defaults set on creation and a "setOptions",
but that is kind of bad form
 
    static private final String DEFAULT_DATA_DIR = "./data/default";
    static private final String DEFAULT_TUI_FILE = DEFAULT_DATA_DIR + "/CtakesAllTuis.txt";
@@ -17,7 +18,7 @@ final public class CreatorProperties {
 
    private boolean _rareWordIndex = true;
 
-   public CreatorProperties( final String ... args ) {
+   public CreatorProperties( final String... args ) {
       if ( args.length == 0 ) {
          printHelp();
          System.exit( 0 );
@@ -41,12 +42,14 @@ final public class CreatorProperties {
    }
 
    static private void printHelp() {
-      System.out.println( "Dictionary Creator: Creates a flat file Cui|Text or Database Dictionary
from UMLS and Orangebook" );
-      System.out.println( "Database Dictionary can be indexed by each Text's First Word or
Rarest Word (for the dictionary)" );
+      System.out.println(
+            "Dictionary Creator: Creates a flat file Cui|Text or Database Dictionary from
UMLS and Orangebook" );
+      System.out.println(
+            "Database Dictionary can be indexed by each Text's First Word or Rarest Word
(for the dictionary)" );
       System.out.println( "Minimal Usage: DictionaryCreator -umls pathToUmlsRoot -ol pathToFlatFileOutput"
);
       System.out.println( "" );
       System.out.println( "-fw \t\tCreate First Word Index" );
-//      System.out.println( "-ct \t\tUse cTakes default setup (default)" );
+      //      System.out.println( "-ct \t\tUse cTakes default setup (default)" );
       for ( Option option : Option.values() ) {
          System.out.println( option.getHelp() );
       }
@@ -55,7 +58,8 @@ final public class CreatorProperties {
       System.out.println( "The default index type for databases is Rare Word Index" );
       System.out.println( "If an Orangebook Path is not specified then (orangebook) medication
terms are not written" );
       System.out.println( "If a Format Data Directory is not specified then the default is
used: " + DEFAULT_DATA_DIR );
-      System.out.println( "If an Input Tui List Path is not specified then the cTakes Tuis
are used: " + DEFAULT_TUI_FILE );
+      System.out.println(
+            "If an Input Tui List Path is not specified then the cTakes Tuis are used: "
+ DEFAULT_TUI_FILE );
       System.out.println( "If a Source Type List Path is not specified then Snomed is used:
" + DEFAULT_SOURCE_FILE );
    }
 
@@ -96,7 +100,7 @@ final public class CreatorProperties {
       ORANGE_BOOK( "Orangebook Path", "-ob" ),
       FORMAT_DATA( "Format Data Directory", "-fd" ),
       TUI_LIST( "Input Tui List Path", "-tui" ),
-//      SEM_LIST( "Input Semantic Group List Path", "-sem" ),
+      //      SEM_LIST( "Input Semantic Group List Path", "-sem" ),
       SOURCE( "Source Type List Path", "-src" ),
       TERM_LIST( "Output Cui and Term List Path", "-ol" ),
       DATA_BASE( "Output Database Url", "-db" ),
@@ -126,17 +130,17 @@ final public class CreatorProperties {
          return __value != null && !__value.isEmpty();
       }
 
-      private void parseValue( final String ... args ) {
-         if ( args[args.length-1].equalsIgnoreCase( __key ) ) {
+      private void parseValue( final String... args ) {
+         if ( args[args.length - 1].equalsIgnoreCase( __key ) ) {
             System.err.println( "An argument is needed for " + __name + " (" + __key + ")"
);
             return;
          }
-         for ( int i=0; i<args.length-1; i++ ) {
+         for ( int i = 0; i < args.length - 1; i++ ) {
             if ( args[i].equalsIgnoreCase( __key ) ) {
                if ( hasValue() ) {
                   System.err.println( __name + " (" + __key + ") has been set more than once"
);
                }
-               __value = args[i+1];
+               __value = args[i + 1];
                // don't break yet, check for repeat setting
             }
          }
@@ -148,5 +152,4 @@ final public class CreatorProperties {
    }
 
 
-
 }

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/CuiTuiUtil.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/CuiTuiUtil.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/CuiTuiUtil.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/CuiTuiUtil.java
Fri May  2 17:47:44 2014
@@ -1,5 +1,14 @@
 package org.apache.ctakes.dictionarytool.util;
 
+import org.apache.ctakes.dictionarytool.reader.UmlsCuisForTuisReader;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.apache.ctakes.dictionarytool.util.UmlsFileName.CUI_TERM_MAP;
+import static org.apache.ctakes.dictionarytool.util.UmlsFileName.CUI_TUI_MAP;
+
 /**
  * Author: SPF
  * Affiliation: CHIP-NLP
@@ -26,4 +35,27 @@ final public class CuiTuiUtil {
       return "T" + tui;
    }
 
+   static public Map<String, Collection<String>> getValidCuisAndTuis( final String
umlsPath,
+                                                                      final Collection<String>
wantedSources,
+                                                                      final Collection<String>
wantedTuis ) {
+      // get all the Cuis for the wanted Tuis.  Key = Cui, Value = Tuis to which the Cui
belongs
+      final Map<String, Collection<String>> wantedCuisAndTuis
+            = UmlsCuisForTuisReader.readUmlsCuisForTuis( umlsPath + '/' + CUI_TUI_MAP._filename,
wantedTuis );
+      if ( wantedSources.isEmpty() ) {
+         // No specified source types, assume that all sources are valid
+         return wantedCuisAndTuis;
+      }
+      // filter out the Cuis that do not belong to the given sources
+      final Collection<String> validCuis
+            = UmlsSourceTypeCuiValidator.getSourceTypeValidCuis( umlsPath + '/' + CUI_TERM_MAP._filename,
+                                                                 wantedSources,
+                                                                 wantedCuisAndTuis.keySet()
);
+      // Key = Cui, Value = Tuis to which the Cui belongs
+      final Map<String, Collection<String>> validCuisAndTuis = new HashMap<String,
Collection<String>>();
+      for ( String validCui : validCuis ) {
+         validCuisAndTuis.put( validCui, wantedCuisAndTuis.get( validCui ) );
+      }
+      return validCuisAndTuis;
+   }
+
 }

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/FileUtil.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/FileUtil.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/FileUtil.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/FileUtil.java
Fri May  2 17:47:44 2014
@@ -32,7 +32,7 @@ final public class FileUtil {
       } else if ( dirPath.startsWith( "~" ) ) {
          return parseDirText( dirPath.replaceAll( "~", System.getProperty( "user.home" )
) );
       } else if ( dirPath.equals( "." ) ) {
-         final String userDir = System.getProperty("user.dir");
+         final String userDir = System.getProperty( "user.dir" );
          if ( userDir == null || userDir.isEmpty() ) {
             return FileSystemView.getFileSystemView().getDefaultDirectory().getPath();
          }
@@ -58,7 +58,6 @@ final public class FileUtil {
    }
 
 
-
    static public BufferedReader createReader( final String filePath ) {
       final String formattedPath = parseDirText( filePath );
       final File file = new File( formattedPath );
@@ -96,8 +95,7 @@ final public class FileUtil {
       try {
          String line = reader.readLine();
          while ( line != null ) {
-            line = line.trim();
-            if ( !line.isEmpty() && !line.startsWith( "//" ) ) {
+            if ( !line.trim().isEmpty() && !line.trim().startsWith( "//" ) ) {
                return line;
             }
             line = reader.readLine();

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/JdbcUtil.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/JdbcUtil.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/JdbcUtil.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/JdbcUtil.java
Fri May  2 17:47:44 2014
@@ -45,10 +45,10 @@ final public class JdbcUtil {
       return connection;
    }
 
-//   static public String createRowInsertSql( final String tableName, final int valueCount
) {
-   static public String createRowInsertSql( final String tableName, final Enum ... fields
) {
+   //   static public String createRowInsertSql( final String tableName, final int valueCount
) {
+   static public String createRowInsertSql( final String tableName, final Enum... fields
) {
 
-   final StringBuilder sb = new StringBuilder( "insert into" );
+      final StringBuilder sb = new StringBuilder( "insert into" );
       sb.append( " " ).append( tableName );
       sb.append( " (" );
       for ( Enum field : fields ) {

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/RareWordUtil.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/RareWordUtil.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/RareWordUtil.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/RareWordUtil.java
Fri May  2 17:47:44 2014
@@ -14,7 +14,8 @@ import java.util.Set;
  */
 final public class RareWordUtil {
 
-   private RareWordUtil() {}
+   private RareWordUtil() {
+   }
 
    // LookupDesc for the standard excluded pos tags are
    //   VB,VBD,VBG,VBN,VBP,VBZ,CC,CD,DT,EX,LS,MD,PDT,POS,PP,PP$,PRP,PRP$,RP,TO,WDT,WP,WPS,WRB
@@ -23,43 +24,6 @@ final public class RareWordUtil {
    // CD, CC, DT, EX, MD, PDT, PP, PP$, PRP, PRP$, RP, TO, WDT, WP, WPS, WRB
    // why not WP$ (possessive wh- pronoun "whose")
    // PP$ is a Brown POS tag, not Penn Treebank (as are the rest)
-//   static private final String[] BAD_POS_TERMS = {
-//         // CD  cardinal number
-//         "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
"ten",
-//         // CC  coordinating conjunction
-//         "and", "or", "but", "for", "nor", "so", "yet",
-//         // DT  determiner
-//         "this", "that", "these", "those", "the",
-//         // EX  existential there
-//         "there",
-//         // MD  modal
-//         "can", "should", "will", "may", "might", "must", "could", "would",
-//         // PDT  predeterminer
-//         "some", "any", "all", "both", "half", "none", "twice",
-//         // PP  prepositional phrase (preposition)
-//         "at", "before", "after", "behind", "beneath", "beside", "between", "into", "through",
"across", "of",
-//         "concerning", "like", "except", "with", "without", "toward", "to", "past", "against",
"during", "until",
-//         "throughout", "below", "besides", "beyond", "from", "inside", "near", "outside",
"since", "upon",
-//         // PP$  possessive personal pronoun - Brown POS tag, not Penn TreeBank
-//         "my", "our",
-//         // PRP  personal pronoun
-//         "i", "you", "he", "she", "it",
-//         // PRP$  possesive pronoun
-//         "mine", "yours", "his", "hers", "its", "ours", "theirs",
-//         // RP  particle  - this contains some prepositions
-//         "about", "off", "up", "along", "away", "back", "by", "down", "forward", "in",
"on", "out",
-//         "over", "around", "under",
-//         // TO  to  - also a preposition
-//         "to",
-//         // WDT  wh- determiner
-//         "what", "whatever", "which", "whichever",
-//         // WP, WPS  wh- pronoun, nominative wh- pronoun
-//         "who", "whom", "which", "that", "whoever", "whomever",
-//         // WRB
-//         "how", "where", "when", "however", "wherever", "whenever",
-//         // Mine ...
-//         "no"
-//   };
 
    static private Set<String> BAD_POS_TERM_SET;
 

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/TokenUtil.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/TokenUtil.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/TokenUtil.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/TokenUtil.java
Fri May  2 17:47:44 2014
@@ -41,13 +41,13 @@ final public class TokenUtil {
       }
       if ( startIndex < line.length() - 1 ) {
          tokens.add( line.substring( startIndex ) );
+      } else {
+         tokens.add( "" );
       }
       return tokens;
    }
 
 
-
-
    static public String createBsvLine( final Collection<String> values ) {
       return createBsvLine( values.toArray( new String[values.size()] ) );
    }
@@ -62,6 +62,9 @@ final public class TokenUtil {
    }
 
    static public String createCsvLine( final Collection<String> values ) {
+      if ( values == null ) {
+         return "";
+      }
       return createCsvLine( values.toArray( new String[values.size()] ) );
    }
 

Added: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsFileName.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsFileName.java?rev=1591985&view=auto
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsFileName.java
(added)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsFileName.java
Fri May  2 17:47:44 2014
@@ -0,0 +1,17 @@
+package org.apache.ctakes.dictionarytool.util;
+
+/**
+ * Author: SPF
+ * Affiliation: CHIP-NLP
+ * Date: 3/26/14
+ */
+public enum UmlsFileName {
+   CUI_TUI_MAP( "MRSTY.RRF" ),
+   CUI_TERM_MAP( "MRCONSO.RRF" ),
+   RELATION_LIST( "MRREL.RRF" );
+   final public String _filename;
+
+   private UmlsFileName( final String filename ) {
+      _filename = filename;
+   }
+}

Propchange: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsFileName.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsSourceTypeCuiValidator.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsSourceTypeCuiValidator.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsSourceTypeCuiValidator.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsSourceTypeCuiValidator.java
Fri May  2 17:47:44 2014
@@ -6,6 +6,9 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 
+import static org.apache.ctakes.dictionarytool.util.index.MrconsoIndex.CUI;
+import static org.apache.ctakes.dictionarytool.util.index.MrconsoIndex.SOURCE;
+
 /**
  * Author: SPF
  * Affiliation: CHIP-NLP
@@ -13,14 +16,16 @@ import java.util.List;
  */
 final public class UmlsSourceTypeCuiValidator {
 
-   private UmlsSourceTypeCuiValidator() {}
+   private UmlsSourceTypeCuiValidator() {
+   }
 
 
    /**
     * Can cull the given collection of cuis
-    * @param rrfPath path to the UMLS_ROOT Meta/MRCONSO.RRF file
+    *
+    * @param rrfPath     path to the UMLS_ROOT Meta/MRCONSO.RRF file
     * @param sourceTypes desired source type names as appear in rrf: RXNORM, SNOMEDCT, MSH,
etc.
-    * @param cuis current list of cuis
+    * @param cuis        current list of cuis
     * @return Subset of cuis that exist in in the given sources
     */
    static public Collection<String> getSourceTypeValidCuis( final String rrfPath,
@@ -33,8 +38,8 @@ final public class UmlsSourceTypeCuiVali
          List<String> tokens = FileUtil.readBsvTokens( reader, rrfPath );
          while ( tokens != null ) {
             lineCount++;
-            if ( tokens.size() > RRF_INDEX.SOURCE._index && sourceTypes.contains(
tokens.get( RRF_INDEX.SOURCE._index ) ) ) {
-               final String cui = CuiTuiUtil.getAsCui( tokens.get( RRF_INDEX.CUI._index )
);
+            if ( tokens.size() > SOURCE._index && sourceTypes.contains( tokens.get(
SOURCE._index ) ) ) {
+               final String cui = CuiTuiUtil.getAsCui( tokens.get( CUI._index ) );
                if ( cuis.contains( cui ) ) {
                   validCuis.add( cui );
                }
@@ -57,9 +62,10 @@ final public class UmlsSourceTypeCuiVali
 
    /**
     * Given a collection of cuis, returns all of the cuis that don't exist for the given
source types
-    * @param rrfPath path to the UMLS_ROOT Meta/MRCONSO.RRF file
+    *
+    * @param rrfPath     path to the UMLS_ROOT Meta/MRCONSO.RRF file
     * @param sourceTypes desired source type names as appear in rrf: RXNORM, SNOMEDCT, MSH,
etc.
-    * @param cuis current list of cuis
+    * @param cuis        current list of cuis
     * @return Subset of cuis that don't exist in in the given sources
     */
    static public Collection<String> getSourceTypeInvalidCuis( final String rrfPath,

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsTermUtil.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsTermUtil.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsTermUtil.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/UmlsTermUtil.java
Fri May  2 17:47:44 2014
@@ -7,7 +7,7 @@ import java.util.HashSet;
 
 /**
  * Contains all the methods used to parse individual text definitions of umls terms
- *
+ * <p/>
  * Author: SPF
  * Affiliation: CHIP-NLP
  * Date: 1/16/14
@@ -22,8 +22,9 @@ final public class UmlsTermUtil {
       UNWANTED_PREFIXES( "UnwantedPrefixes.txt" ),
       UNWANTED_SUFFIXES( "UnwantedSuffixes.txt" ),
       MODIFIER_SUFFIXES( "ModifierSuffixes.txt" ),
-      RIGHT_ABBREVIATIONS( "RightAbbreviations.txt");
+      RIGHT_ABBREVIATIONS( "RightAbbreviations.txt" );
       final private String __name;
+
       private DATA_FILE( final String name ) {
          __name = name;
       }
@@ -43,12 +44,12 @@ final public class UmlsTermUtil {
 
    public UmlsTermUtil( final String dataDir ) {
       this( getDataPath( dataDir, DATA_FILE.REMOVAL_PREFIX_TRIGGERS ),
-           getDataPath( dataDir, DATA_FILE.REMOVAL_SUFFIX_TRIGGERS ),
-           getDataPath( dataDir, DATA_FILE.REMOVAL_COLON_TRIGGERS ),
-           getDataPath( dataDir, DATA_FILE.UNWANTED_PREFIXES ),
-           getDataPath( dataDir, DATA_FILE.UNWANTED_SUFFIXES ),
-           getDataPath( dataDir, DATA_FILE.MODIFIER_SUFFIXES ),
-           getDataPath( dataDir, DATA_FILE.RIGHT_ABBREVIATIONS ) );
+            getDataPath( dataDir, DATA_FILE.REMOVAL_SUFFIX_TRIGGERS ),
+            getDataPath( dataDir, DATA_FILE.REMOVAL_COLON_TRIGGERS ),
+            getDataPath( dataDir, DATA_FILE.UNWANTED_PREFIXES ),
+            getDataPath( dataDir, DATA_FILE.UNWANTED_SUFFIXES ),
+            getDataPath( dataDir, DATA_FILE.MODIFIER_SUFFIXES ),
+            getDataPath( dataDir, DATA_FILE.RIGHT_ABBREVIATIONS ) );
    }
 
    public UmlsTermUtil( final String removalPrefixTriggersPath, final String removalSuffixTriggersPath,
@@ -65,6 +66,10 @@ final public class UmlsTermUtil {
    }
 
    public Collection<String> getFormattedTexts( final String text ) {
+      return getFormattedTexts( text, true );
+   }
+
+   public Collection<String> getFormattedTexts( final String text, final boolean extractAbbreviations
) {
       final String tokenizedText = TextTokenizer.getTokenizedText( text );
       if ( tokenizedText == null || tokenizedText.isEmpty() ) {
          return Collections.emptyList();
@@ -76,17 +81,20 @@ final public class UmlsTermUtil {
       if ( validText == null || validText.isEmpty() ) {
          return Collections.emptyList();
       }
-      // add embedded abbreviations
-      Collection<String> extractedTerms = extractAbbreviations( validText );
-      if ( extractedTerms.isEmpty() ) {
-         extractedTerms = autoExtractAcronyms( validText );
+      Collection<String> extractedTerms = Collections.emptySet();
+      if ( extractAbbreviations ) {
+         // add embedded abbreviations
+         extractedTerms = extractAbbreviations( validText );
+         if ( extractedTerms.isEmpty() ) {
+            extractedTerms = autoExtractAcronyms( validText );
+         }
       }
       if ( extractedTerms.isEmpty() ) {
          extractedTerms = extractModifiers( validText );
       }
       if ( !extractedTerms.isEmpty() ) {
          extractedTerms.add( validText );
-         return getPluralTerms( extractedTerms );
+         return getPluralTerms( getValidTexts( extractedTerms ) );
       }
       // Check for embedded and / or terms
       if ( extractedTerms.isEmpty() ) {
@@ -98,22 +106,25 @@ final public class UmlsTermUtil {
       if ( extractedTerms.isEmpty() ) {
          extractedTerms = autoExtractColonBracketTerms( validText );
       }
-//      if ( extractedTerms.isEmpty() ) {
-//         extractedTerms = autoExtractAndBracketTerms( validText );
-//      }
+      //      if ( extractedTerms.isEmpty() ) {
+      //         extractedTerms = autoExtractAndBracketTerms( validText );
+      //      }
       if ( extractedTerms.isEmpty() ) {
          extractedTerms = autoExtractOrBracketTerms( validText );
       }
+      if ( extractedTerms.isEmpty() ) {
+         extractedTerms = autoExtractAndOrOtherTerms( validText );
+      }
       if ( !extractedTerms.isEmpty() ) {
-//         System.out.println( validText );
-//         for ( String et : extractedTerms ) {
-//            System.out.println("  " + et);
-//         }
-         return getPluralTerms( extractedTerms );
+         //         System.out.println( validText );
+         //         for ( String et : extractedTerms ) {
+         //            System.out.println("  " + et);
+         //         }
+         return getPluralTerms( getValidTexts( extractedTerms ) );
       } else {
          Collection<String> texts = new HashSet<String>( 1 );
          texts.add( validText );
-         return getPluralTerms( texts );
+         return getPluralTerms( getValidTexts( texts ) );
       }
    }
 
@@ -133,7 +144,7 @@ final public class UmlsTermUtil {
    private boolean isTextValid( final String text ) {
       // Check for illegal characters
       for ( int i = 0; i < text.length(); i++ ) {
-         if ( text.charAt( i ) < ' ' || text.charAt( i ) > '~'  ) {
+         if ( text.charAt( i ) < ' ' || text.charAt( i ) > '~' ) {
             return false;
          }
       }
@@ -162,6 +173,14 @@ final public class UmlsTermUtil {
       return true;
    }
 
+   private Collection<String> getValidTexts( final Collection<String> texts )
{
+      final Collection<String> validTexts = new HashSet<String>( texts.size()
);
+      for ( String text : texts ) {
+         validTexts.add( getValidText( text ) );
+      }
+      return validTexts;
+   }
+
    private String getValidText( final String text ) {
       // remove form underlines
       if ( text.contains( "_ _ _" ) ) {
@@ -173,36 +192,36 @@ final public class UmlsTermUtil {
          }
       }
       // remove unmatched parentheses, brackets, etc.
-//      if ( text.startsWith( "(" ) && !text.contains( ")" ) ) {
-//         return getValidText( text.substring( 1 ).trim() );
-//      }
-//      if ( text.startsWith( "[" ) && !text.contains( "]" ) ) {
-//         return getValidText( text.substring( 1 ).trim() );
-//      }
-//      if ( text.startsWith( "(" ) && text.endsWith( ") or" ) ) {
-//         return getValidText( text.substring( 1, text.length() - 4 ).trim() );
-//      }
-//      if ( text.startsWith( "or (" ) ) {
-//         return getValidText( text.substring( 2 ).trim() );
-//      }
-//      if ( text.startsWith( "\"" ) && text.endsWith( "\"" ) ) {
-//         return getValidText( text.substring( 1 ).trim() );
-//      }
-//      if ( text.startsWith( "(" ) && text.endsWith( ")" ) ) {
-//         return getValidText( text.substring( 1, text.length() - 2 ).trim() );
-//      }
-//      if ( text.startsWith( "[" ) && text.endsWith( "]" ) ) {
-//         return getValidText( text.substring( 1, text.length() - 2 ).trim() );
-//      }
-//      if ( text.startsWith( "&" ) ) {
-//         return getValidText( text.substring( 1 ).trim() );
-//      }
-//      if ( text.endsWith( "]" ) && !text.contains( "[" ) ) {
-//         return getValidText( text.substring( 0, text.length() - 2 ).trim() );
-//      }
-//      if ( text.endsWith( ")" ) && !text.contains( "(" ) ) {
-//         return getValidText( text.substring( 0, text.length() - 2 ).trim() );
-//      }
+      //      if ( text.startsWith( "(" ) && !text.contains( ")" ) ) {
+      //         return getValidText( text.substring( 1 ).trim() );
+      //      }
+      //      if ( text.startsWith( "[" ) && !text.contains( "]" ) ) {
+      //         return getValidText( text.substring( 1 ).trim() );
+      //      }
+      //      if ( text.startsWith( "(" ) && text.endsWith( ") or" ) ) {
+      //         return getValidText( text.substring( 1, text.length() - 4 ).trim() );
+      //      }
+      //      if ( text.startsWith( "or (" ) ) {
+      //         return getValidText( text.substring( 2 ).trim() );
+      //      }
+      //      if ( text.startsWith( "\"" ) && text.endsWith( "\"" ) ) {
+      //         return getValidText( text.substring( 1 ).trim() );
+      //      }
+      //      if ( text.startsWith( "(" ) && text.endsWith( ")" ) ) {
+      //         return getValidText( text.substring( 1, text.length() - 2 ).trim() );
+      //      }
+      //      if ( text.startsWith( "[" ) && text.endsWith( "]" ) ) {
+      //         return getValidText( text.substring( 1, text.length() - 2 ).trim() );
+      //      }
+      //      if ( text.startsWith( "&" ) ) {
+      //         return getValidText( text.substring( 1 ).trim() );
+      //      }
+      //      if ( text.endsWith( "]" ) && !text.contains( "[" ) ) {
+      //         return getValidText( text.substring( 0, text.length() - 2 ).trim() );
+      //      }
+      //      if ( text.endsWith( ")" ) && !text.contains( "(" ) ) {
+      //         return getValidText( text.substring( 0, text.length() - 2 ).trim() );
+      //      }
       String strippedText = text.trim();
       // Text in umls can have multiple suffixes and/or prefixes.  Stripping just once doesn't
do the trick
       int lastLength = Integer.MAX_VALUE;
@@ -249,8 +268,10 @@ final public class UmlsTermUtil {
       for ( String modifier : _modifierSuffixes ) {
          if ( tokenizedText.endsWith( modifier ) ) {
             final String mainText = tokenizedText.substring( 0, tokenizedText.length() -
modifier.length() ).trim();
-            final String modifierText = modifier.replace( "(", "" ).replace( ")", "" ).trim();
+            final String modifierText
+                  = modifier.replace( "(", "" ).replace( ")", "" ).replace( "-", "" ).replace(
",", "" ).trim();
             final Collection<String> modifiedTexts = new HashSet<String>( 2 );
+            modifiedTexts.add( tokenizedText );
             modifiedTexts.add( modifierText + " " + mainText );
             return modifiedTexts;
          }
@@ -347,7 +368,8 @@ final public class UmlsTermUtil {
       final int lastOf = tokenizedText.lastIndexOf( " of " );
       if ( lastOf > tokenizedText.lastIndexOf( ']' ) ) {
          final String ofTerm = tokenizedText.substring( lastOf ).trim();
-         final Collection<String> ofExtractions = autoExtractOrBracketTerms( tokenizedText.substring(
0, lastOf ).trim() );
+         final Collection<String> ofExtractions = autoExtractOrBracketTerms( tokenizedText.substring(
0,
+                                                                                        
             lastOf ).trim() );
          final Collection<String> ofTexts = new HashSet<String>( ofExtractions.size()
);
          for ( String ofText : ofExtractions ) {
             ofTexts.add( ofText + " " + ofTerm );
@@ -376,7 +398,8 @@ final public class UmlsTermUtil {
       final int lastOf = tokenizedText.lastIndexOf( " of " );
       if ( lastOf > tokenizedText.lastIndexOf( ')' ) ) {
          final String ofTerm = tokenizedText.substring( lastOf ).trim();
-         final Collection<String> ofExtractions = autoExtractOrBracketTerms( tokenizedText.substring(
0, lastOf ).trim() );
+         final Collection<String> ofExtractions = autoExtractOrBracketTerms( tokenizedText.substring(
0,
+                                                                                        
             lastOf ).trim() );
          final Collection<String> ofTexts = new HashSet<String>( ofExtractions.size()
);
          for ( String ofText : ofExtractions ) {
             ofTexts.add( ofText + " " + ofTerm );
@@ -429,20 +452,31 @@ final public class UmlsTermUtil {
       return extractedTerms;
    }
 
+   private Collection<String> autoExtractAndOrOtherTerms( final String tokenizedText
) {
+      final int otherIndex = tokenizedText.indexOf( " & / or other " );
+      if ( otherIndex < 0 ) {
+         return Collections.emptyList();
+      }
+      final Collection<String> otherTexts = new HashSet<String>( 2 );
+      otherTexts.add( tokenizedText.substring( 0, otherIndex ).trim() );
+      otherTexts.add( tokenizedText.substring( otherIndex + 14 ).trim() );
+      return otherTexts;
+   }
+
    static private String trimParaText( String paraText ) {
       if ( paraText.startsWith( "(" ) ) {
          paraText = paraText.substring( 1 );
       }
       if ( paraText.endsWith( " nos " ) || paraText.endsWith( " nec " ) ) {
-         return paraText.substring( 0, paraText.length()-4 ).trim();
-      } else  if ( paraText.endsWith( ", unspecified " ) ) {
+         return paraText.substring( 0, paraText.length() - 4 ).trim();
+      } else if ( paraText.endsWith( ", unspecified " ) ) {
          return paraText.substring( 0, paraText.length() - 14 ).trim();
       } else if ( paraText.endsWith( " nos )" ) || paraText.endsWith( " nec )" ) ) {
          return paraText.substring( 0, paraText.length() - 5 ).trim();
-      } else  if ( paraText.endsWith( ", unspecified )" ) ) {
+      } else if ( paraText.endsWith( ", unspecified )" ) ) {
          return paraText.substring( 0, paraText.length() - 15 ).trim();
       } else if ( paraText.endsWith( ")" ) ) {
-         return paraText.substring( 0, paraText.length()-1 ).trim();
+         return paraText.substring( 0, paraText.length() - 1 ).trim();
       }
       return paraText.trim();
    }
@@ -452,15 +486,15 @@ final public class UmlsTermUtil {
          bracketText = bracketText.substring( 1 );
       }
       if ( bracketText.endsWith( " nos " ) || bracketText.endsWith( " nec " ) ) {
-         return bracketText.substring( 0, bracketText.length()-4 ).trim();
-      } else  if ( bracketText.endsWith( ", unspecified " ) ) {
+         return bracketText.substring( 0, bracketText.length() - 4 ).trim();
+      } else if ( bracketText.endsWith( ", unspecified " ) ) {
          return bracketText.substring( 0, bracketText.length() - 14 ).trim();
       } else if ( bracketText.endsWith( " nos ]" ) || bracketText.endsWith( " nec ]" ) )
{
          return bracketText.substring( 0, bracketText.length() - 5 ).trim();
-      } else  if ( bracketText.endsWith( ", unspecified ]" ) ) {
+      } else if ( bracketText.endsWith( ", unspecified ]" ) ) {
          return bracketText.substring( 0, bracketText.length() - 15 ).trim();
       } else if ( bracketText.endsWith( "]" ) ) {
-         return bracketText.substring( 0, bracketText.length()-1 ).trim();
+         return bracketText.substring( 0, bracketText.length() - 1 ).trim();
       }
       return bracketText.trim();
    }

Added: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrconsoIndex.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrconsoIndex.java?rev=1591985&view=auto
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrconsoIndex.java
(added)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrconsoIndex.java
Fri May  2 17:47:44 2014
@@ -0,0 +1,16 @@
+package org.apache.ctakes.dictionarytool.util.index;
+
+/**
+ * Author: SPF
+ * Affiliation: CHIP-NLP
+ * Date: 1/23/14
+ */
+public enum MrconsoIndex {
+   CUI( 0 ), LANGUAGE( 1 ), STATUS( 2 ), SOURCE( 11 ), SOURCE_CODE( 13 ), TEXT( 14 );
+   final public int _index;
+
+   private MrconsoIndex( final int index ) {
+      _index = index;
+   }
+
+}

Propchange: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrconsoIndex.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrrelIndex.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrrelIndex.java?rev=1591985&view=auto
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrrelIndex.java
(added)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrrelIndex.java
Fri May  2 17:47:44 2014
@@ -0,0 +1,16 @@
+package org.apache.ctakes.dictionarytool.util.index;
+
+/**
+ * Author: SPF
+ * Affiliation: CHIP-NLP
+ * Date: 3/26/14
+ */
+public enum MrrelIndex {
+   CUI_1( 0 ), RELATION( 3 ), CUI_2( 4 ), REFINED( 7 );
+   final public int _index;
+
+   private MrrelIndex( final int index ) {
+      _index = index;
+   }
+
+}

Propchange: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrrelIndex.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrstyIndex.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrstyIndex.java?rev=1591985&view=auto
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrstyIndex.java
(added)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrstyIndex.java
Fri May  2 17:47:44 2014
@@ -0,0 +1,16 @@
+package org.apache.ctakes.dictionarytool.util.index;
+
+/**
+ * Author: SPF
+ * Affiliation: CHIP-NLP
+ * Date: 3/26/14
+ */
+public enum MrstyIndex {
+   CUI( 0 ), TUI( 1 );
+   final public int _index;
+
+   private MrstyIndex( final int index ) {
+      _index = index;
+   }
+
+}

Propchange: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/util/index/MrstyIndex.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiCodesMapWriter.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiCodesMapWriter.java?rev=1591985&view=auto
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiCodesMapWriter.java
(added)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiCodesMapWriter.java
Fri May  2 17:47:44 2014
@@ -0,0 +1,53 @@
+package org.apache.ctakes.dictionarytool.writer;
+
+import org.apache.ctakes.dictionarytool.util.FileUtil;
+import org.apache.ctakes.dictionarytool.util.TokenUtil;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Author: SPF
+ * Affiliation: CHIP-NLP
+ * Date: 3/28/14
+ */
+final public class CuiCodesMapWriter {
+
+   private CuiCodesMapWriter() {
+   }
+
+   static public void writeCuiCodes( final String termFilePath,
+                                     final Map<String, Map<String, Collection<String>>>
cuiCodes ) {
+      final List<String> codeSources = Arrays.asList( "ICD10PCS", "ICD9CM", "RXNORM",
"SNOMEDCT" );
+      Collections.sort( codeSources );
+      System.out.println( "Writing map of Cuis and Codes to " + termFilePath );
+      long lineCount = 0;
+      try {
+         final BufferedWriter writer = FileUtil.createWriter( termFilePath );
+         for ( Map.Entry<String, Map<String, Collection<String>>> cuiCodesEntry
: cuiCodes.entrySet() ) {
+            lineCount++;
+            final String cui = cuiCodesEntry.getKey();
+            final Map<String, Collection<String>> codeMap = cuiCodesEntry.getValue();
+            writer.write( TokenUtil.createBsvLine( cui,
+                                                   TokenUtil.createCsvLine( codeMap.get(
codeSources.get( 0 ) ) ),
+                                                   TokenUtil.createCsvLine( codeMap.get(
codeSources.get( 1 ) ) ),
+                                                   TokenUtil.createCsvLine( codeMap.get(
codeSources.get( 2 ) ) ),
+                                                   TokenUtil.createCsvLine( codeMap.get(
codeSources.get( 3 ) ) ) ) );
+            writer.newLine();
+            if ( lineCount % 100000 == 0 ) {
+               System.out.println( "File Line " + lineCount );
+            }
+         }
+         writer.close();
+      } catch ( IOException ioE ) {
+         System.err.println( "Error writing Term on line " + lineCount + " in file " + termFilePath
);
+      }
+      System.out.println( "Wrote " + lineCount + " terms to " + termFilePath );
+   }
+
+}

Propchange: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiCodesMapWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiTextsMapWriter.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiTextsMapWriter.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiTextsMapWriter.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/CuiTextsMapWriter.java
Fri May  2 17:47:44 2014
@@ -24,7 +24,7 @@ final public class CuiTextsMapWriter {
       long lineCount = 0;
       try {
          final BufferedWriter writer = FileUtil.createWriter( termFilePath );
-         for (  Map.Entry<String,Collection<String>> cuiTextsEntry : cuiTexts.entrySet()
) {
+         for ( Map.Entry<String, Collection<String>> cuiTextsEntry : cuiTexts.entrySet()
) {
             final String cui = cuiTextsEntry.getKey();
             for ( String text : cuiTextsEntry.getValue() ) {
                lineCount++;

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/FirstWordDbWriter.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/FirstWordDbWriter.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/FirstWordDbWriter.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/FirstWordDbWriter.java
Fri May  2 17:47:44 2014
@@ -12,12 +12,12 @@ import java.util.Map;
 /**
  * <p>
  * CREATE CACHED TABLE UMLS_MS_2011AB (
- *    CUI VARCHAR_IGNORECASE(8) NOT NULL,
- *    FWORD VARCHAR_IGNORECASE(80) NOT NULL,
- *    TEXT VARCHAR_IGNORECASE(2048) NOT NULL,
- *    CODE VARCHAR_IGNORECASE(45) NOT NULL,
- *    SOURCETYPE VARCHAR_IGNORECASE(45) NOT NULL,
- *    TUI VARCHAR_IGNORECASE(4) NOT NULL
+ * CUI VARCHAR_IGNORECASE(8) NOT NULL,
+ * FWORD VARCHAR_IGNORECASE(80) NOT NULL,
+ * TEXT VARCHAR_IGNORECASE(2048) NOT NULL,
+ * CODE VARCHAR_IGNORECASE(45) NOT NULL,
+ * SOURCETYPE VARCHAR_IGNORECASE(45) NOT NULL,
+ * TUI VARCHAR_IGNORECASE(4) NOT NULL
  * );
  * CREATE INDEX IDX_UMLS_MS_2011AB ON UMLS_MS_2011AB( FWORD );
  * COMMIT;
@@ -28,12 +28,14 @@ import java.util.Map;
  */
 final public class FirstWordDbWriter {
 
-   private FirstWordDbWriter() {}
+   private FirstWordDbWriter() {
+   }
 
 
    static private enum FIELD {
-      CUI(1),FWORD(2),TEXT(3),CODE(4),SOURCETYPE(5),TUI(6);
+      CUI( 1 ), FWORD( 2 ), TEXT( 3 ), CODE( 4 ), SOURCETYPE( 5 ), TUI( 6 );
       final private int __index;
+
       FIELD( final int index ) {
          __index = index;
       }
@@ -41,8 +43,8 @@ final public class FirstWordDbWriter {
 
 
    static public void writeTermsToDb( final Map<String, Collection<String>> cuiTuis,
-                             final Map<String, Collection<String>> cuiTexts,
-                             final String url, final String user, final String pass, final
String tableName ) {
+                                      final Map<String, Collection<String>> cuiTexts,
+                                      final String url, final String user, final String pass,
final String tableName ) {
       final Connection connection = JdbcUtil.createDatabaseConnection( url, user, pass );
       final String sql = JdbcUtil.createRowInsertSql( tableName, FIELD.values() );
       System.out.println( "Writing to " + tableName );

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/RareWordDbWriter.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/RareWordDbWriter.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/RareWordDbWriter.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/RareWordDbWriter.java
Fri May  2 17:47:44 2014
@@ -15,12 +15,12 @@ import java.util.Map;
 /**
  * <p>
  * CREATE CACHED TABLE CTAKES_UMLS (
- *    CUI VARCHAR_IGNORECASE(12),
- *    TUI VARCHAR_IGNORECASE(48),
- *    RINDEX INTEGER,
- *    TCOUNT INTEGER,
- *    TEXT VARCHAR_IGNORECASE(255),
- *    RWORD VARCHAR_IGNORECASE(48)
+ * CUI VARCHAR_IGNORECASE(12),
+ * TUI VARCHAR_IGNORECASE(48),
+ * RINDEX INTEGER,
+ * TCOUNT INTEGER,
+ * TEXT VARCHAR_IGNORECASE(255),
+ * RWORD VARCHAR_IGNORECASE(48)
  * );
  * CREATE INDEX IDX_CTAKES_UMLS ON CTAKES_UMLS( RWORD );
  * COMMIT;
@@ -31,11 +31,13 @@ import java.util.Map;
  */
 final public class RareWordDbWriter {
 
-   private RareWordDbWriter() {}
+   private RareWordDbWriter() {
+   }
 
    static private enum FIELD {
-      CUI(1),TUI(2),RINDEX(3),TCOUNT(4),TEXT(5),RWORD(6);
+      CUI( 1 ), TUI( 2 ), RINDEX( 3 ), TCOUNT( 4 ), TEXT( 5 ), RWORD( 6 );
       final private int __index;
+
       FIELD( final int index ) {
          __index = index;
       }
@@ -43,8 +45,8 @@ final public class RareWordDbWriter {
 
 
    static public void writeTermsToDb( final Map<String, Collection<String>> cuiTuis,
-                            final Map<String, Collection<String>> cuiTexts,
-                            final String url, final String user, final String pass, final
String tableName ) {
+                                      final Map<String, Collection<String>> cuiTexts,
+                                      final String url, final String user, final String pass,
final String tableName ) {
       final Connection connection = JdbcUtil.createDatabaseConnection( url, user, pass );
       final String sql = JdbcUtil.createRowInsertSql( tableName, FIELD.values() );
       try {

Modified: ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/TuiListWriter.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/TuiListWriter.java?rev=1591985&r1=1591984&r2=1591985&view=diff
==============================================================================
--- ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/TuiListWriter.java
(original)
+++ ctakes/sandbox/dictionarytool/src/org/apache/ctakes/dictionarytool/writer/TuiListWriter.java
Fri May  2 17:47:44 2014
@@ -11,7 +11,8 @@ import java.util.Collection;
  */
 final public class TuiListWriter {
 
-   private TuiListWriter() {}
+   private TuiListWriter() {
+   }
 
    static public void writeTuiList( final String tuiFilePath, final Collection<String>
typeTuis ) {
       FileUtil.writeOneColumn( tuiFilePath, "list of Tuis", typeTuis );



Mime
View raw message