mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-22 23:52:12 -05:00
fix(dict): Handle cases from Linux
These were found while running `typos` on Linux and inspecting a sampling of the results. #249 represents additional changes to make. There were some identifiers, that looked like hardware registers, that I'm unsure of what can be done for them.
This commit is contained in:
parent
fb0dac4297
commit
639e65b88a
3 changed files with 33549 additions and 33551 deletions
5
crates/typos-dict/assets/words.csv
vendored
5
crates/typos-dict/assets/words.csv
vendored
|
@ -13021,7 +13021,6 @@ handelbars,handlebars
|
|||
handicaped,handicapped
|
||||
handwritng,handwriting
|
||||
harasments,harassments
|
||||
hardlinked,hardline
|
||||
harmoniacs,harmonic
|
||||
harmonisch,harmonic
|
||||
harrasment,harassment
|
||||
|
@ -23557,7 +23556,7 @@ referens,references
|
|||
referere,referee
|
||||
referign,refering
|
||||
refering,referring
|
||||
refernce,references
|
||||
refernce,reference
|
||||
reffered,referred
|
||||
refilles,refills
|
||||
refillls,refills
|
||||
|
@ -27976,7 +27975,7 @@ tast,taste
|
|||
tath,that
|
||||
tehy,they
|
||||
tghe,the
|
||||
ther,there
|
||||
ther,there,their,the
|
||||
thge,the
|
||||
thna,than
|
||||
thne,then
|
||||
|
|
Can't render this file because it is too large.
|
File diff suppressed because it is too large
Load diff
10
src/dict.rs
10
src/dict.rs
|
@ -38,7 +38,7 @@ impl BuiltIn {
|
|||
if corrections.is_empty() {
|
||||
Status::Invalid
|
||||
} else {
|
||||
self.chain_with_vars(corrections)?
|
||||
self.chain_with_vars(corrections)
|
||||
}
|
||||
} else {
|
||||
self.correct_with_vars(word)?
|
||||
|
@ -65,7 +65,7 @@ impl BuiltIn {
|
|||
}
|
||||
|
||||
#[cfg(feature = "vars")]
|
||||
fn chain_with_vars(&self, corrections: &'static [&'static str]) -> Option<Status<'static>> {
|
||||
fn chain_with_vars(&self, corrections: &'static [&'static str]) -> Status<'static> {
|
||||
let mut chained: Vec<_> = corrections
|
||||
.iter()
|
||||
.flat_map(|c| match self.correct_with_vars(c) {
|
||||
|
@ -81,12 +81,12 @@ impl BuiltIn {
|
|||
chained.dedup();
|
||||
}
|
||||
debug_assert!(!chained.is_empty());
|
||||
Some(Status::Corrections(chained))
|
||||
Status::Corrections(chained)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "vars"))]
|
||||
fn chain_with_vars(&self, corrections: &[&str]) -> Option<Status<'static>> {
|
||||
Status::Corrections(corrections.map(|c| Cow::Borrowed(correction).collect()))
|
||||
fn chain_with_vars(&self, corrections: &'static [&'static str]) -> Status<'static> {
|
||||
Status::Corrections(corrections.iter().map(|c| Cow::Borrowed(*c)).collect())
|
||||
}
|
||||
|
||||
#[cfg(feature = "vars")]
|
||||
|
|
Loading…
Reference in a new issue