pub struct SplitCompoundWord { /* private fields */ }
Expand description
A Pattern
that looks for valid words accidentally split by whitespace.
Note that matches of this pattern are not guaranteed to be valid if merged.
Implementations§
Source§impl SplitCompoundWord
impl SplitCompoundWord
Sourcepub fn new(
predicate: impl Fn(WordMetadata) -> bool + Send + Sync + 'static,
) -> Self
pub fn new( predicate: impl Fn(WordMetadata) -> bool + Send + Sync + 'static, ) -> Self
Create a new instance of the linter which will only look for compound words that fit the provided predicate.
Sourcepub fn get_merged_word(
&self,
word_a: Token,
word_b: Token,
source: &[char],
) -> Option<CharString>
pub fn get_merged_word( &self, word_a: Token, word_b: Token, source: &[char], ) -> Option<CharString>
The merged word from the dictionary that this pattern would match on if it was split.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SplitCompoundWord
impl !RefUnwindSafe for SplitCompoundWord
impl !Send for SplitCompoundWord
impl !Sync for SplitCompoundWord
impl Unpin for SplitCompoundWord
impl !UnwindSafe for SplitCompoundWord
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<P> DocPattern for Pwhere
P: PatternExt,
impl<P> DocPattern for Pwhere
P: PatternExt,
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