diff --git a/harper-core/src/document.rs b/harper-core/src/document.rs index e15a0b06..770a2a9c 100644 --- a/harper-core/src/document.rs +++ b/harper-core/src/document.rs @@ -467,8 +467,8 @@ impl Document { self.tokens.remove_indices(to_remove); } - /// Searches for contractions and hyphenated words and condenses them down - /// into single tokens. + /// Searches for contractions and condenses them down into single + /// tokens. fn condense_contractions(&mut self) { if self.tokens.len() < 3 { return; @@ -488,10 +488,6 @@ impl Document { TokenKind::Word(..), TokenKind::Punctuation(Punctuation::Apostrophe), TokenKind::Word(..) - ) | ( - TokenKind::Word(..), - TokenKind::Punctuation(Punctuation::Hyphen), - TokenKind::Word(..) ) ) { // Ensure there is no overlapping between replacements @@ -652,15 +648,6 @@ mod tests { assert_condensed_contractions("There's no way", 5); } - #[test] - fn condenses_pre_existing() { - assert_condensed_contractions("pre-existing", 1); - assert_condensed_contractions( - "There was a pre-existing problem with words with hyphens.", - 18 - ); - } - #[test] fn selects_token_at_char_index() { let text = "There were three little pigs. They built three little homes.";