Fix fuzzy examples

This commit is contained in:
Adriane Boyd 2023-01-17 17:59:45 +01:00
parent c17ccd73e4
commit abadccdfb5

View File

@ -72,17 +72,17 @@ distance of 2 and up to 30% of the pattern string length. `FUZZY1`..`FUZZY9` can
be used to specify the exact number of allowed edits.
```python
# Match lowercase with fuzzy matching (allows up to 2 edits)
# Match lowercase with fuzzy matching (allows up to 3 edits)
pattern = [{"LOWER": {"FUZZY": "definitely"}}]
# Match custom attribute values with fuzzy matching (allows up to 2 edits)
# Match custom attribute values with fuzzy matching (allows up to 3 edits)
pattern = [{"_": {"country": {"FUZZY": "Kyrgyzstan"}}}]
# Match with exact Levenshtein edit distance limits (allows up to 3 edits)
pattern = [{"_": {"country": {"FUZZY3": "Kyrgyzstan"}}}]
# Match with exact Levenshtein edit distance limits (allows up to 4 edits)
pattern = [{"_": {"country": {"FUZZY4": "Kyrgyzstan"}}}]
```
Note that `FUZZY` is using Levenshtein edit distance rather than
Note that `FUZZY` uses Levenshtein edit distance rather than
Damerau-Levenshtein edit distance, so a transposition like `teh` for `the`
counts as two edits, one insertion and one deletion.