Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 search engine
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kyo11103




PostPosted: Thu Feb 20, 2003 2:32 pm   Post subject: search engine

How do I make a search engine in turing that would search for items in an array. Also the search engine must allow for inexact matches or misspell words. Shocked
Sponsor
Sponsor
Sponsor
sponsor
Izzy




PostPosted: Thu Feb 20, 2003 10:29 pm   Post subject: (No subject)

Here is an idea to get you going. 8)

code:
var a: array 1..10 of string
var word: string

a(1) := "hey"
a(2) := "hi"
a(3) := "swat"
a(4) := "turing"
a(5) := "school"
a(6) := "dog"
a(7) := "computer"
a(8) := "horse"
a(9) := "truck"
a(10) := "dragon"

put "Please enter the word you would like to search for"
get word

for i: 1..10
    if a(i) = word then
        put "This word is found in a(",i,")"
    end if
end for


This is an idea of how you could set it up. For providing leverage with the search try things like converting all the letters to the same case when checking if they are the same, etc. Anyway just play around with it a bit. Sorry gotta go to school

- Izzy
Tony




PostPosted: Fri Feb 21, 2003 1:18 am   Post subject: (No subject)

about mispelled words.. you can check for each letter in the string and output the results based on how many letters matched... Though if you add extra letter in the middle of the word, half the letters not gonna match
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
kyo11103




PostPosted: Mon Feb 24, 2003 11:57 pm   Post subject: (No subject)

Thanks Tony
the code really help alot
Tony




PostPosted: Tue Feb 25, 2003 11:36 am   Post subject: (No subject)

its Izzy you should be thanking, he posted the code. I just gave ideas on how to modify it to suit your needs.

Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: