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
use super::{LLLine, ToIdx, XDirection, XMatch};

pub struct Attr<Attr>(pub(crate) std::marker::PhantomData<Attr>);

impl<'l, A: 'static> XMatch<'l> for Attr<A> {
    type Out = &'l A;

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