TABLE OF CONTENTS


trish2/gci [ Modules ]

[ Top ] [ Modules ]

NAME

gci

SYNOPSIS

 #include <gci.h>

DESCRIPTION

GCI --Generalized Case Insensitiveness-- allows to perform a certain class of approximate searches. A case insensitive search can match an alphabetic character with its uppercase or lowercase counterpart. A GCI table consists of a list of characters with, for each one, an explicit list of all characters that can be matched. For instance a GCI can tell that a space can match a tabulation, and undercore or a dash.

GCI are implemented by a shallow one-level PATRICIA tree. The nodes have the leading character as the original character and all the alternative matches in the tail string.

EXAMPLE

SEE ALSO

patricia, patricia_search, gci_new, gci_add, gci_alt


trish2/gci_new [ Functions ]

[ Top ] [ Functions ]

NAME

gci_new

SYNOPSIS

 #include <gci.h>
 patricia_t *gci_new(unsigned int nwc, unsigned int nalt);

FUNCTION

gci_new creates a new GCI table with nwc characters and a total of nalt alternatives. These two arguments need not to be exact, they will determine the resulting PATRICIA tree bunches.

INPUTS

RETURN VALUE

A PATRICIA tree that holds an empty GCI table. It must be freed with patricia_free.

SEE ALSO

gci, patricia_new, patricia_free


trish2/gci_add [ Functions ]

[ Top ] [ Functions ]

NAME

gci_add

SYNOPSIS

 #include <gci.h>
 int gci_add(patricia_t *gci, wchar_t wc, wchar_t *alt);

FUNCTION

Adds the character wc and all its alternatives alt in the GCI table gci. The character will not be inserted if wc already has alternatives in gci.

INPUTS

RETURN VALUE

1 if the character has been successfully added, 0 if wc already had alternatives.

SEE ALSO

gci, gci_new, gci_alt


trish2/gci_alt [ Functions ]

[ Top ] [ Functions ]

NAME

gci_alt

SYNOPSIS

 #include <gci.h>
 wchar_t *gci_alt(patricia_t *gci, wchar_t wc);

FUNCTION

gci_alt gives all alternatives to the character wc in the GCI table gci.

INPUTS

RETURN VALUE

A string with all alternatives of wc. NULL if wc has no alternative. Note that the returned string is not a copy, so modifying it will modify the GCI table. Also it is a claimed pointer, freed with patricia_free.

SEE ALSO

gci, gci_new, gci_add