layered-nlp 0.1.1

Highly-flexible data-oriented NLP framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::{LLLine, ToIdx, XDirection, XMatch};

pub struct AttrEq<'a, Attr> {
    pub(crate) attr: &'a Attr,
}

impl<'l, Attr: PartialEq + 'static> XMatch<'l> for AttrEq<'_, Attr> {
    type Out = ();

    fn go<M>(&self, direction: &M, ll_line: &'l LLLine) -> Vec<(Self::Out, ToIdx)>
    where
        M: XDirection<'l>,
    {
        direction.attr_eq(self.attr, ll_line)
    }
}