Package ca.phon.ipa

Class IPAElement

java.lang.Object
ca.phon.ipa.IPAElement
All Implemented Interfaces:
IExtendable, Visitable<IPAElement>
Direct Known Subclasses:
AlignmentMarker, CompoundWordMarker, Diacritic, IntonationGroup, IntraWordPause, Pause, Phone, PhonexMatcherReference, Sandhi, StressMarker, SyllableBoundary, WordBoundary

public abstract class IPAElement extends Object implements Visitable<IPAElement>, IExtendable

IPAElements represent the atomic unit of IPA transcriptions. IPAElements are constructed using the create methods of IPAElementFactory.

IPAElement objects are extendable via capabilities. Classes provided to ExtensionSupport.putExtension(Class, Object) must have the Extension annotation declaring Phone.class as the accepted type.
E.g.,

 @Extension(IPAElement.class)
 public class MyNewPhoneExtension {...}
 
Common uses for IPAElement extensions are annotations such as syllabification information (see SyllabificationInfo.)

IPAElement objects also implement the visitor pattern. Visitors must implement the

invalid @link
PhoneVisitor
or extend
invalid @link
PhoneVisitorAdapter
and can be applied using the accept(PhoneVisitor) method.

  • Field Details

  • Constructor Details

    • IPAElement

      public IPAElement()
  • Method Details

    • setFeatureSet

      public void setFeatureSet(FeatureSet featureSet)
      Set the custom features for this IPAElement
      Parameters:
      featureSet - . Use null to have the default features returned
    • _getFeatureSet

      protected abstract FeatureSet _getFeatureSet()
      Private method to return the feature set for the IPAElement. This return value for this method can be changed by using the setFeatureSet(FeatureSet) method.
      Returns:
      the phones feature set
    • getText

      public abstract String getText()
      Get the text for this phone
      Returns:
      the phone string
    • getFeatureSet

      public FeatureSet getFeatureSet()
      Return the feature set for this IPAElement.
      Returns:
      the default feature set - derived by the implementing type or custom features if defined.
    • getScType

      public SyllableConstituentType getScType()
      Direct access to SyllabificationInfo.getConstituentType(). Will return the syllable constituent type for the phone (if available.)
      Returns:
      the phone's SyllableConstituentType or SyllableConstituentType.UNKNOWN if no syllabification information was found.
    • setScType

      public void setScType(SyllableConstituentType scType)
      Parameters:
      scType - the constituent type for the phon
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
    • addPropertyChangeListener

      public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
    • fireIndexedPropertyChange

      public void fireIndexedPropertyChange(String propertyName, int index, boolean oldValue, boolean newValue)
    • fireIndexedPropertyChange

      public void fireIndexedPropertyChange(String propertyName, int index, int oldValue, int newValue)
    • fireIndexedPropertyChange

      public void fireIndexedPropertyChange(String propertyName, int index, Object oldValue, Object newValue)
    • firePropertyChange

      public void firePropertyChange(PropertyChangeEvent event)
    • firePropertyChange

      public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
    • firePropertyChange

      public void firePropertyChange(String propertyName, int oldValue, int newValue)
    • firePropertyChange

      public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
    • getPropertyChangeListeners

      public PropertyChangeListener[] getPropertyChangeListeners()
    • getPropertyChangeListeners

      public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
    • hasListeners

      public boolean hasListeners(String propertyName)
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
    • removePropertyChangeListener

      public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
    • contentEquals

      public boolean contentEquals(IPAElement ele)
    • accept

      public void accept(Visitor<IPAElement> phoneVisitor)
      Description copied from interface: Visitable
      Accept the given visitor.
      Specified by:
      accept in interface Visitable<IPAElement>
    • getExtensions

      public Set<Class<?>> getExtensions()
      Description copied from interface: IExtendable
      Return all extension types supported
      Specified by:
      getExtensions in interface IExtendable
    • getExtension

      public <T> T getExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Get the requested extension if available.
      Specified by:
      getExtension in interface IExtendable
      Returns:
      the capability object or null if the cability is not available
    • putExtension

      public <T> T putExtension(Class<T> cap, T impl)
      Description copied from interface: IExtendable
      Add a new extension.
      Specified by:
      putExtension in interface IExtendable
      Parameters:
      cap - the extension to add
      Returns:
      the added extension implementation
    • removeExtension

      public <T> T removeExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Remove a capability.
      Specified by:
      removeExtension in interface IExtendable
      Parameters:
      cap - the capability to remove
    • toString

      public String toString()
      Overrides:
      toString in class Object