fiveo 0.3.2

An approximate string matching library built with the web in mind
Documentation
  • Coverage
  • 84.21%
    16 out of 19 items documented1 out of 8 items with examples
  • Size
  • Source code size: 321.48 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.3 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • garyttierney

fiveo

LICENSE Build Status Crates.io Version

fiveo is a fuzzy text searching library built for use on the web. The API is designed with usage from a C-like foreign function interface in mind so it can be easily embedded in WebAssembly objects.

Example

extern crate fiveo;

use fiveo::Matcher;
use fiveo::MatcherParameters;

fn main() {
    // Create a new matcher with a single entry.
    let searcher = fiveo::Matcher::new("/this/is/a/test/dir\n", MatcherParameters::default()).unwrap();
    // Search for "tiatd" and return a maximum of 10 results.
    let matches = searcher.search("tiatd", 10);

    assert_eq!(0, matches[0].index());
    assert_eq!(1.0f32, matches[0].score());
}

Documentation

Installation

fiveo can be installed using Cargo via the crate available on crates.io

[dependencies]
five = "0.3.2"

By default fiveo will be built and linked against the Rust standard library. For usage in WebAssembly builds there is a compilation feature available to switch to dependencies on liballoc and libcore.

You can activate those features like this:

[dependencies.fiveo]
version = "0.3.2"
features = ["webassembly"]

Credits

fiveo is inspired by the Sublime fuzzy text matcher and @hansonw's port of Cmd-T's algorithm