I Ching Hexagram Encoding and Decoding Process

易經卦象編碼與解碼過程

Overview 概述

This document describes the method of encoding and decoding Chinese text using I Ching hexagrams. The encoding process converts Chinese characters to their pinyin representations and replaces them with hexagrams that share the same pronunciation.

本文檔描述了使用易經卦象編碼和解碼中文文本的方法。編碼過程將中文字符轉換為拼音表示,並用具有相同發音的卦象替換它們。

Encoding Process 編碼過程

Method:

  1. Convert each Chinese character to its pinyin romanization
  2. Characters with multiple pronunciations are kept as original characters
  3. For each pinyin, find a hexagram with the same pinyin sound (ignoring tones)
  4. If no matching hexagram exists, keep the original character
  5. The final encoded string contains a mix of original characters and hexagrams

方法:

  1. 將每個中文字符轉換為拼音羅馬化
  2. 具有多種發音的字符保持為原始字符
  3. 對於每個拼音,尋找具有相同拼音的卦象(忽略聲調)
  4. 如果沒有匹配的卦象,保留原始字符
  5. 最終編碼的字符串包含原始字符和卦象的混合

Example 示例: Encoding "你說得真好"

Character 字符 Pinyin 拼音 Matching Hexagram 匹配卦象 Result 結果
ni3 No match 無匹配
shuo1 No match 無匹配
de2 No match 無匹配
zhen1 ䷲ (震, zhen4)
hao3 No match 無匹配

Final encoded output 最終編碼輸出: 你說得䷲好

Decoding Process 解碼過程

Method:

  1. Convert each character and hexagram to its pinyin
  2. Replace hexagrams with characters that share the same pinyin base (may have different tones)
  3. Adjust character choices to create a meaningful sentence
  4. Output the final decoded string

方法:

  1. 將每個字符和卦象轉換為拼音
  2. 用共享相同拼音基礎的字符替換卦象(可能有不同的聲調)
  3. 調整字符選擇以創建有意義的句子
  4. 輸出最終解碼的字符串

Example 示例: Decoding "你說得䷲好"

  1. Convert to Pinyin 轉換為拼音:
  2. Convert Hexagram to Character 將卦象轉換為字符:
  3. Adjust for Meaning 調整以符合意義:

Final result 最終結果: 你說得真好

Meaning 意義: "You speak really well" or "What you said is really good"

意義: "你說得真好" 或 "你說的非常好"

Instruction Prompt for LLM 對LLM的指令提示

# Encoding Instructions
1. Convert input string into pinyin (keep characters with multiple pinyin as original)
2. Replace pinyin with hexagrams having same pinyin (ignore tone)
3. Recover pinyin to original character if no corresponding hexagram exists
4. Output the final encoded string

# Decoding Instructions
1. Convert input string into pinyin (keep characters with multiple pinyin as original)
2. Convert hexagrams according to the hexagram table data
3. Recover pinyin to original characters and adjust choices to make string meaningful
4. Output the final decoded string

Hexagram Table 卦象表

# 六十四卦象及名稱列表

| 卦象 | 卦名 | 拼音 |
|------|------|------|
| ䷀ | 乾 | qian2 |
| ䷁ | 坤 | kun1 |
| ䷂ | 屯 | zhun1 |
| ䷃ | 蒙 | meng2 |
| ䷄ | 需 | xu1 |
| ䷅ | 訟 | song4 |
| ䷆ | 師 | shi1 |
| ䷇ | 比 | bi3 |
| ䷈ | 小畜 | xiao3 chu4 |
| ䷉ | 履 | lü3 |
| ䷊ | 泰 | tai4 |
| ䷋ | 否 | pi3 |
| ䷌ | 同人 | tong2 ren2 |
| ䷍ | 大有 | da4 you3 |
| ䷎ | 謙 | qian1 |
| ䷏ | 豫 | yu4 |
| ䷐ | 隨 | sui2 |
| ䷑ | 蠱 | gu3 |
| ䷒ | 臨 | lin2 |
| ䷓ | 觀 | guan1 |
| ䷔ | 噬嗑 | shi4 ke4 |
| ䷕ | 賁 | bi4 |
| ䷖ | 剝 | bo1 |
| ䷗ | 復 | fu4 |
| ䷘ | 無妄 | wu2 wang4 |
| ䷙ | 大畜 | da4 chu4 |
| ䷚ | 頤 | yi2 |
| ䷛ | 大過 | da4 guo4 |
| ䷜ | 坎 | kan3 |
| ䷝ | 離 | li2 |
| ䷞ | 咸 | xian2 |
| ䷟ | 恆 | heng2 |
| ䷠ | 遯 | dun4 |
| ䷡ | 大壯 | da4 zhuang4 |
| ䷢ | 晉 | jin4 |
| ䷣ | 明夷 | ming2 yi2 |
| ䷤ | 家人 | jia1 ren2 |
| ䷥ | 睽 | kui2 |
| ䷦ | 蹇 | jian3 |
| ䷧ | 解 | xie4 |
| ䷨ | 損 | sun3 |
| ䷩ | 益 | yi4 |
| ䷪ | 夬 | guai4 |
| ䷫ | 姤 | gou4 |
| ䷬ | 萃 | cui4 |
| ䷭ | 升 | sheng1 |
| ䷮ | 困 | kun4 |
| ䷯ | 井 | jing3 |
| ䷰ | 革 | ge2 |
| ䷱ | 鼎 | ding3 |
| ䷲ | 震 | zhen4 |
| ䷳ | 艮 | gen4 |
| ䷴ | 漸 | jian4 |
| ䷵ | 歸妹 | gui1 mei4 |
| ䷶ | 豐 | feng1 |
| ䷷ | 旅 | lü3 |
| ䷸ | 巽 | xun4 |
| ䷹ | 兌 | dui4 |
| ䷺ | 渙 | huan4 |
| ䷻ | 節 | jie2 |
| ䷼ | 中孚 | zhong1 fu2 |
| ䷽ | 小過 | xiao3 guo4 |
| ䷾ | 既濟 | ji4 ji4 |
| ䷿ | 未濟 | wei4 ji4 |

Compilation Date: April 30, 2025

Source Title: I Ching Hexagram Encoding and Decoding Process

Source Author: Compiled from encoding-process.md, hexagram-instruction.md, hexagram-table.md, and decoding-process.md

Source Link: https://claude.ai/share/c6a2f8aa-fa9c-43e7-9dbd-4024e5950d20

Encoding demo: https://claude.ai/share/9e316fb9-30fd-407a-b4be-866a044b284b

Decoding demo: https://claude.ai/share/169b560d-e20d-443c-9a45-166b3d27dbcd