edu.northwestern.at.morphadorner.corpuslinguistics.inputter

## Class OrigFixer

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.inputter.OrigFixer

-     public class OrigFixer
      extends java.lang.Object

  Fixes <orig> element and surrounding elements.

  <orig> tags are used in Wright archive documents to mark words split across a page break. A typical page break appears as follows:

        <orig reg="larboard" TEIform="orig">lar-</orig>
          <pb TEIform="pb"/> board hand,

  The "reg=" attribute of the <orig> tag provides the original unsplit spelling of the word which is split across the page boundary. The whitespace following the </orig> and preceding the <pb>, as well as the whitespace following the </pb>, causes MorphAdorner to process the split word incorrectly as multiple words instead of a single word.

  OrigFixer modifies the XML for <orig> tags as follows.

  - OrigFixer removes the whitespace following the closing </orig> tag up to the start of the subsequent <pb> .
  - OrigFixer removes the leading whitespace from the text following the closing </pb> which follows the </orig>.
  - OrigFixer replaces the trailing "-" in the word enclosed by the <orig> tag with a special user-defined Unicode character (currently 0xE502) when there is no matching "-" in the "reg=" attribute of the <orig> tag. This allows the MorphAdorner word tokenizers to distinguish the overloaded use of the trailing hyphen as a word continuation character from its use as both a continuation character and a character in the original spelling.

  For example, OrigFixer modifies the sample text above to read:

        <orig reg="larboard" TEIform="orig">lar?</orig><pb TEIform="pb"/>board hand,

  These modifications allow MorphAdorner to process the split word correctly. The MorphAdorner tokenizers recognize the special substitute hyphen character, which is restored to a plain hyphen character by the XML output writers.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `OrigFixer.OrigProcessor` JDOM element processor which fixes elements.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `OrigFixer()` Allow overrides but no instantiation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `fixOrigs(org.jdom2.Document document)` Fix elements in a DOM document.

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

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

- - ### Constructor Detail

    - #### OrigFixer

          protected OrigFixer()

      Allow overrides but no instantiation.

  - ### Method Detail

    - #### fixOrigs

          public static void fixOrigs(org.jdom2.Document document)

      Fix elements in a DOM document.
      Parameters:
        `document` - Document containing elements to fix.