wu :: forums
« wu :: forums - wildcard searching in dictionary »

Welcome, Guest. Please Login or Register.
May 18th, 2024, 10:01am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: william wu, Grimbal, Eigenray, SMQ, towr, ThudnBlunder, Icarus)
   wildcard searching in dictionary
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: wildcard searching in dictionary  (Read 436 times)
cuckoo
Junior Member
**





   


Gender: male
Posts: 57
wildcard searching in dictionary  
« on: Sep 4th, 2007, 2:41am »
Quote Quote Modify Modify

I am doing research on string processing and come up the following problem:
 
D is fixed dictionary of words, you can preprocessing it to build some data structure as you like.
Now in the query phase, you are given a wildcard pattern, and you are asked to return all words in D that match with the pattern.
 
For example, if the wildcard pattern is "h**o", then you must return all words in D begin with 'h' and end with 'o'. "hello" is such a candidate.
 
Generally, you should build "index" on dictionary, not on the query pattern, since the latter changing from time to time.
 
Looking forward an elegant solution! Grin
 
 
 
 
« Last Edit: Sep 4th, 2007, 2:45am by cuckoo » IP Logged
sk
Newbie
*





   


Posts: 45
Re: wildcard searching in dictionary  
« Reply #1 on: Sep 4th, 2007, 8:16am »
Quote Quote Modify Modify

use a ternary search tree
 
http://www.ddj.com/showArticle.jhtml?documentID=ddj9804a&pgno=4
 
u can recursively look for any reg ex. Will work out the the details and post it.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board