├── squirrel.custom.yaml ├── default.custom.yaml ├── README.md ├── pinyin_simp.schema.yaml ├── zhengma.schema.yaml ├── zhengma_pinyin.schema.yaml ├── zhengma_trad.schema.yaml └── LICENSE /squirrel.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | # 候选栏文字字号 3 | style/font_point: 18 4 | # 候选栏编号字号 5 | style/label_font_point: 18 6 | # App默认使用中文模式 7 | app_options: 8 | ascii_mode: 0 9 | -------------------------------------------------------------------------------- /default.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | schema_list: 3 | # 郑码 4 | - {schema: zhengma} 5 | # 郑码打简出繁 6 | - {schema: zhengma_trad} 7 | # 郑码拼音 8 | - {schema: zhengma_pinyin} 9 | 10 | # 配置caps_lock键为中/英切换键 11 | ascii_composer/good_old_caps_lock: false 12 | ascii_composer/switch_key: 13 | Caps_Lock: commit_code 14 | Shift_L: noop 15 | Shift_R: noop 16 | Control_L: noop 17 | Control_R: noop 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rime郑码方案 2 | 3 | ## 一、方案列表 4 | * 郑码(传统郑码输入方式) 5 | * 郑码拼音(同时支持郑码和拼音的输入方式) 6 | * 郑码打简出繁(按简体字的编码打出繁体字的方式) 7 | 8 | ## 二、方案特点 9 | * 词频固定,便于盲打。 10 | * 支持编码反查,不会被生僻字卡到。 11 | * 支持用户自造词,可以实现个性化词库。 12 | 13 | ## 三、关于词库 14 | 单字三万一千左右,词语两万八千左右。 15 | 16 | ## 四、编码反查 17 | 遇到不会打的字,按\`键(就是Tab上方那个按键)进入编码反查模式,输入拼音就能看到正确编码。 18 | 19 | ## 五、造词方法 20 | #### 1、一般造词方法 21 | 输入每个单字的编码,再选中合意的词,完成造词。 22 | 下面是造词“海星”的过程: 23 | 1)输入全部单字的编码vmzykmc。 24 | 2)系统会造出“海星”一词,右方太极图表明其临时词语的身份。 25 | 3)选择该临时词语。 26 | 4)从新输入词语编码vmkm。 27 | 5)“海星”一词自然出现。 28 | 6)再次选择该词语。 29 | 7)若该词语右方太极图消失,表明其已升至正式词语,造词成功。 30 | 31 | #### 2、使用分隔符 32 | 某些单字编码较短,系统难以正确切分,就必须在各单字编码之间加上单引号分隔符。 33 | 如词语“山人”,在输入全部单字编码时,直接输入llod是不可以的,必须输入ll'od。 34 | 35 | #### 3、删除自造词 36 | 在候选窗口中选中要删除的自造词,按Shift+Delete或Ctrl+Delete即可。 37 | 38 | ## 六、特殊字符 39 | 按/键加字符名可以输入特殊字符。如: 40 | * /sx:数学符号 41 | * /dw:单位符号 42 | * /hb:货币符号 43 | * /xl:希腊字母 44 | * /xld:希腊字母大写 45 | * /jm:日文假名 46 | * /pjm:日文片假名 47 | …… 48 | 更多定义请参考程序文件夹中的symbols.yaml文件。 49 | 50 | ## 七、快捷按键 51 | * Ctrl+空格:切换中英文输入 52 | * Ctrl+逗号:切换中英文输入 53 | * Ctrl+句号:切换中英文标点 54 | * Shift+空格:切换全角和半角 55 | * Ctrl+\`(就是Tab上方那个按键):打开方案选单 56 | 57 | ## 八、安装方法 58 | 1)将全部yaml文件复制到Rime用户文件夹中。 59 | 2)打开输入法设定,选择心仪的郑码方案即可。 60 | 61 | ## 九、依赖项目 62 | 编码反查及郑码拼音所需的拼音方案来自[rime-pinyin-simp](https://github.com/rime/rime-pinyin-simp)。 63 | -------------------------------------------------------------------------------- /pinyin_simp.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: pinyin_simp 6 | name: 袖珍简化字拼音 7 | version: "0.8" 8 | author: 9 | - 佚名 10 | description: | 11 | 源自 Android 拼音 12 | dependencies: 13 | - stroke 14 | 15 | switches: 16 | - name: ascii_mode 17 | reset: 0 18 | states: [ 中文, 西文 ] 19 | - name: full_shape 20 | states: [ 半角, 全角 ] 21 | - name: ascii_punct 22 | states: [ 。,, ., ] 23 | 24 | engine: 25 | processors: 26 | - ascii_composer 27 | - recognizer 28 | - key_binder 29 | - speller 30 | - punctuator 31 | - selector 32 | - navigator 33 | - express_editor 34 | segmentors: 35 | - ascii_segmentor 36 | - matcher 37 | - abc_segmentor 38 | - punct_segmentor 39 | - fallback_segmentor 40 | translators: 41 | - punct_translator 42 | - script_translator 43 | - reverse_lookup_translator 44 | 45 | speller: 46 | alphabet: zyxwvutsrqponmlkjihgfedcba 47 | delimiter: " '" 48 | algebra: 49 | - abbrev/^([a-z]).+$/$1/ 50 | - abbrev/^([zcs]h).+$/$1/ 51 | - derive/^([nl])ue$/$1ve/ 52 | - derive/^([jqxy])u/$1v/ 53 | - derive/un$/uen/ 54 | - derive/ui$/uei/ 55 | - derive/iu$/iou/ 56 | - derive/([aeiou])ng$/$1gn/ 57 | - derive/([dtngkhrzcs])o(u|ng)$/$1o/ 58 | - derive/ong$/on/ 59 | - derive/ao$/oa/ 60 | - derive/([iu])a(o|ng?)$/a$1$2/ 61 | 62 | translator: 63 | dictionary: pinyin_simp 64 | preedit_format: 65 | - xform/([nl])v/$1ü/ 66 | - xform/([nl])ue/$1üe/ 67 | - xform/([jqxy])v/$1u/ 68 | 69 | reverse_lookup: 70 | dictionary: stroke 71 | enable_completion: true 72 | prefix: "`" 73 | suffix: "'" 74 | tips: 〔笔画〕 75 | preedit_format: 76 | - xlit/hspnz/一丨丿丶乙/ 77 | 78 | punctuator: 79 | import_preset: symbols 80 | 81 | key_binder: 82 | import_preset: default 83 | 84 | recognizer: 85 | import_preset: default 86 | patterns: 87 | # hack: to enable "/fh" style symbols, '/' must be mapped to a [list]. 88 | # so those who have customized '/' for direct commit won't be affected by 89 | # this change. 90 | punct: "^/([0-9]+[a-z]*|[a-z]+)$" 91 | reverse_lookup: "`[a-z]*'?$" 92 | -------------------------------------------------------------------------------- /zhengma.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: zhengma 6 | name: "郑码" 7 | version: "1.0" 8 | author: 9 | - 发明人 郑易里先生 10 | description: 11 | 郑码输入 12 | 按 ` 键进入拼音反查 13 | dependencies: 14 | - pinyin_simp 15 | 16 | switches: 17 | - name: ascii_mode 18 | reset: 0 19 | states: [ 中文, 英文 ] 20 | - name: ascii_punct 21 | states: [ ,。, ,. ] 22 | - name: full_shape 23 | states: [ 半角, 全角 ] 24 | 25 | engine: 26 | processors: 27 | - ascii_composer 28 | - recognizer 29 | - key_binder 30 | - speller 31 | - punctuator 32 | - selector 33 | - navigator 34 | - express_editor 35 | segmentors: 36 | - ascii_segmentor 37 | - matcher 38 | - abc_segmentor 39 | - punct_segmentor 40 | - fallback_segmentor 41 | translators: 42 | - punct_translator 43 | - reverse_lookup_translator 44 | # 固定词频的翻译器 45 | - table_translator@fixed 46 | # 默认翻译器 47 | - table_translator 48 | filters: 49 | # 过滤重复字词 50 | - uniquifier 51 | 52 | #固定词频的翻译器 53 | fixed: 54 | # 源自默认翻译器 55 | __include: translator 56 | # 关闭用户词典 57 | enable_user_dict: false 58 | enable_completion: false 59 | # 最高出字优先级 60 | initial_quality: 1000 61 | 62 | speller: 63 | # 音节间分音符 64 | delimiter: "'" 65 | # 自动上屏 66 | auto_select: false 67 | # 最大码长超过则顶字上屏 68 | # max_code_length: 4 69 | 70 | translator: 71 | # 词典文件 72 | dictionary: zhengma 73 | # 字符集过滤 74 | enable_charset_filter: false 75 | # 自动造句 76 | enable_sentence: true 77 | # 自动造词 78 | enable_encoder: true 79 | # 对已上屏词自动成词 80 | encode_commit_history: false 81 | # 最大自动成词词长 82 | # max_phrase_length: 4 83 | # 逐渐提示 84 | enable_completion: true 85 | # 用户词典 86 | enable_user_dict: true 87 | disable_user_dict_for_patterns: 88 | - "^`.*$" 89 | 90 | reverse_lookup: 91 | # 反查码表 92 | dictionary: pinyin_simp 93 | prefix: "`" 94 | suffix: "'" 95 | tips: [ 拼音 ] 96 | preedit_format: 97 | - xform/([nl])v/$1ü/ 98 | - xform/([nl])ue/$1üe/ 99 | - xform/([jqxy])v/$1u/ 100 | 101 | key_binder: 102 | import_preset: default 103 | bindings: 104 | # Shift加空格切换全角和半角 105 | - { accept: Shift+space, toggle: full_shape, when: always } 106 | # Control加逗号切换中英文输入 107 | - { accept: Control+comma, toggle: ascii_mode, when: always } 108 | # Control加空格切换中英文输入 109 | - { accept: Control+space, toggle: ascii_mode, when: always } 110 | # Control加句号切换中英文标点 111 | - { accept: Control+period, toggle: ascii_punct, when: always } 112 | 113 | recognizer: 114 | import_preset: default 115 | patterns: 116 | # 编码反查 117 | reverse_lookup: "^`[a-z]*'?$" 118 | # 输入symbols.yaml中的特殊字符 119 | punct: "/[a-z]*$" 120 | 121 | ascii_composer: 122 | import_preset: default 123 | good_old_caps_lock: false 124 | switch_key: 125 | # Shift键不单独使用 126 | Shift_L: noop 127 | Shift_R: noop 128 | # Control键不单独使用 129 | Control_L: noop 130 | Control_R: noop 131 | Caps_Lock: clear 132 | Eisu_toggle: clear 133 | 134 | punctuator: 135 | import_preset: symbols 136 | # 中文标点符号 137 | half_shape: 138 | ',' : { commit: , } 139 | '.' : { commit: 。 } 140 | '<' : 《 141 | '>' : 》 142 | '/' : '/' 143 | '?' : { commit: ? } 144 | ';' : { commit: ; } 145 | ':' : { commit: : } 146 | '''' : { pair: [ '‘', '’' ] } 147 | '"' : { pair: [ '“', '”' ] } 148 | '\' : 、 149 | '|' : '|' 150 | '`' : '`' 151 | '~' : '~' 152 | '!' : { commit: ! } 153 | '@' : '@' 154 | '#' : '#' 155 | '%' : '%' 156 | '$' : ¥ 157 | '^' : { commit: …… } 158 | '&' : '&' 159 | '*' : '*' 160 | '(' : ( 161 | ')' : ) 162 | '-' : '-' 163 | '_' : '_' 164 | '+' : '+' 165 | '=' : '=' 166 | '[' : '[' 167 | ']' : ']' 168 | '{' : '{' 169 | '}' : '}' 170 | -------------------------------------------------------------------------------- /zhengma_pinyin.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: zhengma_pinyin 6 | name: "郑码拼音" 7 | version: "1.0" 8 | author: 9 | - 发明人 郑易里先生 10 | description: 11 | 郑码汉语拼音混合输入 12 | 按 ` 键进入拼音反查 13 | dependencies: 14 | - pinyin_simp 15 | 16 | switches: 17 | - name: ascii_mode 18 | reset: 0 19 | states: [ 中文, 英文 ] 20 | - name: ascii_punct 21 | states: [ ,。, ,. ] 22 | - name: full_shape 23 | states: [ 半角, 全角 ] 24 | 25 | engine: 26 | processors: 27 | - ascii_composer 28 | - recognizer 29 | - key_binder 30 | - speller 31 | - punctuator 32 | - selector 33 | - navigator 34 | - express_editor 35 | segmentors: 36 | - ascii_segmentor 37 | - matcher 38 | - abc_segmentor 39 | - punct_segmentor 40 | - fallback_segmentor 41 | translators: 42 | - punct_translator 43 | - reverse_lookup_translator 44 | # 固定词频的翻译器 45 | - table_translator@fixed 46 | # 默认翻译器 47 | - table_translator 48 | filters: 49 | # 过滤重复字词 50 | - uniquifier 51 | 52 | #固定词频的翻译器 53 | fixed: 54 | # 源自默认翻译器 55 | __include: translator 56 | # 关闭用户词典 57 | enable_user_dict: false 58 | enable_completion: false 59 | # 最高出字优先级 60 | initial_quality: 1000 61 | 62 | speller: 63 | # 音节间分音符 64 | delimiter: "'" 65 | # 自动上屏 66 | auto_select: false 67 | # 最大码长超过则顶字上屏 68 | # max_code_length: 4 69 | 70 | translator: 71 | dictionary: zhengma 72 | prism: zhengma_pinyin 73 | # 字符集过滤 74 | enable_charset_filter: false 75 | # 自动造句 76 | enable_sentence: true 77 | # 自动造词 78 | enable_encoder: true 79 | # 对已上屏词自动成词 80 | encode_commit_history: false 81 | # 最大自动成词词长 82 | # max_phrase_length: 4 83 | # 逐渐提示 84 | enable_completion: true 85 | # 用户词典 86 | enable_user_dict: true 87 | disable_user_dict_for_patterns: 88 | - "^`.*$" 89 | 90 | abc_segmentor: 91 | extra_tags: 92 | - reverse_lookup 93 | 94 | reverse_lookup: 95 | dictionary: pinyin_simp 96 | prefix: "`" 97 | suffix: "'" 98 | tips: [ 拼音 ] 99 | preedit_format: 100 | - xform/([nl])v/$1ü/ 101 | - xform/([nl])ue/$1üe/ 102 | - xform/([jqxy])v/$1u/ 103 | 104 | key_binder: 105 | import_preset: default 106 | bindings: 107 | # Shift加空格切换全角和半角 108 | - { accept: Shift+space, toggle: full_shape, when: always } 109 | # Control加逗号切换中英文输入 110 | - { accept: Control+comma, toggle: ascii_mode, when: always } 111 | # Control加空格切换中英文输入 112 | - { accept: Control+space, toggle: ascii_mode, when: always } 113 | # Control加句号切换中英文标点 114 | - { accept: Control+period, toggle: ascii_punct, when: always } 115 | 116 | recognizer: 117 | import_preset: default 118 | patterns: 119 | # 编码反查 120 | reverse_lookup: "^`[a-z]*'?$" 121 | # 输入symbols.yaml中的特殊字符 122 | punct: "/[a-z]*$" 123 | 124 | ascii_composer: 125 | import_preset: default 126 | good_old_caps_lock: false 127 | switch_key: 128 | # Shift键不单独使用 129 | Shift_L: noop 130 | Shift_R: noop 131 | # Control键不单独使用 132 | Control_L: noop 133 | Control_R: noop 134 | Caps_Lock: clear 135 | Eisu_toggle: clear 136 | 137 | punctuator: 138 | import_preset: symbols 139 | # 中文标点符号 140 | half_shape: 141 | ',' : { commit: , } 142 | '.' : { commit: 。 } 143 | '<' : 《 144 | '>' : 》 145 | '/' : '/' 146 | '?' : { commit: ? } 147 | ';' : { commit: ; } 148 | ':' : { commit: : } 149 | '''' : { pair: [ '‘', '’' ] } 150 | '"' : { pair: [ '“', '”' ] } 151 | '\' : 、 152 | '|' : '|' 153 | '`' : '`' 154 | '~' : '~' 155 | '!' : { commit: ! } 156 | '@' : '@' 157 | '#' : '#' 158 | '%' : '%' 159 | '$' : ¥ 160 | '^' : { commit: …… } 161 | '&' : '&' 162 | '*' : '*' 163 | '(' : ( 164 | ')' : ) 165 | '-' : '-' 166 | '_' : '_' 167 | '+' : '+' 168 | '=' : '=' 169 | '[' : '[' 170 | ']' : ']' 171 | '{' : '{' 172 | '}' : '}' 173 | -------------------------------------------------------------------------------- /zhengma_trad.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: zhengma_trad 6 | name: 郑码简入繁出 7 | version: "1.0" 8 | author: 9 | - 发明人 郑易里先生 10 | description: 11 | 郑码简入繁出 12 | 按 ` 键进入拼音反查 13 | dependencies: 14 | - pinyin_simp 15 | 16 | switches: 17 | - name: ascii_mode 18 | reset: 0 19 | states: [ 中文, 英文 ] 20 | - name: ascii_punct 21 | states: [ ,。, ,. ] 22 | - name: full_shape 23 | states: [ 半角, 全角 ] 24 | - name: zh_trad 25 | reset: 1 26 | states: [ 简体, 繁体 ] 27 | 28 | engine: 29 | processors: 30 | - ascii_composer 31 | - recognizer 32 | - key_binder 33 | - speller 34 | - punctuator 35 | - selector 36 | - navigator 37 | - express_editor 38 | segmentors: 39 | - ascii_segmentor 40 | - matcher 41 | - abc_segmentor 42 | - punct_segmentor 43 | - fallback_segmentor 44 | translators: 45 | - punct_translator 46 | - reverse_lookup_translator 47 | # 固定词频的翻译器 48 | - table_translator@fixed 49 | # 默认翻译器 50 | - table_translator 51 | filters: 52 | - simplifier 53 | - uniquifier 54 | 55 | #固定词频的翻译器 56 | fixed: 57 | # 源自默认翻译器 58 | __include: translator 59 | # 关闭用户词典 60 | enable_user_dict: false 61 | enable_completion: false 62 | # 最高出字优先级 63 | initial_quality: 1000 64 | 65 | speller: 66 | # 音节间分音符 67 | delimiter: "'" 68 | # 自动上屏 69 | auto_select: false 70 | # 最大码长超过则顶字上屏 71 | # max_code_length: 4 72 | 73 | translator: 74 | dictionary: zhengma 75 | prism: zhengma_trad 76 | # 字符集过滤 77 | enable_charset_filter: false 78 | # 自动造句 79 | enable_sentence: true 80 | # 自动造词 81 | enable_encoder: true 82 | # 对已上屏词自动成词 83 | encode_commit_history: false 84 | # 最大自动成词词长 85 | # max_phrase_length: 4 86 | # 逐渐提示 87 | enable_completion: true 88 | # 用户词典 89 | enable_user_dict: true 90 | disable_user_dict_for_patterns: 91 | - "^`.*$" 92 | 93 | reverse_lookup: 94 | dictionary: pinyin_simp 95 | prefix: "`" 96 | suffix: "'" 97 | tips: [ 拼音 ] 98 | preedit_format: 99 | - xform/([nl])v/$1ü/ 100 | - xform/([nl])ue/$1üe/ 101 | - xform/([jqxy])v/$1u/ 102 | 103 | simplifier: 104 | opencc_config: s2t.json 105 | option_name: zh_trad 106 | 107 | key_binder: 108 | import_preset: default 109 | bindings: 110 | # Shift加空格切换全角和半角 111 | - { accept: Shift+space, toggle: full_shape, when: always } 112 | # Control加逗号切换中英文输入 113 | - { accept: Control+comma, toggle: ascii_mode, when: always } 114 | # Control加空格切换中英文输入 115 | - { accept: Control+space, toggle: ascii_mode, when: always } 116 | # Control加句号切换中英文标点 117 | - { accept: Control+period, toggle: ascii_punct, when: always } 118 | 119 | recognizer: 120 | import_preset: default 121 | patterns: 122 | # 编码反查 123 | reverse_lookup: "^`[a-z]*'?$" 124 | # 输入symbols.yaml中的特殊字符 125 | punct: "/[a-z]*$" 126 | 127 | ascii_composer: 128 | import_preset: default 129 | good_old_caps_lock: false 130 | switch_key: 131 | # Shift键不单独使用 132 | Shift_L: noop 133 | Shift_R: noop 134 | # Control键不单独使用 135 | Control_L: noop 136 | Control_R: noop 137 | Caps_Lock: clear 138 | Eisu_toggle: clear 139 | 140 | punctuator: 141 | import_preset: symbols 142 | # 中文标点符号 143 | half_shape: 144 | ',' : { commit: , } 145 | '.' : { commit: 。 } 146 | '<' : 《 147 | '>' : 》 148 | '/' : '/' 149 | '?' : { commit: ? } 150 | ';' : { commit: ; } 151 | ':' : { commit: : } 152 | '''' : { pair: [ '‘', '’' ] } 153 | '"' : { pair: [ '“', '”' ] } 154 | '\' : 、 155 | '|' : '|' 156 | '`' : '`' 157 | '~' : '~' 158 | '!' : { commit: ! } 159 | '@' : '@' 160 | '#' : '#' 161 | '%' : '%' 162 | '$' : ¥ 163 | '^' : { commit: …… } 164 | '&' : '&' 165 | '*' : '*' 166 | '(' : ( 167 | ')' : ) 168 | '-' : '-' 169 | '_' : '_' 170 | '+' : '+' 171 | '=' : '=' 172 | '[' : '[' 173 | ']' : ']' 174 | '{' : '{' 175 | '}' : '}' 176 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------