- From: Graydon Saunders <graydonish@gmail.com>
- Date: Wed, 7 Sep 2022 18:05:18 -0400
- To: public-ixml@w3.org
- Message-ID: <CAO3ciQH-WqsLDzLDNx0grhFgiu5TF6jhyAH1HM+vcCuBLz5RsQ@mail.gmail.com>
Hello -- I am coming to the opinion that the answer is "you can't do that with an ixml grammar", but perhaps I'm missing something. Given an input sentence: delete the rest of the line and delete line 6 and insert “this; and that; and the other thing”. I want to have three results; two that start with delete and one that starts with insert. Using whole = (delBlock|insBlock)+,last,NL. delBlock = 'delete',space,(word,space)+. insBlock = 'insert',space,(word,space)+. last = word. -space = [Zs],[Zs]*. word = [L;P;Nd;Sc]+. -NL = -#A. I get <whole ixml:state="ambiguous" xmlns:ixml="http://invisiblexml.org/NS"> <delBlock>delete <word>the</word> <word>rest</word> <word>of</word> <word>the</word> <word>line</word> <word>and</word> <word>delete</word> <word>line</word> <word>6</word> <word>and</word> </delBlock> <insBlock>insert <word>“this;</word> <word>and</word> <word>that;</word> <word>and</word> <word>the</word> <word>other</word> </insBlock> <last> <word>thing”.</word> </last> </whole> With the two deletes lumped together. My reaction is to look for a way to make the matching non-greedy (I haven't found one) or to define "word" as "anything but this specific string". (Fairly sure that's impossible in ixml.) Is there a way to disambiguate this and guarantee that each delete or insert will start a block? Thanks! -- Graydon Saunders | graydonish@gmail.com Þæs oferéode, ðisses swá mæg. -- Deor ("That passed, so may this.")
Received on Wednesday, 7 September 2022 22:05:42 UTC