Pālifinder: a prototype search engine written in Rust

Hey folks,

Thanks for all the work that’s gone on while I’ve been on retreat. You’ve certainly been busy!

So I made a thing:

The readme covers most of what you need to know.

Down the line this might evolve into a new search backend. Single node, no sharding, no replication, single binary in a scratch container.

Along the way I’ve learned a whole heap of stuff that’s applicable to ArangoSearch and ElasticSearch too.

Have a look, happy to hear your feedback.

5 Likes

I was only able to extract a stem for about half the terms.

So, in the DPD DB, you have to look at the dpd_headwords.inflections column for the list of textual forms for terms and compounds. For sandhi, you have to look at the lookup.lookup_keycolumn and then map the sandhi to words via the deconstructor. Some tokens have multiple possible parses, so you’ll have to figure out how to handle that…

Thanks for taking the torch :flashlight: :grin:

5 Likes

Keep in mind that it’s a prototype. Not knowing Pali, I just took a stab at it. I’m not sure how much time I’ll have over the coming months, but I may look into improving stem extraction. Or else someone can do the hard work for me. Just grab the SQLite database and check it out.

You can see the extraction code here:

The dpd_headwords table has a stem column. I’m using that.

sandhi?

Ignoramus here.

My pleasure!

3 Likes

I’ve created an issue for the stem extraction:

3 Likes

Normally there are spaces between words in our edition of the Pāli Canon. Sandhi is when there isn’t a space between the words because the sounds smoosh together:

In those cases, you need the dictionary to help you split the sandhi into its component words.

2 Likes

Ahh! Well, if there’s a defined algorithm it wouldn’t be hard to introduce.

Could be a separate token filter…

2 Likes

With DPD, the algo is to use the lookup table :blush: Unfortunately, some sandhi compounds have a couple different ways of being split :sweat_smile:

2 Likes

Well, @Khemarato.bhikkhu,

Do you have any interest in continuing with the Snowball algorithm, or shall we just try and perfect the dictionary token filter?

Perhaps we can pull the same trick with ArangoSearch - use the stem table in a token filter.

Big caveat though, it’s going to be a lot of work to get this into production.

2 Likes

Not imminently. I have a few other projects at the moment. But if there’s interest I can dust it off and give it a more serious go maybe sometime next year?

You can say that again! There’s a huge difference between a quick prototype and something production-ready!

2 Likes