# Bourbon

A bilingual workbench for phonological features, segment inventories and feature geometry.
用于音系特征、音段清单和特征几何分析的中英文工具。

[English](#english) · [中文](#中文)

## English

### Overview

Bourbon is a browser-based phonological-feature workbench derived from [Whiskey](https://nnnnnnnn.info/whiskey/) by Klaus Llwynog. It supports editable segment inventories, feature matrices, comparisons and feature trees. Code, data and fonts are bundled with the application; no account or backend is required.

The application includes **216 available segment entries, 26 default features and 15 reference inventories**. Each inventory has its own membership, feature definitions and matrix values. Identical IPA spellings in different inventories remain separate records.

Bourbon opens in English on the first visit and remembers subsequent language choices. Links with `?lang=en` or `?lang=zh` explicitly select the interface language. The page offers actual-size and fit-to-window views; narrow screens stack the chart and analysis panels.

### Quick start

1. Open **Edit inventory**, choose a reference inventory and check the segments you want to include.
2. Apply it on its own, or add it to the current comparison.
3. Select segment buttons to inspect their shared feature values. Use the `+` and `−` filters to find matching segments; the centre option clears a feature's filter.
4. Switch between **Feature table** and **Feature tree**. With multiple inventories, select which inventory's tree to view.
5. Edit segments, features or tree structure as needed, then export a **JSON backup** to retain the complete inventory.

### Inventories and segment editing

An inventory can be renamed, copied, deleted or restored to its default. Each segment can be edited independently, including its IPA spelling, chart position, notes and feature values. Create a segment from a blank matrix or copy an existing matrix.

Controls for length, nasalization, aspiration, breathy voice, labialization, r-colouring and syllabicity link supported IPA spellings to their corresponding feature values. These edits remain a preview until **Save segment**. A new form preserves its original segment; if the spelling already exists, saving to that entry requires confirmation. Arbitrary manual matrix edits and imported values do not automatically infer IPA spelling.

The form-visibility switches beneath the vowel chart control which modified forms are displayed. Hiding a form does not remove it from the inventory or erase its values. Applying an inventory enables the forms it needs.

IPA text uses Unicode NFC rather than NFKC to preserve superscripts and IPA distinctions. Explicit aliases handle ɡ/g, ɚ/ə˞, ɝ/ɜ˞ and legacy affricate ligatures. Bundled IPA and Chinese fonts support the interface. Input validation checks consistency and duplicates; it does not establish that a string represents a valid phonological segment.

### Feature values and analysis

| Value | Meaning |
| --- | --- |
| `+` | Positive assignment |
| `-` | Negative assignment |
| `0` | Unspecified; not equivalent to negative |
| `both` / `±` | Compatible with both signs |

The table, tree and live tree preview share the same status badges: `+`, `−`, `≠`, `?`, `∅` and `—`. A shared positive or negative sign requires every selected segment to specify that sign. Unspecified and `both` values do not establish a shared positive or negative value. When the selected segments differ on a feature (`≠`), the small arrow next to it lists their values, grouped by value; selecting a segment there moves to its button in the chart, and **Show in the feature tree** opens the tree with that feature highlighted.

**Minimal features** (beside the feature controls) opens a dialog and computes the smallest feature sets for the selection. With one selected segment it distinguishes it from the other segments of its inventory; with several, it distinguishes every pair of them. Only opposite `+` and `−` values count. Hidden features are excluded and dependency rules do not infer values.

Every concrete combination is a separate solution, even when two features distinguish exactly the same pairs. At most the **best 19 solutions** are shown. The default ranking compares tree-level sums, then sorted level lists, then English feature names alphabetically (ignoring case; IDs break identical-name ties). An empty tree uses alphabetical order alone. Explicit **Feature table order** uses table positions. The total counts concrete combinations and is exact only when the search has counted them all; otherwise a lower bound is shown. If the search limit is reached, the result explicitly says that the minimum or complete ranking is not proven.

Select each solution directly from the list. **Feature details** shows the distinctions and tree positions. **Must include** requires the exact feature: requiring two features with the same distinguishing effect still counts both. **Exclude** removes only the specified feature. **Clear conditions** resets both lists. Segments that no candidate can distinguish are listed separately. Results are relative to the current template and tree; they are computed when the dialog opens, recomputed when conditions or ranking change, and never saved or exported.

Feature display can show **All**, **Same values**, **Different values** or **Has values**. With no selected segments, all features are shown. “Same” requires every selected segment to have the same assigned value; “Different” requires at least two distinct assigned values; “Has values” requires at least one assignment. `0` is unassigned and `both` is assigned: `+,0` qualifies only as “Has values”, while `±,±` qualifies as “Same values”. **Group by** can also arrange the table by comparison instead of feature class: **Same values**, **Different values**, **Contains unspecified** (one assigned value and some `0`) and **All unspecified**, each with its count. Grouping only changes the view; it is not saved, exported or undone.

**Hide** moves a feature row to a restore area at the bottom of the table; it does not delete the feature or disable its filter. In comparisons, the main Hide/Restore action applies to active inventories that define the feature. Tree nodes for hidden or display-filtered features are dimmed while retaining their positions and status symbols.

Use **Manage features** to create, delete or restore features. Names can be supplied in either language; the other name can be filled automatically. A feature ID is generated unless you provide one. Manual IDs must be unique, contain 1–96 characters, begin with an English letter, and use only English letters, digits, underscores, dots or hyphens. `__proto__`, `constructor` and `prototype` are reserved. IDs are stable matrix-column and import/export keys.

Inventories can be compared when shared feature IDs have compatible definitions and metadata. Conflicts are rejected; a feature absent from one inventory is treated as unspecified for its segments. At least one feature must remain in an inventory.

### Feature geometry and tree editing

The default geometry combines consonant and vowel features in one structure. A feature appears only once and has one default parent; a user may add additional parents when the analysis requires them. `lab`, `cor` and `dors` are feature-bearing nodes that also organize their children; they are not duplicated as same-named structural groups.

| Node or parent | Features carried or linked beneath it |
| --- | --- |
| R | Carries `cons`, `son`, `syll` and `long` in the root node |
| R → Supra-laryngeal | `lat`, `nas`, `cont`, `del`, `app` |
| R → Laryngeal | `voice`, `sg`, `cg` |
| R → Place | `lab`, `cor`, `dors` |
| `lab` | `rnd`, `labiodental` |
| `cor` | `ant`, `dist`, `str` |
| `dors` | `high`, `low`, `front`, `back` |
| R, direct feature links | No separate direct branch; `cons`, `son`, `syll` and `long` are displayed inside R |

ATR occupies the position used for tense in the adopted geometry and is placed under Place; this is a modelling choice, not a general claim that ATR and tenseness are identical. Rhoticization is placed under Supra-laryngeal without requiring one particular tongue configuration. Custom features also remain visible in the default tree.

A saved tree, including an intentionally empty tree, normally takes precedence. Without a saved tree, Bourbon uses an explicitly configured language template if available, otherwise the default geometry. Wholly custom feature sets use general groups. Unmodified generated legacy group structures can resolve to the default geometry. Features omitted from a custom tree remain accessible in a separate list.

The layout adapts card height to the number of feature states and allocates a controlled gap by subtree. Choose **Horizontal** (levels left to right) or **Vertical** (levels top to bottom); the setting is remembered locally. Dashed edges indicate additional parentage. Zoom, fit, reset to 100% and expanded viewing change only the display. Large trees scroll within their own viewport.

**Edit tree** opens an independent draft with a live preview. Expand a node to edit its available fields, order and parents. Both feature nodes and structural groups may have children; multiple parents are supported and cycles are rejected.

| Operation | Effect |
| --- | --- |
| Create feature and node | Adds a matrix column and tree node; segment values start unspecified |
| Add existing feature node | Places an existing feature in the tree without adding another column |
| Remove feature node | Removes only the structural tree node; its matrix column and values remain available in the unlinked list |
| Delete feature in **Manage features** | Removes its column, values, node references, hidden setting and related value rules |
| Delete structural group | Removes the group and its edges while preserving matrix features |
| Delete a parent | Reconnects its surviving children to its former parents |

The root's `cons` and `son` features can be removed from the tree individually without deleting their matrix columns. Deleting R as a group retains its carried features as independent nodes. Creating or deleting a feature in **Manage features** also updates the inventory's saved tree.

Tree-editor changes, including matrix-column changes, are saved together with **Apply**; **Cancel** discards the draft. Restoring the default tree replaces the draft structure. Clearing the tree preserves the matrix and, after Apply, stores an intentionally empty structure.

Reusable tree templates are independent snapshots. Preview checks feature IDs and definitions before applying a template; missing or mismatched features are reported, and loading a template does not silently add matrix columns. Editing a reusable template does not rewrite inventories that already received copies.

Structural edges and signed feature-value rules are separate. Neither automatically rewrites the matrix. Rule validation rejects invalid references, cycles and directly contradictory requirements; it is not proof that all segment values satisfy the declared analysis.

### Appearance

The page-header **Appearance** control offers five themes: **Classic**, **Ocean**, **Sage**, **Sand** and **Plum**. Positive, negative, selected, unselected, mixed and unknown/unspecified colours can be chosen independently.

Feature signs use their own fill colours; selected filters also have a selection-colour border. Text switches between light and dark for contrast. Changes are previewed immediately. **Save** remembers them in the current browser; **Cancel** or Escape restores the previous settings. **Reset defaults** previews the default palette before saving. Appearance preferences are separate from inventory exports.

### Saving, importing and exporting

| Action | Saving behaviour |
| --- | --- |
| Ordinary edits to existing matrix values and inventory feature management | Save automatically |
| New segments and modifier-linked edits | Save with **Save segment** |
| Tree draft, including feature-column changes | Save with **Apply**; Cancel discards the draft |
| Reusable tree-template management | Saves independently of the inventory-tree draft |
| Appearance | Save explicitly; Cancel restores the previous palette |

Closing an inventory editor does not undo changes that have already autosaved. Browser storage is local: inventories are not uploaded or synchronized across devices. Export before clearing browser data. If storage is unavailable or full, the interface reports it; current-session changes may not survive a reload. Segment selections and feature filters are session state.

**Undo** (in the header, or Ctrl+Z / ⌘Z outside text fields) reverts saved changes one operation at a time: feature values, segments, features, imports, deletions, feature trees and tree templates. Up to 100 operations are kept, also across reloads; when browser storage runs short, the oldest are dropped first. Selections, filters, views and appearance are not part of the history, and it is never exported. If the data was changed elsewhere in the meantime (for example in another tab), Undo does nothing and clears the history instead.

| Format | Contents and purpose |
| --- | --- |
| Matrix CSV | Selected segments as rows and feature IDs as columns; convenient spreadsheet editing |
| Inventory JSON | Complete segment pool, membership, definitions, matrices, positions, notes, sequences, visibility, tree, rules and reusable tree templates |

CSV begins with an `IPA` column. Use UTF-8 and values `+`, `-`, `0` or `both`; Unicode `−` and `±` are also accepted, and blank cells become unspecified. Rows and columns can be added, deleted or reordered. Hidden features are included; deleted features are omitted. A blank CSV contains headers only.

Import matches feature IDs or names against the current inventory first, then built-in definitions. New columns create features. Unknown IPA requires chart placement in the preview. Imported matrix values are used as supplied. Import creates a new inventory by default; replacement requires confirmation. Legacy ZIP/four-file packages can also be imported.

Use JSON for a complete inventory backup; CSV does not retain tree structure or other inventory metadata. See [FORMAT.md](FORMAT.md) for schemas and compatibility details.

### Reference inventories and analytical scope

| Template | Selected entries | Adopted scope |
| --- | ---: | --- |
| Mandarin | 28 | Five-vowel analysis; separate alveolopalatals; r-coloured nucleus form |
| Hong Kong Cantonese | 29 | Eight-vowel analysis; ɐ/aː, labialized velars and syllabic m/ŋ |
| English (Whiskey original) | 38 | Original 24 consonants and 14 vowels; not relabelled General American |
| Standard Southern British English | 39 | Lindsey SSB; complex nuclei as V+j/w, plus explicitly listed sequence components |
| French (Parisian) | 34 | a/ɑ and ɛ̃/œ̃ mergers; 11 oral and 3 nasal vowels |
| Spanish (Central / Northern Spain) | 23 | Distinción and yeísmo; non-syllabic i/u realizations |
| Brazilian Portuguese | 33 | Seven oral and five nasal vowels; broad strong-R symbol ʁ |
| Standard Uyghur | 33 | Mayer 2021, Tables 2.1–2.2; eight vowels |
| Vietnamese (Hanoi) | 32 | Main consonants/monophthongs; centering nuclei stored as sequences with an explicit analysis limitation |
| Norwegian (Urban East) | 38 | Kristoffersen-style vowel + glide sequences; local central-w and laminal-coronal assignments |
| Standard Italian | 45 | Seven vowels, traditional s/z contrast, 15 contrastive geminate forms |
| Standard Hindi | 51 | Four phonation series; seven long nasal vowels; stated loan and regional limits |
| Catalan | 30 | Original Whiskey selection |
| Polish | 28 | Original Whiskey selection |
| Turkish | 23 | Original Whiskey selection |

Counts are selected entries, including modified forms and explicitly listed sequence components, **not universal phoneme counts**. The chart does not provide independent diphthong buttons. Complex nuclei may be stored as segment sequences according to the inventory's stated analysis. In particular, the Vietnamese source treats its centering nuclei as diphthongs; storing them as sequences is a representation choice, not evidence against that analysis. Tone and pitch accent are outside these segment matrices.

The matrices include explicit analytical conventions. For example, alveolopalatals use coronal-plus-dorsal features, and r-colouring does not imply a single articulatory configuration. Sources, variants, feature assignments and limitations are documented in inventory notes and [DATA.md](DATA.md).

**Reference inventories are starting points, not validated analyses for every language variety or research question. Before using them in research, check and revise the inventory, segments and feature assignments against the target language, dialect, sources and study. Software validation does not establish the correctness of a linguistic theory.**

### Browser support

Bourbon runs entirely in the browser; nothing is installed or uploaded. It needs a current browser: Chrome or Edge 80+, Firefox 74+ or Safari 13.4+, with JavaScript enabled. Inventories, settings and templates are kept in the browser's local storage on this device only; export a JSON backup to move them or before clearing browser data.

### Credits and license

Bourbon is derived from **Whiskey Feature Switchboard, © 2018 Klaus Llwynog**, which its [about page](https://nnnnnnnn.info/whiskey/about.html) releases under the GNU GPL version 3 or any later version; the author welcomes use, modification and sharing as long as credit is given and the license is not restricted. Source repository: [huanbin/pages](https://codefloe.com/huanbin/pages). Development uses GPT-6 Astra assistance.

The software is licensed under **GPL-3.0-or-later**; see [COPYING](COPYING). Bundled fonts retain their own licenses: [Charis SIL](https://codefloe.com/huanbin/pages/src/branch/main/static/bourbon/licenses/CharisSIL-OFL.txt) (© SIL International, SIL OFL 1.1), [Bitstream Charter](https://codefloe.com/huanbin/pages/src/branch/main/static/bourbon/licenses/Charter-license.txt) (BITSTREAM CHARTER is a registered trademark of Bitstream Inc.) and [Noto Sans SC](https://codefloe.com/huanbin/pages/src/branch/main/static/bourbon/licenses/NotoSansSC-OFL.txt) (SIL OFL 1.1, also covering its renamed subset Bourbon Han). The software is provided without warranty.

## 中文

### 软件概览

Bourbon 是基于 Klaus Llwynog 的 [Whiskey](https://nnnnnnnn.info/whiskey/) 开发的浏览器音系特征分析工具，支持音段清单、特征矩阵、多音位库比较和特征树编辑。代码、数据和字体随应用提供，无需账户或后端服务。

应用包含 **216 个可用音段条目、26 项默认特征和 15 个参考音位库**。每个音位库独立保存成员、特征定义和矩阵值；不同音位库中拼写相同的 IPA 仍是独立记录。

首次访问使用英语，之后记住语言选择。`?lang=en` 和 `?lang=zh` 可明确指定界面语言。页面提供实际大小和适应窗口模式；窄屏下，音位表与分析面板上下排列。

### 快速开始

1. 打开“编辑音位库”，选择参考模板，勾选需要纳入的音段。
2. 单独应用该音位库，或将它加入当前比较。
3. 点击音段按钮，查看共同特征；使用 `+`、`−` 筛选符合条件的音段，中间选项清除该项筛选。
4. 在“特征表”和“特征树”之间切换。比较多个音位库时，可选择查看哪一个音位库的树。
5. 按需编辑音段、特征和树结构，并导出 **JSON 备份**，保存完整音位库。

### 音位库与音段编辑

音位库可重命名、复制、删除或恢复默认值。每个音段可独立编辑 IPA 拼写、图表位置、说明和特征赋值；也可以从空白矩阵创建音段，或复制已有矩阵。

长音、鼻化、送气、气声、唇化、儿化／r 色彩和音节性等修饰选项，会联动更新支持的 IPA 拼写及对应特征值。这类编辑先预览，点击“保存音段”后生效。新形式保留原音段；若拼写已存在，保存到已有条目前需要确认。任意手动矩阵修改和导入值不会自动推断 IPA 拼写。

元音表下方的附加形式开关控制哪些形式可见。隐藏形式不会删除成员或矩阵值；应用音位库时，会开启它需要的形式。

IPA 文本采用 Unicode NFC 而非 NFKC，以保留上标和 IPA 区别；明确处理 ɡ/g、ɚ/ə˞、ɝ/ɜ˞ 和旧式塞擦音合字。应用随包提供 IPA 和中文字体。输入校验检查一致性与重复项，不能证明某个字符串在音系上构成有效音段。

### 特征赋值与分析

| 值 | 含义 |
| --- | --- |
| `+` | 正值 |
| `-` | 负值 |
| `0` | 未指定，不等于负值 |
| `both` / `±` | 兼容正负两种值 |

特征表、特征树及树预览使用相同的状态符号：`+`、`−`、`≠`、`?`、`∅`、`—`。只有所有所选音段都明确取同一正值或负值，才显示共同正／负特征；未指定和 `both` 不能确立共同正／负值。所选音段在某特征上取值不同（`≠`）时，旁边的小箭头可展开各音段的取值（按取值分组）；点击其中的音段会定位到图表中的对应按钮，**在特征树中定位**会打开特征树并突出显示该特征。

特征列表上方的**最小特征集**按钮打开弹窗并立即计算。选中一个音段时，把它与所在音位库的其他音段区分开；选中多个时，把它们两两区分开。只有相反的 `+` 与 `−` 才算区分；隐藏特征不参与，也不使用依赖规则推断取值。

每个具体特征组合都是独立方案，即使区分作用相同也不合并。最多展示**排名前 19 的方案**。默认依次比较特征树层级总和、从小到大的层级列表，再按英文名称字母顺序排列（忽略大小写，同名时按 ID）；树为空时直接按字母排序。明确选择**按特征表顺序**时才使用表中的位置。总数按具体组合统计，完整计数后才显示精确值，否则显示已找到的数量下限。搜索达到上限时，会说明最少数量或完整排名尚未证明。

每个方案直接在列表中选择。展开**逐项查看区分作用与树位置**可查看区分对象、树层级、父节点与分支。**必须包含**严格要求指定特征；同时要求两个区分作用相同的特征，也分别计入两个特征。**不使用**仅排除指定特征，**清空条件**同时重置两类条件。任何候选特征都无法区分的音段另行列出。结果仅相对于当前模板与特征树；打开弹窗时计算，改变条件或排序时重算，不保存也不导出。

显示条件包括“全部”“仅显示相同值”“仅显示不同值”和“仅显示有值”。未选择音段时全部显示。“相同值”要求每个所选音段均已赋值且一致；“不同值”要求已赋值项至少有两个不同值；“有值”要求至少一项已赋值。`0` 为未赋值，`both` 为已赋值，因此 `+,0` 仅满足“有值”，而 `±,±` 满足“相同值”。**分组**还可以把特征表从按特征类别改为按比较结果排列：**相同**、**不同**、**含未指定**（只有一种已赋值且含 `0`）和**全部未指定**，各组显示数量。分组只改变显示，不保存、不导出，也不进入撤销记录。

“隐藏”将特征行移到表格底部的恢复区，不删除特征，也不关闭该项筛选。多音位库比较时，主界面的隐藏／恢复操作作用于当前参与比较且定义该特征的音位库。树中被隐藏或不满足显示条件的特征变灰，但保留位置和状态符号。

在“特征管理”中创建、删除或恢复特征。中英文名称可任选一种填写，另一种可自动补齐。若不手动填写 ID，程序会自动生成。手动 ID 必须在当前音位库中唯一，长度为 1–96 个字符，以英文字母开头，仅使用英文字母、数字、下划线、点或连字符；`__proto__`、`constructor`、`prototype` 为保留名称。ID 是矩阵列和导入导出的固定标识。

比较音位库时，共用特征 ID 的定义及相关元数据必须兼容，否则拒绝合并。某音位库没有的特征，在比较时视为其音段未指定该特征。每个音位库至少保留一项特征。

### 特征几何与树编辑

默认特征几何将辅音和元音合并在同一结构中。每个特征只显示一次，默认只有一个上级；用户可按分析需要添加额外上级。`lab`、`cor`、`dors` 既有自身的特征值，也统辖下级，不再重复建立同名分组。

| 节点或上级 | 承载或连接的特征 |
| --- | --- |
| R | 根节点内部承载 `cons`、`son`、`syll`、`long` |
| R → 喉上节点 | `lat`、`nas`、`cont`、`del`、`app` |
| R → 喉部节点 | `voice`、`sg`、`cg` |
| R → 部位节点 | `lab`、`cor`、`dors` |
| `lab` | `rnd`、`labiodental` |
| `cor` | `ant`、`dist`、`str` |
| `dors` | `high`、`low`、`front`、`back` |
| R 直接连接的特征 | 无；`cons`、`son`、`syll`、`long` 在根节点内部显示 |

此几何用 ATR 承担 tense 所在的位置并归入部位分支；这是建模选择，不表示 ATR 与紧度在所有分析中等同。儿化／r 色彩归入喉上分支，不预设唯一的舌部构形。自定义特征也保留在默认树中。

通常优先采用已保存的树，包括主动保存的空树。未保存树时，先使用明确配置的语言配套模板，否则采用默认几何；完全自定义的特征集使用通用分组。未改动的旧版自动分组结构可采用默认几何。自定义树中未纳入的特征仍可在单独列表中查看。

布局会按节点承载的特征数量自适应卡片高度，并按子树分配适中的间距。可选择“横向”（层级从左到右）或“纵向”（层级从上到下），选择会保存在本机。虚线表示额外的上级归属。放大、缩小、适应窗口、恢复 100% 和展开查看只改变显示，大树在自身区域内滚动。

“编辑特征树”打开独立草稿及即时预览。展开节点可调整可编辑字段、顺序和上级。特征节点与纯结构分组都可以有下级；支持多个上级，不允许环路。

| 操作 | 作用 |
| --- | --- |
| 新建特征并添加节点 | 同时增加矩阵列和树节点，音段值初始为未指定 |
| 添加已有特征节点 | 将已有特征纳入树，不重复增加矩阵列 |
| 移出特征节点 | 只移除树结构中的节点；矩阵列和值保留，并显示在树外特征列表 |
| 在“特征管理”中删除特征 | 删除对应列、赋值、节点引用、隐藏设置及相关取值规则 |
| 删除纯结构分组 | 删除分组及相关连线，保留矩阵特征 |
| 删除上级节点 | 保留下级，将其接到被删节点的原上级 |

R 内部的 `cons`、`son` 可以分别移出树，但不会删除矩阵列。删除 R 分组时，它承载的特征保留为独立节点。在“特征管理”中创建或删除特征，也同步当前音位库已保存的树。

树编辑器中的结构变化和矩阵列变化共同暂存在草稿中，点击“应用”保存，“取消”放弃。恢复默认树会替换草稿结构；清空树不删除矩阵，应用后保存为空树。

通用树模板是独立快照。应用前通过预览核对特征 ID 和定义，报告缺失或不匹配项；载入模板不会悄悄增加矩阵列。后续修改通用模板，不会改写已经获得副本的音位库。

结构连线与正负值依赖规则分开保存，两者都不会自动改写矩阵。规则校验拒绝无效引用、环路和直接矛盾的要求，但不能证明所有音段赋值都满足所声明的分析。

### 主题与配色

页头“配色”提供经典灰蓝、海蓝、鼠尾草绿、暖沙和灰紫五种主题。正值、负值、选中、未选中、混合值、未知／未指定状态均可独立选色。

正负特征使用各自填充色；选中筛选项另有选中颜色边框。文字自动选择浅色或深色以保持对比。修改即时预览，“保存”后由当前浏览器记住；“取消”或 Escape 恢复原配色。“恢复默认”也先预览，再决定是否保存。配色不进入音位库导出文件。

### 保存、导入与导出

| 操作 | 保存方式 |
| --- | --- |
| 普通已有矩阵赋值及音位库特征管理 | 自动保存 |
| 新音段和修饰选项联动编辑 | 点击“保存音段” |
| 树草稿，包括矩阵列变化 | 点击“应用”；取消放弃草稿 |
| 通用树模板管理 | 独立于当前音位库的树草稿保存 |
| 配色 | 明确保存；取消恢复原配色 |

关闭音位库编辑器，不会撤销已经自动保存的操作。数据保存在当前浏览器，不上传，也不跨设备同步。清理浏览器数据前请导出备份。存储被禁用或空间不足时，界面会提示；当前会话中的修改可能无法在刷新后保留。音段选择和特征筛选属于会话状态。

页面顶部的**撤销**按钮（在文本框之外也可按 Ctrl+Z / ⌘Z）按操作逐步撤销已保存的修改，包括特征赋值、音段、特征、导入、删除、特征树和树模板。最多保留 100 步，刷新后仍可撤销；浏览器存储空间不足时先丢弃最早的步骤。选择、筛选、视图和配色不进入撤销记录，撤销记录也不会被导出。如果数据在此期间已在别处修改（例如另一个标签页），撤销不会执行，并会清除撤销记录。

| 格式 | 内容与用途 |
| --- | --- |
| 矩阵 CSV | 所选音段为行，特征 ID 为列，适合电子表格编辑 |
| 音位库 JSON | 完整音段池、成员、定义、矩阵、位置、说明、序列、隐藏设置、树、规则及通用树模板 |

CSV 第一列为 `IPA`，使用 UTF-8 编码。单元格填写 `+`、`-`、`0` 或 `both`，也接受 Unicode `−`、`±`；空白视为未指定。音段行与特征列均可增删、重排。隐藏列参与导出，删除列不参与；空白 CSV 只有表头。

导入时，特征 ID 或名称优先匹配当前音位库，再匹配内置定义；新列创建特征。未知 IPA 需要在预览中指定图表位置。矩阵值以导入文件为准。默认导入为新音位库，替换已有音位库需要确认；也支持导入旧版 ZIP／四文件包。

完整备份请使用 JSON；CSV 不保存树结构及其他音位库元数据。格式和兼容性说明见 [FORMAT.md](FORMAT.md)。

### 参考音位库与分析范围

| 模板 | 选中条目 | 采用范围 |
| --- | ---: | --- |
| 普通话 | 28 | 五元音分析、独立龈腭系列与儿化核形式 |
| 香港粤语 | 29 | 八元音分析，ɐ/aː、唇化软腭音及音节性 m/ŋ |
| 英语（Whiskey 原版） | 38 | 原版 24 辅音、14 元音，不标为通用美式英语 |
| 标准南部英式英语 | 39 | Lindsey SSB，复合核用 V+j/w，并列出序列成分 |
| 法国法语（巴黎型） | 34 | a/ɑ、ɛ̃/œ̃ 合流，11 口元音、3 鼻元音 |
| 西班牙语（西班牙中北部） | 23 | θ/s 区分及 yeísmo；i/u 的非音节性实现 |
| 巴西葡萄牙语 | 33 | 七口元音、五鼻元音，ʁ 为强 R 的宽式符号 |
| 标准维吾尔语 | 33 | Mayer 2021 表 2.1–2.2，八元音 |
| 河内越南语 | 32 | 主要辅音与单元音；向中核以序列保存，明确标注分析限制 |
| 挪威语（城市东部） | 38 | 单元音＋滑音分析；当前模板使用中央 w 与舌叶冠音赋值 |
| 标准意大利语 | 45 | 七元音、传统 s/z 区分及 15 组对立长辅音 |
| 标准印地语 | 51 | 四发声系列、七长鼻元音；借词与地域范围见预设说明 |
| 加泰罗尼亚语 | 30 | Whiskey 原版选择 |
| 波兰语 | 28 | Whiskey 原版选择 |
| 土耳其语 | 23 | Whiskey 原版选择 |

条目数包括所选修饰形式及明确列出的序列成分，**不是适用于所有分析的音位数**。图表不提供独立双元音按钮；复合核可按各音位库的说明保存为音段序列。尤其是越南语资料将向中核分析为双元音，本工具的序列表示不构成反对该分析的证据。声调和音高重音不在这些音段矩阵中。

矩阵包含明确的分析约定。例如，龈腭音采用舌冠＋舌背分析，儿化／r 色彩不预设单一发音构形。各语言变体、资料来源、特征赋值与限制见音位库说明及 [DATA.md](DATA.md)。

**参考音位库是分析起点，不保证适用于所有语言变体或研究问题。用于研究前，请根据目标语言、方言、资料和具体课题，自行核查并修改音位清单、音段及特征赋值。程序校验不能证明语言学理论正确。**

### 浏览器要求

Bourbon 完全在浏览器中运行，不需要安装，也不会上传数据。需要较新的浏览器：Chrome 或 Edge 80+、Firefox 74+、Safari 13.4+，并启用 JavaScript。音位库、设置和模板只保存在本机浏览器的本地存储中；换设备或清除浏览器数据前，请先导出 JSON 备份。

### 来源与许可

Bourbon 源自 **Whiskey Feature Switchboard，© 2018 Klaus Llwynog**。据其[原站说明](https://nnnnnnnn.info/whiskey/about.html)，Whiskey 按 GNU GPL 第 3 版或任何后续版本发布，作者欢迎在注明出处、不限制许可的前提下使用、修改和分享。源码仓库：[huanbin/pages](https://codefloe.com/huanbin/pages)。开发使用 GPT-6 Astra 辅助。

软件采用 **GPL-3.0-or-later**，见 [COPYING](COPYING)。随包字体保留各自许可证：[Charis SIL](https://codefloe.com/huanbin/pages/src/branch/main/static/bourbon/licenses/CharisSIL-OFL.txt)（© SIL International，SIL OFL 1.1）、[Bitstream Charter](https://codefloe.com/huanbin/pages/src/branch/main/static/bourbon/licenses/Charter-license.txt)（BITSTREAM CHARTER 是 Bitstream Inc. 的注册商标）、[Noto Sans SC](https://codefloe.com/huanbin/pages/src/branch/main/static/bourbon/licenses/NotoSansSC-OFL.txt)（SIL OFL 1.1，也适用于其改名子集 Bourbon Han）。本软件不提供任何担保。
