Hi there all.
Lets say i have this sentence:
i want to buy some apples some meat and then some fresh bananas and also sparkling water.
Basically i need to split this sentence into parts so i can have a JSON array like this:
groceries : {"APPLES", "MEAT", "FRESH BANANAS", "SPARKLING WATER"}
i already know how to use the ^burst() function where you can code like this
^burst($_sentence "some")
and the sentence is splitted into facts based on the “some"string
What if i define a concept like this:
~delimiters(and and_some and_then also also_some)
and slpit the sentence based on all those words / phrases in the concept
Something like:
^burst($_sentence ~delimiters )
The above statement is not working.
Also i tried using burst sentence into words like this:
@1 = ^burst($_sentence)
$_length = ^length(@1)
^loop($_length) {
$_nextword = ^first(@1)
if ($_nextWord ? ~delimiters) { ... }
}
But it is not working since next word is a single word but in the concept i have some phrases.
Can someone help me achieve this?
Any method will be great. Thanks