mirror of
https://github.com/rust-unofficial/awesome-rust.git
synced 2024-11-27 11:44:52 -05:00
add section 'Text search'
This commit is contained in:
parent
bfd3ca9ca4
commit
2978c44acc
2 changed files with 12 additions and 3 deletions
|
@ -50,6 +50,7 @@ If you want to contribute, please read [this](CONTRIBUTING.md).
|
||||||
- [Platform specific](#platform-specific)
|
- [Platform specific](#platform-specific)
|
||||||
- [Template engine](#template-engine)
|
- [Template engine](#template-engine)
|
||||||
- [Text processing](#text-processing)
|
- [Text processing](#text-processing)
|
||||||
|
- [Text search](#text-search)
|
||||||
- [Virtualization](#virtualization)
|
- [Virtualization](#virtualization)
|
||||||
- [Web programming](#web-programming)
|
- [Web programming](#web-programming)
|
||||||
- [Resources](#resources)
|
- [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) [<img src="https://travis-ci.org/rust-lang-nursery/regex.svg?branch=master">](https://travis-ci.org/rust-lang-nursery/regex)
|
* [rust-lang-nursery/regex](https://github.com/rust-lang-nursery/regex) — Regular expressions (RE2 style) [<img src="https://travis-ci.org/rust-lang-nursery/regex.svg?branch=master">](https://travis-ci.org/rust-lang-nursery/regex)
|
||||||
|
|
||||||
|
|
||||||
|
## Text search
|
||||||
|
|
||||||
|
* [BurntSushi/fst](https://github.com/BurntSushi/fst) [[fst](https://crates.io/crates/fst)] — [<img src="https://travis-ci.org/BurntSushi/fst.svg?branch=master">](https://travis-ci.org/BurntSushi/fst)
|
||||||
|
* [JDemler/perlin](https://github.com/JDemler/perlin) [[perlin](https://crates.io/crates/perlin)] — [<img src="https://travis-ci.org/JDemler/perlin.svg?branch=master">](https://travis-ci.org/JDemler/perlin)
|
||||||
|
* [tantivy-search/tantivy](https://github.com/tantivy-search/tantivy) [[tantivy](https://crates.io/crates/tantivy)] — [<img src="https://travis-ci.org/tantivy-search/tantivy.svg?branch=master">](https://travis-ci.org/tantivy-search/tantivy)
|
||||||
|
|
||||||
|
|
||||||
### Virtualization
|
### Virtualization
|
||||||
|
|
||||||
* [beneills/quantum](https://github.com/beneills/quantum) — Advanced Rust quantum computer simulator [<img src="https://travis-ci.org/beneills/quantum.svg?branch=master">](https://travis-ci.org/beneills/quantum)
|
* [beneills/quantum](https://github.com/beneills/quantum) — Advanced Rust quantum computer simulator [<img src="https://travis-ci.org/beneills/quantum.svg?branch=master">](https://travis-ci.org/beneills/quantum)
|
||||||
|
|
|
@ -101,7 +101,7 @@ fn parse_header(parser: &mut Parser, content: &mut ReadmeFileContent) -> ReadmeF
|
||||||
|
|
||||||
fn parse_toc(parser: &mut Parser, content: &mut ReadmeFileContent) -> ReadmeFileParsingState {
|
fn parse_toc(parser: &mut Parser, content: &mut ReadmeFileContent) -> ReadmeFileParsingState {
|
||||||
|
|
||||||
// TODO
|
// TODO: Skip the table of content.
|
||||||
println!("TODO: `parse_toc()`");
|
println!("TODO: `parse_toc()`");
|
||||||
|
|
||||||
ReadmeFileParsingState::Content
|
ReadmeFileParsingState::Content
|
||||||
|
@ -127,6 +127,7 @@ fn parse_footer<'a>(parser: &mut Parser<'a>, content: &mut ReadmeFileContent<'a>
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// The path to the README.md file.
|
||||||
let readme_file_path = Path::new("README.md");
|
let readme_file_path = Path::new("README.md");
|
||||||
|
|
||||||
let display = readme_file_path.display();
|
let display = readme_file_path.display();
|
||||||
|
@ -137,14 +138,14 @@ fn main() {
|
||||||
Ok(file) => file,
|
Ok(file) => file,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Try to read the README.md file in a string.
|
||||||
let mut markdown_string = String::new();
|
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) {
|
if let Err(why) = file.read_to_string(&mut markdown_string) {
|
||||||
panic!("couldn't read {}: {}", display, why.description());
|
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);
|
let readme_file_content = parse(&markdown_string);
|
||||||
|
|
||||||
println!("{:?}", readme_file_content);
|
println!("{:?}", readme_file_content);
|
||||||
|
|
Loading…
Reference in a new issue