Path: blob/master/thirdparty/chardet/mbcsgroupprober.py
2992 views
######################## BEGIN LICENSE BLOCK ########################1# The Original Code is Mozilla Universal charset detector code.2#3# The Initial Developer of the Original Code is4# Netscape Communications Corporation.5# Portions created by the Initial Developer are Copyright (C) 20016# the Initial Developer. All Rights Reserved.7#8# Contributor(s):9# Mark Pilgrim - port to Python10# Shy Shalom - original C code11# Proofpoint, Inc.12#13# This library is free software; you can redistribute it and/or14# modify it under the terms of the GNU Lesser General Public15# License as published by the Free Software Foundation; either16# version 2.1 of the License, or (at your option) any later version.17#18# This library is distributed in the hope that it will be useful,19# but WITHOUT ANY WARRANTY; without even the implied warranty of20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU21# Lesser General Public License for more details.22#23# You should have received a copy of the GNU Lesser General Public24# License along with this library; if not, write to the Free Software25# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA26# 02110-1301 USA27######################### END LICENSE BLOCK #########################2829from .charsetgroupprober import CharSetGroupProber30from .utf8prober import UTF8Prober31from .sjisprober import SJISProber32from .eucjpprober import EUCJPProber33from .gb2312prober import GB2312Prober34from .euckrprober import EUCKRProber35from .cp949prober import CP949Prober36from .big5prober import Big5Prober37from .euctwprober import EUCTWProber383940class MBCSGroupProber(CharSetGroupProber):41def __init__(self, lang_filter=None):42super(MBCSGroupProber, self).__init__(lang_filter=lang_filter)43self.probers = [44UTF8Prober(),45SJISProber(),46EUCJPProber(),47GB2312Prober(),48EUCKRProber(),49CP949Prober(),50Big5Prober(),51EUCTWProber()52]53self.reset()545556