switch-chinese 1.0.4 → 1.0.5
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/package.json +1 -1
- package/readme.md +12 -8
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -4,24 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/switch-chinese) [](https://www.npmjs.com/package/switch-chinese)
|
|
6
6
|
|
|
7
|
+
Install
|
|
8
|
+
---
|
|
9
|
+
``` shell
|
|
10
|
+
npm install switch-chinese
|
|
11
|
+
```
|
|
7
12
|
|
|
8
13
|
演示
|
|
9
14
|
---
|
|
10
15
|
+ 基礎用法
|
|
11
16
|
|
|
12
17
|
``` js
|
|
13
|
-
import Stcasc from './stcasc.lib.js';
|
|
14
18
|
const stcasc = Stcasc();
|
|
15
|
-
const sc = "香烟 香烟袅袅 烟雾里 里长面子 吃干面 干 把考卷发回来 卷发 知识产权";
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const sc = "简繁转换 繁简切换 香烟 香烟袅袅 烟雾里 里长面子 吃干面 干 把考卷发回来 卷发 知识产权";
|
|
20
|
+
const tc = stcasc.traditionalized(sc);
|
|
21
|
+
console.log(tc);
|
|
22
|
+
//簡繁轉換 繁簡切換 香菸 香煙裊裊 煙霧裡 里長面子 吃乾麵 幹 把考卷發回來 捲髮 智慧財產權
|
|
18
23
|
```
|
|
19
24
|
|
|
20
25
|
|
|
21
|
-
+
|
|
26
|
+
+ Import
|
|
22
27
|
|
|
23
28
|
``` shell
|
|
24
|
-
npm install switch-chinese
|
|
25
29
|
import Stcasc from 'switch-chinese';
|
|
26
30
|
```
|
|
27
31
|
|
|
@@ -35,8 +39,8 @@ stcasc.traditionalized("简体中文");
|
|
|
35
39
|
+ 轉簡體中文
|
|
36
40
|
|
|
37
41
|
``` js
|
|
38
|
-
stcasc.simplized("
|
|
39
|
-
|
|
42
|
+
stcasc.simplized("繁體中文");
|
|
43
|
+
//繁体中文
|
|
40
44
|
```
|
|
41
45
|
|
|
42
46
|
+ 添加快取,避免重複生成字典
|