File tree 4 files changed +8
-7
lines changed
4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 5
5
from typing import List
6
6
import argparse
7
7
8
- from charset_normalizer import from_path
8
+ from charset_normalizer import from_path , __version__
9
9
from charset_normalizer .utils import iana_name
10
10
11
11
from os import sep
@@ -40,6 +40,8 @@ def cli_coverage(arguments: List[str]):
40
40
print ("This script require https://github.com/Ousret/char-dataset to be cloned on package root directory" )
41
41
exit (1 )
42
42
43
+ print (f"> using charset-normalizer { __version__ } " )
44
+
43
45
success_count = 0
44
46
total_count = 0
45
47
Original file line number Diff line number Diff line change @@ -233,16 +233,13 @@ def reset(self) -> None: # pragma: no cover
233
233
234
234
@property
235
235
def ratio (self ) -> float :
236
- if self ._character_count == 0 :
236
+ if self ._character_count <= 32 :
237
237
return 0.0
238
238
239
239
ratio_of_suspicious_range_usage : float = (
240
240
self ._suspicious_successive_range_count * 2
241
241
) / self ._character_count
242
242
243
- if ratio_of_suspicious_range_usage < 0.1 :
244
- return 0.0
245
-
246
243
return ratio_of_suspicious_range_usage
247
244
248
245
@@ -521,6 +518,8 @@ def is_suspiciously_successive_range(
521
518
return False
522
519
if "Forms" in unicode_range_a or "Forms" in unicode_range_b :
523
520
return False
521
+ if unicode_range_a == "Basic Latin" or unicode_range_b == "Basic Latin" :
522
+ return False
524
523
525
524
return True
526
525
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ def is_symbol(character: str) -> bool:
96
96
if character_range is None :
97
97
return False
98
98
99
- return "Forms" in character_range
99
+ return "Forms" in character_range and character_category != "Lo"
100
100
101
101
102
102
@lru_cache (maxsize = UTF8_MAXIMAL_ALLOCATION )
Original file line number Diff line number Diff line change 2
2
Expose version
3
3
"""
4
4
5
- __version__ = "3.3.0 "
5
+ __version__ = "3.3.1 "
6
6
VERSION = __version__ .split ("." )
You can’t perform that action at this time.
0 commit comments