Class Phoneme
- java.lang.Object
-
- net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
-
- net.oijon.oling.datatypes.phonology.table.Phoneme
-
- All Implemented Interfaces:
XMLDatatype
public class Phoneme extends FeaturalXMLDatatype
Creates the equivalent of an individual phoneme on the IPA chart
-
-
Field Summary
-
Fields inherited from class net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
features, level, lowerObj
-
-
Constructor Summary
Constructors Constructor Description Phoneme(java.lang.String sound)Creates a phoneme with a given sound in a string.Phoneme(java.lang.String sound, int index)Creates a phoneme with a given sound in a string and an index relative to its PhonoCellPhoneme(org.w3c.dom.Element e)Creates a phoneme from an XML element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Phonemefind(java.lang.String value)Finds a particular phoneme object from a given stringvoidfromXML(org.w3c.dom.Element e)java.util.ArrayList<Phoneme>getAllPhonemes()intgetIndex()Gets the index of this phoneme inside its cellintgetSonorancy()Gets the sonorancy of the given phonemejava.lang.StringgetSound()Gets the string of the sound this phoneme representsprotected voidinitFeatures()voidsetIndex(int index)Sets the index of this phoneme inside its cellvoidsetSonorancy(int sonorancy)Sets the sonorancy of the phoneme.voidsetSound(java.lang.String sound)Sets the string of the sound this phoneme representsjava.lang.StringtoString()org.w3c.dom.ElementtoXML()-
Methods inherited from class net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
addFeature, applyFeatures, getFeatures, removeFeature, setFeature
-
-
-
-
Constructor Detail
-
Phoneme
public Phoneme(java.lang.String sound)
Creates a phoneme with a given sound in a string. Note that if this is to be used in a PhonoTable, it needs an index to work properly!- Parameters:
sound- The sound this phoneme represents
-
Phoneme
public Phoneme(java.lang.String sound, int index)Creates a phoneme with a given sound in a string and an index relative to its PhonoCell- Parameters:
sound- The sound this phonemem representsindex- The index of this sound inside its PhonoCell
-
Phoneme
public Phoneme(org.w3c.dom.Element e) throws InvalidXMLExceptionCreates a phoneme from an XML element- Parameters:
e- The XML element to use- Throws:
InvalidXMLException- Thrown when the XML element given is malformed
-
-
Method Detail
-
getIndex
public int getIndex()
Gets the index of this phoneme inside its cell- Returns:
- The index in question
-
getSound
public java.lang.String getSound()
Gets the string of the sound this phoneme represents- Returns:
- The sound in question
-
getSonorancy
public int getSonorancy()
Gets the sonorancy of the given phoneme- Returns:
- The sonorancy of the given phoneme
-
setIndex
public void setIndex(int index)
Sets the index of this phoneme inside its cell- Parameters:
index- The new index to use
-
setSound
public void setSound(java.lang.String sound)
Sets the string of the sound this phoneme represents- Parameters:
sound- The new sound to use
-
setSonorancy
public void setSonorancy(int sonorancy)
Sets the sonorancy of the phoneme. Note that this will likely be overwritten by the PhonoSystem to make it properly conform with the configured sonorancy tree.- Parameters:
sonorancy- The sonorancy value for the phoneme
-
toXML
public org.w3c.dom.Element toXML() throws javax.xml.parsers.ParserConfigurationException- Throws:
javax.xml.parsers.ParserConfigurationException
-
fromXML
public void fromXML(org.w3c.dom.Element e) throws InvalidXMLException- Throws:
InvalidXMLException
-
find
public Phoneme find(java.lang.String value)
Description copied from class:FeaturalXMLDatatypeFinds a particular phoneme object from a given string- Overrides:
findin classFeaturalXMLDatatype- Parameters:
value- The string representation of the wanted phoneme- Returns:
- The phoneme that matches the given string.
-
getAllPhonemes
public java.util.ArrayList<Phoneme> getAllPhonemes()
- Overrides:
getAllPhonemesin classFeaturalXMLDatatype
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
initFeatures
protected void initFeatures()
- Specified by:
initFeaturesin classFeaturalXMLDatatype
-
-