Class Phoneme
java.lang.Object
org.episteme.social.linguistics.Phoneme
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPhoneme(Language language, String ipaSymbol, Phoneme.Type type) Creates a phoneme with IPA symbol (for multi-character IPA).Creates a phoneme with an audio clip.Creates a phoneme with audio and IPA representation. -
Method Summary
Modifier and TypeMethodDescriptionbooleancharReturns the IPA character.Returns the description.Returns the IPA symbol (may be multi-character).Returns the language.getSound()Returns the audio clip.getType()Returns the phoneme type.inthashCode()booleanChecks if this is a consonant phoneme.booleanisVowel()Checks if this is a vowel phoneme.voidplay()Plays the audio clip if available.voidsetDescription(String description) Sets a description for this phoneme.voidsetIpaSymbol(String ipaSymbol) Sets the IPA symbol.voidSets the audio clip.voidsetType(Phoneme.Type type) Sets the phoneme type.toString()
-
Constructor Details
-
Phoneme
Creates a phoneme with an audio clip.- Parameters:
language- the languageclip- the audio clip representing the sound- Throws:
NullPointerException- if language or clip is null
-
Phoneme
-
Phoneme
Creates a phoneme with IPA symbol (for multi-character IPA).- Parameters:
language- the languageipaSymbol- the IPA symbol (can be multiple characters)type- the phoneme type
-
-
Method Details
-
getLanguage
-
getSound
-
setSound
-
getCharacter
public char getCharacter()Returns the IPA character.- Returns:
- the IPA character
-
getIpaSymbol
Returns the IPA symbol (may be multi-character).- Returns:
- the IPA symbol
-
setIpaSymbol
Sets the IPA symbol.- Parameters:
ipaSymbol- the IPA representation
-
getDescription
-
setDescription
Sets a description for this phoneme.- Parameters:
description- the description
-
getType
-
setType
-
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
-
hashCode
-
toString
-