|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nih.nlm.umls.io.RichMRFilesConceptOutputStream
gov.nih.nlm.umls.io.RichMRMetathesaurusOutputStream
public class RichMRMetathesaurusOutputStream
This MetathesaurusOutputStream generates MR files in the "Rich
Release Format". It is an extension of RichMRFilesConceptOutputStream with
additional code for the ReleaseMetadata content.
| Field Summary | |
|---|---|
protected String[] |
ancillary_files
|
protected Atom[] |
atoms
|
protected String[] |
change_files
|
protected FileStatisticsConfiguration |
config
|
protected List |
listeners
|
protected Map |
lui_to_cui_set
|
protected Map |
sui_to_cui_set
|
| Fields inherited from class gov.nih.nlm.umls.io.RichMRFilesConceptOutputStream |
|---|
add_unicode_bom, file_ext, mr_dir, mr_targets, null_value, target_files, target_to_output_stream, versioned_output, warnings |
| Constructor Summary | |
|---|---|
RichMRMetathesaurusOutputStream(FileStatisticsConfiguration config)
Instantiates an empty RichMRMetathesaurusOutputStream. |
|
| Method Summary | |
|---|---|
void |
addProgressListener(ProgressListener l)
Adds a ProgressListener. |
protected void |
ambigCheck(Atom atom)
Checks the maps to see if the given Atoms sui
or lui should be added to the ambiguous maps. |
void |
close()
Closes source files that were opened by this class's openTargets() method. |
protected void |
fireProgressEvent(int pct,
String note)
Fires a ProgressEvent. |
protected String |
getColumnTextFromFileStatistics(FileStatistics file_stats)
Returns the MRCOLS.RRF lines for the specified FileStatistics. |
protected String |
getFileTextFromFileStatistics(FileStatistics file_stats)
Returns the MRFILES.RRF line for the specified FileStatistics. |
void |
open(String mr_dir)
Opens all Rich Release Format MR files in the specified directory. |
protected BufferedWriter |
openTargetFile(String name)
Opens the specified file in the directory passed to open(String). |
protected void |
printLine(String line,
String file_name)
Prints the given line to the file with the given name. |
void |
removeProgressListener(ProgressListener l)
Removes a ProgressListener. |
void |
setCandidateAmbiguousStringIdentifiers(List suis)
Sets the list of suis that are candidates to be ambiguous. |
void |
setCandidateAmbiguousStringIdentifiers(String[] suis)
Sets the list of suis that are candidates to be ambiguous. |
void |
setCandidateAmbiguousTermIdentifiers(List luis)
Sets the list of terms that are candidates to be ambiguous. |
void |
setCandidateAmbiguousTermIdentifiers(String[] luis)
Sets the list of terms that are candidates to be ambiguous. |
void |
writeConcept(Concept concept)
Writes a Concept to the appropriate MR files. |
protected void |
writeFileColumnStats()
This method computes the file and columns statistics for the MRFILES.RRF and MRCOLS.RRF files themselves. |
void |
writeIndexEntry(IndexEntry index_entry)
Writes an IndexEntry to the appropriate MR index file. |
protected void |
writeMRAUI(ReleaseMetadata release_metadata)
Writes a line to the MRAUI.RRF file. |
protected void |
writeMRCUI(ReleaseMetadata release_metadata)
Writes a line to the MRCUI.RRF file. |
protected void |
writeMRDOC(ReleaseMetadata release_metadata)
Write a line to the MRDOC.RRF file. |
protected void |
writeMRRANK(ReleaseMetadata release_metadata)
Writes a line to the MRRANK.RRF file. |
protected void |
writeMRSAB(ReleaseMetadata release_metadata)
Write a line to the MRSAB.RRF file. |
void |
writeReleaseMetadata(ReleaseMetadata release_metadata)
Writes an ReleaseMetadata to the appropriate MR metadata files. |
| Methods inherited from class gov.nih.nlm.umls.io.RichMRFilesConceptOutputStream |
|---|
flush, getFilePosition, getNullValue, getWarnings, isEmptyValue, setNullValue, writeMRCOC, writeMRCONSO, writeMRCXT, writeMRDEF, writeMRHIER, writeMRHIST, writeMRMAP, writeMRREL, writeMRSAT, writeMRSMAP, writeMRSTY |
| 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.ConceptOutputStream |
|---|
getWarnings |
| Methods inherited from interface gov.nih.nlm.util.LocalNullValueSupport |
|---|
getNullValue, isEmptyValue, setNullValue |
| Field Detail |
|---|
protected List listeners
protected FileStatisticsConfiguration config
protected String[] change_files
protected String[] ancillary_files
protected Map sui_to_cui_set
protected Map lui_to_cui_set
protected Atom[] atoms
| Constructor Detail |
|---|
public RichMRMetathesaurusOutputStream(FileStatisticsConfiguration config)
RichMRMetathesaurusOutputStream.
config - FileStatisticsConfiguration| Method Detail |
|---|
public void open(String mr_dir)
throws IOException
open in interface ConceptOutputStreamopen in class RichMRFilesConceptOutputStreammr_dir - the subset directory
IOException - if the files cannot be opened
public void close()
throws IOException
close in interface ConceptOutputStreamclose in class RichMRFilesConceptOutputStreamIOException
protected void printLine(String line,
String file_name)
throws IOException
printLine in class RichMRFilesConceptOutputStreamline - the line to be printedfile_name - printing destination
IOException
public void writeConcept(Concept concept)
throws IOException
Concept to the appropriate MR files.
writeConcept in interface ConceptOutputStreamwriteConcept in class RichMRFilesConceptOutputStreamconcept - the Concept to write
IOException - if the files could not be written
public void writeIndexEntry(IndexEntry index_entry)
throws IOException
IndexEntry to the appropriate MR index file.
writeIndexEntry in interface MetathesaurusOutputStreamindex_entry - the IndexEntry to write
IOException - if the file could not be written
protected void writeMRCUI(ReleaseMetadata release_metadata)
throws IOException
MRCUI.RRF file.
release_metadata - the ReleaseMetadata
IOException - if anything goes wrong
protected void writeMRAUI(ReleaseMetadata release_metadata)
throws IOException
MRAUI.RRF file.
release_metadata - the ReleaseMetadata
IOException - if anything goes wrong
protected void writeMRDOC(ReleaseMetadata release_metadata)
throws IOException
MRDOC.RRF file.
release_metadata - the ReleaseMetadata
IOException - if anything goes wrong
protected void writeMRSAB(ReleaseMetadata release_metadata)
throws IOException
MRSAB.RRF file.
release_metadata - the ReleaseMetadata
IOException - if anything goes wrong
protected void writeMRRANK(ReleaseMetadata release_metadata)
throws IOException
MRRANK.RRF file.
release_metadata - the ReleaseMetadata
IOException - if anything goes wrong
public void writeReleaseMetadata(ReleaseMetadata release_metadata)
throws IOException
ReleaseMetadata to the appropriate MR metadata files.
writeReleaseMetadata in interface MetathesaurusOutputStreamrelease_metadata - the ReleaseMetadata to write
IOException - if the file could not be writtenpublic void setCandidateAmbiguousStringIdentifiers(String[] suis)
setCandidateAmbiguousStringIdentifiers in interface MetathesaurusOutputStreamsuis - the list of suis that are candidates to be ambiguouspublic void setCandidateAmbiguousStringIdentifiers(List suis)
setCandidateAmbiguousStringIdentifiers in interface MetathesaurusOutputStreamsuis - the list of suis that are candidates to be ambiguouspublic void setCandidateAmbiguousTermIdentifiers(String[] luis)
setCandidateAmbiguousTermIdentifiers in interface MetathesaurusOutputStreamluis - list of terms that are candidates to be ambiguouspublic void setCandidateAmbiguousTermIdentifiers(List luis)
setCandidateAmbiguousTermIdentifiers in interface MetathesaurusOutputStreamluis - list of terms that are candidates to be ambiguous
protected BufferedWriter openTargetFile(String name)
throws IOException
open(String).
openTargetFile in class RichMRFilesConceptOutputStreamname - the filename
BufferedWriter for the file
IOException - if the file could not be opened.public void addProgressListener(ProgressListener l)
ProgressListener.
addProgressListener in interface ProgressReporterl - thefProgressListenerpublic void removeProgressListener(ProgressListener l)
ProgressListener.
removeProgressListener in interface ProgressReporterl - thefProgressListener
protected void fireProgressEvent(int pct,
String note)
ProgressEvent.
pct - percent donenote - progress note
protected void writeFileColumnStats()
throws IOException
MRFILES.RRF and MRCOLS.RRF files themselves.
Should it be using "\n"?
IOException - if anything goes wrongprotected String getFileTextFromFileStatistics(FileStatistics file_stats)
MRFILES.RRF line for the specified FileStatistics.
file_stats - the FileStatistics
MRFILES.RRF line for the specified FileStatisticsprotected String getColumnTextFromFileStatistics(FileStatistics file_stats)
MRCOLS.RRF lines for the specified FileStatistics.
file_stats - the FileStatistics
MRCOLS.RRF lines for the specified FileStatisticsprotected void ambigCheck(Atom atom)
Atoms sui
or lui should be added to the ambiguous maps.
atom - the Atomto check
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||