edu.northwestern.at.morphadorner.corpuslinguistics.inflector.pluralizer

## Class EnglishPluralizer

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.inflector.pluralizer.RuleBasedPluralizer
  - - edu.northwestern.at.morphadorner.corpuslinguistics.inflector.pluralizer.EnglishPluralizer

- All Implemented Interfaces:
    Pluralizer
  Direct Known Subclasses:
    DefaultPluralizer

      public class EnglishPluralizer
      extends RuleBasedPluralizer

  English language pluralizer.

  Based upon the paper "An Algorithmic Approach to English Pluralization" by Damian Conway at http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html .

  Original code written by Tom White under the Apache v2 license. Modified by Philip R. Burns for integration into MorphAdorner.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.util.Map<java.lang.String,java.lang.String>` | `ACCUSATIVE_PRONOUNS`
    `protected static java.lang.String[]` | `CATEGORY_A_AE_RULE`
    `protected static java.lang.String[]` | `CATEGORY_EX_ICES_RULE`
    `protected static java.lang.String[]` | `CATEGORY_IX_ICES_RULE`
    `protected static java.lang.String[]` | `CATEGORY_MAN_MANS_RULE`
    `protected static java.lang.String[]` | `CATEGORY_O_OS_RULE`
    `protected static java.lang.String[]` | `CATEGORY_ON_A_RULE`
    `protected static java.lang.String[]` | `CATEGORY_SINGULAR_S_RULE`
    `protected static java.lang.String[]` | `CATEGORY_UM_A_RULE`
    `protected static java.lang.String[]` | `CATEGORY_UNINFLECTED_NOUNS`
    `protected static java.lang.String[]` | `CATEGORY_US_I_RULE`
    `protected static java.lang.String[]` | `CLASSICAL_A_AE_RULE`
    `protected static java.lang.String[]` | `CLASSICAL_A_ATA_RULE`
    `protected static java.lang.String[]` | `CLASSICAL_EIX_ICES_RULE`
    `protected static java.lang.String[]` | `CLASSICAL_EN_INA_RULE`
    `protected static java.lang.String[]` | `CLASSICAL_O_I_RULE`
    `protected static java.lang.String[]` | `CLASSICAL_ON_A_RULE`
    `protected static java.lang.String[]` | `CLASSICAL_UM_A`
    `protected static java.lang.String[]` | `CLASSICAL_US_I_RULE`
    `protected static java.lang.String[]` | `CLASSICAL_US_US_RULE`
    `protected static java.util.Map<java.lang.String,java.lang.String>` | `IRREGULAR_NOUNS`
    `protected static java.util.Map<java.lang.String,java.lang.String>` | `NOMINATIVE_PRONOUNS`
    `protected static java.lang.String` | `POSTFIX_ADJECTIVE_REGEX`
    `protected static java.lang.String[]` | `PREPOSITIONS`
    `protected java.util.List<WordRule>` | `rules`

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.inflector.pluralizer.RuleBasedPluralizer

      `fallbackPluralizer, locale, NOOP_PLURALIZER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EnglishPluralizer()` Create Engish pluralizer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String` | `postProcess(java.lang.String trimmedWord, java.lang.String pluralizedWord)` Fix case of pluralized word.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.inflector.pluralizer.RuleBasedPluralizer

      `getFallbackPluralizer, getLocale, getRules, pluralize, pluralize, pluralizeInternal, setFallbackPluralizer, setLocale, setRules`

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

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

- - ### Field Detail

    - #### POSTFIX_ADJECTIVE_REGEX

          protected static final java.lang.String POSTFIX_ADJECTIVE_REGEX

      See Also:
        Constant Field Values

    - #### PREPOSITIONS

          protected static final java.lang.String[] PREPOSITIONS

    - #### NOMINATIVE_PRONOUNS

          protected static final java.util.Map<java.lang.String,java.lang.String> NOMINATIVE_PRONOUNS

    - #### ACCUSATIVE_PRONOUNS

          protected static final java.util.Map<java.lang.String,java.lang.String> ACCUSATIVE_PRONOUNS

    - #### IRREGULAR_NOUNS

          protected static final java.util.Map<java.lang.String,java.lang.String> IRREGULAR_NOUNS

    - #### CATEGORY_UNINFLECTED_NOUNS

          protected static final java.lang.String[] CATEGORY_UNINFLECTED_NOUNS

    - #### CATEGORY_MAN_MANS_RULE

          protected static final java.lang.String[] CATEGORY_MAN_MANS_RULE

    - #### CATEGORY_EX_ICES_RULE

          protected static final java.lang.String[] CATEGORY_EX_ICES_RULE

    - #### CATEGORY_IX_ICES_RULE

          protected static final java.lang.String[] CATEGORY_IX_ICES_RULE

    - #### CATEGORY_UM_A_RULE

          protected static final java.lang.String[] CATEGORY_UM_A_RULE

    - #### CLASSICAL_UM_A

          protected static final java.lang.String[] CLASSICAL_UM_A

    - #### CATEGORY_US_I_RULE

          protected static final java.lang.String[] CATEGORY_US_I_RULE

    - #### CLASSICAL_US_I_RULE

          protected static final java.lang.String[] CLASSICAL_US_I_RULE

    - #### CLASSICAL_US_US_RULE

          protected static final java.lang.String[] CLASSICAL_US_US_RULE

    - #### CATEGORY_ON_A_RULE

          protected static final java.lang.String[] CATEGORY_ON_A_RULE

    - #### CLASSICAL_ON_A_RULE

          protected static final java.lang.String[] CLASSICAL_ON_A_RULE

    - #### CLASSICAL_A_ATA_RULE

          protected static final java.lang.String[] CLASSICAL_A_ATA_RULE

    - #### CATEGORY_A_AE_RULE

          protected static final java.lang.String[] CATEGORY_A_AE_RULE

    - #### CLASSICAL_A_AE_RULE

          protected static final java.lang.String[] CLASSICAL_A_AE_RULE

    - #### CLASSICAL_EN_INA_RULE

          protected static final java.lang.String[] CLASSICAL_EN_INA_RULE

    - #### CLASSICAL_O_I_RULE

          protected static final java.lang.String[] CLASSICAL_O_I_RULE

    - #### CATEGORY_O_OS_RULE

          protected static final java.lang.String[] CATEGORY_O_OS_RULE

    - #### CATEGORY_SINGULAR_S_RULE

          protected static final java.lang.String[] CATEGORY_SINGULAR_S_RULE

    - #### CLASSICAL_EIX_ICES_RULE

          protected static final java.lang.String[] CLASSICAL_EIX_ICES_RULE

    - #### rules

          protected final java.util.List<WordRule> rules

  - ### Constructor Detail

    - #### EnglishPluralizer

          public EnglishPluralizer()

      Create Engish pluralizer.

  - ### Method Detail

    - #### postProcess

          protected java.lang.String postProcess(java.lang.String trimmedWord,
                                     java.lang.String pluralizedWord)

      Fix case of pluralized word.
      Overrides:
        `postProcess` in class `RuleBasedPluralizer`
      Parameters:
        `trimmedWord` - The input word, with leading and trailing whitespace removed.
        `pluralizedWord` - The pluralized word.
      Returns:
        The `pluralizedWord` after processing.

        If `trimmedWord` is all uppercase, then `pluralizedWord` is uppercased. If `trimmedWord` is titlecase, then `pluralizedWord` is titlecased.