edu.northwestern.at.morphadorner.tools.mergespellingdata

## Class MergeSpellingData

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.mergespellingdata.MergeSpellingData

-     public class MergeSpellingData
      extends java.lang.Object

  Merges multiple files of altenate spellings into one big file.

  Usage:

  java edu.northwestern.at.morphadorner.tools.mergespellingdata.MergeSpellingData output.tab input.tab input2.tab ...
  output.tab -- output merged word spelling data file.
  input*.tab -- input tab-delimited files containing spelling maps to be merged.

  Each input spelling map is a utf-8 file containing two fields separated by a tab character. The first field is a variant spelling. The second field is the standardized spelling for the variant.

  The output file is a utf-8 text file containing the merged spelling maps from the input files. When a given variant appears more than once with different standardized spellings in the input files, the last mapping encountered is the one written to the output file.

- - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `getAlternateSpellings(java.io.Reader reader, java.util.Map<java.lang.String,java.lang.String> map, java.util.Set<java.lang.String> set)` Get map of alternative : canonical spelling pairs from a reader.
    `protected static boolean` | `isDBNull(java.lang.String s)` Check if a string represents a database null value.
    `static void` | `main(java.lang.String[] args)` Main program for merge spelling data.
    `protected static void` | `mergeSpellingData(java.lang.String[] args)` Merge the spelling data.

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

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

- - ### Constructor Detail

    - #### MergeSpellingData

          protected MergeSpellingData()

      Allow overrides but not instantiation.

  - ### Method Detail

    - #### main

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

      Main program for merge spelling data.

    - #### isDBNull

          protected static boolean isDBNull(java.lang.String s)

      Check if a string represents a database null value.
      Parameters:
        `s` - String to check for null value.
      Returns:
        true if string is null.

    - #### mergeSpellingData

          protected static void mergeSpellingData(java.lang.String[] args)
                                           throws java.io.IOException

      Merge the spelling data.
      Throws:
        `java.io.IOException`

    - #### getAlternateSpellings

          public static void getAlternateSpellings(java.io.Reader reader,
                                   java.util.Map<java.lang.String,java.lang.String> map,
                                   java.util.Set<java.lang.String> set)
                                            throws java.io.IOException

      Get map of alternative : canonical spelling pairs from a reader.
      Parameters:
        `reader` - The reader.
      Throws:
        `java.io.IOException`