Expose triagrams from word

This commit is contained in:
Imbus 2024-11-21 08:47:45 +01:00
parent 94d807fc67
commit 7dd7f5610b
2 changed files with 7 additions and 0 deletions

View file

@ -32,6 +32,10 @@ Word::Word(const std::string &w) : word(w) {
string Word::get_word() const { return string(); }
vector<std::string> Word::get_triagrams() const {
return triagrams;
}
unsigned int Word::get_matches(const vector<string> &t) const {
unsigned int matches = 0;

View file

@ -17,6 +17,9 @@ class Word {
/** Returns the word */
std::string get_word() const;
/** Returns triagrams */
std::vector<std::string> get_triagrams() const;
/** Returns how many of the trigrams in t that are present
in this word's trigram vector */
unsigned int get_matches(const std::vector<std::string> &t) const;