rite: be equal, similar (to something else).
He rite te tikanga o tēnei ki tō runga ake nei. / The meaning of this is similar to that of the above.
A string similarity library. It finds degree of similarity between strings, based on Dice’s Coefficient, which is mostly better than Levenshtein distance.
This is a clojurescript port of the javascript string-similarity library. It was built for a few reasons:
- Learning.
- We use string-similarity within BeeCastle and had an issue with older versions of Internet Explorer, and wanted something that would work in that environment.
- It was also an exercise in converting a very imperative, mutable state driven algorithm to a functional, immutable one.
Require the namespace
(ns example.core
(:require [rite.core :as rite]))
Get best match to a given string from a set of other strings
(-> (rite.find-best-match "healed" ["mailed" "edward" "sealed" "theatre"])
:best-match
:target) ;; => "sealed"
var rite = require('./build/rite');
rite.findBestMatch('healed', ['mailed', 'edward', 'sealed', 'theatre']).bestMatch.target; // 'sealed'