pub struct Word {
pub syllables: Vec<Syllable>,
}Fields§
§syllables: Vec<Syllable>Implementations§
Source§impl Word
impl Word
pub fn new<I>(text: I, aliases: &[Transformation]) -> Result<Self, ASCAError>
pub fn get_syll_segments(&self, syll_index: usize) -> Option<&VecDeque<Segment>>
pub fn get_syll_segments_mut( &mut self, syll_index: usize, ) -> Option<&mut VecDeque<Segment>>
Sourcepub fn remove_syll(&mut self, syll_index: usize)
pub fn remove_syll(&mut self, syll_index: usize)
Removes and returns the syllable at syll_index within the word, shifting all elements after it to the left.
§Panics
Panics if syll_index is out of bounds.
Sourcepub fn swap_sylls(&mut self, a: usize, b: usize)
pub fn swap_sylls(&mut self, a: usize, b: usize)
Sourcepub fn seg_length_at(&self, seg_index: SegPos) -> usize
pub fn seg_length_at(&self, seg_index: SegPos) -> usize
Finds number of consecutive identical segments within a syllable starting from the given index.
Does not take into account if said index is in the middle of the repetition
§Panics
If SegPos is out of bounds
Trait Implementations§
Source§impl FromIterator<Word> for Phrase
impl FromIterator<Word> for Phrase
Auto Trait Implementations§
impl Freeze for Word
impl RefUnwindSafe for Word
impl Send for Word
impl Sync for Word
impl Unpin for Word
impl UnwindSafe for Word
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more