MCPcopy Index your code
hub / github.com/clips/pattern / bigrams

Function bigrams

pattern/metrics.py:280–281  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

278 based on the number of shared bigrams, e.g., "night" and "nacht" have one common bigram "ht".
279 """
280 def bigrams(s):
281 return set(s[i:i+2] for i in range(len(s)-1))
282 nx = bigrams(string1)
283 ny = bigrams(string2)
284 nt = nx.intersection(ny)

Callers 1

dice_coefficientFunction · 0.85

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…