flashtext

Crates.ioflashtext
lib.rsflashtext
version0.1.0
sourcesrc
created_at2020-04-06 18:29:48.289474
updated_at2020-04-06 18:29:48.289474
descriptionRust implementation of flashtext algorithm to search and replace keywords in given text
homepage
repository
max_upload_size
id227025
size19,939
Amey Narkhede (glitzflitz)

documentation

README

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.

Commit count: 0

cargo fmt