관리-도구
편집 파일: sjisprober.cpython-35.pyc
��Re� � @ s� d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z m Z Gd d � d e � Z d S) � )�MultiByteCharSetProber)�CodingStateMachine)�SJISDistributionAnalysis)�SJISContextAnalysis)� SJIS_SM_MODEL)�ProbingState�MachineStatec sp e Z d Z � f d d � Z � f d d � Z e d d � � Z e d d � � Z d d � Z d d � Z � S) � SJISProberc sH t t | � j � t t � | _ t � | _ t � | _ | j � d S)N)�superr �__init__r r � coding_smr �distribution_analyzerr �context_analyzer�reset)�self)� __class__� ��/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/chardet/sjisprober.pyr % s zSJISProber.__init__c s$ t t | � j � | j j � d S)N)r r r r )r )r r r r , s zSJISProber.resetc C s | j j S)N)r �charset_name)r r r r r 0 s zSJISProber.charset_namec C s d S)N�Japaneser )r r r r �language4 s zSJISProber.languagec C s� xWt t | � � D]C} | j j | | � } | t j k rm | j j d | j | j | � t j | _ Pq | t j k r� t j | _ Pq | t j k r | j j � } | d k r| d | j d <| j j | j d | d � | � | j j | j | � q | j j | | d | | d | � | � | j j | | d | d � | � q W| d | j d <| j t j k r�| j j � r�| j � | j k r�t j | _ | j S)Nz!%s %s prober hit error at byte %s� r � � ���)�range�lenr � next_stater �ERROR�logger�debugr r r �NOT_ME�_state�ITS_ME�FOUND_IT�START�get_current_charlen� _last_charr �feedr �state� DETECTING�got_enough_data�get_confidence�SHORTCUT_THRESHOLD)r �byte_str�i�coding_state�char_lenr r r r( 8 s6 zSJISProber.feedc C s+ | j j � } | j j � } t | | � S)N)r r, r �max)r �context_conf�distrib_confr r r r, Y s zSJISProber.get_confidence) �__name__� __module__�__qualname__r r �propertyr r r( r, r r )r r r $ s !r N)�mbcharsetproberr �codingstatemachiner �chardistributionr �jpcntxr �mbcssmr �enumsr r r r r r r �<module> s