getDistanceInfo method
Computes the distance between the given inputs.
inputs is a list of strings to compare. The exact number of inputs
required depends on the specific algorithm.
options provides optional configuration for the computation.
The base implementation returns an empty DistanceInfo. Subclasses must override this method to provide a meaningful result.
Implementation
@override
DistanceInfo getDistanceInfo(List<String> inputs, {CalculationOptions? options}) {
if (inputs.length != 2) {
throw ArgumentError(
"There should be only two inputs",
);
}
options ??= CalculationOptions.defaultOne();
var result = getLcsInfo(inputs[0], inputs[1]);
return DistanceInfo()
..originalInputs = inputs
..distance = result.lcsMatchedSubSequences!.keys.first.toDouble()
..lcsInfo = result;
}