pub struct Entry {
pub word: String,
pub code: Vec<String>,
pub weight: Option<u32>,
}Expand description
A single dictionary entry.
Fields§
§word: StringThe word or phrase exactly as represented by the source.
code: Vec<String>Source coding components in source order.
The representation depends on the dictionary format:
- SCEL: pinyin syllables, including embedded Latin code letters when the source uses them.
- QCEL: pinyin syllables, explicit Latin codes, or codes resolved through QCEL’s built-in table when the source omits its table.
- QPYD: apostrophe-delimited pinyin components stored with the entry.
- BDICT/BCD regular entries: decoded pinyin syllables or embedded Latin code letters.
- BDICT/BCD English and mixed entries: the directly stored code as a single component.
- Other formats: another source-specific coding system may be used.
weight: Option<u32>An optional source-defined numeric weight.
The representation depends on the dictionary format:
- SCEL: the first little-endian
u16in the word extension, when the extension contains at least two bytes. - QCEL: the first little-endian
u32in the word extension, when the extension contains at least four bytes. - BDICT/BCD: the numeric field in regular, English, and weighted
mixed records. Mixed records without a documented weight use
None. - QPYD: always
None; its undocumented four-byte index field is not exposed as a weight.
These formats do not document precise statistical semantics, so this field does not promise a corpus frequency.
Trait Implementations§
impl Eq for Entry
impl StructuralPartialEq for Entry
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnsafeUnpin for Entry
impl UnwindSafe for Entry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more