7#include "JapaneseGroupProber.h"
12namespace kencodingprober
15static const char *
const ProberName[] = {
23JapaneseGroupProber::JapaneseGroupProber()
25 mProbers[0] =
new UnicodeGroupProber();
26 mProbers[1] =
new nsSJISProber();
27 mProbers[2] =
new nsEUCJPProber();
31JapaneseGroupProber::~JapaneseGroupProber()
33 for (
unsigned int i = 0; i < JP_NUM_OF_PROBERS; i++) {
38const char *JapaneseGroupProber::GetCharSetName()
40 if (mBestGuess == -1) {
42 if (mBestGuess == -1) {
46 return mProbers[mBestGuess]->GetCharSetName();
49void JapaneseGroupProber::Reset(
void)
52 for (
unsigned int i = 0; i < JP_NUM_OF_PROBERS; i++) {
65nsProbingState JapaneseGroupProber::HandleData(
const char *aBuf,
unsigned int aLen)
74 hptr = highbyteBuf = (
char *)malloc(aLen);
78 for (i = 0; i < aLen; ++i) {
91 for (i = 0; i < JP_NUM_OF_PROBERS; ++i) {
95 st = mProbers[i]->HandleData(highbyteBuf, hptr - highbyteBuf);
100 }
else if (st == eNotMe) {
101 mIsActive[i] =
false;
103 if (mActiveNum == 0) {
115float JapaneseGroupProber::GetConfidence(
void)
118 float bestConf = 0.0;
127 for (i = 0; i < JP_NUM_OF_PROBERS; ++i) {
131 cf = mProbers[i]->GetConfidence();
142void JapaneseGroupProber::DumpStatus()
148 for (i = 0; i < JP_NUM_OF_PROBERS; i++) {
150 printf(
" Chinese group inactive: [%s] (confidence is too low).\r\n", ProberName[i]);
152 cf = mProbers[i]->GetConfidence();
153 printf(
" Chinese group %1.3f: [%s]\r\n", cf, ProberName[i]);
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:08:36 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.