From 2978c44acce82450fa9ad06751d9c418362ea894 Mon Sep 17 00:00:00 2001 From: kud1ing Date: Wed, 28 Dec 2016 17:32:40 +0100 Subject: [PATCH] add section 'Text search' --- README.md | 8 ++++++++ src/main.rs | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3cf41a4..d09e046 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ If you want to contribute, please read [this](CONTRIBUTING.md). - [Platform specific](#platform-specific) - [Template engine](#template-engine) - [Text processing](#text-processing) + - [Text search](#text-search) - [Virtualization](#virtualization) - [Web programming](#web-programming) - [Resources](#resources) @@ -748,6 +749,13 @@ See also [About Rust’s Machine Learning Community](https://medium.com/@autumn_ * [rust-lang-nursery/regex](https://github.com/rust-lang-nursery/regex) — Regular expressions (RE2 style) [](https://travis-ci.org/rust-lang-nursery/regex) +## Text search + +* [BurntSushi/fst](https://github.com/BurntSushi/fst) [[fst](https://crates.io/crates/fst)] — [](https://travis-ci.org/BurntSushi/fst) +* [JDemler/perlin](https://github.com/JDemler/perlin) [[perlin](https://crates.io/crates/perlin)] — [](https://travis-ci.org/JDemler/perlin) +* [tantivy-search/tantivy](https://github.com/tantivy-search/tantivy) [[tantivy](https://crates.io/crates/tantivy)] — [](https://travis-ci.org/tantivy-search/tantivy) + + ### Virtualization * [beneills/quantum](https://github.com/beneills/quantum) — Advanced Rust quantum computer simulator [](https://travis-ci.org/beneills/quantum) diff --git a/src/main.rs b/src/main.rs index eaccd55..fbb9af4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -101,7 +101,7 @@ fn parse_header(parser: &mut Parser, content: &mut ReadmeFileContent) -> ReadmeF fn parse_toc(parser: &mut Parser, content: &mut ReadmeFileContent) -> ReadmeFileParsingState { - // TODO + // TODO: Skip the table of content. println!("TODO: `parse_toc()`"); ReadmeFileParsingState::Content @@ -127,6 +127,7 @@ fn parse_footer<'a>(parser: &mut Parser<'a>, content: &mut ReadmeFileContent<'a> fn main() { + // The path to the README.md file. let readme_file_path = Path::new("README.md"); let display = readme_file_path.display(); @@ -137,14 +138,14 @@ fn main() { Ok(file) => file, }; + // Try to read the README.md file in a string. let mut markdown_string = String::new(); - // Try to read the README.md file in a string. if let Err(why) = file.read_to_string(&mut markdown_string) { panic!("couldn't read {}: {}", display, why.description()); } - // Try to parse the Markdown content string. + // Try to parse the README.md content string. let readme_file_content = parse(&markdown_string); println!("{:?}", readme_file_content);