Returns the most similar entity. @param key key @return most similar entity or null
(final byte[] key)
| 456 | * @return most similar entity or {@code null} |
| 457 | */ |
| 458 | public static byte[] similarEntity(final byte[] key) { |
| 459 | final TokenObjectMap<byte[]> map = entities(); |
| 460 | final TokenList list = new TokenList(map.size()); |
| 461 | for(final byte[] entity : map) list.add(entity); |
| 462 | return Levenshtein.similar(key, list.finish()); |
| 463 | } |
| 464 | |
| 465 | /** |
| 466 | * Returns the initialized entity map. |