pub struct RawModel { /* private fields */ }Expand description
Represents a raw model.
Implementations§
Source§impl RawModel
impl RawModel
Sourcepub fn feature_provider(&mut self) -> &mut FeatureProvider
pub fn feature_provider(&mut self) -> &mut FeatureProvider
Returns a mutable reference of the feature provider.
Sourcepub fn merge(&self) -> Result<MergedModel>
pub fn merge(&self) -> Result<MergedModel>
Merges this model and returns MergedModel.
This process integrates the features, so that each edge has three items: a uni-gram cost, a left-connection ID, and a right-connection ID.
§Errors
Generated left/right connection ID must be smaller than 2^32.
Sourcepub fn unigram_weight_indices(&self) -> &[Option<NonZeroU32>]
pub fn unigram_weight_indices(&self) -> &[Option<NonZeroU32>]
Returns the relation between uni-gram feature IDs and weight indices.
Sourcepub fn bigram_weight_indices(&self) -> &[HashMap<u32, u32>]
pub fn bigram_weight_indices(&self) -> &[HashMap<u32, u32>]
Returns the relation between bi-gram feature IDs and weight indices.
Trait Implementations§
Source§impl<'de, __Context> BorrowDecode<'de, __Context> for RawModel
impl<'de, __Context> BorrowDecode<'de, __Context> for RawModel
Source§fn borrow_decode<D: BorrowDecoder<'de, Context = __Context>>(
decoder: &mut D,
) -> Result<Self, DecodeError>
fn borrow_decode<D: BorrowDecoder<'de, Context = __Context>>( decoder: &mut D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Auto Trait Implementations§
impl Freeze for RawModel
impl RefUnwindSafe for RawModel
impl Send for RawModel
impl Sync for RawModel
impl Unpin for RawModel
impl UnwindSafe for RawModel
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