Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
fix(core): #195 by allowing numerics in words
Elijah Potteraa244664d116
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dictindex 8fc030d04..ef48d4314 100644--- a/harper-core/dictionary.dict+++ b/harper-core/dictionary.dict@@ -49768,3 +49768,6 @@ upsample/SMGorganoid/SMcentric/SMHarper/SM+a8c/SM+a11n/1+a12s/9diff --git a/harper-core/src/lexing/mod.rs b/harper-core/src/lexing/mod.rsindex e451d3111..04a7184e9 100644--- a/harper-core/src/lexing/mod.rs+++ b/harper-core/src/lexing/mod.rs@@ -44,7 +44,7 @@ pub fn lex_token(source: &[char]) -> Option<FoundToken> {fn lex_word(source: &[char]) -> Option<FoundToken> {let end = source.iter()- .position(|c| !c.is_english_lingual())+ .position(|c| !c.is_english_lingual() && !c.is_numeric()).unwrap_or(source.len());if end == 0 {diff --git a/harper-core/tests/run_tests.rs b/harper-core/tests/run_tests.rsindex 50f5f3d6e..fcb8e074f 100644--- a/harper-core/tests/run_tests.rs+++ b/harper-core/tests/run_tests.rs@@ -47,3 +47,4 @@ create_test!(proper_noun_capitalization.md, 2);create_test!(amazon_hostname.md, 0);create_test!(issue_159.md, 1);create_test!(issue_358.md, 0);+create_test!(issue_195.md, 0);diff --git a/harper-core/tests/test_sources/issue_195.md b/harper-core/tests/test_sources/issue_195.mdnew file mode 100644index 000000000..3d993260e--- /dev/null+++ b/harper-core/tests/test_sources/issue_195.md@@ -0,0 +1 @@+If we have words with numbers in them, like IPv4, they should get marked as just that: words.