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 TokenText(pub(crate) ());

impl<'l> XMatch<'l> for TokenText {
    type Out = &'l str;

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