|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nih.nlm.umls.io.OriginalMRFilesConceptInputStream
public class OriginalMRFilesConceptInputStream
This ConceptInputStream builds Concept objects from a full
set of original format MR files.
| Field Summary | |
|---|---|
protected String[] |
file_names
|
protected String |
mr_dir
|
protected PushBackReader |
mratx_source
|
protected PushBackReader |
mrcoc_source
|
protected int |
mrcon_counter
|
protected int |
mrcon_lines
|
protected PushBackReader |
mrcon_source
|
protected PushBackReader |
mrcxt_source
|
protected PushBackReader |
mrdef_source
|
protected PushBackReader |
mrlo_source
|
protected PushBackReader |
mrrel_source
|
protected PushBackReader |
mrsat_source
|
protected PushBackReader |
mrso_source
|
protected PushBackReader |
mrsty_source
|
protected String |
null_value
|
protected Concept |
this_concept
|
protected String[] |
tokens
|
protected List |
warnings
|
| Constructor Summary | |
|---|---|
OriginalMRFilesConceptInputStream()
Instantiates an empty OriginalMRFilesConceptInputStream. |
|
| Method Summary | |
|---|---|
void |
close()
Close files opened during open(String[]). |
protected Concept |
getAtoms(Concept this_concept,
String current_cui)
Returns Atoms from the MRCON
and MRSO files with the
given cui and adds them to the current Concept. |
protected void |
getAttributes(Concept this_concept,
String current_cui)
Returns Attributes from the MRSAT files with the
given cui and adds them to the current Concept |
int |
getConceptProgress()
Returns the percentage of MRCON lines that have been processed. |
protected void |
getContexts(Concept this_concept,
String current_cui)
Returns Contexts from the MRCXT files with the
given cui and adds them to the current Concept. |
protected void |
getCoocurrences(Concept this_concept,
String current_cui)
Returns a Coocurrences from the MRCOC file with the
given cui and adds them to the current Concept. |
protected void |
getDefinitions(Concept this_concept,
String current_cui)
Returns Definitions from the MRDEF file with the
given cui and adds them to the current Concept. |
protected Map |
getLineCounts()
Reads through MRFILES to determine the size of MRCON. |
protected void |
getLocators(Concept this_concept,
String current_cui)
Returns Locators from the MRLO file with the
given cui and adds them to the current Concept. |
protected void |
getMappings(Concept this_concept,
String current_cui)
Returns Mappings from the MRATX file with the
given cui and adds them to the current Concept. |
String |
getNullValue()
Returns the null value. |
protected void |
getRelationships(Concept this_concept,
String current_cui)
Returns Relationships from the MRREL file with the
given cui and adds them to the current Concept |
protected void |
getSemanticTypes(Concept this_concept,
String current_cui)
Returns SemanticTypes from the MRSTY file with the
given cui and adds them to the current Concept. |
String[] |
getWarnings()
Returns a String[] of warnings accumulated during
processing of the input stream. |
boolean |
isEmptyValue(String token)
Indicates whether or not the specified token is null or contains a null value as defined by being either zero length or a value equal to the null value. |
void |
open(String[] install_paths)
Opens all of the MR Files in preparation for subsetting. |
protected PushBackReader |
openSourceFile(String name)
Opens the specified file in the directory passed to open(String[]). |
Concept |
readConcept()
Returns the next Concept from the MR Files. |
void |
setNullValue(String null_value)
Sets the null value to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PushBackReader mrso_source
protected PushBackReader mrcon_source
protected PushBackReader mrsty_source
protected PushBackReader mrdef_source
protected PushBackReader mrrel_source
protected PushBackReader mrcxt_source
protected PushBackReader mrcoc_source
protected PushBackReader mratx_source
protected PushBackReader mrsat_source
protected PushBackReader mrlo_source
protected String[] file_names
protected String mr_dir
protected Concept this_concept
protected int mrcon_lines
protected int mrcon_counter
protected final String[] tokens
protected List warnings
protected String null_value
| Constructor Detail |
|---|
public OriginalMRFilesConceptInputStream()
OriginalMRFilesConceptInputStream.
| Method Detail |
|---|
public void setNullValue(String null_value)
setNullValue in interface LocalNullValueSupportnull_value - the new null string valuepublic String getNullValue()
getNullValue in interface LocalNullValueSupportpublic boolean isEmptyValue(String token)
isEmptyValue in interface LocalNullValueSupport
public void open(String[] install_paths)
throws IOException
open in interface ConceptInputStreaminstall_paths - the directory containing the files
IOException - if any files can not be opened
public void close()
throws IOException
open(String[]).
close in interface ConceptInputStreamIOException - if files can not be closedpublic int getConceptProgress()
MRCON lines that have been processed.
getConceptProgress in interface ConceptInputStreamMRCON lines that have been processed
public Concept readConcept()
throws IOException
Concept from the MR Files.
readConcept in interface ConceptInputStreamConceptfrom the MR Files
IOException - if files could not be read
protected PushBackReader openSourceFile(String name)
throws IOException
open(String[]).
name - the filename
BufferedReader on the file
IOException - if the file could not be opened
protected Map getLineCounts()
throws IOException
MRFILES to determine the size of MRCON.
This is used in the getConceptProgress() method.
Map of file names to lines in file
IOException - if the file cannot be opened or read
protected void getMappings(Concept this_concept,
String current_cui)
throws IOException
Mappings from the MRATX file with the
given cui and adds them to the current Concept.
this_concept - Concept that will contain the Mappingscurrent_cui - String representation of the cui
IOException - if there is a problem with the file
protected Concept getAtoms(Concept this_concept,
String current_cui)
throws IOException
Atoms from the MRCON
and MRSO files with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
Concept that will contain the Atoms
IOException - if there is a problem with the file
protected void getAttributes(Concept this_concept,
String current_cui)
throws IOException
Attributes from the MRSAT files with the
given cui and adds them to the current Concept
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if there is a problem with the file
protected void getContexts(Concept this_concept,
String current_cui)
throws IOException
Contexts from the MRCXT files with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if anything wrong with file
protected void getCoocurrences(Concept this_concept,
String current_cui)
throws IOException
Coocurrences from the MRCOC file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from file
protected void getDefinitions(Concept this_concept,
String current_cui)
throws IOException
Definitions from the MRDEF file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from the file
protected void getLocators(Concept this_concept,
String current_cui)
throws IOException
Locators from the MRLO file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from file
protected void getSemanticTypes(Concept this_concept,
String current_cui)
throws IOException
SemanticTypes from the MRSTY file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from file
protected void getRelationships(Concept this_concept,
String current_cui)
throws IOException
Relationships from the MRREL file with the
given cui and adds them to the current Concept
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from filepublic String[] getWarnings()
String[] of warnings accumulated during
processing of the input stream.
getWarnings in interface ConceptInputStreamString[] of warnings
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||