Browse the docs

silk.text.word_dictionary_thai.

The ICU Thai word dictionary for silk.text.word_dictionary, as a packed minimal trie.

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. A node record is seven bytes: the index of its first edge (big-endian u32), its edge count (u16) and 1 when a word ends there (u8). An edge record is six bytes: a BMP scalar (u16) and the index of its child node (u32). The edges of a node are sorted by scalar.

Import as word_dictionary_thai with import silk.text.word_dictionary_thai as word_dictionary_thai.

Public declarations: 3.

root#

silk
pub fn root() -> usize

Returns the index of the root node of the trie.

nodes#

silk
pub fn nodes() -> &'static [u8]

Returns the node records of the trie, seven bytes each.

edges#

silk
pub fn edges() -> &'static [u8]

Returns the edge records of the trie, six 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.

View the source of this page