fix lowercase

This commit is contained in:
PyYoshi 2012-07-07 11:13:39 +09:00
parent d360ee9576
commit 0627b9183a
14 changed files with 17 additions and 16 deletions

View file

@ -195,15 +195,15 @@ float JapaneseContextAnalysis::GetConfidence(void)
PRInt32 SJISContextAnalysis::GetOrder(const char* str, PRUint32 *charLen) PRInt32 SJISContextAnalysis::GetOrder(const char* str, PRUint32 *charLen)
{ {
//find out current char's byte length //find out current char's byte length
if ((unsigned char)*str >= (unsigned char)0x81 && (unsigned char)*str <= (unsigned char)0x9f || if ((unsigned char)*str >= (unsigned char)0x81 && (unsigned char)*str <= (unsigned char)0x9f ||
(unsigned char)*str >= (unsigned char)0xe0 && (unsigned char)*str <= (unsigned char)0xfc ) (unsigned char)*str >= (unsigned char)0xe0 && (unsigned char)*str <= (unsigned char)0xfc )
*charLen = 2; *charLen = 2;
else else
*charLen = 1; *charLen = 1;
//return its order if it is hiragana //return its order if it is hiragana
if (*str == '\202' && if (*str == '\202' &&
(unsigned char)*(str+1) >= (unsigned char)0x9f && (unsigned char)*(str+1) >= (unsigned char)0x9f &&
(unsigned char)*(str+1) <= (unsigned char)0xf1) (unsigned char)*(str+1) <= (unsigned char)0xf1)
return (unsigned char)*(str+1) - (unsigned char)0x9f; return (unsigned char)*(str+1) - (unsigned char)0x9f;
return -1; return -1;

View file

@ -242,6 +242,6 @@ const SequenceModel Win1251BulgarianModel =
BulgarianLangModel, BulgarianLangModel,
(float)0.969392, (float)0.969392,
PR_FALSE, PR_FALSE,
"windows-1251", "WINDOWS-1251",
"Bulgarian" "Bulgarian"
}; };

View file

@ -316,7 +316,7 @@ const SequenceModel Win1251Model =
RussianLangModel, RussianLangModel,
(float)0.976601, (float)0.976601,
PR_FALSE, PR_FALSE,
"windows-1251", "WINDOWS-1251",
"Russian" "Russian"
}; };

View file

@ -195,6 +195,6 @@ const SequenceModel iso_8859_2czechModel =
czechLangModel, czechLangModel,
(float)0.968107, (float)0.968107,
PR_TRUE, PR_TRUE,
"iso-8859-2", "ISO-8859-2",
"czech" "czech"
}; };

View file

@ -214,7 +214,7 @@ const SequenceModel Win1255Model =
HebrewLangModel, HebrewLangModel,
(float)0.984004, (float)0.984004,
PR_FALSE, PR_FALSE,
"windows-1255", "WINDOWS-1255",
"Hebrew" "Hebrew"
}; };

View file

@ -239,6 +239,6 @@ const SequenceModel Win1250HungarianModel =
HungarianLangModel, HungarianLangModel,
(float)0.965178, (float)0.965178,
PR_TRUE, PR_TRUE,
"windows-1250", "WINDOWS-1250",
"hungarian" "hungarian"
}; };

View file

@ -195,6 +195,6 @@ const SequenceModel iso_8859_2polishModel =
polishLangModel, polishLangModel,
(float)0.974309, (float)0.974309,
PR_TRUE, PR_TRUE,
"iso-8859-2", "ISO-8859-2",
"polish" "polish"
}; };

View file

@ -195,6 +195,6 @@ const SequenceModel windows_1252spanishModel =
spanishLangModel, spanishLangModel,
(float)0.983906, (float)0.983906,
PR_TRUE, PR_TRUE,
"windows-1252", "WINDOWS-1252",
"spanish" "spanish"
}; };

View file

@ -50,7 +50,8 @@ public:
Reset();} Reset();}
virtual ~nsEUCTWProber(void){delete mCodingSM;} virtual ~nsEUCTWProber(void){delete mCodingSM;}
nsProbingState HandleData(const char* aBuf, PRUint32 aLen); nsProbingState HandleData(const char* aBuf, PRUint32 aLen);
const char* GetCharSetName() {return "x-euc-tw";} const char* GetCharSetName() {return "EUC-TW";}
//const char* GetCharSetName() {return "x-euc-tw";}
nsProbingState GetState(void) {return mState;} nsProbingState GetState(void) {return mState;}
void Reset(void); void Reset(void);
float GetConfidence(void); float GetConfidence(void);

View file

@ -52,7 +52,7 @@ public:
Reset();} Reset();}
virtual ~nsGB18030Prober(void){delete mCodingSM;} virtual ~nsGB18030Prober(void){delete mCodingSM;}
nsProbingState HandleData(const char* aBuf, PRUint32 aLen); nsProbingState HandleData(const char* aBuf, PRUint32 aLen);
const char* GetCharSetName() {return "gb18030";} const char* GetCharSetName() {return "GB18030";}
nsProbingState GetState(void) {return mState;} nsProbingState GetState(void) {return mState;}
void Reset(void); void Reset(void);
float GetConfidence(void); float GetConfidence(void);

View file

@ -59,7 +59,7 @@
#define MIN_MODEL_DISTANCE (0.01) #define MIN_MODEL_DISTANCE (0.01)
#define VISUAL_HEBREW_NAME ("ISO-8859-8") #define VISUAL_HEBREW_NAME ("ISO-8859-8")
#define LOGICAL_HEBREW_NAME ("windows-1255") #define LOGICAL_HEBREW_NAME ("WINDOWS-1255")
PRBool nsHebrewProber::isFinal(char c) PRBool nsHebrewProber::isFinal(char c)
{ {

View file

@ -48,7 +48,7 @@ public:
nsLatin1Prober(void){Reset();} nsLatin1Prober(void){Reset();}
virtual ~nsLatin1Prober(void){} virtual ~nsLatin1Prober(void){}
nsProbingState HandleData(const char* aBuf, PRUint32 aLen); nsProbingState HandleData(const char* aBuf, PRUint32 aLen);
const char* GetCharSetName() {return "windows-1252";} const char* GetCharSetName() {return "WINDOWS-1252";}
nsProbingState GetState(void) {return mState;} nsProbingState GetState(void) {return mState;}
void Reset(void); void Reset(void);
float GetConfidence(void); float GetConfidence(void);

View file

@ -430,7 +430,7 @@ const SMModel SJISSMModel = {
6, 6,
{eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, SJIS_st }, {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, SJIS_st },
SJISCharLenTable, SJISCharLenTable,
"Shift_JIS", "SHIFT_JIS",
}; };

View file

@ -57,7 +57,7 @@ public:
Reset();} Reset();}
virtual ~nsSJISProber(void){delete mCodingSM;} virtual ~nsSJISProber(void){delete mCodingSM;}
nsProbingState HandleData(const char* aBuf, PRUint32 aLen); nsProbingState HandleData(const char* aBuf, PRUint32 aLen);
const char* GetCharSetName() {return "Shift_JIS";} const char* GetCharSetName() {return "SHIFT_JIS";}
nsProbingState GetState(void) {return mState;} nsProbingState GetState(void) {return mState;}
void Reset(void); void Reset(void);
float GetConfidence(void); float GetConfidence(void);