simple-ime 1.0.0-beta.0 → 1.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,41 @@
1
- # Simple Ime
2
- An simple browser tool to use Chinese Pinyin Input Method (IME).
1
+ ## Simple Ime
2
+
3
+ ![CI](https://github.com/nieyuyao/simple-ime/workflows/CI/badge.svg)
4
+ ![latest tag](https://badgen.net/github/release/nieyuyao/simple-ime)
5
+ ![npm](https://img.shields.io/npm/v/simple-ime.svg)
6
+
7
+ 一个简易的web拼音输入法工具
8
+
9
+ [英文文档](./README-en.md)
3
10
 
4
11
  <img src="./public/demo.png" width="240" />
5
12
 
6
- # Install
13
+ 与[Goole Input tools](https://www.google.com/inputtools/try/)相比,它携带了一个离线词库,因此不需要联网查询就可以完成拼音转换。
14
+ 相应的,由于离线词库,包体积无法做到很小。此外,不支持`iframe`。
15
+ > 如果你想减小离线词库的大小,可以运行`npm run splitDict`,然后将`temp/`目录下的`dict.txt`与`packed-trie`复制到`src/data`目录下,重新构建即可
16
+
17
+ ## 快捷键
18
+
19
+ | 快捷键 | 描述 |
20
+ | --- | --- |
21
+ | ↑ | 向上翻页 |
22
+ | ↓ | 向下翻页 |
23
+ | + | 向上翻页 |
24
+ | - | 向下翻页 |
25
+ | ← | 向左切换候选词 |
26
+ | → | 向右切换候选词 |
27
+ | < | 向左切换候选词 |
28
+ | > | 向左切换候选词 |
29
+ | Shift | 切换英/拼 |
30
+ | Enter | 直接键入转换后内容 |
31
+ | [ | 左移输入法上的光标 |
32
+ | ] | 右移输入法上的光标 |
33
+
34
+ ## 安装
7
35
 
8
36
  > npm install simple-ime
9
37
 
10
- # Usage
38
+ ## 使用
11
39
 
12
40
  ```js
13
41
  import { createSimpleIme } from 'simple-ime'
@@ -21,61 +49,61 @@ ime.turnOn()
21
49
  ime.turnOff()
22
50
  ```
23
51
 
24
- # APIs
52
+ ## APIs
25
53
 
26
- ## createSimpleIme
54
+ ### createSimpleIme
27
55
 
28
- Create ime instance.
56
+ 创建一个SimpleIme实例
29
57
 
30
58
  `function createSimpleIme(): SimpleImeInstance`
31
59
 
32
- ## SimpleImeInstance
60
+ ### SimpleImeInstance
33
61
 
34
- ### Properties:
62
+ #### 属性:
35
63
 
36
- #### version
64
+ ##### version
37
65
 
38
- Version of ime.
66
+ ime的版本
39
67
 
40
68
  `version: string`
41
69
 
42
- ### Methods:
70
+ #### Methods:
43
71
 
44
- #### turnOn
72
+ ##### turnOn
45
73
 
46
- Turn on the ime.
74
+ 打开ime
47
75
 
48
76
  `function turnOn(): void`
49
77
 
50
- #### turnOff
78
+ ##### turnOff
51
79
 
52
- Turn off the ime.
80
+ 关闭ime
53
81
 
54
82
  `function turnOff(): void`
55
83
 
56
- #### toggleOnOff
84
+ ##### toggleOnOff
57
85
 
58
- Toggle the ime.
86
+ 开关ime
59
87
 
60
88
  `function toggleOnOff(): void`
61
89
 
62
- #### dispose
90
+ ##### dispose
63
91
 
64
- Destroy the ime instance.
92
+ 销毁ime实例
65
93
 
66
94
  `function dispose(): void`
67
95
 
68
- # Development
96
+ ## 开发
69
97
 
70
- Run `npm run dev` and then open browser.
98
+ 执行`npm run dev`,打开页面`http://localhost:xxx`
71
99
 
72
- # Build
100
+ ## 构建
73
101
 
74
102
  ```shell
75
103
  npm run build
76
104
  ```
77
105
 
78
- # Credits
106
+ ## 感谢
79
107
 
80
- - The frontend part of the implementation is heavily inspired by [CloudInput](https://github.com/mzhangdev/CloudInput).
81
- - Thanks to [web-pinyin-ime](https://github.com/dongyuwei/web-pinyin-ime) for algorithm of generating candidate words.
108
+ - 输入框的实现参考了 [CloudInput](https://github.com/mzhangdev/CloudInput),它提供了输入法前后端的实现
109
+ - 感谢[web-pinyin-ime](https://github.com/dongyuwei/web-pinyin-ime) ,它提供了生成词典以及优化查询速度的方法