Struct nlprule::tokenizer::tag::Tagger[][src]

pub struct Tagger { /* fields omitted */ }

The lexical tagger.

Implementations

impl Tagger[src]

pub fn id_tag<'a>(&self, tag: &'a str) -> PosId<'a>[src]

Tags the given string representation of a part-of-speech tag. Part-of-speech tags are treated as a closed set so each valid part-of-speech tag will get a numerical id.

pub fn id_word<'a>(&self, text: Cow<'a, str>) -> WordId<'a>[src]

Tags the given text. Unknown words will not get a numerical id.

pub fn get_tags_with_options(
    &self,
    word: &str,
    add_lower: Option<bool>,
    use_compound_split_heuristic: Option<bool>
) -> Vec<WordData<'_>>
[src]

Get the tags and lemmas (as WordData) for the given word.

Arguments

  • word: The word to lookup data for.
  • add_lower: Whether to add data for the lowercase variant of the word. If None, will be set according to the language options.
  • use_compound_split_heuristic: Whether to use a heuristic to split compound words. If None, will be set according to the language options. If true, will attempt to find tags for words which are longer than some cutoff and unknown by looking up tags for substrings from left to right until tags are found or a minimum length reached.

pub fn get_tags(&self, word: &str) -> Vec<WordData<'_>>[src]

Get the tags and lemmas (as WordData) for the given word using the default options of the tagger.

Arguments

  • word: The word to lookup data for.

pub fn get_group_members(&self, lemma: &str) -> Vec<&str>[src]

Get the words with the same lemma as the given lemma.

Trait Implementations

impl Clone for Tagger[src]

impl Default for Tagger[src]

impl<'de> Deserialize<'de> for Tagger[src]

impl Serialize for Tagger[src]

Auto Trait Implementations

impl !RefUnwindSafe for Tagger

impl Send for Tagger

impl Sync for Tagger

impl Unpin for Tagger

impl UnwindSafe for Tagger

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.