flashtext 0.1.0

Rust implementation of flashtext algorithm to search and replace keywords in given text
Documentation
  • Coverage
  • 43.75%
    7 out of 16 items documented6 out of 15 items with examples
  • Size
  • Source code size: 35.96 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.71 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • glitzflitz

flashtext

Build Status

Rust implementation of flashtext algorithm to search and replace keywords in given text

Usage

Add this to your Cargo.toml

[dependencies]
flashtext = "0.1.0"

Examples

Find keyword/sentence

use flashtext::KeywordProcessor;
let mut keywordprocessor = KeywordProcessor::new(false);
keywordprocessor.add_keyword("apple");
println!("{:?}", keywordprocessor.find_keywords("An apple fell from the tree");

Replace keyword/sentence

use flashtext::KeywordProcessor;
let mut keywordprocessor = KeywordProcessor::new(false);
keywordprocessor.add_keywords("dancing", "reading");
println!("{}", keywordprocessor.replace_keywords("She likes dancing"));

TODO

  • Add tests
  • Add Benchmarks
  • Setup CI

Note

This experimental implementation is for learning purposes. For better performance and more features you should use rust's regex engine.