mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-04 04:10:20 +03:00
Fix fuzzy examples
This commit is contained in:
parent
c17ccd73e4
commit
abadccdfb5
|
@ -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.
|
be used to specify the exact number of allowed edits.
|
||||||
|
|
||||||
```python
|
```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"}}]
|
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"}}}]
|
pattern = [{"_": {"country": {"FUZZY": "Kyrgyzstan"}}}]
|
||||||
|
|
||||||
# Match with exact Levenshtein edit distance limits (allows up to 3 edits)
|
# Match with exact Levenshtein edit distance limits (allows up to 4 edits)
|
||||||
pattern = [{"_": {"country": {"FUZZY3": "Kyrgyzstan"}}}]
|
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`
|
Damerau-Levenshtein edit distance, so a transposition like `teh` for `the`
|
||||||
counts as two edits, one insertion and one deletion.
|
counts as two edits, one insertion and one deletion.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user