Normalizer object for Unicode TR15 normalization. More...
#include <nvtext/unicode_normalize.hpp>
Public Member Functions | |
| unicode_normalizer (cudf::table_view const &unicode_data, unicode_normalization_form form, cuda::stream_ref stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
| Construct a unicode_normalizer from UnicodeData.txt columns. More... | |
Normalizer object for Unicode TR15 normalization.
The normalizer is constructed from the contents of the Unicode Character Database UnicodeData.txt file, loaded by the caller as a cudf table (e.g. via cudf::io::read_csv).
The file is published by the Unicode Consortium and can be downloaded from: https://unicode.org/Public/15.1.0/ucd/UnicodeData.txt It is a semicolon-delimited file with 15 fields per row. The three fields required by this API are field 0 (code point hex), field 3 (CCC), and field 5 (decomposition mapping).
The unicode_data table must contain exactly three columns in the following order, corresponding to the fields above:
<compat>, <font>, <wide>, etc.Decomposition of Hangul syllables (U+AC00..U+D7A3) is performed algorithmically per the Unicode standard and does not require entries in the provided table.
Composition exclusions (singletons, non-starter decompositions, and the ~70 Unicode-specified explicit exclusions) are computed internally.
Definition at line 76 of file unicode_normalize.hpp.
| nvtext::unicode_normalizer::unicode_normalizer | ( | cudf::table_view const & | unicode_data, |
| unicode_normalization_form | form, | ||
| cuda::stream_ref | stream = cudf::get_default_stream(), |
||
| rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
| ) |
Construct a unicode_normalizer from UnicodeData.txt columns.
| unicode_data | Table with three columns as described above |
| form | Normalization form to apply |
| stream | CUDA stream used for device memory operations and kernel launches |
| mr | Device memory resource used to allocate internal tables |