gov.nih.nlm.umls.io
Class RichMRFilesIndexLookup

java.lang.Object
  extended bygov.nih.nlm.umls.io.RichMRFilesIndexLookup

public class RichMRFilesIndexLookup
extends Object

Peforms a lookup in the index files to locate the Concepts that contain given words.

Author:
Deborah Shapiro

Constructor Summary
RichMRFilesIndexLookup(String dir)
          Instantiates an RichMRFilesIndexLookup from the specified input directory.
 
Method Summary
 void close()
          Release resources being used by this class.
 int countChildContexts(Context cxt)
          Looks up the given Context in the appropriate index files and returns the count of Contexts whose ptr matches the given one + the aui.
 int countSiblingContexts(Context cxt)
          Looks up the given Context in the appropriate index files and returns the count of Contexts whose ptr matches the given one.
 Context findAncestorContext(Context cxt, String ptr)
          Looks up the given ptr in the appropriate index files and returns the matching ancestor.
 Atom findAtomByAui(String aui)
          Looks up the given aui in the AUI_MRCONSO.x index file and returns the Atom that contains the given aui.
 Context[] findChildContexts(Context cxt)
          Looks up the given Context's ptr + aui in the appropriate index files and returns the Contexts with matching ptrs.
 Concept findConceptByAui(String aui)
          Looks up the given aui in the AUI_MRCONSO.x index file and returns the Concept that contains the given aui.
 Concept findConceptByCui(String cui)
          Looks up the given cui in MRCONSO and returns the Concept associated with the given cui.
 Concept[] findConceptsByNormWords(String[] p_words)
          Looks up the given normalized words in the appropriate index files and returns the Concepts whose Strings contain all of the words.
 Concept[] findConceptsByWords(String[] p_words)
          Looks up the given words in the appropriate index files and returns the Concepts whose Strings contain all of the words.
 Context[] findSiblingContexts(Context cxt)
          Looks up the given Context's ptr in the appropriate index files and returns the Contexts with matching ptrs.
 String getLanguage()
          Returns the language of the index file that should be searched.
 int getPreviousTotalResultCount()
          Returns the total number of concept matches found on the previous search.
 double getThreshold()
          Returns the rank threshold value for searching.
 int getWordCountThreshold()
          Returns the rank threshold value for searching.
 void setLanguage(String lat)
          Sets the language of the index file that should be searched.
 void setMaxResults(int max_results)
          Sets the maximum number of results that should be returned.
 void setThreshold(double threshold)
          Sets the rank threshold value for searching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RichMRFilesIndexLookup

public RichMRFilesIndexLookup(String dir)
                       throws IOException
Instantiates an RichMRFilesIndexLookup from the specified input directory.

Parameters:
dir - subset directory where index files can be found
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
Release resources being used by this class.

Throws:
IOException

findConceptsByWords

public Concept[] findConceptsByWords(String[] p_words)
                              throws IOException
Looks up the given words in the appropriate index files and returns the Concepts whose Strings contain all of the words. Right-handed wildcards are supported via a '*' character.

Parameters:
p_words - to be searched for
Returns:
Concept[]
Throws:
IOException

findConceptsByNormWords

public Concept[] findConceptsByNormWords(String[] p_words)
                                  throws IOException
Looks up the given normalized words in the appropriate index files and returns the Concepts whose Strings contain all of the words. Right-handed wildcards are supported via a '*' character.

Parameters:
p_words - to be searched for
Returns:
Concept[]
Throws:
IOException

getPreviousTotalResultCount

public int getPreviousTotalResultCount()
Returns the total number of concept matches found on the previous search.

Returns:
int number of concepts found on previous search

findChildContexts

public Context[] findChildContexts(Context cxt)
                            throws IOException
Looks up the given Context's ptr + aui in the appropriate index files and returns the Contexts with matching ptrs.

Parameters:
cxt - Context
Returns:
Context[] children
Throws:
IOException

findSiblingContexts

public Context[] findSiblingContexts(Context cxt)
                              throws IOException
Looks up the given Context's ptr in the appropriate index files and returns the Contexts with matching ptrs.

Parameters:
cxt - Context
Returns:
Context[] children
Throws:
IOException

findAncestorContext

public Context findAncestorContext(Context cxt,
                                   String ptr)
                            throws IOException
Looks up the given ptr in the appropriate index files and returns the matching ancestor.

Parameters:
cxt - Context
ptr - String
Returns:
Context[]
Throws:
IOException

countChildContexts

public int countChildContexts(Context cxt)
                       throws IOException
Looks up the given Context in the appropriate index files and returns the count of Contexts whose ptr matches the given one + the aui.

Parameters:
cxt - Context parent
Returns:
int children
Throws:
IOException

countSiblingContexts

public int countSiblingContexts(Context cxt)
                         throws IOException
Looks up the given Context in the appropriate index files and returns the count of Contexts whose ptr matches the given one.

Parameters:
cxt - Context parent
Returns:
int siblings
Throws:
IOException

findConceptByCui

public Concept findConceptByCui(String cui)
                         throws IOException
Looks up the given cui in MRCONSO and returns the Concept associated with the given cui.

Parameters:
cui - to be searched for
Returns:
Concept
Throws:
IOException

findConceptByAui

public Concept findConceptByAui(String aui)
                         throws IOException
Looks up the given aui in the AUI_MRCONSO.x index file and returns the Concept that contains the given aui.

Parameters:
aui - to be searched for
Returns:
Concept containing the aui
Throws:
IOException

findAtomByAui

public Atom findAtomByAui(String aui)
                   throws IOException
Looks up the given aui in the AUI_MRCONSO.x index file and returns the Atom that contains the given aui.

Parameters:
aui - to be searched for
Returns:
Atom containing the aui
Throws:
IOException

setLanguage

public void setLanguage(String lat)
Sets the language of the index file that should be searched.

Parameters:
lat - language abbreviation

getLanguage

public String getLanguage()
Returns the language of the index file that should be searched.

Returns:
the language of the index file that should be searched

setMaxResults

public void setMaxResults(int max_results)
Sets the maximum number of results that should be returned.

Parameters:
max_results - number of results

setThreshold

public void setThreshold(double threshold)
Sets the rank threshold value for searching.

Parameters:
threshold - the rank threshold valud for searching

getThreshold

public double getThreshold()
Returns the rank threshold value for searching.

Returns:
the rank threshold value for searching

getWordCountThreshold

public int getWordCountThreshold()
Returns the rank threshold value for searching.

Returns:
the rank threshold value for searching


Copyright ©2005