silk.text.word_dictionary_thai.
The packed ICU Thai word dictionary trie for silk.text.word_dictionary.
When to use#
Use IcuDictionary in silk.text.word_dictionary, which reads this data. Use this module
only to read the packed trie directly.
Details#
The data is thaidict.txt of ICU release 78.1: 26383 words in 17325 nodes and 38637 edges. A
node is a u32: the index of its first edge (24 bits), its edge count (7 bits) and 1 when a word
ends there (low bit). Edge i has the label labels()[i] and leads to the node in the little-
endian u32 at targets()[4 * i]. The edges of a node are consecutive and sorted by label. A
label is a scalar minus base(); U+200C and U+200D are the labels 0xfe and 0xff.
rootTargets() holds the child of the root for each of the 256 labels, or 0.
Import as word_dictionary_thai with import silk.text.word_dictionary_thai as word_dictionary_thai.
Public declarations: 5.
root#
pub fn root() -> u32Returns the packed root node of the trie.
base#
pub fn base() -> u32Returns the scalar of label 0.
labels#
pub fn labels() -> &'static [u8]Returns the label of each edge, one byte each.
targets#
pub fn targets() -> &'static [u8]Returns the packed child node of each edge, four bytes each.
rootTargets#
pub fn rootTargets() -> &'static [u8]Returns the packed child of the root for each label, or 0, four bytes each.
Category: Text.
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.