Citation and Sutta Name Lookup Tools šŸ› 

I have two (now not so new) tools I would appreciate feedback on. Specifically:

  • Does anything break?
  • Does it work on your mobile device?
  • Does it do what you expect?
  • Can you understand how to use it?
  • Can you think of specific ways it could be more useful to you?

Citation helper

Screenshot:

The urls on suttacentral.net are actually very regular and if you could remember how, itā€™s possible to just type what you want in the url bar. However, there are lots of mistakes you can make and end up with nothing. This tool aims to take your attempt at a citation and turn it into a working link on not only SuttaCentral, but also SuttaFriends.org, DhammaTalks.org, and ancient-buddhist-texts.net. This is especially helpful because the last three donā€™t have complete coverage. I have created a table of the existing translations, so the lookup is happening from that. As new translations are added to those sites they will have to be added to the tool.

One particularly handy feature is being able to get an exact link to a Dhammapada verse. Just type dhp123 and it will automatically give you a link directly to that verse. However, Iā€™m not sure how stable that will be on the SuttaCentral links. (Bhante @Sujato, is the verse id #dhp123:1 a real thing, or just a temporary fix? There doesnā€™t seem to be a way to see that id on the front end.)

And you donā€™t need to use the mouse to select one of the results. Simply pressing return in the input field will open SCā€™s link in a new tab. Otherwise you can tab to the button you want to open.

Sutta name lookup

Screenshot:

This tool aims to take the name of a sutta either in Pali or in English (from the names in the Wisdom Publications editions) and give you citations/links to all possible suttas.

There are two modes: exact search and what I call fuzzy search. Exact requires your complete or partial search term to match exactly including diacritics. The fuzzy search ignores not only diacritics but also aspirated consonants (e.g. kh, gh, th, dh are treated as k, g, t, d) and even double consonants. Exact is much faster, but as it says, requires a precise search term.

The database for the Pali in this tool came from a 10 year old spreadsheet given to me by John K. I believe it was used in the construction of SuttaCentral. It includes alternate names for many suttas, but I canā€™t guarantee it has every possible alternative.

Big thanks goes to @Khemarato.bhikkhu for his help and especially encouragement. But as always, the responsibility for all errors is mine. And there may be many!!! This is my first real coding project. Iā€™m too embarrassed to show the code yet, but hope to do so eventually.

All feedback is welcome.

13 Likes

I agree that they should probably be combined.

There are enough ambiguous queries even in citation land (e.g. Dhp 4 might refer to ā€œHe abused meā€¦ā€ or to the Flowers chapter) that I think it worthwhile to add the concept of multiple results to the Citation helper. Perhaps like this:

Dhp Verse 4

  • link
  • another link

Dhp Chapter 4

  • more
  • links

or, of course, as a table.

2 Likes

So in that situation I wonder if the person entering ā€œDhp 4ā€ is actually uncertain as to what they are after. My guess is that while that citation may be ambiguous, for the person typing it in, they know what they have in mind.

To that end, Iā€™ve added a new warning message letting the user know that for the book they are working with, if they want the chapter, they can use the chapter flag:


(Itā€™s not working yet with SN and AN yet, though. Chapters work, just no alert message)

Iā€™m kind of averse to giving multiple options because I think outside of the Dhammapada, the citations are not actually that ambiguous. That is, as long as you know that itā€™s not a PTS citation.

Iā€™m working on the principle that as long as you give the user hints, itā€™s better to give them the option to type exactly what they want, kind of like a command line. For the most part though, typing in any correct citation will give you the correct link.

Can you or anyone else give an example of another ambiguous citations that are used (not just theoretically possible).

1 Like

There is @Gillian 's confusion here: Non-PTS sutta numbering systems?

Which you had helpfully explained, but which still confuses me :sweat_smile: But I guess it isnā€™t too bad: If I search for ā€œAN 10.196ā€ I can just click on both the SC and DT links and hope one or the other is the one Iā€™m looking for. :laughing: Doesnā€™t work if I was given the ATI number (ā€œan 10.208ā€) thoughā€¦ :confused:

Right. Iā€™m totally interested in hearing how people would want that problem to be solved. If the user knew which translator the citation came from, then they could just choose that translatorā€™s translation from the list and then they would be fine. The trick is then finding the same sutta by a different translator.

I guess as long as the user knew which translator it came from, then it would be possible for them to ask for the citation from the other translator. So then there could be two input boxes. One to convert an Ajahn T translation to Bhante Bodhiā€™s and one to do the opposite.

Just an initial look:

Nice, nice. Very Nice. Thank you so much for these tools.

UI/UX was a bit confusing for me initially. Iā€™m not a UI/UX expert but the following wouldā€™ve helped (me, anyway).

  1. Thereā€™s two bits of functionality, but there is no divider between them, so I thought they worked together somehow:

  1. the links suddenly appear when I start typing in. I would prefer it to be explicit that thereā€™s nothing available from the start and then fill in the links when available. This would also stop elements jumping down on mobile, which was a bit distracting:

  2. The greyed out of the radio buttons was a bit subtle for me:

  3. The example text in the input box wasnā€™t grey enough for me to realise that it was an example at first. Maybe put it in italics? Or maybe more explicit? ā€œfor example type: MN141ā€? Something like that. But I often have problems with that sort of thing.

1 Like

Itā€™s missing a few of the translators on SC, which seems odd to me since you included logic to default to Sujato anyway.

Relatedly, it gives incorrect links for texts that donā€™t have a Sujato translation, e.g. the Jatakas. Now, sutta central automatically redirects you from //suttacentral.net/ja100/en/sujato to //suttacentral.net/ja100/en/chalmers so itā€™s not a critical issue, but itā€™s odd.

Thanks so much for taking a look and giving specific feedback!

Yes, I played around with that. Iā€™m assuming you mean it should be lighter? It is already much lighter than the default. I thought that any lighter than it is and it would become an accessibility issue. How does this look:
image

Do you mean that it wasnā€™t clear why they were grayed out? The idea is that the only time you get to choose a layout is if you are picking Bhante Sujatoā€™s translation. What would you suggest to improve it? I figured that graying out options that were unavailable was fairly straightforward, but I guess itā€™s not.

Hmm. I can see that now. I had hoped that these labels would make it clear what was going on:
image

Do you think having a label above the bottom section would help? Something like ā€œDirect Website Linksā€?

I have considered wrapping the whole thing in tabbed sections where one tab would be for citation look up, another would be for searching for a Pali sutta name (i.e. the other app) and a third would be for the links section. But I really wanted the links area available for me to just click on when I wanted it. But you are right, they really are two totally different things. The links section is a way to avoid having to click so many times on the SC interface.

Right. I went back and forth on that. My thinking was the clearest way to indicate that nothing was available was ā€¦ to show nothing. For SuttaFriends.org and Ancient Buddhist text, there is going to be a lot of times when nothing is available. So having those constantly there saying nothing was available didnā€™t make sense to me.

But the jumping. I know. Iā€™m not so crazy about that. So, for now I have stopped the jumping by fixing the height of the link button area.

Thanks again for taking the time to give such specific feedback. If you could clarify the things I have asked about that would be wonderful.

Actually when you made your browser plugin to make Discourse be without hearts, it got me thinking of other ways plugins might enhance the suttasphere. I have the idea to try and turn these apps into a browser plugin either as a simple page as is, or what Iā€™d really like is to have it integrated into the browser bar. So instead of trying for a citation in the input box on the page, you would just type into the url bar and then the possible links would appear at the top of the drop down of suggestions. Seems like it should be possible.

It is in fact missing most of the translators. There are actually lots and lots of translators of English texts. But Bhante Sujato is the only one who has all of the major and most of the minor books. (He doesnā€™t have Vv, Pv, or Ja). Bhante Bodhi has a whole lot (and heā€™s popular) so thatā€™s why I included him.

The app works from a table of available suttas on each of the websites. To add all the translators to the interface would require keeping lots more information about what exists on SuttaCentral. And there is no mechanism for me to be informed when new ones are added. But I agree it would be a great feature.

You are absolutely correct that the app relies on SCā€™s functionality of falling back to whatever translation exists. My thought with the app was giving people a quick way to get to a translation, not generating a perfect link. Thatā€™s why I donā€™t default to the ā€œAllā€, aka SuttaPlex card. Because that would require an extra click to get to a translation. And there is only a very narrow selection of suttas (in the Vv and Pv) that wonā€™t redirect you to a translation because they donā€™t exist on SC.

Iā€™ve tweaked the instructions (in the info tab) to make the behaviour a little more clear.

For the Ancient Buddhist Text website I do actually have full links stored to the pages because they are done in words not just citations that can be calculated like the other sites.

It didnā€™t make sense to me to keep track of the five different translators of the Jatakas when SC would be able to get you to the right place anyway.

One thought that I had was to not display the link as part of the button. Having it there made it easier to troubleshoot, but it may not make sense to show it to the user as it does seem like it may be promising something that doesnā€™t exist.

Thanks so much for the feedback! Itā€™s really helpful.

Yes. Thatā€™s right.

Great!

No. I mean that it wasnā€™t clear that they were greyed out. To be fair, I was on my phone when I first tried it, so I was watching where to put my finger rather than what was happening in the UI.

:rofl: :rofl: I thought I had! ā€¦

So you have this:

I would prefer this:

I think even just a simple separator line (or different colour background for each) wouldā€™ve helped me understand they were two different functions. Obviously now that I understand it, I see it as two separate functions.

And I really like that.

I like my interfaces to be explicit, but I see what you mean. Maybe having them say ā€˜nothing availableā€™ is just cluttering it up. :woman_shrugging:

Effectively theyā€™re buttons, so they could be greyed out (and empty) while nothing is available I guess? It would make the interface more consistent? Maybe?

And very handy that is too!

To be clear, it didnā€™t take me long to work out what was going on, and once I had it was fine. I was just monitoring and recording my confusion when first presented with the interface.

Itā€™s a pleasure. I know how hard it is to get feedback on these things sometimes.

Sounds great!

2 Likes

Oh, gosh, Iā€™m thick. I didnā€™t realize that you had taken the time to make a real mockup so your label confused me. At some point I think I may have grayed the text out too, but obviously that wasnā€™t happening. Thanks so much. Thatā€™s super helpful. Fixed now.

Iā€™ll keep all your other comments in mind, especially as I try to integrate the Pali name lookup tool. Any thoughts on that?

These are awesome, congratulations!

It is currently not real, but it will be soon.

This is a somewhat complex issue that Hongda is currently working on. We want to make it so that ā€œrange suttasā€ (mainly dhp and the AN 1s and AN 2s, tho the concept could be extended further) can be accessed via different URLs. Normally on SC, of course, one URL = 1 resource. But in these cases there is no one, ā€œnaturalā€ way to present the texts.

So the aim with Dhammapada would be that normal navigation remains as-is (via vagga). But you can also navigation to a single verse (/dhp123) or to the whole Dhammapada on a page, with the verse linked (/dhp#123). Itā€™s a tricky one, because the concept of one sutta = one page is baked deeply into SC, and it affects a range of Page data. You can track progress here.

2 Likes

Thatā€™s wonderful. A prerequisite for criticizing any sutta website should be that you have to try and make one first. The number of tricky bits is almost limitless. Thanks for all your hard work. And the whole team, of course.

Initial thoughts on Sutta name look up. It worked exactly as I thought it would. Itā€™s fantastic!

I canā€™t imagine using the exact match, but itā€™s good to have it there. I would prefer not to have to choose a language - my brain works in both English and ā€˜sloppyā€™ (I mean fuzzy :wink: ) pali interchangeably, so ā€˜eitherā€™ might be an additional language option?

As far as integration goes I havenā€™t really thought about itā€™s feasibility, but one box that I can type whatever - number or name (incl regex) in whatever language, but also retain some ā€˜advanced levelā€™ for finer control. Would be awesome to have PTS lookup tool integrated in there too at some point?

I have a feeling that these tools are going to be hanging out in my open tabs pretty much constantly. Thanks once again for them!

2 Likes

This is awesome, Iā€™ve used it every day since - reading alternate translations which I would likely not have otherwise accessed. I donā€™t read pali, but this is a very easy way to get another angle.

Anyway, some feedback on a quirk - itā€™s not a problem for me, just an fyi. For a change, I thought to investigate a random Therigatha verse, Iā€™ve heard of them but never read anyā€¦didnā€™t even know where to find them(!). SuttaFriends > Theri > random verse took me to Thig11.1. Once Iā€™d read it, as an experiment, into the main search box of Citation Helper I entered Thig11ā€¦and the page goes completely blank. (repeatable, same behavior in Edge and Chrome).

Thanks again for providing this, sometimes just a few small words translated differently can open up a new understanding. :slight_smile: :pray:

2 Likes

Thatā€™s not a quirk, thatā€™s a bug! Thanks so much for letting me know.

Youā€™ve never read the Therigatha? My goodness you are in for a treat. So happy that SuttaFriends could help you.

1 Like

OK, should be fixed now. For anyone curious about why this was happeningā€¦

Books are either a collection of suttas or a collection of chapters with suttas in them. And on the three websites the plugin really deals with (at least by calculating the urls programmatically) that is the limit to the levels, even though traditionally there may be more internal grouping.

There is one unusual case though, and thatā€™s with the Thera and Therigatha. In those books there are a few chapters that, in effect, only have a single sutta. SuttaCentral and SuttaFriends deal with this by giving them the citation chapter.1. So for example, Thig11.1. But there is only one ā€œsuttaā€ aka Theri in that chapter. However, on DhammaTalks.org, this is sutta has the citation Thig11.

Right now you can get all three links, but the script will only give you SC and SF if you put in Thag11.1. But along the way, when you type ā€œThag11ā€ it will pop up DT. Not ideal, but at least now itā€™s not broken!

2 Likes

Iā€™ve done an overhaul of the name lookup tool. Also has a new link:
https://name.readingfaithfully.org/

As always, feedback is welcome.

I still have one major improvement to make so that the interface is more responsive.

1 Like

I am having trouble reading the darker font color on the dark background:

Screenshot from 2022-05-01 08-42-16

For example, I found it hard to spot that in an$ words ending with "am" the third character is a $, and not a s.

2 Likes

Oh, yes. Thatā€™s a good point. Also the font was smaller for some reason. Please tell me what you think now: https://name.readingfaithfully.org/

1 Like