Double search possibility

Home Forums Code, Bugs, Suggestions, Questions Double search possibility

This topic contains 3 replies, has 2 voices, and was last updated by  Delengroth 6 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26128 Reply

    Adrien

    This website idea is so great and you feel as lost as described by Borges in his short story.

    I don’t have any computer knowledge so I don’t know what my suggestion would imply from a technical perspective.

    Since when you look for a sentence you find it surrounded by non-sense it could be interesting to be able to look for two series of words together : you could see how the pages of the library connect both texts and see for example what might happen between Hamlet’s first and last lines on a single page.

    I also agree with a suggestion posted 2 months ago : it would be so nice to have other “languagize” possibilities than English. I think Borges would have been the first to ask for it!

    Congratulations and thanks for your work!

    #26130 Reply

    Delengroth
    Participant

    It actually wouldn’t be too difficult to implement that feature, given how the Library currently works. Right now, the search term you type in is surrounded by random characters to fill in the rest of the page, and that page is used to mathematically find where it would be located.

    I made a quick little mock up to show it in action. Copy the code from this page:
    https://pastebin.com/raw/eBsJxy4b

    And then go to this page to run it:
    http://www.runphponline.com/

    First delete all of the code already there, it’s just a “Hello World” example, then paste what you copied. On the right, switch to the “Output HTML” tab, then click “Run Code” on the left. Give it a second or two and it will generate a page. I made the search terms all caps and surrounded by 3 spaces to make it easier to spot on the page. You can keep clicking “Run Code” to generate more pages. If you want to edit the search terms, just change the “ONCE UPON A TIME” and “THE END” at the top of the code. Make sure to leave it inside the quotes or you will get errors.

    #26145 Reply

    Adrien

    Thank you very much Delengroth! It’s very useful

    #26149 Reply

    Delengroth
    Participant

    @Adrien, glad you like it! Good news, I was bored again and converted the code to HTML/Javascript so that you don’t need a PHP server to run it. It does the exact same thing with 2 added bonuses: 1) I added input boxes for the two searches with a button and 2) Because HTML/JS runs on your local computer, generating pages is instant 🙂

    You can find the code here:
    https://pastebin.com/S2hjwA92

    Click the “Download” button near the top, or just click this link for the same file:
    https://pastebin.com/dl/S2hjwA92

    If HTML files are associated to your browser, you should be able to just double click the file to open it. If not, create a new tab and just drag the file into the webpage area.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Double search possibility
Your information: