[−][src]Struct sticker_encoders::lemma::TdzLemmaEncoder
Lemma encoder-decoder for TüBa-D/Z
This encoder wraps EditTreeEncoder
. Before encoding and after
decoding a list of transformation rules is applied to transform
the lemmas from and to TüBa-D/Z-style lemmas.
For example, the particle verb abschließen is encoded as the ab#schließen in TüBa-D/Z. During encoding, the lemma is transformed to schließen. Then during decoding the lemma is transformed back to ab#schließen based on the ab particle that is either a prefix of in form (e.g. abgeschlossen) or a separated particle (e.g. ich schließe es ab).
Implementations
impl TdzLemmaEncoder
[src]
pub fn new(backoff_strategy: BackoffStrategy) -> Self
[src]
Construct a TdzLemmaEncoder
.
The backoff strategy is used when the edit tree that was predicted is not applicable to the form.
Trait Implementations
impl<'de> Deserialize<'de> for TdzLemmaEncoder
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl SentenceDecoder for TdzLemmaEncoder
[src]
type Encoding = <EditTreeEncoder as SentenceDecoder>::Encoding
type Error = <EditTreeEncoder as SentenceDecoder>::Error
The decoding error type.
fn decode<S>(
&self,
labels: &[S],
sentence: &mut Sentence
) -> Result<(), Self::Error> where
S: AsRef<[EncodingProb<Self::Encoding>]>,
[src]
&self,
labels: &[S],
sentence: &mut Sentence
) -> Result<(), Self::Error> where
S: AsRef<[EncodingProb<Self::Encoding>]>,
impl SentenceEncoder for TdzLemmaEncoder
[src]
type Encoding = <EditTreeEncoder as SentenceEncoder>::Encoding
type Error = <EditTreeEncoder as SentenceEncoder>::Error
The encoding error type.
fn encode(
&self,
sentence: &Sentence
) -> Result<Vec<Self::Encoding>, Self::Error>
[src]
&self,
sentence: &Sentence
) -> Result<Vec<Self::Encoding>, Self::Error>
impl Serialize for TdzLemmaEncoder
[src]
Auto Trait Implementations
impl RefUnwindSafe for TdzLemmaEncoder
impl Send for TdzLemmaEncoder
impl Sync for TdzLemmaEncoder
impl Unpin for TdzLemmaEncoder
impl UnwindSafe for TdzLemmaEncoder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,