16 WordCount (std::string w,
size_t c) : word(w), count(c) {}
17 WordCount & operator++() { count++;
return *
this; }
18 friend bool operator< (
const WordCount & l,
const WordCount & r)
20 if (l.count != r.count)
return l.count < r.count;
21 else return l.word > r.word;
25 double make_word_heap(Rcpp::CharacterVector, std::vector<WordCount> &);
33 LogicalVector query(CharacterVector word)
const;
35 void insert (CharacterVector word_list);
36 void insert_cover(Rcpp::CharacterVector text,
double target);
37 void insert_n(Rcpp::CharacterVector text,
size_t n);
38 void insert_above(Rcpp::CharacterVector text,
size_t thresh);