pub struct DictBuilder<D> { /* private fields */ }
Expand description
Builds a binary dictionary from csv lexicon and connection matrix (optional)
Implementations§
source§impl DictBuilder<NoDic>
impl DictBuilder<NoDic>
sourcepub fn new_system() -> Self
pub fn new_system() -> Self
Creates a new builder for system dictionary
source§impl<D: DictionaryAccess> DictBuilder<D>
impl<D: DictionaryAccess> DictBuilder<D>
sourcepub fn set_compile_time<T: Into<SystemTime>>(&mut self, time: T) -> SystemTime
pub fn set_compile_time<T: Into<SystemTime>>(&mut self, time: T) -> SystemTime
Set the dictionary compile time to the specified time instead of current time
sourcepub fn set_description<T: Into<String>>(&mut self, description: T)
pub fn set_description<T: Into<String>>(&mut self, description: T)
Set the dictionary description
sourcepub fn read_lexicon<'a, T: AsDataSource<'a> + 'a>(
&mut self,
data: T,
) -> SudachiResult<usize>
pub fn read_lexicon<'a, T: AsDataSource<'a> + 'a>( &mut self, data: T, ) -> SudachiResult<usize>
Read the csv lexicon from either a file or an in-memory buffer
sourcepub fn read_conn<'a, T: AsDataSource<'a> + 'a>(
&mut self,
data: T,
) -> SudachiResult<()>
pub fn read_conn<'a, T: AsDataSource<'a> + 'a>( &mut self, data: T, ) -> SudachiResult<()>
Read the connection matrix from either a file or an in-memory buffer
sourcepub fn compile<W: Write>(&mut self, w: &mut W) -> SudachiResult<()>
pub fn compile<W: Write>(&mut self, w: &mut W) -> SudachiResult<()>
Compile the binary dictionary and write it to the specified sink
sourcepub fn resolve(&mut self) -> SudachiResult<usize>
pub fn resolve(&mut self) -> SudachiResult<usize>
Resolve the dictionary references.
Returns the number of resolved entries
sourcepub fn report(&self) -> &[DictPartReport]
pub fn report(&self) -> &[DictPartReport]
Return dictionary build report
Auto Trait Implementations§
impl<D> Freeze for DictBuilder<D>where
D: Freeze,
impl<D> RefUnwindSafe for DictBuilder<D>where
D: RefUnwindSafe,
impl<D> Send for DictBuilder<D>where
D: Send,
impl<D> Sync for DictBuilder<D>where
D: Sync,
impl<D> Unpin for DictBuilder<D>where
D: Unpin,
impl<D> UnwindSafe for DictBuilder<D>where
D: UnwindSafe,
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more