edu.northwestern.at.morphadorner.corpuslinguistics.inflector.wordrule

## Class CategoryInflectionRule

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.inflector.wordrule.SuffixInflectionRule
  - - edu.northwestern.at.morphadorner.corpuslinguistics.inflector.wordrule.CategoryInflectionRule

- All Implemented Interfaces:
    WordRule

      public class CategoryInflectionRule
      extends SuffixInflectionRule

  A rule for specifying an inflection using suffixes that only applies to a subset of words with those suffixes (a category).

  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 java.lang.String` | `regex`

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.inflector.wordrule.SuffixInflectionRule

      `pluralSuffix, singularSuffix`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CategoryInflectionRule(java.lang.String[] words, java.lang.String singularSuffix, java.lang.String pluralSuffix)` Construct a rule for `words` with suffix `singularSuffix` which becomes `pluralSuffix` in the plural.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `applies(java.lang.String word)` Tests to see if this rule applies for the given word.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.inflector.wordrule.SuffixInflectionRule

      `apply`

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

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

- - ### Field Detail

    - #### regex

          protected final java.lang.String regex

  - ### Constructor Detail

    - #### CategoryInflectionRule

          public CategoryInflectionRule(java.lang.String[] words,
                                java.lang.String singularSuffix,
                                java.lang.String pluralSuffix)

      Construct a rule for `words` with suffix `singularSuffix` which becomes `pluralSuffix` in the plural.
      Parameters:
        `words` - The set of words which define this category.
        `singularSuffix` - The singular suffix, starting with a "-" character
        `pluralSuffix` - The plural suffix, starting with a "-" character.

  - ### Method Detail

    - #### applies

          public boolean applies(java.lang.String word)

      Tests to see if this rule applies for the given word.
      Specified by:
        `applies` in interface `WordRule`
      Overrides:
        `applies` in class `SuffixInflectionRule`
      Parameters:
        `word` - The word that is being tested
      Returns:
        `true` if this rule should be applied, `false` otherwise