pub enum KeyGrid {
NineKey,
FourteenKey,
EighteenKey,
NineKeyShuangpin(&'static NineKeyShuangpin),
FourteenKeyShuangpin(&'static NineKeyShuangpin),
EighteenKeyShuangpin(&'static NineKeyShuangpin),
}Expand description
九宫格会话把字母归成组码用的键盘。一个组码键上有几个字母,解码只认组码:路径搜索、锁定、切分、整句、简拼和英文混入都与「字母怎么变成码」无关,只经由这里的表。
九键双拼不按字母归组,而是一个音节两位数字(声母一位、韵母一位),表由用户选的方案给出,所以它带着那张表(进程里按内容只留一份,见 nine_key_shuangpin);相等按表的引用比较。
Variants§
NineKey
电话键盘:组码是 2–9。
FourteenKey
全拼 14 键:组码是每组首字母的小写 q e t u o a d g j l z c b m。
EighteenKey
全拼十八键:八组双字母键与十组单字母键。
NineKeyShuangpin(&'static NineKeyShuangpin)
九键双拼:组码是方案用到的数字,可以有 1 和 0。
FourteenKeyShuangpin(&'static NineKeyShuangpin)
14 键双拼:当前 26 键方案投到相邻字母组,每个音节仍占两键,分号与 L 共键。
EighteenKeyShuangpin(&'static NineKeyShuangpin)
双拼 18 键:按 Q WE RT Y U IO P/A SD FG H JK L/Z XC V BN M 分组。
Implementations§
Source§impl KeyGrid
impl KeyGrid
Sourcepub fn code_of(self, letter: u8) -> Option<u8>
pub fn code_of(self, letter: u8) -> Option<u8>
字母所在键的组码;十八键双拼的大写字母标记精确输入。字母双拼网格的分号归入 L,九键双拼不按字母归组。
Sourcepub fn letters(self, code: u8) -> &'static str
pub fn letters(self, code: u8) -> &'static str
组码键上的字母;不是这种键盘的组码时为空。九键双拼是这个键上能起头一个音节的字母(声母的首字母和从这个键开始的零声母音节的首字母)。
Sourcepub fn encode(self, pinyin: &str) -> String
pub fn encode(self, pinyin: &str) -> String
拼音(或任何字母串)的组码;a..=z 以外的字节(')跳过。九键双拼按 ' 分开的音节编码,完整音节两位、单独的声母一位,有一段两样都不是时为空。
Sourcepub fn offers_raw_key(self) -> bool
pub fn offers_raw_key(self) -> bool
组码本身是不是可上屏的文字。九键的数字是:左列在没有锁定时给出「原样上屏这一键」,CommitRaw 上屏数字。十四键或十八键的组码只是这一组的首字母,原样上屏没有意义:左列没有这一项,CommitRaw 改为结束组字。九键双拼的数字和九键一样是数字本身。
Sourcepub fn uses_digits(self) -> bool
pub fn uses_digits(self) -> bool
组码是数字,从 character 进来:九键和九键双拼。数字在这两种网格下是组字的键,不是选词键。
Trait Implementations§
impl Copy for KeyGrid
impl Eq for KeyGrid
Auto Trait Implementations§
impl Freeze for KeyGrid
impl RefUnwindSafe for KeyGrid
impl Send for KeyGrid
impl Sync for KeyGrid
impl Unpin for KeyGrid
impl UnsafeUnpin for KeyGrid
impl UnwindSafe for KeyGrid
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.