Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

❇️ Adjust the MD to lower the sensitivity around certain CSVs #69

Merged
merged 3 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charset_normalizer/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def eligible(self, character: str) -> bool:
def feed(self, character: str) -> None:
self._character_count += 1

if character != self._last_printable_char and character not in ["<", ">", "=", ":", "/", "&", ";", "{", "}", "[", "]"]:
if character != self._last_printable_char and character not in ["<", ">", "=", ":", "/", "&", ";", "{", "}", "[", "]", ",", "|", '"']:
if is_punctuation(character):
self._punctuation_count += 1
elif character.isdigit() is False and is_symbol(character):
Expand Down Expand Up @@ -116,7 +116,7 @@ def eligible(self, character: str) -> bool:
return True

def feed(self, character: str) -> None:
if character not in {'\n', '\t', '\r'} and character.isprintable() is False:
if character not in {'\n', '\t', '\r', '\t'} and character.isprintable() is False:
Ousret marked this conversation as resolved.
Show resolved Hide resolved
self._unprintable_count += 1
self._character_count += 1

Expand Down
2 changes: 1 addition & 1 deletion tests/test_probe_chaos.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_subtle_gibberish(self):

self.assertGreater(
mess_ratio("´Á¥½³ø§i -- ±i®Ìºû, ³¯·Ø©v"),
0.8
0.7
)

self.assertGreater(
Expand Down