Files
GopherGate/target/doc/icu_normalizer/index.html
2026-02-26 12:00:21 -05:00

31 lines
8.3 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Normalizing text into Unicode Normalization Forms."><title>icu_normalizer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="icu_normalizer" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Crate icu_normalizer</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../icu_normalizer/index.html">icu_<wbr>normalizer</a><span class="version">2.1.1</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#functionality" title="Functionality">Functionality</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>icu_<wbr>normalizer</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/icu_normalizer/lib.rs.html#6-3097">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Normalizing text into Unicode Normalization Forms.</p>
<p>This module is published as its own crate (<a href="https://docs.rs/icu_normalizer/latest/icu_normalizer/"><code>icu_normalizer</code></a>)
and as part of the <a href="https://docs.rs/icu/latest/icu/"><code>icu</code></a> crate. See the latter for more details on the ICU4X project.</p>
<h2 id="functionality"><a class="doc-anchor" href="#functionality">§</a>Functionality</h2>
<p>The top level of the crate provides normalization of input into the four normalization forms defined in <a href="https://www.unicode.org/reports/tr15/">UAX #15: Unicode
Normalization Forms</a>: NFC, NFD, NFKC, and NFKD.</p>
<p>Three kinds of contiguous inputs are supported: known-well-formed UTF-8 (<code>&amp;str</code>), potentially-not-well-formed UTF-8,
and potentially-not-well-formed UTF-16. Additionally, an iterator over <code>char</code> can be wrapped in a normalizing iterator.</p>
<p>The <code>uts46</code> module provides the combination of mapping and normalization operations for <a href="https://www.unicode.org/reports/tr46/">UTS #46: Unicode IDNA
Compatibility Processing</a>. This functionality is not meant to be used by
applications directly. Instead, it is meant as a building block for a full implementation of UTS #46, such as the
<a href="https://docs.rs/idna/latest/idna/"><code>idna</code></a> crate.</p>
<p>The <code>properties</code> module provides the non-recursive canonical decomposition operation on a per <code>char</code> basis and
the canonical compositon operation given two <code>char</code>s. It also provides access to the Canonical Combining Class
property. These operations are primarily meant for <a href="https://harfbuzz.github.io/">HarfBuzz</a> via the
<a href="https://docs.rs/icu_harfbuzz/latest/icu_harfbuzz/"><code>icu_harfbuzz</code></a> crate.</p>
<p>Notably, this normalizer does <em>not</em> provide the normalization “quick check” that can result in “maybe” in
addition to “yes” and “no”. The normalization checks provided by this crate always give a definitive
non-“maybe” answer.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>nfc = icu_normalizer::ComposingNormalizerBorrowed::new_nfc();
<span class="macro">assert_eq!</span>(nfc.normalize(<span class="string">"a\u{0308}"</span>), <span class="string">"ä"</span>);
<span class="macro">assert!</span>(nfc.is_normalized(<span class="string">"ä"</span>));
<span class="kw">let </span>nfd = icu_normalizer::DecomposingNormalizerBorrowed::new_nfd();
<span class="macro">assert_eq!</span>(nfd.normalize(<span class="string">"ä"</span>), <span class="string">"a\u{0308}"</span>);
<span class="macro">assert!</span>(!nfd.is_normalized(<span class="string">"ä"</span>));</code></pre></div></div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="properties/index.html" title="mod icu_normalizer::properties">properties</a></dt><dd>Access to the Unicode properties or property-based operations that
are required for NFC and NFD.</dd><dt><a class="mod" href="provider/index.html" title="mod icu_normalizer::provider">provider</a></dt><dd>🚧 [Unstable] Data provider struct definitions for this ICU4X component.</dd><dt><a class="mod" href="uts46/index.html" title="mod icu_normalizer::uts46">uts46</a></dt><dd>Bundles the part of UTS 46 that makes sense to implement as a
normalization.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.ComposingNormalizer.html" title="struct icu_normalizer::ComposingNormalizer">Composing<wbr>Normalizer</a></dt><dd>A normalizer for performing composing normalization.</dd><dt><a class="struct" href="struct.ComposingNormalizerBorrowed.html" title="struct icu_normalizer::ComposingNormalizerBorrowed">Composing<wbr>Normalizer<wbr>Borrowed</a></dt><dd>Borrowed version of a normalizer for performing composing normalization.</dd><dt><a class="struct" href="struct.Composition.html" title="struct icu_normalizer::Composition">Composition</a></dt><dd>An iterator adaptor that turns an <code>Iterator</code> over <code>char</code> into
a lazily-decomposed and then canonically composed <code>char</code> sequence.</dd><dt><a class="struct" href="struct.DecomposingNormalizer.html" title="struct icu_normalizer::DecomposingNormalizer">Decomposing<wbr>Normalizer</a></dt><dd>A normalizer for performing decomposing normalization.</dd><dt><a class="struct" href="struct.DecomposingNormalizerBorrowed.html" title="struct icu_normalizer::DecomposingNormalizerBorrowed">Decomposing<wbr>Normalizer<wbr>Borrowed</a></dt><dd>Borrowed version of a normalizer for performing decomposing normalization.</dd><dt><a class="struct" href="struct.Decomposition.html" title="struct icu_normalizer::Decomposition">Decomposition</a></dt><dd>An iterator adaptor that turns an <code>Iterator</code> over <code>char</code> into
a lazily-decomposed <code>char</code> sequence.</dd></dl></section></div></main></body></html>