Interface AlignmentScorer<T>

  • All Known Implementing Classes:
    GaleAndChurch

    public interface AlignmentScorer<T>
    SegmentAlignmentScorer defines interface of the source and target segment alignment score functions. Score functions include deletionScore (1-0), insertionScore (0-1), substitutionScore (1-1), contractionScore (2-1), expansionScore (1-2) and meldingScore (2-2).
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int contractionScore​(T p_sourceTuv1, T p_sourceTuv2, T p_targetTuv)
      Calculate the cost of contracting two source segments to one target segment.
      int deletionScore​(T p_sourceTuv)
      Calculate the cost of deletion of source segment.
      int expansionScore​(T p_sourceTuv, T p_targetTuv1, T p_targetTuv2)
      Calculate the cost of expanding one source segment to two target segments.
      int insertionScore​(T p_targetTuv)
      Calculate the cost of insertion of target segment.
      int meldingScore​(T p_sourceTuv1, T p_sourceTuv2, T p_targetTuv1, T p_targetTuv2)
      Calculate the cost of melding of two source segments to two target segments.
      void setLocales​(LocaleId p_sourceLocale, LocaleId p_targetLocale)
      Set source and target locales.
      int substitutionScore​(T p_sourceTuv, T p_targetTuv)
      Calculate the cost of substitution of source segment by target segment.
    • Method Detail

      • setLocales

        void setLocales​(LocaleId p_sourceLocale,
                        LocaleId p_targetLocale)
        Set source and target locales.
        Parameters:
        p_sourceLocale - Source locale
        p_targetLocale - Target locale
      • substitutionScore

        int substitutionScore​(T p_sourceTuv,
                              T p_targetTuv)
        Calculate the cost of substitution of source segment by target segment.
        Parameters:
        p_sourceTuv - Source TUV. Source is in X sequence in the DP map.
        p_targetTuv - Target TUV. Target is in Y sequence in the DP map.
        Returns:
        cost of the substitution
      • deletionScore

        int deletionScore​(T p_sourceTuv)
        Calculate the cost of deletion of source segment.
        Parameters:
        p_sourceTuv - Source TUV. Source is in X sequence in the DP map.
        Returns:
        cost of the deletion
      • insertionScore

        int insertionScore​(T p_targetTuv)
        Calculate the cost of insertion of target segment.
        Parameters:
        p_targetTuv - Target TUV. Target is in Y sequence in the DP map.
        Returns:
        cost of the insertion
      • contractionScore

        int contractionScore​(T p_sourceTuv1,
                             T p_sourceTuv2,
                             T p_targetTuv)
        Calculate the cost of contracting two source segments to one target segment.
        Parameters:
        p_sourceTuv1 - Source TUV1. Source is in X sequence in the DP map.
        p_sourceTuv2 - Source TUV2. Source is in X sequence in the DP map.
        p_targetTuv - Target TUV. Target is in Y sequence in the DP map.
        Returns:
        cost of the contraction
      • expansionScore

        int expansionScore​(T p_sourceTuv,
                           T p_targetTuv1,
                           T p_targetTuv2)
        Calculate the cost of expanding one source segment to two target segments.
        Parameters:
        p_sourceTuv - Source TUV. Source is in X sequence in the DP map.
        p_targetTuv1 - Target TUV1. Target is in Y sequence in the DP map.
        p_targetTuv2 - Target TUV2. Target is in Y sequence in the DP map.
        Returns:
        cost of the expansion
      • meldingScore

        int meldingScore​(T p_sourceTuv1,
                         T p_sourceTuv2,
                         T p_targetTuv1,
                         T p_targetTuv2)
        Calculate the cost of melding of two source segments to two target segments.
        Parameters:
        p_sourceTuv1 - Source TUV1. Source is in X sequence in the DP map.
        p_sourceTuv2 - Source TUV2. Source is in X sequence in the DP map.
        p_targetTuv1 - Target TUV1. Target is in Y sequence in the DP map.
        p_targetTuv2 - Target TUV2. Target is in Y sequence in the DP map.
        Returns:
        cost of the melding