Page 1 of 1

QS-Use of universal class (**) in pattern action code - Bug?

Posted: Wed Nov 18, 2009 10:02 am
by intelcom
Hi!

I have been developing the rule sets for some time now and never had problems using universal class. For the first time now I need to use ** in the middle of the pattern and I am experiencing problems.

My pattern:
*T | ** | ^ | / | ^ | F

T= Street type
F = Floor

I am trying to identify the floor here (operand [3], [4], [5] and [6]), and I am not interested in operand [2] as this can either be empty (null) or contain some tokens.
The pattern it is not being recognized by QS. I would expect this to work just fine, but nothing happens.

I changed my pattern to
*T | ** (1:1)| ^ | / | ^ | F
and it worked. But then I need to have at least one token between T and first ^,and that is not always the case.

Anyone familiar with this issue and knows what causes it? Could this bee a bug?


Amra

Posted: Wed Nov 18, 2009 3:55 pm
by ray.wurlod
Could you just look for ^ | / | ^ | F at the end of the record plus a condition that street type is non-empty?

Posted: Wed Nov 18, 2009 5:59 pm
by stuartjvnorton
I would have expected your original pattern to work, but how about using 2 floating specifiers?

*T | *^ | / | ^ | F


Or, as Ray said, why not just look for the ^ | / | ^ | F at the end?
The only reason you would need something as specific as the full pattern for something like floors is if the preceding tokens somehow changed the context of the part you're actually looking for and you needed to parse differently for that specific situation.