Package nzilbb.encoding.comparator
Class IPA2IPAComparator<E>
- java.lang.Object
-
- nzilbb.encoding.comparator.IPA2IPAComparator<E>
-
- All Implemented Interfaces:
EditComparator<E>
public class IPA2IPAComparator<E> extends Object implements EditComparator<E>
Comparator that maps one IPA-encoded series to another.
-
-
Constructor Summary
Constructors Constructor Description IPA2IPAComparator()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EditStep<E>compare(E from, E to)Compares two sequence elements, and evaluates the distance between them.EditStep<E>delete(E from)The distance for deleting the given element.EditStep<E>insert(E to)The distance for inserting the given element.
-
-
-
Method Detail
-
compare
public EditStep<E> compare(E from, E to)
Compares two sequence elements, and evaluates the distance between them.- Specified by:
comparein interfaceEditComparator<E>- Parameters:
from- The element from the source sequence, which may be null,to- The element from the destination sequence, which may be null.- Returns:
- An edit step between the two elements.
EditStep.getFrom()is set to from,EditStep.getTo()is set to to,EditStep.getStepDistance()is set to the computed edit distance between these two elements, andEditStep.getOperation()is set to either EditStep.StepOperation.NONE or EditStep.StepOperation.CHANGE.
-
delete
public EditStep<E> delete(E from)
The distance for deleting the given element.- Specified by:
deletein interfaceEditComparator<E>- Parameters:
from- The element that would be deleted, which may be null.- Returns:
- An edit step with
EditStep.getStepDistance()set to the distance for deleting the given element.EditStep.getFrom()is set to from, andEditStep.getOperation()is set to EditStep.StepOperation.DELETE
-
insert
public EditStep<E> insert(E to)
The distance for inserting the given element.- Specified by:
insertin interfaceEditComparator<E>- Parameters:
to- The element that would be inserted, which may be null.- Returns:
- An edit step with
EditStep.getStepDistance()set to the distance for inserting the given element.EditStep.getTo()is set to to, andEditStep.getOperation()is set to EditStep.StepOperation.INSERT
-
-