edu.northwestern.at.morphadorner.corpuslinguistics.inputter

## Class DiskBasedXMLTextInputter

- java.lang.Object
- - edu.northwestern.at.utils.IsCloseableObject
  - - edu.northwestern.at.morphadorner.corpuslinguistics.inputter.XMLTextInputter
    - - edu.northwestern.at.morphadorner.corpuslinguistics.inputter.DiskBasedXMLTextInputter

- All Implemented Interfaces:
    TextInputter

      public class DiskBasedXMLTextInputter
      extends XMLTextInputter
      implements TextInputter

  Text inputter which reads text from a TEI or EEBO XML fileL.

  The XML file is divided into smaller sections which are stored in temporary disk files. MorphAdorner uses a modified XGTagger interface to adorn each section of text separately, and then merge the results to produce the final adorned XML output.

  In this class, the segmentMap inherited from `XMLTextInputter` maps a segment name to the name of the temporary disk file which holds the segment text.

- - ### Field Summary

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.inputter.XMLTextInputter

      `document, encoding, fixGaps, fixOrigs, fixSplitWords, fixSplitWordsPatternReplacers, segmentMap, segmentNames, splitText, storesSegmentFiles, teiHeaderPattern, textID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DiskBasedXMLTextInputter()` Create disk-based XML text inputter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close inputter.
    `void` | `finalize()` Finalize,
    `protected java.lang.String` | `getSegment(java.lang.String segmentName)` Get segment text from disk.
    `protected void` | `putSegment(java.lang.String segmentName, java.lang.String segmentText)` Put segment text to disk.
    `void` | `setSegmentText(int segmentNumber, java.io.File segmentTextFile)` Updates specified segment of loaded text from file.
    `void` | `setSegmentText(java.lang.String segmentName, java.io.File segmentTextFile)` Updates specified segment of loaded text from file.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.inputter.XMLTextInputter

      `doLoadDocument, doLoadText, enableGapFixer, enableOrigFixer, enableSplitWordsFixer, findChild, getNextTextID, getSegmentCount, getSegmentName, getSegmentText, getSegmentText, loadText, loadText, loadText, loadText, setSegmentText, setSegmentText, usesSegmentFiles, writeChildren`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface edu.northwestern.at.morphadorner.corpuslinguistics.inputter.TextInputter

      `enableGapFixer, enableOrigFixer, enableSplitWordsFixer, getSegmentCount, getSegmentName, getSegmentText, getSegmentText, loadText, loadText, loadText, loadText, setSegmentText, setSegmentText, usesSegmentFiles`

- - ### Constructor Detail

    - #### DiskBasedXMLTextInputter

          public DiskBasedXMLTextInputter()

      Create disk-based XML text inputter.

  - ### Method Detail

    - #### setSegmentText

          public void setSegmentText(int segmentNumber,
                            java.io.File segmentTextFile)

      Updates specified segment of loaded text from file.
      Specified by:
        `setSegmentText` in interface `TextInputter`
      Overrides:
        `setSegmentText` in class `XMLTextInputter`
      Parameters:
        `segmentNumber` - The segment number (starts at 0).
        `segmentTextFile` - The file containing the updated segment text.

    - #### setSegmentText

          public void setSegmentText(java.lang.String segmentName,
                            java.io.File segmentTextFile)

      Updates specified segment of loaded text from file.
      Specified by:
        `setSegmentText` in interface `TextInputter`
      Overrides:
        `setSegmentText` in class `XMLTextInputter`
      Parameters:
        `segmentName` - The segment name.
        `segmentTextFile` - The file containing the updated segment text.

    - #### getSegment

          protected java.lang.String getSegment(java.lang.String segmentName)

      Get segment text from disk.
      Overrides:
        `getSegment` in class `XMLTextInputter`
      Parameters:
        `segmentName` - Segment name.
      Returns:
        Segment text.

    - #### putSegment

          protected void putSegment(java.lang.String segmentName,
                        java.lang.String segmentText)

      Put segment text to disk.
      Overrides:
        `putSegment` in class `XMLTextInputter`
      Parameters:
        `segmentName` - Segment name.
        `segmentText` - Segment text.

    - #### close

          public void close()

      Close inputter.
      Overrides:
        `close` in class `XMLTextInputter`

    - #### finalize

          public void finalize()
                        throws java.lang.Throwable

      Finalize,
      Overrides:
        `finalize` in class `XMLTextInputter`
      Throws:
        `java.lang.Throwable`