Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxiangzhuang committed Apr 26, 2024
1 parent d32bd9e commit 0907667
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ and [sacrebleu](https://github.com/mjpost/sacrebleu)
# Basic usage:
```rust
use bleuscore::compute_score;
// get the references and prediction data:
let references: Vec<Vec<String>> = vec![vec!["Hello, World!".to_string()]];
let predictions: Vec<String> = vec!["Yellow, World!".to_string()];
Expand Down
3 changes: 1 addition & 2 deletions src/ngram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ mod test {
fn test_get_token_ngram_short() {
let tokens = vec!["a".to_string(), "b".to_string()];
let counter = get_token_ngram_counter(&tokens, 4);
let string_slice = &vec!["Hello".to_string(), "World".to_string()];
assert_eq!(counter[&tokens[0..=0]], 1);
assert_eq!(counter[&tokens[1..=1]], 1);
assert_eq!(counter[&tokens[1..=2]], 1);
assert_eq!(counter[&tokens[0..=1]], 1);
}

#[test]
Expand Down

0 comments on commit 0907667

Please sign in to comment.