Struct hyphenation::extended::Extended [−][src]
pub struct Extended { pub exceptions: Exceptions, pub minima: (usize, usize), // some fields omitted }
Expand description
A dictionary for extended Knuth–Liang hyphenation, based on the strategy described by Németh in “Automatic non-standard hyphenation in OpenOffice.org”.
It comprises the working language, the set of extended patterns and exceptions, and the character boundaries for hyphenation.
Fields
exceptions: Exceptions
minima: (usize, usize)
The minimum number of char
s from the start and end of a word where
breaks may not occur.
Implementations
impl Extended
[src]
impl Extended
[src]pub fn language(&self) -> Language
[src]
pub fn language(&self) -> Language
[src]The language for which this dictionary can provide hyphenation.
pub fn prefix_tallies(&'f self, query: &'q [u8]) -> PrefixTallies<'f, 'q, Tally>
[src]
pub fn prefix_tallies(&'f self, query: &'q [u8]) -> PrefixTallies<'f, 'q, Tally>
[src]An iterator over the tallies associated to all prefixes of the query, including the query itself.
Trait Implementations
impl<'de> Deserialize<'de> for Extended
[src]
impl<'de> Deserialize<'de> for Extended
[src]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Extended, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Extended, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<'h> Hyphenator<'h> for Extended
[src]
impl<'h> Hyphenator<'h> for Extended
[src]type Exact = (usize, Option<Subregion>)
type Exact = (usize, Option<Subregion>)
An owned opportunity used to specify and store the predetermined hyphenation of known words. Read more
fn hyphenate<'t>(&'h self, word: &'t str) -> Word<'t, Self::Opportunity>
[src]
fn hyphenate<'t>(&'h self, word: &'t str) -> Word<'t, Self::Opportunity>
[src]Hyphenate a word, computing appropriate word breaks and preparing it for iteration. Read more
fn opportunities_within(
&'h self,
word: &str,
(l, r): (usize, usize)
) -> Vec<Self::Opportunity>
[src]
fn opportunities_within(
&'h self,
word: &str,
(l, r): (usize, usize)
) -> Vec<Self::Opportunity>
[src]The hyphenation opportunities that arise by pattern between the specified byte indices. Read more
fn exception_within(
&'h self,
w: &str,
(l, r): (usize, usize)
) -> Option<Vec<Self::Opportunity>>
[src]
fn exception_within(
&'h self,
w: &str,
(l, r): (usize, usize)
) -> Option<Vec<Self::Opportunity>>
[src]The hyphenation opportunities that arise by exception between the specified byte indices, if any. Read more
fn add_exception(
&mut self,
w: String,
ops: Vec<Self::Exact>
) -> Option<Vec<Self::Exact>>
[src]
fn add_exception(
&mut self,
w: String,
ops: Vec<Self::Exact>
) -> Option<Vec<Self::Exact>>
[src]Specify the hyphenation of the given word with an exact sequence of
opportunities and add it to the exception list. Subsequent calls to
hyphenate
or opportunities
will yield this hyphenation instead of
generating one from patterns. Read more
fn remove_exception(&mut self, w: &str) -> Option<Vec<Self::Exact>>
[src]
fn remove_exception(&mut self, w: &str) -> Option<Vec<Self::Exact>>
[src]If the word is an exception, remove it and return the previously specified opportunities; otherwise, return none. Read more
fn unbreakable_chars(&self) -> (usize, usize)
[src]
fn unbreakable_chars(&self) -> (usize, usize)
[src]The number of char
s from the start and end of a word where breaks may
not occur, according to dictionary parameters. Read more
fn opportunities(&'h self, lowercase_word: &str) -> Vec<Self::Opportunity>
[src]
fn opportunities(&'h self, lowercase_word: &str) -> Vec<Self::Opportunity>
[src]The hyphenation opportunities that our dictionary can find in the given word. The word should be lowercase. Read more
impl Load for Extended
[src]
impl Load for Extended
[src]fn from_reader<R>(lang: Language, reader: &mut R) -> Result<Self> where
R: Read,
[src]
fn from_reader<R>(lang: Language, reader: &mut R) -> Result<Self> where
R: Read,
[src]Deserialize a dictionary from the provided reader, verifying that it belongs to the expected language. Read more
fn any_from_reader<R>(reader: &mut R) -> Result<Self> where
R: Read,
[src]
fn any_from_reader<R>(reader: &mut R) -> Result<Self> where
R: Read,
[src]Deserialize a dictionary from the provided reader.
impl<'d> Score<'d> for Extended
[src]
impl<'d> Score<'d> for Extended
[src]type Value = (u8, Option<&'d Subregion>)
type Value = (u8, Option<&'d Subregion>)
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. Read more
fn denotes_opportunity((v, _): Self::Value) -> bool
[src]
fn denotes_opportunity((v, _): Self::Value) -> bool
[src]Whether the given value denotes a valid break.
impl Serialize for Extended
[src]
impl Serialize for Extended
[src]pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Extended
impl Send for Extended
impl Sync for Extended
impl Unpin for Extended
impl UnwindSafe for Extended
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,