Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Index_and_3waySearch

    Prepare a sorted index of the words in a document, put it in a select tag; use it for searching and make it roll automatically alongwith typical search box and dblclickking a word.

    This utility has been used in XP and IE8 for searching technical documents of text / html types and it does the following:

    a) encapsulates the file, opened from the input file-type-tag, into a <DIV>, adding <br> for line breaks of text files (an <IFRAME> messes up)

    b) collects all the words and compiles an INDEX of the words, sorting and removing duplicates

    c) the index is put into a <SELECT> element from where a word can be selected to search the whole document

    d) the normal search box is in an input element; an entry here rolls the <SELECT> and vice versa

    e) double clicking on a word selects and searches more of it in the whole document

    f) the double clicked word rolls into the other two modes of search

    g) the total number of founds is shown and the document scrolls to the first found

    h) mouse over a found shows its score

    i) the Next button scrolls to the next found

    j) the code includes indexOf routine for string prototype.

    The code is in the enclosed zip.

    Have a nice day.
    Attached Files Attached Files

  • #2
    New Coder
    Join Date
    Sep 2010
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Accumulation of the array of Index across files opened can be avoided by purging it when a new file is opened; also, the 'Found' value can be set to nothing when a new file is opened; the fix is to add the following into the opening function as below:

    function stt(fn){cnt=[];spn.innerText="";.....

    u jayakodi


  •  

    LinkBacks (?)

    1. 04-25-2014, 01:57 PM

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •