simple-ime 1.0.0-beta.4 → 1.0.0-beta.6

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,18 +1,41 @@
1
- # Simple Ime
1
+ ## Simple Ime
2
2
 
3
3
  ![CI](https://github.com/nieyuyao/simple-ime/workflows/CI/badge.svg)
4
4
  ![latest tag](https://badgen.net/github/release/nieyuyao/simple-ime)
5
5
  ![npm](https://img.shields.io/npm/v/simple-ime.svg)
6
6
 
7
- A simple browser tool to use Chinese Pinyin Input Method (IME).
7
+ 一个简易的web拼音输入法工具
8
+
9
+ [英文文档](./README-en.md)
8
10
 
9
11
  <img src="./public/demo.png" width="240" />
10
12
 
11
- # 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
+ ## 安装
12
35
 
13
36
  > npm install simple-ime
14
37
 
15
- # Usage
38
+ ## 使用
16
39
 
17
40
  ```js
18
41
  import { createSimpleIme } from 'simple-ime'
@@ -26,61 +49,61 @@ ime.turnOn()
26
49
  ime.turnOff()
27
50
  ```
28
51
 
29
- # APIs
52
+ ## APIs
30
53
 
31
- ## createSimpleIme
54
+ ### createSimpleIme
32
55
 
33
- Create ime instance.
56
+ 创建一个SimpleIme实例
34
57
 
35
58
  `function createSimpleIme(): SimpleImeInstance`
36
59
 
37
- ## SimpleImeInstance
60
+ ### SimpleImeInstance
38
61
 
39
- ### Properties:
62
+ #### 属性:
40
63
 
41
- #### version
64
+ ##### version
42
65
 
43
- Version of ime.
66
+ ime的版本
44
67
 
45
68
  `version: string`
46
69
 
47
- ### Methods:
70
+ #### Methods:
48
71
 
49
- #### turnOn
72
+ ##### turnOn
50
73
 
51
- Turn on the ime.
74
+ 打开ime
52
75
 
53
76
  `function turnOn(): void`
54
77
 
55
- #### turnOff
78
+ ##### turnOff
56
79
 
57
- Turn off the ime.
80
+ 关闭ime
58
81
 
59
82
  `function turnOff(): void`
60
83
 
61
- #### toggleOnOff
84
+ ##### toggleOnOff
62
85
 
63
- Toggle the ime.
86
+ 开关ime
64
87
 
65
88
  `function toggleOnOff(): void`
66
89
 
67
- #### dispose
90
+ ##### dispose
68
91
 
69
- Destroy the ime instance.
92
+ 销毁ime实例
70
93
 
71
94
  `function dispose(): void`
72
95
 
73
- # Development
96
+ ## 开发
74
97
 
75
- Run `npm run dev` and then open browser.
98
+ 执行`npm run dev`,打开页面`http://localhost:xxx`
76
99
 
77
- # Build
100
+ ## 构建
78
101
 
79
102
  ```shell
80
103
  npm run build
81
104
  ```
82
105
 
83
- # Credits
106
+ ## 感谢
84
107
 
85
- - The frontend part of the implementation is heavily inspired by [CloudInput](https://github.com/mzhangdev/CloudInput).
86
- - 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) ,它提供了生成词典以及优化查询速度的方法