Skip to content

Commit

Permalink
Fix right padding
Browse files Browse the repository at this point in the history
  • Loading branch information
Roughsketch committed Aug 16, 2017
1 parent 062a948 commit 43583d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ngram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ impl<'a> NGram<'a> {
//right-padding
if !self.pad.is_empty() {
for i in 1..self.n {
let num_blanks = i;
let num_blanks = self.n - i;
let last_entry = tokenized_sequence.len();
let mut tc = Vec::new();
tc.extend_from_slice(&tokenized_sequence[(last_entry - num_blanks) .. last_entry]);
tc.extend_from_slice(&tokenized_sequence[(last_entry - i) .. last_entry]);
for _ in 0..num_blanks {
tc.push(self.pad);
}
Expand Down

0 comments on commit 43583d3

Please sign in to comment.