in src/cs/Microsoft.PhoneticMatching/Distance/EnHybridDistance.cs [38:64]
public double Distance(DistanceInput first, DistanceInput second)
{
if (first == null || second == null)
{
throw new ArgumentNullException("distance input can't be null");
}
if (first.Phrase == null || first.Pronunciation == null)
{
throw new ArgumentException("First distance input is invalid. Phrase or Punctuation is null");
}
if (second.Phrase == null || second.Pronunciation == null)
{
throw new ArgumentException("Second distance input is invalid. Phrase or Punctuation is null");
}
double distance = 0;
NativeResourceWrapper.CallNative((buffer) =>
{
int bufferSize = NativeResourceWrapper.BufferSize;
var result = EnHybridDistance_Distance(this.Native, first.Phrase, first.Pronunciation.Native, second.Phrase, second.Pronunciation.Native, out distance, buffer, ref bufferSize);
NativeResourceWrapper.BufferSize = bufferSize;
return result;
});
return distance;
}