Files
old-nlp/venv/lib/python3.7/site-packages/chardet/__pycache__/chardistribution.cpython-37.pyc

16 lines
6.1 KiB
Plaintext
Raw Normal View History

2019-10-20 13:16:49 +02:00
B
T%<25>]<5D>$<00>@s<>ddlmZmZmZddlmZmZmZddlm Z m
Z
m Z ddl m Z mZmZddlmZmZmZGdd<07>de<14>ZGdd <09>d e<15>ZGd
d <0B>d e<15>ZGd d <0A>d e<15>ZGdd<0F>de<15>ZGdd<11>de<15>ZGdd<13>de<15>ZdS)<15>)<03>EUCTW_CHAR_TO_FREQ_ORDER<45>EUCTW_TABLE_SIZE<5A> EUCTW_TYPICAL_DISTRIBUTION_RATIO)<03>EUCKR_CHAR_TO_FREQ_ORDER<45>EUCKR_TABLE_SIZE<5A> EUCKR_TYPICAL_DISTRIBUTION_RATIO)<03>GB2312_CHAR_TO_FREQ_ORDER<45>GB2312_TABLE_SIZE<5A>!GB2312_TYPICAL_DISTRIBUTION_RATIO)<03>BIG5_CHAR_TO_FREQ_ORDER<45>BIG5_TABLE_SIZE<5A>BIG5_TYPICAL_DISTRIBUTION_RATIO)<03>JIS_CHAR_TO_FREQ_ORDER<45>JIS_TABLE_SIZE<5A>JIS_TYPICAL_DISTRIBUTION_RATIOc@sLeZdZdZdZdZdZdd<06>Zdd<08>Zd d
<EFBFBD>Z d d <0C>Z
d d<0E>Z dd<10>Z dS)<12>CharDistributionAnalysisig<>G<EFBFBD>z<14><>?g{<14>G<EFBFBD>z<EFBFBD>?<3F>cCs0d|_d|_d|_d|_d|_d|_|<00><06>dS)N)<07>_char_to_freq_order<65> _table_size<7A>typical_distribution_ratio<69>_done<6E> _total_chars<72> _freq_chars<72>reset)<01>self<6C>r<00>=/tmp/pip-install-_zqls8j0/chardet/chardet/chardistribution.py<70>__init__.sz!CharDistributionAnalysis.__init__cCsd|_d|_d|_dS)zreset analyser, clear any stateF<65>N)rrr)rrrrr=szCharDistributionAnalysis.resetcCsX|dkr|<00>|<01>}nd}|dkrT|jd7_||jkrTd|j|krT|jd7_dS)z"feed a character with known length<74><00><><EFBFBD><EFBFBD><EFBFBD>rriN)<05> get_orderrrrr)r<00>char<61>char_len<65>orderrrr<00>feedFs 
zCharDistributionAnalysis.feedcCsT|jdks|j|jkr|jS|j|jkrN|j|j|j|j}||jkrN|S|jS)z(return confidence based on existing datar)rr<00>MINIMUM_DATA_THRESHOLD<4C>SURE_NOr<00>SURE_YES)r<00>rrrr<00>get_confidenceTs 

z'CharDistributionAnalysis.get_confidencecCs |j|jkS)N)r<00>ENOUGH_DATA_THRESHOLD)rrrr<00>got_enough_datadsz(CharDistributionAnalysis.got_enough_datacCsdS)Nr r)r<00>byte_strrrrr!isz"CharDistributionAnalysis.get_orderN) <0A>__name__<5F>
__module__<EFBFBD> __qualname__r+r(r'r&rrr%r*r,r!rrrrr(s rcs$eZdZ<02>fdd<02>Zdd<04>Z<04>ZS)<05>EUCTWDistributionAnalysiscs$tt|<00><02><02>t|_t|_t|_dS)N) <09>superr1rrrrrrr)r)<01> __class__rrrrsz"EUCTWDistributionAnalysis.__init__cCs0|d}|dkr(d|d|ddSdSdS)Nr<00><><00>^r<00><>r r)rr-<00>
first_charrrrr!xsz#EUCTWDistributionAnalysis.get_order)r.r/r0rr!<00> __classcell__rr)r3rr1qs r1cs$eZdZ<02>fdd<02>Zdd<04>Z<04>ZS)<05>EUCKRDistributionAnalysiscs$tt|<00><02><02>t|_t|_t|_dS)N) r2r9rrrrrrr)r)r3rrr<00>sz"EUCKRDistributionAnalysis.__init__cCs0|d}|dkr(d|d|ddSdSdS)Nr<00><>r5rr6r r)rr-r7rrrr!<00>sz#EUCKRDistributionAnalysis.get_order)r.r/r0rr!r8rr)r3rr9<00>s r9cs$eZdZ<02>fdd<02>Zdd<04>Z<04>ZS)<05>GB2312DistributionAnalysiscs$tt|<00><02><02>t|_t|_t|_dS)N) r2r;rrrr rr
r)r)r3rrr<00>sz#GB2312DistributionAnalysis.__init__cCs>|d|d}}|dkr6|dkr6d|d|dSdSdS)Nrrr:r6r5r r)rr-r7<00> second_charrrrr!<00>sz$GB2312DistributionAnalysis.get_order)r.r/r0rr!r8rr)r3rr;<00>s r;cs$eZdZ<02>fdd<02>Zdd<04>Z<04>ZS)<05>Big5DistributionAnalysiscs$tt|<00><02><02>t|_t|_t|_dS)N) r2r=rr rr rr r)r)r3rrr<00>sz!Big5DistributionAnalysis.__init__cCsX|d|d}}|dkrP|dkr:d|d|ddSd|d|dSndSdS) Nrr<00><>r6<00><><00>?<00>@r r)rr-r7r<rrrr!<00>s z"Big5DistributionAnalysis.get_order)r.r/r0rr!r8rr)r3rr=<00>s r=cs$eZdZ<02>fdd<02>Zdd<04>Z<04>ZS)<05>SJISDistributionAnalysiscs$tt|<00><02><02>t|_t|_t|_dS)N) r2rBrrrrrrr)r)r3rrr<00>sz!SJISDistributionAnalysis.__init__cCsr|d|d}}|dkr0|dkr0d|d}n&|dkrR|dkrRd|dd}nd S||d
}|d krnd }|S) Nrr<00><><00><><00><><00><><00><><00>r rA<00>r)rr-r7r<r$rrrr!<00>s z"SJISDistributionAnalysis.get_order)r.r/r0rr!r8rr)r3rrB<00>s rBcs$eZdZ<02>fdd<02>Zdd<04>Z<04>ZS)<05>EUCJPDistributionAnalysiscs$tt|<00><02><02>t|_t|_t|_dS)N) r2rJrrrrrrr)r)r3rrr<00>sz"EUCJPDistributionAnalysis.__init__cCs0|d}|dkr(d|d|ddSdSdS)Nr<00><>r5r6rr r)rr-r"rrrr!<00>sz#EUCJPDistributionAnalysis.get_order)r.r/r0rr!r8rr)r3rrJ<00>s rJN)<1C> euctwfreqrrr<00> euckrfreqrrr<00>
gb2312freqrr r
<00>big5freqr r r <00>jisfreqrrr<00>objectrr1r9r;r=rBrJrrrr<00><module>sI