pub struct Model(_);
Expand description
Model data.
Implementations§
source§impl Model
impl Model
sourcepub fn read_slice(slice: &[u8]) -> Result<(Self, &[u8])>
pub fn read_slice(slice: &[u8]) -> Result<(Self, &[u8])>
Creates a model from a slice and returns a tuple of the model and the remaining slice.
Errors
When bincode generates an error, it will be returned as is.
sourcepub fn dictionary(&self) -> &[WordWeightRecord]
pub fn dictionary(&self) -> &[WordWeightRecord]
Returns the slice of dictionary words.
sourcepub fn replace_dictionary(&mut self, dict: Vec<WordWeightRecord>)
pub fn replace_dictionary(&mut self, dict: Vec<WordWeightRecord>)
Replaces the dictionary with the given data.
sourcepub fn tag_models(&self) -> &[TagModel]
pub fn tag_models(&self) -> &[TagModel]
Returns the slice of tag models.
Trait Implementations§
source§impl TryFrom<KyteaModel> for Model
impl TryFrom<KyteaModel> for Model
§type Error = VaporettoError
type Error = VaporettoError
The type returned in the event of a conversion error.
source§fn try_from(model: KyteaModel) -> Result<Self>
fn try_from(model: KyteaModel) -> Result<Self>
Performs the conversion.