Class TierAligner

java.lang.Object
ca.phon.session.alignment.TierAligner

public final class TierAligner extends Object
Helper class for aligning two tiers of a record. Tier values are first filtered using tier alignment rules and then left-aligned. The result is a list of tuples where each tuple contains an element from the top tier and an element from the bottom tier. If one tier has more elements than the other, nulls are used to fill in the gaps (i.e., 'indels.')
  • Constructor Details

    • TierAligner

      public TierAligner()
  • Method Details

    • mapAlignedElements

      public static List<Tuple<?,?>> mapAlignedElements(List<?> topElements, List<?> bottomElements)
      Return a list of left-aligned tuples
      Parameters:
      topElements -
      bottomElements -
      Returns:
      list of aligned tuples
    • alignTiers

      public static TierAlignment alignTiers(Tier<?> topTier, Tier<?> bottomTier, TierAlignmentRules tierAlignmentRules, Transcriber transcriber)
      Align two tiers using the given tier alignment rules
      Parameters:
      topTier - top tier
      bottomTier - bottom tier
      tierAlignmentRules - tier alignment rules
      transcriber - transcriber the blind transcriber used to transcribe the record
      Returns:
      tier alignment
    • alignTiers

      public static TierAlignment alignTiers(Tier<?> topTier, Tier<?> bottomTier)
    • alignTiers

      public static TierAlignment alignTiers(Tier<?> topTier, Tier<?> bottomTier, Transcriber transcriber)
    • calculateCrossTierAlignment

      public static CrossTierAlignment calculateCrossTierAlignment(Record record, Transcriber transcriber)
      Calculates cross tier alignment for all tiers against the Orthography tier
      Parameters:
      record -
      Returns:
      cross tier alignment for record against Orthography
    • calculateCrossTierAlignment

      public static CrossTierAlignment calculateCrossTierAlignment(Record record, Tier<?> topTier)
      Calculates cross tier alignment for all tiers against the Orthography tier
      Parameters:
      record - the record
      topTier - the top tier to align against (usually orthography or morphology
      Returns:
      cross tier alignment for record
    • calculateCrossTierAlignment

      public static CrossTierAlignment calculateCrossTierAlignment(Record record, Tier<?> topTier, Transcriber transcriber)
      Calculate cross tier alignment for all tiers which align by type
      Parameters:
      record - the record
      topTier - the top tier to align against (usually orthography or morphology
      transcriber - the transcriber to use for blind tiers
      Returns:
      cross tier alignment for record