Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/federicotdn/match2000
Fuzzy text matching in Go, based on go-diff
https://github.com/federicotdn/match2000
bitap diff fuzzy go match search string text
Last synced: about 2 months ago
JSON representation
Fuzzy text matching in Go, based on go-diff
- Host: GitHub
- URL: https://github.com/federicotdn/match2000
- Owner: federicotdn
- License: mit
- Created: 2024-07-20T23:13:15.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-20T23:15:27.000Z (6 months ago)
- Last Synced: 2024-10-12T23:13:15.291Z (3 months ago)
- Topics: bitap, diff, fuzzy, go, match, search, string, text
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# match2000
match2000 is a library for performing fuzzy text search in Go. It is a modified version of a subset of the [go-diff](https://github.com/sergi/go-diff) library.The main modification made was that the `pattern` argument can now have any length. Previously having too long of a pattern would cause an overflow due to the code attempting to left-shift an `int` more than 32 times. The match2000 implementation uses the `Int` type from `math/big`, gaining flexibility but with a performance penalty.
Other smaller modifications applied were:
- Removed assumptions about strings being UTF-8 encoded.
- Changed all usages of `math.Min` and `math.Max` to `min` and `max`.
- Removed all unnecessary `int` -> `float64` -> `int` conversions (after above change was applied).
- Removed dependency on `github.com/stretchr/testify/assert` package.
- Changed `DiffMatchPatch` struct name to just `Match`.
- Unexported `MatchAlphabet`.
- Simplified code slightly where possible.
- Adapted tests to changes described above, plus added more test cases.## License
Same license as the original go-diff library.