Package ca.phon.alignment
Class IndelAligner<T>
java.lang.Object
ca.phon.alignment.IndelAligner<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
Aligner<T>
- Direct Known Subclasses:
PhoneAligner
,SyllableAligner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncalculateAlignment
(T[] top, T[] bottom) Calculate the alignment.protected abstract int
protected abstract int
costSubstitute
(T ele1, T ele2) Return the similarity between two elementsReturns the AlignmentMap calculated during the last call to 'calculateAlignment'.protected Integer[][]
retrieveAlignment
(T[] top, T[] bottom, int i, int j, int tally, int[][] matrix, Stack<Integer> tp, Stack<Integer> ap, int score) Get the alignment from the completed matrix
-
Constructor Details
-
IndelAligner
public IndelAligner()
-
-
Method Details
-
costSubstitute
Return the similarity between two elements- Parameters:
ele1
-ele2
-- Returns:
-
costSkip
-
calculateAlignment
Description copied from interface:Aligner
Calculate the alignment. Alignment calculation is determined by implementation. See global vs local alignment.- Specified by:
calculateAlignment
in interfaceAligner<T>
- Returns:
- the alignment map
-
retrieveAlignment
protected Integer[][] retrieveAlignment(T[] top, T[] bottom, int i, int j, int tally, int[][] matrix, Stack<Integer> tp, Stack<Integer> ap, int score) Get the alignment from the completed matrix- Parameters:
top
- top elementsbottom
- bottom elementsi
- the width of the matrixj
- the height of the matrixtally
- the total score accumulated in at each setp of the recursiontp
- the stack used to store the target alignmentap
- the stack used to store the actual alignmentscore
-Matrix
- the completed dynamic algorithm
-
getAlignmentMap
Description copied from interface:Aligner
Returns the AlignmentMap calculated during the last call to 'calculateAlignment'. Undefined if calculateAlignment was not called.- Specified by:
getAlignmentMap
in interfaceAligner<T>
- Returns:
- alignment map
-