def-gthill / lexurgy

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

Syllable features disappearing when inserting segment in non-initial position #45

Closed Mardikhouran closed 2 years ago

Mardikhouran commented 2 years ago

Same end result as #44, but different trigger.

.lsc file

Feature (syllable) +stress

Diacritic ˈ (before) [+stress]

Class vowel {a, i, u}
Class cons {p, t, k, x}

Syllables:
 @cons? @vowel @cons?

stress-assignement:
 <syl> => [+stress] / _ <syl> $

neutralisation:
 * @cons => x * / _ a

.wli file

katak
akatak

Results

ˈxa.xak
a.xa.xak

Expected

ˈxa.xak
a.ˈxa.xak

Remarks

Results are the same regardless of the placement of the stress mark (first, before, etc)

def-gthill commented 2 years ago

Can't you just use this?

neutralisation:
 @cons => x / _ a

Regardless, writing things in an over-complicated way shouldn't break the rules. I'll take a look.

Mardikhouran commented 2 years ago

I used the barest minimum of a MWE, because I encountered the problem when using features: rather than writing [cons +prenas $Place] => [nasal $Place -prenas -voice -WhateverConsFeatureIrrelevantForNasals], I used [cons +prenas $Place] * => * [nasal $Place], which shouldn't have me revise the rule if the segment to change gets another feature nasals aren't defined for.

def-gthill commented 2 years ago

Okay, that makes sense. And I appreciate the effort in distilling this down to a minimum example.

As a workaround while I get this sorted out, it seems to work if you switch the order:

neutralisation:
 @cons * => * x / _ a

Basically Lexurgy struggles whenever you use * at a syllable boundary, because it isn't clear which syllable it's supposed to belong to. Let me know if this change works for your actual case.

Mardikhouran commented 2 years ago

Results are the same for either [+prenas $Place] * => * [nasal $Place] or * [+prenas $Place] * => [nasal $Place] *. I will resort to the clunky -Whatever without null segments for the time being.

def-gthill commented 2 years ago

This is fixed in commit 0068789e6bd56e044247372730c338468101f7a3. Getting to your remaining bug report shortly...