| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace Salient\Contract; |
| 4: | |
| 5: | /** |
| 6: | * @api |
| 7: | */ |
| 8: | interface HasTextComparisonFlag |
| 9: | { |
| 10: | /** |
| 11: | * Uncertainty is 0 if values are identical, otherwise 1 |
| 12: | */ |
| 13: | public const ALGORITHM_SAME = 1; |
| 14: | |
| 15: | /** |
| 16: | * Uncertainty is 0 if the longer value contains the shorter value, |
| 17: | * otherwise 1 |
| 18: | */ |
| 19: | public const ALGORITHM_CONTAINS = 2; |
| 20: | |
| 21: | /** |
| 22: | * Uncertainty is derived from levenshtein() |
| 23: | * |
| 24: | * String length cannot exceed 255 characters. |
| 25: | */ |
| 26: | public const ALGORITHM_LEVENSHTEIN = 4; |
| 27: | |
| 28: | /** |
| 29: | * Uncertainty is derived from similar_text() |
| 30: | */ |
| 31: | public const ALGORITHM_SIMILAR_TEXT = 8; |
| 32: | |
| 33: | /** |
| 34: | * Uncertainty is derived from shared ngrams relative to the longest string |
| 35: | */ |
| 36: | public const ALGORITHM_NGRAM_SIMILARITY = 16; |
| 37: | |
| 38: | /** |
| 39: | * Uncertainty is derived from shared ngrams relative to the shortest string |
| 40: | */ |
| 41: | public const ALGORITHM_NGRAM_INTERSECTION = 32; |
| 42: | |
| 43: | /** |
| 44: | * Values are normalised before comparison |
| 45: | */ |
| 46: | public const NORMALISE = 64; |
| 47: | } |
| 48: |