Struct hyphenation::Standard [−][src]
pub struct Standard { pub language: Language, pub patterns: Patterns, pub exceptions: Exceptions, pub minima: (usize, usize), }
A dictionary for standard Knuth–Liang hyphenation.
It comprises the working language, the pattern and exception sets, and the character boundaries for hyphenation.
Fields
language: Language
patterns: Patterns
exceptions: Exceptions
minima: (usize, usize)
The minimum number of char
s from the start and end of a word where breaks
may not occur.
Trait Implementations
impl<'de> Deserialize<'de> for Standard
[src]
impl<'de> Deserialize<'de> for Standard
fn deserialize<__D>(
__deserializer: __D
) -> Result<Standard, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Standard, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Serialize for Standard
[src]
impl Serialize for Standard
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Clone for Standard
[src]
impl Clone for Standard
fn clone(&self) -> Standard
[src]
fn clone(&self) -> Standard
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Standard
[src]
impl Debug for Standard
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Eq for Standard
[src]
impl Eq for Standard
impl PartialEq<Standard> for Standard
[src]
impl PartialEq<Standard> for Standard
fn eq(&self, other: &Standard) -> bool
[src]
fn eq(&self, other: &Standard) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Standard) -> bool
[src]
fn ne(&self, other: &Standard) -> bool
This method tests for !=
.
impl<'h> Hyphenator<'h> for Standard
[src]
impl<'h> Hyphenator<'h> for Standard
type Opportunity = usize
Plain representation of a word break.
type Exact = usize
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>
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<usize>
[src]
fn opportunities_within(
&'h self,
word: &str,
(l, r): (usize, usize)
) -> Vec<usize>
The hyphenation opportunities that arise between the specified indices. Read more
fn exact(&'h self, w: &str) -> Option<Vec<Self::Opportunity>>
[src]
fn exact(&'h self, w: &str) -> Option<Vec<Self::Opportunity>>
Retrieve the known exact hyphenation for this word, if any.
fn add_exact(&mut self, w: String, ops: Vec<usize>) -> Option<Vec<usize>>
[src]
fn add_exact(&mut self, w: String, ops: Vec<usize>) -> Option<Vec<usize>>
Specify the hyphenation of the given word with an exact sequence of opportunities. Subsequent calls to hyphenate
or opportunities
will yield this hyphenation instead of generating one from patterns. Read more
fn unbreakable_chars(&self) -> (usize, usize)
[src]
fn unbreakable_chars(&self) -> (usize, usize)
The number of char
s from the start and end of a word where breaks may not occur. Read more
fn opportunities(&'h self, lowercase_word: &str) -> Vec<Self::Opportunity>
[src]
fn opportunities(&'h self, lowercase_word: &str) -> Vec<Self::Opportunity>
The hyphenation opportunities that our dictionary can find in the given word. The word should be lowercase. Read more
fn boundaries(&self, word: &str) -> Option<(usize, usize)>
[src]
fn boundaries(&self, word: &str) -> Option<(usize, usize)>
The byte indices delimiting the substring where breaks may occur, unless the word is too short to be hyphenated. Read more
impl Load for Standard
[src]
impl Load for Standard
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,
Deserialize a dictionary from the provided reader, verifying that it effectively belongs to the requested 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,
Deserialize a dictionary from the provided reader.
fn from_path<P>(lang: Language, path: P) -> Result<Self> where
P: AsRef<Path>,
[src]
fn from_path<P>(lang: Language, path: P) -> Result<Self> where
P: AsRef<Path>,
Read and deserialize the dictionary at the given path, verifying that it effectively belongs to the requested language. Read more
impl<'d> Score<'d> for Standard
[src]
impl<'d> Score<'d> for Standard
type Value = u8
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
Whether the given value denotes a valid break.
fn score(&'d self, word: &str) -> Vec<u8>
[src]
fn score(&'d self, word: &str) -> Vec<u8>
Generate a word's hyphenation score, from which opportunities may be extracted. Read more