Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/chardet/cp949prober.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
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
1######################## BEGIN LICENSE BLOCK ########################
2# The Original Code is mozilla.org 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) 1998
7# the Initial Developer. All Rights Reserved.
8#
9# Contributor(s):
10# Mark Pilgrim - port to Python
11#
12# This library is free software; you can redistribute it and/or
13# modify it under the terms of the GNU Lesser General Public
14# License as published by the Free Software Foundation; either
15# version 2.1 of the License, or (at your option) any later version.
16#
17# This library is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# Lesser General Public License for more details.
21#
22# You should have received a copy of the GNU Lesser General Public
23# License along with this library; if not, see
24# <https://www.gnu.org/licenses/>.
25######################### END LICENSE BLOCK #########################
27from .chardistribution import EUCKRDistributionAnalysis
28from .codingstatemachine import CodingStateMachine
29from .mbcharsetprober import MultiByteCharSetProber
30from .mbcssm import CP949_SM_MODEL
33class CP949Prober(MultiByteCharSetProber):
34 def __init__(self) -> None:
35 super().__init__()
36 self.coding_sm = CodingStateMachine(CP949_SM_MODEL)
37 # NOTE: CP949 is a superset of EUC-KR, so the distribution should be
38 # not different.
39 self.distribution_analyzer = EUCKRDistributionAnalysis()
40 self.reset()
42 @property
43 def charset_name(self) -> str:
44 return "CP949"
46 @property
47 def language(self) -> str:
48 return "Korean"