funderburkjim / kosha-dev

Develop xml and html for anekArthaka and samAnArthaka Sanskrit dictionaries
1 stars 1 forks source link

List panel -- the meaning of 'L' #5

Closed funderburkjim closed 1 year ago

funderburkjim commented 1 year ago

In the CDSL dictionaries (such as MW, Apte, etc), the list pane (in the webtc1 display) is found approximately as follows:

This makes sense for the CDSL dictionaries, since the entries are, with some exceptions, in Sanskrit alphabetical order.

image
funderburkjim commented 1 year ago

But for harsa and similar dictionaries, this scheme does not work.

Currently we get typically just 1 element (the 'middle' headword) in the list pane.

image
funderburkjim commented 1 year ago

As I understand it, in the digitization (harsa.txt), L roughly corresponds to the verse.

<L>87<pc>156
<k1>deva-puM<meanings>rAjan,meGa,sura
<k1>nava-puM<meanings>navya,stuti
<k1>Bava-puM<meanings>Siva,saMsAra,BUti,sattA,Apti,janman
rAjYi meGe sure devo navo navye stutAvapi .
BavaH Sive ca saMsAre BUtisattAptijanmasu .. 90 ..
<LEND>

This one record of harsa.txt becomes 14 records of harsa.xml, one for each of the key1 values

deva,rAjan,meGa,sura
nava,navya,stuti
Bava,Siva,saMsAra,BUti,sattA,Apti,janman

Each of these 14 xml records has the same 'embedded' L-value (displayed as ID=87). e.g.

<H1><h><key1>deva</key1><key2>deva</key2></h> <body>
<hwdetails><hwdetail><hw><s>deva-puM</s></hw><meaning><s>rAjan,meGa,sura</s></meaning></hwdetail></hwdetails>
<entrydetails><entrydetail><s>rAjYi meGe sure devo navo navye stutAvapi .</s></entrydetail><entrydetail><s>BavaH Sive ca saMsAre BUtisattAptijanmasu .. 90 ..</s></entrydetail></entrydetails>
</body><tail><L>87</L><pc>156</pc></tail></H1>

That <L>87</L> becomes [ID=87] in the displays.

harsa.sqlite

The displays access the xml records via the database made from the xml. The sqlite.py program creates harsa.sqlite from harsa.xml. There is one database record for each xml record, and this database record has 3 fields:

 key VARCHAR(100)  NOT NULL,    <<<   from <key1>deva</key1> in the xml record
 lnum DECIMAL(10,2) NOT NULL,   <<<  from `<L>87</L>` in the xml record
 data TEXT NOT NULL   <<<< the full record from harsa.xml

This 'lnum' field is used ONLY for list display.

solution idea

Change sqlite.py so it computes the 'lnum' field differently. Namely,

Let's try this idea and see what happens!.

funderburkjim commented 1 year ago

version v1

This version of kosha-dev pushed to Github. And installed at sanskrit-lexicon; sanskrit-lexicon url for displays: https://sanskrit-lexicon.uni-koeln.de/work/kosha-dev/v1/apps/harsa/web/