forked from feature23/StringSimilarity.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathISpanDistance.cs
More file actions
26 lines (25 loc) · 914 Bytes
/
ISpanDistance.cs
File metadata and controls
26 lines (25 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
namespace F23.StringSimilarity.Interfaces
{
/// <summary>
/// An interface for distance measures that operate on spans.
/// </summary>
public interface ISpanDistance
{
/// <summary>
/// Compute and return a measure of distance.
/// Must be >= 0.
///
/// This method operates on spans such as byte arrays.
/// Note that, when used on bytes, string encodings that
/// use more than one byte per codepoint (such as UTF-8)
/// are not supported and will most likely return
/// incorrect results.
/// </summary>
/// <param name="b1">The first span.</param>
/// <param name="b2">The second span.</param>
/// <returns>The measure of distance between the spans.</returns>
double Distance<T>(ReadOnlySpan<T> b1, ReadOnlySpan<T> b2)
where T : IEquatable<T>;
}
}