# `Nous.Eval.Evaluators.FuzzyMatch`
[🔗](https://github.com/nyo16/nous/blob/v0.17.1/lib/nous/eval/evaluators/fuzzy_match.ex#L1)

Evaluator that uses string similarity for matching.

Uses Levenshtein distance to calculate similarity between strings.

## Configuration

  * `:threshold` - Minimum similarity (0.0 to 1.0, default: 0.8)
  * `:normalize` - Normalize strings before comparison (default: true)
  * `:case_insensitive` - Ignore case (default: true)

## Examples

    TestCase.new(
      id: "fuzzy",
      input: "What is the capital of France?",
      expected: "Paris is the capital of France",
      eval_type: :fuzzy_match,
      eval_config: %{threshold: 0.7}
    )

# `calculate_similarity`

```elixir
@spec calculate_similarity(String.t(), String.t()) :: float()
```

Calculate similarity between two strings using Levenshtein distance.

Returns a value between 0.0 (completely different) and 1.0 (identical).

# `levenshtein_distance`

```elixir
@spec levenshtein_distance(String.t(), String.t()) :: non_neg_integer()
```

Calculate the Levenshtein distance between two strings.

Distance is counted in graphemes, not bytes, so a multi-byte character or a
combining sequence costs a single edit.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
