edu.northwestern.at.morphadorner.corpuslinguistics.spellingmapper

## Class BritishToUSSpellingMapper

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.spellingmapper.BritishToUSSpellingMapper

- All Implemented Interfaces:
    SpellingMapper

      public class BritishToUSSpellingMapper
      extends java.lang.Object
      implements SpellingMapper

  Maps British to American spellings.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.util.Map<java.lang.String,java.lang.String>` | `britToUSMap` Hash map with British spelling as key and American spelling as value.
    `protected static java.lang.String` | `wordMapPath` Resource file with British/American mappings.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BritishToUSSpellingMapper()` Create British to US spelling mapper.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `loadBritishToUSWordMap()` Load the British to US mapping data.
    `java.lang.String` | `mapSpelling(java.lang.String spelling)` Returns U.S.

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

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

- - ### Field Detail

    - #### wordMapPath

          protected static final java.lang.String wordMapPath

      Resource file with British/American mappings.
      See Also:
        Constant Field Values

    - #### britToUSMap

          protected static java.util.Map<java.lang.String,java.lang.String> britToUSMap

      Hash map with British spelling as key and American spelling as value.

  - ### Constructor Detail

    - #### BritishToUSSpellingMapper

          public BritishToUSSpellingMapper()

      Create British to US spelling mapper.

  - ### Method Detail

    - #### loadBritishToUSWordMap

          protected void loadBritishToUSWordMap()
                                         throws java.net.MalformedURLException,
                                                java.io.IOException

      Load the British to US mapping data.
      Throws:
        `java.net.MalformedURLException`
        `java.io.IOException`

    - #### mapSpelling

          public java.lang.String mapSpelling(java.lang.String spelling)

      Returns U.S. spelling given a British spelling.
      Specified by:
        `mapSpelling` in interface `SpellingMapper`
      Parameters:
        `spelling` - The spelling.
      Returns:
        The mapped spelling.