Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 12th Jun 2009 10:30 Edited at: 12th Jun 2009 10:51
How do you grab a word out of a sentance?

or how would you search for a word in a sentance?

RND Q

what are the snapshots for?can I delete them

If at first you don't succeed-Pause-Go to last checkpoint
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 12th Jun 2009 11:54
Quote: "what are the snapshots for?can I delete them"


They are just screen shots, they aren't needed.

Quote: "How do you grab a word out of a sentance?"

There are many ways. For a text parser system a year or two ago, I wrote a system that would go through a string character by character using MID$() and identified where the spaces were. Then it would load the strings between the spaces into an array using a combination of Left$() and RIGHT$(). Then you could just pick whatever word you need. My system would check each one against lists to identify if they were important, looking for verbs, correct words, nouns etc.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 12th Jun 2009 16:05
ya I did something similar with an equation style calculator, you would enter an equation like you would on a regular calculator, it would cycle through and find any parenthesis or operations using mid$() then compute the result

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 12th Jun 2009 20:54
Thanks,

I'll mess around with it.If I can't figure it out I'll ask.

If at first you don't succeed-Pause-Go to last checkpoint
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 12th Jun 2009 22:15 Edited at: 12th Jun 2009 22:19
This is what I got so far I'm glad I could work it out on my own

it was fun.I could probally shorten it somehow.Tell me if you see

anything I could make better.


If at first you don't succeed-Pause-Go to last checkpoint
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 12th Jun 2009 22:25
i havent tested it but as i was looking thru i realized something small you could do make reading the code easier

you have:



but i was thinking you could shorten that to:



adding strings basically adds the second (l$()) to the end of the first (wordS(a))

so as long as at the start of the loop word$(a)="" then this will work

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 12th Jun 2009 22:42
thanks,
did'nt think about that.I thought thier would be a better way to do that.

If at first you don't succeed-Pause-Go to last checkpoint

Login to post a reply

Server time is: 2025-05-15 13:04:00
Your offset time is: 2025-05-15 13:04:00