This project was started sometimes in 2021 after a question about whether something was possible. Turns out it mostly was. The question was if it was possible to create a search function that took the works of Thomas Aquinas (lifted, presumably with permission) fram https://aquinas.cc and allowed the ser to search for references til the books of the Bible. This sounds like a straight forward task, but there are a few wrinkles; The books are referenced in a lot of different ways, both in the original latin and in the english translation. Chapters are written both as roman and arabic numerals. There are a lot of variation. The "search" in this project, is not really a search, it's a hash-table lookup. The hash is stored as a persistant memory structure using perls Storable module. The first hurdle in this project was to get the source material. Aquinas.cc uses a CMS with rather peculiar properties. If you just scrape the files using the liste in the menu, you will only get a fraction of the content. When you open a link (chapter) in the site, only a part of that chapter is initially loaded. As you scroll down the page, more text is loaded and the location (URL) will update with fractions following a period. To scrape the site, all these URLs will have to be fetched. I ended up using a script in the javascript console to do this. The method is as follows: - Open a page. - Open the javascript console - Paste the content of "javascript_to_run_in_console.js" and wait. - After some (a long) time, you will be at chapters end. Then you copy all the URLs listed in the console. This job is already done and the URLs are stored in auuinas_urls.txt. Should aquinas.cc get more chapters. You'll have to "scrape" them the same way. Now that we have all the URLs, the pages will have to be downloaded. "fetch.pl" does this. You can run it more that once, it will only download files we don't have. The files downloaded takes up a lot of space. Run the "compact.pl" script to remove unnecessary HTML. The compact script could be smarter, it contains a lot of duplicate content. See below. Next comes the "indexing". This is done by index.pl. This is where the real work is done. index.pl reads all the files in "source", makes sure to skip duplicate content and creates a massive perl hash (or actually several). The hash is then saved to aquinasindex.storable. The indexing produces a lot of output, so you can follow what it does (it also looks cool). The algorithm itself, you'll have to study from the code. THERE IS PROBABLY ROOM FOR IMPOVEMENT HERE. I'M NOT SURE WE'RE FINDING EVERYTHING! Finally the "search" (search.cgi), which is not a search, but a hash-lookup. This part is used in the browser. It uses the stored memory structure to give a list of all references we've fund and presents it to the user. Selecting a book and a chapter, will list the text blocks with the text hilighted (not working perfectly) and a link back to aquinas.cc The interface could use some love. Project originally created by Mathias Moe (mathias@jpg.no). Feel free to reach out, but I can't guarantee good answers. Should I do this again, maybe I'd do it in Elasticsearch with a plethora of stemming rules. IDK. Oslo, Oct 29 2026.