[][src]Struct vtext::tokenize_sentence::PunctuationTokenizer

pub struct PunctuationTokenizer {
    pub params: PunctuationTokenizerParams,
}

Punctuation sentence tokenizer

This simple tokenizer uses punctuation (default ".", "?", "!") to determine sentence boundaries. Trailing whitespace is also captured in the preceding sentence.

Arguments (PunctuationTokenizerParams)

  • punctuation - Punctuation tokens used to determine boundaries. Only the first "character" using the chars method is used.

Fields

params: PunctuationTokenizerParams

Trait Implementations

impl Clone for PunctuationTokenizer[src]

impl Debug for PunctuationTokenizer[src]

impl Default for PunctuationTokenizer[src]

fn default() -> PunctuationTokenizer[src]

Create a new instance

impl Tokenizer for PunctuationTokenizer[src]

fn tokenize<'a>(
    &'a self,
    text: &'a str
) -> Box<dyn Iterator<Item = &'a str> + 'a>
[src]

Tokenize a string

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> 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.