Delphi - What Structure allows for SAVING inverted index type of information? -
delphi xe6. looking implemented limited style of search, edit field user come in business name looked up. need allow user come in multiple words, or part of multiple words. example, on business "first bank of kansas", user should able come in "fir kan", , should homecoming match. means inverted index type of structure. have type of list of each unique word, (document id, primary key id, etc, integer). struggling type of construction create this... have approximately 250,000 business names, have 43,500 unique words. word count vary 1 occurrence of word several one thousand (company, corporation, etc) have requirements...
1). assume user enters ban. need find words start ban. need homecoming bank, banker, etc... means whatever construction use, have able find ban , move next alphabetic entry... , maintain moving next until find value not start ban. eliminates type of hash structure, correct?
2). want fast. hash fastest, can't utilize this, correct? see requirement 1.
3). each entry in construction needs able hold list of integers. if end going linkedlist, each element has hold list of integers.
4). need able save , load structure. don't want have build each time utilize it.
whatever end with, appears have nested structure, higher level list (linkedlist?) each node beingness integer list.
what looking for? commercial product use? outlook, etc have search capabilities.
every word linked specific set of ids, each representing business name, right?.
i recommend using binary tree info construction because effort searching log(n), quite fast. especially, if business names changing @ runtime, avltree should well, although it's quite work implement yourself. there should many ready-to-use units on binary trees on internet.
for each successful search word in tree info structure, should take list of ids , aggregate grouped entered word succeeded for. lastly step take aggregated lists of ids , intersection.
there should ids left fitting entered words. ids referencing searched business names.
delphi data-structures collections
No comments:
Post a Comment