Struct nlprule::rule::DisambiguationRule[][src]

pub struct DisambiguationRule { /* fields omitted */ }

A disambiguation rule. Changes the information associcated with one or more tokens if it matches. Sourced from LanguageTool. An example of how a simple rule might look in the original XML format:

<rule id="NODT_HAVE" name="no determiner + have as verb/noun ->have/verb">
   <pattern>
       <token>
            <exception postag="PRP$"></exception>
            <exception regexp="yes">the|a</exception>
       </token>
       <marker>
           <token case_sensitive="yes" regexp="yes">[Hh]ave|HAVE</token>
       </marker>
   </pattern>
   <disambig action="replace"><wd lemma="have" pos="VB"></wd></disambig>
</rule>

Implementations

impl DisambiguationRule[src]

pub fn id(&self) -> &Index[src]

Get a unique identifier of this rule.

pub fn test(&self, tokenizer: &Tokenizer) -> bool[src]

Often there are examples associated with a rule. This method checks whether the correct action is taken in the examples.

Trait Implementations

impl Clone for DisambiguationRule[src]

impl Debug for DisambiguationRule[src]

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

impl Serialize for DisambiguationRule[src]

Auto Trait Implementations

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.