Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/chardet/mbcsgroupprober.py: 94%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

17 statements  

1######################## BEGIN LICENSE BLOCK ######################## 

2# The Original Code is Mozilla Universal charset detector code. 

3# 

4# The Initial Developer of the Original Code is 

5# Netscape Communications Corporation. 

6# Portions created by the Initial Developer are Copyright (C) 2001 

7# the Initial Developer. All Rights Reserved. 

8# 

9# Contributor(s): 

10# Mark Pilgrim - port to Python 

11# Shy Shalom - original C code 

12# Proofpoint, Inc. 

13# 

14# This library is free software; you can redistribute it and/or 

15# modify it under the terms of the GNU Lesser General Public 

16# License as published by the Free Software Foundation; either 

17# version 2.1 of the License, or (at your option) any later version. 

18# 

19# This library is distributed in the hope that it will be useful, 

20# but WITHOUT ANY WARRANTY; without even the implied warranty of 

21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 

22# Lesser General Public License for more details. 

23# 

24# You should have received a copy of the GNU Lesser General Public 

25# License along with this library; if not, see 

26# <https://www.gnu.org/licenses/>. 

27######################### END LICENSE BLOCK ######################### 

28 

29from .big5prober import Big5Prober 

30from .charsetgroupprober import CharSetGroupProber 

31from .cp949prober import CP949Prober 

32from .enums import LanguageFilter 

33from .eucjpprober import EUCJPProber 

34from .euckrprober import EUCKRProber 

35from .euctwprober import EUCTWProber 

36from .gb2312prober import GB2312Prober 

37from .johabprober import JOHABProber 

38from .sjisprober import SJISProber 

39from .utf8prober import UTF8Prober 

40 

41 

42class MBCSGroupProber(CharSetGroupProber): 

43 def __init__(self, lang_filter: LanguageFilter = LanguageFilter.NONE) -> None: 

44 super().__init__(lang_filter=lang_filter) 

45 self.probers = [ 

46 UTF8Prober(), 

47 SJISProber(), 

48 EUCJPProber(), 

49 GB2312Prober(), 

50 EUCKRProber(), 

51 CP949Prober(), 

52 Big5Prober(), 

53 EUCTWProber(), 

54 JOHABProber(), 

55 ] 

56 self.reset()