Class Phoneme

  • All Implemented Interfaces:
    XMLDatatype

    public class Phoneme
    extends FeaturalXMLDatatype
    Creates the equivalent of an individual phoneme on the IPA chart
    • 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 PhonoCell
      Phoneme​(org.w3c.dom.Element e)
      Creates a phoneme from an XML element
    • 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 represents
        index - The index of this sound inside its PhonoCell
      • Phoneme

        public Phoneme​(org.w3c.dom.Element e)
                throws InvalidXMLException
        Creates 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
      • find

        public Phoneme find​(java.lang.String value)
        Description copied from class: FeaturalXMLDatatype
        Finds a particular phoneme object from a given string
        Overrides:
        find in class FeaturalXMLDatatype
        Parameters:
        value - The string representation of the wanted phoneme
        Returns:
        The phoneme that matches the given string.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object