Re: transforming sentence to list
- From: "Mauro Di Nuzzo" <picorna@xxxxxxxxx>
- Date: Sun, 23 Dec 2007 14:16:31 +0100
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 :)
.
- References:
- transforming sentence to list
- From: omargamil
- transforming sentence to list
- Prev by Date: Re: transforming sentence to list
- Next by Date: Logtalk 2.31.0 released
- Previous by thread: Re: transforming sentence to list
- Next by thread: AMAST 2008 - Call For Papers
- Index(es):
Relevant Pages
|
|