![]() |
![]() |
![]() |
Dee Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <dee-icu.h> #define DEE_ICU_ERROR enum DeeICUError; DeeICUTermFilter; GQuark dee_icu_error_quark (void
); gchar * dee_icu_term_filter_apply (DeeICUTermFilter *self
,const gchar *text
); void dee_icu_term_filter_destroy (DeeICUTermFilter *filter
); DeeICUTermFilter * dee_icu_term_filter_new (const gchar *system_id
,const gchar *rules
,GError **error
); DeeICUTermFilter * dee_icu_term_filter_new_ascii_folder ();
This module allows developers to easily construct powerful DeeTermFilters with ease. The filters leverage the ICU framework to provide world class transliteration features.
The filters can be employed manually by calling dee_icu_term_filter_apply()
or installed in a DeeAnalyzer by calling dee_analyzer_add_term_filter()
passing the term filter instance as the user data and
dee_icu_term_filter_destroy()
as the GDestroyNotify.
#define DEE_ICU_ERROR dee_icu_error_quark()
Error domain for the ICU extension to Dee. Error codes will be from the DeeICUError enumeration
typedef enum { DEE_ICU_ERROR_BAD_RULE, DEE_ICU_ERROR_BAD_ID, DEE_ICU_ERROR_UNKNOWN } DeeICUError;
Error codes for the ICU extension to Dee. These codes will be set when the error domain is DEE_ICU_ERROR.
DEE_ICU_ERROR_BAD_RULE
: Error parsing a transliteration rule
DEE_ICU_ERROR_BAD_ID
: Error parsing a transliterator system id
DEE_ICU_ERROR_UNKNOWN
: The ICU subsystem returned an error that is not
handled in Dee
gchar * dee_icu_term_filter_apply (DeeICUTermFilter *self
,const gchar *text
);
Apply a DeeICUTermFilter on a piece of UTF-8 text.
|
The filter to apply |
|
The text to apply the filter on |
Returns : |
A newly allocated string. Free with g_free() . [transfer full]
|
void dee_icu_term_filter_destroy (DeeICUTermFilter *filter
);
Free all resources allocated by a DeeICUTermFilter.
|
The filter to free |
DeeICUTermFilter * dee_icu_term_filter_new (const gchar *system_id
,const gchar *rules
,GError **error
);
Create a new DeeICUTermFilter for a given ICU transliterator system id and/or set of transliteration rules.
|
A system id for the transliterator to use. See userguide.icu-project.org/transforms/general |
|
A set of transliteration rules to use. See userguide.icu-project.org/transforms/general/rules. [allow-none] |
|
A place to return a GError, or NULL to ignore errors. [allow-none][error-domains Dee.ICUError]
|
Returns : |
A newly allocated DeeICUTermFilter.
Free with dee_icu_term_filter_destroy() . [transfer full]
|
DeeICUTermFilter * dee_icu_term_filter_new_ascii_folder ();
Construct a term filter that folds any UTF-8 string into ASCII.
Returns : |
A newly allocated DeeICUTermFilter. Free with
dee_icu_term_filter_destroy() . [transfer full]
|