Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat: add "FFT" and "BWT" transforms to `RedundantAcronyms` (#4369)

Andrew Dunbar0ee99153be3a
diff --git a/harper-core/src/linting/redundant_acronyms.rs b/harper-core/src/linting/redundant_acronyms.rs
index 55418f7b4..f4f37f539 100644
--- a/harper-core/src/linting/redundant_acronyms.rs
+++ b/harper-core/src/linting/redundant_acronyms.rs
@@ -24,6 +24,8 @@ const ACRONYMS: &[(&str, &[&str], &str, Flag)] = &[
"machine",
None,
),
+ ("BWT", &["Burrows-Wheeler"], "transform", None),
+ ("FFT", &["Fast Fourier"], "transform", None),
("GOP", &["Grand Old"], "Party", None),
("GUI", &["graphical user"], "interface", None),
("LCD", &["liquid crystal"], "display", None),
@@ -455,4 +457,30 @@ mod tests {
&[],
);
}
+
+ #[test]
+ fn correct_bwt_transform() {
+ assert_good_and_bad_suggestions(
+ "TSuffix Arrays: It turns out the way we generated the BWT transform above was quite inefficient.",
+ RedundantAcronyms::default(),
+ &[
+ "TSuffix Arrays: It turns out the way we generated the BWT above was quite inefficient.",
+ "TSuffix Arrays: It turns out the way we generated the Burrows-Wheeler transform above was quite inefficient.",
+ ],
+ &[],
+ );
+ }
+
+ #[test]
+ fn correct_fft_transform() {
+ assert_good_and_bad_suggestions(
+ "In fact, the FFT transform does not have to process functions of equally spaced time samples",
+ RedundantAcronyms::default(),
+ &[
+ "In fact, the FFT does not have to process functions of equally spaced time samples",
+ "In fact, the Fast Fourier transform does not have to process functions of equally spaced time samples",
+ ],
+ &[],
+ );
+ }
}