masatana / go-textdistance Goto Github PK
View Code? Open in Web Editor NEWCalculate text distance (similarity) in Golang - Experimental implementation
License: MIT License
Calculate text distance (similarity) in Golang - Experimental implementation
License: MIT License
As of right now, some tests use naive implementation to compare float value.
We could use nicer comparing library.
var longer []rune
var shorter []rune
if len(s1) > len(s2) {
longer = []rune(s1)
shorter = []rune(s2)
} else {
longer = []rune(s2)
shorter = []rune(s1)
}
This does not work well when s1 or s2 contains non unicode rune.
For instance, let s1 = "helloworld" and s2 = "helloζηδΈη", and length of s1 and s2 would be 10 and 13. Then s2 is the longer one according to current code.
But s1 should be the longer one since we calculate JaroDistance by rune.
I got this message when trying to build the addic7ed project that is using your plugin.
Also used on MacOS, and working well.
pi@raspberrypi:~/go/src/github.com/addic7ed $ go build
# github.com/masatana/go-textdistance
../../../pkg/mod/github.com/masatana/[email protected]/util.go:7:12: constant 9223372036854775807 overflows int
I believe the two strings "CA" and "ABC" technically only require two changes under Damerau-Levenshtein distance: Transposition + Insertion.
CA -> AC -> ABC
This library returns "3" as the number of changes. Is this correct?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.