OLD | NEW |
1 /* | 1 /* |
2 ********************************************************************** | 2 ********************************************************************** |
3 * Copyright (C) 2005-2013, International Business Machines | 3 * Copyright (C) 2005-2015, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ********************************************************************** | 5 ********************************************************************** |
6 */ | 6 */ |
7 | 7 |
8 #ifndef __CSRSBCS_H | 8 #ifndef __CSRSBCS_H |
9 #define __CSRSBCS_H | 9 #define __CSRSBCS_H |
10 | 10 |
11 #include "unicode/uobject.h" | 11 #include "unicode/uobject.h" |
12 | 12 |
13 #if !UCONFIG_NO_CONVERSION | 13 #if !UCONFIG_NO_CONVERSION |
(...skipping 12 matching lines...) Expand all Loading... |
26 int32_t hitCount; | 26 int32_t hitCount; |
27 | 27 |
28 protected: | 28 protected: |
29 int32_t byteIndex; | 29 int32_t byteIndex; |
30 const uint8_t *charMap; | 30 const uint8_t *charMap; |
31 | 31 |
32 void addByte(int32_t b); | 32 void addByte(int32_t b); |
33 | 33 |
34 public: | 34 public: |
35 NGramParser(const int32_t *theNgramList, const uint8_t *theCharMap); | 35 NGramParser(const int32_t *theNgramList, const uint8_t *theCharMap); |
| 36 virtual ~NGramParser(); |
36 | 37 |
37 private: | 38 private: |
38 /* | 39 /* |
39 * Binary search for value in table, which must have exactly 64 entries. | 40 * Binary search for value in table, which must have exactly 64 entries. |
40 */ | 41 */ |
41 int32_t search(const int32_t *table, int32_t value); | 42 int32_t search(const int32_t *table, int32_t value); |
42 | 43 |
43 void lookup(int32_t thisNgram); | 44 void lookup(int32_t thisNgram); |
44 | 45 |
45 virtual int32_t nextByte(InputText *det); | 46 virtual int32_t nextByte(InputText *det); |
46 virtual void parseCharacters(InputText *det); | 47 virtual void parseCharacters(InputText *det); |
47 | 48 |
48 public: | 49 public: |
49 int32_t parse(InputText *det); | 50 int32_t parse(InputText *det); |
50 | 51 |
51 }; | 52 }; |
52 | 53 |
53 #if !UCONFIG_NO_NON_HTML5_CONVERSION | 54 #if !UCONFIG_ONLY_HTML_CONVERSION |
54 class NGramParser_IBM420 : public NGramParser | 55 class NGramParser_IBM420 : public NGramParser |
55 { | 56 { |
56 private: | |
57 int32_t alef; | |
58 int32_t isLamAlef(int32_t b); | |
59 int32_t nextByte(InputText *det); | |
60 void parseCharacters(InputText *det); | |
61 | |
62 public: | 57 public: |
63 NGramParser_IBM420(const int32_t *theNgramList, const uint8_t *theCharMap); | 58 NGramParser_IBM420(const int32_t *theNgramList, const uint8_t *theCharMap); |
| 59 ~NGramParser_IBM420(); |
| 60 |
| 61 private: |
| 62 int32_t alef; |
| 63 int32_t isLamAlef(int32_t b); |
| 64 int32_t nextByte(InputText *det); |
| 65 void parseCharacters(InputText *det); |
64 }; | 66 }; |
65 #endif | 67 #endif |
66 | 68 |
67 | 69 |
68 class CharsetRecog_sbcs : public CharsetRecognizer | 70 class CharsetRecog_sbcs : public CharsetRecognizer |
69 { | 71 { |
70 public: | 72 public: |
71 CharsetRecog_sbcs(); | 73 CharsetRecog_sbcs(); |
72 virtual ~CharsetRecog_sbcs(); | 74 virtual ~CharsetRecog_sbcs(); |
73 virtual const char *getName() const = 0; | 75 virtual const char *getName() const = 0; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 public: | 226 public: |
225 virtual ~CharsetRecog_KOI8_R(); | 227 virtual ~CharsetRecog_KOI8_R(); |
226 | 228 |
227 const char *getName() const; | 229 const char *getName() const; |
228 | 230 |
229 const char *getLanguage() const; | 231 const char *getLanguage() const; |
230 | 232 |
231 virtual UBool match(InputText *det, CharsetMatch *results) const; | 233 virtual UBool match(InputText *det, CharsetMatch *results) const; |
232 }; | 234 }; |
233 | 235 |
234 #if !UCONFIG_NO_NON_HTML5_CONVERSION | 236 #if !UCONFIG_ONLY_HTML_CONVERSION |
235 class CharsetRecog_IBM424_he : public CharsetRecog_sbcs | 237 class CharsetRecog_IBM424_he : public CharsetRecog_sbcs |
236 { | 238 { |
237 public: | 239 public: |
238 virtual ~CharsetRecog_IBM424_he(); | 240 virtual ~CharsetRecog_IBM424_he(); |
239 | 241 |
240 const char *getLanguage() const; | 242 const char *getLanguage() const; |
241 }; | 243 }; |
242 | 244 |
243 class CharsetRecog_IBM424_he_rtl : public CharsetRecog_IBM424_he { | 245 class CharsetRecog_IBM424_he_rtl : public CharsetRecog_IBM424_he { |
244 public: | 246 public: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 const char *getName() const; | 284 const char *getName() const; |
283 | 285 |
284 virtual UBool match(InputText *det, CharsetMatch *results) const; | 286 virtual UBool match(InputText *det, CharsetMatch *results) const; |
285 }; | 287 }; |
286 #endif | 288 #endif |
287 | 289 |
288 U_NAMESPACE_END | 290 U_NAMESPACE_END |
289 | 291 |
290 #endif /* !UCONFIG_NO_CONVERSION */ | 292 #endif /* !UCONFIG_NO_CONVERSION */ |
291 #endif /* __CSRSBCS_H */ | 293 #endif /* __CSRSBCS_H */ |
OLD | NEW |