diff --git a/instant-segment/src/lib.rs b/instant-segment/src/lib.rs index e2e3184..46ae92c 100644 --- a/instant-segment/src/lib.rs +++ b/instant-segment/src/lib.rs @@ -73,7 +73,7 @@ impl Segmenter { pub fn score_sentence<'a>(&self, mut words: impl Iterator) -> Option { let mut prev = words.next()?; let mut score = self.score(prev, None); - while let Some(word) = words.next() { + for word in words { score += self.score(word, Some(prev)); prev = word; }