sanskrit-lexicon / csl-websanlexicon

0 stars 1 forks source link

change to display of <lang...> #8

Open funderburkjim opened 4 years ago

funderburkjim commented 4 years ago

A recent change to the 'yat' dictionary changed a greek tag <g> to <lang n="greek">. The display then appears as: image

Despite the Greek text being provided, the display puts in the '(greek)' notation. The intended use of this '(greek)' notation is to indicate that there is Greek text in the dicitionary (i.e. the scanned images) which has not yet been coded.

So the objective here is to find how to remove the (greek) notation for yat.

Similarly, Greek in mw72 has recently been finished, so we don't want the (greek) notation there. Similarly for the (1) instance of Greek in the STC dictionary.

funderburkjim commented 4 years ago

basicdisplay in csl-websanlexicon

The (greek) notation is currently added within the module csl-websanlexicon/v02/web/webtc/basicdisplay.php (at about line 423). Here is the change:

--- a/v02/makotemplates/web/webtc/basicdisplay.php
+++ b/v02/makotemplates/web/webtc/basicdisplay.php
@@ -423,16 +423,8 @@ public function __construct($key,$matches,$filterin,$dict) {
     // nothing special here  Greek remains to be filled in
     // Depends on whether the text is filled in
     $n = $attribs['n'];
-    if (in_array($this->dict,array('pwg','mw','pw','wil','md'))) {
+    if (in_array($this->dict,array('pwg','mw','pw','wil','md','yat','mw72','snp','stc'))) {
      # nothing to do.  Greek (and other) unicode has been provided.
-    }else if ($this->dict == 'mw72') {
-     $empty = $attribs['empty'];
-     if ($empty == 'yes') {
-      # placeholder required
-      $this->row .= " ($n) ";
-     }else {
-       # no placeholder required. nothing to do
-     }
     }else {
      # put a placeholder where the greek, arabic, etc. needs to be provided.
      $this->row .= " ($n) ";

remove special 'mw72' case in basicadjust

Since the mw72 dictionary had for a long time some Greek text filled in and some not filled in, logic was added in basicadjust.php to add special markup for the not-filled-in instances. In the following change, I just commented this out. Note that the logic to recognize this situation for mw72 in basicdisplay above.

   } else if ($this->getParms->dict == "mw72") {
-   $line = preg_replace('|></lang>|'," empty='yes'></lang>",$line);
+   # removed 10-31-2019, since Greek text now provided in mw72.
+   #$line = preg_replace('|></lang>|'," empty='yes'></lang>",$line);
   } else ...

removal of "g" element handler

In Yat, we replace the "g" element with the 'lang n="greek'. In basicdisplay, there is special logic to handle the "g" element, but it is no longer needed. So is removed.

-  } else if ( ($el == "g")&&($this->dict == "yat")) {
-   # no markup.  Should remove when yat.txt changes to "<lang>" markup
funderburkjim commented 4 years ago

installation of changes

Once the changes to csl-websanlexicon have been committed, the generate_web script needs to be applied. It is simplest to just generate the changes for ALL dictionaries, even though the changes will affect displays in only a few dictionaries because:

Also csl-apidev needs updating

There currently is an awkward inter-relation between csl-apidev repository and csl-websanlexicon repository.

This apidev_readme file describes the manual syncing. In brief, run the script sh apidev_copy.sh, and commit csl-apidev.

This syncing is required when there are changes in any of basicadjust.php, basicdisplay.php, or dal.php

gasyoun commented 4 years ago

Nobody would know how to fix other than you, Jim. So many fixes involved.

funderburkjim commented 4 years ago

Nobody would know how to fix other than you, Jim.

That's why I supplied so many details. I want others to know how to fix, so I am not a bottleneck to further developments.

gasyoun commented 4 years ago

I want others to know how to fix, so I am not a bottleneck to further developments.

Exactly. It's adorable to see the level of detail. At least we have a chance. What about doing a Skype call again?