Package ca.phon.ipa

Class 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
  • Method Details

    • getPrefixDiacritics

      public Diacritic[] getPrefixDiacritics()
      Specified by:
      getPrefixDiacritics in interface PrefixDiacritics
    • setPrefixDiacritics

      public void setPrefixDiacritics(Diacritic[] prefixDiacritics)
      Set the prefix diacritics for this Phone.
      Parameters:
      prefixDiacritics -
    • getPrefix

      public String getPrefix()
      Get the string representing this phone's prefix.
      Returns:
    • getPrefixFeatures

      public FeatureSet getPrefixFeatures()
      Get the feature set for the prefix diacritic.
      Returns:
      feature set for the prefix diacritic or an empty set if not found
    • getBasePhone

      public Character 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

      public void setBasePhone(Character basePhone)

      Set the base glyph for the Phone. The base glyph must be one of the following IPATokenTypes:

      Parameters:
      basePhone -
    • getBase

      public String getBase()
      Get the string for the phone's base.
      Returns:
      the text for the phone's base
    • getBaseFeatures

      public FeatureSet getBaseFeatures()
      Get the feature set for the base phone
      Returns:
      the base phone's feature set or an empty set if not found
    • getCombiningDiacritics

      public Diacritic[] getCombiningDiacritics()

      Get the combining diacritics for the phone.

      Specified by:
      getCombiningDiacritics in interface CombiningDiacritics
      Returns:
      the combining diacritics, or an empty array if no combining diacritics are available.
    • setCombiningDiacritics

      public void setCombiningDiacritics(Diacritic[] combiningDiacritics)

      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

      public Diacritic[] getToneNumberDiacritics()
      Get the tone diacritics for this phone.
      Returns:
      tone diacritics
    • getLengthDiacritics

      public Diacritic[] getLengthDiacritics()
    • getCombining

      public String getCombining()
      Get the string for the combining diacritic portion of the phone.
      Returns:
      the combining diacritic string
    • getCombiningFeatures

      public FeatureSet getCombiningFeatures()
      Get the feature set for all combining diacritics.
      Returns:
      the feature set for all combining diacritics
    • getSuffixDiacritics

      public Diacritic[] getSuffixDiacritics()
      Specified by:
      getSuffixDiacritics in interface SuffixDiacritics
    • setSuffixDiacritics

      public void setSuffixDiacritics(Diacritic[] suffixDiacritics)
      Set the prefix diacritics for this Phone.
      Parameters:
      prefixDiacritics -
    • getSuffix

      public String getSuffix()
      Get the string for this phone's suffix.
      Returns:
      the text for the suffix portion of the Phone
    • getSuffixFeatures

      public FeatureSet getSuffixFeatures()
      Get the feature set for the suffix diacritic
      Returns:
      feature set for the suffix diacritic or an empty set if not found
    • _getFeatureSet

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

      public String getText()
      Description copied from class: IPAElement
      Get the text for this phone
      Specified by:
      getText in class IPAElement
      Returns:
      the phone string