Package com.yahoo.language.process
Class CharacterClasses
java.lang.Object
com.yahoo.language.process.CharacterClasses
Determines the class of a given character. Use this rather than java.lang.Character.
- Author:
- bratseth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisDigit(int c) Returns true for code points which should be considered digits - same as java.lang.Character.isDigit.booleanisLatin(int c) Returns true if this is a latin characterbooleanisLatinDigit(int c) Returns true if this is a latin digit (other digits are not consistently parsed into numbers by Java)booleanisLetter(int c) Returns true for code points which are letters in unicode 3 or 4, plus some additional characters which are useful to view as letters even though not defined as such in unicode.booleanisLetterOrDigit(int c) Convenience, returns isLetter(c) || isDigit(c)booleanisSentenceEnd(int c) Returns whether the given character is of a type used to mark the end of a sentence.booleanisSymbol(int c) Returns true if the character is in the class "other symbol" - emojis etc.
-
Constructor Details
-
CharacterClasses
public CharacterClasses()
-
-
Method Details
-
isLetter
public boolean isLetter(int c) Returns true for code points which are letters in unicode 3 or 4, plus some additional characters which are useful to view as letters even though not defined as such in unicode. -
isSymbol
public boolean isSymbol(int c) Returns true if the character is in the class "other symbol" - emojis etc. -
isDigit
public boolean isDigit(int c) Returns true for code points which should be considered digits - same as java.lang.Character.isDigit. -
isLatinDigit
public boolean isLatinDigit(int c) Returns true if this is a latin digit (other digits are not consistently parsed into numbers by Java) -
isLatin
public boolean isLatin(int c) Returns true if this is a latin character -
isLetterOrDigit
public boolean isLetterOrDigit(int c) Convenience, returns isLetter(c) || isDigit(c) -
isSentenceEnd
public boolean isSentenceEnd(int c) Returns whether the given character is of a type used to mark the end of a sentence.
-