StringPattern (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.util.featuregen, class: StringPattern

Package opennlp.tools.util.featuregen

# Class StringPattern

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

public class StringPattern extends Object
Recognizes predefined patterns in strings.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `containsComma()`
  `boolean`
  `containsDigit()`
  `boolean`
  `containsHyphen()`
  `boolean`
  `containsLetters()`
  `boolean`
  `containsPeriod()`
  `boolean`
  `containsSlash()`
  `int`
  `digits()`
  Retrieves the number of digits.
  `boolean`
  `isAllCapitalLetter()`
  `boolean`
  `isAllDigit()`
  `boolean`
  `isAllHiragana()`
  `boolean`
  `isAllKatakana()`
  `boolean`
  `isAllLetter()`
  `boolean`
  `isAllLowerCaseLetter()`
  `boolean`
  `isInitialCapitalLetter()`
  `static StringPattern`
  `recognize(String token)`

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

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

- ## 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.