Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 61 additions & 43 deletions app/script.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions app/signals.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
.signals-split .scope canvas { height: clamp(16rem, 34vw, 24rem); }
#cv-picture { image-rendering: pixelated; }

/* Readings under the resonance theory: a working theory in the story, not a decoding. */
.signals-split .theory { padding-left: 0.9rem; border-left: 4px solid var(--them); }
.signals-split .theory strong { color: var(--them); }

.tick-us, .tick-them { font-style: normal; }
.tick-us { color: var(--us); }
.tick-them { color: var(--them); }
Expand Down
2 changes: 1 addition & 1 deletion lib/glyph-vocab.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@
"which": null,
"gloss": "that",
"domain": "Logic and number",
"note": "alone in a node slot: the line above"
"note": "alone in a node slot: the triplet before"
},
{
"kind": "ONE",
Expand Down
2 changes: 1 addition & 1 deletion lib/glyph-zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"VOICE.LIGHT": {"gloss": "无线电", "note": "由光承载的声音"},
"VOICE.BODY": {"gloss": "共鸣体、乐器", "note": "会发声的物体"},
"VOICE.OPEN": {"gloss": "一个问题", "note": ""},
"ONE": {"gloss": "那", "note": "单独放在节点位置:指上一行"},
"ONE": {"gloss": "那", "note": "单独放在节点位置:指前一个三元组"},
"ONE.ONE": {"gloss": "相同", "note": ""},
"ONE.NOT": {"gloss": "不同", "note": ""},
"OPEN.COUNT": {"gloss": "多少?", "note": "“什么数?”,用 COUNT.n 回答"},
Expand Down
393 changes: 288 additions & 105 deletions lib/glyph.js

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions script/convert/en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,27 @@ <h1>Text to grid, grid to text</h1>
<div class="wrap">
<div class="section-head">
<h2 class="section-title" id="forward-title">Text → drawing</h2>
<p class="section-lede">One band per row: <code>SYMBOL: node | relation | node</code>. Words are <code>KIND.WHICH</code> from the <a href="../../dictionary/en/">dictionary</a>, numbers are <code>COUNT.n</code>, and <code>_</code> is empty. Rows under a statement are other voices answering it. A blank row starts the next statement. <code>#</code> starts a comment.</p>
<p class="section-lede">One band per row: <code>SYMBOL: node | relation | node</code>. Words are <code>KIND.WHICH</code> from the <a href="../../dictionary/en/">dictionary</a>, numbers are <code>COUNT</code> and base-512 digits (<code>COUNT.137</code>, <code>COUNT.4.171</code> for 2219, or just <code>COUNT.2219</code>), and <code>_</code> is empty. A block of rows is one triplet; rows under its first are other voices answering it. A blank row starts the next triplet. <code>#</code> starts a comment.</p>
</div>
<div class="gs-pane">
<div>
<label class="field">Examples
<select id="gs-examples">
<option value="">Pick an example …</option>
<option value="# They speak: three statements. A blank line starts the next edge.\n+: BODY.OTHER | ONE | BODY.AIR\n×: _ | _ | _.WATER\n*: _ | _ | _.AIR\n\n+: SELF | LIGHT.BEFORE | BODY.OTHER\n\n+: SELF | VOICE.ONE | ONE\n">A conversation</option>
<option value="# They speak: three triplets. A blank line starts the next one.\n+: BODY.OTHER | ONE | BODY.AIR\n×: _ | _ | _.WATER\n*: _ | _ | _.AIR\n\n+: SELF | LIGHT.BEFORE | BODY.OTHER\n\n+: SELF | VOICE.ONE | ONE\n">A conversation</option>
<option value="# &quot;We saw your world.&quot;\n+: SELF | LIGHT.BEFORE | BODY.OTHER\n">We saw your world</option>
<option value="# &quot;We no longer see you.&quot; (the shadow transmission)\n+: SELF | LIGHT.BEFORE | OTHER\n\n+: SELF | LIGHT.NOT | OTHER\n">We no longer see you</option>
<option value="# &quot;Your world is water. We saw that.&quot;\n+: BODY.OTHER | ONE | BODY.WATER\n\n+: SELF | LIGHT.BEFORE | ONE\n">We saw that</option>
<option value="# &quot;We see pulsars. The pulsars are twelve.&quot;\n+: SELF | LIGHT.ONE | STAR.TIME\n\n+: STAR.TIME | ONE | COUNT.12\n">Twelve pulsars</option>
<option value="# &quot;Your world is what?&quot; and our answer: a water-world.\n+: BODY.OTHER | ONE | OPEN\n×: _ | _ | BODY.WATER\n">A question</option>
<option value="# &quot;How many pulsars?&quot; Twelve.\n+: STAR.TIME | ONE | OPEN.COUNT\n×: _ | _ | COUNT.12\n">How many?</option>
<option value="# A third voice sides with them, against us, about our own world.\n+: BODY.OTHER | ONE | BODY.AIR\n×: _ | _ | _.WATER\n*: _ | _ | _.AIR\n">A third voice</option>
<option value="# &quot;Now is 2219. Twelve pulsars.&quot; Big numbers are base-512 digits after COUNT.\n+: TIME.ONE | ONE | COUNT.4.171\n\n+: STAR.TIME | ONE | COUNT.12\n">The year 2219</option>
</select>
</label>
<label class="field">Page source <textarea id="gs-src" rows="9" spellcheck="false" autocapitalize="off" autocomplete="off"></textarea></label>
<p class="gs-error" id="gs-src-err" role="alert" hidden></p>
<label class="field">Triplets per line <select id="gs-per-line"><option>1</option><option selected>2</option><option>3</option><option>4</option></select></label>
<p class="note">Symbols: <span class="gs-ink-them">+</span> is them, <span class="gs-ink-us">×</span> is us; any other single character is another voice.</p>
</div>
<div class="gs-out">
Expand All @@ -81,7 +83,7 @@ <h2 class="section-title" id="forward-title">Text → drawing</h2>
<div class="wrap">
<div class="section-head">
<h2 class="section-title" id="reverse-title">Drawing → text</h2>
<p class="section-lede">Pick a part and click a position to stamp it, or pick "one cell" and draw freely. The lighter squares are the lattice: text only ever sits there, so a mark between them makes it a picture. You can also paste a drawing as text, one row per line, with <code>.</code> for empty cells.</p>
<p class="section-lede">Pick a part and click to stamp it, or pick "one cell" and draw freely. The lighter rows are where bands go. Leave 1 empty cell between the parts of a word, 2 between words and 4 between triplets: the machine reads the structure from those gaps alone, and anything that won't split into whole parts is a picture. You can also paste a drawing as text, one row per line, with <code>.</code> for empty cells.</p>
</div>
<div class="gs-pane">
<div>
Expand All @@ -95,8 +97,9 @@ <h2 class="section-title" id="reverse-title">Drawing → text</h2>
</div>
<div class="gs-palette" id="gs-palette" role="group" aria-label="Parts"></div>
<div class="gs-controls">
<label class="field">Number <input type="number" id="gs-num" min="0" max="511" value="12"></label>
<label class="field">Digit <input type="number" id="gs-num" min="0" max="511" value="12"></label>
<label class="field">Lines <input type="number" id="gs-lines" min="1" max="12" value="2"></label>
<label class="field">Width <input type="number" id="gs-width" min="7" max="120" value="45"></label>
<label class="field">Voices <select id="gs-voices"><option>1</option><option selected>2</option><option>3</option></select></label>
<button type="button" class="btn btn-sm btn-ghost" id="gs-clear">Clear</button>
</div>
Expand Down
13 changes: 8 additions & 5 deletions script/convert/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,27 @@ <h1>文字变图,图变文字</h1>
<div class="wrap">
<div class="section-head">
<h2 class="section-title" id="forward-title">文字 → 图</h2>
<p class="section-lede">每行一个声部:<code>符号: 节点 | 关系 | 节点</code>。词写成<a href="../dictionary/">词典</a>里的 <code>类.指</code>,数写成 <code>COUNT.n</code>,<code>_</code> 表示空。一句下面的行是其他声音在回应它。空一行开始下一句。<code>#</code> 后面是注释。</p>
<p class="section-lede">每行一个声部:<code>符号: 节点 | 关系 | 节点</code>。词写成<a href="../dictionary/">词典</a>里的 <code>类.指</code>,数写成 <code>COUNT</code> 加 512 进制的数位(<code>COUNT.137</code>;2219 写作 <code>COUNT.4.171</code>,也可以直接写 <code>COUNT.2219</code>),<code>_</code> 表示空。一组行是一个三元组,第一行下面的行是其他声音在回应它。空一行开始下一个三元组。<code>#</code> 后面是注释。</p>
</div>
<div class="gs-pane">
<div>
<label class="field">例子
<select id="gs-examples">
<option value="">选一个例子 …</option>
<option value="# 他们说话:三句。空一行开始下一条边。\n+: BODY.OTHER | ONE | BODY.AIR\n×: _ | _ | _.WATER\n*: _ | _ | _.AIR\n\n+: SELF | LIGHT.BEFORE | BODY.OTHER\n\n+: SELF | VOICE.ONE | ONE\n">一场对话</option>
<option value="# 他们说话:三个三元组。空一行开始下一个。\n+: BODY.OTHER | ONE | BODY.AIR\n×: _ | _ | _.WATER\n*: _ | _ | _.AIR\n\n+: SELF | LIGHT.BEFORE | BODY.OTHER\n\n+: SELF | VOICE.ONE | ONE\n">一场对话</option>
<option value="# “我们看见过你们的世界。”\n+: SELF | LIGHT.BEFORE | BODY.OTHER\n">我们看见过你们的世界</option>
<option value="# “我们看不见你们了。”(影子那段发射)\n+: SELF | LIGHT.BEFORE | OTHER\n\n+: SELF | LIGHT.NOT | OTHER\n">我们看不见你们了</option>
<option value="# “你们的世界是水世界。我们看见过那个。”\n+: BODY.OTHER | ONE | BODY.WATER\n\n+: SELF | LIGHT.BEFORE | ONE\n">我们看见过那个</option>
<option value="# “我们看见脉冲星。脉冲星有十二颗。”\n+: SELF | LIGHT.ONE | STAR.TIME\n\n+: STAR.TIME | ONE | COUNT.12\n">十二颗脉冲星</option>
<option value="# “你们的世界是什么?”我们的回答:水世界。\n+: BODY.OTHER | ONE | OPEN\n×: _ | _ | BODY.WATER\n">一个问题</option>
<option value="# “脉冲星有多少颗?”十二颗。\n+: STAR.TIME | ONE | OPEN.COUNT\n×: _ | _ | COUNT.12\n">多少?</option>
<option value="# 第三个声音站在他们一边,反对我们对自己世界的说法。\n+: BODY.OTHER | ONE | BODY.AIR\n×: _ | _ | _.WATER\n*: _ | _ | _.AIR\n">第三个声音</option>
<option value="# “现在是 2219 年。十二颗脉冲星。”大的数是 COUNT 后面的 512 进制数位。\n+: TIME.ONE | ONE | COUNT.4.171\n\n+: STAR.TIME | ONE | COUNT.12\n">2219 年</option>
</select>
</label>
<label class="field">页面源文 <textarea id="gs-src" rows="9" spellcheck="false" autocapitalize="off" autocomplete="off"></textarea></label>
<p class="gs-error" id="gs-src-err" role="alert" hidden></p>
<label class="field">每行几个三元组 <select id="gs-per-line"><option>1</option><option selected>2</option><option>3</option><option>4</option></select></label>
<p class="note">符号:<span class="gs-ink-them">+</span> 是他们,<span class="gs-ink-us">×</span> 是我们;其他任何单个字符是另一个声音。</p>
</div>
<div class="gs-out">
Expand All @@ -81,7 +83,7 @@ <h2 class="section-title" id="forward-title">文字 → 图</h2>
<div class="wrap">
<div class="section-head">
<h2 class="section-title" id="reverse-title">图 → 文字</h2>
<p class="section-lede">选一个部件,点一个位置把它盖上去;或者选“单格”随手画。颜色浅一些的方块是格点:文字只会落在那里,画在它们之间的记号会让它变成一幅图。也可以粘贴用文字表示的图,每行一排,<code>.</code> 表示空格。</p>
<p class="section-lede">选一个部件,点一下把它盖上去;或者选“单格”随手画。颜色浅一些的排是声部所在的地方。词里的部件之间空 1 格,词与词空 2 格,三元组之间空 4 格:翻译机只靠这些空隙读出结构,切不成完整部件的就是一幅图。也可以粘贴用文字表示的图,每行一排,<code>.</code> 表示空格。</p>
</div>
<div class="gs-pane">
<div>
Expand All @@ -95,8 +97,9 @@ <h2 class="section-title" id="reverse-title">图 → 文字</h2>
</div>
<div class="gs-palette" id="gs-palette" role="group" aria-label="部件"></div>
<div class="gs-controls">
<label class="field">数 <input type="number" id="gs-num" min="0" max="511" value="12"></label>
<label class="field">句数 <input type="number" id="gs-lines" min="1" max="12" value="2"></label>
<label class="field">数位 <input type="number" id="gs-num" min="0" max="511" value="12"></label>
<label class="field">行数 <input type="number" id="gs-lines" min="1" max="12" value="2"></label>
<label class="field">宽 <input type="number" id="gs-width" min="7" max="120" value="45"></label>
<label class="field">声音数 <select id="gs-voices"><option>1</option><option selected>2</option><option>3</option></select></label>
<button type="button" class="btn btn-sm btn-ghost" id="gs-clear">清空</button>
</div>
Expand Down
Loading
Loading