Computer Science Canada making turing find words |
Author: | iop [ Sat Jul 17, 2004 11:07 pm ] |
Post subject: | making turing find words |
i want to create a bot that can talk to people. for that i need turning to get input, then find words in that input that will tell it what to do. how can i make turning look for words in user input? |
Author: | Tony [ Sun Jul 18, 2004 12:23 am ] | ||||
Post subject: | |||||
turing test eh? after you're done reading the very informative link... ![]() you can separate a sentance into individual words using substrings as in
obviously white spaces are flags and you get individual words between them. To find where " " is located, you use index() function
|
Author: | iop [ Sun Jul 18, 2004 12:46 am ] |
Post subject: | |
doesnt turing have like a scan command or something that looks over inputed data for whatever its looking for? |
Author: | AsianSensation [ Sun Jul 18, 2004 9:02 am ] |
Post subject: | |
m...........yeah, like tony pointed out above, index is the function you would be using, how well it works would depend on your creativity and skill at string manipulations really. |
Author: | Tony [ Sun Jul 18, 2004 9:53 am ] | ||
Post subject: | |||
yeah... instead of breaking the string up into individual words, you can search for an occurance of the substring directly.
ofcourse it will result true for any occurance of substring, even if its *tony* a solution would be to add whitespaces to the search " tony " but that doesn't work for the first and last words inputed. So you'd have to be creative. A solution would be to add such whitespaces yourself. as AsianSensation said : it comes down to your creativity and skill at string manipulations |
Author: | DanShadow [ Mon Jul 26, 2004 6:48 pm ] | ||
Post subject: | |||
hmm...this is my way of finding a word in a string:
I dont have Turing on this computer, but I believe that code should work. But I guess the 'index' command is better... |
Author: | Tony [ Mon Jul 26, 2004 7:22 pm ] | ||
Post subject: | |||
hah, you just rewrote the index function ![]() ![]()
![]() this way tony and blah_tony_blah are different things ![]() |
Author: | DanShadow [ Fri Jul 30, 2004 8:57 pm ] |
Post subject: | |
aww! Lol, I didnt even know of the index function before I created that. Well, I guess thats cool. ![]() |