Skip to content

Commit

Permalink
So funny the useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
printer83mph committed Nov 24, 2022
1 parent 5e7e458 commit c5048af
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/markov.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ impl Model {
self.touch_word(last);

self.count_start_occurrence(first);
// since we miss this in the loop:
self.count_occurrence(first);

self.count_end_occurrence(last);

Expand All @@ -150,7 +148,6 @@ impl Model {
let (w1, w2) = (words[i - 1], words[i]);
self.touch_word(w2);
self.count_pair(w1, w2);
self.count_occurrence(w2);
}
}

Expand Down Expand Up @@ -237,10 +234,4 @@ impl Model {
stats.next_occurrences[w2_idx] += 1;
stats.next_total += 1;
}

/// add a single occurrance to a word, used for ending words
fn count_occurrence(&mut self, word: &str) -> () {
let (_, stats) = self.get_stats_mut(word).unwrap();
stats.occurrences += 1;
}
}
Empty file removed src/util.rs
Empty file.

0 comments on commit c5048af

Please sign in to comment.