Class KASRAlignmentItem

java.lang.Object
com.keenresearch.keenasr.KASRAlignmentItem

public class KASRAlignmentItem extends Object
A single step in an alignment trace. For an KASRAlignOp.INSERTION, refIndex is -1 and refToken is empty. For a KASRAlignOp.DELETION, recIndex is -1 and recToken is empty. For KASRAlignOp.MATCH and KASRAlignOp.SUBSTITUTION, both indices and tokens are populated. Indices refer to positions in the post-normalization token vectors; see KASRTextAligner.getReferenceTokens() for the reference side.
  • Method Details

    • getOp

      public final KASRAlignOp getOp()
      Returns:
      The edit operation this item represents.
    • getRefIndex

      public final int getRefIndex()
      Returns:
      Index of the reference token participating in this operation, or -1 for an insertion.
    • getRecIndex

      public final int getRecIndex()
      Returns:
      Index of the recognized token participating in this operation, or -1 for a deletion.
    • getRefToken

      public final String getRefToken()
      Returns:
      Reference token at refIndex, or empty for an insertion.
    • getRecToken

      public final String getRecToken()
      Returns:
      Recognized token at recIndex, or empty for a deletion.