Skip to main content

WordItem

Struct WordItem 

Source
pub struct WordItem {
Show 13 fields pub pinyin: SharedString, pub canonical_pinyin: SharedString, pub word: SharedString, pub weight: i64, pub source: CandidateSource, pub scheme: SchemeType, pub fixed_position: i32, pub fuzzy: bool, pub corrected_from: SharedString, pub sentence_association: bool, pub sentence_words: Vec<String>, pub touch_supported: bool, pub confident_correction: bool,
}
Expand description

One candidate row. Every field the goldens record is here from the start, including the ones the overlays added.

Fields§

§pinyin: SharedString

The code the row matched, as typed. Composition advance consumes exactly this.

§canonical_pinyin: SharedString

The complete quanpin key from the dictionary, used when a phrase is persisted.

§word: SharedString§weight: i64

Dictionary weight; for lattice rows trunc(log_prob * 1000), which is not a sort key.

§source: CandidateSource§scheme: SchemeType

The scheme whose provider produced the row; in mixed wubi it routes learning and removal to the right table.

§fixed_position: i32

0 when unfixed, otherwise the fixed slot 1..=5.

§fuzzy: bool§corrected_from: SharedString

Non-empty for a row read from an autocorrected spelling; holds the folded letters the user typed.

§sentence_association: bool

Only whole-sentence association rows (lattice and neural sentences).

§sentence_words: Vec<String>

Word boundaries of a decoded sentence, for personal context learning.

§touch_supported: bool

26 键双拼按触点计价的纠错整句,而且落点支持把它留在引擎给的座位上(分数不比字面整句低出 TouchTuning::show_margin):runtime 不把它当整句的次选读法挪到表尾。其余行永远为假。

§confident_correction: bool

26 键双拼按触点计价的纠错整句,触点支持而且明显比字面整句好,按首选规则(shuangpin::dictionary 的 confident_correction)坐了第一位。宿主据此给首选画强调色、读屏念「已纠正」(视图里的 confident_correction)。带它的行同时 touch_supported;其余行永远为假。

Implementations§

Source§

impl WordItem

Source

pub fn new( pinyin: impl Into<String>, word: impl Into<String>, weight: i64, source: CandidateSource, canonical_pinyin: impl Into<String>, ) -> Self

Trait Implementations§

Source§

impl Clone for WordItem

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WordItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WordItem

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for WordItem

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WordItem

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.