Translating Lexurgy to tadpole
This chapter is based on the Lexurgy Cheatsheet and shows how to translate various Lexurgy constructs into tadpole. Lexurgy constructs are shown on the left, and the corresponding tadpole construct on the right. Titles on each column show the corresponding Lexurgy and tadpole terminology if there is a difference.
Getting Lexurgy Defaults
To get behavior close to that of Lexurgy, some configuration needs to be added that is not implicit in tadpole:
- If using modifiers without full symbol definitions, set
config fallback_feature_matrix = true;at the beginning of the file. If using modifiers with classes, optionally setsymbol class all;after class definitions instead. - If using symbol matchers with modifiers, set
config validate_symbols = true;either at the beginning of the file or locally where required using a#{with /* */}annotation. Also setsegmentation symbol;after all symbol and modifier definitions. - If using multi-character symbol definitions, set
segmentation symbol;after all symbol and modifier definitions. If using syllables, add a syllable rebuild hook at the beginning of the file:
hooks pre add { syllables rebuild; }
Basics
| Comment | |
|---|---|
| |
| Simple Change | Simple Rule |
| |
| Condition | Environment |
| |
| Exception | |
| |
| Condition and Exception | Environments |
| |
| Word Beginning | |
| |
| Word End | |
| |
| Insertion | |
| |
| Deletion | |
| |
| Collapsing Alternatives | |
| |
| Corresponding Alternatives | |
| |
| Alternative Environments | Multiple Environments |
| |
| Sound Class | Class Matcher |
| |
| Corresponding Sound Classes | Class Replacer |
| |
| Wildcard | |
| |
| Multi-character Symbol | Symbol Definition |
| |
| Note: Can also be implemented with classes, symbol definitions are more appropriate when using features. | |
| Escape | |
| not applicable; symbols are always quoted |
Combining Elements
| Sequence | |
|---|---|
| |
| Optional Element | |
| |
| Grouping | |
| |
| Repeated Element Any Number | |
| |
| Repeated Element At Least One | |
| |
| Repeated Element Exact Number | |
| |
| Repeated Element Range | |
| |
| Repeated Element Maximum Number | |
| |
| Repeated Element Minimum Number | |
| not available, use a range with any reasonably large maximum |
| Capture | Content Binding |
| |
Note: When used as a matcher, use exact match <_1>(!) to replicate Lexurgy behavior. | |
| Negation | |
| |
| Intersection | Conjunction |
| |
| Negated Intersection | Conjunction with Negation |
| |
| Unchanged | No-Op Rule |
| |
| Note: No dedicated syntax in tadpole. Shown is a typical non-matching rule | |
| Word Boundary | Between Words |
| |
Control Flow
| Simultaneous Expression | Simultaneous Rule |
|---|---|
| |
| Sequential Block | Sequential Rule |
| |
| Hierarchical Block | Fallback Rule |
| |
| Propagating Rule | Converging Rule |
| |
| Left-to-Right Rule | |
| |
| Right-to-Left Rule | |
| |
| Filter | Filter Rule |
| |
| Reusable Element | Macro |
| |
| Deferred Rule | Rule Macro |
| |
| Cleanup Rule | Hook Rule |
| |
| Cleanup Off | Disabling Hook Rules |
| |
| Deromanizer | Input |
| |
| Literal Deromanizer | Input with Segmentation |
| |
| Note: Semantics don’t fully match, additional scope annotations may be necessary for fully equivalent construct. | |
| Romanizer | Output |
| |
| Literal Romanizer | Output |
| Typically not applicable, may be equivalent to scope annotations on part of an output rule in some cases. | |
| Intermediate Romanizer | Output |
| |
Features
| Binary Feature | Feature Definition |
|---|---|
| |
| Note: Explicitly named default value may be required to fully match behavior | |
| Univalent Feature | Feature Definition |
| |
| Multivalent Feature | Feature Definition |
| |
| Feature Variable | Feature Binding |
| |
| Named Absent Value | Default Value |
| |
| Negated Feature Value | |
| |
| Diacritic | Modifier |
| |
| Diacritic, Before | Modifier, Before Position |
| |
| Diacritic, After First | Modifier, At Position |
| |
| Note: tadpole can also specify combining marks directly, but recommends using unicode escapes. | |
| Floating Diacritic | Soft Modifier |
| |
| Exact Match | Strict Match |
| |
| Inexact Capture Reference | Binding Matcher |
| |
Note: Default behavior of tadpole binding matchers matches this construct; Use When used as replacer, use | |
Syllables
| Explicit Syllables | |
|---|---|
| |
| Syllable Boundary | |
| |
| Negated Syllable Boundary | |
| |
| Note: Negated matchers always cover one symbol in tadpole, requiring slight modification. | |
| Syllable Element | Syllable Matcher |
| |
| Simple Automatic Syllables | Automatic Syllables |
| |
| Structured Automatic Syllables | Automatic Syllables |
| |
| Reluctant Onset | Automatic Syllables |
| |
| Clearing Syllables | |
| |
| Syllable-Level Feature | Syllable Feature |
| |
| Automatic Feature Assignment | Intrinsic Syllable Feature |
| |