refactor: splitting models
This commit is contained in:
+13
-13
@@ -1058,11 +1058,7 @@ fn jaccard(a: &BTreeSet<String>, b: &BTreeSet<String>) -> f64 {
|
||||
}
|
||||
let inter = a.intersection(b).count() as f64;
|
||||
let union = a.union(b).count() as f64;
|
||||
if union == 0.0 {
|
||||
0.0
|
||||
} else {
|
||||
inter / union
|
||||
}
|
||||
if union == 0.0 { 0.0 } else { inter / union }
|
||||
}
|
||||
|
||||
/// The Flesch-Kincaid grade level of a passage.
|
||||
@@ -1313,8 +1309,9 @@ options:
|
||||
|
||||
#[test]
|
||||
fn stem_without_a_task_is_flagged_but_completions_are_not() {
|
||||
assert!(codes(
|
||||
r#"
|
||||
assert!(
|
||||
codes(
|
||||
r#"
|
||||
id: q-a-001
|
||||
status: draft
|
||||
level: 1
|
||||
@@ -1323,11 +1320,13 @@ options:
|
||||
- { id: A, text: aaaa, correct: true }
|
||||
- { id: B, text: bbbb }
|
||||
"#
|
||||
)
|
||||
.contains(&"clarity-no-task"));
|
||||
)
|
||||
.contains(&"clarity-no-task")
|
||||
);
|
||||
|
||||
assert!(!codes(
|
||||
r#"
|
||||
assert!(
|
||||
!codes(
|
||||
r#"
|
||||
id: q-a-001
|
||||
status: draft
|
||||
level: 1
|
||||
@@ -1336,8 +1335,9 @@ options:
|
||||
- { id: A, text: aaaa, correct: true }
|
||||
- { id: B, text: bbbb }
|
||||
"#
|
||||
)
|
||||
.contains(&"clarity-no-task"));
|
||||
)
|
||||
.contains(&"clarity-no-task")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user