Go implementation of Soft-Bisim, a character-bigram similarity for look-alike names (Millán-Hernández, García-Hernández, Ledeneva, Hernández-Castañeda, MCPR 2019). Built for Watchman token scoring.
Soft-Bisim is Kondrak BI-SIM with a softened bigram credit scale. Where BI-SIM scores a bigram pair by the fraction of positional matches (0, 0.5, or 1), Soft-Bisim distinguishes exact matches, doubled letters, transpositions, and partial overlaps.
import softbisim "github.com/PhonoGrams/soft-bisim"
softbisim.Similarity("cycloserine", "cyclosporine")
softbisim.Bisim("toradol", "tegretol") // Kondrak positional baselineScores are in [0, 1]. Identical strings score 1 under DefaultWeights (the published genetic-algorithm scale used Exact=0.8, which breaks identity; that scale is PaperWeights).
See docs/algorithm.md for the recurrence and Watchman notes.
- Millán-Hernández et al., Soft Bigram Similarity to Identify Confusable Drug Names, MCPR 2019
- Kondrak, N-Gram Similarity and Distance, SPIRE 2005
- Kondrak & Dorr, Identification of Confusable Drug Names, COLING 2004
- Sister package: soft_bigram (distance, not similarity)
Apache License 2.0