tantivy_fst/lib.rs
1// Copyright 2015 2016 2017 2018 Andrew Gallant
2// Copyright 2019 Paul Masurel
3//
4//! This is a fork over Andrew Gallant `fst` crate.
5//! Parts of this crate were retrofitted from a PR by Clément Renault
6//! https://github.com/BurntSushi/fst/pull/61
7#![warn(missing_docs)]
8#![allow(clippy::new_without_default)]
9#![allow(clippy::should_implement_trait)]
10
11pub use crate::automaton::Automaton;
12pub use crate::error::{Error, Result};
13pub use crate::map::{Chain, Map, MapBuilder};
14pub use crate::stream::{IntoStreamer, Streamer};
15
16#[cfg(feature = "regex")]
17mod regex;
18
19#[cfg(feature = "regex")]
20pub use self::regex::Regex;
21
22mod error;
23#[path = "automaton/mod.rs"]
24mod inner_automaton;
25#[path = "map.rs"]
26mod inner_map;
27pub mod raw;
28mod stream;
29
30/// Automaton implementations for finite state transducers.
31///
32/// This module defines a trait, `Automaton`, with several implementations
33/// including, but not limited to, union, intersection and complement.
34pub mod automaton {
35 pub use crate::inner_automaton::*;
36}
37
38/// Map operations implemented by finite state transducers.
39///
40/// This API provided by this sub-module is close in spirit to the API
41/// provided by
42/// [`std::collections::BTreeMap`](http://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html).
43///
44/// # Overview of types
45///
46/// `Map` is a read only interface to pre-constructed sets. `MapBuilder` is
47/// used to create new sets. (Once a set is created, it can never be modified.)
48/// `Stream`, `Keys` and `Values` are streams that originated from a map.
49/// `StreamBuilder` builds range queries. `OpBuilder` collects a set of streams
50/// and executes set operations like `union` or `intersection` on them with the
51/// option of specifying a merge strategy for a map's values. The rest of the
52/// types are streams for set operations.
53pub mod map {
54 pub use crate::inner_map::*;
55}