Struct crfs::Model[][src]

pub struct Model<'a> { /* fields omitted */ }

The CRF model

Implementations

impl<'a> Model<'a>[src]

pub fn new(buf: &'a [u8]) -> Result<Self>[src]

Create an instance of a model object from a model in memory

pub fn num_attrs(&self) -> u32[src]

Number of attributes

pub fn num_labels(&self) -> u32[src]

Number of labels

pub fn to_label(&self, lid: u32) -> Option<&str>[src]

Convert a label ID to label string

pub fn to_label_id(&self, value: &str) -> Option<u32>[src]

Convert a label string to label ID

pub fn to_attr(&self, aid: u32) -> Option<&str>[src]

Convert a attribute ID to attribute string

pub fn to_attr_id(&self, value: &str) -> Option<u32>[src]

Convert a attribute string to attribute ID

pub fn tagger(&'a self) -> Result<Tagger<'a>>[src]

Get a new tagger

pub fn dump<W: Write>(&self, w: &mut W) -> Result<()>[src]

Print the model in human-readable format

Trait Implementations

impl<'a> Clone for Model<'a>[src]

impl<'a> Debug for Model<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Model<'a>[src]

impl<'a> Send for Model<'a>[src]

impl<'a> Sync for Model<'a>[src]

impl<'a> Unpin for Model<'a>[src]

impl<'a> UnwindSafe for Model<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.