pub struct CreatedWords(/* private fields */);
Expand description
Bitset which represents that a word of a specified length was created. Lattice construction fills this bitmap and passes it to the OOV providers. It allows OOV providers to check if a word of a specific length was created very cheaply.
Unfortunately, if a word is more than MAX_VALUE
characters, handlers need to do usual linear-time check.
Implementations§
source§impl CreatedWords
impl CreatedWords
pub fn empty() -> CreatedWords
pub fn single<Pos: Into<i64>>(length: Pos) -> CreatedWords
pub fn add_word<P: Into<i64>>(&self, length: P) -> CreatedWords
pub fn add(&self, other: CreatedWords) -> CreatedWords
pub fn has_word<P: Into<i64> + Copy>(&self, length: P) -> HasWord
pub fn is_empty(&self) -> bool
pub fn not_empty(&self) -> bool
Trait Implementations§
source§impl Clone for CreatedWords
impl Clone for CreatedWords
source§fn clone(&self) -> CreatedWords
fn clone(&self) -> CreatedWords
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CreatedWords
impl Debug for CreatedWords
source§impl Default for CreatedWords
impl Default for CreatedWords
source§fn default() -> CreatedWords
fn default() -> CreatedWords
Returns the “default value” for a type. Read more
source§impl PartialEq for CreatedWords
impl PartialEq for CreatedWords
impl Copy for CreatedWords
impl Eq for CreatedWords
impl StructuralPartialEq for CreatedWords
Auto Trait Implementations§
impl Freeze for CreatedWords
impl RefUnwindSafe for CreatedWords
impl Send for CreatedWords
impl Sync for CreatedWords
impl Unpin for CreatedWords
impl UnwindSafe for CreatedWords
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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