tags:

views:

10

answers:

1

Hi, I am trying my hands on swi-prolog in win xp. I am trying to understsnad how to split a sentence in prolog into spearate atoms.

Ex : Say I have a sentence like this :

"this is a string"
Is there any way to get individual words to get stored in a variable?

like :

X = this
Y = is
....
and so forth.

Can anyone please explain how this works?

Thanks.

A: 

?-split("this is a string"," ", Out).

Out=["this","is","a"," string"]

Min2liz
split in not defined
JPro