Package ca.phon.ipa
Class Phone
java.lang.Object
ca.phon.ipa.IPAElement
ca.phon.ipa.Phone
- All Implemented Interfaces:
IExtendable
,CombiningDiacritics
,PrefixDiacritics
,SuffixDiacritics
,Visitable<IPAElement>
- Direct Known Subclasses:
CompoundPhone
public class Phone
extends IPAElement
implements PrefixDiacritics, SuffixDiacritics, CombiningDiacritics
A basic phone consists of the following parts:
- A (optional) prefix diacritic
- A base glyph (i.e., Consonant, Vowel, etc.)
- Combining diacritics
- Length - measured from 0-3, with 0 being no length modifier
- A (optional) suffix diacritic
-
Field Summary
Fields inherited from class ca.phon.ipa.IPAElement
PHONE_TEXT
-
Method Summary
Modifier and TypeMethodDescriptionprotected FeatureSet
Private method to return the feature set for theIPAElement
.getBase()
Get the string for the phone's base.Get the feature set for the base phoneGet the primary glyph for this Phone.Get the string for the combining diacritic portion of the phone.Get the combining diacritics for the phone.Get the feature set for all combining diacritics.Get the string representing this phone's prefix.Get the feature set for the prefix diacritic.Get the string for this phone's suffix.Get the feature set for the suffix diacriticgetText()
Get the text for this phoneGet the tone diacritics for this phone.void
setBasePhone
(Character basePhone) Set the base glyph for the Phone.void
setCombiningDiacritics
(Diacritic[] combiningDiacritics) Set the combining diacritics for this phone.void
setPrefixDiacritics
(Diacritic[] prefixDiacritics) Set the prefix diacritics for this Phone.void
setSuffixDiacritics
(Diacritic[] suffixDiacritics) Set the prefix diacritics for this Phone.Methods inherited from class ca.phon.ipa.IPAElement
accept, addPropertyChangeListener, addPropertyChangeListener, contentEquals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getExtension, getExtensions, getFeatureSet, getPropertyChangeListeners, getPropertyChangeListeners, getScType, hasListeners, putExtension, removeExtension, removePropertyChangeListener, removePropertyChangeListener, setFeatureSet, setScType, toString
-
Method Details
-
getPrefixDiacritics
- Specified by:
getPrefixDiacritics
in interfacePrefixDiacritics
-
setPrefixDiacritics
Set the prefix diacritics for this Phone.- Parameters:
prefixDiacritics
-
-
getPrefix
Get the string representing this phone's prefix.- Returns:
-
getPrefixFeatures
Get the feature set for the prefix diacritic.- Returns:
- feature set for the prefix diacritic or an empty set if not found
-
getBasePhone
Get the primary glyph for this Phone. All other parts of the Phone are 'attached' to this glyph.- Returns:
- the base character for the Phone
-
setBasePhone
Set the base glyph for the Phone. The base glyph must be one of the following
IPATokenType
s:- Parameters:
basePhone
-
-
getBase
Get the string for the phone's base.- Returns:
- the text for the phone's base
-
getBaseFeatures
Get the feature set for the base phone- Returns:
- the base phone's feature set or an empty set if not found
-
getCombiningDiacritics
Get the combining diacritics for the phone.
- Specified by:
getCombiningDiacritics
in interfaceCombiningDiacritics
- Returns:
- the combining diacritics, or an empty array if no combining diacritics are available.
-
setCombiningDiacritics
Set the combining diacritics for this phone. Each character must have a the
IPATokenType.COMBINING_DIACRITIC
token type.- Parameters:
combiningDiacritics
-- Throws:
IllegalArgumentException
- if one of the given diacritics is not a combining diacritic
-
getToneNumberDiacritics
Get the tone diacritics for this phone.- Returns:
- tone diacritics
-
getLengthDiacritics
-
getCombining
Get the string for the combining diacritic portion of the phone.- Returns:
- the combining diacritic string
-
getCombiningFeatures
Get the feature set for all combining diacritics.- Returns:
- the feature set for all combining diacritics
-
getSuffixDiacritics
- Specified by:
getSuffixDiacritics
in interfaceSuffixDiacritics
-
setSuffixDiacritics
Set the prefix diacritics for this Phone.- Parameters:
prefixDiacritics
-
-
getSuffix
Get the string for this phone's suffix.- Returns:
- the text for the suffix portion of the Phone
-
getSuffixFeatures
Get the feature set for the suffix diacritic- Returns:
- feature set for the suffix diacritic or an empty set if not found
-
_getFeatureSet
Description copied from class:IPAElement
Private method to return the feature set for theIPAElement
. This return value for this method can be changed by using theIPAElement.setFeatureSet(FeatureSet)
method.- Specified by:
_getFeatureSet
in classIPAElement
- Returns:
- the phones feature set
-
getText
Description copied from class:IPAElement
Get the text for this phone- Specified by:
getText
in classIPAElement
- Returns:
- the phone string
-