[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.145.41.173: ~ $


<_9Y�$�@s*ddlmZmZmZddlmZmZmZddlm	Z	m
Z
mZddlm
Z
mZmZddlmZmZmZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)�)�EUCTW_CHAR_TO_FREQ_ORDER�EUCTW_TABLE_SIZE� EUCTW_TYPICAL_DISTRIBUTION_RATIO)�EUCKR_CHAR_TO_FREQ_ORDER�EUCKR_TABLE_SIZE� EUCKR_TYPICAL_DISTRIBUTION_RATIO)�GB2312_CHAR_TO_FREQ_ORDER�GB2312_TABLE_SIZE�!GB2312_TYPICAL_DISTRIBUTION_RATIO)�BIG5_CHAR_TO_FREQ_ORDER�BIG5_TABLE_SIZE�BIG5_TYPICAL_DISTRIBUTION_RATIO)�JIS_CHAR_TO_FREQ_ORDER�JIS_TABLE_SIZE�JIS_TYPICAL_DISTRIBUTION_RATIOc@speZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�ZdS)�CharDistributionAnalysisig�G�z��?g{�G�z�?�cCsDd|_d|_d|_d|_d|_d|_|j�dS)N)�_char_to_freq_order�_table_size�typical_distribution_ratio�_done�_total_chars�_freq_chars�reset)�self�r�/chardistribution.py�__init__.s						z!CharDistributionAnalysis.__init__cCsd|_d|_d|_dS)zreset analyser, clear any stateF�N)rrr)rrrrr=s		zCharDistributionAnalysis.resetcCst|dkr|j|�}nd}|dkrp|jd7_||jkrpd|j|krp|jd7_dS)z"feed a character with known length�rriN���)�	get_orderrrrr)r�charZchar_len�orderrrr�feedFszCharDistributionAnalysis.feedcCsr|jdks!|j|jkr(|jS|j|jkrk|j|j|j|j}||jkrk|S|jS)z(return confidence based on existing datar)rr�MINIMUM_DATA_THRESHOLD�SURE_NOr�SURE_YES)r�rrrr�get_confidenceTs!z'CharDistributionAnalysis.get_confidencecCs|j|jkS)N)r�ENOUGH_DATA_THRESHOLD)rrrr�got_enough_datadsz(CharDistributionAnalysis.got_enough_datacCsdS)Nrr r)r�byte_strrrrr!isz"CharDistributionAnalysis.get_orderN)
�__name__�
__module__�__qualname__r*r'r&r%rrr$r)r+r!rrrrr(s	rcs.eZdZ�fdd�Zdd�Z�S)�EUCTWDistributionAnalysiscs2tt|�j�t|_t|_t|_dS)N)	�superr0rrrrrrr)r)�	__class__rrrrs		z"EUCTWDistributionAnalysis.__init__cCs6|d}|dkr.d|d|ddSdSdS)Nr���^r�r r)rr,�
first_charrrrr!xs
z#EUCTWDistributionAnalysis.get_order)r-r.r/rr!rr)r2rr0qsr0cs.eZdZ�fdd�Zdd�Z�S)�EUCKRDistributionAnalysiscs2tt|�j�t|_t|_t|_dS)N)	r1r7rrrrrrr)r)r2rrr�s		z"EUCKRDistributionAnalysis.__init__cCs6|d}|dkr.d|d|ddSdSdS)Nr�r4rr5r r)rr,r6rrrr!�s
z#EUCKRDistributionAnalysis.get_order)r-r.r/rr!rr)r2rr7�sr7cs.eZdZ�fdd�Zdd�Z�S)�GB2312DistributionAnalysiscs2tt|�j�t|_t|_t|_dS)N)	r1r9rrrr	rr
r)r)r2rrr�s		z#GB2312DistributionAnalysis.__init__cCsI|d|d}}|dkrA|dkrAd|d|dSdSdS)Nrrr8r5r4r r)rr,r6�second_charrrrr!�sz$GB2312DistributionAnalysis.get_order)r-r.r/rr!rr)r2rr9�sr9cs.eZdZ�fdd�Zdd�Z�S)�Big5DistributionAnalysiscs2tt|�j�t|_t|_t|_dS)N)	r1r;rrrrrr
r)r)r2rrr�s		z!Big5DistributionAnalysis.__init__cCsd|d|d}}|dkr\|dkrEd|d|ddSd|d|dSndSdS)	Nrr�r5��?�@r r)rr,r6r:rrrr!�sz"Big5DistributionAnalysis.get_order)r-r.r/rr!rr)r2rr;�sr;cs.eZdZ�fdd�Zdd�Z�S)�SJISDistributionAnalysiscs2tt|�j�t|_t|_t|_dS)N)	r1r@rrrrrrr)r)r2rrr�s		z!SJISDistributionAnalysis.__init__cCs�|d|d}}|dkr>|dkr>d|d}n1|dkrk|dkrkd|dd}ndS||d	}|d
kr�d}|S)
Nrr��������r?�r r r)rr,r6r:r#rrrr!�sz"SJISDistributionAnalysis.get_order)r-r.r/rr!rr)r2rr@�sr@cs.eZdZ�fdd�Zdd�Z�S)�EUCJPDistributionAnalysiscs2tt|�j�t|_t|_t|_dS)N)	r1rHrrrrrrr)r)r2rrr�s		z"EUCJPDistributionAnalysis.__init__cCs6|d}|dkr.d|d|ddSdSdS)Nr�r4r5rr r)rr,r"rrrr!�s
z#EUCJPDistributionAnalysis.get_order)r-r.r/rr!rr)r2rrH�srHN)Z	euctwfreqrrrZ	euckrfreqrrrZ
gb2312freqrr	r
Zbig5freqrrr
Zjisfreqrrr�objectrr0r7r9r;r@rHrrrr�<module>sI

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 799 B 0644
__init__.cpython-35.pyc File 799 B 0644
big5freq.cpython-35.opt-1.pyc File 53.36 KB 0644
big5freq.cpython-35.pyc File 53.36 KB 0644
big5prober.cpython-35.opt-1.pyc File 1.04 KB 0644
big5prober.cpython-35.pyc File 1.04 KB 0644
chardistribution.cpython-35.opt-1.pyc File 6.45 KB 0644
chardistribution.cpython-35.pyc File 6.45 KB 0644
charsetgroupprober.cpython-35.opt-1.pyc File 2.27 KB 0644
charsetgroupprober.cpython-35.pyc File 2.27 KB 0644
charsetprober.cpython-35.opt-1.pyc File 3.46 KB 0644
charsetprober.cpython-35.pyc File 3.46 KB 0644
codingstatemachine.cpython-35.opt-1.pyc File 2.82 KB 0644
codingstatemachine.cpython-35.pyc File 2.82 KB 0644
compat.cpython-35.opt-1.pyc File 293 B 0644
compat.cpython-35.pyc File 293 B 0644
cp949prober.cpython-35.opt-1.pyc File 1.05 KB 0644
cp949prober.cpython-35.pyc File 1.05 KB 0644
enums.cpython-35.opt-1.pyc File 2.59 KB 0644
enums.cpython-35.pyc File 2.59 KB 0644
escprober.cpython-35.opt-1.pyc File 2.65 KB 0644
escprober.cpython-35.pyc File 2.65 KB 0644
escsm.cpython-35.opt-1.pyc File 7.63 KB 0644
escsm.cpython-35.pyc File 7.63 KB 0644
eucjpprober.cpython-35.opt-1.pyc File 2.45 KB 0644
eucjpprober.cpython-35.pyc File 2.45 KB 0644
euckrfreq.cpython-35.opt-1.pyc File 23.46 KB 0644
euckrfreq.cpython-35.pyc File 23.46 KB 0644
euckrprober.cpython-35.opt-1.pyc File 1.05 KB 0644
euckrprober.cpython-35.pyc File 1.05 KB 0644
euctwfreq.cpython-35.opt-1.pyc File 53.36 KB 0644
euctwfreq.cpython-35.pyc File 53.36 KB 0644
euctwprober.cpython-35.opt-1.pyc File 1.05 KB 0644
euctwprober.cpython-35.pyc File 1.05 KB 0644
gb2312freq.cpython-35.opt-1.pyc File 37.39 KB 0644
gb2312freq.cpython-35.pyc File 37.39 KB 0644
gb2312prober.cpython-35.opt-1.pyc File 1.05 KB 0644
gb2312prober.cpython-35.pyc File 1.05 KB 0644
hebrewprober.cpython-35.opt-1.pyc File 3.06 KB 0644
hebrewprober.cpython-35.pyc File 3.06 KB 0644
jisfreq.cpython-35.opt-1.pyc File 43.39 KB 0644
jisfreq.cpython-35.pyc File 43.39 KB 0644
jpcntx.cpython-35.opt-1.pyc File 24.15 KB 0644
jpcntx.cpython-35.pyc File 24.15 KB 0644
langbulgarianmodel.cpython-35.opt-1.pyc File 24.25 KB 0644
langbulgarianmodel.cpython-35.pyc File 24.25 KB 0644
langcyrillicmodel.cpython-35.opt-1.pyc File 29.78 KB 0644
langcyrillicmodel.cpython-35.pyc File 29.78 KB 0644
langgreekmodel.cpython-35.opt-1.pyc File 23.94 KB 0644
langgreekmodel.cpython-35.pyc File 23.94 KB 0644
langhebrewmodel.cpython-35.opt-1.pyc File 22.79 KB 0644
langhebrewmodel.cpython-35.pyc File 22.79 KB 0644
langhungarianmodel.cpython-35.opt-1.pyc File 24.23 KB 0644
langhungarianmodel.cpython-35.pyc File 24.23 KB 0644
langthaimodel.cpython-35.opt-1.pyc File 22.77 KB 0644
langthaimodel.cpython-35.pyc File 22.77 KB 0644
langturkishmodel.cpython-35.opt-1.pyc File 22.79 KB 0644
langturkishmodel.cpython-35.pyc File 22.79 KB 0644
latin1prober.cpython-35.opt-1.pyc File 3.15 KB 0644
latin1prober.cpython-35.pyc File 3.15 KB 0644
mbcharsetprober.cpython-35.opt-1.pyc File 2.26 KB 0644
mbcharsetprober.cpython-35.pyc File 2.26 KB 0644
mbcsgroupprober.cpython-35.opt-1.pyc File 1.06 KB 0644
mbcsgroupprober.cpython-35.pyc File 1.06 KB 0644
mbcssm.cpython-35.opt-1.pyc File 18.36 KB 0644
mbcssm.cpython-35.pyc File 18.36 KB 0644
sbcharsetprober.cpython-35.opt-1.pyc File 3.06 KB 0644
sbcharsetprober.cpython-35.pyc File 3.06 KB 0644
sbcsgroupprober.cpython-35.opt-1.pyc File 1.6 KB 0644
sbcsgroupprober.cpython-35.pyc File 1.6 KB 0644
sjisprober.cpython-35.opt-1.pyc File 2.48 KB 0644
sjisprober.cpython-35.pyc File 2.48 KB 0644
universaldetector.cpython-35.opt-1.pyc File 6.19 KB 0644
universaldetector.cpython-35.pyc File 6.19 KB 0644
utf8prober.cpython-35.opt-1.pyc File 1.96 KB 0644
utf8prober.cpython-35.pyc File 1.96 KB 0644
version.cpython-35.opt-1.pyc File 351 B 0644
version.cpython-35.pyc File 351 B 0644