| Index: chrome/third_party/hunspell/src/hunspell/hunspell.hxx
|
| ===================================================================
|
| --- chrome/third_party/hunspell/src/hunspell/hunspell.hxx (revision 21721)
|
| +++ chrome/third_party/hunspell/src/hunspell/hunspell.hxx (working copy)
|
| @@ -1,30 +1,20 @@
|
| -#include "license.hunspell"
|
| -#include "license.myspell"
|
| -
|
| #include "hashmgr.hxx"
|
| #include "affixmgr.hxx"
|
| #include "suggestmgr.hxx"
|
| -#include "csutil.hxx"
|
| #include "langnum.hxx"
|
|
|
| #define SPELL_COMPOUND (1 << 0)
|
| #define SPELL_FORBIDDEN (1 << 1)
|
| +#define SPELL_ALLCAP (1 << 2)
|
| +#define SPELL_NOCAP (1 << 3)
|
| +#define SPELL_INITCAP (1 << 4)
|
|
|
| -#define NOCAP 0
|
| -#define INITCAP 1
|
| -#define ALLCAP 2
|
| -#define HUHCAP 3
|
| -#define HUHINITCAP 4
|
| +#define SPELL_XML "<?xml?>"
|
|
|
| +#define MAXDIC 20
|
| #define MAXSUGGESTION 15
|
| #define MAXSHARPS 5
|
|
|
| -#if defined(W32) && defined(LIBRARY)
|
| -#define DLLTEST2_API __declspec(dllexport)
|
| -#else
|
| -#define DLLTEST2_API
|
| -#endif
|
| -
|
| #ifndef _MYSPELLMGR_HXX_
|
| #define _MYSPELLMGR_HXX_
|
|
|
| @@ -32,15 +22,27 @@
|
| #include "chrome/third_party/hunspell/google/bdict_reader.h"
|
| #endif
|
|
|
| -#ifdef W32
|
| -class DLLTEST2_API Hunspell
|
| +#ifdef HUNSPELL_STATIC
|
| + #define DLLEXPORT
|
| #else
|
| + #ifdef HUNSPELL_EXPORTS
|
| + #define DLLEXPORT __declspec( dllexport )
|
| + #else
|
| + #define DLLEXPORT __declspec( dllimport )
|
| + #endif
|
| +#endif
|
| +
|
| +#ifdef WIN32
|
| +class DLLEXPORT Hunspell
|
| +#else
|
| class Hunspell
|
| #endif
|
| {
|
| AffixMgr* pAMgr;
|
| - HashMgr* pHMgr;
|
| + HashMgr* pHMgr[MAXDIC];
|
| + int maxdic;
|
| SuggestMgr* pSMgr;
|
| + char * affixpath;
|
| char * encoding;
|
| struct cs_info * csconv;
|
| int langnum;
|
| @@ -61,11 +63,16 @@
|
| #ifdef HUNSPELL_CHROME_CLIENT
|
| Hunspell(const unsigned char* bdict_data, size_t bdict_length);
|
| #else
|
| - Hunspell(FILE* aff_handle, FILE* dic_handle);
|
| + Hunspell(FILE* aff_handle, FILE* dic_handle, const char * key = NULL);
|
| #endif
|
|
|
| ~Hunspell();
|
|
|
| +#ifndef HUNSPELL_CHROME_CLIENT
|
| + /* load extra dictionaries (only dic files) */
|
| + int add_dic(const char * dpath, const char * key = NULL);
|
| +#endif
|
| +
|
| /* spell(word) - spellcheck word
|
| * output: 0 = bad word, not 0 = good word
|
| *
|
| @@ -87,18 +94,63 @@
|
| */
|
|
|
| int suggest(char*** slst, const char * word);
|
| +
|
| + /* deallocate suggestion lists */
|
| +
|
| + void free_list(char *** slst, int n);
|
| +
|
| char * get_dic_encoding();
|
|
|
| - /* handling custom dictionary */
|
| + /* morphological functions */
|
| +
|
| + /* analyze(result, word) - morphological analysis of the word */
|
| +
|
| + int analyze(char*** slst, const char * word);
|
| +
|
| + /* stem(result, word) - stemmer function */
|
|
|
| - int put_word(const char * word);
|
| + int stem(char*** slst, const char * word);
|
| +
|
| + /* stem(result, analysis, n) - get stems from a morph. analysis
|
| + * example:
|
| + * char ** result, result2;
|
| + * int n1 = analyze(&result, "words");
|
| + * int n2 = stem(&result2, result, n1);
|
| + */
|
| +
|
| + int stem(char*** slst, char ** morph, int n);
|
|
|
| - /* pattern is a sample dictionary word
|
| - * put word into custom dictionary with affix flags of pattern word
|
| + /* generate(result, word, word2) - morphological generation by example(s) */
|
| +
|
| + int generate(char*** slst, const char * word, const char * word2);
|
| +
|
| + /* generate(result, word, desc, n) - generation by morph. description(s)
|
| + * example:
|
| + * char ** result;
|
| + * char * affix = "is:plural"; // description depends from dictionaries, too
|
| + * int n = generate(&result, "word", &affix, 1);
|
| + * for (int i = 0; i < n; i++) printf("%s\n", result[i]);
|
| + */
|
| +
|
| + int generate(char*** slst, const char * word, char ** desc, int n);
|
| +
|
| + /* functions for run-time modification of the dictionary */
|
| +
|
| + /* add word to the run-time dictionary */
|
| +
|
| + int add(const char * word);
|
| +
|
| + /* add word to the run-time dictionary with affix flags of
|
| + * the example (a dictionary word): Hunspell will recognize
|
| + * affixed forms of the new word, too.
|
| */
|
|
|
| - int put_word_pattern(const char * word, const char * pattern);
|
| + int add_with_affix(const char * word, const char * example);
|
|
|
| + /* remove word from the run-time dictionary */
|
| +
|
| + int remove(const char * word);
|
| +
|
| /* other */
|
|
|
| /* get extra word characters definied in affix file for tokenization */
|
| @@ -107,25 +159,14 @@
|
|
|
| struct cs_info * get_csconv();
|
| const char * get_version();
|
| +
|
| + /* experimental and deprecated functions */
|
|
|
| - /* experimental functions */
|
| -
|
| #ifdef HUNSPELL_EXPERIMENTAL
|
| - /* suffix is an affix flag string, similarly in dictionary files */
|
| -
|
| + /* suffix is an affix flag string, similarly in dictionary files */
|
| int put_word_suffix(const char * word, const char * suffix);
|
| -
|
| - /* morphological analysis */
|
| -
|
| - char * morph(const char * word);
|
| - int analyze(char*** out, const char *word);
|
| -
|
| char * morph_with_correction(const char * word);
|
|
|
| - /* stemmer function */
|
| -
|
| - int stem(char*** slst, const char * word);
|
| -
|
| /* spec. suggestions */
|
| int suggest_auto(char*** slst, const char * word);
|
| int suggest_pos_stems(char*** slst, const char * word);
|
| @@ -146,9 +187,15 @@
|
| char * sharps_u8_l1(char * dest, char * source);
|
| hentry * spellsharps(char * base, char *, int, int, char * tmp, int * info, char **root);
|
| int is_keepcase(const hentry * rv);
|
| - int insert_sug(char ***slst, char * word, int *ns);
|
| + int insert_sug(char ***slst, char * word, int ns);
|
| + void cat_result(char * result, char * st);
|
| + char * stem_description(const char * desc);
|
| + int spellml(char*** slst, const char * word);
|
| + int get_xml_par(char * dest, const char * par, int maxl);
|
| + const char * get_xml_pos(const char * s, const char * attr);
|
| + int get_xml_list(char ***slst, char * list, const char * tag);
|
| + int check_xml_par(const char * q, const char * attr, const char * value);
|
|
|
| -
|
| };
|
|
|
| #endif
|
|
|
| Property changes on: chrome\third_party\hunspell\src\hunspell\hunspell.hxx
|
| ___________________________________________________________________
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|