pub struct ModelBuilder { /* private fields */ }Expand description
Writes a model file.
See the module for an example.
Implementations§
Source§impl ModelBuilder
impl ModelBuilder
Sourcepub fn new(dictionary: &str, schema: Schema) -> Result<Self>
pub fn new(dictionary: &str, schema: Schema) -> Result<Self>
Starts a model file.
§Arguments
dictionary- The name of the dictionary the model is for, as what uses the model names the dictionary of its morphemes:ipadic.schema- The schema of the dictionary.
§Returns
The builder, or Error::Model for an empty name.
Sourcepub fn from_model<B: AsRef<[u8]>>(model: &Model<B>) -> Self
pub fn from_model<B: AsRef<[u8]>>(model: &Model<B>) -> Self
Sourcepub fn chunker(self, model: &ChunkerModel) -> Result<Self>
pub fn chunker(self, model: &ChunkerModel) -> Result<Self>
Gives the file its chunker part.
§Arguments
model- The model of the chunker.
§Returns
The builder, or Error::Model when the chunker was not trained
with the schema of the file.
Sourcepub fn parser(
self,
model: &ParserModel,
quantization: Quantization,
) -> Result<Self>
pub fn parser( self, model: &ParserModel, quantization: Quantization, ) -> Result<Self>
Gives the file its parser part.
§Arguments
model- The model of the parser.quantization- How its weights are written.
§Returns
The builder, or Error::Model when the parser was not trained
with the schema of the file.
Trait Implementations§
Source§impl Clone for ModelBuilder
impl Clone for ModelBuilder
Source§impl Debug for ModelBuilder
impl Debug for ModelBuilder
Source§impl PartialEq for ModelBuilder
impl PartialEq for ModelBuilder
impl StructuralPartialEq for ModelBuilder
Auto Trait Implementations§
impl Forget for ModelBuilder
impl Freeze for ModelBuilderwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Pattern>: Freeze,
PhantomData<Vec<String>>: Freeze,
PhantomData<(String, String)>: Freeze,
impl Move for ModelBuilder
impl RefUnwindSafe for ModelBuilder
impl Send for ModelBuilder
impl Sync for ModelBuilder
impl Unpin for ModelBuilder
impl UnsafeUnpin for ModelBuilderwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Pattern>: UnsafeUnpin,
PhantomData<Vec<String>>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
impl UnwindSafe for ModelBuilder
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