#include <JpCntx.h>
Protected Member Functions | |
PRInt32 | GetOrder (const char *str, PRUint32 *charLen) |
PRInt32 | GetOrder (const char *str) |
Definition at line 105 of file JpCntx.h.
PRInt32 SJISContextAnalysis::GetOrder | ( | const char * | str | ) | [inline, protected, virtual] |
Implements JapaneseContextAnalysis.
Implements JapaneseContextAnalysis.
Definition at line 194 of file JpCntx.cpp.
00195 { 00196 //find out current char's byte length 00197 if (((unsigned char)*str >= (unsigned char)0x81 && (unsigned char)*str <= (unsigned char)0x9f) || 00198 ((unsigned char)*str >= (unsigned char)0xe0 && (unsigned char)*str <= (unsigned char)0xfc )) 00199 *charLen = 2; 00200 else 00201 *charLen = 1; 00202 00203 //return its order if it is hiragana 00204 if (*str == '\202' && 00205 (unsigned char)*(str+1) >= (unsigned char)0x9f && 00206 (unsigned char)*(str+1) <= (unsigned char)0xf1) 00207 return (unsigned char)*(str+1) - (unsigned char)0x9f; 00208 return -1; 00209 }