Help with string tokenization #2453
-
Hi I have an input relation where the fact looks like this:
I was trying to see if I can use the builtin string functors for this, but the documentation link seems to be broken. I checked Is this possible to do using Souffle? Can you please suggest where I should be looking? Sample code would be very welcome, as I am new to logic programming paradigm. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, Otherwise, by default Souffle only offers |
Beta Was this translation helpful? Give feedback.
Hi,
The easiest way, if that's an option, would be to prepare the input data to match your requirement.
Otherwise, by default Souffle only offers
strlen
andsubstr
. It is not very convenient but in association withrange
you can access individual characters of the input string and then recursively build sequences of consecutive characters. Something along this line.