I think Duane Morin wrote:
>
> I'm applying rules to a token stream that will include terms like "32%" and
> "401k". Since I've written a large number of Userfunctions to help me
> with the rules, and since those deal strictly with StringValue(), I'd like
> to treat all of my tokens like strings. Thus, I have two problems with
> the way Jess works "out of the box":
>
> 1) If I reference something like 401k in a create$ statement (i.e.
> (create$ what is in my 401k), then Jess breaks it up: what is in my 401 k.
>
> 2) Jess won't let me take the stringValue() of the 401 token - it keeps
> telling me "not a string".
You'll find that recent versions of Jess will do the conversion
automatically. Download a newer version.
>
> Where do I have to insert changes? *Can* I replace the tokenizer? I wrote a
> lexer that parses the tokens the way I want, and attempted to create a
> ValueVector consisting of a bunch of Value(x, RU.STRING) objects for each
> token. But...now what? How do I get that ValueVector recognized within
> my Jess program?
>
Use store() and fetch to transfer things between Java and
executeCommand-type things to avoid letting Jess reparse your nicely
tokenized multifields.
I have not done anything to allow the user to replace the tokenizer,
as it's very tricky, and filled with exceptions and special cases to
properly handle CLIPS syntax. The changes you proose might have bad
consequences elsewhere.
> Duane
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (510) 294-2154
Sandia National Labs FAX: (510) 294-2234
Org. 8920, MS 9214 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------