Class IPAElementFactory

java.lang.Object
ca.phon.ipa.IPAElementFactory

public class IPAElementFactory extends Object
A factory for creating various types of IPAElement objects.
  • Constructor Details

    • IPAElementFactory

      public IPAElementFactory()
  • Method Details

    • createPhone

      public Phone createPhone()
      New basic phone
    • createPhone

      public Phone createPhone(Character basePhone)
      Create a new basic phone
      Parameters:
      basePhone -
      Returns:
      the created IPAElement object
    • createPhone

      public Phone createPhone(Character basePhone, Diacritic[] combiningDiacritics)
    • createPhone

      public Phone createPhone(Diacritic prefix, Character basePhone)
      Create a new basic phone
      Parameters:
      prefix -
      basePhone -
    • createPhone

      public Phone createPhone(Diacritic prefix, Character basePhone, Diacritic suffix)
      Create a new basic phone
      Parameters:
      prefix -
      basePhone -
      suffix -
    • createPhone

      public Phone createPhone(Diacritic prefix, Character basePhone, Diacritic[] combining, Diacritic suffix)
      Create a new basic phone
      Parameters:
      prefix -
      basePhone -
      combining -
      suffix -
    • createPhone

      public Phone createPhone(Diacritic[] prefix, Character basePhone, Diacritic[] combining, Diacritic[] suffix)
      Create a new basic phone
      Parameters:
      prefix -
      basePhone -
      combining -
      suffix -
    • createPhone

      public Phone createPhone(Diacritic[] prefix, Character basePhone, Diacritic[] combining, Diacritic[] suffix, FeatureSet overrides, SyllableInfo syllInfo)
      Create a new basic phone with feature overrides and syllable info
      Parameters:
      prefix - prefix diacritics
      basePhone - base phone character
      combining - combining diacritics
      suffix - suffix diacritics
      overrides - feature overrides
      syllInfo - syllable info
      Returns:
      the created IPAElement object
    • clonePhone

      public Phone clonePhone(Phone p)
    • clonePhoneAsDiphthong

      public Phone clonePhoneAsDiphthong(Phone p)
    • clonePhoneWithScType

      public Phone clonePhoneWithScType(Phone p, SyllableConstituentType scType)
    • clonePhoneWithSyllableInfo

      public Phone clonePhoneWithSyllableInfo(Phone p, SyllableInfo syllInfo)
    • createDiacritic

      public Diacritic createDiacritic(String text)

      Create diacritic from given string. Given string must match one of:

      • PREFIX COMBINING*
      • SUFFIX ROLE_REVERSAL COMBINING*
      • SUFFIX COMBINING* LIGATURE
      • SUFFIX COMBINING*
      • PREFIX ROLE_REVERSAL COMBINING*
      • LIGATURE PREFIX COMBINING*

      Parameters:
      text -
      Returns:
      diacritic for given string
      Throws:
      IllegalArgumentException - if text does not match prefix/suffix diacritic rules
    • createDiacritic

      public Diacritic createDiacritic(Character dia)
      Create diacritic from given char
      Parameters:
      dia -
      Returns:
    • createDiacritic

      public Diacritic createDiacritic(Diacritic[] prefix, Character dia, Diacritic[] suffix)
      Create diacritic from prefix diacritics, dia, and suffix (or combining) diacritics
      Parameters:
      prefix -
      dia -
      suffix -
      Returns:
    • copyDiacritic

      public Diacritic copyDiacritic(Diacritic dia)
    • createCompoundPhone

      public CompoundPhone createCompoundPhone()
      Create an empty compound phone
    • createCompoundPhone

      public CompoundPhone createCompoundPhone(Phone phone1, Phone phone2, Character ligature)
      Create a new compound phone
      Parameters:
      phone1 -
      phone2 -
      ligature -
    • createCompoundPhone

      public CompoundPhone createCompoundPhone(Phone phone1, Phone phone2, Character ligature, FeatureSet overrides, SyllableInfo syllInfo)
    • createCompoundPhone

      public CompoundPhone createCompoundPhone(Phone phone1, Phone phone2, Character ligature, Diacritic[] prefixDiacritics, Diacritic[] combiningDiacritics, Diacritic[] suffixDiacritics, FeatureSet overrides, SyllableInfo syllInfo)
    • cloneCompoundPhone

      public CompoundPhone cloneCompoundPhone(CompoundPhone cp)
    • createSyllableBoundary

      public SyllableBoundary createSyllableBoundary()
      Create a 'hard' syllable boundary. I.e., a '.'
      Returns:
      a syllable boundary marker
    • createStress

      public StressMarker createStress(StressType type)
      Create a new stress marker
      Parameters:
      type -
      Returns:
      a new stress marker of the given type
    • cloneStress

      public StressMarker cloneStress(StressMarker sm)
    • cloneStressWithSyllableInfo

      public StressMarker cloneStressWithSyllableInfo(StressMarker sm, SyllableInfo syllInfo)
    • createPrimaryStress

      public StressMarker createPrimaryStress()
      Create a primary stress marker
      Returns:
      a new primary stress marker
    • createSecondaryStress

      public StressMarker createSecondaryStress()
      Create a secondary stress marker
      Returns:
      a new secondary stress marker
    • createIntonationGroup

      public IntonationGroup createIntonationGroup(IntonationGroupType type)
      Create a new intonation group
      Parameters:
      type -
      Returns:
      a new intonation group marker
    • cloneIntonationGroup

      public IntonationGroup cloneIntonationGroup(IntonationGroup ig)
    • createMajorIntonationGroup

      public IntonationGroup createMajorIntonationGroup()
      Create a major intonation group marker
      Returns:
      a new major intonation group marker
    • createMinorIntonationGroup

      public IntonationGroup createMinorIntonationGroup()
      Create a minor intonation group marker
      Returns:
      a new minor intonation group marker
    • createWordBoundary

      public WordBoundary createWordBoundary()
      Create a new word boundary. I.e., a ' '
      Returns:
      a new word boundary marker
    • createPause

      public Pause createPause(PauseLength length)
      Create a pause
      Parameters:
      length -
      Returns:
      a new pause of the given length
    • createPause

      public Pause createPause(float secs)
    • clonePause

      public Pause clonePause(Pause pause)
    • createIntraWordPause

      public IntraWordPause createIntraWordPause()
      Create an intra-word pause
      Returns:
      new intra-word pause
    • createCompoundWordMarker

      public CompoundWordMarker createCompoundWordMarker()
      Create the default compound word marker ('+')
      Returns:
      compound word marker
    • createCompoundWordMarkerPlus

      public CompoundWordMarker createCompoundWordMarkerPlus()
    • createCompoundWordMarkerTilde

      public CompoundWordMarker createCompoundWordMarkerTilde()
    • createLinker

      public Linker createLinker()
      Create a linker
      Returns:
      linker (sandhi)
    • createContraction

      public Contraction createContraction()
      Create a contraction
      Returns:
      contraction (sandhi)
    • createSandhi

      public Sandhi createSandhi(String text)
      Create a sandhi element based on given text
      Returns:
      sandhi
    • cloneSandhi

      public Sandhi cloneSandhi(Sandhi s)
    • createPhonexMatcherReference

      public PhonexMatcherReference createPhonexMatcherReference(int groupIndex)
      Create a phonex matcher reference.
      Parameters:
      groupIndex -
    • createPhonexMatcherReference

      public PhonexMatcherReference createPhonexMatcherReference(String groupName)
      Create a phonex matcher reference.
      Parameters:
      groupName -
      Returns:
    • createPhonexMatcherReference

      public PhonexMatcherReference createPhonexMatcherReference(String groupName, Integer groupIndex, Diacritic[] prefixDiacritics, Diacritic[] combiningDiacritics, Diacritic[] suffixDiacritics)
    • clonePhonexMatcherReference

      public PhonexMatcherReference clonePhonexMatcherReference(PhonexMatcherReference ref)
    • createAlignmentMarker

      public AlignmentMarker createAlignmentMarker()
      Create a new alignment marker (left-right arrow 0x2194)
      Returns:
    • cloneElement

      public IPAElement cloneElement(IPAElement ele)
      Clone the given IPAElement the returned element will have the exact content and same SyllableConstituentType as the original element
      Parameters:
      ele -
      Returns:
      a copy of the given element
      Throws:
      NullPointerException - if ele is null
    • cloneElementWithSyllableInfo

      public IPAElement cloneElementWithSyllableInfo(IPAElement ele, SyllableInfo syllableInfo)
      Clone the given IPAElement the returned element will have the exact content and same SyllableConstituentType as the original element with new syllable info
      Parameters:
      ele -
      syllableInfo -
      Returns:
      a copy of the given element
      Throws:
      NullPointerException - if ele is null
    • createToneNumber

      public ToneNumber createToneNumber(char[] toneChars)
      Create a tone number element
      Parameters:
      toneChars - tone character (0-9 in superscript)
      Returns:
      tone number element
    • cloneToneNumber

      public ToneNumber cloneToneNumber(ToneNumber tn)
    • cloneToneNumberWithSyllableInfo

      public ToneNumber cloneToneNumberWithSyllableInfo(ToneNumber tn, SyllableInfo syllInfo)