Class Grapheme
java.lang.Object
org.episteme.social.linguistics.Grapheme
- All Implemented Interfaces:
Serializable
Represents a grapheme - the minimal unit of written language.
A grapheme is the fundamental unit of a writing system, such as a letter in alphabetic scripts. For example, in English, the letters a-z are graphemes. Note that space (as a delimiter) is typically not considered a grapheme. * @see Grapheme (Wikipedia)
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancharReturns the character representation.intReturns the Unicode code point.Returns the language this grapheme belongs to.Returns the Unicode name of this character.inthashCode()booleanChecks if this is a consonant (for Latin script).booleanChecks if this is a lowercase letter.booleanChecks if this is an uppercase letter.booleanisVowel()Checks if this is a vowel (for Latin script).voidsetUnicodeName(String unicodeName) Sets the Unicode name.toString()
-
Constructor Details
-
Grapheme
Creates a new Grapheme.- Parameters:
language- the language this grapheme belongs tocharacter- the character representation- Throws:
NullPointerException- if language is null
-
-
Method Details
-
getLanguage
-
getCharacter
public char getCharacter()Returns the character representation.- Returns:
- the character
-
getCodePoint
public int getCodePoint()Returns the Unicode code point.- Returns:
- the code point
-
getUnicodeName
Returns the Unicode name of this character.- Returns:
- the Unicode name, or null if not set
-
setUnicodeName
Sets the Unicode name.- Parameters:
unicodeName- the Unicode character name
-
isVowel
public boolean isVowel()Checks if this is a vowel (for Latin script).- Returns:
- true if vowel
-
isConsonant
public boolean isConsonant()Checks if this is a consonant (for Latin script).- Returns:
- true if consonant
-
isUpperCase
public boolean isUpperCase()Checks if this is an uppercase letter.- Returns:
- true if uppercase
-
isLowerCase
public boolean isLowerCase()Checks if this is a lowercase letter.- Returns:
- true if lowercase
-
equals
-
hashCode
-
toString
-