Implementing the New Concise Pali English Dictionary

Thanks to the diligent work by @Russell over the past several months, we now have ready the first, very substantial, update to the Concise Pali English Dictionary.

Sadhu! Sadhu! :ribbon: :birthday: :sparkles:

This involved going through the entries from Gā€“N and checking the old dictionary against the much newer and more reliable Dictionary of Pali (DoP) by Margaret Cone. Changes consist of:

  1. Correcting mistakes in CPED, both in the entries and the grammar.
  2. Using the same conventions for grammar as in DoP.
  3. Adding extra meanings or terms from DoP that are found in the EBTs (non-EBT meanings and words were left out).

This is a very important update. It preserves the portions of the DoP that are of most interest to students of early Buddhism, and makes the ever-useful concise dictionary even more useful.

As for implementation, I would propose the following:

  1. CPED and NCPED are maintained as separate entities.
  2. We preferentially use the entries from NCPED instead of CPED.
  3. CPED becomes the fallback.

In other words, you never see both CPED and NCPED.

Let me know if you think this is reasonable.

As @blake developed the dictionary tools, it would make more sense for him to implement this, I think. If not, hopefully @vimala can do it.

I have proofed the text and marked the definitions using the same HTML style as for the recent updates for the PTS dict. This was much easier!

Basically it means that complex entries are marked up as nested lists. One difference between the two is that the PTS formats entries by default as paragraphs, and uses lists only when necessary. This was just a pragmatic choice, by preference it would be all lists. The NCPED, on the other hand, has all entries as lists.

(Incidentally, the classes for the lists are necessary to target them for styling; ideally we could drop them as they just duplicate the list ā€œtypeā€. Somewhat annoyingly, though, this runs into a problem when you have both upper-case and lower-case list types; CSS is case-insensitive so you canā€™t differentiate type=ā€œAā€ and type=ā€œaā€. If we can find a way around this we can drop the classes for lists in the dicts.)

What needs to be done with this is as follows:

  1. The spreadsheet needs to be properly HTML-ized (Iā€™ve only done the definitions)
  2. This includes the grammar; preferably Iā€™d like to do these as with the PTS dict, with abbreviations spelled our, and placed with suitable markup at the start of the entry (This is standard for dictionaries).
  3. Note that there is some extra information in various columns; I hope this is useful for correctly identifying forms.
  4. Apply magic.
  5. Rejoice!

Hereā€™s Russelā€™s file with my updates. This includes the non-HTML definitions, for reference only. In addition to the HTML, the updated definitions have various corrected typos and the like, so they should be used going forward and the old ones discarded.

NewConcisePaliEnglishDictionary_G-N.ods.zip (982.5 KB)

8 Likes

It would seem to me that it needs to be JS-ized instead.
@blake - I can do that unless there is more that needs to be considered.

The source files for the dictionaries are HTML, this should be the same.

The lookup tool is a js dictionary.

Weā€™re talking in circles. The current spreadsheet must first be converted to the appropriate HTML markup. Once the HTML file is ready, it will be processed by JS.

JS does not pull the data out of the html file automatically. There are JS databases here:
https://github.com/suttacentral/suttacentral/tree/master/static/js/data

The data has to also be incorporated into these files, otherwise the lookup tool will continue to use the old data.

Oh, okay, I wasnā€™t thinking of the lookup, but the dictionary. So we have two files, one for the lookup tool and one for the dictionary results page here:

In that case, both need to be updated.

But the HTML markup is richer and more semantic; and it agrees with the markup for other dictionaries. So shouldnā€™t we have just one source in HTML and transform it to JS?

Neat! Much thanks @Russell and the band!

2 Likes

I think JSON might be more the way to go here, but will leave that decision up to Blake.
Yes, we have 2 files right now. I can do that.

Is there room to have it translated fully into Portuguese? Please count on me. :slight_smile:

1 Like

If you want to make a dictionary in Portuguese ā€¦ sure, go for it!
All you need to do is make a spreadsheet with the words in one column and the meaning in another. If you want to be more precise, make it like the one Bhante attached above.

2 Likes

:anjal:

Dear Bhante @sujato,

Sadhu! Sadhu! Sadhu! May all Dhamma followers benefit from this endeavor!

I have received your e-mail and replied.

Hope everyone had a great vassa :joy:! Celebrate your good kamma to have been able to practice! Kathina is here :relaxed:!

with reverence and in mettā,

russ

:anjal:

7 Likes

is CPED being retained and maintained for the sake of the lookup tool because itā€™s slimmer than PTS PED?

Thatā€™s right. For 90% of cases, you just need the basic meaning of the word, and CPED is excellent for that.

We will update it to use the NCPED as that is completed, although that wonā€™t be finalized until the final volume of Coneā€™s dictionary is published.

Good news: Russellā€™s going to move on to the first volume of Cone, so that should be ready in a few months.

3 Likes

Coneā€™s third volume was supposed to be finished in 2017 last time I asked the publisher, so it should be soon

3 Likes

Oh good, we shall keep a lookout.

1 Like

OK. I need some input here because the file has many more columns than any of our dictionaries.
Is it OK if I just put entries like for instance ā€œgacchatiā€ like this:

<dl>
<dt><dfn>gacchati</dfn></dt>
<dd>
<ol type="1" class="decimal"><li>
<ol type="i" class="lower-roman"><li>(of people, animals, rivers, roads etc) goes; moves, walks; goes away, leaves; goes to (+ acc. or santike/santikaį¹ƒ etc); often with absol., e.g. ādāya ~ati, gahetvā ~ati, goes with, takes; pahāya ~ati, goes off without, leaves behind</li>
<li>goes to another existence, another birth etc</li>
<li>follows a course; follows a future course</li>
<li>goes to an activity; goes to do something</li>
<li>goes to in a sexual intercourse; has intercourse with</li></ol></li>
<li>goes to a state of condition; undergoes, reaches; obtains</li>
<li>relies on</li>
<li>the first person present is not rarely used to express an immediate or near future sense: I am going; I am going to go; we are about to go</li></ol>
</dd>
<dd class="grammar">pr. 3 sg.</dd>
</dl>

Iā€™m just not sure what to do with the other columns in the spreadsheet like: additions, CdoP page, regular form, stem, truncated form, ebt, etc.
I could put them all in <dd class=" ..."> at the bottom but it will probably show up in the dictionary.

And how to deal with the various grammatical forms of the words?

1 Like

We should keep @blake in the loop on this, as the maker of these tools, he has more idea what to do than I. But I can describe what is in the spreadsheet.

As far as the markup goes, we donā€™t use multiple <dd> in one <dt> (I think!). Instead just mark <dd class="grammar">pr. 3 sg.</dd> as a paragraph. And best to put this at the beginning of the entry; this is standard in dictionaries. For PTS dict I use

<p class="case">pr. 3 sg.</p>

I donā€™t like having the grammar info in abbreviated form. In the revisions for the PTS dict I spelled them out (eg SuttaCentral) where possible. With some find & replace we should be able to spell out most of the entries in NCPED without too much problem. There are some complex entries, however, which need to be handled carefully.

One detail I am not sure about is the use of ā€œmfn.ā€ This is essentially used for adjectives, as they are declined according to the gender of the relevant noun. So it doesnā€™t really mean ā€œmasculine/feminine/neuterā€, it means ā€œundefined genderā€, or better ā€œinherited genderā€. But I am guessing there is a reason why they donā€™t just use ā€œadjectiveā€; probably the category is broader and there are things that are not strictly speaking adjectives. Suggestions welcome!

Most of the extra columns can be safely ignored. They were just there as part of the development process.

The ā€œmeaningā€, ā€œebtā€ and ā€œsujato termsā€ columns should be ignored. Likewise the ā€œCDoPā€ page column, this is just a reference.

The main columns are the ā€œwordā€, ā€œgrammarā€ and ā€œHTML meaningā€.

The columns ā€œregular formā€, ā€œstemā€, ā€œtruncated formā€ are there as potential assists for the lookup. ā€œstemā€ and ā€œtruncated formā€ are probably useless and best ignored for now. ā€œStemā€ was an idea we never followed through. ā€œTruncated formā€ does what the JS lookup tool does anyway, slice off the end of a word. In principle, having a hand-curated list of such forms is more reliable than a machine-generated process, but I donā€™t think it has been developed sufficiently yet.

The role of the ā€œregular formā€ is the main entry or fallback for the various declined forms.

Checking the dictionary now, I see that Gabriel has not used this very much, preferring to use ā€œ(same as ā€¦)ā€ or ā€œ(see ā€¦)ā€ in the meaning column.

Perhaps the best approach would be to extract these from the meaning (or HTML meaning) column and populate the ā€œregular formā€ column, or put them in a new column. Fortunately Gabriel has been very consistent and clean with this, so it should be simple. For now, letā€™s assume we have a new column called ā€œmainā€. It should work something like this.

When I hover on a word, or see a result on /define/, I donā€™t want to see ā€œ(see xyz)ā€. I want to see the meaning of the word. So that should be there with the relevant grammatical info.

Letā€™s assume I look at garukatvā. This currently says ā€œ(see garukaroti)ā€. But we will have extracted this to the ā€œmainā€ column, which will just say ā€œgarukarotiā€. So when I search for or hover over garukatvā, it shows me the entry for garukaroti instead. However, since these are distinct grammatical forms, it should show me the grammar for garukatvā. In other words, the entry for garukatvā would be:

garukatvā
absol.
honors; venerates; esteems; treats as important

However, it is probably a good idea in such cases to indicate the more basic form. And letā€™s spell out the grammar too. So we have:

garukatvā
absolutive from garukaroti
honors; venerates; esteems; treats as important

This also solves an awkward problem with the entries, which is that such derived meanings are not properly declined in the entries. Technically speaking, we should have:

garukatvā
absolutive from garukaroti
having honored; having venerated; having esteemed; having treated as important

However it is a massive amount of careful work to do this for each entry, with little benefit. If we use ā€œabsolutive from garukarotiā€ it shows that the entry form is derived from another source, and should be adapted according to the appropriate grammatical case.

Now, in this case the existing ā€œ(see garukaroti)ā€ is redundant, for garukaroti already exists in the ā€œregular formā€ column. So whatever, we can filter out the redundancy.

In some cases it is more complex than that. In general, the principle should be similar to how CSS works, in that the more specific meaning should be preferred.

Consider the entry for gahÄ«ta (long Ä«). This says ā€œ(same as gahita)ā€ (short i). It also has gaį¹‡hāti as the ā€œregular formā€. In this case, it would be best to display the entry for gahita. They both have the same grammar.

In turn, gahita has gaį¹‡hāti as its ā€œregular formā€. There is no need to do anything about this, as gahita already has its meaning defined. It might be considered useful to have a link back to the ā€œregular formā€ from this result; but this is an enhancement.

Oh, and another enhancement: it would be nice to have a list of definitions for these grammatical terms, which displayed as a popup on the entries!

2 Likes

This is what is used in the cped.html now. Would you like me to change that in cped?

<dl>
<dt><dfn>gacchanta</dfn></dt>
<dd>going; moving; walking.</dd>
<dd class="grammar">pr.p. of gacchati</dd>
</dl>

I take it you mean ā€œRusselā€ ā€¦

Now the lookup tool (and cped in the dictionary results) has abreviated meanings. For instance right now it says:
'gacchati':["gam + a","goes; moves; walks."],

But when hovering over the word, you can click on ā€œgacchatiā€ and that takes you to the dictionary entry SuttaCentral

If I were to change the lookup tool to Russelā€™s update, it would become much too long.

A word like gacchanta is now listed in the lookup tool and dictionary pages as:
'gacchanta':["pr.p. of gacchati","going; moving; walking."],

While Russelā€™s update has (see gacchati). Changing that to the meaning of gacchati would again be much too long for the lookup tool and I feel that even for the dictionary pages, it might be good to keep the rendering of the existing cped in there as well.

So in short, I think it might be best to leave the lookup-tool as-is and just make a new html file called ncped.html with the comments/changes you have specified.
On the other hand, there are certain words, like garukatvā that do not appear in the lookup tool.
So maybe the thing to do here is to go over all the words that are not mentioned in the lookup tool and incorporate them. What do you think?


While working on this, I found another problem. For instance (converted to csv):
chetabba,fpp mfn.,,"<ol type=""1"" class=""decimal""><li>(see chettabba)</li></ol>"

But then you go to ā€œchettabbaā€ and there it says:
chettabba,fpp mfn.,chindati,"<ol type=""1"" class=""decimal""><li>(see chindati)</li></ol>"

So you end up here:
chindati,pr. 3 sg.,chindati,"<ol type=""1"" class=""decimal""><li>cuts; chops; cuts off; cuts out; inscribes</li><li>cuts down; destroys; removes</li><li>crosses (water)</li></ol>"

So, should both chettabba and chetabba be listed like this?:

chetabba,fpp mfn.,,"<ol type=""1"" class=""decimal""><li>cuts; chops; cuts off; cuts out; inscribes</li><li>cuts down; destroys; removes</li><li>crosses (water)</li></ol>"

chettabba,fpp mfn.,chindati,"<ol type=""1"" class=""decimal""><li>cuts; chops; cuts off; cuts out; inscribes</li><li>cuts down; destroys; removes</li><li>crosses (water)</li></ol>"


And what to do with things like:

`(see chindati); [quasi 4th class, in form identical with pass.; the meanings overlap], (intrans.) breaks, breaks off; dries up, comes to an end

or

the state of being a wife; marriage (see jāyā)

Do you want to have the full text of the word it refers to also in there, or just a link to the definition of that word?

Iā€™m wondering if it will not be easier to keep all the (see ā€¦) and then make the word a link to the respective definition instead.

1 Like

Yes. it doesnā€™t seem to be invalid HTML, but it is unsemantic. Multiple <dd. tags, I believe, should be used if there are multiple definitions of the same term, not for giving extra information for the same term. best use paragraphs within the dd.

You take it correctly!

As far as the details of the implementation go, I see the problem, but Iā€™m reluctant to say too much. I think we need @blakeā€™s input here, as I have no real understanding of how the logic of the lookup and so on work. It may well be that the tools need to be implemented differently.