From 43cfc4d2c67f2444c7dcd239f4ac6764a58d40c6 Mon Sep 17 00:00:00 2001 From: cipchk Date: Mon, 26 Nov 2018 13:53:27 +0800 Subject: [PATCH] init --- .editorconfig | 11 + .gitignore | 9 + .prettierrc | 5 + .vscode/launch.json | 16 ++ .vscode/tasks.json | 31 +++ .vscodeignore | 6 + LICENSE | 21 ++ README.md | 18 ++ icon.png | Bin 0 -> 7479 bytes package.json | 68 +++++++ src/dict.ts | 389 ++++++++++++++++++++++++++++++++++++ src/extension.ts | 57 ++++++ src/transverter.ts | 90 +++++++++ tsconfig.json | 20 ++ tslint.json | 14 ++ vsc-extension-quickstart.md | 20 ++ 16 files changed, 775 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 .prettierrc create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 .vscodeignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 icon.png create mode 100644 package.json create mode 100644 src/dict.ts create mode 100644 src/extension.ts create mode 100644 src/transverter.ts create mode 100644 tsconfig.json create mode 100644 tslint.json create mode 100644 vsc-extension-quickstart.md diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..89ae637 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = false +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03671c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# IDE +# .vscode + +/node_modules +package-lock.json +npm-debug.log +yarn.lock +*.vsix +/out diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..72f7c03 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "printWidth": 80, + "singleQuote": true, + "trailingComma": "all" +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..88cba68 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + "version": "0.2.0", + "configurations": [{ + "name": "Launch Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}"], + "stopOnEntry": false, + "sourceMaps": true, + "preLaunchTask": "npm", + "outFiles": [ + "${workspaceRoot}/out/**/*.js" + ] + }] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..4ee5745 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,31 @@ +// Available variables which can be used inside of strings. +// ${workspaceRoot}: the root folder of the team +// ${file}: the current opened file +// ${fileBasename}: the current opened file's basename +// ${fileDirname}: the current opened file's dirname +// ${fileExtname}: the current opened file's extension +// ${cwd}: the current working directory of the spawned process + +// A task runner that calls a custom npm script that compiles the extension. +{ + "tasks": [{ + "taskName": "npm", + // we want to run npm + "command": "npm", + // the command is a shell script + "isShellCommand": true, + // show the output window only if unrecognized errors occur. + "showOutput": "silent", + // we run the custom script "compile" as defined in package.json + "args": [ + "run", + "watch", + "--loglevel", + "silent" + ], + // The tsc compiler is started in watching mode + "isBackground": true, + // use the standard tsc in watch mode problem matcher to find compile problems in the output. + "problemMatcher": "$tsc-watch" + }] +} diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..14fe376 --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,6 @@ +.vscode/** +node_modules/** +src/** +.editorconfig +.gitignore +vsc-extension-quickstart.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..526ac71 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018-present 卡色 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9eed0cf --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +## zh-hans-tt-hant-vscode + +**简体与繁体互转**:VSCODE 中文简繁体转换器-支持台湾地区惯用词汇替换。 + +> 转换器来自 [chinese-transverter](https://github.com/mumuy/chinese-transverter)。 + +## 如何使用 + +打开命令面板,搜索 `zh-hans-tt-hant` 字样找到对应的命令,回车即可。 + +## 命令列表 + +| 命令 | 描述 | +| ---- | ---- | +| `zh-hans-to-zh-hant` | 简体转繁体 | +| `zh-hant-to-zh-hans` | 繁体转简体 | +| `zh-hans-to-zh-hant-tw` | 简体转繁体-含台湾地区惯用词 | +| `zh-hant-to-zh-hans-tw` | 繁体转简体-含台湾地区惯用词 | diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..af7ec4cec2e8e25c688a67575874983692a0c516 GIT binary patch literal 7479 zcmV-79mwK|P)C0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU#08mU+MgRZ*{{H^`{r&v>{QLX+0002` z`ug_v_V4fS?Ck9L`1tVf@b&fe_xJbt`T6tn^Xu#D^78WZ^z`xZ@#W>^;^N}g*4F9i z=~GivKtMq5?(W>&+}hgO)z#I-#l=5AKjh@(XlQ6XJw58`>ged`=jZ3t)YRbM;E9Qe zQc_YjHa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y4L64Bt;BR0 z#J(%pFm2g{ErSD{^i_!fo!e-zvk90gbfP`P7T1%2KNv0X zOvw0f$y<%*dzx6ltY@I&2nX0paBZO^BSTxM3Uj#Mr)>I}*SIM-Fj5~BoiUoS@oM(^ zNN8Or1kfA}`JhtzYh-Y3oD2LwW1IYI1uMkQY7Cxjm(^H$##1)JI6J0C)R=&=Rd&vG zVW9VqBBeXc+^tw829ehKOGSgDQzumPoLcg(x}^>S;b#`dERKm;JYz;oP|dQsW|z}D zMW0)C((hr6slG^+NknjZb>zeEn#r1*sTT*3UoSaL64GJRtSy-fD^^Dr%nUNsk)^5? z*;Chg{?~S)WBQEU=RU(tdQcK0tXdIE%p?x9NhA{6%|V0K4cUHk2o29Hy?(09TTuM; z*Ks*tPfzn!hy{f4n_2R!t@gwJ3>bIkL!g&V!;Juvp0SV@GLgEGB>Qm2+OZ=qEUTJ1 zI>Jkz;lraE8rSq4xO>yu;%ODBrA0pB`W$L-L;vNG2IGP>a%{w?T;JA*0>WJH96#FK zur_4$@HywUse4}rf+@seE)>hLlwWwIr7)U5N(BhBDsHY zFllw=55Jzz#;k}O9c1!f7B(^t{^`{CZWsDY@_X`Xpb4WS%4d+QJk`Q_#>eKp5A`{? z^wE89!x|DcJukJUYUJ`?tKz04tx{Lc9-O+Sd9ZJQ%ReZr9+wqg?6oS zh3vcycPAR~;8R}DWy_{!{2koFP? { + builder.replace(selection as any, transverter(text, options)); + }); +} + +export function activate(context: ExtensionContext) { + COMMANDS.forEach(item => { + context.subscriptions.push( + commands.registerTextEditorCommand(item.command, textEditor => { + process(textEditor, item.options); + }), + ); + }); +} + +export function deactivate(): void {} diff --git a/src/transverter.ts b/src/transverter.ts new file mode 100644 index 0000000..b95e8b2 --- /dev/null +++ b/src/transverter.ts @@ -0,0 +1,90 @@ +/** + * 来自:https://github.com/mumuy/chinese-transverter + */ + +import { DICT } from './dict'; + +export interface TransverterOptions { + type: 'simplified' | 'traditional'; + language: '' | 'zh_TW'; +} + +export function transverter(str: string, options: TransverterOptions) { + options = Object.assign( + { + type: 'simplified', + language: '', + }, + options, + ); + let source, + target, + result = '', + hash = {}; + if (options.type == 'traditional') { + source = DICT.simplified_chinese; + target = DICT.traditional_chinese; + for (const i in DICT.words) { + //固定词替换 + str = str.replace(i, DICT.words[i]); + } + if (options.language === 'zh_TW') { + //惯用词替换:简->繁 + for (const i in DICT.zh_TW) { + if (str.indexOf(i) > -1) { + str = str.replace(new RegExp(i, 'g'), DICT.zh_TW[i]); + } + } + } + } else { + source = DICT.traditional_chinese; + target = DICT.simplified_chinese; + for (const i in DICT.words) { + //固定词替换 + if (str.indexOf(DICT.words[i]) > -1) { + str = str.replace(new RegExp(DICT.words[i], 'g'), i); + } + } + for (const i in DICT.toSimplified) { + //单向替换:繁->简 + if (str.indexOf(i) > -1) { + str = str.replace(new RegExp(i, 'g'), DICT.toSimplified[i]); + } + } + } + for (let i = 0, len = str.length; i < len; i++) { + let noReplace = false; + let c = str[i]; + for (let j = 0; j < DICT.exception.length; j++) { + let index = str.indexOf(DICT.exception[j]); + if (i >= index && i < index + DICT.exception[j].length - 1) { + c = DICT.exception[j]; + noReplace = true; + break; + } + } + if (!noReplace) { + if (hash[c]) { + c = hash[c]; + } else { + let index = source.indexOf(c); + if (index > -1) { + c = hash[c] = target[index]; + } + } + } + result += c; + i += c.length - 1; + } + if (options.type == 'simplified') { + if (options.language == 'zh_TW') { + //惯用词替换:繁->简 + for (let i in DICT.zh_TW) { + if (result.indexOf(DICT.zh_TW[i]) > -1) { + result = result.replace(new RegExp(DICT.zh_TW[i], 'g'), i); + } + } + } + } + return result; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8c78732 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "out", + "lib": [ + "es2017", + "dom" + ], + "sourceMap": true, + "rootDir": ".", + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + ".vscode-test" + ] +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..4bb09dd --- /dev/null +++ b/tslint.json @@ -0,0 +1,14 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint:recommended" + ], + "jsRules": {}, + "rules": { + "quotemark": false, + "no-console": false, + "arrow-parens": false, + "member-access": false, + }, + "rulesDirectory": [] +} diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md new file mode 100644 index 0000000..b5db582 --- /dev/null +++ b/vsc-extension-quickstart.md @@ -0,0 +1,20 @@ +# Welcome to your VS Code Extension + +## What's in the folder +* This folder contains all of the files necessary for your extension +* `package.json` - this is the manifest file that defines the location of the snippet file +and specifies the language of the snippets +* `snippets/snippets.json` - the file containing all snippets + +## Get up and running straight away +* press `F5` to open a new window with your extension loaded +* create a new file with a file name suffix matching your language +* verify that your snippets are proposed on intellisense + +## Make changes +* you can relaunch the extension from the debug toolbar after making changes to the files listed above +* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes + +## Install your extension +* To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. +* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. \ No newline at end of file