Add tests for stop words and fix a couple of bugs

This commit is contained in:
Loïc Lecrenier 2023-04-27 13:30:09 +02:00
parent dd007dceca
commit 374095d42c
5 changed files with 155 additions and 17 deletions

View file

@ -241,7 +241,7 @@ impl PhraseBuilder {
}
fn is_empty(&self) -> bool {
self.words.is_empty()
self.words.is_empty() || self.words.iter().all(Option::is_none)
}
// precondition: token has kind Word or StopWord