I have written the following code:
for tumbling window $s in ("this", "is", "an", "example", "." , "this", "is", "another", "[", "example", ".", "]", "Another", "example", ".")
start $a when fn:true()
end $b next $r when ($b = "." and $r = "]") or $b = "."
return
<s>{$s}</s>
which returns:
<s>this is an example .</s>
<s>this is another [ example .</s>
<s>] Another example .</s>
but I am looking for
<s>this is an example .</s>
<s>this is another [ example . ]</s>
<s>Another example .</s>
I am playing around with if-clauses, but I am wondering whether there is a more direct way to force the end of a sentence at "]" when it is preceded by "." or at "." when there is no following "]". Thanks.
Ciao,
Giuseppe