|
C/Migemo 1.4
|
#include "common.h"#include <ctype.h>#include <limits.h>#include <stddef.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "charset.h"#include "filename.h"#include "migemo.h"#include "migemo_struct.h"#include "mtree.h"#include "romaji.h"#include "rxgen.h"#include "strbuf.h"#include "wordlist.h"
マクロ定義 | |
| #define | DICT_ROMA2HIRA "roma2hira.dat" |
| #define | DICT_HIRA2KATA "hira2kata.dat" |
| #define | DICT_HAN2ZEN "han2zen.dat" |
| #define | DICT_ZEN2HAN "zen2han.dat" |
| #define | _MAX_PATH 1024 |
関数 | |
| int MIGEMO_CALLTYPE | migemo_load (migemo *mo, int dict_id, const char *dict_file) |
| migemo *MIGEMO_CALLTYPE | migemo_open (const char *dict) |
| void MIGEMO_CALLTYPE | migemo_close (migemo *mo) |
| unsigned char *MIGEMO_CALLTYPE | migemo_query (migemo *mo, const unsigned char *query) |
| void MIGEMO_CALLTYPE | migemo_release (migemo *mo, unsigned char *used_pattern) |
| int MIGEMO_CALLTYPE | migemo_set_operator (migemo *mo, int index, const unsigned char *op) |
| const unsigned char *MIGEMO_CALLTYPE | migemo_get_operator (migemo *mo, int index) |
| void MIGEMO_CALLTYPE | migemo_set_escape_chars (migemo *mo, const unsigned char *chars) |
| void MIGEMO_CALLTYPE | migemo_setproc_char2int (migemo *mo, MIGEMO_PROC_CHAR2INT proc) |
| void MIGEMO_CALLTYPE | migemo_setproc_int2char (migemo *mo, MIGEMO_PROC_INT2CHAR proc) |
| int MIGEMO_CALLTYPE | migemo_is_enable (migemo *mo) |
| const char *MIGEMO_CALLTYPE | migemo_version (void) |
| int MIGEMO_CALLTYPE | migemo_switch_sdict (migemo *mo, int flags) |
| int MIGEMO_CALLTYPE | migemo_save_sdict (migemo *mo, const char *dict_file) |
| migemo *MIGEMO_CALLTYPE | migemo_open_sdict (const char *dict_file) |
| #define _MAX_PATH 1024 |
| #define DICT_HAN2ZEN "han2zen.dat" |
| #define DICT_HIRA2KATA "hira2kata.dat" |
| #define DICT_ROMA2HIRA "roma2hira.dat" |
| #define DICT_ZEN2HAN "zen2han.dat" |
| void MIGEMO_CALLTYPE migemo_close | ( | migemo * | mo | ) |
| const unsigned char *MIGEMO_CALLTYPE migemo_get_operator | ( | migemo * | mo, |
| int | index ) |
Retrieve the metacharacter (operator) string for the specified index.
For details about supported index values, see migemo_set_operator().
| mo | Migemo object. |
| index | Metacharacter identifier (MIGEMO_OPINDEX_*). |
| int MIGEMO_CALLTYPE migemo_is_enable | ( | migemo * | mo | ) |
Check whether the main dictionary is loaded and ready for queries.
| mo | Migemo object. |
参照先 migemo::enable.
| int MIGEMO_CALLTYPE migemo_load | ( | migemo * | mo, |
| int | dict_id, | ||
| const char * | dict_file ) |
Add a dictionary or data file to the Migemo object.
Supported dictionary types (dict_id):
| mo | Migemo object. |
| dict_id | Identifier specifying the type of dictionary/data. |
| dict_file | Path to the dictionary or data file to load. |
参照先 migemo::char2int, migemo::charset, stree_header::charset, charset_getproc(), CHARSET_PROC_CHAR2INT, CHARSET_PROC_INT2CHAR, migemo::enable, migemo::han2zen, stree::head, migemo::hira2kata, migemo_setproc_char2int(), migemo_setproc_int2char(), migemo::mtree, migemo::roma2hira, romaji_load(), migemo::stree, stree_load(), migemo::zen2han (計18項目).
| migemo *MIGEMO_CALLTYPE migemo_open | ( | const char * | dict | ) |
| migemo *MIGEMO_CALLTYPE migemo_open_sdict | ( | const char * | dict_file | ) |
| unsigned char *MIGEMO_CALLTYPE migemo_query | ( | migemo * | mo, |
| const unsigned char * | query ) |
| void MIGEMO_CALLTYPE migemo_release | ( | migemo * | mo, |
| unsigned char * | used_pattern ) |
| int MIGEMO_CALLTYPE migemo_save_sdict | ( | migemo * | mo, |
| const char * | dict_file ) |
参照先 migemo::stree, stree_save().
| void MIGEMO_CALLTYPE migemo_set_escape_chars | ( | migemo * | mo, |
| const unsigned char * | chars ) |
Set custom characters to escape in generated regular expressions.
| mo | Migemo object. |
| chars | String of characters to escape (ASCII 32-126). If NULL, default set ("\\.*+^$/") is used. If "", no characters are escaped. |
| int MIGEMO_CALLTYPE migemo_set_operator | ( | migemo * | mo, |
| int | index, | ||
| const unsigned char * | op ) |
Set regular expression metacharacters (operators) for the Migemo object.
Supported metacharacter identifiers (index):
| mo | Migemo object. |
| index | Metacharacter identifier (MIGEMO_OPINDEX_*). |
| op | Metacharacter string to set. |
| void MIGEMO_CALLTYPE migemo_setproc_char2int | ( | migemo * | mo, |
| MIGEMO_PROC_CHAR2INT | proc ) |
Set a custom character conversion procedure (char -> int) for the Migemo object.
| mo | Migemo object. |
| proc | Character conversion procedure. |
参照先 migemo::char2int, CHARSET_PROC_CHAR2INT, migemo::rx, rxgen_setproc_char2int().
参照元 migemo_load().
| void MIGEMO_CALLTYPE migemo_setproc_int2char | ( | migemo * | mo, |
| MIGEMO_PROC_INT2CHAR | proc ) |
Set a custom character conversion procedure (int -> char) for the Migemo object.
| mo | Migemo object. |
| proc | Character conversion procedure. |
参照先 CHARSET_PROC_INT2CHAR, migemo::rx, rxgen_setproc_int2char().
参照元 migemo_load().
| int MIGEMO_CALLTYPE migemo_switch_sdict | ( | migemo * | mo, |
| int | flags ) |
| const char *MIGEMO_CALLTYPE migemo_version | ( | void | ) |
Retrieve the version string of the C/Migemo library.