Class StringPattern

java.lang.Object
opennlp.tools.util.featuregen.StringPattern

public class StringPattern extends Object
Recognizes predefined patterns in strings.
  • Method Details

    • recognize

      public static StringPattern recognize(String token)
    • isAllLetter

      public boolean isAllLetter()
      Returns:
      true if all characters are letters.
    • isInitialCapitalLetter

      public boolean isInitialCapitalLetter()
      Returns:
      true if first letter is capital.
    • isAllCapitalLetter

      public boolean isAllCapitalLetter()
      Returns:
      true if all letters are capital.
    • isAllLowerCaseLetter

      public boolean isAllLowerCaseLetter()
      Returns:
      true if all letters are lower case.
    • isAllDigit

      public boolean isAllDigit()
      Returns:
      true if all chars are digits.
    • isAllHiragana

      public boolean isAllHiragana()
      Returns:
      true if all chars are hiragana.
    • isAllKatakana

      public boolean isAllKatakana()
      Returns:
      true if all chars are katakana.
    • digits

      public int digits()
      Retrieves the number of digits.
    • containsPeriod

      public boolean containsPeriod()
      Returns:
      true if a period is contained.
    • containsComma

      public boolean containsComma()
      Returns:
      true if a comma is contained.
    • containsSlash

      public boolean containsSlash()
      Returns:
      true if a slash is contained.
    • containsDigit

      public boolean containsDigit()
      Returns:
      true if a digit is contained.
    • containsHyphen

      public boolean containsHyphen()
      Returns:
      true if a hypen is contained.
    • containsLetters

      public boolean containsLetters()
      Returns:
      true if a letters are contained.