Skip to main content

TouchTuning

Struct TouchTuning 

Source
pub struct TouchTuning {
    pub base: f64,
    pub scale: f64,
    pub sigma_x: f64,
    pub sigma_y: f64,
    pub bias_y: f64,
    pub min_penalty: f64,
    pub max_penalty: f64,
    pub cut: f64,
    pub show_margin: f64,
    pub show_penalty: f64,
    pub lead_margin: f64,
    pub lead_penalty: f64,
}
Expand description

计价参数,单位是词网格的自然对数分。sigma_*、bias_y 以键为单位。默认值在三端宿主导出的几何上扫参得到(见模块注释里的笔记)。

Fields§

§base: f64

B:落点在两键正中间时的罚分。

§scale: f64

s:距离平方之差每一单位加多少罚分。

§sigma_x: f64

σx、σy:横向、纵向的距离各以多少个键为一个单位。

§sigma_y: f64§bias_y: f64

b_y:每个键的瞄准点往下挪多少个键高(按键普遍偏下)。

§min_penalty: f64

P_MIN、P_MAX:罚分的下限和上限。平面表原有的邻键永不丢弃,最多付到 P_MAX。

§max_penalty: f64§cut: f64

P_CUT:平面表里没有的键(真实布局下的斜邻键、;)罚分超过它就不加。

§show_margin: f64

纠错整句的分数(已经扣了罚分)不比字面整句低出这么多时,落点算是支持它:它留在引擎给的座位上(整句块之后),不和整句的次选读法一起挪到表尾。打对了的输入按在键心,罚分高,纠错整句多半低于这条线,照旧沉底,不挤占它后面的候选。

§show_penalty: f64

同时要求纠错整句改动的每一键在落点下的价都不超过它,落点才算支持这次改正。打对的输入里,按在键心附近的那一键改过去的价高,挡在这条线外;只看分数差时,字面整句本来就排得很靠后的那些用例常有一条分数接近的纠错整句,它坐到整句块之后,把金标准往后挤一位。

§lead_margin: f64

m_sp(方案里的 shuangpin_touch_lead_margin):纠错整句坐首选要求它的分数(已扣罚分)比字面整句高出这么多乘以纠错边数(TypoSentence::leads)。双拼触点专用,不复用全拼值为无穷大的 typo_lead_margin;只在 Rust 侧可调,宿主经 FFI 设不了。无穷大时首选规则整个不起作用。

§lead_penalty: f64

P_LEAD:坐首选还要求改动的每一键在落点下改过去的价(不打学习折扣)都不超过它。按在键心的字母改到邻键的价接近 B + s,挡在这条线外,所以打在键心的字母永远不会被首选改掉。

Trait Implementations§

Source§

impl Clone for TouchTuning

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 Copy for TouchTuning

Source§

impl Debug for TouchTuning

Source§

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

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

impl Default for TouchTuning

Source§

fn default() -> Self

在 Android 模拟器导出的几何(resources/eval/key-geometry/android-portrait*.json)上扫参得到;扫参表见模块注释里的笔记。

Source§

impl PartialEq for TouchTuning

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 TouchTuning

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.