Class PhonoCell
- java.lang.Object
-
- net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
-
- net.oijon.oling.datatypes.phonology.table.PhonoCell
-
- All Implemented Interfaces:
XMLDatatype
- Direct Known Subclasses:
PhonoList
public class PhonoCell extends FeaturalXMLDatatype
Creates the equivalent of a cell in the IPA chart
-
-
Field Summary
-
Fields inherited from class net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
features, level, lowerObj
-
-
Constructor Summary
Constructors Constructor Description PhonoCell()Creates a blank cellPhonoCell(int index)Creates a blank cell at a given index relative to its PhonoCategoryPhonoCell(java.util.ArrayList<Phoneme> phonemes, int index)Creates a cell from a given list of phonemesPhonoCell(org.w3c.dom.Element e)Creates a PhonoCell from an XML element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSound(java.lang.String s)Adds a sound from a string, automatically setting the index to be at the end of the cellvoidaddSound(Phoneme p)Adds a sound from a phoneme, automatically checking for and fixing index conflictsbooleanequals(java.lang.Object o)voidfromXML(org.w3c.dom.Element e)intgetIndex()Gets the index of the cell relative to the PhonoCategoryjava.util.ArrayList<Phoneme>getPhonemes()Gets all the phonemes in this cell as an ArrayListprotected voidinitFeatures()voidsetIndex(int index)Sets the index of the cell relative to the PhonoCategoryintsize()Gets the amount of phonemes in the cellintsizeWithoutSpacers()For the legacy parser, spacers are required.java.lang.StringtoString()org.w3c.dom.ElementtoXML()-
Methods inherited from class net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
addFeature, applyFeatures, find, getAllPhonemes, getFeatures, removeFeature, setFeature
-
-
-
-
Constructor Detail
-
PhonoCell
public PhonoCell()
Creates a blank cell
-
PhonoCell
public PhonoCell(int index)
Creates a blank cell at a given index relative to its PhonoCategory- Parameters:
index- The index of this cell inside its PhonoCategory
-
PhonoCell
public PhonoCell(java.util.ArrayList<Phoneme> phonemes, int index)
Creates a cell from a given list of phonemes- Parameters:
phonemes- The phonemes to be put into the cellindex- The index of this cell inside its PhonoCategory
-
PhonoCell
public PhonoCell(org.w3c.dom.Element e) throws InvalidXMLExceptionCreates a PhonoCell from an XML element- Parameters:
e- The XML element to use- Throws:
InvalidXMLException- Thrown when the XML element given is malformed
-
-
Method Detail
-
addSound
public void addSound(java.lang.String s)
Adds a sound from a string, automatically setting the index to be at the end of the cell- Parameters:
s- The sound to be added
-
addSound
public void addSound(Phoneme p)
Adds a sound from a phoneme, automatically checking for and fixing index conflicts- Parameters:
p- The sound to be added
-
size
public int size()
Gets the amount of phonemes in the cell- Returns:
- The amount of phonemes in the cell
-
getPhonemes
public java.util.ArrayList<Phoneme> getPhonemes()
Gets all the phonemes in this cell as an ArrayList- Returns:
- All of the phonemes in the cell
-
getIndex
public int getIndex()
Gets the index of the cell relative to the PhonoCategory- Returns:
- The index of the cell in the PhonoCategory
-
setIndex
public void setIndex(int index)
Sets the index of the cell relative to the PhonoCategory- Parameters:
index- The index of the cell in the PhonoCategory
-
sizeWithoutSpacers
public int sizeWithoutSpacers()
For the legacy parser, spacers are required. However, spacers really, really should not be in the XML. This gets the size without spacer chars, to see if this really should be added to the XML at all.- Returns:
- The size of the cell without spacer characters
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
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
-
initFeatures
protected void initFeatures()
- Specified by:
initFeaturesin classFeaturalXMLDatatype
-
-