def-gthill / lexurgy

A high-powered sound change applier
GNU General Public License v3.0
42 stars 5 forks source link

ltr "programming error" with filter #56

Closed AdamantConlanger closed 1 year ago

AdamantConlanger commented 1 year ago

Minimal example:

Feature type(consonant, vowel)
Feature (syllable) stress(*unstressed, stress)

Symbol C [consonant]
Symbol V [vowel]

Diacritic ˈ (before) (floating) [stress]

Syllables:
  C? V C? C?

rule-one [vowel]:
  [] => [stress] / $ _

rule-two ltr [vowel]:
  [unstressed] => [stress] / [stress] [] _

Input: CVCCVCVV

AdamantConlanger commented 1 year ago

for future reference in case the title gets changed: The problem occurs at rule-two, where it gives the error message "Rule rule-two encountered a programming error when applied to word ˈCVC.CV.CV.V (originally CVCCVCVV)". I've never encountered that error before (as far as I can recall; it's been a while.) Removing the left-to-rightness of the rule fixes the issue, as does removing the filter or just removing the entire rule. Interestingly, replacing ltr by propagate fixes it.

Also, the original minimal example doesn't trip up with input CVCCVCV, but if we make it rtl instead of ltr, it errors there too.

def-gthill commented 1 year ago

Good catch. A "programming error" means there was an error condition somewhere, but I haven't told the program what the error message should be for that condition. It's always a bug: either the sound changes should work, or the sound changes are invalid and you should get a real error message explaining why.

def-gthill commented 1 year ago

Fixed in commit 5753f3f1c9dc0ec9618b49c463936c28118be79e