Skip to content

Commit f2b7165

Browse files
Finish xml doc comments (#58)
QUICK SUMMARY (TL;DR): #48 XML comments add to repository PR SOLUTION APPROACH: Added tags for all classes, constructors, methods, properties, properties, and class variables with public or protected scope. Created extra branch for setup of docfx tool running successfully for next pr, pending approval this one. Existing private members with xml comment tags did not seem to appear in api generated documentation. Therefore skipped further updating xml comment tags of private members. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7f2db8f commit f2b7165

22 files changed

+233
-15
lines changed

src/F23.StringSimilarity/Damerau.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@ public class Damerau : IMetricStringDistance, IMetricSpanDistance
5656
public double Distance(string s1, string s2)
5757
=> Distance(s1.AsSpan(), s2.AsSpan());
5858

59+
/// <summary>
60+
/// Calculates the Damerau-Levenshtein distance between two sequences.
61+
/// </summary>
62+
/// <remarks>The Damerau-Levenshtein distance is a metric for measuring the edit distance between
63+
/// two sequences, allowing for the following operations: <list type="bullet"> <item><description>Insertion of a
64+
/// single element.</description></item> <item><description>Deletion of a single element.</description></item>
65+
/// <item><description>Substitution of one element for another.</description></item>
66+
/// <item><description>Transposition of two adjacent elements.</description></item> </list> This method is
67+
/// case-sensitive for sequences of strings or characters.</remarks>
68+
/// <typeparam name="T">The type of elements in the sequences. Must implement <see cref="IEquatable{T}"/>.</typeparam>
69+
/// <param name="s1">The first sequence to compare. Cannot be <see langword="null"/>.</param>
70+
/// <param name="s2">The second sequence to compare. Cannot be <see langword="null"/>.</param>
71+
/// <returns>The Damerau-Levenshtein distance between the two sequences, which represents the minimum number of operations
72+
/// (insertions, deletions, substitutions, or transpositions) required to transform one sequence into the other.
73+
/// Returns 0 if the sequences are equal.</returns>
74+
/// <exception cref="ArgumentNullException">Thrown if <paramref name="s1"/> or <paramref name="s2"/> is <see langword="null"/>.</exception>
5975
public double Distance<T>(ReadOnlySpan<T> s1, ReadOnlySpan<T> s2)
6076
where T : IEquatable<T>
6177
{

src/F23.StringSimilarity/ICharacterSubstitution.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424

2525
namespace F23.StringSimilarity
2626
{
27+
/// <summary>
2728
/// Used to indicate the cost of character substitution.
2829
///
2930
/// Cost should always be in [0.0 .. 1.0]
3031
/// For example, in an OCR application, cost('o', 'a') could be 0.4
3132
/// In a checkspelling application, cost('u', 'i') could be 0.4 because these are
3233
/// next to each other on the keyboard...
34+
/// </summary>
3335
public interface ICharacterSubstitution
3436
{
3537
/// <summary>

src/F23.StringSimilarity/Interfaces/INormalizedSpanDistance.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
namespace F23.StringSimilarity.Interfaces
22
{
3+
/// <summary>
4+
/// An interface for normalized distance measures that operate on spans.
5+
/// </summary>
36
public interface INormalizedSpanDistance : ISpanDistance
47
{
58
}

src/F23.StringSimilarity/Interfaces/INormalizedSpanSimilarity.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
namespace F23.StringSimilarity.Interfaces
22
{
3+
/// <summary>
4+
/// Defines a contract for calculating the similarity between spans of text, normalized to a range of 0 to 1.
5+
/// </summary>
6+
/// <remarks>This interface extends <see cref="ISpanSimilarity"/> by ensuring that similarity scores are
7+
/// normalized. A score of 0 indicates no similarity, while a score of 1 indicates identical spans.</remarks>
38
public interface INormalizedSpanSimilarity : ISpanSimilarity
49
{
510
}

src/F23.StringSimilarity/Interfaces/INormalizedStringDistance.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
namespace F23.StringSimilarity.Interfaces
2626
{
27+
/// <summary>
28+
/// Interface for normalized string distance algorithms.
29+
/// </summary>
2730
public interface INormalizedStringDistance : IStringDistance
2831
{
2932
}

src/F23.StringSimilarity/Interfaces/INormalizedStringSimilarity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
namespace F23.StringSimilarity.Interfaces
2626
{
27+
/// <summary>
28+
/// Interface for normalized string similarity algorithms.
29+
/// </summary>
2730
public interface INormalizedStringSimilarity : IStringSimilarity
2831
{
2932
}

src/F23.StringSimilarity/Interfaces/ISpanDistance.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace F23.StringSimilarity.Interfaces
44
{
5+
/// <summary>
6+
/// An interface for distance measures that operate on spans.
7+
/// </summary>
58
public interface ISpanDistance
69
{
710
/// <summary>

src/F23.StringSimilarity/Interfaces/ISpanSimilarity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace F23.StringSimilarity.Interfaces
44
{
5+
/// <summary>
6+
/// Interface for span similarity algorithms.
7+
/// </summary>
58
public interface ISpanSimilarity
69
{
710
/// <summary>

src/F23.StringSimilarity/Interfaces/IStringDistance.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
namespace F23.StringSimilarity.Interfaces
2626
{
27+
/// <summary>
28+
/// Interface for string distance algorithms.
29+
/// </summary>
2730
public interface IStringDistance
2831
{
2932
/// <summary>

src/F23.StringSimilarity/Interfaces/IStringSimilarity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
namespace F23.StringSimilarity.Interfaces
2626
{
27+
/// <summary>
28+
/// Interface for string similarity algorithms.
29+
/// </summary>
2730
public interface IStringSimilarity
2831
{
2932
/// <summary>

0 commit comments

Comments
 (0)