Hi,

the semantics of the match in the implementation is not as
straightforward as I thought. The fix will take some time.

I would advise that you use two rules for optional leading rule elements
for now:
"a" "b" "c"; // equal to "a"? "b" "c";
"b" "c"; // maybe with a -PARTOF()

Additionally, you could use dynamic anchoring in order to change the
matching direction. Here, the rules do not start with the first element,
but choose the optimal element by a simple heuristic.

Best,

Peter


On 23.05.2013 13:30, Peter Klügl wrote:
> Hi,
>
> On 23.05.2013 13:09, armin.weg...@bka.bund.de wrote:
>> Hi!
>>
>> In Ruta 2.0.2-SNAPSHOT, rules with an optional first element do not work. 
>> The optional part seems to be mandatory. Using
>>
>> DECLARE Test;
>> "a"? "b" "c"{->MARK(Test, 1, 3)};
>>
>> on
>>
>> a b c x b c
>>
>> marks "a b c" (0, 5) but not "b c" (8, 11).
> Yes, this is a bug. Thanks for reporting this and I will fix it ASAP.
>
> In previous versions of the system, the optional part of leading rule
> elements was completely ignored. I must have missed that situation in
> the test cases since I rarely use string expressions myself because the
> implementation is still inefficient (will change soon).
>
> Best,
>
> Peter
>
>> Cheers,
>> Armin

Reply via email to