edu.northwestern.at.morphadorner.tools.addcharacteroffsets

## Class AddCharacterOffsets

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.addcharacteroffsets.AddCharacterOffsets

-     public class AddCharacterOffsets
      extends java.lang.Object

  Create derived MorphAdorner files with character offsets to word tokens.

  Usage:

  >       java edu.northwestern.at.morphadorner.tools.addcharacteroffsets.AddCharacterOffsets adornedinput.xml adornedoutput.xml unadornedoutput.xml

  adornedinput.xml | Standard MorphAdorner adorned output file.
  adornedoutput.xml | Derived adorned file with character offsets added to tags.
  unadornedoutput.xml | Derived unadorned file whose word offsets are given in adornedoutput.xml file.

  The derived adorned output file adornedoutput.xml adds a cof= attribute to each <w> tag. The cof= attribute specifies the character (not byte) offset of each word in the unadornedoutput.xml file. The latter file removes the <w> and <c> tags from the adorned input file and outputs the word and whitespace text as specified by the <w> and <c> tags.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `ATTRS`
    `protected static int` | `CDATA`
    `protected static int` | `CLEFT` Matcher groups for c.
    `protected static java.lang.String` | `cPattern` tag pattern.
    `protected static PatternReplacer` | `creplacer` tag replacement.
    `protected static int` | `CRIGHT`
    `protected static int` | `LEFT` Matcher groups for w.
    `protected static java.lang.String` | `LINE_SEPARATOR` Line separator.
    `protected static int` | `MAXLINEWIDTH` Maximum line width.
    `protected static int` | `RIGHT`
    `protected static int` | `WORD`
    `protected static java.lang.String` | `wPattern` tag pattern.
    `protected static PatternReplacer` | `wreplacer` tag replacement.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AddCharacterOffsets(java.lang.String[] args)` Create derived adorned files with character offset attributes.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `displayUsage()` Display program usage.
    `static void` | `main(java.lang.String[] args)` Main program.

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

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

- - ### Field Detail

    - #### LINE_SEPARATOR

          protected static final java.lang.String LINE_SEPARATOR

      Line separator.

    - #### wPattern

          protected static java.lang.String wPattern

      tag pattern.

    - #### wreplacer

          protected static PatternReplacer wreplacer

      tag replacement.

    - #### LEFT

          protected static final int LEFT

      Matcher groups for w.
      See Also:
        Constant Field Values

    - #### ATTRS

          protected static final int ATTRS

      See Also:
        Constant Field Values

    - #### WORD

          protected static final int WORD

      See Also:
        Constant Field Values

    - #### RIGHT

          protected static final int RIGHT

      See Also:
        Constant Field Values

    - #### cPattern

          protected static java.lang.String cPattern

      tag pattern.

    - #### CLEFT

          protected static final int CLEFT

      Matcher groups for c.
      See Also:
        Constant Field Values

    - #### CDATA

          protected static final int CDATA

      See Also:
        Constant Field Values

    - #### CRIGHT

          protected static final int CRIGHT

      See Also:
        Constant Field Values

    - #### creplacer

          protected static PatternReplacer creplacer

      tag replacement.

    - #### MAXLINEWIDTH

          protected static final int MAXLINEWIDTH

      Maximum line width.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AddCharacterOffsets

          public AddCharacterOffsets(java.lang.String[] args)

      Create derived adorned files with character offset attributes.
      Parameters:
        `args` - Command line arguments.

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)

      Main program.

    - #### displayUsage

          public static void displayUsage()

      Display program usage.