blekerfeld / donut

Donut, dictionary toolkit
MIT License
9 stars 3 forks source link

Two level compiler should have a way of back reference. #11

Closed blekerfeld closed 7 years ago

blekerfeld commented 7 years ago

VOW_CON_+.CON=> will ditch the second consonant, but right now that can be any consonant. What if it only needs to be removed if it is the same as the match in the middle context? For this a backreference to the match should be introduced.

blekerfeld commented 7 years ago

Back referecing is now possible regarding matches on the left side of the middle context. Meaning that this works:

VOW.(CON).+_(1)_=>

Capturing is done by placing the context between brackets, referencing to the same match is done by (number of group). This rule will only ditch the consonant, if it is the same! :)