MCPcopy Create free account
hub / github.com/BaseXdb/basex / similarEntity

Method similarEntity

basex-core/src/main/java/org/basex/util/XMLToken.java:458–463  ·  view source on GitHub ↗

Returns the most similar entity. @param key key @return most similar entity or null

(final byte[] key)

Source from the content-addressed store, hash-verified

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.

Callers 1

itemMethod · 0.95

Calls 5

entitiesMethod · 0.95
addMethod · 0.95
similarMethod · 0.95
sizeMethod · 0.65
finishMethod · 0.45

Tested by

no test coverage detected