7#include "CharDistribution.h"
9#include "tables/Big5Freq.tab"
10#include "tables/EUCKRFreq.tab"
11#include "tables/GB2312Freq.tab"
12#include "tables/JISFreq.tab"
17namespace kencodingprober
20float CharDistributionAnalysis::GetConfidence()
23 if (mTotalChars == 0) {
27 if (mTotalChars != mFreqChars) {
28 float r = mFreqChars / ((mTotalChars - mFreqChars) * mTypicalDistributionRatio);
38EUCKRDistributionAnalysis::EUCKRDistributionAnalysis()
40 mCharToFreqOrder = EUCKRCharToFreqOrder;
41 mTableSize = EUCKR_TABLE_SIZE;
42 mTypicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO;
45GB2312DistributionAnalysis::GB2312DistributionAnalysis()
47 mCharToFreqOrder = GB2312CharToFreqOrder;
48 mTableSize = GB2312_TABLE_SIZE;
49 mTypicalDistributionRatio = GB2312_TYPICAL_DISTRIBUTION_RATIO;
52Big5DistributionAnalysis::Big5DistributionAnalysis()
54 mCharToFreqOrder = Big5CharToFreqOrder;
55 mTableSize = BIG5_TABLE_SIZE;
56 mTypicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO;
59SJISDistributionAnalysis::SJISDistributionAnalysis()
61 mCharToFreqOrder = JISCharToFreqOrder;
62 mTableSize = JIS_TABLE_SIZE;
63 mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO;
66EUCJPDistributionAnalysis::EUCJPDistributionAnalysis()
68 mCharToFreqOrder = JISCharToFreqOrder;
69 mTableSize = JIS_TABLE_SIZE;
70 mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO;
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:08 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.