1 ######################## BEGIN LICENSE BLOCK ########################
2 # The Original Code is mozilla.org code.
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.
10 # Mark Pilgrim - port to Python
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.
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.
22 # You should have received a copy of the GNU Lesser General Public
23 # License along with this library; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 ######################### END LICENSE BLOCK #########################
28 from .chardistribution
import GB2312DistributionAnalysis
29 from .codingstatemachine
import CodingStateMachine
30 from .mbcharsetprober
import MultiByteCharSetProber
31 from .mbcssm
import GB2312_SM_MODEL
34 class GB2312Prober(MultiByteCharSetProber
):
35 def __init__(self
) -> None:
37 self
.coding_sm
= CodingStateMachine(GB2312_SM_MODEL
)
38 self
.distribution_analyzer
= GB2312DistributionAnalysis()
42 def charset_name(self
) -> str:
46 def language(self
) -> str: