Path: blob/master/thirdparty/chardet/euckrprober.py
2992 views
######################## BEGIN LICENSE BLOCK ########################1# The Original Code is mozilla.org code.2#3# The Initial Developer of the Original Code is4# Netscape Communications Corporation.5# Portions created by the Initial Developer are Copyright (C) 19986# the Initial Developer. All Rights Reserved.7#8# Contributor(s):9# Mark Pilgrim - port to Python10#11# This library is free software; you can redistribute it and/or12# modify it under the terms of the GNU Lesser General Public13# License as published by the Free Software Foundation; either14# version 2.1 of the License, or (at your option) any later version.15#16# This library is distributed in the hope that it will be useful,17# but WITHOUT ANY WARRANTY; without even the implied warranty of18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU19# Lesser General Public License for more details.20#21# You should have received a copy of the GNU Lesser General Public22# License along with this library; if not, write to the Free Software23# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA24# 02110-1301 USA25######################### END LICENSE BLOCK #########################2627from .mbcharsetprober import MultiByteCharSetProber28from .codingstatemachine import CodingStateMachine29from .chardistribution import EUCKRDistributionAnalysis30from .mbcssm import EUCKR_SM_MODEL313233class EUCKRProber(MultiByteCharSetProber):34def __init__(self):35super(EUCKRProber, self).__init__()36self.coding_sm = CodingStateMachine(EUCKR_SM_MODEL)37self.distribution_analyzer = EUCKRDistributionAnalysis()38self.reset()3940@property41def charset_name(self):42return "EUC-KR"4344@property45def language(self):46return "Korean"474849