- Notifications
You must be signed in to change notification settings - Fork1
🧸 Tiny optimal string alignment distance library
License
NotificationsYou must be signed in to change notification settings
Philippus/osita
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Osita is an implementation of theOptimal String Alignment distancealgorithm. It implements the standard version of the algorithm and an extension of it where the substitution cost hasbeen replaced by a function which calculates the keyboard distance between characters using the Euclidean distancebetween keys on a QWERTY or AZERTY-keyboard.You can also supply your own substitution cost function.
Osita is published for Scala 2.12, 2.13 and 3. To start using it add the following to yourbuild.sbt
:
libraryDependencies += "nl.gn0s1s" %% "osita" % "0.1.0"
importnl.gn0s1s.osita.Osita._osa("abcde","abcde")// val res0: Double = 0.0osa("abcde","abcd")// val res1: Double = 1.0osaWithSubstitutionCost("abc","agc")(qwertySubstitutionCost)// val res2: Double = 1.118033988749895
- Optimal String Alignment distance
- Euclidean Distance
- Distances between keys on a QWERTY keyboard on Code Golf -https://codegolf.stackexchange.com/questions/233618/distances-between-keys-on-a-qwerty-keyboard
- Keyboard distance in Perl -https://metacpan.org/release/KRBURTON/String-KeyboardDistance-1.01/source/README
The code is available under theMozilla Public License, version 2.0.
About
🧸 Tiny optimal string alignment distance library
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published