Re: transforming sentence to list



Just relax during your holidays...

sentence_to_list(Sentence, [Head|Tail]) :-
append(S, Rest, Sentence),
append(Word, [32], S), !,
atom_codes(Head, Word),
sentence_to_list(Rest, Tail).
sentence_to_list(Word, [Head]) :-
atom_codes(Head, Word).

Just works for well-formed sentences.

Cheers, M


"omargamil" <nicromonicon@xxxxxxxxxxx> ha scritto nel messaggio
news:ad55144a-4d99-47fb-a568-3336ad4e649c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hey all :) i was hoping you could help me with this problem...i want
to transform a sentence to a list..
i.e:if the input sentence is this:"tom is ironing the shirt"
then output is:[tom,is,ironing,the,shirt]

i'd REALLY appreicate your help on this..my final exams are due next
week

thanks in advance :)


.



Relevant Pages

  • 3936 Trudeau St
    ... the disk will relax near the difficult tail. ... blind male rarely threatens Saad, ...
    (sci.crypt)
  • Re: RSA Challenges
    ... transform. ... She can comprise once, relax there, then arrange ... till the move from the north-east. ...
    (sci.crypt)