├── .gitignore ├── LICENCE ├── README.md ├── icon.png ├── screenshot-usage-01.png ├── screenshot-usage-02.png ├── screenshot-usage-03.png └── workflow ├── CN_china.png ├── HK_hongKong.png ├── SimplifiedChinese.png ├── TW_taiwan.png ├── TraditionalChinese.png ├── alfred.py ├── chineseconverter.py ├── icon.png ├── info.plist └── opencc ├── __init__.py ├── data ├── mix2zhs.ini ├── mix2zht.ini ├── simp_to_trad_characters.ocd ├── simp_to_trad_phrases.ocd ├── trad_to_simp_characters.ocd ├── trad_to_simp_phrases.ocd ├── zhs2zht.ini └── zht2zhs.ini └── version.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | 47 | # Translations 48 | *.mo 49 | *.pot 50 | 51 | # Django stuff: 52 | *.log 53 | 54 | # Sphinx documentation 55 | docs/_build/ 56 | 57 | # PyBuilder 58 | target/ -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Amo Wu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Alfred Chinese Converter 簡繁轉換 2 | 3 | [![Stories in Ready](https://badge.waffle.io/amowu/alfred-chinese-converter.png?label=ready&title=Ready)](https://waffle.io/amowu/alfred-chinese-converter) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/amowu/alfred-chinese-converter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 4 | 5 | ![icon](icon.png) 6 | 7 | ## Introduction 介紹 8 | 9 | 使用開源項目 [OpenCC](https://github.com/BYVoid/OpenCC)(開放中文轉換)開發的 [Alfred 2](http://www.alfredapp.com/) workflow,支持簡繁體中文的[詞彙級別轉換](https://zh.wikipedia.org/wiki/%E7%B9%81%E7%B0%A1%E8%BD%89%E6%8F%9B#.E8.A9.9E.E5.B0.8D.E8.A9.9E.E7.9B.B8.E4.BA.92.E8.BD.89.E6.8F.9B)、[異體字轉換](https://zh.wikipedia.org/wiki/%E7%B9%81%E7%B0%A1%E8%BD%89%E6%8F%9B#.E5.AD.97.E5.AF.B9.E5.AD.97.E7.9B.B8.E4.BA.92.E8.BD.AC.E6.8D.A2)以及[地區習慣用詞轉換](https://zh.wikipedia.org/wiki/%E7%B9%81%E7%B0%A1%E8%BD%89%E6%8F%9B#.E5.9C.B0.E5.8C.BA.E7.94.A8.E8.AF.AD.E8.BD.AC.E6.8D.A2)(中國大陸、臺灣、香港)。 10 | 11 | ## Features 特點 12 | 13 | 節選自 [OpenCC](https://github.com/BYVoid/OpenCC) 的部份特點: 14 | 15 | > - 嚴格區分「一簡對多繁」和「一簡對多異」。 16 | > - 完全兼容異體字,可以實現動態替換。 17 | > - 嚴格審校一簡對多繁詞條,原則爲「能分則不合」。 18 | > - 支持中國大陸、臺灣、香港異體字和地區習慣用詞轉換,如「裏」「裡」、「鼠標」「滑鼠」。 19 | > - 詞庫和函數庫完全分離,可以自由修改、導入、擴展。 20 | 21 | ## Installation 安裝 22 | 23 | Mac OS X 環境底下,使用 [Homebrew](http://brew.sh/) 安裝 [OpenCC](https://github.com/BYVoid/OpenCC) 這套開放中文轉換庫: 24 | 25 | ```bash 26 | $ brew install opencc 27 | ``` 28 | 29 | ## Download 下載 30 | 31 | 📎 [alfred-chinese-converter.alfredworkflow](https://github.com/amowu/alfred-chinese-converter/releases/download/1.0.0/alfred-chinese-converter.alfredworkflow) v1.0.0 32 | 33 | ## Usage 用法 34 | 35 | 使用關鍵字 `cc` 輸入需要作簡繁轉換的詞句: 36 | 37 | ![輸入關鍵字 cc,然後接著輸入要轉換的詞句](screenshot-usage-01.png) 38 | 39 | Alfred 會列出 7 項轉換結果: 40 | 41 | - 簡體到繁體 42 | - 繁體到簡體 43 | - 簡體到臺灣正體 44 | - 臺灣正體到簡體 45 | - 簡體到香港繁體(香港小學學習字詞表標準) 46 | - 香港繁體(香港小學學習字詞表標準)到簡體 47 | - 簡體到繁體(臺灣正體標準)並轉換爲臺灣常用詞彙 48 | 49 | ![選擇其中一項轉換結果,然後 Enter](screenshot-usage-02.png) 50 | 51 | 選擇其中一筆結果,自動複製至剪貼簿: 52 | 53 | ![成功複製到剪貼簿](screenshot-usage-03.png) 54 | 55 | ## License 許可協議 56 | 57 | MIT License 58 | 59 | ## Third Party Library 第三方庫 60 | 61 | - [alfred-python](https://github.com/nikipore/alfred-python) Apache License 2.0 62 | - [opencc-python](https://github.com/lepture/opencc-python) Apache License 2.0 63 | 64 | ## Contributors 貢獻者 65 | 66 | - [Hank Wang](https://github.com/hanksudo) 67 | - [Michael Waterfall](https://github.com/mwaterfall/alfred-datetime-format-converter) 68 | - [Khanh Ly](https://dribbble.com/shots/1948154-Country-flags-Retail-Loyalty-Congress-2015) 69 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/icon.png -------------------------------------------------------------------------------- /screenshot-usage-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/screenshot-usage-01.png -------------------------------------------------------------------------------- /screenshot-usage-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/screenshot-usage-02.png -------------------------------------------------------------------------------- /screenshot-usage-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/screenshot-usage-03.png -------------------------------------------------------------------------------- /workflow/CN_china.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/CN_china.png -------------------------------------------------------------------------------- /workflow/HK_hongKong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/HK_hongKong.png -------------------------------------------------------------------------------- /workflow/SimplifiedChinese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/SimplifiedChinese.png -------------------------------------------------------------------------------- /workflow/TW_taiwan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/TW_taiwan.png -------------------------------------------------------------------------------- /workflow/TraditionalChinese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/TraditionalChinese.png -------------------------------------------------------------------------------- /workflow/alfred.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import itertools 3 | import os 4 | import plistlib 5 | import unicodedata 6 | import sys 7 | 8 | from xml.etree.ElementTree import Element, SubElement, tostring 9 | 10 | """ 11 | You should run your script via /bin/bash with all escape options ticked. 12 | The command line should be 13 | 14 | python yourscript.py "{query}" arg2 arg3 ... 15 | """ 16 | UNESCAPE_CHARACTERS = u""" ;()""" 17 | 18 | _MAX_RESULTS_DEFAULT = 9 19 | 20 | preferences = plistlib.readPlist('info.plist') 21 | bundleid = preferences['bundleid'] 22 | 23 | class Item(object): 24 | @classmethod 25 | def unicode(cls, value): 26 | try: 27 | items = iter(value.items()) 28 | except AttributeError: 29 | return unicode(value) 30 | else: 31 | return dict(map(unicode, item) for item in items) 32 | 33 | def __init__(self, attributes, title, subtitle, icon=None): 34 | self.attributes = attributes 35 | self.title = title 36 | self.subtitle = subtitle 37 | self.icon = icon 38 | 39 | def __str__(self): 40 | return tostring(self.xml()).decode('utf-8') 41 | 42 | def xml(self): 43 | item = Element(u'item', self.unicode(self.attributes)) 44 | for attribute in (u'title', u'subtitle', u'icon'): 45 | value = getattr(self, attribute) 46 | if value is None: 47 | continue 48 | if len(value) == 2 and isinstance(value[1], dict): 49 | (value, attributes) = value 50 | else: 51 | attributes = {} 52 | SubElement(item, attribute, self.unicode(attributes)).text = self.unicode(value) 53 | return item 54 | 55 | def args(characters=None): 56 | return tuple(unescape(decode(arg), characters) for arg in sys.argv[1:]) 57 | 58 | def config(): 59 | return _create('config') 60 | 61 | def decode(s): 62 | return unicodedata.normalize('NFD', s.decode('utf-8')) 63 | 64 | def uid(uid): 65 | return u'-'.join(map(str, (bundleid, uid))) 66 | 67 | def unescape(query, characters=None): 68 | for character in (UNESCAPE_CHARACTERS if (characters is None) else characters): 69 | query = query.replace('\\%s' % character, character) 70 | return query 71 | 72 | def work(volatile): 73 | path = { 74 | True: '~/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data', 75 | False: '~/Library/Application Support/Alfred 2/Workflow Data' 76 | }[bool(volatile)] 77 | return _create(os.path.join(os.path.expanduser(path), bundleid)) 78 | 79 | def write(text): 80 | sys.stdout.write(text) 81 | 82 | def xml(items, maxresults=_MAX_RESULTS_DEFAULT): 83 | root = Element('items') 84 | for item in itertools.islice(items, maxresults): 85 | root.append(item.xml()) 86 | return tostring(root, encoding='utf-8') 87 | 88 | def _create(path): 89 | if not os.path.isdir(path): 90 | os.mkdir(path) 91 | if not os.access(path, os.W_OK): 92 | raise IOError('No write access: %s' % path) 93 | return path 94 | -------------------------------------------------------------------------------- /workflow/chineseconverter.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | import alfred 3 | import opencc 4 | 5 | 6 | def process(query_str): 7 | """Entry Point""" 8 | if query_str is not None: 9 | results = alfred_items_for_value(query_str) 10 | xml = alfred.xml(results) # compiles the XML answer 11 | alfred.write(xml) # writes the XML back to Alfred 12 | 13 | 14 | def alfred_items_for_value(value): 15 | """ 16 | Given a Chinese language string, return a list of alfred items for each of the results 17 | """ 18 | index = 0 19 | results = [] 20 | 21 | config_list = [ 22 | ('t2s.json', u'繁體到簡體', 'SimplifiedChinese.png'), 23 | ('s2t.json', u'簡體到繁體', 'TraditionalChinese.png'), 24 | ('s2tw.json', u'簡體到臺灣正體', 'TW_taiwan.png'), 25 | ('tw2s.json', u'臺灣正體到簡體', 'CN_china.png'), 26 | ('s2hk.json', u'簡體到香港繁體', 'HK_hongKong.png'), 27 | ('hk2s.json', u'香港繁體(香港小學學習字詞表標準)到簡體', 'CN_china.png'), 28 | ('tw2sp.json', u'繁體(臺灣正體標準)到簡體並轉換爲中國大陸常用詞彙', 'CN_china.png'), 29 | ('s2twp.json', u'簡體到繁體(臺灣正體標準)並轉換爲臺灣常用詞彙', 'TW_taiwan.png'), 30 | ] 31 | for config_file, description, icon in config_list: 32 | converter = opencc.OpenCC( 33 | config=config_file, opencc_path='/usr/local/bin/opencc') 34 | item_value = converter.convert(value) 35 | results.append(alfred.Item( 36 | title=item_value, 37 | subtitle=description, 38 | attributes={ 39 | 'uid': alfred.uid(index), 40 | 'arg': item_value, 41 | }, 42 | icon=icon, 43 | )) 44 | index += 1 45 | 46 | return results 47 | 48 | if __name__ == '__main__': 49 | try: 50 | query_str = alfred.args()[0] 51 | except IndexError: 52 | query_str = None 53 | process(query_str) 54 | -------------------------------------------------------------------------------- /workflow/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/icon.png -------------------------------------------------------------------------------- /workflow/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.amowu.chineseconverter 7 | category 8 | Tools 9 | connections 10 | 11 | 0A7F94DA-8824-4BEA-892C-25D9882A4143 12 | 13 | 14 | destinationuid 15 | 7F9665D5-6218-48CD-A0BD-8DC8504B53BD 16 | modifiers 17 | 0 18 | modifiersubtext 19 | 20 | 21 | 22 | destinationuid 23 | 148821F7-6868-4034-9B5D-B8D238F0876B 24 | modifiers 25 | 0 26 | modifiersubtext 27 | 28 | 29 | 30 | 31 | createdby 32 | Amo Wu 33 | description 34 | Convert Chinese between Traditional and Simplified by OpenCC 35 | disabled 36 | 37 | name 38 | Chinese Converter 39 | objects 40 | 41 | 42 | config 43 | 44 | autopaste 45 | 46 | clipboardtext 47 | {query} 48 | 49 | type 50 | alfred.workflow.output.clipboard 51 | uid 52 | 7F9665D5-6218-48CD-A0BD-8DC8504B53BD 53 | version 54 | 0 55 | 56 | 57 | config 58 | 59 | argumenttype 60 | 0 61 | escaping 62 | 36 63 | keyword 64 | cc 65 | queuedelaycustom 66 | 1 67 | queuedelayimmediatelyinitially 68 | 69 | queuedelaymode 70 | 0 71 | queuemode 72 | 1 73 | runningsubtext 74 | 簡繁轉換中... 75 | script 76 | python chineseconverter.py "{query}" 77 | subtext 78 | 支持簡繁體中文的詞彙級別轉換、異體字轉換以及地區習慣用詞轉換(中國大陸、臺灣、香港)。 79 | title 80 | 請輸入需要簡繁轉換的詞句... 81 | type 82 | 0 83 | withspace 84 | 85 | 86 | type 87 | alfred.workflow.input.scriptfilter 88 | uid 89 | 0A7F94DA-8824-4BEA-892C-25D9882A4143 90 | version 91 | 0 92 | 93 | 94 | config 95 | 96 | lastpathcomponent 97 | 98 | onlyshowifquerypopulated 99 | 100 | output 101 | 0 102 | removeextension 103 | 104 | sticky 105 | 106 | text 107 | Copied {query} 108 | title 109 | Chinese Converter 110 | 111 | type 112 | alfred.workflow.output.notification 113 | uid 114 | 148821F7-6868-4034-9B5D-B8D238F0876B 115 | version 116 | 0 117 | 118 | 119 | readme 120 | https://github.com/amowu/alfred-chinese-converter 121 | uidata 122 | 123 | 0A7F94DA-8824-4BEA-892C-25D9882A4143 124 | 125 | ypos 126 | 60 127 | 128 | 148821F7-6868-4034-9B5D-B8D238F0876B 129 | 130 | ypos 131 | 180 132 | 133 | 7F9665D5-6218-48CD-A0BD-8DC8504B53BD 134 | 135 | ypos 136 | 60 137 | 138 | 139 | webaddress 140 | http://amowu.com 141 | 142 | 143 | -------------------------------------------------------------------------------- /workflow/opencc/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | import os 3 | import subprocess 4 | 5 | from version import __version__ 6 | 7 | _package_dir = os.path.abspath(os.path.dirname(__file__)) 8 | 9 | #: path to data folder 10 | DATA_PATH = os.path.join(_package_dir, 'data') 11 | 12 | #: path to bin folder 13 | BIN_PATH = os.path.join(_package_dir, 'bin') 14 | 15 | #: build-in configurations 16 | BUILDIN_CONFIGS = { 17 | 's2t': os.path.join(DATA_PATH, 'zhs2zht.ini'), 18 | 't2s': os.path.join(DATA_PATH, 'zht2zhs.ini'), 19 | 'mix2t': os.path.join(DATA_PATH, 'mix2zht.ini'), 20 | 'mix2s': os.path.join(DATA_PATH, 'mix2zhs.ini'), 21 | } 22 | 23 | class OpenCC(object): 24 | """Interface for convert Traditional Chinese to Simplified Chinese or vice 25 | versa 26 | 27 | """ 28 | 29 | def __init__( 30 | self, 31 | config, 32 | opencc_path=os.path.join(BIN_PATH, 'opencc'), 33 | data_path=DATA_PATH 34 | ): 35 | """ 36 | 37 | config is the path to opencc configuration, it can also be a name in 38 | BUILDIN_CONFIGS, and opencc_path is the path to the opencc executable 39 | file, default is 'opencc' 40 | 41 | """ 42 | if config in BUILDIN_CONFIGS: 43 | config = BUILDIN_CONFIGS[config] 44 | #: the path to configuration of opencc 45 | self.confg = config 46 | #: the path to opencc executable 47 | self.opencc_path = opencc_path 48 | #: the path to data_path 49 | self.data_path = data_path 50 | 51 | def convert(self, text): 52 | """Convert text 53 | 54 | """ 55 | proc = subprocess.Popen([self.opencc_path, '-c', self.confg], 56 | cwd=self.data_path, 57 | stdin=subprocess.PIPE, 58 | stdout=subprocess.PIPE) 59 | proc.stdin.write(text.encode('utf8')) 60 | proc.stdin.close() 61 | code = proc.wait() 62 | if code: 63 | raise RuntimeError('Failed to call opencc with exit code %s' % code) 64 | result = proc.stdout.read() 65 | return result.decode('utf8') -------------------------------------------------------------------------------- /workflow/opencc/data/mix2zhs.ini: -------------------------------------------------------------------------------- 1 | ; Open Chinese Convert 2 | ; 3 | ; Copyright 2010 BYVoid 4 | ; 5 | ; Licensed under the Apache License, Version 2.0 (the "License"); 6 | ; you may not use this file except in compliance with the License. 7 | ; You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, software 12 | ; distributed under the License is distributed on an "AS IS" BASIS, 13 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ; See the License for the specific language governing permissions and 15 | ; limitations under the License. 16 | 17 | title = mix_to_simp 18 | description = Standard Configuration for Conversion from Simplified-Traditional-Mixed Chinese to Simplified Chinese 19 | dict0 = OCD simp_to_trad_characters.ocd 20 | dict1 = OCD trad_to_simp_phrases.ocd 21 | dict1 = OCD trad_to_simp_characters.ocd 22 | -------------------------------------------------------------------------------- /workflow/opencc/data/mix2zht.ini: -------------------------------------------------------------------------------- 1 | ; Open Chinese Convert 2 | ; 3 | ; Copyright 2010 BYVoid 4 | ; 5 | ; Licensed under the Apache License, Version 2.0 (the "License"); 6 | ; you may not use this file except in compliance with the License. 7 | ; You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, software 12 | ; distributed under the License is distributed on an "AS IS" BASIS, 13 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ; See the License for the specific language governing permissions and 15 | ; limitations under the License. 16 | 17 | title = mix_to_trad 18 | description = Standard Configuration for Conversion from Simplified-Traditional-Mixed Chinese to Traditional Chinese 19 | dict0 = OCD trad_to_simp_characters.ocd 20 | dict1 = OCD simp_to_trad_phrases.ocd 21 | dict1 = OCD simp_to_trad_characters.ocd 22 | -------------------------------------------------------------------------------- /workflow/opencc/data/simp_to_trad_characters.ocd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/opencc/data/simp_to_trad_characters.ocd -------------------------------------------------------------------------------- /workflow/opencc/data/simp_to_trad_phrases.ocd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/opencc/data/simp_to_trad_phrases.ocd -------------------------------------------------------------------------------- /workflow/opencc/data/trad_to_simp_characters.ocd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/opencc/data/trad_to_simp_characters.ocd -------------------------------------------------------------------------------- /workflow/opencc/data/trad_to_simp_phrases.ocd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amowu/alfred-chinese-converter/7d881120d33fb9a6d51370b78ee5b55fbcfc0a8e/workflow/opencc/data/trad_to_simp_phrases.ocd -------------------------------------------------------------------------------- /workflow/opencc/data/zhs2zht.ini: -------------------------------------------------------------------------------- 1 | ; Open Chinese Convert 2 | ; 3 | ; Copyright 2010 BYVoid 4 | ; 5 | ; Licensed under the Apache License, Version 2.0 (the "License"); 6 | ; you may not use this file except in compliance with the License. 7 | ; You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, software 12 | ; distributed under the License is distributed on an "AS IS" BASIS, 13 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ; See the License for the specific language governing permissions and 15 | ; limitations under the License. 16 | 17 | title = simp_to_trad 18 | description = Standard Configuration for Conversion from Simplified Chinese to Traditional Chinese 19 | dict0 = OCD simp_to_trad_phrases.ocd 20 | dict0 = OCD simp_to_trad_characters.ocd 21 | -------------------------------------------------------------------------------- /workflow/opencc/data/zht2zhs.ini: -------------------------------------------------------------------------------- 1 | ; Open Chinese Convert 2 | ; 3 | ; Copyright 2010 BYVoid 4 | ; 5 | ; Licensed under the Apache License, Version 2.0 (the "License"); 6 | ; you may not use this file except in compliance with the License. 7 | ; You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, software 12 | ; distributed under the License is distributed on an "AS IS" BASIS, 13 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ; See the License for the specific language governing permissions and 15 | ; limitations under the License. 16 | 17 | title = trad_to_simp 18 | description = Standard Configuration for Conversion from Traditional Chinese to Simplified Chinese 19 | dict0 = OCD trad_to_simp_phrases.ocd 20 | dict0 = OCD trad_to_simp_characters.ocd 21 | -------------------------------------------------------------------------------- /workflow/opencc/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '0.1' --------------------------------------------------------------------------------