kite 0.0.3

Information retrieval library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use term::Term;


#[derive(Debug, PartialEq)]
pub enum TermSelector {
    Prefix(String),
}


impl TermSelector {
    pub fn matches(&self, term: &Term) -> bool {
        match *self {
            TermSelector::Prefix(ref prefix) => {
                return term.as_bytes().starts_with(prefix.as_bytes());
            }
        }
    }
}