模板:Braille cell
⠀
本模板使用以下模板樣式: |
- 基本使用,內文:
{{Braille cell|A|B|C}}
→ ⠁⠃⠉ - 圖形:
{{Braille cell|A|B|C|type=image|size=15px}}
→ - 所有參數:
{{Braille cell|code1|code2|code3|...|code20|lang=|type=|size=|caption=|background=}}
在系統內設值的,盲文指的是英語盲文(2級),以及任何抽象形式(「點-136」)。
- Substituted:
{{subst:Braille cell|code1}}
使用概述
[編輯]code1, 2, 3, ..., 20. Letter definitions to be translated to a braille cell (case insensitive, A=a). Only the first unnamed parameter is evaluated when this template is substituted, and only dot patterns in numeric order are valid input.
lang for the braille language. Four braille languages are recognised: English (grade 2), French, Japanese and Korean braille. English (grade 2) braille is default so doesn't have to be entered, the other languages should be defined (e.g. lang=Japanese
).
type. Type of braille cell to be shown: 6-dot cell image, 8-dot cell image, in-line text character 6, 6dot, 8, 8dot, image, text
. The default is text (inline font character). For Japanese and Korean braille script, entering type=Korean
produces illustrative colored braille cells (see Korean braille). These two types are default for their languages.
size. Width size of the image (in px
) of font-size of the inline text (like %, em, px). Add the unit to the number (e.g. size=20px
for 6dot/8dot images, and 10px, 2em, 150%
for fontsize).
caption. A descriptive caption (mouse hover text) for a braille character is added. It can be shortened to the simple definition (caption=
(<blank>), and be hidden (caption=no
).
background or bg. Sets the background color. For type=text
only. Default is #f4f4f4
. Examples:
{{Braille cell|K|L|M|type=text}}
→ ⠅⠇⠍{{Braille cell|K|L|M|type=text|background=yellow}}
→ ⠅⠇⠍{{Braille cell|K|L|M|type=text|background=transparent}}
→ ⠅⠇⠍
輸入值
[編輯]Possible input: plain text and various braille cell definitions (see below). Up to 20 cells can be indicated in a single call to the template, each dot pattern separated with a pipe character "|". Skipping a code is read as a blank cell (e.g. {{braille cell|A||b|o|o|k
introduces a blank cell after "A").
All defined input values will output a single Braille cell.
Acceptable input values to produce braille cells are of the following types:
字母
[編輯]簡單英文字母 - 大寫或小寫:"A", "c", "X", "W", "z", 等。6點,8點,及日本型式單元均有效。
Accented French letters - capital or lower case: "È", "Ö", "å", etc.
Double letters and words - capital or lower case: "st", "SH", "for", "Th", "ing", etc.
Japanese letters - Katakana, hiragana, and Japanese diacritics (e.g. "dakuten", "chōon", "-Y-", etc.) are valid input for 6-dot, 8-dot, text, and Japanese cell types, with Romaji valid for Japanese cells only.
Korean letters - The {{positional Hangul jamo}} are valid input for 6-dot, 8-dot, text, and Korean cell types, with Revised Romanization (X- for initial, -X for final consonants) valid for Korean cells only.
其它字型
[編輯]數字 - 以數字符號為前綴:"#0" (="J"), "#7" (="G")等。
Punctuation - signs or names: "exclamation", ".", "openquote", "bracket", etc.
Other symbols - "null" or "blank", "accent" or "`", "contraction" or "contr2", "capital", "decimal", "contr3" or "space" (dots 4+5), "correction", "cursive" or "contr1", "number" or "#".
Notes - For the question mark "?" in French, use lang=French
. Otherwise it will produce (default) the English braille. The French "space" is the third English Braille contraction prefix, while English Braille space is "blank" or "null", and French "cursive" is the first English Braille contractions prefix.
盲文單元定義(點編號)
[編輯]Four options can be used in this Braille cell template to produce a cell, and all are case-insensitive (A=a).
{{braille cell|1234|1423|⠏|U+280F|u+280f}}
→ ⠏⠏⠏⠏⠏
Note that this cell definition is unrelated to any language (no "A" assigned).
A braille cell is defined by naming the raised dots. In 6-dot notation there are 64 combinations, in 8-dot notation this number is 256 (including all 6-dot cells). Such a definition is independent of the braille language (there is no connection with a letter A; this is for the Braille language to add).
Using the cell numbering shown here, one can simply mention the raised dots: say dots-1234 for ⠏. The numeric order can be in raising numeric order ("123456"), or in row-by-row order ("142536"), so the same cell is uniquely identified by 1234
or by 1423
. A dot pattern in rising numeric order is the only valid input when substituting this template.
Another identification is the Unicode character, ⠏, that is U+280F ⠏ BRAILLE PATTERN DOTS-1234 ,HTML:⠏
,block: Braille Patterns. The block has a mapping from raised dots to character id in the range U+28xx.
Inversely, a cell can be defined by its Unicode character id: U+280F defines cell with raised dots-1234.
對於1829盲文單元之盲文單元定義
[編輯]{{braille cell|1234|A23|size=20|type=image}}
→
The 1829 Braille standard established the option of a bar across a row in addition to any combination of the two dots. In 1829 notation, there are 125 combinations, including all 64 valid regular 6-dot cell configurations.
Using the cell numbering shown here, one can simply define the raised rows: A, B, C, AB, AC, BC, or ABC, followed by the raised dots in rows not occupied by a bar ("0" for no dots). The order of the bars and numbers can be in rising order ("ABC123456"), with letters (bars) before numbers (dots), or in row-by-row order ("A14B25C36"), so the same cell is uniquely identified by AC25
or by A25C
.
The 1829 Braille standard is not compatible with the Unicode Braille specification, and neither a text character, nor a Unicode code point will output an 1829 Braille cell.
特殊選項
[編輯]兩個輸入代碼可以產生特殊的非盲文輸出。
單元編號概述
[編輯]dot numbers
returns the overview of dot numbers 1–8. It can only be type=image
:
{{braille cell|dot numbers|type=image|size=40px}}
→
空白
[編輯]null
或 whitespace
產生一個實際得到空白,而不是空白的盲文單元:
{{braille cell|type=text|H|e|l|l|o|NULL|w|o|r|l|d}}
→ ⠓⠑⠇⠇⠕ ⠺⠕⠗⠇⠙
語言
[編輯]lang=
表示英語,法語,日語,韓語等語種的盲文。英語盲文及其衍生項目是系統內設的。
日本和韓國盲文
[編輯]Japanese braille and Korean braille have setting options from an earlier version of this template. They can be declared using type=Japanese
. Doing so returns colored braillecells for clarification.
lang= |
type= |
顯現 | 備註 |
---|---|---|---|
<沒有用到> | <沒有用到> | 英語,6dot b/w | 系統內設 |
<沒有用到> | 6dot | 6dot b/w | 不變 |
<沒有用到> | 韓語 | 6dot 有色韓語 | 不變 (deprecated; use lang=Korean instead)
|
<沒有用到> | 日語 | 6dot 有色日語 | 不變 (deprecated; use lang=Japanese instead)
|
8dot | <沒有用到> | 8dot b/w | 不變 |
本文 | 字母 (總是為 8dot) | 不變 | |
日語 | 6dot | 6dot b/w | 新選項 |
韓語 | 6dot | 6dot b/w | 新選項 |
日語 | 8dot | 8dot b/w | 新選項 |
韓語 | 8dot | 8dot b/w | 新選項 |
In general, the language should be entered lang=Japanese
. The parameter type
then is available as default (colored cells) or enforcing 6dot black/white cells for Japanese or Korean.
型式
[編輯]type=6dot, 8dot, image, text
. Default: text (as a character from the font). When dot 7 or 8 is used, always the 8-dot image is shown, any 6-dot setting is overruled.
大小
[編輯]- When text,
size=150% or 3em or 40px
(Default: 100%, so regular font size). - When image, in px:
size=20px
背景設定
[編輯]可以設定為文本輸出(不適用於圖像輸出)。
{{Braille cell|K|L|M}}
→ ⠅⠇⠍{{Braille cell|K|L|M|background=yellow}}
→ ⠅⠇⠍{{Braille cell|K|L|M|bg=yellow}}
→ ⠅⠇⠍ (shortcut){{Braille cell|K|L|M|background=transparent}}
→ ⠅⠇⠍
說明
[編輯]The cell has a caption (mouse hover text), based on the input. When the template is substituted, no caption is generated.
可能錯誤
[編輯]Possible errors that are caught:
- Input is not recognised as a braille code:
{{Braille cell|xyz}}
→ 錯誤使用{{Braille cell}}
:輸入「xyz」不受支持。
- More than 20 (braille) characters are requested:
{{Braille cell|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|type=text}}
→ ⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚⠅⠇⠍⠝⠕⠏⠟⠗⠎⠞錯誤使用{{Braille cell}}
:輸入超過 20 個布萊葉盲文符號。
Article pages with a red error message also are listed in Category:Unsupported braille input.
- Numbers and dot number: Input "#2" is for the cell meaning decimal number two, input "2" produces the dot number 2 cell:
{{Braille cell|#2|2}}
→ .
This mistake is not caught or noted. The intention of the editor (input is dot-number or decimal number) cannot be deduced.
範例
[編輯]6-dot單元,基本的字母輸入: {{Braille cell | X}} - ⠭
Japanese multi-cell: {{Braille cell | y dakuten | か | chōon | type=kana}} -
Korean multi-cell:{{Braille cell | h- | ᅡ | ᆫ | type=hangul}} -
8-dot cell, basic letter input: {{Braille cell | type=8 | X}} -
Unicode text character, large size, basic letter input: {{Braille cell | type=Unicode | size=300% | X}} - ⠭
6-dot cell, small size, title text: {{Braille cell | size=25 | X | text=a small braille X}} - ⠭
6-dot, dot order input: {{Braille cell | 12536}} - ⠷
bottom dots, numeric order input: {{Braille cell | type=8 | 2478}} -
Same input, but substituted (note that only the first unnamed parameter is evaluated): {{subst:Braille cell | type=8 | 2478}} - ⣊
概述
[編輯]技術細節
[編輯]The parameter name "dot-id" is used to define a braille cell. It is the numbering of the raised dots, like 136
for ⠥. The sequence is climbing: 12345678, as is used in the Unicode character name: "Braille pattern dots-136".
- {{Braille cell}}: separates numbered parameters into individual calls to /main.
- {{Braille cell/main}}: calls /main2. Converts a single input code plus named parameters into appropriate braille cell id ("dot-id") and input code. Contains the list with non-English code translations (other languages).
- {{Braille cell/main2}}: Calls /core. Prepares input texts and codes, using the now determined cell id. Checks for and shows error message.
- {{Braille cell/core}}: Produces the actual cell output (text or image) using the settings.
- {{braille cell/main2singlecell}}
- {{braille cell/lang2lang-id}}
Input is evaluated and processed using these lists:
- {{Braille cell/english&cell2dot-id}}: analyse input code against default list (English and generic)
- {{Braille cell/dot-id2character}}: cell id into text character (Unicode)
- {{Braille cell/dot-id2article}}: cell id into Wikipedia article name
- {{Braille cell/dot-id2unicode-id}}: cell id into textual Unicode definition, pattern U+28xx
- {{Braille cell/dot-id2filename}}: cell id into a specific filename (6dot, Japanese, Korean)
- {{Braille cell/dot-id2filename-8dot}}: cell id into a default 8-dot filename
Error tracking category:
- Category:Unsupported braille input: tracks transclusions with invalid input.
- T:braille/subs
- Template:braille cell - sbx