pub struct MultiFtzr<A, B>(pub A, pub B);
Expand description

The composition of two featurizers. Created with featurizers!

Tuple Fields§

§0: A§1: B

Trait Implementations§

source§

impl<A: Clone, B: Clone> Clone for MultiFtzr<A, B>

source§

fn clone(&self) -> MultiFtzr<A, B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<A: Debug, B: Debug> Debug for MultiFtzr<A, B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Origin: Copy, A, B> Ftzr<Origin> for MultiFtzr<A, B>where A: Ftzr<Origin>, B: Ftzr<Origin>,

§

type TokenGroup = EitherGroup<<A as Ftzr<Origin>>::TokenGroup, <B as Ftzr<Origin>>::TokenGroup>

Type of tokens visited by the featurizer. Usually something like &'a [T] (for one dimensional data)
source§

fn push_tokens<Push>(&self, origin: Origin, push: &mut Push)where Push: FnMut(Self::TokenGroup),

The main method to implement for the Ftzr<InputData> trait. Each group of tokens is visited by the FnMut(Self::TokenGroup) function. Read more
source§

fn push_tokens_from<Push, T>(&self, input: InputData, push: &mut Push)where Push: FnMut(T), T: FeatureFrom<Self::TokenGroup>,

Identical to Ftzr::push_tokens, except with implicit coercion via FeatureFrom<Self::TokenGroup> Read more
source§

fn featurize<Feature, A>(&self, input: InputData) -> Awhere Feature: FeatureFrom<Self::TokenGroup>, A: Accumulates<Feature>,

The most versatile tool in the entire crate. Read more
source§

impl<A: Hash, B: Hash> Hash for MultiFtzr<A, B>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a, Origin, TA: Hash, TB: Hash, A, B> IterFtzr<&'a Origin> for MultiFtzr<A, B>where Origin: ?Sized + 'a, A: IterFtzr<&'a Origin, TokenGroup = TA>, B: IterFtzr<&'a Origin, TokenGroup = TB>,

§

type TokenGroup = EitherGroup<TA, TB>

Type of tokens produced by the featurizer. Usually something like &'a [T] (for one dimensional data)
§

type Iter = MultiFtzrIter<<A as IterFtzr<&'a Origin>>::Iter, <B as IterFtzr<&'a Origin>>::Iter>

The associated iterator. For example: NGramIter, MultiFtzrIter, etc
source§

fn iterate_features(&self, origin: &'a Origin) -> Self::Iter

Similar to into_iter, but for featurizers.
source§

impl<A: Ord, B: Ord> Ord for MultiFtzr<A, B>

source§

fn cmp(&self, other: &MultiFtzr<A, B>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<A: PartialEq, B: PartialEq> PartialEq<MultiFtzr<A, B>> for MultiFtzr<A, B>

source§

fn eq(&self, other: &MultiFtzr<A, B>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A: PartialOrd, B: PartialOrd> PartialOrd<MultiFtzr<A, B>> for MultiFtzr<A, B>

source§

fn partial_cmp(&self, other: &MultiFtzr<A, B>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<A: Copy, B: Copy> Copy for MultiFtzr<A, B>

source§

impl<A: Eq, B: Eq> Eq for MultiFtzr<A, B>

source§

impl<A, B> StructuralEq for MultiFtzr<A, B>

source§

impl<A, B> StructuralPartialEq for MultiFtzr<A, B>

Auto Trait Implementations§

§

impl<A, B> RefUnwindSafe for MultiFtzr<A, B>where A: RefUnwindSafe, B: RefUnwindSafe,

§

impl<A, B> Send for MultiFtzr<A, B>where A: Send, B: Send,

§

impl<A, B> Sync for MultiFtzr<A, B>where A: Sync, B: Sync,

§

impl<A, B> Unpin for MultiFtzr<A, B>where A: Unpin, B: Unpin,

§

impl<A, B> UnwindSafe for MultiFtzr<A, B>where A: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.