token

Crates.iotoken
lib.rstoken
version1.0.0-rc1
sourcesrc
created_at2015-02-21 23:25:36.390756
updated_at2015-12-11 23:59:11.698689
descriptionA simple string-tokenizer (and sentence splitter) Note: If you find that you would like to use the name for something more appropriate, please just send me a mail at jaln at itu dot dk
homepage
repositoryhttps://github.com/Machtan/token-rs
max_upload_size
id1446
size12,553
Naja Lautrup Nysom (Machtan)

documentation

https://machtan.github.io/token-rs/token

README

Token

Build status (master)

This is a small package containing a simple string-tokenizer for the rust programming language. The package also contains a simple sentence-splitting iterator.

(The sentence splitter might be moved, once I find out where I want it).

Documentation

machtan.github.io/token-rs/token

Building

Add the following to your Cargo.toml file

[dependencies.token] git = "https://github.com/machtan/token-rs"

Examples

extern crate token;

let separators = vec![' ', '\n', '\t', '\r'];
let source: &str = "    Hello world \n  How do you do\t-Finely I hope";

let mut tokenizer = tokenizer::Tokenizer::new(source.as_bytes(), separators);
println!("Tokenizing...");
for token in tokenizer {
    println!("- Got token: {}", token.unwrap());
}
println!("Done!");

License

MIT (do what you want with it)

Commit count: 0

cargo fmt