gov.nih.nlm.umls.io
Class OriginalMRMetathesaurusInputStream

java.lang.Object
  extended bygov.nih.nlm.umls.io.OriginalMRFilesConceptInputStream
      extended bygov.nih.nlm.umls.io.OriginalMRMetathesaurusInputStream
All Implemented Interfaces:
ConceptInputStream, MetathesaurusInputStream
Direct Known Subclasses:
OriginalMRMetamorphoSysInputStream

public class OriginalMRMetathesaurusInputStream
extends OriginalMRFilesConceptInputStream
implements MetathesaurusInputStream

This MetathesaurusInputStream builds IndexEntrys, and ReleaseMetadata from a full set of standard MR files.

Author:
Deborah Shapiro

Field Summary
protected  int current_index
           
protected  int index_counter
           
protected  int index_lines
           
protected  BufferedReader mrcui_source
           
protected  BufferedReader mrsab_source
           
protected  BufferedReader[] mrx_sources
           
 
Fields inherited from class gov.nih.nlm.umls.io.OriginalMRFilesConceptInputStream
file_names, mr_dir, mratx_source, mrcoc_source, mrcon_counter, mrcon_lines, mrcon_source, mrcxt_source, mrdef_source, mrlo_source, mrrel_source, mrsat_source, mrso_source, mrsty_source, this_concept, tokens
 
Constructor Summary
OriginalMRMetathesaurusInputStream()
          Instantiates an empty OriginalMRMetathesaurusInputStream;
 
Method Summary
 void close()
          Close files opened during open(String[]).
 String[] getAmbiguousStringIdentifiers()
          Returns the complete list of suis from the AMBIGSUI list.
 List getAmbiguousStringIdentifiersAsList()
          Returns the complete list of suis from the AMBIGSUI list.
 String[] getAmbiguousTermIdentifiers()
          Returns the complete list of terms from the AMBIGLUI list.
 List getAmbiguousTermIdentifiersAsList()
          Returns the complete list of terms from the AMBIGLUI list.
 int getIndexProgress()
          Returns the percentage of the index file lines that have been processed.
protected  Map getLineCounts()
          Reads through MRFILES to determine the size of the index files.
 void open(String[] install_paths)
          Opens all target files in the specified directory.
 IndexEntry readIndexEntry()
          Returns an IndexEntry from one of the index files.
 ReleaseMetadata readReleaseMetadata()
          Returns the ReleaseMetadata containing data from MRSAB, MRDOC and MRCUI.
 
Methods inherited from class gov.nih.nlm.umls.io.OriginalMRFilesConceptInputStream
getAtoms, getAttributes, getConceptProgress, getContexts, getCoocurrences, getDefinitions, getLocators, getMappings, getRelationships, getSemanticTypes, openSourceFile, readConcept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nih.nlm.umls.io.ConceptInputStream
getConceptProgress, readConcept
 

Field Detail

current_index

protected int current_index

index_lines

protected int index_lines

index_counter

protected int index_counter

mrx_sources

protected BufferedReader[] mrx_sources

mrcui_source

protected BufferedReader mrcui_source

mrsab_source

protected BufferedReader mrsab_source
Constructor Detail

OriginalMRMetathesaurusInputStream

public OriginalMRMetathesaurusInputStream()
Instantiates an empty OriginalMRMetathesaurusInputStream;

Method Detail

open

public void open(String[] install_paths)
          throws IOException
Opens all target files in the specified directory. The set of target files is the standard MR files.

Specified by:
open in interface ConceptInputStream
Overrides:
open in class OriginalMRFilesConceptInputStream
Parameters:
install_paths - the subset directory
Throws:
IOException - if the files cannot be opened

close

public void close()
           throws IOException
Close files opened during open(String[]).

Specified by:
close in interface ConceptInputStream
Overrides:
close in class OriginalMRFilesConceptInputStream
Throws:
IOException - if files can not be closed

readIndexEntry

public IndexEntry readIndexEntry()
                          throws IOException
Returns an IndexEntry from one of the index files. We read through the index files one at a time, returning all of the entries.

Specified by:
readIndexEntry in interface MetathesaurusInputStream
Returns:
an IndexEntry from one of the index files
Throws:
IOException - if the files cannot be read

getIndexProgress

public int getIndexProgress()
Returns the percentage of the index file lines that have been processed.

Specified by:
getIndexProgress in interface MetathesaurusInputStream
Returns:
the percentage of the index file lines that have been processed

getLineCounts

protected Map getLineCounts()
                     throws IOException
Reads through MRFILES to determine the size of the index files. This is used in the getIndexProgress() method.

Overrides:
getLineCounts in class OriginalMRFilesConceptInputStream
Returns:
Map of file names to lines in file
Throws:
IOException - if the file cannot be opened or read

readReleaseMetadata

public ReleaseMetadata readReleaseMetadata()
                                    throws IOException
Returns the ReleaseMetadata containing data from MRSAB, MRDOC and MRCUI.

Specified by:
readReleaseMetadata in interface MetathesaurusInputStream
Returns:
the ReleaseMetadata for this input stream
Throws:
IOException - if the files could not be read

getAmbiguousStringIdentifiers

public String[] getAmbiguousStringIdentifiers()
                                       throws IOException
Returns the complete list of suis from the AMBIGSUI list. They will be used in calculating entries for the output AMBIGSUI list.

Specified by:
getAmbiguousStringIdentifiers in interface MetathesaurusInputStream
Returns:
list of suis
Throws:
IOException

getAmbiguousStringIdentifiersAsList

public List getAmbiguousStringIdentifiersAsList()
                                         throws IOException
Returns the complete list of suis from the AMBIGSUI list. They will be used in calculating entries for the output AMBIGSUI list.

Specified by:
getAmbiguousStringIdentifiersAsList in interface MetathesaurusInputStream
Returns:
list of suis
Throws:
IOException

getAmbiguousTermIdentifiers

public String[] getAmbiguousTermIdentifiers()
                                     throws IOException
Returns the complete list of terms from the AMBIGLUI list. They will be used in calculating entries for the output AMBIGLUI list.

Specified by:
getAmbiguousTermIdentifiers in interface MetathesaurusInputStream
Returns:
list of terms
Throws:
IOException

getAmbiguousTermIdentifiersAsList

public List getAmbiguousTermIdentifiersAsList()
                                       throws IOException
Returns the complete list of terms from the AMBIGLUI list. They will be used in calculating entries for the output AMBIGLUI list.

Specified by:
getAmbiguousTermIdentifiersAsList in interface MetathesaurusInputStream
Returns:
list of terms
Throws:
IOException


Copyright ©2005