GithubHelp home page GithubHelp logo

agext / levenshtein Goto Github PK

View Code? Open in Web Editor NEW
87.0 2.0 6.0 24 KB

Levenshtein distance and similarity metrics with customizable edit costs and Winkler-like bonus for common prefix.

License: Apache License 2.0

Go 99.28% Shell 0.72%
levenshtein levenshtein-distance similarity-metric common-prefix-bonus winkler string-pairs string-distance string-similarity edit-costs awesome-go

levenshtein's People

Contributors

alex-alrux avatar radeksimko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

levenshtein's Issues

Getting a 500 error when trying to pull this dep

OI have the following in my Gopkg.lock file:

[[projects]]
  name = "github.com/agext/levenshtein"
  packages = ["."]
  revision = "5f10fee965225ac1eecdc234c09daf5cd9e7f7b6"
  version = "v1.2.1"

Output from running dep ensure.

Solving failure: no valid source could be created: 
        failed to set up sources from the following URLs:
https://github.com/agext/levenshtein
: remote repository at https://github.com/agext/levenshtein does not exist, or is inaccessible: remote: Internal Server Error.
remote: 
fatal: unable to access 'https://github.com/agext/levenshtein/': The requested URL returned error: 500
: exit status 128
        failed to set up sources from the following URLs:
ssh://[email protected]/agext/levenshtein
: remote repository at ssh://[email protected]/agext/levenshtein does not exist, or is inaccessible: ERROR: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
: exit status 128
        failed to set up sources from the following URLs:
git://github.com/agext/levenshtein
: remote repository at git://github.com/agext/levenshtein does not exist, or is inaccessible: fatal: remote error: 
  
: exit status 128
        failed to set up sources from the following URLs:
http://github.com/agext/levenshtein
: remote repository at http://github.com/agext/levenshtein does not exist, or is inaccessible: remote: Internal Server Error.
remote: 
fatal: unable to access 'http://github.com/agext/levenshtein/': The requested URL returned error: 500
: exit status 128

panic: runtime error: index out of range

Hello,

please excuse if this is not an issue with your code but as a beginner in Golang it seems to me like it could be.

Here is the sample code I run:

package main

import "fmt"
import "github.com/davecgh/go-spew/spew"
import "github.com/agext/levenshtein"

func main () {
	var myparams = levenshtein.NewParams()
	myparams.MinScore(0.92)
	spew.Dump(myparams)

	fmt.Println(levenshtein.Match(`foo`, `foo`, myparams))
	fmt.Println(levenshtein.Match(`foo`, `bar`, myparams))
	fmt.Println(levenshtein.Match(`NetworkManager-glib-0.8.1-5.el6_0.1.i686.rpm`, `gdm-plugin-fingerprint-2.30.4-39.el6.i686.rpm`, myparams))
}

It produces the following output:

(*levenshtein.Params)(0xc000094100)({
 insCost: (int) 1,
 subCost: (int) 1,
 delCost: (int) 1,
 maxCost: (int) 0,
 minScore: (float64) 0.92,
 bonusPrefix: (int) 4,
 bonusScale: (float64) 0.1,
 bonusThreshold: (float64) 0.7
})
1
0
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/agext/levenshtein.Calculate(0xc0000ca000, 0x24, 0x2c, 0xc0000cc000, 0x23, 0x30, 0x5, 0x1, 0x1, 0x1, ...)
	/Users/smeier/go/src/github.com/agext/levenshtein/levenshtein.go:112 +0x8ba
github.com/agext/levenshtein.Match(0x11036f6, 0x2c, 0x11037ff, 0x2d, 0xc000094100, 0x2)
	/Users/smeier/go/src/github.com/agext/levenshtein/levenshtein.go:272 +0x1a8
main.main()
	/Users/smeier/Documents/grabbag/levenshtein_bug.go:14 +0x271
exit status 2

I am running go version go1.12.5 darwin/amd64.

Any help or comments are appreciated.

Getting the issue 422 while pulling github.com/mattn/goveralls

package levenshtein failing as bwlow when it tried to access github.com/mattn/goveralls
https://travis-ci.com/github/asellappen/levenshtein/jobs/398770419

Testing with goveralls...
go: downloading github.com/mattn/goveralls v0.0.7
go: github.com/mattn/goveralls upgrade => v0.0.7
go: downloading golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375
Bad response status from coveralls: 422
{"message":"Couldn't find a repository matching this job.","error":true}
The command "./test.sh $TEST_METHOD" exited with 1.

have tried with adding COVERALLS_TOKEN in travis.yml as below and still its failing ,
travis encrypt COVERALLS_TOKEN=your_token_goes_here --add env.global
env:
global:
secure: 0wWHj9zvAqpjPMxngeVm6+WwjynAAfOwoGy1yBnwiH7rsOskuWbf7aaaOhVC65fH+wiRbmBIpGMlVXv5wrKGrK7EXxMcoXBtie0MoK2UCWRwJcYG3+e4bZ9wLe+3eBRGK/EbT8GawHrJaZxPvhg......................................

Please help to check and provide a fix for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.