Struct imdb_index::IndexBuilder [−][src]
pub struct IndexBuilder { /* fields omitted */ }
A builder for opening or creating an Index
.
Methods
impl IndexBuilder
[src]
impl IndexBuilder
pub fn new() -> IndexBuilder
[src]
pub fn new() -> IndexBuilder
Create a new builder with a default configuration.
pub fn open<P1: AsRef<Path>, P2: AsRef<Path>>(
&self,
data_dir: P1,
index_dir: P2
) -> Result<Index>
[src]
pub fn open<P1: AsRef<Path>, P2: AsRef<Path>>(
&self,
data_dir: P1,
index_dir: P2
) -> Result<Index>
Use the current configuration to open an existing index. If the index does not exist, or if there was a problem opening it, then this returns an error.
Generally, this method is cheap to call. It opens some file descriptors, but otherwise does no work.
data_dir
should be the directory containing decompressed IMDb tsvfiles. See: https://www.imdb.com/interfaces/
index_dir
should be the directory containing a previously created
index using Index::create
.
Note that settings for index creation are ignored.
pub fn create<P1: AsRef<Path>, P2: AsRef<Path>>(
&self,
data_dir: P1,
index_dir: P2
) -> Result<Index>
[src]
pub fn create<P1: AsRef<Path>, P2: AsRef<Path>>(
&self,
data_dir: P1,
index_dir: P2
) -> Result<Index>
Use the current configuration to create a new index.
Calling this method is expensive, and one should expect this to take dozens of seconds or more to complete.
data_dir
should be the directory containing decompressed IMDb tsvfiles. See: https://www.imdb.com/interfaces/
index_dir
should be the directory containing a previously created
index using Index::create
.
This will overwrite any previous index that may have existed in
index_dir
.
pub fn ngram_type(&mut self, ngram_type: NgramType) -> &mut IndexBuilder
[src]
pub fn ngram_type(&mut self, ngram_type: NgramType) -> &mut IndexBuilder
Set the type of ngram generation to use.
The default type is Window
.
pub fn ngram_size(&mut self, ngram_size: usize) -> &mut IndexBuilder
[src]
pub fn ngram_size(&mut self, ngram_size: usize) -> &mut IndexBuilder
Set the ngram size on this index.
When creating an index, ngrams with this size will be used.
Trait Implementations
impl Debug for IndexBuilder
[src]
impl Debug for IndexBuilder
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for IndexBuilder
[src]
impl Default for IndexBuilder
fn default() -> IndexBuilder
[src]
fn default() -> IndexBuilder
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for IndexBuilder
impl Send for IndexBuilder
impl Sync for IndexBuilder
impl Sync for IndexBuilder