edu.northwestern.at.morphadorner

## Class DefaultMorphAdornerXMLWriter

- java.lang.Object
- - edu.northwestern.at.morphadorner.DefaultMorphAdornerXMLWriter

- All Implemented Interfaces:
    MorphAdornerXMLWriter

      public class DefaultMorphAdornerXMLWriter
      extends java.lang.Object
      implements MorphAdornerXMLWriter

  Writes an adorned XML file with added ID fields.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SortedArrayList<SentenceAndWordNumber>` | `sortedWords` Sorted list of word IDs and word and sentence number information.
    `protected XMLWriter` | `writer` Output XML writer.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultMorphAdornerXMLWriter()` Create XML writer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `getWordAndSentenceNumbers(MorphAdornerSettings settings)` Get word and sentence numbers.
    `void` | `writeXML(java.lang.String inFile, java.lang.String outFile, int maxID, PartOfSpeechTags posTags, java.util.Map<java.lang.Integer,java.lang.Integer> splitWords, int totalWords, int totalPageBreaks, MorphAdorner adorner, boolean tokenizingOnly)` Write XML output.

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

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

- - ### Field Detail

    - #### sortedWords

          protected SortedArrayList<SentenceAndWordNumber> sortedWords

      Sorted list of word IDs and word and sentence number information.

    - #### writer

          protected XMLWriter writer

      Output XML writer.

  - ### Constructor Detail

    - #### DefaultMorphAdornerXMLWriter

          public DefaultMorphAdornerXMLWriter()

      Create XML writer.

  - ### Method Detail

    - #### writeXML

          public void writeXML(java.lang.String inFile,
                      java.lang.String outFile,
                      int maxID,
                      PartOfSpeechTags posTags,
                      java.util.Map<java.lang.Integer,java.lang.Integer> splitWords,
                      int totalWords,
                      int totalPageBreaks,
                      MorphAdorner adorner,
                      boolean tokenizingOnly)
                        throws java.io.IOException,
                               org.xml.sax.SAXException

      Write XML output.
      Specified by:
        `writeXML` in interface `MorphAdornerXMLWriter`
      Parameters:
        `inFile` - The XML input file.
        `outFile` - The XML output file.
        `maxID` - The maximum ID value in the input file.
        `posTags` - The part of speech tags.
        `splitWords` - The map of (word ID, # of word parts) for multipart words.
        `totalWords` - Total words.
        `totalPageBreaks` - Total page breaks.
        `adorner` - The adorner.
        `tokenizingOnly` - Only emit tokenization-related attributes.
      Throws:
        `IOException,` - SAXException
        `java.io.IOException`
        `org.xml.sax.SAXException`

    - #### getWordAndSentenceNumbers

          protected void getWordAndSentenceNumbers(MorphAdornerSettings settings)

      Get word and sentence numbers.