PostgreSQL Source Code git master
|
#include "postgres.h"
#include "catalog/pg_type.h"
#include "mb/pg_wchar.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "daitch_mokotoff.h"
Go to the source code of this file.
Data Structures | |
struct | dm_node |
Macros | |
#define | DM_CODE_DIGITS 6 |
Typedefs | |
typedef struct dm_node | dm_node |
Functions | |
static bool | daitch_mokotoff_coding (const char *word, ArrayBuildState *soundex) |
PG_FUNCTION_INFO_V1 (daitch_mokotoff) | |
Datum | daitch_mokotoff (PG_FUNCTION_ARGS) |
static void | initialize_node (dm_node *node, int last_update) |
static void | add_next_code_digit (dm_node *node, int code_index, char code_digit) |
static void | set_leaf (dm_node *first_node[2], dm_node *last_node[2], dm_node *node, int ix_node) |
static dm_node * | find_or_create_child_node (dm_node *parent, char code_digit, ArrayBuildState *soundex) |
static void | update_node (dm_node *first_node[2], dm_node *last_node[2], dm_node *node, int ix_node, int letter_no, int prev_code_index, int next_code_index, const char *next_code_digits, int digit_no, ArrayBuildState *soundex) |
static void | update_leaves (dm_node *first_node[2], int *ix_node, int letter_no, const dm_codes *codes, const dm_codes *next_codes, ArrayBuildState *soundex) |
static char | read_char (const unsigned char *str, int *ix) |
static char | read_valid_char (const char *str, int *ix) |
static const dm_codes * | read_letter (const char *str, int *ix) |
Variables | |
static const dm_node | start_node |
static const dm_codes | end_codes [2] |
static const char | iso8859_1_to_ascii_upper [] |
#define DM_CODE_DIGITS 6 |
Definition at line 61 of file daitch_mokotoff.c.
|
static |
Definition at line 182 of file daitch_mokotoff.c.
References dm_node::code_digit, dm_node::next_code_digits, and dm_node::next_code_index.
Referenced by update_node().
Datum daitch_mokotoff | ( | PG_FUNCTION_ARGS | ) |
Definition at line 123 of file daitch_mokotoff.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, arg, CurrentMemoryContext, daitch_mokotoff_coding(), initArrayResult(), makeArrayResult(), MemoryContextDelete(), MemoryContextSwitchTo(), old_ctx, PG_GETARG_TEXT_PP, PG_RETURN_DATUM, PG_RETURN_NULL, pg_server_to_any(), PG_UTF8, soundex(), text_to_cstring(), and VARSIZE_ANY_EXHDR.
|
static |
Definition at line 519 of file daitch_mokotoff.c.
References accumArrayResult(), cstring_to_text_with_len(), CurrentMemoryContext, DM_CODE_DIGITS, end_codes, i, dm_node::next, palloc_object, PointerGetDatum(), read_letter(), soundex(), dm_node::soundex, start_node, update_leaves(), and word().
Referenced by daitch_mokotoff().
|
static |
Definition at line 216 of file daitch_mokotoff.c.
References accumArrayResult(), dm_node::children, dm_node::code_digit, cstring_to_text_with_len(), CurrentMemoryContext, DM_CODE_DIGITS, i, dm_node::next_code_index, palloc_object, PointerGetDatum(), dm_node::prev_code_index, soundex(), dm_node::soundex, dm_node::soundex_length, and start_node.
Referenced by update_node().
|
static |
Definition at line 164 of file daitch_mokotoff.c.
References dm_node::is_leaf, dm_node::last_update, dm_node::next_code_digits, dm_node::next_code_index, dm_node::prev_code_digits, and dm_node::prev_code_index.
Referenced by update_node().
PG_FUNCTION_INFO_V1 | ( | daitch_mokotoff | ) |
|
static |
Definition at line 396 of file daitch_mokotoff.c.
References iso8859_1_to_ascii_upper, pg_utf_mblen, str, and utf8_to_unicode().
Referenced by read_valid_char().
|
static |
Definition at line 467 of file daitch_mokotoff.c.
References cmp(), i, j, read_valid_char(), and str.
Referenced by daitch_mokotoff_coding().
|
static |
Definition at line 451 of file daitch_mokotoff.c.
References read_char(), and str.
Referenced by read_letter().
|
static |
Definition at line 196 of file daitch_mokotoff.c.
References dm_node::is_leaf, and dm_node::next.
Referenced by update_node().
|
static |
Definition at line 332 of file daitch_mokotoff.c.
References i, j, dm_node::next, dm_node::prev_code_index, soundex(), and update_node().
Referenced by daitch_mokotoff_coding().
|
static |
Definition at line 262 of file daitch_mokotoff.c.
References add_next_code_digit(), find_or_create_child_node(), i, initialize_node(), dm_node::next_code_digits, dm_node::next_code_index, dm_node::prev_code_digits, dm_node::prev_code_index, set_leaf(), soundex(), and update_node().
Referenced by update_leaves(), and update_node().
|
static |
Definition at line 105 of file daitch_mokotoff.c.
Referenced by daitch_mokotoff_coding().
|
static |
Definition at line 113 of file daitch_mokotoff.c.
Referenced by read_char().
|
static |
Definition at line 90 of file daitch_mokotoff.c.
Referenced by daitch_mokotoff_coding(), and find_or_create_child_node().