You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the video https://youtu.be/F8F422GldwY, I could reproduce the same behaviour but I really didn't understand why the reverse of the Alphabet worked in the InsertBrackets rule.
For instance, if I got it right, the InsertBrackets will be looking for the sequence hg in angha? I suppose there is some hidden interaction between the @-> and the .r operator not described in the video.. Am I missing something?
No hidden interaction. The rule is compiled as left-to-right, then the resulting transducer is reversed (yielding right-to-left longest-match). The alphabet transducer is also reversed to make it all work. The alphabet could have been defined explicitly like the below (without reversal):
def Alphabet [a | g | n | {gn} | {hg}];
def InsertBrackets [ Alphabet @-> %} ... %{ ].r;
Following the video https://youtu.be/F8F422GldwY, I could reproduce the same behaviour but I really didn't understand why the reverse of the Alphabet worked in the InsertBrackets rule.
For instance, if I got it right, the InsertBrackets will be looking for the sequence
hg
inangha
? I suppose there is some hidden interaction between the@->
and the.r
operator not described in the video.. Am I missing something?The text was updated successfully, but these errors were encountered: