Struct vibrato::dictionary::builder::SystemDictionaryBuilder
source · pub struct SystemDictionaryBuilder {}
Expand description
Builder for Dictionary
from system lexicon entries.
Implementations§
source§impl SystemDictionaryBuilder
impl SystemDictionaryBuilder
sourcepub fn from_readers<S, C, P, U>(
system_lexicon_rdr: S,
connector_rdr: C,
char_prop_rdr: P,
unk_handler_rdr: U
) -> Result<Dictionary>where
S: Read,
C: Read,
P: Read,
U: Read,
pub fn from_readers<S, C, P, U>( system_lexicon_rdr: S, connector_rdr: C, char_prop_rdr: P, unk_handler_rdr: U ) -> Result<Dictionary>where S: Read, C: Read, P: Read, U: Read,
Creates a new Dictionary
from readers of system entries in the MeCab format.
Consider to use from_readers_with_bigram_info()
if you want to store a dictionary with smaller memory.
Arguments
system_lexicon_rdr
: A reader of a lexicon file*.csv
.connector_rdr
: A reader of matrix filematrix.def
.char_prop_rdr
: A reader of character definition filechar.def
.unk_handler
: A reader of unknown definition fileunk.def
.
Errors
VibratoError
is returned when an input format is invalid.
sourcepub fn from_readers_with_bigram_info<S, R, L, C, P, U>(
system_lexicon_rdr: S,
bigram_right_rdr: R,
bigram_left_rdr: L,
bigram_cost_rdr: C,
char_prop_rdr: P,
unk_handler_rdr: U,
dual_connector: bool
) -> Result<Dictionary>where
S: Read,
R: Read,
L: Read,
C: Read,
P: Read,
U: Read,
pub fn from_readers_with_bigram_info<S, R, L, C, P, U>( system_lexicon_rdr: S, bigram_right_rdr: R, bigram_left_rdr: L, bigram_cost_rdr: C, char_prop_rdr: P, unk_handler_rdr: U, dual_connector: bool ) -> Result<Dictionary>where S: Read, R: Read, L: Read, C: Read, P: Read, U: Read,
Creates a new memory-efficient Dictionary
from readers of system entries.
This function implements a matrix of connection costs in a compact format.
Compared to a dictionary generated by from_readers()
,
one generated by this function can save memory consumption,
although analysis speed can be slower.
Arguments
system_lexicon_rdr
: A reader of a lexicon file*.csv
.bigram_right_rdr
: A reader of bi-gram info associated with right IDsbigram.right
.bigram_left_rdr
: A reader of bi-gram info associated with left IDsbigram.left
.bigram_cost_rdr
: A reader of a bi-gram cost filebigram.cost
.char_prop_rdr
: A reader of character definition filechar.def
.unk_handler
: A reader of unknown definition fileunk.def
.dual_connector
: Iftrue
, the dictionary controls speed reduction.
Errors
VibratoError
is returned when an input format is invalid.
Auto Trait Implementations§
impl RefUnwindSafe for SystemDictionaryBuilder
impl Send for SystemDictionaryBuilder
impl Sync for SystemDictionaryBuilder
impl Unpin for SystemDictionaryBuilder
impl UnwindSafe for SystemDictionaryBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more