https://github.com/wowinter13/fast_fuzzy_matcher
A tiny and blazing-fast fuzzy search in Ruby with FFI bindings to Go.
https://github.com/wowinter13/fast_fuzzy_matcher
ffi ffi-bindings fuzzy-matching fuzzy-search golang ruby
Last synced: about 1 month ago
JSON representation
A tiny and blazing-fast fuzzy search in Ruby with FFI bindings to Go.
- Host: GitHub
- URL: https://github.com/wowinter13/fast_fuzzy_matcher
- Owner: wowinter13
- License: mit
- Created: 2023-10-15T23:19:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-07T01:11:12.000Z (over 1 year ago)
- Last Synced: 2025-03-20T02:41:02.340Z (2 months ago)
- Topics: ffi, ffi-bindings, fuzzy-matching, fuzzy-search, golang, ruby
- Language: Go
- Homepage:
- Size: 958 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# FuzzyMatch
This library is a work in progress.
The fastest Fuzzy Matcher in the wild west. FFI-based.
Find a needle in a haystack based on string similarity and regular expression rules.
### Basic usage
Just pass an array of strings to the matcher and it will return the best match(es) for the given needle.
```ruby
require 'fast_fuzzy_matcher'FuzzyMatcher.find("whl", ["cartwheel", "foobar", "wheel", "baz"])
=> ["cartwheel", "wheel"]```
### Advanced usage
Better documentation is coming soon. For now, please refer to the specs.
# Benchmarks
To be done.
Approximately 10-60x faster than the fastest Ruby implementation. The difference is more pronounced for longer strings and larger dictionaries.
## Documentation
Detailed documentation is available at [rubydoc](https://rubydoc.info/gems/fast_fuzzy_matcher).
## Installation
fast_fuzzy_matcher is available as a gem, to install it just install the gem:
gem install fast_fuzzy_matcher
If you're using Bundler, add the gem to Gemfile.
gem 'fast_fuzzy_matcher'
Run `bundle install`.
## Running tests
bundle exec rspec spec/
## Contributing
1. Fork it ( https://github.com/wowinter13/fast_fuzzy_matcher/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## License
MIT License. See LICENSE for details.