[][src]Trait spandex_hyphenation::score::Score

pub trait Score<'d> {
    type Value;
    fn score(&'d self, word: &str) -> Vec<Self::Value>;
fn denotes_opportunity(value: Self::Value) -> bool; }

Methods to evaluate each index in a string as an opportunity for hyphenation.

Associated Types

type Value

A value assigned to each index — which is to say, to each potential break between letters — to determine whether the string can be broken at that index.

Loading content...

Required methods

fn score(&'d self, word: &str) -> Vec<Self::Value>

Generate a word's hyphenation score, from which opportunities may be extracted.

The Standard and Extended dictionaries mark each byte index with an integer value, where an odd value marks the index as a valid break.

fn denotes_opportunity(value: Self::Value) -> bool

Whether the given value denotes a valid break.

Loading content...

Implementors

impl<'d> Score<'d> for Extended[src]

type Value = (u8, Option<&'d Subregion>)

impl<'d> Score<'d> for Standard[src]

type Value = u8

Loading content...