def-gthill / lexurgy

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

Feature Suggestion: A rule that runs after each rule #49

Closed bigyihsuan closed 1 year ago

bigyihsuan commented 2 years ago

I would like to be able to define a rule that runs after each rule is run.

I propose the global keyword, or some other keyword, that can modify a rule (like propagate or feature/class filters).

Consider the following example:

insert-a:
    * => a / $ @C _

f-gem:
    @F$1 * => $1 $1 / @V _ @V

no-cc global:
    * => ə / @C _ @C

The no-cc rule will run after each rule. So, a word like ksen becomes:

ksen
(insert-a) => kasen
(no-cc)    => kasen    # no change because CC condition was not met
(f-gem)    => kassen
(no-cc)    => kasəsen

Such a global rule could allow for constant features, such as a tonal language forcing tones on any new vowel that appears.

def-gthill commented 2 years ago

I like this idea. I can't promise when I'll get to it, but I've got it in the queue.

def-gthill commented 1 year ago

Lexurgy 1.1, released today, features "cleanup rules" that do this. Thanks for the suggestion!