mirror of
https://github.com/wassname/segpy.git
synced 2026-07-25 13:30:14 +08:00
Simplifies comparison statements in encoding.py
This commit is contained in:
+2
-2
@@ -64,10 +64,10 @@ def guess_encoding(bs, threshold=0.5):
|
||||
if null_freq == 1.0:
|
||||
return ASCII # Doesn't matter
|
||||
|
||||
if ebcdic_freq < threshold and ascii_freq >= threshold:
|
||||
if ebcdic_freq < threshold <= ascii_freq:
|
||||
return ASCII
|
||||
|
||||
if ebcdic_freq >= threshold and ascii_freq < threshold:
|
||||
if ebcdic_freq >= threshold > ascii_freq:
|
||||
return EBCDIC
|
||||
|
||||
if ebcdic_freq < threshold and ascii_freq < threshold:
|
||||
|
||||
Reference in New Issue
Block a user