7#ifndef NSSBCHARSETPROBER_H
8#define NSSBCHARSETPROBER_H
10#include "nsCharSetProber.h"
13#define SB_ENOUGH_REL_THRESHOLD 1024
14#define POSITIVE_SHORTCUT_THRESHOLD (float)0.95
15#define NEGATIVE_SHORTCUT_THRESHOLD (float)0.05
16#define SYMBOL_CAT_ORDER 250
17#define NUMBER_OF_SEQ_CAT 4
18#define POSITIVE_CAT (NUMBER_OF_SEQ_CAT - 1)
21namespace kencodingprober
24 const unsigned char *charToOrderMap;
25 const char *precedenceMatrix;
26 float mTypicalPositiveRatio;
27 bool keepEnglishLetter;
28 const char *charsetName;
31class KCODECS_NO_EXPORT nsSingleByteCharSetProber :
public nsCharSetProber
34 explicit nsSingleByteCharSetProber(
const SequenceModel *model)
37 , mNameProber(nullptr)
41 nsSingleByteCharSetProber(
const SequenceModel *model,
bool reversed, nsCharSetProber *nameProber)
44 , mNameProber(nameProber)
49 const char *GetCharSetName()
override;
50 nsProbingState HandleData(
const char *aBuf,
unsigned int aLen)
override;
51 nsProbingState GetState(
void)
override
55 void Reset(
void)
override;
56 float GetConfidence(
void)
override;
57 void SetOpion()
override
67 bool KeepEnglishLetters()
69 return mModel->keepEnglishLetter;
73 void DumpStatus()
override;
77 nsProbingState mState;
78 const SequenceModel *mModel;
82 unsigned char mLastOrder;
84 unsigned int mTotalSeqs;
85 unsigned int mSeqCounters[NUMBER_OF_SEQ_CAT];
87 unsigned int mTotalChar;
89 unsigned int mFreqChar;
92 nsCharSetProber *mNameProber;
95extern const SequenceModel Koi8rModel;
96extern const SequenceModel Win1251Model;
97extern const SequenceModel Latin5Model;
98extern const SequenceModel MacCyrillicModel;
99extern const SequenceModel Ibm866Model;
100extern const SequenceModel Ibm855Model;
101extern const SequenceModel Latin7Model;
102extern const SequenceModel Win1253Model;
103extern const SequenceModel Latin5BulgarianModel;
104extern const SequenceModel Win1251BulgarianModel;
105extern const SequenceModel Latin2HungarianModel;
106extern const SequenceModel Win1250HungarianModel;
107extern const SequenceModel Win1255Model;
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:52 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.