Class Grapheme

java.lang.Object
org.episteme.social.linguistics.Grapheme
All Implemented Interfaces:
Serializable

public class Grapheme extends Object implements 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 Details

    • Grapheme

      public Grapheme(Language language, char character)
      Creates a new Grapheme.
      Parameters:
      language - the language this grapheme belongs to
      character - the character representation
      Throws:
      NullPointerException - if language is null
  • Method Details

    • getLanguage

      public Language getLanguage()
      Returns the language this grapheme belongs to.
      Returns:
      the language
    • 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

      public String getUnicodeName()
      Returns the Unicode name of this character.
      Returns:
      the Unicode name, or null if not set
    • setUnicodeName

      public void setUnicodeName(String unicodeName)
      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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object