Split sentence

Oct 6, 2006 at 11:55am

Split sentence

Hi,

is there a simple way to split a sentence into words??
i have found an example how to import a textfile and split that text into lines but i can’t get it to split the line into seperate words.
then another question when i import a textfile….change the textfile and import it again, is it possible to let max look at the difference of the files?? so when my text in the file is:
“this is my text”
and i change it to:
“this is my text the second time”

is it then possible to let max tell that “the second time” is new.

Hope someone can help me out here..
Greetings Zeb

#28004
Oct 6, 2006 at 1:18pm

#85455
Oct 6, 2006 at 2:29pm

the [zl iter 1] worked great thanks the [zl] wasn’t known by me but it opened up a whole new way in max.
But i still have a question..when i use the [zl iter 1] my sentence “this is my sentence” gets split into seperate words.
What if i want to add something to every word??
Seperation is:
this
is
my
sentence

Convert it into:
1,this;
2,is;
3,my;
4,sentence;

thanks in advance

#85456
Oct 6, 2006 at 2:58pm

On 06-oct.-06, at 16:29, Joost wrote:

> What if i want to add something to every word??
> Seperation is:
> this
> is
> my
> sentence
>
> Convert it into:
> 1,this;
> 2,is;
> 3,my;
> 4,sentence;

This looks like the [coll ] text format… What are you exactly trying
to do?
In Max, the comma has a special meaning: it seperates 2 messages.
So the message “hello, world” is equivalent to the message “hello”
followed by “word”. In Max, you don’t manipulate strings but list of
symbols!

[sprintf ] may help you. [regexp too]. And of course [js], etc.

p

#85457
Oct 6, 2006 at 7:26pm

assuming you want to fill a coll:
“this is my sentence” -> listfunnel -> coll

Joost wrote:
> the [zl iter 1] worked great thanks the [zl] wasn’t known by me but it opened up a whole new way in max.

then wait until you find out about peter elsea´s LObjects ;)

p

> But i still have a question..when i use the [zl iter 1] my sentence “this is my sentence” gets split into seperate words.
> What if i want to add something to every word??
> Seperation is:
> this
> is
> my
> sentence
>
> Convert it into:
> 1,this;
> 2,is;
> 3,my;
> 4,sentence;
>
> thanks in advance
>
>

#85458
Oct 8, 2006 at 9:32am

Quote: Patrick Delges wrote on Fri, 06 October 2006 16:58
—————————————————-
> This looks like the [coll ] text format… What are you exactly trying
> to do?
—————————————————-

It’s right i want to put the sentence split in to word in to a coll. This worked as Pure said with “this is my sentence” -> listfunnel -> coll so that’s great.

What i’m exactly trying to do is make a text document float trough space. So there is a text document called text.txt this is read by max/msp and split in to words and these words are put in to a coll. From to call i substract the words one by one and let them start at the bottom of the window and let them float to the top of the window. When they reach the top they stay there.
But when the text document is changed the words added to the text documents start at the bottom floating up and the words who where already there are still at the top of the window…..
is this understandable??
So that’s what I’m trying to do.. :D any tips??

Ow…and i tried the “this is my sentence” -> listfunnel -> coll part but when it reaches the 45th word it stops. It looks like the coll is limited and I searched for this and I found something about a limitation of 256…what can I do about this??

Greetz zeb a max/msp newbie :D

#85459
Oct 9, 2006 at 7:47am

Joost wrote:
> Ow…and i tried the “this is my sentence” -> listfunnel -> coll part
> but when it reaches the 45th word it stops. It looks like the coll is
> limited and I searched for this and I found something about a
> limitation of 256…what can I do about this??

There might be a limit for the length of lists, but your listlength is 2
(after run through listfunnel…)
There must be a (conceptual) bug in your patch.
If you split your text in chunks and send them to listfunnel, each chunk
would start with the first index again and thus overwrite your coll
contents… just guessing…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#85460
Oct 10, 2006 at 8:34am

i tried some things with the listfunnel and coll and it is not the coll that is the problem but the listfunnel…
I added a sample and as you can see in the max window it doesn’t print the whole text from the text file. The “b” part isn’t printed. It lookes like there is a max of 256 characters on the listfunnel.. what can i do about this??

thanks in advance

#85461

You must be logged in to reply to this topic.