edu.northwestern.at.morphadorner.tools.compareadornedfiles

## Class CompareAdornedFiles

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.compareadornedfiles.CompareAdornedFiles

-     public class CompareAdornedFiles
      extends java.lang.Object

  Compare word elements in two adorned files and emit differences.

  Usage:

        java edu.northwestern.at.morphadorner.tools.compareadornedfiles.CompareAdornedFiles
            oldadorned.xml newadorned.xml diffs.xml

  oldadorned.xml -- "Old" unmodified adorned file.
  newadorned.xml -- "new" modified version of adorned file.
  diffs.xml -- Word differences between two adorned files.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompareAdornedFiles(java.lang.String oldAdornedFileName, java.lang.String newAdornedFileName, java.lang.String changesFileName, java.io.PrintStream printStream)` Create CompareAdornedFiles.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `logAttributeAdditions(WordChangeLog changeLog, java.lang.String id, AdornedWordData w)` Log attribute additions for an added word.
    `protected void` | `logAttributeDeletions(WordChangeLog changeLog, java.lang.String id, AdornedWordData w)` Log attribute deletions for a deleted word.
    `protected boolean` | `logAttributeDifferences(WordChangeLog changeLog, java.lang.String id, AdornedWordData w1, AdornedWordData w2)` Log differences in attributes and their values for two adorned words.
    `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`

- - ### Constructor Detail

    - #### CompareAdornedFiles

          public CompareAdornedFiles(java.lang.String oldAdornedFileName,
                             java.lang.String newAdornedFileName,
                             java.lang.String changesFileName,
                             java.io.PrintStream printStream)
                              throws java.lang.Exception

      Create CompareAdornedFiles.
      Parameters:
        `oldAdornedFileName` - Old adorned file name.
        `newAdornedFileName` - New adorned file name.
        `changesFileName` - Changes file name.
        `printStream` - Output stream for reporting progress.
      Throws:
        `java.lang.Exception` - in case of error.

  - ### Method Detail

    - #### logAttributeDifferences

          protected boolean logAttributeDifferences(WordChangeLog changeLog,
                                        java.lang.String id,
                                        AdornedWordData w1,
                                        AdornedWordData w2)

      Log differences in attributes and their values for two adorned words.
      Parameters:
        `changeLog` - Change log in which to store changes.
        `id` - The word ID.
        `w1` - First "old" adorned word.
        `w2` - Second "new" adorned word.
      Returns:
        true if any attributes added, deleted, or modified from w1 to w2.

    - #### logAttributeAdditions

          protected void logAttributeAdditions(WordChangeLog changeLog,
                                   java.lang.String id,
                                   AdornedWordData w)

      Log attribute additions for an added word.
      Parameters:
        `changeLog` - Change log in which to store changes.
        `id` - The word ID.
        `w` - The added adorned word.

    - #### logAttributeDeletions

          protected void logAttributeDeletions(WordChangeLog changeLog,
                                   java.lang.String id,
                                   AdornedWordData w)

      Log attribute deletions for a deleted word.
      Parameters:
        `changeLog` - Change log in which to store changes.
        `id` - The word ID.
        `w` - The deleted adorned word.

    - #### main

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

      Main program.