Class Phoneme

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

public class Phoneme extends Object implements Serializable
Represents a phoneme - the minimal unit of sound in a language.

A phoneme is to spoken language what a grapheme is to written language. This class uses IPA (International Phonetic Alphabet) for representation. * @see Phoneme (Wikipedia)

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Phoneme

      public Phoneme(Language language, Clip clip)
      Creates a phoneme with an audio clip.
      Parameters:
      language - the language
      clip - the audio clip representing the sound
      Throws:
      NullPointerException - if language or clip is null
    • Phoneme

      public Phoneme(Language language, Clip clip, char ipaCharacter)
      Creates a phoneme with audio and IPA representation.
      Parameters:
      language - the language
      clip - the audio clip
      ipaCharacter - the IPA character representation
    • Phoneme

      public Phoneme(Language language, String ipaSymbol, Phoneme.Type type)
      Creates a phoneme with IPA symbol (for multi-character IPA).
      Parameters:
      language - the language
      ipaSymbol - the IPA symbol (can be multiple characters)
      type - the phoneme type
  • Method Details

    • getLanguage

      public Language getLanguage()
      Returns the language.
      Returns:
      the language
    • getSound

      public Clip getSound()
      Returns the audio clip.
      Returns:
      the clip, or null if not set
    • setSound

      public void setSound(Clip clip)
      Sets the audio clip.
      Parameters:
      clip - the audio clip
    • getCharacter

      public char getCharacter()
      Returns the IPA character.
      Returns:
      the IPA character
    • getIpaSymbol

      public String getIpaSymbol()
      Returns the IPA symbol (may be multi-character).
      Returns:
      the IPA symbol
    • setIpaSymbol

      public void setIpaSymbol(String ipaSymbol)
      Sets the IPA symbol.
      Parameters:
      ipaSymbol - the IPA representation
    • getDescription

      public String getDescription()
      Returns the description.
      Returns:
      the description
    • setDescription

      public void setDescription(String description)
      Sets a description for this phoneme.
      Parameters:
      description - the description
    • getType

      public Phoneme.Type getType()
      Returns the phoneme type.
      Returns:
      the type
    • setType

      public void setType(Phoneme.Type type)
      Sets the phoneme type.
      Parameters:
      type - the type
    • isVowel

      public boolean isVowel()
      Checks if this is a vowel phoneme.
      Returns:
      true if vowel
    • isConsonant

      public boolean isConsonant()
      Checks if this is a consonant phoneme.
      Returns:
      true if consonant
    • play

      public void play()
      Plays the audio clip if available.
    • 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