Skip to main content

SentenceAssociationOptions

Struct SentenceAssociationOptions 

Source
pub struct SentenceAssociationOptions {
    pub word_lattice: bool,
    pub neural_keyboard: bool,
    pub show_next_on_duplicate: bool,
    pub collocation_model: PathBuf,
    pub collocation_weight: f64,
    pub collocation_rerank: bool,
    pub collocation_grammar: GramConfig,
}
Expand description

Neural sentence association switches. The desktop-model switch is not among them: that model runs only as the input runtime’s settled reranker, which the host gates on the preference.

Fields§

§word_lattice: bool§neural_keyboard: bool

The Engine’s own keyboard-model rerank: nine-key reranks once across its segmentations, the quanpin and shuangpin dictionaries rerank inside the lattice, and the model’s pick becomes a NeuralKeyboard row after the lattice best. Hosts leave it off: 整句联想「增强」 (the neural_keyboard preference) mounts the input runtime’s per-keystroke reranker instead (host-api keyboard_reranker_enabled). It stays for evals and experiments that build the options directly (convert_eval --keyboard-neural).

§show_next_on_duplicate: bool§collocation_model: PathBuf

octagram .gram 语法模型的路径(宿主按模型包解析好后传入);空 = 关闭。 路径无效时词典静默退回无搭配打分,与 msime-bigram.bin 缺失的回退一致。

§collocation_weight: f64

搭配项的标定系数(ln 域结果由装配方换算后按它缩放);0 = 关闭。

§collocation_rerank: bool

解码最优路径是否作为 Collocation 整句行显示;关掉时搭配分仍参与解码。

§collocation_grammar: GramConfig

octagram 六参数;默认对齐万象现行,见 crate::lattice::octagram::GramConfig。

Trait Implementations§

Source§

impl Clone for SentenceAssociationOptions

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 SentenceAssociationOptions

Source§

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

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

impl Default for SentenceAssociationOptions

Source§

fn default() -> Self

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

impl PartialEq for SentenceAssociationOptions

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 SentenceAssociationOptions

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.