edu.northwestern.at.morphadorner.corpuslinguistics.sentencemelder

## Class XMLSentenceMelder

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.sentencemelder.SentenceMelder
  - - edu.northwestern.at.morphadorner.corpuslinguistics.sentencemelder.XMLSentenceMelder

-     public class XMLSentenceMelder
      extends SentenceMelder

  XML Sentence melder

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `emitXMLWrapperForBlank` True to emit XML wrapper element for a blank.
    `protected static char[]` | `oneBlankChar` Single blank character.
    `protected java.lang.String` | `xmlBlankWrapper` XML element to wrap a blank.

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.sentencemelder.SentenceMelder

      `LDQUOTESTR, LSQUOTESTR, RDQUOTESTR, RSQUOTESTR, state`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLSentenceMelder()` Create XML sentence melder.
    `XMLSentenceMelder(XMLWriter xmlWriter)` Create sentence melder.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `endSentence()` Finish sentence.
    `void` | `outputBlank()` Add blank to sentence.
    `protected void` | `outputWord(java.lang.String word)` Add word to sentence.
    `void` | `setEmitXMLWrapperForBlank(boolean emitXMLWrapperForBlank)` Set XML wrapper flag for blanks.
    `void` | `setEmitXMLWrapperForBlank(java.lang.String xmlBlankWrapper)` Set XML wrapper flag for blanks.
    `void` | `setURI(java.lang.String elementURI)` Set URI for XML elements.
    `void` | `seWriter(XMLWriter xmlWriter)` Set XML writer.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.sentencemelder.SentenceMelder

      `getState, processWord, reconstituteSentence, reset, setState, shouldOutputBlank, startSentence`

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

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

- - ### Field Detail

    - #### oneBlankChar

          protected static final char[] oneBlankChar

      Single blank character.

    - #### emitXMLWrapperForBlank

          protected boolean emitXMLWrapperForBlank

      True to emit XML wrapper element for a blank.

    - #### xmlBlankWrapper

          protected java.lang.String xmlBlankWrapper

      XML element to wrap a blank.

  - ### Constructor Detail

    - #### XMLSentenceMelder

          public XMLSentenceMelder()

      Create XML sentence melder.

    - #### XMLSentenceMelder

          public XMLSentenceMelder(XMLWriter xmlWriter)

      Create sentence melder.
      Parameters:
        `xmlWriter` - XML output data writer.

  - ### Method Detail

    - #### seWriter

          public void seWriter(XMLWriter xmlWriter)

      Set XML writer.
      Parameters:
        `xmlWriter` - XML output data writer.

    - #### setEmitXMLWrapperForBlank

          public void setEmitXMLWrapperForBlank(java.lang.String xmlBlankWrapper)

      Set XML wrapper flag for blanks.
      Parameters:
        `xmlBlankWrapper` - Wrap blank with specified XML element.

        If the specified wrapper is empty or null, blanks are not wrapped.

    - #### setEmitXMLWrapperForBlank

          public void setEmitXMLWrapperForBlank(boolean emitXMLWrapperForBlank)

      Set XML wrapper flag for blanks.
      Parameters:
        `emitXMLWrapperForBlank` - Wrap blank with given XML element.

        If the specified wrapper is empty or null, blanks are not wrapped.

    - #### setURI

          public void setURI(java.lang.String elementURI)

      Set URI for XML elements.
      Parameters:
        `elementURI` - URI for XML elements,

    - #### outputBlank

          public void outputBlank()

      Add blank to sentence.
      Overrides:
        `outputBlank` in class `SentenceMelder`

    - #### outputWord

          protected void outputWord(java.lang.String word)

      Add word to sentence.
      Overrides:
        `outputWord` in class `SentenceMelder`
      Parameters:
        `word` - The word to add.

    - #### endSentence

          public java.lang.String endSentence()

      Finish sentence.
      Overrides:
        `endSentence` in class `SentenceMelder`
      Returns:
        Returned sentence.