Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #include "license.hunspell" | 1 #include "license.hunspell" |
| 2 #include "license.myspell" | 2 #include "license.myspell" |
| 3 | 3 |
| 4 #include <stdlib.h> | 4 #include <stdlib.h> |
| 5 #include <string.h> | 5 #include <string.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 | 7 |
| 8 #include "hunspell.hxx" | 8 #include "hunspell.hxx" |
| 9 #include "hunspell.h" | 9 #include "hunspell.h" |
| 10 #ifndef HUNSPELL_CHROME_CLIENT | 10 #ifndef HUNSPELL_CHROME_CLIENT |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 free((*slst)[ns]); | 345 free((*slst)[ns]); |
| 346 } | 346 } |
| 347 for (int k = ns; k > 0; k--) (*slst)[k] = (*slst)[k - 1]; | 347 for (int k = ns; k > 0; k--) (*slst)[k] = (*slst)[k - 1]; |
| 348 (*slst)[0] = dup; | 348 (*slst)[0] = dup; |
| 349 return ns + 1; | 349 return ns + 1; |
| 350 } | 350 } |
| 351 | 351 |
| 352 int Hunspell::spell(const char * word, int * info, char ** root) | 352 int Hunspell::spell(const char * word, int * info, char ** root) |
| 353 { | 353 { |
| 354 #ifdef HUNSPELL_CHROME_CLIENT | 354 #ifdef HUNSPELL_CHROME_CLIENT |
| 355 if (pHMgr) pHMgr[0]->EmptyHentryCache(); | 355 pHMgr[0]->EmptyHentryCache(); |
|
Nico
2014/03/11 16:40:55
Can you paste the warning? (Often a good idea to i
Alexander Potapenko
2014/03/11 17:38:48
Updated the CL description.
Maybe it used to be a
| |
| 356 #endif | 356 #endif |
| 357 struct hentry * rv=NULL; | 357 struct hentry * rv=NULL; |
| 358 // need larger vector. For example, Turkish capital letter I converted a | 358 // need larger vector. For example, Turkish capital letter I converted a |
| 359 // 2-byte UTF-8 character (dotless i) by mkallsmall. | 359 // 2-byte UTF-8 character (dotless i) by mkallsmall. |
| 360 char cw[MAXWORDUTF8LEN]; | 360 char cw[MAXWORDUTF8LEN]; |
| 361 char wspace[MAXWORDUTF8LEN]; | 361 char wspace[MAXWORDUTF8LEN]; |
| 362 w_char unicw[MAXWORDLEN]; | 362 w_char unicw[MAXWORDLEN]; |
| 363 // Hunspell supports XML input of the simplified API (see manual) | 363 // Hunspell supports XML input of the simplified API (see manual) |
| 364 if (strcmp(word, SPELL_XML) == 0) return 1; | 364 if (strcmp(word, SPELL_XML) == 0) return 1; |
| 365 int nc = strlen(word); | 365 int nc = strlen(word); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 708 } | 708 } |
| 709 | 709 |
| 710 } | 710 } |
| 711 | 711 |
| 712 return he; | 712 return he; |
| 713 } | 713 } |
| 714 | 714 |
| 715 int Hunspell::suggest(char*** slst, const char * word) | 715 int Hunspell::suggest(char*** slst, const char * word) |
| 716 { | 716 { |
| 717 #ifdef HUNSPELL_CHROME_CLIENT | 717 #ifdef HUNSPELL_CHROME_CLIENT |
| 718 if (pHMgr) pHMgr[0]->EmptyHentryCache(); | 718 pHMgr[0]->EmptyHentryCache(); |
| 719 #endif | 719 #endif |
| 720 int onlycmpdsug = 0; | 720 int onlycmpdsug = 0; |
| 721 char cw[MAXWORDUTF8LEN]; | 721 char cw[MAXWORDUTF8LEN]; |
| 722 char wspace[MAXWORDUTF8LEN]; | 722 char wspace[MAXWORDUTF8LEN]; |
| 723 if (!pSMgr || maxdic == 0) return 0; | 723 if (!pSMgr || maxdic == 0) return 0; |
| 724 w_char unicw[MAXWORDLEN]; | 724 w_char unicw[MAXWORDLEN]; |
| 725 *slst = NULL; | 725 *slst = NULL; |
| 726 // process XML input of the simplified API (see manual) | 726 // process XML input of the simplified API (see manual) |
| 727 if (strncmp(word, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) { | 727 if (strncmp(word, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) { |
| 728 return spellml(slst, word); | 728 return spellml(slst, word); |
| (...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2047 | 2047 |
| 2048 /* remove word from the run-time dictionary */ | 2048 /* remove word from the run-time dictionary */ |
| 2049 | 2049 |
| 2050 int Hunspell_remove(Hunhandle *pHunspell, const char * word) { | 2050 int Hunspell_remove(Hunhandle *pHunspell, const char * word) { |
| 2051 return ((Hunspell*)pHunspell)->remove(word); | 2051 return ((Hunspell*)pHunspell)->remove(word); |
| 2052 } | 2052 } |
| 2053 | 2053 |
| 2054 void Hunspell_free_list(Hunhandle *, char *** slst, int n) { | 2054 void Hunspell_free_list(Hunhandle *, char *** slst, int n) { |
| 2055 freelist(slst, n); | 2055 freelist(slst, n); |
| 2056 } | 2056 } |
| OLD | NEW |