#include <CharDistribution.h>
Public Member Functions | |
SJISDistributionAnalysis () | |
Protected Member Functions | |
PRInt32 | GetOrder (const char *str) |
Definition at line 196 of file CharDistribution.h.
SJISDistributionAnalysis::SJISDistributionAnalysis | ( | ) |
Definition at line 98 of file CharDistribution.cpp.
References CharDistributionAnalysis::mCharToFreqOrder, CharDistributionAnalysis::mTableSize, and CharDistributionAnalysis::mTypicalDistributionRatio.
00099 { 00100 mCharToFreqOrder = JISCharToFreqOrder; 00101 mTableSize = JIS_TABLE_SIZE; 00102 mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO; 00103 }
PRInt32 SJISDistributionAnalysis::GetOrder | ( | const char * | str | ) | [inline, protected, virtual] |
Reimplemented from CharDistributionAnalysis.
Definition at line 205 of file CharDistribution.h.
00206 { 00207 PRInt32 order; 00208 if ((unsigned char)*str >= (unsigned char)0x81 && (unsigned char)*str <= (unsigned char)0x9f) 00209 order = 188 * ((unsigned char)str[0]-(unsigned char)0x81); 00210 else if ((unsigned char)*str >= (unsigned char)0xe0 && (unsigned char)*str <= (unsigned char)0xef) 00211 order = 188 * ((unsigned char)str[0]-(unsigned char)0xe0 + 31); 00212 else 00213 return -1; 00214 order += (unsigned char)*(str+1) - 0x40; 00215 if ((unsigned char)str[1] > (unsigned char)0x7f) 00216 order--; 00217 return order; 00218 };