Record Class SyllableInfo

java.lang.Object
java.lang.Record
ca.phon.ipa.SyllableInfo
Record Components:
constituentType - syllable constituent type
isDiphthong - true if element is a diphthong member (only valid for SyllableConstituentType.NUCLEUS)
stress - syllable stress
syllableIndex - index of syllable in word/phrase

public record SyllableInfo(SyllableConstituentType constituentType, boolean isDiphthong, SyllableStress stress, int syllableIndex, boolean segregated, int sonority, int sonorityDistance, ToneNumber tone) extends Record
Syllable information for IPAElements.
  • Constructor Details

    • SyllableInfo

      public SyllableInfo(SyllableConstituentType constituentType, boolean isDiphthong, SyllableStress stress, int syllableIndex, boolean segregated, int sonority, int sonorityDistance, ToneNumber tone)
      Creates an instance of a SyllableInfo record class.
      Parameters:
      constituentType - the value for the constituentType record component
      isDiphthong - the value for the isDiphthong record component
      stress - the value for the stress record component
      syllableIndex - the value for the syllableIndex record component
      segregated - the value for the segregated record component
      sonority - the value for the sonority record component
      sonorityDistance - the value for the sonorityDistance record component
      tone - the value for the tone record component
  • Method Details

    • builder

      public static SyllableInfo.Builder builder()
      Create a new builder instance with default values.
      Returns:
      builder
    • toBuilder

      public SyllableInfo.Builder toBuilder()
      Create a builder initialized with the values from this SyllableInfo.
      Returns:
      builder pre-populated with this record's values
    • annotateElements

      public static List<IPAElement> annotateElements(List<IPAElement> elems)
      Return a list of elements where the syllable info has been set. It's assumed that syllable constituent type information has been applied to the elements already.
      Parameters:
      elems - list of elements
      Returns:
      list of elements with syllable info set - these elements have been cloned with new SyllableInfo information
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • constituentType

      public SyllableConstituentType constituentType()
      Returns the value of the constituentType record component.
      Returns:
      the value of the constituentType record component
    • isDiphthong

      public boolean isDiphthong()
      Returns the value of the isDiphthong record component.
      Returns:
      the value of the isDiphthong record component
    • stress

      public SyllableStress stress()
      Returns the value of the stress record component.
      Returns:
      the value of the stress record component
    • syllableIndex

      public int syllableIndex()
      Returns the value of the syllableIndex record component.
      Returns:
      the value of the syllableIndex record component
    • segregated

      public boolean segregated()
      Returns the value of the segregated record component.
      Returns:
      the value of the segregated record component
    • sonority

      public int sonority()
      Returns the value of the sonority record component.
      Returns:
      the value of the sonority record component
    • sonorityDistance

      public int sonorityDistance()
      Returns the value of the sonorityDistance record component.
      Returns:
      the value of the sonorityDistance record component
    • tone

      public ToneNumber tone()
      Returns the value of the tone record component.
      Returns:
      the value of the tone record component