apoc.text.levenshteinSimilarity

Function APOC Core

apoc.text.levenshteinSimilarity(text1, text2) - calculate the similarity (a value within 0 and 1) between two texts.

Signature

apoc.text.levenshteinSimilarity(text1 :: STRING?, text2 :: STRING?) :: (FLOAT?)

Input parameters

Name Type Default

text1

STRING?

null

text2

STRING?

null

Usage Examples

RETURN apoc.text.levenshteinSimilarity("Neo4j", "Neo4j") AS output;
Table 1. Results
output

1.0

RETURN apoc.text.levenshteinSimilarity("Neo4j", "Neoj4") AS output;
Table 2. Results
output

0.6

RETURN apoc.text.levenshteinSimilarity("Neo4j Aura", "Neo4j Graph Database") AS output;
Table 3. Results
output

0.35